Playbook overview

Prepare the repository

Guide, operating model and reference

Open the repository as if you’d joined the project this morning. How do you run it? Where would you look for the cancellation rule? Is there a test that sets the clock, or do you have to wait until three o’clock tomorrow to find out whether it works?

This is the repository part of the engineering harness. Permissions, runtime and protected verification also depend on systems outside the checkout. For concrete checks to try, see the tool recipes.

What goes in AGENTS.md

Start with an AGENTS.md at the root. Think of it as the five-minute introduction you’d give someone before handing them a task. Try the instructions from a clean checkout. If step three assumes a database that only exists on your laptop, you’ve found your first improvement.

Put this near the topGive the agent something specific
Where to startLink to the architecture map and the domain guide. Point to one good example of the kind of change people make here.
How to run the projectList actual commands to install dependencies, start and reset a local environment, and use test data. Say where to look when a command fails.
What to checkProvide a fast check for everyday changes and the full verification command CI runs. Say when to exercise a browser journey or integration.
What to preserveName two or three boundaries that are easy to cross. For example, cancellation policy lives in the booking domain. Link to the check that enforces it.
When to stopGive examples of decisions that require an owner, actions that need separate approval, and prohibited operations. Say what evidence to leave before pausing.
Where lessons liveLink to the relevant learning files and explain how to propose a correction.

Keep the commands and working rules here. Link to detailed design, test fixtures and troubleshooting instead of making everyone read them for every task. In a larger repository, put local instructions near the code they govern if your agent supports scoped files. Check that your tool reads them as expected before relying on them. Keep permissions and required checks enforced outside the instruction file.

Copy the example AGENTS.md. Its paths and commands are for a fictional repository. Replace them with the commands you can actually run.

A study by Gloaguen and colleagues found that repository context files raised inference cost without a general increase in task success across the settings they tested. I’d use that as a reason to try each instruction on a real task and keep it only if it helps the session find or do something it needs. Decide which reviewed version a fresh session should read before giving it work without someone alongside. ETH Zürich study · Decide what the agent can trust

Give the agent something it can check

A repository map can narrow the search. Symbol references, a schema and a runnable example can settle questions more directly. For a typed codebase, start with a symbol definition, its callers and implementations. Use text search for configuration keys, log messages or dynamic references the language tools cannot see. Read the current code and a representative test before proposing a new abstraction. It can spend less of its time guessing where to look.

Put important boundaries in the build where you can. If the team agrees that cancellation policy belongs in one place, a dependency check or a test can catch a change that puts the same rule in the web layer. The repository guide can explain why the rule exists. The failing check tells you when someone has crossed it. Make the failure name the offending dependency and show where the rule is explained. On an old codebase, record the existing violations and prevent new ones first. That gets you a useful check without turning the first cancellation change into an architecture rewrite.

Treat automated dead-code findings as leads. A CMS may load code by convention and a service may have consumers outside the repository. Check those possibilities and run the relevant behaviour before deleting something a static analyser called unused.

Then try the instructions from a clean checkout. Make sure the project starts with disposable data and documented setup. Use a controllable clock for a test that depends on time. Provide a way to see what happened when a check fails. A command that passes only on the machine where it was written is going to waste somebody’s afternoon.

Make it possible to see a failure

If the customer can’t cancel, start by reproducing it. See what the browser sent, follow the request through the service, and look at the rule that actually refused it. A request identifier in the test environment can turn three unrelated-looking error messages into one useful trace. Give the worker access to those diagnostics with disposable data and keep customer details and secrets out of them.

During implementation, run the smallest check that answers the question in front of you. Before review, run the checks agreed for the change. Use the same verification entry point locally and in the build where you can. For unattended work, give each job a workspace it can recreate. It should be possible to lose the workspace and still know what was agreed, what changed and what remains to be checked.

Keep useful memory close to the work

Imagine picking up a half-finished task a week later. The useful things to find are the current decision, the change under review and the open question. Put that memory in the repo, or in the work record the repo points to. A transcript may explain how you got there, but the next engineer or agent should be able to pick up the task without reading all of it.

When a boundary moves or a build command changes, update the relevant guidance in the same change. Otherwise, the repository starts giving two different accounts of how it works. The code will win eventually, usually after somebody has spent time following the wrong one.

Keep three things in places people can find again. Stable instructions belong in AGENTS.md and the docs it points to. A decision that only matters to this change belongs with the work item. An observed failure that could recur belongs in a learning file, with enough detail to check it. See how to maintain the learning files.

For an industry example of keeping project decisions and standards available across sessions, see Rahul Garg’s patterns for AI-assisted development.