Specs — Spec-Driven Development for Law AI¶
This directory holds the persistent, versioned specifications that drive every non-trivial change in the codebase: the Law AI content of the fleet's spec-driven loop (docs/spec-driven.md). The machinery that validates and drives them — the /spec-driven:* chain, the spec validator, the backlog lint — is the fleet hub's, consumed by reference; nothing here depends on a script in this repo.
Layout¶
specs/
├── _template/ # Copy this to start a new spec (repo-owned; seeded once from the hub kit)
│ ├── spec.md # WHAT + WHY (requirements, NFRs, acceptance criteria, the §13 review question)
│ ├── plan.md # HOW (architecture, tech choices, risks)
│ └── tasks.md # Granular, agent-assignable tasks with acceptance tests + Follow-ups Discovered
├── _review_questions.json # The questions a spec must answer (constitution §13), read by the validator
└── NNN-feature-slug/ # One directory per feature/epic, NNN = zero-padded id
Workflow¶
/spec-driven:specify <BL-id or intent>→ claims the backlog item and fillsspec.md(copies_template/)./spec-driven:clarify <slug>→ resolves open questions inline./spec-driven:plan <slug>→ fillsplan.md./spec-driven:tasks <slug>→ fillstasks.md.- Open PR. CI's
Spec Drift Gateruns the fleet'sspec_validator.py --strict— every requirement inspec.mdmust map to at least one task intasks.md, every open question must be resolved, and every review question answered.make lint-specsruns the same gate locally. /spec-driven:implement T-NNNon tasks; referencespecs/NNN-...in commits/PR descriptions; mirror follow-ups into BACKLOG.md.
Rules¶
- Specs are code: review them in PRs, never edit historical specs in-place after merge — open an amendment spec instead.
- Every spec MUST satisfy docs/constitution.md.
- Specs are loaded into agent RAG context — keep them concrete and free of marketing language.