From swd
Bootstrap or extend a repo's documentation for coding agents. Creates AGENTS.md + docs/ structure (architecture, guidelines, product-specs with stable IDs and invariants). Use when the user asks to "document the project for coding agents", "set up agent docs", "add AGENTS.md", "create docs/ structure", or asks to add a new feature spec / invariant in a repo that already follows this pattern.
How this skill is triggered — by the user, by Claude, or both
Slash command
/swd:repo-docsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill bootstraps a documentation layout designed for LLM-assisted development: every project area has a stable, addressable home, every product behavior has a unique ID, and every change has a clear consultation path.
This skill bootstraps a documentation layout designed for LLM-assisted development: every project area has a stable, addressable home, every product behavior has a unique ID, and every change has a clear consultation path.
Do not invoke for one-off README edits or for repos that already have a different doc convention without confirming with the user.
<repo-root>/
├── AGENTS.md
└── docs/
├── README.md
├── architecture.md
├── guidelines.md
└── product-specs/
├── README.md
├── invariants.md
└── <feature>.md (one per feature area)
| File | Purpose | Do not put here |
|---|---|---|
AGENTS.md | Project elevator pitch + tech stack + brief architecture + index of every doc with load hints | Long architectural rationale, full specs |
docs/README.md | How to manage docs/ itself: spec format rules, ID conventions, when to update what, file naming | Project content |
docs/architecture.md | High-level architecture, layer boundaries, important technical assumptions, migration paths | Implementation tutorials |
docs/guidelines.md | Process rules: lint/test policy, planning, regression CRA (5-whys), doc-update protocol | Product behavior |
docs/product-specs/README.md | Spec format requirements (testability, ID rules) + index of feature spec files | Feature behavior |
docs/product-specs/invariants.md | Conditions that hold across the system. Prefix INV. Don't have to be testable in isolation. | Feature-level behavior |
docs/product-specs/<feature>.md | Testable behaviors for one feature area. Each has a unique PREFIX-NUM ID. | Implementation details |
Each feature spec is:
LifecycleEnum Zod schema validates input".**Testable:** line. If you find yourself wanting to add one, rewrite the body until it's no longer needed.### PREFIX-NUM: Short title heading. PREFIX is shared by all specs in one file (e.g., CMP in companies.md). NUM is unique within the file and never reused.Invariants are different:
INV-7) but they describe system-wide properties, not feature behaviors.ID stability:
Before writing anything:
README.md, package.json, source layout, any existing SPEC.md or design docsIf the repo already has agent docs in this pattern, skip bootstrapping and only add/edit the requested files.
Before creating files, propose:
companies.md, deals.md, tasks.md)CMP, DEAL, TASK)Ask before creating. The user's preferred granularity matters more than your guess.
docs/product-specs/invariants.md — the floor; everything else references itdocs/product-specs/<feature>.md files — one per feature areadocs/product-specs/README.md — index + format rulesdocs/architecture.md — layers, decisions, assumptionsdocs/guidelines.md — process rulesdocs/README.md — meta-doc on managing docs/AGENTS.md — top-level overview + index of everythingSee templates/ in this skill directory for ready-to-fill skeletons. They embed all the format requirements.
AGENTS.md indexes every other doc with a one-line summary and a "load when…" hintdocs/product-specs/README.md indexes every spec file with prefix + summary### INV-N: Short title + 1–3 sentence bodyPrefix: \XXX`.` line--- separator### XXX-N: Short title + 1–3 sentence body that's precise enough to derive a test fromdocs/ (table)validateLifecycle function returns false for invalid stages" is not a spec; "Lifecycle stage is one of …" is.**Testable:** line. If the body isn't already testable, rewrite the body.CMP-1, CMP-2, CMP-4.The skill is complete when all of these are true. Each item is answerable with evidence — a file path, a grep result, a user confirmation — not a vibe.
**Testable:** line. If the body isn't self-evidently testable, the body is rewritten — not annotated.INV-N ID. Invariants live in invariants.md, not scattered into feature specs.AGENTS.md indexes every file under docs/; docs/product-specs/README.md indexes every feature spec; every see INV-N / see XXX-N reference points to something that exists.AGENTS.md ~150 lines, each feature spec 5–15 items at 1–3 sentences, architecture 1–3 pages. Over-budget files are split or trimmed.If a checkbox cannot be ticked honestly, the skill is not done — return to the step that produces it.
The whole point of this layout is that an agent (or human) can quickly find the doc that answers their question. Long docs defeat that purpose. Aim for:
If a spec file is growing past ~15 items, consider splitting it.
npx claudepluginhub korya/swd-skills --plugin swdProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.