一键导入
md-render
Fires when generating or verifying deterministic HTML from report MDs. Runs render / verify / lint / selftest / check via the bundled md2html.cjs
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Fires when generating or verifying deterministic HTML from report MDs. Runs render / verify / lint / selftest / check via the bundled md2html.cjs
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Fires when deciding whether a report or explanatory document needs figures, when designing a figure, or when writing the figures declaration in frontmatter. Designs cognitive-load-reducing figures via the trigger table, quantitative limits, and templates
Fires when producing a report or completion notice. Generates a report that includes the interlock verification section.
Discipline for preventing the stop bug (malformed tool call -> self-priming). Fires when the stopbug-observe hook emits a trip-wire (migration advice) or the time-based timer (calibration prompt), or as a minimal focus-check right before heavy processing.
報告書・説明文書で図を使うか判断する際、図を設計する際、frontmatter の figures 宣言を書く際に発火する。図トリガー表・定量上限・雛形で「認知負荷を減らす図」を設計する
報告書 MD から決定論 HTML を生成・検証する際に発火する。md2html.cjs(同梱)で render / verify / lint / selftest / check を実行する
報告書・完了報告を出力する際に発火する。インターロック検証欄を含む報告書を生成する
| name | md-render |
| description | Fires when generating or verifying deterministic HTML from report MDs. Runs render / verify / lint / selftest / check via the bundled md2html.cjs |
The MD is canonical; HTML is derived (HTML ⊆ MD). The renderer takes no wall clock, randomness, or environment as input and produces byte-identical HTML from the same MD (determinism).
--verify / --lint / --check (referenced from the report skill's renderer procedure)R=~/.claude/skills/md-render/md2html.cjs
node "$R" <report.md> <report.html> # render (fixed 7 blocks, dark theme)
node "$R" --verify <report.md> # bidirectional: HTML⊆MD (zero fabrication) + MD⊆HTML (zero omission)
node "$R" --lint <report.md> # figures declaration-reality (bidirectional) + required markers. exit 1 = block
node "$R" --selftest # sha256 check of built-in golden cases (corruption detection)
node "$R" --check <in.md> <out.html> # freshness check of embedded sha256 vs current MD (for _index)
--lint only on reports newly written after the revision (grandfather migration — see the report skill)./vendor/mermaid.min.js next to the HTML ② pinned CDN ③ raw textvendor/ next to the HTML (the loader resolves relative to the HTML document)Declare tabs: by-h2 in the report frontmatter to render the top-level body H2 sections as a tab UI (deterministic extension — no new MD syntax). Tab labels are the H2 heading text (MD-derived); the audience / decisions / TOC / pending panels and the lead stay outside the tabs.
html.js before paint, switching to tab view only when JS runs. The tab loader reads only data-* attributes and toggles classList / aria-selected (no innerHTML, no MD-derived strings injected into the DOM) — determinism and HTML⊆MD are preserved (hidden panels remain in the static HTML and are covered by --verify).--lint warns otherwise). Unknown tabs values are ignored with a lint warning.tabs: by-h2 reports; non-tab reports stay byte-identical.Heading ids are sec-<sha1(normalized-heading)[:8]> (position-independent, heading-dependent). Re-rendering keeps the id stable as long as the heading text is unchanged — so anchored comments never get lost. TOC / decision links derive from the same id, so they stay consistent automatically. Identical-text H2 headings share one id (--lint warns); make headings unique to avoid comment merging.
Reports (detected via isReport: frontmatter doc_id/report_id/audience/status or a "読者と目的" section) with a stable id (report_id or doc_id) get a per-topic comment Composer under each body H2, plus a reply-prompt generator. Suppress with comments: off.
ccpit-cmt:<reportId>:<sectionId>); comments are never written into the HTML body → determinism (同一MD→byte一致) and HTML⊆MD/MD⊆HTML are preserved (the Composer is empty containers + CSS/aria labels + empty textarea → zero static text nodes; verified by an on/off extractTextNodes equality test).report_id/doc_id); no filename fallback (a filename is MD-external and would break byte-identity). No id → comments disabled.navigator.clipboard.writeText one-click copy (falls back to execCommand('copy') + select on non-secure contexts like file://). Reply-body generation (by a reviewing agent / CC) is out of this renderer's scope (layer separation).The renderer emits only fixed inline scripts (mermaid loader, tab apply-before-paint, tab loader, comment loader, reply generator) and SVG only as data: images. A compatible policy:
default-src 'none'; img-src data:; style-src 'unsafe-inline'; script-src 'sha256-<hash-per-inline-script>'
Generate the sha256-… hashes from the emitted inline scripts at build/publish time (they change if the loaders change). The renderer does not emit a CSP meta tag itself (a wrong hash would break the page) — apply CSP at the serving layer.
| File | Description |
|---|---|
md2html.cjs | Renderer (zero dependencies, single file) |
vendor/mermaid.min.js | mermaid v10.9.1 (MIT License) |
vendor/LICENSE-mermaid.txt | mermaid license attribution (incl. recorded sha256) |
After editing md2html.cjs, always run --selftest; if the change is intentional, recompute and update the built-in GOLDEN sha values (leaving selftest FAIL unresolved is treated as corruption).