This is a template repo for spec‑driven, agentic software development. Most projects that adopt it will replace this file with their own contributing guide. The version below is the contributing guide for this template — the work of evolving the workflow itself.
Read these in order:
README.md— what this repo is and where everything lives.AGENTS.md— operating rules every agent (and human) follows.memory/constitution.md— governing principles. Override only with an ADR.docs/specorator.md— the full workflow definition..claude/memory/MEMORY.md— operational memory (workflow rules + project state).
The contribution workflow for this template uses the workflow it ships. Even meta‑changes — a new template, a renamed agent, a tightened quality gate — go through /spec:idea → /spec:research → /spec:requirements → … → /spec:retro. The repo is its own dogfood.
Concretely:
- Branch. Cut a fresh topic branch off the integration branch. Use one of the standard prefixes — see
docs/branching.md. - Worktree. Put the branch in
.worktrees/<slug>/. Seedocs/worktrees.md. - Stage. Walk the appropriate workflow stages for the change you're making. A typo fix doesn't need
/spec:research; a new agent role does. - Verify. Run
npm run verifygreen before pushing. Seedocs/verify-gate.md. - PR. One concern per PR; never stack. See
feedback_pr_hygiene.md. - Review. Address feedback with follow‑up commits, not rebases. See
feedback_pr_workflow.md. - Merge. Maintainer merges (or autonomous‑merge per
feedback_autonomous_merge.md).
| Kind | How |
|---|---|
| Fix a typo / broken link in a doc. | Direct PR. No spec needed. |
Add a feedback_*.md distilling a recurring lesson. |
PR under chore(memory): …. Keep it short, link to the example that motivated it. |
| Tighten an existing template. | PR under docs(templates): …. Describe what was missing and why the template now catches it. |
| Add a new template / slash command / agent role. | Open an ADR first. The constitution makes new roles ADR‑gated. |
| Add a new operational bot. | Add agents/operational/<name>/PROMPT.md and README.md. Must follow the eight‑section common shape (see agents/operational/README.md). |
| Regenerate generated docs. | Run npm run fix for all generated surfaces, or npm run fix:adr-index / npm run fix:commands / npm run fix:script-docs for one surface, review the generated output, then run npm run verify. |
| Replace a stage in the workflow. | ADR. Stages map 1:1 to quality gates and IDs; replacing one is a constitutional‑level change. |
Tweak .claude/settings.json defaults. |
PR. Loosening a deny rule needs an ADR; tightening one does not. |
Add, rename, or remove a file under docs/. |
PR must also update docs/README.md so the Diátaxis hub stays accurate. The hub is the index of record; orphaned files are not allowed to ship. |
The user-facing documentation lives in docs/ and is organised by Diátaxis — Tutorial, How-to, Reference, Explanation. Two rules:
- The hub is canonical. Any PR that adds, renames, or removes a file anywhere under
docs/— includingdocs/how-to/,docs/tutorials/, anddocs/adr/— must updatedocs/README.mdin the same PR. Excluded sub-collections (which grow on their own internal indices, not the hub):archive/,daily-reviews/,postmortems/,issues/,plans/,superpowers/,steering/,scripts/(regenerable TypeDoc),glossary/(one-file-per-term per ADR-0010). Thedocs-review-botflags PRs that touchdocs/without touching the hub. - Recipes use the template. A new How-to guide starts from
docs/how-to/_template.md. Keep every section other than## Stepsto two sentences; why-content goes in Explanation, not in the recipe.
- Adding a tool to an agent's tool list to "fix" the agent. Tool restrictions on agents are deliberate. If an agent needs a tool it doesn't have, the work it's being asked to do is the wrong shape. Open an issue.
- Bypassing verify with
--no-verify/ commit hooks off. Seefeedback_pr_hygiene.md. - Stacked PRs. One concern per branch. If you discover a second concern mid‑PR, open a second branch.
- Editing an ADR's body. ADR bodies are immutable. To change a decision, supersede the ADR.
- Editing files under
docs/archive/. Archive is read‑only by convention.
Both humans and agents contribute via the same workflow. Agents have narrower tool lists than humans — they cannot edit outside their scope, cannot push to protected branches, cannot bypass verify. Those constraints are part of the workflow's safety story; preserve them.
If you're driving an agent‑heavy session:
- Start with
/spec:startto set up the feature directory. - Use the orchestrator agent to route between stages — don't pick stages by hand.
- Mark stages complete only when their quality gate is green. The orchestrator won't let you advance past a red gate without an explicit override.
- Run
/spec:retroat the end. The retrospective is mandatory, not optional (Article X — Iteration).
- Markdown for all artifacts. Concise + precise beats long + complete in early iterations.
- Filenames are kebab‑case.
- IDs are stable:
REQ-<AREA>-NNN,T-<AREA>-NNN,TEST-<AREA>-NNN,ADR-NNNN. - Commit messages: imperative mood, reference IDs (
feat(spec): add T-AUTH-014 password reset). - ADR bodies are immutable. The only fields ever updated on an existing ADR are
statusandsuperseded-by.
The constitution's Article VII — Human Oversight reserves intent, priorities, and acceptance for humans. If you're an agent and a question of intent comes up, escalate — don't invent. If you're a human and an agent escalates, give a clear answer; "use your judgement" is rarely the right one.
MIT — same as the repo.