Scott Tompkins

Agentic Engineering Methodology

How I direct coding agents. I own the requirements and the review, the agent writes tests before code, its tools are scoped to the task, and decisions live in numbered records it can read.

Cursor · Claude · MCP · TDD · CrewAI

A coding agent’s first pass looks finished. The code compiles and the happy path works. The edge cases, the error handling and the requirements I never said out loud are missing. Handing implementation to a large language model (LLM) means planning for that, and for two other things the model does.

The second is context decay. A model does not hold an unbounded conversation in mind, so a constraint I stated clearly in the first prompt can be gone by the fifth. The third is guessing. When a requirement is vague the model does not ask. It fills the blank with a plausible assumption and states it confidently enough that I might not catch it until something breaks.

I treat all three as properties of how these models work, not as bugs a later release will fix. I have worked this way since around mid-2023. I keep the decisions for myself and build guardrails around the rest.

A repository written for agents

FoodForms is a pro bono check-in platform for food pantries. In eight weeks it went from first commit to production: an offline-first kiosk, a phone site, staff and platform consoles, ESP32 printer firmware and its own GitOps deployment. I made the decisions. Coding agents carried most of the implementation.

That worked because the repository itself was designed as the agent’s working context. Its workflow standard says so in its opening: the repository “is maintained mostly by coding agents, often less capable than the one that designed it.” The rest of the standard follows from that sentence.

  • An agent reads one short entry document first. It holds the repository map, the architectural pattern in a paragraph and ten numbered rules. Tenant isolation always goes through one helper. Migrations are append-only. No user-facing text lives outside the English and Spanish catalogs. Kiosk code never calls the network. No personal data goes in logs or fixtures. Do not invent APIs.
  • One command defines “works”. It runs lint, type checking, the translation catalog check and the unit, component and integration tests. An agent is not done until it passes, and may never skip or delete a test to get there.
  • A table states what each kind of change must ship with. A new screen needs a component test in both languages. A new table needs a test proving tenants are still isolated. A new flow needs a browser test, including its offline variant. The agent does not decide how much testing is enough.
  • Anything that changes the stack, the structure or the data model gets a numbered decision record with context, decision and consequences. There were 62 when the project reached production. When an agent meets a question the documents do not answer, it drafts a record marked proposed, recommends an option and keeps going. It does not stall or guess silently.
  • Gaps in knowledge about the program or a pantry go into an open-questions document, so they do not become silent assumptions. Regulatory text and income figures are never guessed. The agent points at the reference document it would need.
  • For each kind of task the standard names an existing file to imitate.
  • Every change ends in release notes written for pantry staff, split by who is affected. Writing them forces a check that the change does what a person asked for.

The decision records did the most against context decay. A new session reads the relevant record and inherits the reasoning. They also gave a change of direction a clear form. When requirements changed, one new record superseded four, and the agents had an unambiguous statement of what no longer applied.

One session, from story to review

The repository rules sit on top of how I run a single session with an agent.

I own the architecture, the requirements and the acceptance criteria. The model implements inside those boundaries. I split it this way because architecture and requirements depend on business judgment and on context nobody wrote down, and models are unreliable there. Turning a clear specification into working code is what they do well.

Every session starts with a user story: background, context, foreseeable challenges and explicit acceptance criteria. The story answers guessing. If I cannot say what “done” looks like precisely enough for the model to verify it, I do not understand the problem well enough to delegate it. I learned this by doing the opposite. I used to hand the model a loose description and correct it in conversation. The model followed my latest correction and lost the earlier constraints.

I instruct the model to write the tests before the implementation. Tests hold a requirement in a form that runs. When the model’s context loses a constraint from five prompts back, the test still enforces it, and when the model produces behaviour that sounds plausible and is wrong, the test fails. The tests also stay in the codebase as a record of what the code is supposed to do.

The model works through the Model Context Protocol (MCP), which connects it to tools such as documentation, APIs, the test runner and build output. I give it the tools and access the current task needs and nothing more. With them the model is working inside the real development environment. The scoping keeps it away from production databases, the wrong branches and systems that have nothing to do with the task.

Then I read the output the way I would read a pull request from a capable but inexperienced developer. I check error handling, edge cases, naming and consistency with the rest of the codebase. I also check that the implementation matches the specification and not a plausible interpretation of it. Unreviewed output collects small faults, such as an error message that is slightly wrong, a missing null check or logging that ignores the project’s conventions.

OwnermeCoding agentTest suiteuser story, acceptance criteriawrites tests firstimplements against the testsfailures enforce constraintsoutput, read as a pull requestreview: edge cases, conventions
I own the specification and the review. The agent implements against tests it wrote first, so constraints survive context decay.
Diagram as text
  1. Owner to Coding agent: user story, acceptance criteria
  2. Coding agent to Test suite: writes tests first
  3. Coding agent to Test suite: implements against the tests
  4. Test suite to Coding agent: failures enforce constraints
  5. Coding agent to Owner: output, read as a pull request
  6. Owner to Coding agent: review: edge cases, conventions

Which guardrail answers which failure

The table sets the practices above against the three problems from the top of the page. Review also answers the first one, since error handling and edge cases are what I check for. The single check command and the table of required tests answer it too, because the agent is not the one deciding that its work is finished.

GuardrailContext decayGuessing when unclearLooks done, has gaps
Tests written firstyes
User story with acceptance criteriayes
Output reviewed as a pull requestyesyes
Numbered decision recordsyes
Open-questions documentyes
One command defines "works"yes
Tests required by change typeyes
Three ways a coding agent's output goes wrong, and the practices on this page that answer each one.

What it costs

Each of these takes time before any code exists. Writing the story takes 10 to 15 minutes, and it is more specification work than I would do for a human developer who could pick up the context unprompted. I get back a specification I can reuse if I have to implement the work again or hand it to a different model.

Writing tests first means less code per prompt cycle on the first iteration.

The first hour of setting up MCP servers, SSH keys and environment scoping produces no output. I treat it like setting up CI/CD: I do it once and use it in every later session.

Review takes the most time, compared with letting the model write and moving on.

The method also tests my own specifications, which I did not plan for. A vague requirement comes back as a wrong implementation within seconds, so I find out quickly when a story is not clear enough.

Where I used it at Decian

At Decian I was the lead and the only experienced software engineer. I was also setting up an engineering practice the company had not had before, and mentoring a team that ranged from interns to the company owner. I used this method on the Mission Control portal, on the billing reconciliation pipeline, where the logic for correlating customer identifiers across two systems was specified in tests before the model wrote the join, and on the pipeline observability work. This site, its content pipeline and my résumé generator were built the same way.

An experiment with several agents

In 2026 I started experimenting, on my own time, with applying the same ideas to a team of agents. I chose CrewAI, a framework for orchestrating several agents, and the target was an end-to-end ERPNext implementation. ERPNext is an open-source business management system, and implementing one involves requirements analysis, data modeling, business logic, integration and customization. The agent roles follow the disciplines a human implementation team would have:

  • a product manager agent that turns business requirements into structured specifications
  • an analyst agent that breaks specifications into work items with acceptance criteria
  • coding agents that implement against those specifications
  • adversarial test agents that write tests meant to break the implementation
  • a scribe agent that maintains a Quartz-based knowledge base

The scribe exists because of context decay. With several agents, the decisions, constraints and domain knowledge have to be shared across agents and sessions. The scribe keeps them in a structured knowledge base that the other agents read from and write to, so no single agent’s context has to hold everything.

This is an experiment and not shipped production work.

Two earlier notes cover the thinking behind the method: Agentic X on the owner and builder split, and Agentic Coding and Product Discipline on what it did for product management. The tools are summarized under AI-assisted engineering.