skills/html-artifacts/html-module-map/SKILL.md
Produce a single-file HTML "module map" artifact that breaks down a business module, feature, subsystem, or end-to-end workflow — inline-SVG architecture diagram with the hot path highlighted, a key-files panel, a numbered callstack walkthrough in execution order, a gotchas callout, and a glossary. Use this skill whenever the user asks to break down a module, explain how a feature works, document a business workflow, draw an architecture diagram, onboard a teammate, "explain X to me", "map out the auth flow", "walk me through the order pipeline", or "document this subsystem". Trigger even without the word "HTML" — the artifact format is the whole point. For PR review use html-pr-review; for authoring a PR use html-pr-writeup.
npx skillsauth add arctuition/skills html-module-mapInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are helping the user produce one self-contained HTML file that explains a module or workflow well enough that a teammate (or their future self in three months) can get oriented in five minutes. The artifact replaces the README that nobody updates with a document that's actually pleasant to open.
This works for two flavours of subject:
The same visual vocabulary serves both; the difference is what goes in the boxes.
// HACK: comment from 2022.If the user has access to a real codebase, do the legwork: git ls-files, rg <symbol>, read the entry-point file. If it's a workflow described in prose, ask one focused clarifying question about boundary and hot path before drawing.
Adapt to the subject; this is a default.
<repo or product> · architecture note), h1 naming what this document explains (e.g. "How authentication flows through birchline/web"), one-paragraph summary that names the trust boundary or the invariant the system protects.--clay. Don't draw every box; draw the ones that matter to the explanation.aside.panel uses .kf (compact, narrow); the main-column "where to make changes" / "怎么找回自己写的东西" section uses .file-index (3-column grid with optional line-count chip). Don't use .kf in the main column — display: block on the filename makes the row stack badly when the column is wider than ~280px.Don't reach for D3 or mermaid. Hand-rolled inline SVG with simple rounded rectangles and arrows is enough for almost everything you'd want to draw. The patterns to use are in references/design-tokens.md under "Architecture / flow diagram":
rect for nodes<marker id="arrowHead"> referenced from each <line> for arrows.box.hot for the one important node (--clay outline)--gray-500These are the rules that the model breaks most often. Each one has a failure mode that's been observed in the wild — the diagram looks "OK" while you're drawing it and reads as decoration when the user opens the file.
rect or text element. After laying out, eyeball each label position. If "create" or "edit row" is partially behind a box, move it.<rect class="group"> when nodes share a context. Three loose boxes labelled "Shell", "Page", "Data" beat thirteen boxes drifting on a blank canvas.Before you finalize a diagram, do this 30-second check:
rect, fix it before moving on..box.hot.For sequence diagrams (time on the y-axis), draw vertical lifelines and label arrows with what's in flight. For state machines, draw rounded boxes for states and arrows labelled with the event that triggers the transition.
The walkthrough is what the reader will actually read. Treat it like a tour, not a reference.
Inline <code> is for short identifiers — useSession, panelId, /users/, version: 2. Anything that grows beyond an identifier belongs in its own block:
<pre class="code"> when: the code is longer than ~40 characters, contains a parameter list, contains multiple & / = / ? characters (URL queries, signatures), or shows a transformation. These wrap badly inside prose paragraphs and make the line jagged.Concretely, this stays inline:
调用
useProductsURLState()把 URL 解析出来。
This must be lifted:
❌ 把 URL 上的
?category=&listType=&page=&library=&panelType=&panelId=...解析出来 — 这串塞在一段 prose 里会把行撑爆。✅ 写成
?category= &listType= &page= &library= &panelType= &panelId=…跟在段落下面,再
<details class="snippet">包起来如果想默认收起来。
A walkthrough step paragraph should be 3–5 lines on screen, not 8. If you find yourself stringing together 6+ inline <code> chips inside one paragraph, that paragraph is doing two things — break it into two short paragraphs at the natural seam (e.g. "解析出来 → 然后" is a seam). Dense walls of mixed prose + identifiers are the second-most-common reason a module map gets skimmed past.
Inline a <details class="snippet"> only when the code is the explanation. Don't paste the whole function; paste the 6–10 lines that show the seam. If the snippet is more than 20 lines, it's a reference, not an explanation — link to the file in code text and trust the reader's editor.
This is what makes the document trusted. Put what newcomers actually trip on:
One sentence each. If a gotcha needs three paragraphs, it should be its own section.
Apply the tokens and components in references/design-tokens.md. The visual language matches html-pr-writeup and html-pr-review so a team produces a coherent set of artifacts.
Default filename: <subject-name>-breakdown.html (e.g. auth-flow-breakdown.html, checkout-breakdown.html).
Save in ~/artifacts/, creating the directory if it doesn't exist. If the user specified a directory or filename, honor that instead. Surface a computer:// link so the user can open it themselves — don't auto-open. Don't dump the HTML source into chat — the artifact is the deliverable.
After saving, ask whether they want to (a) deepen any section, (b) add a sequence diagram or state machine, or (c) move on.
Match the user's prose language. Code, file paths, table names, and node labels can stay in English even if the prose is Chinese — they're identifiers in the codebase.
html-pr-review or html-pr-writeup.references/design-tokens.md — full CSS/component vocabulary including the flow SVG diagram pattern, callstack walkthrough, key files panel, and gotchas callout. Read it before assembling the HTML — it has the full CSS and component markup you need to drop into the document's <style> and body.data-ai
Wrap up the work you just did and open a PR for it — branch off main/master if needed, commit only the changes you made, push, open a pull request (following .github/PULL_REQUEST_TEMPLATE.md when present), and open the PR in the browser. Targets the `upstream` remote's default branch as the base when an `upstream` remote exists, otherwise `origin`. Use when the user says "sign off", "signoff", "ship it", "open a PR for this", "commit and PR", or "wrap this up".
development
Produce a single-file HTML "thread recap" artifact that captures what was discussed in an agent / pairing / chat conversation — the questions explored, the decisions made and their tradeoffs, the dead ends we walked into, the open questions left, and the artifacts produced — so a teammate who wasn't in the room can pick up the context. Use this skill whenever the user asks to summarize a conversation/thread/session, mentions sharing a thread with colleagues, says things like "把这个对话总结一下", "share this thread with the team", "write up what we decided", "decision log for this conversation", "document the tradeoffs we made", "recap of our pairing session", or wants to hand off a Claude/ChatGPT/agent transcript as context. Trigger even when "HTML" isn't said — the artifact format is the whole point. Input can be the current session's own conversation context OR a transcript the user pastes in.
development
Produce a single-file HTML "PR writeup" artifact that explains a pull request to its reviewers — motivation, before/after behavior, file-by-file tour with the reasoning, where to focus the review, test plan, and rollout. Use this skill whenever the user is about to open a PR, has just finished a branch, mentions writing a PR description, asks for a PR write-up, says things like "explain this change to my team", "help me pitch this PR", "write the PR description", "summarize what I'm shipping", or wants to make sure reviewers understand intent and risk before they read the diff. Trigger even when they don't say "HTML" — the artifact format is the whole point and the user should not have to ask for it by name.
development
Produce a single-file HTML "code review companion" artifact that helps a reviewer get oriented in someone else's pull request — a risk-coloured map of every file, an annotated diff with margin notes and severity tags, the call-graph that shows how the changed pieces fit together, and the questions worth asking the author. Use this skill whenever the user is about to review a PR, has been assigned one, mentions reviewing code they didn't write, says things like "help me review this", "I need to review PR