文档

html-collab

试用

生成可被反复批注的 HTML 文档,给每个块打上稳定 ID,并附带结构化的反馈通道。

它能做什么

html-collab 输出的 .html 文件中,每个块元素都带有 data-cid,head 里嵌入一段 collab-data JSON 用来存放评论与编辑。三套流程:GENERATE 新建文档,按类型(p、h、sec、li、bq、pre、tbl)为块分配顺序编号,在具备文件读写能力的环境中写入 ~/Documents/html-collab/<标题>.html;READ 解析带批注的文件,先在对话里输出一段上下文块,把所有评论和编辑列出来,反馈记录因此永久留在聊天记录里;REVISE 原样套用编辑、回应评论,保留 originalCreated,把 comments 和 edits 清空。`/html-collab` 切换模式,加 `off` 后输出干净的展示型 HTML,不再带侧边栏、顶栏和脚本。

什么时候用它

  • 起草一份准备交给他人逐段批注的文档
  • 读取一份已批注 .html 上的评论和编辑
  • 根据审阅意见产出新版本
  • 导出干净的展示型 HTML,去掉审阅界面

技能文档

html-collab Skill

Use this skill when creating documents meant for iterative LLM–human review, or when reading/revising annotated html-collab files.


Commands

/html-collab or /html-collab on

Explicitly enable html-collab format for subsequent document generation. Equivalent to the default behavior — use when the user wants to be explicit.

/html-collab off

Switch to plain HTML mode for subsequent output. Use when the user wants a clean, presentation-ready document — no collab-data, no data-cid, no engine script, no sidebar. Typical use case: a finished document ready for an audience, not for further annotation.

Plain HTML output should be well-structured, self-contained, and styled — a document a reader can open directly in a browser with no toolbars or review UI.


GENERATE — Create a new html-collab document

When: User asks you to write, draft, or generate a document (and html-collab mode is on).

Steps:

  1. Start with the content of skill/assets/template.html as your base structure. If you do not have local access to this file, do not fetch it automatically — instead, ask the user to install the skill first (clawhub install html-collab) or provide the template file directly.
    • Output path (Claude Code): Write the generated file to ~/Documents/html-collab/-.html. Create the directory if it does not exist (mkdir -p ~/Documents/html-collab). This matches the default folder the browser Save dialog opens in, so all versions stay together.
  2. Fill `` with semantic HTML:
    • Use for the document title, for sections, for paragraphs,/`` for lists.
  3. Assign a data-cid attribute to every block element. Rules:
    • Format: - — e.g. p-001, h-001, sec-001, li-001
    • Types: p, `h` → , `sec` → , li, `bq` → , pre, `tbl` →
    • Sequential per type across the whole document (not per section)
    • Every block must have one; never skip or duplicate
  4. Populate collab-data meta:
    • title: the document title
    • originalCreated and lastRevised: both set to the current ISO timestamp
    • model: your model identifier
    • maxImageBytes: 51200 (default = 50 KB; do not change unless user specifies)
    • imageStorage: "base64"
    • comments: []
    • edits: []
  5. Document-level UI belongs inside the article, not in the framework.
    • #collab-header (the top bar with the Save button) and #collab-sidebar (the comment panel) belong exclusively to the html-collab engine.
    • If the document needs custom UI controls (e.g. a language toggle, a table of contents, a theme switch), place them inside `` — as a block at the top of the article or a floating element relative to #collab-main.
    • Putting custom controls in the framework header confuses human reviewers into thinking they're engine features.
  6. Output the complete .html file.

READ — Extract context from an annotated file

When: User provides a .html file that has been annotated by a human.

Reading efficiently:

  • Skip everything between <!-- collab:llm-skip:start --> and <!-- collab:llm-skip:end --> — this is engine CSS/JS you do not need to parse.
  • If meta.summary is present in collab-data, read it first for a compact structural index before parsing the full article.

Steps:

  1. Parse `` — this is the document text.
  2. Parse the JSON inside ``.
  3. Build and present this context block in the conversation before doing anything else:
[DOCUMENT CONTENT]
 here>

[HUMAN FEEDBACK]

Comments:
  · [] "" → "" [screenshot, , base64]

Edits:
  · [] "" → ""

Always output this block even if there are no comments or edits — it confirms to the user what you read. This conversation record is permanent: REVISE will clear comments and edits from the file, but the feedback is preserved here in the chat history.

  1. Image handling — per environment:

    • Bash tool available (e.g. Claude Code): For each image where sizeBytes > meta.maxImageBytes, compress it with a script and write the compressed base64 back to data, update sizeBytes, add "compressedBy": "". Example using Python/Pillow:
      python3 - <<'PYEOF'
      import base64, io, sys
      from PIL import Image
      data = base64.b64decode("""PASTE_BASE64_HERE""")
      img = Image.open(io.BytesIO(data))
      out = io.BytesIO()
      img.save(out, 'JPEG', quality=55, optimize=True)
      print(base64.b64encode(out.getvalue()).decode())
      PYEOF
      
    • Multimodal, no Bash: Receive the image as a visual input for understanding. In output, set data to null and add "compressedBy": null, "description": "".
    • Text-only model: Replace each image with [screenshot, KB, base64-omitted] in the context block. Do not include the raw base64 string.
  2. Where the same data-cid appears in both Comments and Edits: the comment's quote reflects the original (pre-edit) text. In REVISE, apply the edit first, then interpret the comment against the updated text.


REVISE — Produce a new version incorporating human feedback

When: After READ, the user asks you to revise the document.

Steps:

  1. For each entry in edits: replace the text of the corresponding data-cid block with revised verbatim.
  2. For each entry in comments: revise the content of the targeted block to address the feedback. For blocks with both an edit and a comment, apply the edit first, then address the comment.
  3. Add new blocks as needed: assign fresh CIDs continuing from the highest existing number for each type (e.g. if p-007 exists, next paragraph is p-008).
  4. Remove blocks as needed: retire their CIDs permanently — never reuse them.
  5. Output the revised .html file:
    • Updated `` content
    • All original data-cid values preserved (do not reassign existing IDs)
    • collab-data reset: comments: [], edits: []
    • meta.lastRevised updated to current timestamp
    • meta.model updated to your model identifier
    • meta.originalCreated unchanged
    • meta.versionHash set to "" — the engine recomputes this on next browser save
    • meta.summary set to "" — the engine recomputes this on next browser save
    • File output by environment:
      • Bash/file access available (e.g. Claude Code): Write directly over the original file. The conversation history preserves the feedback record; no extra file needed.
      • Chat environment (no file access): Suggest a filename using the document title and today's date — e.g. market-analysis-20260606.html. This lets users build a natural version sequence in their folder without manual renaming.


Reference

常见问题

默认把文件写到哪里?
在能访问文件系统的环境中,输出到 ~/Documents/html-collab/<标题>.html,目录不存在时会自动创建。
/html-collab off 有什么区别?
输出变为纯展示 HTML,不再带 collab-data、data-cid、引擎侧边栏和引擎脚本。
删除的块对应的 CID 还能复用吗?
不能。退役的 CID 永久保留,新增的块按各类型当前最大的编号顺延。
文档自身 UI 和引擎框架 UI 怎么分?
语言切换、目录、主题切换等自定义控件要放在 <article> 内部;#collab-header 和 #collab-sidebar 只归引擎使用。

相关技能

Aggressively produce self-contained HTML artifacts instead of Markdown for substantial agent outputs. Use when the user asks for a doc, plan, spec, report, r...

7 次安装

When the user asks to create an HTML PPT, presentation slides, or a deck, or convert an existing PowerPoint (.pptx) file, use this skill to generate a modern, responsive HTML presentation based on design system specifications (design.md). This includes Chinese requests such as 做PPT、幻灯片、演示文稿、网页版PPT、P

Produce a report, analysis, audit, RCA, review, or summary as a standalone HTML file with ONE consistent design. Use whenever the user asks for output "as HT...

作者 Yuan Chen

Create complete, source-grounded professional documents from existing materials, outlines, or templates, then generate, edit, review, or redline the final .d...

25 次安装

Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of 'Word doc', 'word...

3 次安装

Generate a beautiful, deployable HTML introduction page for any AgentSkill. Reads USAGE.md (preferred) or SKILL.md, parses name, description, and feature sec...

1 次安装