/tw:docs-code-samplesfrom Technical Writing Skills
Writing and maintaining the code in documentation — docs pages, tutorials, API references: a sample complete and runnable, eliding correctly, expected output and the likely error, code built up step by step in a tutorial, testing so samples don't rot, placeholder conventions, languages at parity, no insecure practice a reader will copy, copy-paste ergonomics, and recording the version verified against. Use on "code example", "code sample", "snippet", "the example doesn't work", "add an example", "tutorial code", "test the docs examples".
Ships in Technical Writing Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A reader copies a sample before reading the paragraph above it. Every rule here follows from that: the sample has to work on arrival, and it has to be safe to run.
A sample is also the most perishable content in any piece — a docs page or a published tutorial alike. It's correct on the day it's written and silently wrong by the next release unless something checks it.
Before applying this skill, find the guide the writing answers to and read it — the project's style guide and conventions:
AGENTS.md names (its style guide), or, for a guide kept outside the repo, what the user's personal agent instructions name; otherwise the contributing docs.Voice, person, tone, terminology, formatting choices and who the reader is come from that guide, never from this skill.
docs-standards is the default.Read the answers from the request, the guide, the project (its package files, lockfile and existing samples) first; ask only what's missing. Ask with the app's question tool where it has one, so the choices can be picked; otherwise as a numbered list answered by number. Offer choices where the answers are known and a short typed answer otherwise.
PROJECT_ID), the default where the guide sets none.config that appears from nowhere, no type that's never constructed.// your logic here in the middle of the thing being demonstrated is the defect this whole skill exists to prevent.// Configure the client, # Configure the client), never ... or … (Google) — a reader can't tell an ellipsis from code, and in some languages, such as Python, ... is valid code that runs. Filling the gap with plausible-looking calls that don't exist is never honest.PROJECT_ID), no possessives (PROJECT_ID, never MY_PROJECT_ID), and after the sample, a list introduced with "Replace the following:" that explains each one in the order it appears.example.com, example.org, example.net and the .example top-level domain (RFC 2606, RFC 6761); the IPv4 ranges 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 (RFC 5737); the IPv6 prefix 2001:db8::/32 (RFC 3849); North American phone numbers 555-0100 to 555-0199 (common practice); UK mobile numbers 07700 900000 to 07700 900999, set aside for drama (Ofcom). Never a real customer's data, a real person's details, or a real internal hostname.Readers copy samples into production, unchanged, at a rate that surprises everyone. A sample is an implicit recommendation:
Pick one, and be honest about which you have:
And regardless:
A tutorial or a build-along article doesn't show one sample; it builds a working project in steps, and the reader types or pastes along. Everything above still holds for each block, and these add to it:
Each is a yes or no:
docs-writing-standards and its house-voice checklist. Code on a documentation page → docs-standards.developer-docs, or api-reference for request and response examples on an endpoint.demo-project in content-writing-skills. Quickstart samples in a product repository's front door → readmes.sme-interviews.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub timonwa/technical-writing-skills --plugin tw23 skills in this plugin
/api-referenceWriting and maintaining the documentation for an API a developer has to integrate against — the reference itself (endpoints, parameters, status codes, error tables, response examples), plus the pages around it that make it usable: authentication, a quickstart, pagination, rate limits, webhooks, versioning and deprecation. Covers writing the prose fields inside an OpenAPI or similar spec as well as hand-written pages. Use on "API docs", "API reference", "document this endpoint", "OpenAPI description", "SDK docs", "webhook docs"./codebase-researchFinding documentation facts in a codebase you didn't write — where defaults, limits, error strings, UI labels, env vars and the public surface actually live, reading for names and values rather than logic, searching backwards from the string a user sees, using tests as a behaviour spec, and the traps that produce confidently wrong docs. Use on "read the code", "check the source", "where is this defined", "what's the default", "is this still used", "find out how this works"./content-auditManually invoked. Inventories an existing documentation set and judges its shape rather than its defects — every page with its type, audience, owner, last-verified date and usage, a keep/merge/split/rewrite/retire verdict for each, duplicate clusters, orphans and ghosts, navigation depth, and a gap analysis against what readers are actually trying to do. Outputs the inventory and a prioritized writing queue. Never edits a page./developer-docsWriting and restructuring developer-facing documentation-site pages in any framework or platform — verify against source when the code is available, one clear focus per page, link integrity when moving pages, prose before every code block, runnable examples, canonical-page linking instead of duplication, one term per concept, MDX and component import hygiene, and next-steps footers. Use on "docs page", "write the docs for", "restructure the docs", "MDX page", "developer guide"./docs-ai-checkManually invoked. Checks whether writing (a docs page, a folder of pages or a diff) reads as machine-written, and reports the specific tells rather than a verdict: citations that don't hold, em-dash frequency and pattern, blacklisted vocabulary and phrases, the structural tells (uniform section lengths, lists of exactly three, summaries that restate, closers that congratulate), hollow claims, and rhythm. Returns a rewrite for each flagged passage, then asks which to apply./docs-auditManually invoked. Audits a body of documentation for defects a reader would hit — claims that no longer match the product, broken links and anchors, navigation integrity, duplicated and contradictory content, missing coverage, stale images, and content nobody has verified in months. Works on a docs repo, an exported help centre, or any folder of documents. Verifies each finding and writes a prioritized report. Never edits a page.