In my last few posts, I spoke about how coding is largely solved, and that context engineering, verification, and engineering judgment are where the real work is now. Several people asked me the obvious next question: "Fine, but what does that look like on real project? Does it really work?"
In this blog, I want to speak about some practical ideas to answer that question. It is not a framework. It is a playbook based on one internal product we built and now run this way.
The problem: the knowledge was everywhere except where the agent was
Before we restructured, we already had an agentic workflow. The coding agent wrote code, and it did that well.
The problem was that everything around the code lived somewhere else:
- Architecture decisions sat in a wiki page last updated two quarters ago.
- Business context and rules lived in tickets, meeting notes, and a few people's heads.
- Test cases lived in a spreadsheet owned by someone else.
- "How we work here" was tribal knowledge picked up in code review.
Because of this, the agent could write code, but it could not really engineer. It did not know the intentions behind our choices, which user journeys mattered, or how to know whether a change was impacting the architecture of the system. Every task began with someone pasting context into a chat window and ended with a human checking everything by hand.
According to me, the agent was not the bottleneck—our scattered knowledge and organizational habits were.
The shift: make the repository a full snapshot of the product
The question we were trying to solve was simple: how do we make sure our software architecture and business rules stay intact with changing requirements when an agent is making the changes?
We settled on one principle: everything the agent needs to understand, change, and verify the product should live in the repository, next to the code.
The repository now has three parts that evolve together:
context/: the source of truth for what and how.- A technical document covering architecture, storage, interfaces, constraints, and deployment.
- A business and domain document covering users, roles, terminology, business rules, and privacy rules.
src/: the code, with unit tests next to it as usual.e2e-tests/: proof that the product still works end to end.- Manual test cases written as user journeys (Given/When/Then), with stable IDs.
- Playwright automation for those journeys.
- A small tracker showing which cases are automated and which are not.
On top of that sits a short AGENTS.md. It is not general documentation. It tells the agent how to work in this repository and where to look for everything else.
The key idea is that at any commit, the repository describes one coherent version of the product. The code, the context explaining the intentions behind it, and the tests verifying it all agree with each other.
Specs live in the ticket, not the repository
This sounds close to spec-driven development, and it is, with one deliberate difference.
We do not keep a separate spec file for each feature in the repository. Over time, those specs go stale, pile up, and start contradicting the actual code.
Instead, we separate the two:
- The ticket holds the intent. It captures the requirement, acceptance criteria, scope, and the agent's reasoning and decisions as the work progresses.
- The repository holds the current state. Once the change merges, the context documents and test cases are updated to describe the product as it now is.
So the ticket tracks the change, and the repository reflects the result. Once a feature merges, it stops being treated as a separate "feature spec" and simply becomes part of how the product behaves—and part of what every future change is tested against.
That is the flywheel I wrote about in March, put into practice.
The workflow: one agent, three skills, human gates
We have seen a lot of attention on running fleets of specialised agents, but before jumping onto that trajectory, we chose to keep things simpler. We use the same coding agent throughout, guided by three small skills that encode how we work across different stages:
- Start work
- State the intent and how we will know the work is done.
- Create a branch from the right base.
- Open or reuse a ticket, and log the plan and reasoning there.
- Human check, after implementation and before any commit
- Map every acceptance criterion to the diff.
- Update only the context documents that the change made inaccurate.
- Update manual test cases and automation where the behaviour changed.
- Run the local checks: lint check, unit tests, the app running locally, and browser checks for the affected journeys.
- List what still needs human review, such as security, authentication, privacy, or migrations.
- Commit and PR
- Create one focused commit.
- Open a PR with honest evidence: what was tested, what was not, and why.
Every Git action still requires explicit human approval. These skills do not replace engineering judgment—they make sure you apply your judgment at the right moments, with the right evidence in front of you.
Why this works: the agent can close its own loop
For me, the best thing about this setup is that it lets the agent verify its own work. Once requirements, architecture, and tests sit together in the repository, the agent can:
- Read the requirement from the ticket and understand the business context behind it from the domain document.
- Respect the architecture because the boundaries and constraints are written down, not implied.
- Verify the change itself. It can run unit tests, start the app, walk through the affected user journeys in a browser, and write or update the end-to-end tests.
- Keep the repository current, because updating context is part of the definition of done, not an afterthought.
In a way, these tests and checks act like architectural fitness functions—giving us an objective integrity assessment by which we know that our system is doing good with the change. Before, the agent produced code and a human had to build confidence from scratch. Now, the agent produces both the code and the evidence, and the human uses their intellect to review and make sense of it.
That is a much better use of senior engineering time.
The engineering does not go away
None of this removes what I wrote about in August. If anything, it makes those responsibilities clearer:
- Quality still lives in gates, not prompts. CI, coverage thresholds, static analysis, and secret scanning all continue to run. The skills simply make sure the agent runs them first.
- Protected areas still need humans. Authentication, access control, privacy suppression, migrations, and CI/CD are listed explicitly as "stop and ask."
- You still need to understand what you are verifying. Context documents help the agent, and they also give the team a shared vocabulary to communicate intentions behind choices—to engineers, reviewers, and stakeholders alike.
- Refusing unnecessary complexity is still the job. A clear context document makes over-engineering easier to spot, because the intended design is written down.
The playbook: practical ideas to convert an existing codebase
If you are working on an existing codebase and looking for where to start, here are the steps I would try:
- Run a team knowledge sprint. Spend a few focused days pulling architecture, business rules, and terminology out of wikis, tickets, and people's heads into two context documents. You can use the agent to draft them from the code and let the team correct them. Expect the first version to be wrong in places—that is how you surface the gaps.
- Write a short
AGENTS.md. Include commands, conventions, protected paths, and pointers to the context. Keep it focused on how to work in the repo, not a full description of the system. - Bring the tests into the repository. Move manual test cases into the repo as user journeys with stable IDs, even before they are automated. Then automate the critical paths over time.
- Encode your workflow as two or three skills. Start, check, finish. Keep them short and explicit about where human approval is required.
- Make "update context" part of done. Every PR should either update the context it made inaccurate or explicitly state why nothing changed.
- Keep history out of the context. Change logs, test-run results, and interim decisions belong in the ticket and the PR. The repository should describe the system as it stands today.
- Measure honestly. Watch how often the agent can finish a change with solid evidence and without human rescue. That gives you a practical signal on whether your context and checks are good enough.
In conclusion
Giving an agent access to your code is not the same as giving it access to your product.
The product is the code, the business and technical context explaining why it behaves the way it does, and the tests proving that it still holds together as requirements change. When all three live together and are kept up to date, the agent becomes much more useful to the team.
I would recommend trying these ideas on your existing codebases and adapting them to what works best for your situation and organizational factors. It is not glamorous work, but it pays off over time.
Let me know what you think about these topics.
No comments:
Post a Comment