Install
openclaw skills install @ytisvibecoding/html-editor把任意静态 HTML 转成可视化编辑版:注入可拖动工具栏、颜色/字号/布局/风格面板、就地文字编辑、撤销保存导出干净版、元素与面板双向跳转、中英文 i18n、6 套场景风格 Prompt 一键复制给 AI 重塑样式。颜色面板数据驱动:扫 DOM 文字字符数 top 5 + 背景元素数 top 4 + 边框元素数 top 3,跨主题通用。适用于用户说可编辑版HTML、html可视化编辑、让html可编辑、样式面板、改html不写代码、所见即所得、点击直接编辑、把报告/页面/演示稿变成可调样式、给 AI 复制风格提示词。
openclaw skills install @ytisvibecoding/html-editor把任意静态 HTML 升级成「可视化编辑版」:文字可直接点开编辑,右侧面板可调颜色、字号、布局和主题预设,改完可导出新的 HTML。
python <skill-dir>/scripts/adapt.py <your-report.html>
# 输出:<your-report>-editable.html
指定输出路径:
python <skill-dir>/scripts/adapt.py <your-report.html> -o <your-report>-editable.html --force
依赖只有一个:
pip install beautifulsoup4
打开生成的 *-editable.html,页面会多出工具栏和右侧样式面板:
localStorage.hve_toolbar_pos,刷新仍在。navigator.language 自动识别,写入 localStorage.hve_lang。--text-purple 等)+ prompt 改名 + 直改 inline 为 var(),画面联动var(--xxx) 还原成 hex(剪贴到 Notion / 邮件 / 微信也不丢色),vars-style 块保留供完整网页渲染。HTML
↓ parse_css.py → 抽取 CSS 变量、font-size、background、color、选择器规则
↓ scan_dom.py → 扫描 DOM;v1.8 数据驱动统计 color/bg/border 使用频次(top-N)
↓ generate_panel.py → 生成颜色(top-N)/字号(≤10 收敛)/布局(7 项)面板 + 6 张 Style Prompt 卡片 + window.X 常量
↓ inject.py → 注入可拖动 toolbar、panel、editor-core.css/js、i18n 字典,标记 data-editable
↓ verify.py → 运行 sanity checks;失败则不产出坏件
不配置 API key 也能跑,启发式命名会兜底。若环境变量可用,会使用 LLM 给 CSS 变量生成更语义化的 label,例如「主色调 Accent」而不是「蓝色 Blue」。
支持的环境变量:
ANTHROPIC_API_KEYOPENAI_API_KEY<style>,且 :root 里有 5 个以上 CSS 变量;效果最好。把整个 html-visual-editor/ 目录放到对应工具可读取的位置:
~/.workbuddy/skills/html-visual-editor/~/.claude/skills/html-visual-editor/ 或项目级 skills 目录scripts/adapt.pypython /path/to/html-visual-editor/scripts/adapt.py <html>python <skill-dir>/scripts/adapt.py <skill-dir>/examples/demo-report.html --force --verbose
open <skill-dir>/examples/demo-report-editable.html
adapt.py 会自动运行 sanity checks,重点覆盖:
PAGE_ELEMENT_TO_PANEL row 字符级一致PRESETS 为 flat 格式,仅保留 original(v1.5+ 风格切换改为复制 prompt,不再 apply CSS)HVE_STYLE_PRESETS 包含 6 套场景风格 + palette + vibe 双语data-editable 覆盖率达标applyFallbackSize / applyFallbackLayout 等绕开核心引擎的 shim若检查失败,修源 HTML 或脚本,不要绕过检查。
html-visual-editor/
├── SKILL.md
├── README.md
├── LICENSE
├── assets/
│ ├── editor-core.css
│ ├── editor-core.js
│ └── panel.template.html
├── presets/
│ ├── builtin.json
│ └── llm_label_prompt.txt
├── scripts/
│ ├── adapt.py
│ ├── parse_css.py
│ ├── scan_dom.py
│ ├── generate_panel.py
│ ├── inject.py
│ ├── verify.py
│ └── utils/diagnose_css.py
└── examples/
└── demo-report.html
adapt.py,不要手写 panel。assets/editor-core.js,所有适配逻辑放在 scripts 和 window.X 常量里。