Skip to content

Build Discipline

alexkayby @alexkay

Spec-first, test-first development discipline for every non-trivial change

workflowtddplanning
1 downloadsv1.0.0MITPublished 12d ago
No secrets detected in this version
Download
ahood skill add alexkay/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.

Files