agentsclimarketplace

Doc visualizer

Skill BillBai/bba/skills/doc-visualizer

Turn a markdown doc into a single, self-contained visual HTML page that is easy to skim and trustworthy to read. Supports single files and directories (generates one HTML with tab navigation). Use whenever the user wants to read, understand, clean up, summarize, or share AI-generated markdown — specs, OpenSpec change proposals, reference docs, architecture/design docs, RFCs, READMEs — especially when they say the docs are long, dense, full of AI boilerplate ("slop"), hard to skim, or "抓不住重点". Also use when the user wants to translate an English doc into natural Chinese, or asks to "把这个 md 可视化 / 转成 HTML / 去掉套话 / 翻译成中文 / 看懂这份文档". The page surfaces the key points up top, collapses the deep detail, draws Mermaid diagrams for flows/architecture, and keeps the original text one click away. It never rewrites the author's meaning. Prefer this skill over a plain markdown→HTML conversion whenever readability, de-slopping, summarization, or Chinese translation matters.From its SKILL.md

Install
npx -y skills add BillBai/bba --skill doc-visualizer

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

12.4 KB, as published. Nobody here has run it

doc-visualizer

Turn one markdown file into one self-contained HTML page that a tired engineer can skim in 30 seconds and trust completely.

The docs that AI coding agents generate (OpenSpec specs, reference docs, architecture write-ups) are usually correct but exhausting: padded with boilerplate, flat in structure, hard to skim, and — when English — awkward to read for a Chinese-speaking team. This skill fixes the reading experience without touching the substance.

The one idea that governs everything: length ≠ information

"More detail" and "less slop" are not in tension once you separate length from information.

  • Slop is words that carry no information: empty adjectives ("robust", "seamless", "comprehensive"), filler transitions ("It's worth noting that…"), and sentences that just restate the heading. Cut these freely.
  • Good enrichment is words that carry new information: the why behind a decision, a concrete example, an edge case, how this piece connects to the rest of the system. Add these only where a reader would actually get stuck.

The test for every sentence in the output: does it carry a fact or an action? If not, it goes. If a reader would ask "but why?" or "how?", that's where you add — and only there. Never pad to seem thorough.

The fidelity contract — 尊重原文 (highest priority)

This overrides everything below. The output is a better view of the source, never a different document.

  1. Meaning is immutable. Never alter or "improve" a technical claim, requirement, number, name, API, or the logical order of an argument. De-slopping only removes empty words; when unsure whether a phrase carries information, keep it.
  2. Additions are physically separated. Anything you add is never blended into the author's sentences. It goes in a clearly-styled callout (补充 / 推测), so the reader always knows what is theirs vs. yours.
  3. Every addition is sourced. Enrichment grounded in the repo cites its origin as plain text (e.g. src/auth/token.ts:42). Enrichment that is your inference is labeled 推测 and phrased tentatively. If you can't ground or honestly mark a claim, don't make it.
  4. The original is always one click away. Every section carries a collapsible "查看原文" with the source markdown verbatim; for translated docs it shows the original English. Nothing is lost; the reader can always verify your view against the source.

A good mental model: you are an editor and designer, not a co-author. You re-present and annotate. You never put words in the author's mouth.

Pipeline

Work through these stages in order. Think first, render last.

1. Read & classify

Read the source markdown fully. If the input path is a directory, recursively find all .md files within it (excluding node_modules, .git, and hidden directories). Sort them by relative path. Then process each file through stages 2–5 individually before rendering. Detect the doc type and language per file. Type and language steer summary phrasing and which diagrams help — but the v1 renderer is general-purpose; don't build type-specific templates yet, just adapt emphasis.

2. Extract the key points

Produce a "本文要点" list of 3–7 bullets — the things a reader must take away — and a one-line summary for each major section. This is the single most valuable output; it's what solves "抓不住重点". Label it clearly as a summary (it's yours, not the author's words). Pull these from the source; do not invent.

3. De-slop

Remove boilerplate and empty phrasing per references/slop-blocklist.md. This is deletion and tightening only — never a rewrite of substance. Preserve all technical content, including anything the blocklist would superficially match but that actually carries meaning in context.

4. Enrich (only where it helps, always marked)

Where a reader would get stuck on why or how, add a 补充 callout. If repo access is available and relevant, read the referenced code to ground the explanation and cite the path:line. Otherwise mark it 推测. Do not enrich passages that are already clear — restraint is part of quality.

5. Translate to natural Chinese (only if the source isn't Chinese)

Follow references/glossary-zh.md. The bar: read like it was written by a Chinese engineer, not translated.

  • Work paragraph by paragraph, never sentence by sentence. Read the whole paragraph, put the English aside, say it the way you'd explain it to a colleague in a design review, and write that down — then check back against the English for dropped facts. Sentence-level mapping is where stiff, mechanical translation comes from.
  • Metaphor and coined terms (load-bearing, seam, footgun…): translate the concept, never the surface word. Literal renderings (载重、缝) are meaningless. Say what the term actually means in plain Chinese and keep the English in parentheses on first use. See the 隐喻术语 section of the glossary.
  • Keep code, identifiers, API names, and established product/proper nouns in English. Don't translate useEffect, PostgreSQL, OAuth, git rebase.
  • Avoid 黑话 and corporate jargon (赋能, 抓手, 颗粒度, 对齐一下…) and the banned list in the glossary (e.g. 落文档).
  • Add a translator's note (译注) only for genuinely ambiguous or culture-bound terms.
  • Self-check: re-read the Chinese with the English covered. Any sentence you can only understand by recalling the English original has failed — rewrite it.

6. Render

Fill assets/template.html (single file) or assets/template-dir.html (directory) as the skeleton. Both already contain the CSS, the light/dark theme, the sticky table-of-contents, the collapsible machinery, callout styles, syntax highlighting (highlight.js via CDN) and Mermaid (via CDN). Don't reinvent styling; fill the marked content regions. Read the comments at the top of each template for exactly which regions to replace.

Rendering — single file

Use assets/template.html. Components to populate:

  • Header: doc title, a one-line "this doc in a sentence", and meta (source filename, doc type, source language → output language).
  • 本文要点 panel (top, always expanded): the 3–7 key points from stage 2.
  • Sidebar TOC: every section, each with its one-line summary as a tooltip/subtitle.
  • Body sections: de-slopped prose. Lead with what matters; push depth into <details> "深入" blocks so the page skims fast and expands on demand.
  • Callouts: 补充 (sourced addition), 推测 (inferred), 译注 (translation note), plus 信息/注意/警告 as the content warrants.
  • Diagrams: for any flow, sequence, or architecture described in prose or lists, add a Mermaid diagram. Author it strictly within the safe subset in references/mermaid-guide.md (quote every label, one statement per line, no reserved-word ids…). Copy the template's canonical raw-text wrapper exactly: Mermaid source belongs inside <script type="text/plain" class="mermaid-source"> nested in <div class="mermaid">; never put source text directly in the div, because the HTML parser will decode or discard valid Mermaid characters before rendering. Validate the final HTML with scripts/validate-mermaid-html.mjs; pass an mmdc path when available so it also performs real Mermaid parsing. The diagram supplements the text; it never replaces the original.
  • Code: keep code blocks verbatim, syntax-highlighted, with the language label.
  • 查看原文 toggle: per section, a collapsed block with the verbatim source markdown (and original-language text for translations).

Rendering — directory mode

Use assets/template-dir.html. The pipeline stages 2–5 run per file; stage 6 renders all files into one HTML. Each file goes through the same fidelity contract.

Components to populate (in addition to per-file components above):

  • Tab bar: one tab per file, labeled with the file's relative path from the input directory. The first tab is active by default.
  • Per-file panels: each file gets a <div class="file-panel" id="file-N"> containing the same structure as a single-file render (header, keypoints, sections). The first file's panel is active by default.
  • Sidebar TOC: initially shows the first file's sections. Rebuilt by JavaScript when the user switches tabs.
  • TOC data: populate the <script type="application/json" id="toc-data"> block with each file's section IDs and titles.
  • Section IDs: use sec-F-S format (F = file index, S = section index within that file) to avoid ID collisions across files.
  • Keypoints: per-file keypoints, displayed inside each file's panel.

Output location & naming

  • Single file: <source-basename>.bba-doc-viz.html next to the source (e.g. proposal.md → proposal.bba-doc-viz.html).
  • Directory: <directory-name>.bba-doc-viz.html inside the directory (e.g. docs/ → docs/docs.bba-doc-viz.html).

The .bba-doc-viz.html suffix makes generated files easy to identify and gitignore — suggest that users add *.bba-doc-viz.html to their project's .gitignore. Then tell the user the path and offer to open it.

Repo access & sourcing

Reading the surrounding codebase makes enrichment far more accurate — but only use what you actually read, and always cite it (rule 3). If you don't have repo access and the doc references code you'd need to see, say so in the relevant 补充/推测 rather than guessing silently.

Verify before finishing (fidelity check)

Before handing back the HTML, re-read it against the source and confirm:

  • No technical claim, number, name, or requirement changed meaning.
  • Every 补充/推测 is either sourced or honestly marked as inference.
  • Every section's "查看原文" contains the true original.
  • The 本文要点 are supported by the source, not invented.
  • Chinese output has no 翻译腔 / 黑话 / banned words, all identifiers stayed in English, and no metaphor term was translated literally (载重/缝-style renderings are failures). Re-read the Chinese without the English: every sentence must stand on its own.
  • Every Mermaid container uses the canonical raw-text source wrapper, and every diagram passed scripts/validate-mermaid-html.mjs (with mmdc when available, otherwise plus the checklist in references/mermaid-guide.md).
  • The HTML opens and renders (no broken <details>).
  • For directory mode: every .md file found in the directory is represented (no file silently dropped); tab switching correctly shows each file's content and updates the sidebar; section IDs don't collide across files.

If anything fails, fix it before delivering. Respecting the original is the whole point; a pretty page that distorts the source is a failure.

References

  • references/slop-blocklist.md — what counts as slop, with English + Chinese examples and the keep-don't-cut caveats.
  • references/glossary-zh.md — translation rules (paragraph-level re-expression, metaphor-term handling), preferred Chinese phrasings, the do-not-translate list, and the banned-word list (extend this over time).
  • references/mermaid-guide.md — the safe Mermaid subset, per-diagram checklist, and validation requirement.
  • scripts/validate-mermaid-html.mjs — checks the final HTML embedding contract and, when given mmdc, parses every embedded diagram with Mermaid.
  • assets/template.html — the HTML skeleton for single-file mode.
  • assets/template-dir.html — the HTML skeleton for directory mode.

Keep looking

Skills are one crate of 607,533. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.