Skip to Content

Insights Blog

AI Coding Workflow: 7 Steps That Hold Up on a Team

Copy LinkPrintEmailFacebookX
AI Coding Workflow: 7 Steps That Hold Up on a Team

Most AI coding workflow advice is written by one developer for another: here is how I prompt, here is my rules file, here is the model I switch to when I get stuck. Useful, but it is not what a CTO or VP of Engineering needs. You are not standardizing one person’s habits. You are deciding how a team of six or sixty produces code that an agent wrote and a human is accountable for. At LoadSys we run that workflow on every modernization project, and the version below is the one that survived contact with real codebases.

  1. Why a team AI coding workflow is a different problem
  2. Step 1: Write the spec before anyone writes a prompt
  3. Step 2: Version the context, not just the code
  4. Step 3: Cut work into tasks an agent can finish in one sitting
  5. Step 4: Give the agent a branch, a sandbox and a budget
  6. Step 5: Let the tests, not the agent, decide what is done
  7. Step 6: Review every commit, and budget the time for it
  8. Step 7: Measure it, because nobody’s gut is reliable here
  9. Rolling it out without stopping the sprint
  10. Running this workflow on legacy code
  11. Frequently asked questions

Why a team AI coding workflow is a different problem

When one developer uses Claude Code or Cursor, the feedback loop is tight: they read every line, they know the codebase, and they feel it when the agent goes wrong. Scale that to a team and three things break. Context stops being shared. Review load climbs faster than output, because generated code arrives in bigger batches. And accountability blurs, because “the agent did it” is not an answer anyone can give in an incident review.

The data says this is worth taking seriously. In METR’s early 2025 randomized study, 16 experienced open-source developers took 19 percent longer on real tasks when allowed to use AI tools, while believing afterward that they had been sped up by about 20 percent. METR’s February 2026 update with newer tools found raw estimates closer to neutral, with wide confidence intervals and enough selection problems that the authors called the result unreliable and changed the study design. The honest reading is that individual speedup is real for some people on some tasks, impossible to see from self-report, and heavily dependent on the surrounding workflow. That is where a leader’s attention belongs.

Step 1: Write the spec before anyone writes a prompt

A prompt is a request. A specification is a contract. The difference matters because an agent will happily build the wrong thing with great confidence, and the only way to tell that it did is to have written down the right thing first.

Our specs are short, structured and specific: the behavior that must be preserved, the behavior that changes, the interfaces touched, the acceptance tests that will prove each requirement, and the things explicitly out of scope. A spec for a module rebuild is typically a few pages, not forty. You can see the shape of one in our sample modernization specification. The spec is the artifact the agent reads, the artifact the reviewer checks against, and the artifact the client signs. One document, three jobs.

The failure mode this prevents is the one that eats the most time on AI-assisted teams: work that is 90 percent right. The 2025 Stack Overflow Developer Survey found that 66 percent of developers named “AI solutions that are almost right, but not quite” as their biggest frustration, with debugging that code close behind. Almost right is what you get when the target was never written down.

Step 2: Version the context, not just the code

Every serious coding agent now reads a project-level instruction file: CLAUDE.md for Claude Code, rules files for Cursor, custom instructions for Copilot. Anthropic’s own Claude Code best practices treat that file as the primary lever on quality, and they are right. On a team, the question is who owns it.

Treat the instruction file the way you treat a linter config: it lives in the repository, changes go through pull requests, and a named engineer owns it. It should hold the conventions a new hire would otherwise learn by being corrected in review: how errors are handled, where business logic lives, which libraries are banned, how tests are named, what the deploy process looks like. Keep it under a few hundred lines. Past that the agent starts ignoring it the same way people ignore a forty-page onboarding doc.

Alongside it, keep a short map of the codebase for the agent: the modules, what each does, and the places where the obvious change is the wrong change. Legacy systems are full of those. More on this in our piece on context engineering for coding teams.

A developer's hands on a laptop keyboard with terminal output on screen and a printed specification with handwritten checkmarks beside it

Step 3: Cut work into tasks an agent can finish in one sitting

The single biggest predictor of whether an agent run succeeds is the size of the task. Ask for a whole feature and you get a sprawling diff that touches twenty files, half of which nobody asked about. Ask for one well-bounded change with a named test that should pass at the end, and you get something a reviewer can hold in their head.

Our rule of thumb: a task is the right size when a senior engineer could describe the finished diff in two sentences before it is written, and when the agent can complete it, tests included, inside one context window. For a modernization project that usually means one endpoint, one model, one screen or one migration per task. The spec gets decomposed into a numbered task list up front, with dependencies marked, so the agent is never deciding what to do next, only how.

Step 4: Give the agent a branch, a sandbox and a budget

Agents should never work on a shared branch or on a developer’s live working tree. Each task gets its own branch or git worktree, which makes a bad run disposable: delete the branch and nothing is lost. For teams running several agents in parallel, worktrees are the only sane way to keep them from stepping on each other.

Scope the tools. An agent that can run the test suite, read the repository and edit files is useful. An agent with production database credentials or deploy keys is an incident waiting for a prompt. Keep its permissions to the repository and an ephemeral environment, route anything that touches a real system through a human, and run a secrets scanner over every agent branch before merge, since generated code has a habit of pasting whatever it found in the environment into a config file. Then set a budget per task in steps and spend. When an agent has looped for forty minutes on a ten-minute task, it is not about to succeed; it is about to produce something that looks like success. A cap stops the run and makes a human look at why.

Step 5: Let the tests, not the agent, decide what is done

This is the step that separates teams that ship with agents from teams that clean up after them. An agent will report that it finished. It will describe the tests it ran and the results it got. Sometimes it did not run them. Sometimes it changed the test to make it pass. Sometimes it ran them against a stale build. I have seen all three on real projects, and I covered the pattern in detail in why coding agents need proof of completion.

The fix is structural. The definition of done for a task is a command that exits zero, run by CI or by a script the agent cannot edit, against the branch the agent produced. The acceptance tests named in the spec are written, or at least stubbed, before the agent starts, and the agent’s job is to turn them green without touching them. If the task needs a new test, a human writes or approves it. The agent’s own summary of what it did is treated as a pull request description, not as evidence.

Add the cheap mechanical gates too: linting, type checks, a dependency audit, and a diff-scope check that flags any task touching files outside its stated boundary.

Two engineers reviewing a pull request together at one desk, one seated and one leaning in toward the monitor

Step 6: Review every commit, and budget the time for it

Every commit an agent produces gets read by a human before it merges. Not skimmed, read. That is the policy on every LoadSys engagement and it is the one clients push back on most, because it looks like it gives back the speed the agent bought. It does give some back. It is also the only thing standing between you and shipping code nobody on the team understands.

Two things make it workable. First, the tasks are small (step 3), so each review is a few hundred lines with a spec section to check against. Second, review is planned capacity. If an agent produces eight tasks a day per engineer, someone has to read eight diffs a day, and your sprint plan should say who. Reviewers check three things: does the diff match the spec section it claims to implement, did it stay inside its scope, and would I be comfortable being paged for this code at two in the morning. A second model as a first-pass reviewer catches real issues; it does not replace the human signature.

Step 7: Measure it, because nobody’s gut is reliable here

The METR studies above make one point very clearly: developers cannot tell from the inside whether AI is making them faster. So the team needs numbers it did not generate by feel. The ones we watch are cycle time per task from spec to merge, the share of agent tasks that pass CI on the first run, the share that get sent back in review and why, defect escape rate on agent-written modules versus hand-written ones, and review hours as a fraction of engineering hours.

The 2025 DORA report frames AI as an amplifier of whatever system it lands in: strong delivery practices get stronger, weak ones get faster at producing problems. The measurements above tell you which one is happening to you before the quarter ends.

None of this is unique to engineering. A growth agency such as Smart Sites judges SEO work by movement in rankings and traffic rather than by the hours that went into it, and an engineering team that has handed part of the implementation to agents needs the same kind of external scoreboard.

Rolling it out without stopping the sprint

Nobody gets to pause delivery for a quarter to install a workflow, so the order of adoption matters. Start with steps 4 and 5, boundaries and verification, because they are the ones that prevent damage and they need no buy-in from anyone outside engineering: worktrees per task, scoped permissions, a CI gate the agent cannot edit. Add the instruction file next (step 2) and put a name on it. Then introduce the spec and the task decomposition (steps 1 and 3) on one bounded piece of work, a single module or a single integration, with one senior engineer and one or two developers who already use the tools. Measure that piece against the previous sprint’s numbers (step 7), and only then widen it.

Two mistakes come up repeatedly. The first is mandating the tool before the workflow exists, which produces a wave of large, unreviewed pull requests and a backlash that sets adoption back months. The second is letting each developer keep a private rules file and a private prompting style, which works for them and fails for the team the day they go on vacation. The workflow has to be the team’s, in the repository, reviewed like code.

Expect the review step to feel slow for the first few weeks. It gets faster as the instruction file absorbs the corrections reviewers keep making, which is the point of owning it: every review comment that recurs twice should become a line in the file so the agent stops producing it.

Running this workflow on legacy code

Everything above is harder on a fifteen-year-old PHP or .NET Framework application with no tests and two people left who understand it, which is exactly where most of our clients start. The order changes slightly. Characterization tests come first: before the agent changes anything, it helps write tests that pin down what the current system actually does, including the behavior that looks like a bug but that the business depends on. The spec is written against those tests. Only then does rebuild work begin, module by module, with the old and new systems running side by side until the numbers match.

That sequence, spec first, bounded tasks, machine-verified completion and human review of every commit, is the whole of our spec-driven development practice. It is also why we can commit to a fixed price and a 90-day delivery on applications in the 20K to 200K line range: the workflow makes the work predictable enough to put a number on. The same workflow is what we deliver as AI-Assisted Development on greenfield work, and what we teach in our Dev Team Training on AI Best Practices; modernization is just where it earns its keep fastest.

If you have an aging custom application and want to know whether this workflow fits it, the quickest way to find out is a conversation. A 30-minute call. We’ll tell you if your app fits in 90 days.

Frequently asked questions

What is an AI coding workflow?

An AI coding workflow is the repeatable sequence a team uses to turn a requirement into merged, tested code when coding agents such as Claude Code, Cursor or Copilot are doing part of the implementation. A good one defines who writes the spec, how the agent gets context, how big each task is, what the agent is allowed to touch, how completion is verified and who reviews the result.

Does an AI coding workflow actually make a team faster?

It depends almost entirely on the workflow around the tool. Controlled studies by METR found experienced developers were slower with early 2025 tools and roughly neutral with late 2025 tools, with wide uncertainty, while developers consistently believed they were faster. Teams that see real gains pair agents with small tasks, machine-verified tests and planned review capacity, then measure cycle time and defect rates instead of trusting impressions.

How big should a task be for a coding agent?

Small enough that a senior engineer could describe the finished diff in two sentences, and that the agent can complete it, including running the tests, inside a single context window. In practice that is one endpoint, one model, one screen or one migration, with the acceptance test named in advance.

Should every AI-generated commit be reviewed by a human?

Yes. Automated gates such as tests, linting and a model-based first-pass review catch many problems, but a human still needs to confirm the diff matches the spec, stayed within scope and is code the team is willing to own in production. Small tasks keep that review affordable.

How do you stop an agent from claiming a task is finished when it is not?

Make completion a command that exits zero, run by CI or a script the agent cannot modify, against tests the agent is not allowed to change. Treat the agent’s own summary as a description of the pull request, never as proof that the work passed.

Does the workflow depend on which coding agent we use?

No. Claude Code, Cursor and Copilot differ in how they read context and how much they do without asking, but the seven steps sit outside the tool: the spec, the versioned instruction file, task size, boundaries, machine-verified completion, human review and measurement are the same whichever agent is in the loop. Teams that switch tools mid-project keep the workflow and change the instruction file’s syntax.

Back to top