Spec doc
Spin up a polished, self-hosted HTML spec/design doc with Notion-style margin comments for review. Use when the user asks to "spin up a spec doc", "write this up as a spec / design doc / tech spec / product doc", "make a commentable doc", or wants a reviewable design writeup they can mark up and iterate on. Produces a served page (charts + editorial design) plus a persistent comment system, and runs a verification pass.From its SKILL.md
npx -y skills add tim-win/spec-doc --skill spec-docAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 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
6.5 KB, as published. Nobody here has run it
Spec Doc
Turn a design/architecture/product decision into a served, visually-communicative HTML spec with a Notion-style margin-comment system (select text → ⌘/Ctrl+M → comment → reply → resolve, persisted to disk). The reviewer marks it up in the browser; you read their comments, amend the doc, reply, and resolve — looping until they're happy.
This skill bundles a zero-dependency engine and a designed template. Your job is to author the content; the engine and look come for free.
What's in assets/
| File | Role | How you use it |
|---|---|---|
serve.py | Zero-dep static server + JSON comment API (stdlib http.server; persists to comments.json). | Copy verbatim. |
app.js | The comment system: selection anchoring, margin rail, threads, edit/resolve, resolved drawer. | Copy verbatim. |
template.html | Self-contained page: full design system (CSS), page shell (topbar / TOC / content / comment rail / drawer), and a complete worked example exercising every component. | Copy → index.html, then replace the article content with the user's spec. Read its top-of-<article> AUTHORING GUIDE comment for the component vocabulary. |
Steps
-
Pick a home. Create a folder for the doc, e.g.
<repo>/docs/<slug>/. (System-level cross-component docs usually belong under the repo'sdocs/. If the repo also keeps a markdown spec, this HTML is the reviewable companion — keep both in sync.) -
Drop in the engine.
mkdir -p docs/<slug> cp <skill>/assets/serve.py docs/<slug>/serve.py cp <skill>/assets/app.js docs/<slug>/app.js cp <skill>/assets/template.html docs/<slug>/index.html(
<skill>= this skill's directory.) -
Author the content. Edit
index.html: set<title>, the.toclinks, and replace everything inside<article id="doc">with the spec. This is a real product/tech doc — include the product framing, not just the engineering:- Masthead — title, one-line subtitle, status pill (PLANNED / DRAFT / APPROVED), owner, scope.
- A thesis card — the single core idea in one or two sentences (
.thesis). - Why — the problem and who it's for. A before/after diagram (
.arch) earns its place here. - Requirements — functional + non-functional, plus the personas/use-cases that shape the decisions (don't skip this; it's what makes it a product doc).
- The core idea / architecture — lead with a visual. Use the chart components (
.tltimeline,.stacklayers,.uni,.life) to make the argument, not decorate it. - Tech spec — the concrete code areas to change: a
table.tblof files + what changes, model/schema sketches in.codeblocks. Be specific (real file paths, real symbols). - Risks — a table with
.dot-ststatus pills (plugged / accepted / flag). - Roadmap — phases as a
.roadtrack; bracket the recommended first slice (.slice). - Open questions — the genuine forks left for the reviewer.
Use the palette tokens (
--terra,--sage,--gold,--coral,--blue) — never hardcode hex. Keep charts hand-built (HTML/CSS/SVG); no chart libraries, no new dependencies. Prefer one well-made figure per section over walls of prose.Theming: the default is a warm editorial palette (Fraunces / Hanken Grotesk / JetBrains Mono on cream). If the user wants a different feel, retheme by editing
:rootand the font<link>— but keep the structure, the comment shell, and the component classes intact. -
Run + verify (see checklist below). Always verify before handing off — this is what makes the deliverable trustworthy.
-
Tell the user the URL and how to restart, then iterate via comments.
Run & verify (do this every time)
Start it (pick a free port; if one's busy, just try another):
python3 docs/<slug>/serve.py 8791 # or any free port
Then verify — don't assume, check:
- Files parse.
python3 -m py_compile serve.pyand (ifnodeexists)node --check app.js. - Server + API end-to-end.
curlthe page (200, non-trivial size) and/app.js; then create → reply → resolve → list → delete a comment via the API and confirmcomments.jsonreflects each step. (Loop the comment tools via ToolSearch if browser-driving.) - It renders. Open it in Chrome (claude-in-chrome) and screenshot the top of the page — confirm the masthead, thesis, TOC, charts, and the empty comment rail look right. Known gotcha: deep-scroll screenshots may come back blank — that's a capture-pipeline artifact, not a real bug. Confirm content is actually painted with
document.elementFromPoint(x,y)returning real elements rather than trusting a blank frame. - Comments actually anchor. This is the part screenshots can't prove — drive it programmatically: POST a comment whose
anchor.quoteis a unique phrase in the doc, reload, and assert exactly onemark.cmt-hlwraps that exact text and a.cmtcard renders aligned to it. Also test two comments on the same span → they must share one mark (both ids indata-cid), not corrupt the text. - Clean up. Delete all test comments so the user opens a clean slate; remove
__pycache__.
The review loop
The reviewer selects text and hits ⌘/Ctrl+M to comment; replies and resolves live in the right rail, resolved ones in the drawer. Everything persists to comments.json (the server re-reads it per request, so you can edit it out-of-band while they review).
When they've marked it up:
- Read
comments.json. - For each open comment: amend
index.html, then reply on that thread (POST/api/comments/<id>/replieswithauthor: "claude"summarizing the change) and resolve it (PATCHresolved: true). - Repeat until they're satisfied. Then fold the final state back into any companion markdown spec.
Notes
- Zero dependencies — stdlib
http.serveronly. Never add npm/pip packages for this. comments.jsonis the source of truth and is safe to hand-edit or commit.- Author comments default to
reviewer; useauthor: "claude"for your own replies so the rail shows the right avatar.