Course outline
The CTO's playbook for AI coding agents · Module 3: Spec-driven development at scale
A spec template teams will actually use
One lightweight, org-standard spec template, sized by risk tier. What goes in, what stays in the code and tests, and how to keep it short enough that people don't route around it.
Lesson 10 / 20 · ⏱ 8 min
The fastest way to kill spec-driven development is a twelve-section template nobody wants to fill. The second fastest is no template at all, so every team invents its own and agents get a different shape of input each time. You want one short, org-standard format that scales up with risk, not with bureaucracy.
The template
Keep it as a Markdown file in the repo, next to the code it describes, so agents and reviewers read the same thing.
# Spec: <short name> Tier: 1 | 2 | 3
Owner: <name> Reviewer(s): <names> Status: draft | approved | done
## Problem
One paragraph. Who hurts today, and how we'll know it's fixed.
## Scope
In: what this change does
Out: what it explicitly does not do (agents love to "helpfully" expand)
## Constraints
Non-negotiables: performance budgets, compatibility, data rules,
security or compliance requirements, systems that must not change.
## Acceptance criteria
- [ ] Given ..., when ..., then ... (each one testable)
- [ ] ...
## Approach (tier 2+)
Chosen design in a few lines, alternatives rejected and why.
## Risks and rollout (tier 2+)
What could break, blast radius, flag or migration plan, rollback.
## Open questions
Anything the agent must NOT guess. Resolve before approval.
Two sections do most of the work. Out of scope stops agents from wandering. Acceptance criteria give both the agent and the reviewer the same finish line.
Size it by risk, not by effort
An agent can turn a two-line spec into a 2,000-line diff. So size the spec by what happens if it’s wrong, not by how long the code takes.
| Tier | Typical change | Sections required | Reviewer |
|---|---|---|---|
| 1. Low risk | Internal tool tweak, copy change, isolated refactor with tests | Problem, scope, acceptance criteria | Any teammate, async |
| 2. Medium | New feature in one service, schema addition, new dependency | Tier 1 plus constraints, approach, risks | Tech lead or code owner |
| 3. High | Auth, payments, PII, cross-service contracts, data migrations | Full template plus explicit rollback and sign-off | Owner plus security or platform |
What stays out
A spec describes what and why. The code and tests describe how. When a spec starts listing function names and loop structures, it goes stale on the first refactor and turns reviewers into proofreaders.
🎮 Spec or code and tests?
1 / 8 · Score: 0
Where does this information belong?
Getting adoption
- Start with tier 2. Tier 1 feels like overhead, tier 3 already has process. Tier 2 is where specs pay off first.
- Let agents draft. An agent can turn a ticket and a conversation into a first-draft spec. Humans edit and approve; nobody starts from a blank page.
- Link, don’t copy. Constraints that apply everywhere belong in shared context (lesson 3-4), referenced from the spec, not pasted into each one.
- Retire sections nobody reads. Review the template every quarter. If a section is always “N/A”, remove it.
Before you move on
✅ Key takeaways
0 / 4 completed