An agent that edits our engineering playbook, and the three things we rolled back
We keep what we learn while building games in a single methodology document, our engineering playbook.
The problem was keeping it up to date. So we added a retrospective agent that reads the week’s changes across our game repositories and edits the document itself.
It started as v1.0 on 2026-07-25 and reached v1.37.0 twelve days later, across 57 commits. The parts that ran smoothly were less instructive than the parts we rolled back, so this post is about those.
1. Off CI and onto a local runner
The weekly run first lived in a GitHub Actions workflow.
It needed an ANTHROPIC_API_KEY secret, and the repository didn’t have one. So every week the job quietly skipped, and it was a while before we noticed.
On 2026-07-27 we replaced it with a local runner (scripts/retro.mjs). It launches claude -p headlessly and uses the Claude Code login already present on that machine, so there was no new key to issue or store.
We also moved the agent’s instructions (RETRO.md) out of .github/ to the repository root. Rules for editing the playbook shouldn’t be hidden inside scheduler configuration, where they don’t show up in normal diffs or reviews.
2. “Don’t push” moved from the prompt to the permissions file
The agent may only commit. The runner pushes, and only commits that pass npm test.
At first that rule was a sentence in the instructions. Now it’s in the agent’s permissions file (.claude/retro-settings.json) as a deny list: git push, reset, rebase, checkout, and the gh pr, release and secret commands are all blocked.
Nothing had gone wrong. But if the agent pushes before the tests run, the tests don’t protect anything, and leaving that as a polite request in a prompt felt wrong.
3. --force only half worked
To avoid running twice in one week, each run’s commit ends with a trailer such as Retro-Run: 2026-W32. The runner looks for it and exits if it’s already there.
The first time we tried a forced re-run (--force), nothing happened. There were two guards:
- The runner’s trailer check.
--forcebypassed this one. - The agent read its instructions and decided “the marker is there, so I stop”.
--forcedidn’t reach this one.
The instructions described the trailer only as “the marker that prevents a double run”. The agent read that as a gate it should check, not just a marker it should write, which was a faithful reading of what we wrote.
We fixed it by having the agent decide based on content (is this lesson already in the document?) rather than on the marker. When two places make the same decision, the re-run path is where it breaks without anyone noticing.
4. No weekly quota
Each run was limited to two or three edits, and anything beyond that went to a queue for a human to review.
When we looked at the queue, four items were sitting there not because they needed judgement, but because they were over the quota. We removed the cap and kept only the evidence criteria: can the lesson point to a specific commit and line? Will it hold for the next game? Is it already in the document?
What we took away
- Rules you need enforced belong in configuration, not prompts. A prompt may well be followed, but you have to keep checking. A
denyentry doesn’t need checking. - Agents should edit sources, not build outputs. The combined playbook is generated from per-chapter files. If the agent edits the combined file, the consistency test fails. Letting it touch only the sources means CI catches drift immediately.
- An empty week is a valid result. Our favourite rule: if there’s no lesson worth promoting, the agent commits nothing. If we’d asked for something every week, the document would be thicker by now and much less useful.