Spec-Driven Development (the Define stage)
Apply the discipline of an engineer who has watched a quarter of compute burn on the wrong objective and
refuses to repeat it. The cheapest place to fix a mistake is in the spec; the most expensive is in a
running job or a live cluster. A spec is text you can edit in minutes. Code, a 4,000-GPU-hour run, or a
node-pool change is not. Write the spec first, get it reviewed, then plan and build.
This skill owns one stage: Define. It does not plan the work ([[task-planning-decomposition]]), design
the system ([[ml-system-design]]), teach doc-writing craft and stakeholder alignment
([[staff-plus-engineering]]), or design the metrics ([[ml-evaluation-evals]]) — it sequences and gates
those. See [[engineering-lifecycle]] for where Define sits.
How to use this skill
- Read
spec-driven-development-guide.md in this directory — the full process with checkpoints,
the spec contents for AI infra / ML, rationalizations, red flags, and the verification gate.
- For a fill-in spec template and a worked example (serve a model at a p95 / QPS / $-budget target),
read
examples.md and imitate it.
- Right-size the spec to the blast radius. A one-line config tweak does not need an RFC; a new serving
stack or a large training run does. The gate scales with cost and risk — never skip it for anything
expensive or irreversible.
Essentials (full detail in spec-driven-development-guide.md)
- Interview before you spec. A vague ask is not a requirement. Extract what (the change), why
(the underlying goal), for whom (the consumer), constraints (budget, deadline, quota, latency),
and the success metric — before writing a line of spec or code.
- The metric is the spec. State the ML/business metric and turn it into acceptance criteria as
testable conditions ("p95 < 200 ms at 500 QPS on the eval set; quality ≥ baseline − 0.5%"). If you
can't measure done, you're not ready to start.
- Cost is a first-class section. Estimate GPU/TPU-hours and dollars before the run. An expensive
job with no cost estimate is a red flag, not a plan.
- Write scope AND non-goals. Non-goals prevent scope creep and tell reviewers what you deliberately
excluded.
- SLOs/SLAs explicitly: latency (p50/p95/p99), throughput (QPS/tokens-per-sec), availability. Vague
"fast" and "reliable" are not commitments.
- Failure modes & blast radius: what breaks, who it takes down, the rollback/exit plan. Multi-tenant
clusters and shared quota mean your failure is someone else's outage.
- Data & dependencies, security & quota: where the data comes from and its licensing/PII status;
what services/teams you depend on; quota and multi-tenancy isolation.
- Open questions are part of the spec. Listing unknowns is honest and routes the right reviewers;
hiding them defers the cost to build time at 100x the price.
- Checkpoint: the spec is reviewed and agreed before Plan/Build. A spec written and never read by a
stakeholder bought you nothing.
Related skills
[[engineering-lifecycle]] — the umbrella; Define → Plan → Build → Verify → Ship. Start here.
[[task-planning-decomposition]] — the next stage: turn the agreed spec into an ordered plan.
[[ml-system-design]] — designing the architecture the spec commits to (serving stack, training topo).
[[ml-evaluation-evals]] — designing the metric and eval harness your acceptance criteria reference.
[[staff-plus-engineering]] — RFC/design-doc writing craft, driving alignment, and review at scale.
1---2name: spec-driven-development3description: Spec-Driven Development (the Define stage)4---56# Spec-Driven Development (the Define stage)78Apply the discipline of an engineer who has watched a quarter of compute burn on the wrong objective and9refuses to repeat it. **The cheapest place to fix a mistake is in the spec; the most expensive is in a10running job or a live cluster.** A spec is text you can edit in minutes. Code, a 4,000-GPU-hour run, or a11node-pool change is not. Write the spec first, get it reviewed, *then* plan and build.1213This skill owns one stage: **Define**. It does not plan the work ([[task-planning-decomposition]]), design14the system ([[ml-system-design]]), teach doc-writing craft and stakeholder alignment15([[staff-plus-engineering]]), or design the metrics ([[ml-evaluation-evals]]) — it sequences and gates16those. See [[engineering-lifecycle]] for where Define sits.1718## How to use this skill19201. **Read `spec-driven-development-guide.md`** in this directory — the full process with checkpoints,21 the spec contents for AI infra / ML, rationalizations, red flags, and the verification gate.222. For a fill-in **spec template** and a worked example (serve a model at a p95 / QPS / $-budget target),23 read **`examples.md`** and imitate it.243. Right-size the spec to the blast radius. A one-line config tweak does not need an RFC; a new serving25 stack or a large training run does. The gate scales with cost and risk — never skip it for anything26 expensive or irreversible.2728## Essentials (full detail in `spec-driven-development-guide.md`)2930- **Interview before you spec.** A vague ask is not a requirement. Extract *what* (the change), *why*31 (the underlying goal), *for whom* (the consumer), *constraints* (budget, deadline, quota, latency),32 and the *success metric* — before writing a line of spec or code.33- **The metric is the spec.** State the ML/business metric and turn it into **acceptance criteria as34 testable conditions** ("p95 < 200 ms at 500 QPS on the eval set; quality ≥ baseline − 0.5%"). If you35 can't measure done, you're not ready to start.36- **Cost is a first-class section.** Estimate GPU/TPU-hours and dollars *before* the run. An expensive37 job with no cost estimate is a red flag, not a plan.38- **Write scope AND non-goals.** Non-goals prevent scope creep and tell reviewers what you deliberately39 excluded.40- **SLOs/SLAs explicitly:** latency (p50/p95/p99), throughput (QPS/tokens-per-sec), availability. Vague41 "fast" and "reliable" are not commitments.42- **Failure modes & blast radius:** what breaks, who it takes down, the rollback/exit plan. Multi-tenant43 clusters and shared quota mean your failure is someone else's outage.44- **Data & dependencies, security & quota:** where the data comes from and its licensing/PII status;45 what services/teams you depend on; quota and multi-tenancy isolation.46- **Open questions are part of the spec.** Listing unknowns is honest and routes the right reviewers;47 hiding them defers the cost to build time at 100x the price.48- **Checkpoint: the spec is reviewed and agreed before Plan/Build.** A spec written and never read by a49 stakeholder bought you nothing.5051## Related skills5253- `[[engineering-lifecycle]]` — the umbrella; Define → Plan → Build → Verify → Ship. Start here.54- `[[task-planning-decomposition]]` — the next stage: turn the agreed spec into an ordered plan.55- `[[ml-system-design]]` — designing the architecture the spec commits to (serving stack, training topo).56- `[[ml-evaluation-evals]]` — designing the metric and eval harness your acceptance criteria reference.57- `[[staff-plus-engineering]]` — RFC/design-doc writing craft, driving alignment, and review at scale.