Writing Documents
A technical document exists to get a reader to a decision, or to a working understanding, without them having to reconstruct the author's thinking.
The failure mode is not ugliness. It is a document that is complete, accurate, and unreadable — where the reader cannot find the decision, cannot tell what is settled versus proposed, and cannot see what changed since they last read it.
This skill is two layers. Do not glue them together.
- Writing (default) — pick the type, load its shape, write from evidence. Output is Markdown in the user's tree.
- Design system (opt-in) — tokens, themes, print, self-contained HTML. Load
core/ only when the user asked for HTML, PDF, print, a designed page, or "use the design system".
Format first
format = markdown, unless the user asked for html, pdf, print, designed, themed, or "use the design system".
| Format |
Load |
Do not load |
markdown |
this file, the type file, references/writing.md, references/evidence.md |
core/, themes, templates/longform.html, print.css, build_document.py |
html / pdf |
the above plus references/output.md and core/ |
— |
both |
Markdown first (canonical in-repo), then HTML from that source |
— |
Full dial, conventional paths, and HTML assembly: references/output.md.
On the Markdown path, leave Mermaid as fenced blocks. Prerender to themed SVG only on the HTML path.
State the assumption in one line. Do not quiz.
Writing docs/adr/adr-014.md as type adr (markdown). Designed HTML on request.
Ask only when the slug is actually ambiguous, the request conflicts with another skill, or they asked for HTML and no theme is set (field-notes is the default).
Never offer a designed HTML version unprompted.
Pick the type
Load references/type-index.md if the slug is unclear. Then load one references/type-<slug>.md before writing.
| Slug |
Reader's question |
Shape |
design-doc |
Should we do this, and is the approach sound? |
Context → Problem → Goals / non-goals → Design → Alternatives → Cross-cutting → Risks → Rollout → Open questions |
adr |
Why is it like this? |
Status → Context → Decision → Consequences. One decision, immutable once accepted |
spec |
What exactly must I build, and how do I know I am done? |
Scope → Definitions → Normative requirements → Examples → Compliance |
api-contract |
How do I call this correctly, and what happens when I do it wrong? |
Companion to OAS/RAML, not a second copy of the spec |
architecture |
How is it arranged today? |
Living current-state (C4 context/container), not a change proposal |
handoff |
What do I run, change, and not break after you leave? |
Status, how to run, in-flight work, tripwires |
design-handoff |
What do I build, in every state? |
Screens, states, components, acceptance criteria |
discovery |
What did we learn, and should we proceed? |
Evidence, opportunities, go / stop / reframe |
test-report |
Can we ship, on this build? |
Verdict first; counts with denominators |
postmortem |
What happened, why, and what stops it recurring? |
Summary → Impact → Timeline → Root cause → Action items. Blameless |
proposal |
Should I approve this? |
The ask → Rationale → Cost → Alternatives → Decision needed |
runbook |
What do I do right now? |
Preconditions → Steps → Verification → Rollback → Escalation |
onboarding |
How do I get it running and prove it works? |
Prerequisites, commands from CI, one validation |
tutorial |
Can I learn this by doing it once? |
Diátaxis lesson — one successful path |
how-to |
How do I get this job done? |
Diátaxis recipe for a competent user |
reference |
What is the exact fact? |
Diátaxis lookup — mirrors the product |
explanation |
Why is it like this? |
Diátaxis study — context, not a procedure |
mulesoft |
What does this Mule app do? |
Suite: README, architecture, and conditional extras |
Aliases (rfc → design-doc, playbook → runbook) live in references/type-index.md. Do not invent a second filename.
If several types apply, split. Two clear documents beat one that mixes a decision with a 3am checklist. A linked set is references/suites.md.
Evidence before prose
Mark claims the reader might not be able to check:
| State |
Treatment |
| Verified |
State as fact, cite a repo-relative path |
| Provided |
Attribute to the stakeholder; cannot prove runtime |
| Inferred |
Label it and list supporting evidence |
| Unresolved |
Open questions; do not pick an answer |
| Recommended |
Keep separate from current-state |
Full rules, privacy, and the optional business-context checkpoint: references/evidence.md.
Writing
The design system cannot rescue unclear writing, and clear writing survives bad formatting. Depth in references/writing.md.
- Lead each section with its conclusion.
- One idea per paragraph.
- Prefer prose to bullets for reasoning. Bullets are for enumerable things.
- Define terms on first use; use the same term throughout.
- Put numbers in the sentence when numbers exist.
- Name the actors. "It was decided" hides who can revisit it.
- Non-goals, real alternatives, and open questions with owners — omit only on purpose.
- Status explicit:
Draft, Proposed, Accepted, Superseded by <link>, Deprecated.
- Headings are claims or questions, not labels. Stable IDs derived from the text, never auto-numbered.
- Cross-references by name, not section number.
HTML path only
When format is html or pdf, references/output.md applies in full. Short version:
- Assemble from
templates/longform.html. The type reference declares the root data-pattern; theme stays independently selectable on data-theme.
- Keep prose at 62–72 characters. Let maps, tables, timelines, comparisons, and registers use the wider shell when the pattern calls for them.
- Diagrams from
diagram-design; charts from chart-design.
- Print via
core/print.css. Inspect the PDF; do not claim print support from @media print alone.
- No JavaScript required to read the file.
Pattern before theme
Pattern answers how the reader moves; theme answers what visual voice they
hear. Do not use theme changes to simulate structural distinction.
| Pattern |
Reading movement |
Types |
decision |
ask → options → trade-offs → next move |
design-doc, discovery, proposal |
record |
status → settled choice → consequences |
adr |
contract |
definitions → rules → specimens → compliance |
spec, api-contract, test-report, reference |
procedure |
safety → steps → verification → recovery |
handoff, how-to, runbook |
learning |
context → practice → checkpoint → takeaway |
explanation, onboarding, tutorial |
system |
map → boundaries → interfaces → states |
architecture, design-handoff |
incident |
impact → timeline → cause → owned action |
postmortem |
suite |
document map → ownership → freshness |
mulesoft |
Use the type reference's default. The full layout and acceptance contract is
core/document-patterns.md.
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/build_document.py" \
"${CLAUDE_PLUGIN_ROOT}/templates/longform.html" \
--theme field-notes --out document.html
node "${CLAUDE_PLUGIN_ROOT}/scripts/export_pdf.mjs" document.html --out document.pdf
${CLAUDE_PLUGIN_ROOT} is Claude Code's portable reference to the plugin directory. Working inside this repo, the bare scripts/ and templates/ paths are correct.
Leave alone
- Casual edits to existing Markdown (typos, one extra paragraph, a changelog bullet).
- Metric-led reports →
analytical-document-design.
- Slides →
presentation-design.
- Standalone charts or diagrams.
- Restyling Markdown into HTML, or applying a theme, unless asked.
- Generating Mule XML or running MUnit. Mule markdown refresh when
mule-docs is installed — prefer that skill.
- Rewriting a README that already has a shape the user did not ask to change.
Before delivering
Reference files
references/type-index.md — slug, aliases, path, shipped types.
references/type-design-doc.md
references/type-adr.md
references/type-spec.md
references/type-api-contract.md
references/type-architecture.md
references/type-handoff.md
references/type-design-handoff.md
references/type-discovery.md
references/type-test-report.md
references/type-postmortem.md
references/type-proposal.md
references/type-runbook.md
references/type-onboarding.md
references/type-tutorial.md
references/type-how-to.md
references/type-reference.md
references/type-explanation.md
references/type-mulesoft.md
references/writing.md — prose, headings, review mechanics.
references/evidence.md — evidence states, privacy.
references/suites.md — when to emit a linked set.
references/output.md — format dial, HTML/PDF assembly.
1---2name: writing-documents3description: Write structured technical documents — design-doc, adr, spec, api-contract, architecture, handoff, design-handoff, discovery, test-report, postmortem, proposal, runbook, onboarding, tutorial, how-to, reference, explanation, mulesoft — as Markdown in the repo by default. Use when asked to write or restructure one of those types, including RFCs, ADRs, developer handoffs, API writeups, test summaries, discovery briefs, or MuleSoft project docs. Produce designed HTML or PDF only when asked. Do not use for casual edits to existing markdown, metric-led reports (analytical-document-design), slides (presentation-design), standalone charts or diagrams, restyling a file into HTML unprompted, or Mule markdown refresh when mule-docs is installed.4---56# Writing Documents78A technical document exists to get a reader to a decision, or to a working understanding, without them having to reconstruct the author's thinking.910The failure mode is not ugliness. It is a document that is complete, accurate, and unreadable — where the reader cannot find the decision, cannot tell what is settled versus proposed, and cannot see what changed since they last read it.1112This skill is two layers. Do not glue them together.13141. **Writing** (default) — pick the type, load its shape, write from evidence. Output is Markdown in the user's tree.152. **Design system** (opt-in) — tokens, themes, print, self-contained HTML. Load `core/` only when the user asked for HTML, PDF, print, a designed page, or "use the design system".1617## Format first1819`format = markdown`, unless the user asked for `html`, `pdf`, `print`, `designed`, `themed`, or "use the design system".2021| Format | Load | Do not load |22|---|---|---|23| `markdown` | this file, the type file, `references/writing.md`, `references/evidence.md` | `core/`, themes, `templates/longform.html`, print.css, `build_document.py` |24| `html` / `pdf` | the above plus `references/output.md` and `core/` | — |25| `both` | Markdown first (canonical in-repo), then HTML from that source | — |2627Full dial, conventional paths, and HTML assembly: `references/output.md`.2829On the Markdown path, leave Mermaid as fenced blocks. Prerender to themed SVG only on the HTML path.3031State the assumption in one line. Do not quiz.3233> Writing `docs/adr/adr-014.md` as type `adr` (markdown). Designed HTML on request.3435Ask only when the slug is actually ambiguous, the request conflicts with another skill, or they asked for HTML and no theme is set (`field-notes` is the default).3637Never offer a designed HTML version unprompted.3839## Pick the type4041Load `references/type-index.md` if the slug is unclear. Then load **one** `references/type-<slug>.md` before writing.4243| Slug | Reader's question | Shape |44|---|---|---|45| `design-doc` | Should we do this, and is the approach sound? | Context → Problem → Goals / non-goals → Design → Alternatives → Cross-cutting → Risks → Rollout → Open questions |46| `adr` | Why is it like this? | Status → Context → Decision → Consequences. One decision, immutable once accepted |47| `spec` | What exactly must I build, and how do I know I am done? | Scope → Definitions → Normative requirements → Examples → Compliance |48| `api-contract` | How do I call this correctly, and what happens when I do it wrong? | Companion to OAS/RAML, not a second copy of the spec |49| `architecture` | How is it arranged today? | Living current-state (C4 context/container), not a change proposal |50| `handoff` | What do I run, change, and not break after you leave? | Status, how to run, in-flight work, tripwires |51| `design-handoff` | What do I build, in every state? | Screens, states, components, acceptance criteria |52| `discovery` | What did we learn, and should we proceed? | Evidence, opportunities, go / stop / reframe |53| `test-report` | Can we ship, on this build? | Verdict first; counts with denominators |54| `postmortem` | What happened, why, and what stops it recurring? | Summary → Impact → Timeline → Root cause → Action items. Blameless |55| `proposal` | Should I approve this? | The ask → Rationale → Cost → Alternatives → Decision needed |56| `runbook` | What do I do right now? | Preconditions → Steps → Verification → Rollback → Escalation |57| `onboarding` | How do I get it running and prove it works? | Prerequisites, commands from CI, one validation |58| `tutorial` | Can I learn this by doing it once? | Diátaxis lesson — one successful path |59| `how-to` | How do I get this job done? | Diátaxis recipe for a competent user |60| `reference` | What is the exact fact? | Diátaxis lookup — mirrors the product |61| `explanation` | Why is it like this? | Diátaxis study — context, not a procedure |62| `mulesoft` | What does this Mule app do? | Suite: README, architecture, and conditional extras |6364Aliases (`rfc` → `design-doc`, `playbook` → `runbook`) live in `references/type-index.md`. Do not invent a second filename.6566If several types apply, split. Two clear documents beat one that mixes a decision with a 3am checklist. A linked set is `references/suites.md`.6768## Evidence before prose6970Mark claims the reader might not be able to check:7172| State | Treatment |73|---|---|74| Verified | State as fact, cite a repo-relative path |75| Provided | Attribute to the stakeholder; cannot prove runtime |76| Inferred | Label it and list supporting evidence |77| Unresolved | Open questions; do not pick an answer |78| Recommended | Keep separate from current-state |7980Full rules, privacy, and the optional business-context checkpoint: `references/evidence.md`.8182## Writing8384The design system cannot rescue unclear writing, and clear writing survives bad formatting. Depth in `references/writing.md`.8586- Lead each section with its conclusion.87- One idea per paragraph.88- Prefer prose to bullets for reasoning. Bullets are for enumerable things.89- Define terms on first use; use the same term throughout.90- Put numbers in the sentence when numbers exist.91- Name the actors. "It was decided" hides who can revisit it.92- Non-goals, real alternatives, and open questions with owners — omit only on purpose.93- Status explicit: `Draft`, `Proposed`, `Accepted`, `Superseded by <link>`, `Deprecated`.94- Headings are claims or questions, not labels. Stable IDs derived from the text, never auto-numbered.95- Cross-references by name, not section number.9697## HTML path only9899When format is `html` or `pdf`, `references/output.md` applies in full. Short version:100101- Assemble from `templates/longform.html`. The type reference declares the root `data-pattern`; theme stays independently selectable on `data-theme`.102- Keep prose at 62–72 characters. Let maps, tables, timelines, comparisons, and registers use the wider shell when the pattern calls for them.103- Diagrams from `diagram-design`; charts from `chart-design`.104- Print via `core/print.css`. Inspect the PDF; do not claim print support from `@media print` alone.105- No JavaScript required to read the file.106107### Pattern before theme108109Pattern answers how the reader moves; theme answers what visual voice they110hear. Do not use theme changes to simulate structural distinction.111112| Pattern | Reading movement | Types |113|---|---|---|114| `decision` | ask → options → trade-offs → next move | design-doc, discovery, proposal |115| `record` | status → settled choice → consequences | adr |116| `contract` | definitions → rules → specimens → compliance | spec, api-contract, test-report, reference |117| `procedure` | safety → steps → verification → recovery | handoff, how-to, runbook |118| `learning` | context → practice → checkpoint → takeaway | explanation, onboarding, tutorial |119| `system` | map → boundaries → interfaces → states | architecture, design-handoff |120| `incident` | impact → timeline → cause → owned action | postmortem |121| `suite` | document map → ownership → freshness | mulesoft |122123Use the type reference's default. The full layout and acceptance contract is124`core/document-patterns.md`.125126```bash127python3 "${CLAUDE_PLUGIN_ROOT}/scripts/build_document.py" \128 "${CLAUDE_PLUGIN_ROOT}/templates/longform.html" \129 --theme field-notes --out document.html130node "${CLAUDE_PLUGIN_ROOT}/scripts/export_pdf.mjs" document.html --out document.pdf131```132133`${CLAUDE_PLUGIN_ROOT}` is Claude Code's portable reference to the plugin directory. Working inside this repo, the bare `scripts/` and `templates/` paths are correct.134135## Leave alone136137- Casual edits to existing Markdown (typos, one extra paragraph, a changelog bullet).138- Metric-led reports → `analytical-document-design`.139- Slides → `presentation-design`.140- Standalone charts or diagrams.141- Restyling Markdown into HTML, or applying a theme, unless asked.142- Generating Mule XML or running MUnit. Mule markdown refresh when `mule-docs` is installed — prefer that skill.143- Rewriting a README that already has a shape the user did not ask to change.144145## Before delivering146147- [ ] Format matches the request (markdown unless they asked for designed output).148- [ ] The type's expected sections are present, or their absence is deliberate.149- [ ] Inferred claims are labelled; unresolved items are open questions.150- [ ] Every section leads with its conclusion.151- [ ] Terms are defined on first use and used consistently.152- [ ] Heading IDs are stable and text-derived; cross-references are by name.153- [ ] HTML path only: measure 62–72ch, prints without stranded headings or clipped code.154155## Reference files156157- `references/type-index.md` — slug, aliases, path, shipped types.158- `references/type-design-doc.md`159- `references/type-adr.md`160- `references/type-spec.md`161- `references/type-api-contract.md`162- `references/type-architecture.md`163- `references/type-handoff.md`164- `references/type-design-handoff.md`165- `references/type-discovery.md`166- `references/type-test-report.md`167- `references/type-postmortem.md`168- `references/type-proposal.md`169- `references/type-runbook.md`170- `references/type-onboarding.md`171- `references/type-tutorial.md`172- `references/type-how-to.md`173- `references/type-reference.md`174- `references/type-explanation.md`175- `references/type-mulesoft.md`176- `references/writing.md` — prose, headings, review mechanics.177- `references/evidence.md` — evidence states, privacy.178- `references/suites.md` — when to emit a linked set.179- `references/output.md` — format dial, HTML/PDF assembly.