Skip to main content

spec: define done before code

Writes numbered acceptance checks before nontrivial implementation so agents stop filling intent gaps from training data alone.

Source facts

Repository
MasihMoafi/skills
Last source activity
November 3, 2026 at 08:37
Detected SKILL.md language
English
Stars
8
Forks
0

Uses

Use for nontrivial features, requirements, PRDs, vision docs or acceptance criteria—not trivial edits, exploration, spikes or prototypes.

How to use

Size the loop to the task → write numbered “done” checks with observable acceptance → plan, execute, verify → return to Specify when evidence changes intent. Review the spec yourself; that review is the leverage.

Limitations

Adds no approval gate; ask only about material gaps. Spikes first when behavior is still unknown, then specify.

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
name
spec
description
Use for nontrivial implementation, requirements, a PRD or vision document, or acceptance criteria. Defines done before code. Not for trivial edits, exploration, spikes or prototypes.
# Spec-driven development Define what done means before code, because an agent fills every gap in intent from its training data. A spec adds no approval gate; ask only about material gaps. Size the loop to the task (Stanford CS146S, 29 Sep 2026): - a copy change or small fix: just ask the agent; - a small feature across several files: one plan; - a medium feature: research, then plan, in separate sessions; - a big refactor or migration: several rounds of research and plans, split into stacked issues, one agent each. For discovery, spike first and specify once the behavior is known. Review the spec and plan yourself; that review is where the leverage is. The loop: **Specify, Plan, Execute, Verify.** Go back to Specify when evidence changes the intent. ## 1. Specify Numbered items, each with an acceptance check and a status, written before work begins. A check is observable ("feature works" is not one). When the change touches money, data, security or an external integration, add all four risk checks: 1. **Failure:** what happens when a dependency or write fails. 2. **Concurrency:** what happens when actors or async events collide. 3. **Observability:** how production behavior is measured. 4. **Rollback:** how the old behavior comes back, and how that is checked. When intent has gaps, interview the user (goal, constraints, criteria, non-goals, edge cases) before writing. Keep the spec in version control beside the code it governs. Two tiers, after [OpenSpec](https://openspec.dev): `specs/` holds the current truth of each capability; a change is a short proposal with its delta against that truth, and once shipped its delta is merged into `specs/` and the proposal archived. No competing specs for one capability. ```markdown # SPEC: [Feature] Goal: [1-3 sentences: the problem and the outcome] Invariants: [contracts and rules that must not break] Constraints: [stack, banned dependencies, limits] | # | Item | Acceptance check | Status | | --- | --- | --- | --- | | 1 | [observable happy path] | [command or action → result] | todo | | 2 | [failure / concurrency / rollback, as relevant] | … | todo | Non-goals: [what must not be touched] Stop and ask: [3-5 task-specific conditions, e.g. a test still fails after 3 fixes; data would be deleted outside a test environment] ``` ## 2. Plan Read the spec and the codebase's conventions; write the approach, the trade-off chosen and why, the files affected and the order. Then split it into tasks: one atomic change each, ordered by dependency, each with a binary done-check (if it needs "and" twice, split it). Rate each task's **importance** (foundational, important, nice-to-have) and **difficulty** (easy, medium, hard) separately: importance is value, difficulty routes the work. ## 3. Execute One task per fresh session when a combined diff would be too big to review; otherwise run the list in one session. Tick each item's status as its check passes. When reality contradicts the spec, stop, update the spec, then resume. ## 4. Verify Every project gate passes first (lint, types, tests). A claim of "passes" or "fixed" needs the command run in this turn and its full output read; an earlier run or a subagent's report is a lead, not evidence. Evidence ranks: an agent's claim (untrusted) < automated tests or CI (necessary, not sufficient) < a real end-to-end run < the user's own acceptance, the only thing that closes "done". Name the level behind every completion claim, and give the user a one-line check per item. For a vision document or PRD, follow `project-docs` (`VISION.md`): thesis, purpose, value, non-goals, kept apart from status. Source: *AI-Native Software Engineering*, chapters 5 and 6.
View on GitHub