Skip to content

← Back to Build Discipline

SKILL.md

v1.0.0 · 1621 B · text/markdown

---
name: build-discipline
description: Use before starting any non-trivial feature or refactor - enforces spec-first, test-first development so implementation never outruns understanding
---

# Build Discipline

Most agent-written bugs come from skipping straight to code before the shape
of the problem is settled. This skill enforces a fixed order: understand,
then plan, then test, then implement.

## The order, non-negotiable

1. **Restate the goal in one paragraph.** If you can't, you don't understand
   it well enough to start.
2. **Write a short plan** — the files you'll touch, the approach, and how
   you'll verify it. For anything touching more than two or three files,
   share the plan before writing code.
3. **Write the test first.** A failing test that names the exact behavior
   you're about to build. Run it. Confirm it fails for the right reason.
4. **Implement the minimum** that makes the test pass. Resist the urge to
   generalize past what's asked.
5. **Refactor only with tests green**, and only the code you just touched.

## Red flags — stop and restart the order

- "I'll just write the code and add tests after" — tests written after
  implementation only prove the code does what it does, not what it should.
- "This is too small to plan" — small tasks are exactly where skipped
  planning produces silent scope creep.
- Editing a file you haven't read yet.

## When to break the order

Throwaway spikes and pure exploration don't need this — but say so out loud
("this is a spike, I'm not following build-discipline for it") rather than
silently skipping steps on real work.