Tous les articles

Making your codebase agent-ready in a week

You do not need a quarter of preparation or a platform migration to prepare a codebase for AI agents. You need a week. The difference between a repository where agents flounder and one where they complete work unsupervised comes down to five artifacts: context files, a fast test command, a couple of seed skills, a permission configuration and a task template. One or two engineers can build all five in five days, and the delta is immediate.

We know because this week is, almost verbatim, how our agentic engineering engagements start. Here is the schedule.

What agent-ready actually means

A useful definition: an agent dropped into the repository can discover how to build, test and validate a change without a human explaining anything, and the actions it must never take are enforced by configuration rather than hope. There is a simple test. Give an agent a small real ticket, cold, and count the interventions: every question it has to ask, every wrong assumption you correct, every command it could not find. Each intervention is a gap in one of the five artifacts. Run this test on Monday morning, before you fix anything, and you have both your work list and your before picture.

Days one and two: context files

Write the file your agent reads at the start of every session: build and test commands, the architecture in ten lines, the conventions that are real (not the aspirational ones), the traps that catch new people. Keep it under 200 lines; past that, context files get skimmed by the model the way onboarding docs get skimmed by humans. We covered the mechanics in the context files your agents read before they touch your code, including the per-module files a monorepo needs.

The method matters as much as the content: write from evidence. Run the Monday test, watch where the agent stumbled, document exactly that. A context file written from imagination describes the codebase you wish you had.

Day three: one command to test, and a fast one

Agents iterate against feedback, and the test suite is the feedback that matters. Two requirements. There must be a single documented command that runs the relevant tests, because an agent that has to guess your test invocation will guess wrong in creative ways. And there must be a fast subset, seconds rather than minutes, for the inner loop, with the full suite left to CI. A twenty-minute suite does not make delegation impossible, it makes it twenty minutes per iteration, which quietly caps everything.

If the honest answer is that the tests are thin or flaky, day three starts the remediation rather than finishing it. On an old codebase this becomes its own workstream, and it is one agents themselves are unusually good at, starting with characterization tests.

Day four: seed skills and a task template

Write two or three skills for the procedures your team repeats: the migration routine, the review checklist, the new-endpoint scaffold. Do not brainstorm twenty; extract the ones that already recur, the way we describe in how one developer’s workflow becomes the team’s.

Then write the task template, which is the highest-value artifact almost nobody creates: a half-page shape for delegated work with a goal, explicit boundaries (files and layers in scope, everything else out) and a definition of done that names the tests. The template is what shared prompt conventions look like when they take physical form in the repo, and it turns delegation from individual improvisation into a team practice.

Day five: permissions, then a pilot task

Configure what the agent may do without asking (run tests, lint, read anything), what always requires approval (installing dependencies, network calls, database migrations) and what is simply unavailable (production credentials, force pushes, deploy commands). Enforce the last category with real boundaries, scoped tokens and CI checks, not instructions, because instructions are requests and configuration is physics.

Then spend the afternoon proving the week: rerun the Monday test with a fresh ticket and count interventions again. The drop is usually dramatic, and whatever friction remains is next week’s list.

None of this is glamorous, which is exactly why it does not happen by default: every individual gap is small, so nobody owns the pile. Treat the pile as a project with a deadline five days out.