/project-toolkit:api-doc-authoringfrom project-toolkit
Writes API documentation structured around developer use cases with executed examples and failure recovery. Activated by 'document this API' or 'write the API guide'.
Ships in project-toolkit. 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; scripts run unread.
Document the task developers are trying to complete, prove the examples run, and make failure recovery first-class.
API documentation is entered through a developer use case, not through the implementation's endpoint inventory. A tired developer should reach a working path and recover from common failures without reverse-engineering the API.
This skill owns how API documentation is structured and validated for use. It does not own claim checking, prose style, or API design:
| Concern | Owner | How this skill uses it |
|---|---|---|
| Behavioral and cross-document claims | doc-accuracy | Runs through the existing lifecycle gates. No second accuracy gate here. |
| DRY, YAGNI, derived mutable facts | code-qualities-assessment | Link to the canonical fact. Do not restate it in each example. |
| Voice, banned words, dashes | voice.md and universal.md | Consumed as written. This skill adds no style guide. |
| API and schema design | the business-behavior-first design owner | Describe the resulting contract. Never redefine it. |
| Capability graph | check_capability_graph.py | This skill's owns and depends-on metadata. doc-accuracy declares no capability block, so it is cited, not declared. |
document this API, write the API guide, quickstart for this endpoint,
add examples to the API docs, document the error responses
Apply when a developer will call the API to finish a task and the docs are new, rewritten, or touched by an API contract change.
Skip the narrative when the artifact is a true reference listing, such as a generated schema page, or the API is trivial or internal with one obvious call. Write the reference, mark it as reference, and stop. Do not invent a use case to fill space.
developer goal -> minimum working request -> expected response
-> common failures + remediation -> advanced options
-> execute examples, then doc-accuracy through the lifecycle
State the goal as a developer task ("place an order and check it"), not an
endpoint name. List the operations that together finish it. Several CRUD
endpoints that implement one workflow become one entry point, in the order a
developer calls them. Read references/use-case-flow.md for the entry shape.
Show the smallest request that succeeds: required inputs only. Follow it with the response and the next action (which field feeds the next call). Optional parameters wait until the working path is complete.
For each operation, list the failures a developer is likely to hit. Each row
carries status or error name, likely cause, and action. Write a cause or action
only when the contract or a run supports it. Where it does not, write Unknown.
Never promise exhaustive error coverage the contract cannot support.
Optional knobs, rare behavior, and the exhaustive field table come after the basic workflow succeeds. Keep similar use cases in the same order: request, response, errors.
Mark each runnable example so it can be re-run (references/example-verification.md
has the syntax and the evidence contract), then run it against a local, test, or
mock API:
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/api-doc-authoring/scripts/api_examples.py run <doc.md> --base-url http://127.0.0.1:<port> --evidence <evidence.json>; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
Never paste console output or a response from memory. A response block with no
executed request is flagged by lint and cannot be called verified.
Documentation written here is documentation. The test skill's Gate 5 and the
review skill's doc-accuracy axis (category docs-and-instructions) already
compose doc-accuracy for it; follow
${COPILOT_PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-.claude}}/skills/test/references/doc-accuracy-gate.md.
Do not run a parallel
accuracy gate.
When an API contract changes, find the affected examples and re-run them:
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/api-doc-authoring/scripts/api_examples.py list <docs...> --touching /orders; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
A changed request shape makes the stale example fail. It does not stay trusted prose.
| Subcommand | Purpose | Exit codes |
|---|---|---|
list | Examples in the docs, filtered by --touching <path prefix> | 0 listed, 2 bad input |
lint | Missing ids or status, unverified responses, error rows without cause or action | 0 clean, 1 findings, 2 bad input or no examples found |
run | Execute examples, compare status and documented response, write evidence. --evidence refuses a symlink, a non-regular file, a path outside the working directory, or an existing file that is not a prior report | 0 all pass, 1 stale, failing, or lint findings (verdict FAIL even when every HTTP comparison passed), 2 unverifiable |
Stdlib only. api_examples.py imports the parser doc_examples.py beside it. run refuses a non-loopback host unless --allow-remote is passed,
because a doc example can create or delete data. It sends only to the base URL host: a request path must start with /, and redirects are returned as replies, never followed. Loopback requests ignore proxy settings.
Exit 2 means unverified, never pass. It covers:
lint found no example to check;Content-Length, or slower than 30 s;A stop with --evidence writes the file either way. The verdict is UNVERIFIED when nothing had failed.
The evidence file is owner-only (mode 0o600), since it records request URLs. The write never replaces a file that changed after the check. --evidence needs no-follow, dir_fd file calls, so Windows refuses it. There, run without it and save the report printed to stdout.
A stop that already has a failed example or lint finding exits 1. Its evidence file lists the examples that never ran under deadline_exceeded. Under request_failed it names the example that could not finish and the examples after it. A request that missed its 30 s deadline may still reach the server, so check a mutating example by hand.
| Avoid | Instead |
|---|---|
| Alphabetical endpoint list as the front door | Use-case entry, reference after |
| A response block copied from memory | Run the request, keep the evidence |
| Error rows that list only a status name | Add cause and action, or Unknown |
| Invented remediation for an unspecified failure | Unknown, and file the gap |
| Optional parameters in the first example | Required inputs only, options later |
| Forcing narrative onto a reference-only page | Write the reference and say so |
| Copying doc-accuracy or style rules into the page | Cite the owner |
lint returns PASS and run returns PASS at the final head, with the evidence file kept.Unknown.doc-accuracy ran through the lifecycle gate, not a second gate here.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub rjmurillo/ai-agents --plugin project-toolkit105 skills in this plugin
/adr-generatorCreate comprehensive Architectural Decision Records (ADRs). Researches the destination directory to detect existing template conventions, gathers context, determines next ADR number, generates the ADR, validates completeness, and saves. Supports multiple ADR formats (MADR, Nygard, Alexandrian, project canonical). Use when documenting technical decisions, creating new ADR files, or capturing rationale so future readers can revisit a choice. Use when you say "write an ADR", "document this decision", "document these design choices", "record why we chose this", "capture the rationale", or "for future maintainers", or when creating an ADR-like markdown file under docs/decisions/, docs/adr/, docs/architecture/, architecture/decisions/, or .project-toolkit/architecture/. Do NOT use to debate or review an existing ADR (use adr-review)./adr-reviewMulti-agent debate orchestration for Architecture Decision Records. Automatically triggers on ADR create/edit/delete. Coordinates architect, critic, independent-thinker, security, analyst, and high-level-advisor agents in structured debate rounds until consensus. Use when you say "review this ADR", when an ADR is created/edited/deleted, or when reviewing, accepting, or updating a decision file under .project-toolkit/architecture/, docs/architecture/, docs/decisions/, docs/adr/, or architecture/decisions/, including intent like "review this decision record" or "check this rationale for future maintainers". Do NOT use to author a new ADR (use adr-generator).2 plugins in one repository ship this exact skill · first indexed Nov 13, 2026
Other plugins' skills for the same job