/trace:scaffold-docs [path]from trace
Scaffolds starter docs for a project's durable-context folder based on repo signals. One-time bootstrap after /trace:init for projects with code but little documentation.
Ships in trace. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use Claude Code’s Read, Glob, Write, and Edit tools for file operations. Use AskUserQuestion for closed choices and normal chat for open questions. Invoke referenced skills with the Skill tool. Resolve script paths from this installed skill; respect the session’s permissions.
You are bootstrapping a project's durable-context folder: suggest starter docs for the topics this repo evidences, then scaffold the ones the developer picks. Light touch — record what the repo confirms and leave prompts for the rest.
Files land in <docs-folder>/system/ (descriptive — what the codebase IS) and, for the one paired topic, also <docs-folder>/architecture/ (prescriptive — what the system MUST do). The three-category model itself is described in the READMEs /trace:init copies into place; scaffold assumes those READMEs are there.
Before doing anything, read:
[path] argument resolves into a scope rootResolve the scope per scope-resolution.md — $ARGUMENTS if given, otherwise cwd. All globs, reads, and writes in the phases below operate inside it (including Phase 2's signal scan).
Resolve the scope's durable-context folder per docs-folder-resolution.md. The folder must contain system/README.md and architecture/README.md (placed by /trace:init). If either is missing, tell the developer to run /trace:init first (pass the same path argument when the scope isn't cwd) and stop — scaffold relies on the canonical structure being in place.
List the .md files already in <docs-folder>/system/ and <docs-folder>/architecture/. Also note anything at the <docs-folder>/ root (a legacy location from earlier plugin versions). Never suggest a topic an existing file already covers.
Glob for cheap signals and map them to candidate topics. Presence is enough at this stage — don't read deeply yet.
| Signal in the repo | Candidate topic | Lands in |
|---|---|---|
| Auth / session / token library, or login/permission code | security.md — trust boundaries, authn/authz, secrets | system/ + paired architecture/ |
| DB driver / ORM dependency, or a schema/models directory | data-layer.md — engine, schema shape, access patterns | system/ |
| Migrations directory | migrations.md — how migrations are created and run | system/ |
| Backend HTTP framework or route definitions | api.md — endpoints, error handling, validation | system/ |
| Frontend framework with an HTTP client | api-integration.md — how the frontend talks to its backend | system/ |
| Queue / message-bus / background-job dependency | events.md — async flows and contracts | system/ |
Always consider security.md even without an auth library — every project has a trust boundary somewhere. Suggest only topics the repo evidences plus security; keep the list short.
Present the tailored shortlist. For each: the signal that prompted it, the proposed filename(s) and folder(s), and one line on what it would cover. Then use the question control (multi-select) to choose which to scaffold, plus an option to add a topic of their own. Filenames are suggestions — use the project's own vocabulary if it differs (e.g. kafka.md over events.md if the codebase calls it that).
For each chosen topic, take a quick look to confirm what the repo evidences (DB engine, migrations path, auth library, etc.), then write:
<docs-folder>/system/<topic>.md (descriptive — every chosen topic gets this):
## Still to document list of 2–4 prompts, phrased as questions, for what you couldn't infer.<docs-folder>/architecture/<topic>.md (only for security, since it pairs by default):
## Still to document list of 2–4 MUST-rule prompts: "What MUST be true about token expiry?", "What MUST be validated at the trust boundary?". Do not invent rules — the developer fills these.Apply authoring-rules.md: state confirmed facts as facts; put everything uncertain under prompts. No speculation. example-scaffold-output.md shows the target shape and length for both kinds of file.
Show the developer the scaffolded files.
Tell the developer:
## Still to document prompts — with you now, or on their own./trace:distil keeps system/ and architecture/ files current as work happens.architecture/<topic>.md; the security pair shows the shape.system/<topic>.md and architecture/<topic>.md describe the same area from descriptive and prescriptive sides. Scaffold seeds the pairing only for security; other pairings emerge later./trace:distil's job.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub axakon/trace --plugin trace11 skills in this plugin
/adrRecord an architecture decision as a lightweight, immutable ADR in the scope's docs folder. Owns the ADR template, numbering, and write. Invokable directly for a direct-path decision, or by /trace:spec at handoff./agents-md-setupSet up or review the project's AGENTS.md through an interactive interview with the developer/commit-messageDraft a single commit's message — imperative-mood title plus a short why body, optional decision bullets, plain text (no markdown). Use when the developer explicitly asks for a commit message, asks to fix a message before amending, or asks the agent to perform the commit on their behalf./context-graphMeasure context weight per directory: AGENTS.md chains, @ imports, gotchas, on-demand docs./distilEvaluate recent changes and propose updates to the project's permanent context (AGENTS.md or the scope's docs folder) when something durable was learned/doctorValidate a TRACE-adopted scope against TRACE's own conventions — doc structure, marker pairs, AGENTS.md spec, ADR numbering and immutability, working-note banners, relative links — then guide the fixes. Owns the resolution flow for ADR number collisions left by merged branches. Useful after merges, before releases, or whenever the structure feels off.