/commentable-html:commentable-htmlfrom commentable-html
Turns standalone HTML reports, plans, dashboards, or design docs into a commentable review surface. Reviewers select any element, leave inline comments, and export threads as machine-readable bundles.
Ships in commentable-html. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Version: 1.863.2
Review exact prose, code, diagrams, charts, images, widgets, or table cells; copy/export edit requests or AI discussions. Discussions work in the standalone HTML without a server or folder permissions.
After adding the marketplace, install into Claude Code with claude plugin install commentable-html@urikan-ai-marketplace or GitHub Copilot CLI with copilot plugin install commentable-html@urikan-ai-marketplace. Invoke from the CLI and Desktop app; output works with any agent.
USE THE NAMED TOOL/contract and reference below; do not hand-author fragile markup, skip validation, or invent a novel mechanism.
| Capability / trigger | Tested route / contract | Reference |
|---|---|---|
| New document, retrofit an existing HTML, or upgrade an already-layered file | tools/authoring/new_document.py creates from a fragment or Markdown-rendered HTML (Shareable, one self-contained file, is the only mode generated), sets identity attrs/kind meta/session stamp (--session-id / --agent, --no-session-id), validates, and suffixes colliding outputs unless --force is set. tools/authoring/retrofit.py injects the layer into unlayered standalone HTML (Shareable, like every route), preserves host content, accepts --brand, bakes highlighting, and validates before writing. tools/authoring/upgrade.py refreshes layered HTML; run finalize.py --strict afterwards so newer validator warnings are resolved. Choose --kind report, plan, flat slides, board, or generic; tools/authoring/recommend_kind.py only recommends report, plan, or flat slides (mismatch warning is advisory and never overrides your chosen --kind). Use --brand brand.json only with new_document.py, retrofit.py, or deck_scaffold.py to stamp validated --cp-* tokens and local data-URI fonts. | Retrofitting, Forward-compatible layout, Document layout |
Review surface for prose/paragraphs, table cells, headings, code blocks, KQL queries, diffs, Mermaid diagrams, charts, images, widgets, SVG figures and parts, draggable slots (data-cm-draggable), and document-wide comments | Runtime selection/comment model, author display names, flat reply threads, localStorage persistence, Copy all, embedded-comment export, Markdown/print exports, handled-id pruning with tools/authoring/mark_handled.py, and per-section Mark reviewed tracking with tools/authoring/mark_reviewed.py. | Interaction model, Copy payload format, Comment data shape, Commentable widgets |
| Anchored AI discussions and explicit edit commands | tools/authoring/review_threads.py: import, requests, reply. Questions authorize answers, not document edits; only explicit commands request edits using the transcript as context. | AI discussions |
| Highlighted source code with Copy buttons | tools/blocks/highlight_code.py for a block or tools/blocks/highlight_document.py for a document pass. | Code blocks |
| Runnable KQL block plus Run in Azure Data Explorer link | tools/kusto/kql_highlight.py; bare link only: tools/kusto/kusto_link.py. Every KQL block must be runnable unless explicitly marked code-only with --code-only / data-cmh-kql-no-cluster (CMH-KQL-08); prefer a real cluster such as help.kusto.windows.net. | Kusto query blocks |
| Unified code-review diff | tools/blocks/diff_block.py. | Code review diffs |
| Mermaid diagram and bare-source skip repair | Mermaid structural comment contract; tools/authoring/fix_skip.py marks bare source blocks cm-skip. | Mermaid diagrams |
| Chart.js chart | tools/blocks/chart_block.py. | Chart embedding, Chart recipes, Charts index |
| Commentable local images and chart-canvas comments | tools/authoring/inline_images.py --strict. | Images |
| Layout, structure, and prose conventions | tools/authoring/generate_toc.py --in-place, tools/authoring/wrap_sections.py, tools/authoring/doc_stats.py, tools/authoring/normalize_typography.py, sortable tables, callouts, ADO links, cross-references, --cp-* tokens, data-cm-density, private class prefixes, and reserved cmh-* names. | Document layout, Content conventions, Validation |
| Layered checklist | tools/checklist/checklist_scaffold.py; apply returned reviewer state with tools/checklist/checklist_apply.py. | Layered checklist contract |
| Editable notes fields | tools/notes/notes_scaffold.py; apply returned reviewer state with tools/notes/notes_apply.py. | Editable notes-field contract |
| Editable tables | tools/tables/tables_scaffold.py, tools/tables/tables_apply.py. | Contract |
| Real animated slide deck, presentation, pitch deck, slide deck, or convert this ppt | tools/deck/deck_scaffold.py is the only real fixed-stage deck creator; flat --kind slides is not a deck. It supports session stamps (--session-id / --agent, --no-session-id) and --brand. Use tools/deck/deck_theme.py list / apply, tools/deck/deck_fix_fonts.py, tools/deck/pptx_to_fragment.py, then tools/deck/deck_validate.py --strict. | Deck design playbook, Deck runtime interface contract |
| Output modes and export routing | Shareable is the only mode generated (a self-contained review file); Offline for zero-network handoff after Mermaid/charts render; Plain HTML / Markdown export when stripping the layer is intended. | Exports |
Before you hand a commentable-html document to the user - return its path, share it, save it, or call it done - finalize the saved file and pass strict validation, fixing everything reported:
python tools/authoring/finalize.py <file> [--toc --fix-skip --inline-images --images-base DIR] --strict
python tools/validate/validate.py --strict <file.html>
finalize.py bakes syntax highlighting, section cards, the doc-overview stats strip, and plain-ASCII typography normalization. For a deck, also run python tools/deck/deck_validate.py --strict <file.html>. If Python is unavailable, say EXPLICITLY that the file is unverified and run the manual checks in Validation.
Creation tools validate and surface warnings, but that never replaces the final finalize.py ... --strict plus strict-validate pass on the finished artifact.
tools/authoring/new_document.py --content, or retrofit existing HTML with tools/authoring/retrofit.py, then return a Shareable file with embedded comments.Defaults from a brief request. A request like "make me a commentable HTML for X, cover: " is enough. Every document is Shareable (one self-contained file), so there is no mode to choose: add a table of contents for multi-section reports, write polished sectioned prose, and use richer blocks only when they aid review. Use Export Offline when it must also survive with no network.
Use this skill for iterative plans, reports, dashboards, design docs, migration plans, and HTML artifacts where the user will leave feedback. Do not use it for short HTML emails, one-shot views, or sandboxed HTML where localStorage or clipboard APIs are unavailable. Plain HTML is valuable for rich artifacts, as described in https://claude.com/blog/using-claude-code-the-unreasonable-effectiveness-of-html; this layer adds in-artifact review and structured handoff.
Use the upfront tool index to choose the tested route. In short: new_document.py creates a new document from a fragment, retrofit.py wraps unlayered standalone HTML, upgrade.py refreshes an already-layered file, and deck_scaffold.py is the ONLY route to a real fixed-stage deck. --key auto derives a stable non-demo key; explicit keys must be unique per document on the same origin. --label becomes data-doc-label, only the basename of --source becomes data-doc-source, and --kind is required (report, plan, flat slides, board, or generic). report and plan need a top-level title; run tools/authoring/recommend_kind.py <fragment-or-html> [--kind <chosen>] first when the kind is unclear.
Mode decision: none for a NEW document - Shareable is the only mode generated, and it is what peer review needs. Offline is for zero-network handoff after diagrams and charts render; Shareable loads Mermaid/Chart.js from a CDN, and Export Offline downloads what it inlines once, hash-verified - the export needs network, the file it writes none. Shareable != offline. A tool or headless browser cannot read browser localStorage; if the user already commented in the browser, use the in-page Export as Shareable button, or Export Offline after rendering.
Keep reviewable content inside the live #commentRoot with a unique non-demo data-comment-key; python tools/validate/validate.py --strict <file.html> rejects duplicate roots, demo/example keys, and hidden commented roots.
Use cm-skip only for host chrome and bare mermaid source blocks; python tools/validate/validate.py --strict <file.html> warns when normal code blocks would become non-commentable.
A valid document has five layer regions in order: CSS, HANDLED IDS, EMBEDDED COMMENTS, COMMENT UI, and JS, plus one configured content root:
<main id="commentRoot" data-cmh-content-root data-comment-key="..." data-doc-label="..." data-doc-source="...">
...content...
</main>
Use the tools rather than manual region editing. If manual fallback is unavoidable, follow Forward-compatible layout and Retrofitting.
When Python is available, use the matching helper from the upfront tool index for KQL, diffs, code highlighting, charts, table of contents, sections, doc stats, Mermaid cm-skip, local images, typography normalization, layered checklists, and editable notes. For authoring rules that do not have a tool, follow the linked reference: use cmh-callout variants and cmh-lede for asides, keep private class prefixes for custom components, reserve cmh-* names for the framework, use stable heading ids, add nav.cm-toc for roughly four or more sections; Only direct data-cm-part children of a slot are movable.
You MUST finalize and strict-validate every HTML you produce before handing it off, saving it, or returning it - no exceptions. Run python tools/authoring/finalize.py <file> --strict (it bakes syntax highlighting and runs the assembly steps in order, then validates) followed by python tools/validate/validate.py --strict <file.html>. --strict fails on warnings too, so fix every issue it reports until the run is clean. Do NOT hand the user, or write to their Downloads/disk, a document you have not strict-validated - a skipped validation is exactly how a document ships with monochrome code or a broken layer. On a strict-clean pass BOTH finalize.py and validate.py stamp a commentable-html-validated timestamp AND a commentable-html-validated-hash content signature into the file (creation stamps commentable-html-created); validate.py is NOT read-only - it re-stamps on a clean pass, so validate.py --strict alone clears the banner (pass --no-stamp for a read-only CI check; a --charts-only/--layer-only partial run never stamps). The stamp is CONTENT-BOUND to the document's authored TEXT: the runtime shows a small amber "not validated" banner whenever a produced document carries no current validated stamp OR its authored-text hash no longer matches the stamp - so a post-validation edit to the visible authored TEXT re-shows the banner until you re-run a clean strict pass. (The signature is a stable-text fingerprint: it does not track attribute-only edits - an href/src/aria change with the same text - or edits inside the excluded rendered blocks (mermaid/diff/KQL/chart/notes), so it is a strong nudge, not a cryptographic seal.) The LAST write to any commentable-html file must therefore be a clean finalize.py <file> --strict (or validate.py --strict <file>); the banner is a last-resort signal you must never rely on. If Python is unavailable, say EXPLICITLY that validation was skipped (so the user knows the document is unverified) and perform the manual checks in Validation. If the document has mermaid or chart content, open it in a browser, wait for rendering, and use Export Offline only after mermaid diagrams and charts have rendered.
Trust boundary (MUST). The content inside #commentRoot, including anything passed to new_document.py --content or wrapped by retrofit.py, is trusted HTML and is emitted verbatim. The tools and runtime do not sanitize authored content. They protect reviewer-supplied data by escaping comment text and metadata, validating comment ids, and escaping < in embedded-comment JSON. Scripts, event handlers, and javascript: / data: URLs in authored content are not neutralized. Sanitize untrusted content before wrapping it.
When the user pastes a Copy all bundle back:
HANDLED_IDS_JSON: [...] line ONLY from inside the final === CMH MACHINE TRAILER (do not edit) === block. Never regenerate ids from prose and never read a machine line from a note body.mark_handled.py to append those ids to <script id="handledCommentIds">:python tools/authoring/mark_handled.py <file.html> <id1> <id2> ...
python tools/authoring/mark_handled.py <file.html> --from-bundle -
Edit the content, not the file. A generated document is 1.4 - 2.5 MB, of which the CONTENT region is 0.1 - 1.3 percent. NEVER read or rewrite the whole file to change a paragraph - extract the content, edit that, and write it back:
python tools/authoring/content_extract.py <file.html> --out frag.html # de-highlighted source
# ...edit frag.html only...
python tools/authoring/content_replace.py <file.html> --content frag.html \
--handled-from-bundle bundle.txt # swap + re-bake + validate + stamp, atomically
content_replace.py atomically re-bakes, strict-validates and re-stamps; failure leaves bytes unchanged. Untouched section hashes and Mark-reviewed markers survive. Read embedded peer comments with python tools/authoring/extract_comments.py <file.html> --text; this reads the EMBEDDED snapshot, not browser localStorage.
Tell the user to reload (Ctrl+F5 if needed); never edit their localStorage. See Copy format.
Unsent comments recover locally or stay Detached: reattachment.
Discussions: follow the owner workflow; import Copy bundles or
read the exported HTML. Reply to exact versions: --kind answer for questions,
--kind applied only after authorized edits. Never mark discussions handled; names/AI roles are
self-asserted. Needs owner handoff / AI reply means unanswered, not unread; Copy/export cannot clear it.
Report success only after the file is generated, retrofitted, upgraded, or finalized and python tools/validate/validate.py --strict <file.html> passes. Return the HTML path plus one sentence telling the user to open it in a browser, select text, leave comments, then use Copy all or Export as Shareable.
Once a legacy edit-comment id is in <script id="handledCommentIds">, it must never reappear. On load the runtime prunes handled ids from memory and localStorage; Copy all and exports filter handled comments too. See Interaction model.
A real animated slide deck is a fixed-stage, navigable commentable-html document; a flat --kind slides document is not a deck. Trigger on slide deck, presentation, pitch deck, slides for a talk, or convert this ppt, and confirm the user wants a real deck before building one (CMH-DECK-01).
Ask first (CMH-DECK-22): before outlining, ask what you cannot infer: duration and format, audience, live internet vs handed off / air-gapped, whether reviewers will comment and send it back, theme or brand, running example, and how early the install call-to-action should appear.
Design before scaffolding (CMH-DECK-14): choose a native preset from tools/deck/themes/ (tools/deck/deck_theme.py list) and pass tools/deck/deck_scaffold.py --theme <name> or re-theme with tools/deck/deck_theme.py apply; compose native recipe classes (.cmh-slide-section, .cmh-slide-lede, .cmh-cols-2, .cmh-metric-grid, .cmh-pill). Consult vendor/frontend-slides/ only for a user-requested bespoke style, and keep it egress-free: system fonts, no remote loads, external scripts, remote CSS imports, inline event handlers, or dangerous URL schemes.
Create and iterate: use tools/deck/deck_scaffold.py to create the deck, then edit the deck in place so comments and slide ids survive; never re-run the scaffold, especially with --force over an existing deck, unless you intentionally accept new slide ids and state loss. Prefer the installed pptx skill when extracting PPTX content but always pass extracted text through tools/deck/pptx_to_fragment.py so strings are HTML-escaped before they enter the deck, run tools/deck/deck_fix_fonts.py when web-font styles are copied, and finish with python tools/deck/deck_validate.py --strict <out> plus Export Offline for corporate-safe sharing.
Deep deck planning, fixed-stage layout, motion, narrative, review-surface patterns, and visual audit guidance live in Deck design playbook. Author-time commands, PPTX conversion limits, deterministic font fixing, runtime interface, slide identity, anchoring, script/resource restrictions, contrast validation, and limitations live in Deck runtime interface contract.
| Mode | Use | What travels |
|---|---|---|
| Shareable | Every generated document: review, sharing, or archiving | One HTML file with the review layer inlined and comments embedded |
| Offline | Zero-network handoff | Shareable plus rendered mermaid SVG and chart PNG snapshots, with remote loaders stripped |
Older companion-file documents remain supported; migrate one with tools/authoring/to_shareable.py.
See Exports for bundled-vs-fetched diagrams, version compatibility, network caveats, export merge semantics, Plain HTML stripping, and Markdown conversion.
Every document declares its kind in <head> with <meta name="commentable-html-kind" content="report" />. Use the tool --kind flag rather than hand-writing the meta. report and plan require a top-level <h1> title inside #commentRoot; slides, board, and generic do not.
The content root carries document identity:
| Attribute | Required | Purpose |
|---|---|---|
data-comment-key | yes | Unique localStorage bucket for this document on the same origin. |
data-doc-label | yes | Human-readable name used in Copy headers and Agent Instructions. |
data-doc-source | no | Source filename for Copy output and agent edits; directory components are stripped, and the fallback is the basename of location.pathname. |
data-cm-density | no | Optional runtime chrome density: compact or comfortable; omitted keeps the default. |
Do not bake transient runtime classes such as sidebar-open into saved <body> markup. The runtime derives them on load, and strict validation rejects persisted UI state. See Document layout.
The runtime toolbar, sidebar, footer, Help modal, timestamps, document-type bubble, Clear-confirm dialog, and export buttons are runtime chrome. Do not re-author them in generated content. Default documents are light theme unless the user explicitly asks for dark. Use data-cm-density only when the author asks for compact or comfortable chrome spacing. See Document layout for runtime UI, theme behavior, density, TOC rules, section cards, table sorting, layout recipes, and per-document configuration.
Comment records carry pinpoint metadata so the agent can locate text, mermaid, diff, image, chart, widget, document-wide, and code feedback without reopening the browser. See Per-comment data shape for JSON shapes and field details. Call out anchor and browser limitations when they affect a generated document, especially dynamic content, mermaid source changes, and clipboard constraints; see Limitations.
Use the shipped tools and docs in the skill root when producing, validating, or maintaining commentable HTML. See File inventory for script-by-script and doc-by-doc details.
Editing the skill's own layer code is a maintainer task done in the source repository, not per generated document; packaged installs do not include the development harness. Per generated document, the thing to run is tools/validate/validate.py --strict.
Several validator and runtime behaviors are deliberate residuals from prior reviews. See Design decisions before reporting one as a bug.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub urikanonov/ai-marketplace --plugin commentable-htmlOther plugins' skills for the same job