Install
openclaw skills install redline-annotate在 AI 生成的 HTML 网页上做可视化标注,把"点元素 + 写评论"的反馈通过本地 server + UserPromptSubmit hook 自动喂回模型,无需复制粘贴。当用户说"标注网页"、"给这个 HTML 加批注"、"/annotate"、或希望对生成的网页提具体元素修改意见时触发。
openclaw skills install redline-annotate把 AI 生成的网页变成"可批注文档",让用户像在 Google Docs 上 comment 一样直接在网页元素上提反馈。
核心架构:浏览器 ←(HTTP)→ 本地 server → 写 inbox 文件 → UserPromptSubmit hook 自动注入 → 模型 apply。用户只需点一次"提交反馈",没有复制粘贴动作。
何时执行:用户要求"标注 <文件名>"或"给 <文件> 加批注"。
步骤:
injector.sh <html-file>,它会:
inject.css / inject.js / __RL_CONFIG__ 注入到 </body> 前<原文件名>.annotated.html(不动原文件)open 在默认浏览器打开绝对不要:
何时执行:hook 自动触发——当 cwd 下存在 .redline-inbox.json 时,UserPromptSubmit hook 会把它的内容塞进 additionalContext,并附带 apply 指令。模型不需要等用户显式说"应用"。
步骤:
feedback-template.md 的渲染规则rm <inbox_path> 删掉 inbox 文件,否则下一次 prompt 会重复触发冲突处理:
injector.sh — 注入脚本,启 server + 注入资源 + 开浏览器inject.js — 标注层逻辑(toolbar/popover/sidebar/fetch 提交)inject.css — 标注层样式server.py — 本地 HTTP 接收端(POST /feedback → 写 inbox 文件)hook.sh — UserPromptSubmit hook(检测 inbox → 注入 additionalContext)feedback-template.md — JSON → 模型 prompt 的转换规则# 安装(自动配置软链接 + hook)
cd <skill-dir>/redline
./install.sh
# 卸载(移除软链接 + hook + 停 server)
./uninstall.sh
install.sh 会自动完成:
~/.claude/skills/redline 软链接~/.claude/settings.json 添加 UserPromptSubmit hook首次使用时 server 自动启动,无需手动运行。
{
"file": "output.html",
"timestamp": "2026-05-21T10:30:00Z",
"annotations": [
{
"id": 1,
"selector": "main > .hero > button.cta",
"elementHTML": "<button class=\"cta\">立即购买</button>",
"elementText": "立即购买",
"boundingBox": {"x": 480, "y": 320, "w": 120, "h": 40},
"comment": "颜色改成红的,再大 1.5 倍"
}
]
}
tail -f ~/.claude/redline/server.logpython3 server.py 7893CLAUDE_PROJECT_DIR=/path/to/project ./hook.sh(需先在该目录放一份 inbox)kill $(cat ~/.claude/redline/server.pid)