spec-synclisted
Install: claude install-skill buildd-ai/buildd
# Spec-Sync
Spec-driven development for buildd. **Code is the source of truth; `docs/SPEC.md`
is its canonical written form; the doc/site repos are outputs.** This skill keeps
that chain from rotting.
## Mental model
```
code (schema + routes + runner) ──► docs/SPEC.md ──► buildd-docs / buildd-site
(truth) (canonical) (downstream outputs)
▲ │
└──────────── drift tasks ◄──────────────┘
```
Never edit SPEC.md to match the docs. Edit it to match the **code**, then fix the
docs to match SPEC.md.
## When to use
- Re-grounding the spec after drift has accumulated.
- After a schema (`packages/core/db/schema.ts`) or API-route change that alters the
domain model — update SPEC.md §2/§4 in the same PR.
- Before refreshing `buildd-docs` or `buildd-site`.
- Periodic drift audit (regenerate `docs/reports/doc-drift-punchlist.md`).
## The loop (proven pipeline)
```
ingest (clean code corpus) → retrieve (surface candidates) → JUDGE (agent reads evidence) → emit drift
```
1. **Re-derive truth.** `schema.ts` (tables/enums), `api/**` routes, `apps/runner/src/backends/`
are ground truth. Don't trust the doc repos. Keep `docs/SPEC.md` matching them.
2. **Ingest a CLEAN code corpus.** Exclude history — migrations and tests keep removed
features semantically "alive" (a `CREATE TABLE objectives` migration makes "objectives"
look implemented fore