Specs first, evidence before done: how I build with Claude Code
The Claude Code setup and the spec-first, test-first loop my team and I run every day, from ticket to merged pull request.
- Role
- Senior engineer, leading a team of 4
- Collaboration
- Peer review and QA on every pull request
- Core tools
- Claude Code · CLAUDE.md · Skills · MCP · Hooks · Permission rules · Subagents
Intent → Spec → Plan → Test-first build → Fresh review → Evidence → Release
In this post
I started with GitHub Copilot: completions in the editor and a chat that knew the file in front of me. It made me faster at writing code. It did not change how I decide what to build, how I check it, or how I ship it.
Claude Code is a different kind of tool. It reads the whole repository, runs the tests, drives a browser and works through a plan for an hour. That power cuts both ways: an agent can build the wrong thing very fast and then report that everything passed. So I don't measure it by how much code it writes. I measure it by whether every step leaves something a person can read, question and reject. That is the loop below, and it is how my team works with it every day.
Turn a request into a spec
An agent is only as good as the problem it's given. For anything bigger than a small fix, I write the problem down before any code exists.
- Requirements say what the change must do, for whom, and what "done" means.
- A design doc lays out the goals, the non-goals, the constraints and two or three approaches with their trade-offs. I pick one; the doc records why.
- An architecture doc comes in when a change crosses services. It names each component, the data flow, the API contracts and what happens when each part fails.
On our workflow platform these are ordinary documents, not ceremony: a spec for a new field type in the schema-driven form engine, a requirements doc for a new connector, a design note before a workflow became a governed tool behind the MCP gateway. The agent helps draft them, finds gaps by reading the existing code, and asks only the questions that would change the build. Then a fresh agent reads the docs as if it had to plan from them alone. Its questions show what the docs forgot, and the answers go back in before anyone writes code.
Give the agent context it can trust
An agent that guesses at conventions writes code nobody wants to review. So the project tells it what's true.
- CLAUDE.md in each repository holds the current architecture, the conventions and the commands to build, test and run. I keep it up to date as the code changes, so the agent reuses what exists instead of inventing a second way to do it.
- Skills carry the procedures we repeat: how to brainstorm a change, write a plan, work test-first, verify before calling something finished, and ask for a review. They load only when a task needs them.
- Fresh documentation comes through MCP. Context7 serves current library docs, and when a framework ships its docs inside the package, the agent reads those before writing framework code. Language servers for TypeScript and Python mean it reads real types instead of guessing them.
- Memory carries decisions from one session to the next: what we agreed, what we rejected and why.
Draw the boundaries
Instructions say how to work. Permissions decide what the agent can touch. I rely on both.
- Permission rules and hooks keep secrets out of reach. Environment files, credentials and keys sit outside what the agent is allowed to read. A hook that blocks an action is stronger than a prompt that asks nicely.
- Auto mode reviews risky actions before they run, and anything that can't be taken back waits for me: pushing, deploying, deleting, publishing.
- Dependencies are pinned and checked before they're installed, never pulled by a bare name on a whim.
- Nothing is committed or pushed until I have reviewed the change myself. The agent proposes; I own what gets merged.
Make the plan a contract
A plan is the set of decisions the agent can't make alone. Once the design is agreed, it becomes small tasks.
Take a typical ticket: let customers export their order history as a CSV file, with the same filters as the orders list. The plan names the files each task touches, the exact function signatures and the tests that prove it. A Review Focus section lists the inputs most likely to hurt a real user: an empty result, a huge one, a filter combination nobody tried, a slow service downstream.
Then each task runs test-first. Write the test, watch it fail for the right reason, make it pass, run the whole suite. When real code disagrees with the plan, which happens often, the agent makes the call, writes it in a ledger with what it would cost if wrong, and keeps going. Nothing is decided in secret, and the ledger survives when a long session gets compacted.
Review with fresh eyes, then prove it
The author can't see their own blind spots, and an agent is no different. So the review comes from somewhere else.
- Before I raise a pull request, a separate subagent on the most capable model reviews the whole branch against the spec and the plan. It never shared the author's assumptions, which is the point. Each important finding is fixed with a test that reproduces it first.
- Lint, type checks and security guidance run alongside it.
- Then the evidence: the full test suite, the end-to-end tests, and the feature in a running app. The export opens, the filters match, a large export finishes, a forbidden one is refused. "All tests pass" is something to check, not something to believe.
- The pull request carries a test plan, taken from the design doc and the Review Focus list, and then it goes through the team's normal peer review and QA.
Make it a team practice
A good workflow that lives in one person's head doesn't scale. I lead a team of four engineers across React, .NET and NestJS, and all of us work with Claude Code.
The same CLAUDE.md, rules and skills live in the repositories, so everyone's agent works from the same conventions and the same boundaries. An AI-assisted pull request gets the same peer review and QA as any other, and the person who raised it owns it. When a change doesn't hold up, the owner investigates, fixes or reverts it, and explains the cause and the check in the review trail. The tools speed up the work; they don't change who is accountable for it.
The outcome
A loop I can repeat on any ticket and hand to anyone on the team. Requirements and docs give the work a clear shape. Maintained context and shared skills keep the agent consistent. Permissions and hooks keep it inside the lines. Test-first tasks, a fresh review and real evidence decide when it's done.
Copilot made me faster at writing code. Claude Code, run this way, makes me faster at the whole job — deciding, designing, building, checking and shipping — with every decision written down for the next person to read.