From ct
Use when writing or reviewing technical documentation — READMEs, API reference, inline comments, architecture docs, runbooks, migration guides, changelogs, tutorials. Also use when user asks to "document this", "write docs", "write a README", "explain this code", "write a runbook", "improve these docs". Language- and framework-agnostic guidelines. Do NOT use for ADRs (separate pattern) or for code comments on trivial code.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ct:documentationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Language- and framework-agnostic guidelines for writing and reviewing technical documentation. Covers the reader-facing artefact only; language-specific doc tooling is out of scope.
Language- and framework-agnostic guidelines for writing and reviewing technical documentation. Covers the reader-facing artefact only; language-specific doc tooling is out of scope.
Good docs answer the reader's question without making them read the code. Bad docs restate the code in English and rot on the next refactor. The skill leans on the Diátaxis framework (https://diataxis.fr/): every doc sits in exactly one of four quadrants. Mixing quadrants in one file is the single most common anti-pattern.
Before writing a sentence, identify the quadrant. Each has a different job, reader state, and stopping condition.
| Quadrant | Audience | Goal | Stopping condition | Common mistake |
|---|---|---|---|---|
| Tutorial | Learner, new to the thing | Acquire competence via guided exercise | Reader produced a working result | Drifting into reference lists |
| How-to guide | Practitioner with a task | Solve one specific problem | The stated problem is solved | Teaching theory instead of steps |
| Reference | Practitioner needing a fact | State API / config / behaviour exactly | Every surface described once, authoritatively | Narrative tone; examples as spec |
| Explanation | Curious reader wanting "why" | Build a mental model | Model is clear enough to reason from | Listing steps reader cannot run |
If a single file tries to do two quadrants, split it.
| Type | Quadrant | Audience | MUST have | NEVER include | Success |
|---|---|---|---|---|---|
| README | How-to + links | First-time visitor | What, who-for, quickstart, links | Full API ref, architecture essays | Newcomer unblocked in <5 min |
| API reference | Reference | Integrator | Public surfaces: inputs, outputs, errors, invariants | Tutorials, rationale, war stories | Caller writes correct code without source |
| Inline comments | Explanation | Future maintainer | WHY for non-obvious decisions, invariants, workarounds | WHAT a good name conveys; ticket refs | Code survives refactor without rot |
| Architecture | Explanation | New engineers | Boundaries, data flow, trust lines, invariants, trade-offs | Line-level walk-throughs, changelog | New engineer predicts where change belongs |
| Runbook | How-to | On-call under stress | Symptoms, diagnostics, recovery, rollback, escalation, SLO impact | Theory, design rationale | Operator at 03:00 recovers without paging author |
| Migration guide | How-to | User moving versions | Breaking changes, before/after code, deprecation timeline, rollback | Marketing, feature highlights | Users upgrade with zero surprises |
| Changelog | Reference | Users scanning impact | Date, version, grouped changes, migration links | Implementation details, refactors | User decides impact in 30s |
| Tutorial | Tutorial | Learner | Single linear path, prereqs, verifiable steps, result | Branches, reference dumps | Learner completes exercise and knows it |
Default: no comment. A comment is a liability — it drifts from the code and readers trust it anyway.
Write a comment only when the WHY is non-obvious:
Do NOT:
// for issue #123) — belongs in PR description and git blame.TODO.Every line must be YES. Any NO blocks ship.
| Check | Pass condition |
|---|---|
| Quadrant named | Exactly one of tutorial / how-to / reference / explanation |
| Audience named | Reader identifiable in first paragraph |
| TL;DR present | Anything over ~200 words opens with a summary |
| Assumptions explicit | Preconditions / prerequisites listed |
| Failure modes covered | What breaks, how it manifests, how to recover |
| Examples runnable | Every code block executed at least once |
| No duplicated facts | Cross-references, not copy-paste |
| Dates on time-bound claims | Version or as of YYYY-MM |
No TODO / tbd / "coming soon" | Ship without the stub or don't ship |
| Links resolve | No 404s, no broken anchors |
| Anti-pattern | Why it fails | Fix |
|---|---|---|
| WHAT-only comments or docs | Rot silently at next refactor | Delete, or rewrite to carry WHY |
| Quadrant mixing | Readers with different goals fight the same file | Split — one quadrant per file |
| Reference dump inside README | Drowns newcomers; duplicates API docs | README keeps pointers; reference lives separately |
| Undated "recently" claims | Unverifiable; misleads after 6 months | Add as of YYYY-MM or a version |
| Untested example code | Looks authoritative; breaks for every reader | Execute every snippet |
| Docs-as-apology | Wall of prose excusing a confusing API | Fix the API; shorten the doc |
Docstring templates full of TODO | False confidence that a thing is documented | Remove the template until real content exists |
| Copy-pasting API reference into README | Two sources of truth; they diverge | Link from README to canonical reference |
| Excuse | Reality |
|---|---|
| "It's obvious, no one will misread it." | You wrote it; readers did not. |
| "Docs slow me down." | Undocumented systems slow everyone else down, forever. |
| "We'll write docs when the API stabilises." | It never stabilises. Document the current shape; update when it moves. |
| "I'll just add a comment to explain." | If a comment is required to understand it, the code probably needs to change. |
| "The tests are the documentation." | Tests describe behaviour, not intent or rationale. |
| "Nobody reads docs anyway." | They do — usually at 3 AM, during an incident. |
| "The team already knows this." | Until the team changes. Which is always. |
| "It's in the wiki / Slack / that one Notion page." | Three sources of truth means zero. Consolidate. |
Language-specific doc tooling is deliberately out of scope — pick the idiomatic tool for the ecosystem and apply this skill's principles on top.
npx claudepluginhub pvillega/claude-templates --plugin ctCreates documentation that developers actually read. Covers README craft, API docs, tutorials, and internal docs. Treats docs as a product requiring UX, marketing, and user empathy.
Generates or updates documentation for code, APIs, or systems including READMEs, API references, inline comments, technical guides, and ADRs.
Authors technical documentation through a repeatable workflow — audience analysis, Diátaxis-mode selection, structure, draft, review, publish. Covers READMEs, ADRs, API docs, and runbooks.