Put a coding agent on rails
Write the instruction file a coding agent reads, and use permission modes so it plans before it edits.
You build: An AGENTS.md under 60 lines in a repo of yours, and one small change made by a coding agent under your rules.
- A coding agent you already use (Claude Code, Codex, OpenCode or similar)
- A small git repo with a test command
-
01Write AGENTS.md: what the repo is, the test and lint commands, three rules, known traps
Write what a new colleague gets wrong in week one. Leave out what the code already says.
wc -l AGENTS.mdYou pass when: Under 60 lines. Every command in it runs as written.
-
02Give the agent a small issue in its read-only or plan mode
git status --shortYou pass when: Nothing changed on disk, and you have a plan that names the files it will touch.
-
03Allow edits and let it carry out the plan
git diff --statYou pass when: The diff touches only the files the plan named, and the agent ran your test command without being told to in the prompt.
-
04Add the first thing it got wrong to AGENTS.md
git log --oneline -n 2 -- AGENTS.mdYou pass when: A second commit to AGENTS.md. The file grows from real mistakes, not guesses.
The check runs on the computer, not on your word: a step passes when its command exits with 0 there.
Computers are not set up on this site yet. Run each command on your own machine and compare with "You pass when".
Commands run in labs/31-coding-agent-rules and may take up to 60 seconds each. Every command starts a new shell: put keys and settings in a .env file there, it is loaded each time.