A game in a week: how we direct AI coding agents
Zigland went from design document to TestFlight in about a week, built with AI coding agents. The speed came from the discipline: written rules, plans, reviews and tests.
Zigland is a single-screen roguelite archery platformer for iPhone and iPad, in the line of Bubble Bobble and Snow Bros. You shoot arrows to stun corrupted creatures, walk up to free them, and bank what they leave behind at a portal. Runs of nine rooms end in a three-phase boss. There's a village hub, an island map, local two-player co-op, and both touch and gamepad controls.
It went from design document to a TestFlight build in about a week, built in Unity 6 with AI coding agents (Claude Code). 62 of its 63 commits are co-authored with Claude. The only one that isn't is the initial check-in.
That sounds like a story about a fast model. It's really about direction: how we steer agents so the speed holds up.
The problem: speed without a steering wheel
An AI coding agent will write a lot of code quickly. Left alone, it will also:
- forget a decision made two hours ago
- quietly pick a different architecture each session
- say "done" when the code compiles but the feature doesn't work
- fix a bug in one place and leave its twin somewhere else
None of that is new; a capable person joining without a brief does the same. Nor is the fix: written rules, written plans, reviews, and proof before anything is called finished. What changes with agents is that you need all of it, all the time, because the agent reads your brief from scratch at the start of every session.
Architecture: the documents are the system
Game design document (source of truth)
-> CLAUDE.md: rules, gotchas, every decision with its date
-> spec per feature: why, success, anti-goals
-> plan per feature: tasks, files, interfaces, named tests, review focus
-> build: small steps, tests per area, whole suite before every push
-> we play it on a phone and judge the feel -> decisions go back into CLAUDE.md CLAUDE.md is the contract
Zigland's CLAUDE.md is 958 lines long. Its first line tells the agent to read it, then the full design document, and that if the two disagree the design document wins and this file gets updated. It holds:
- Code rules. Kinematic, tile-aware movement with no physics engine for the player or creatures. No static player singleton, so co-op stays possible. Constants in one place. Sprite sizes in multiples of 8 pixels. Creatures, arrows and pickups defined as data, not new classes.
- Editor rules. Check the console for compile errors before moving on. Never hand-edit Unity's
.metafiles. Prefer editor scripts over hand-written asset files. Ask before importing large packages. - Gotchas, written after each bug. Scripted play-tests must wait on game time, not frame counts, because the unfocused editor runs at around 2,000 frames a second. Open the scene before creating assets. Reset every static on start-up. And one learned the hard way: a package that switched on a different touch system broke touch input on every iOS launch, so it is now banned by name.
- Decisions, with dates and the exact words. There are 72 of them, each in the form "developer, date: what was decided". "Only ever allow integer scale." "Never scale text." The agent doesn't have to remember a conversation; it reads the ruling.
It also states who does what. The agent builds. We play and judge the feel on a phone, make the device builds, and decide anything marked open in the design document.
Specs and plans are the work orders
Each feature starts as a spec that states why it exists, what success looks like and its anti-goals. The room-pool spec, for example, rules out near-duplicate layouts padding the count, a room that can't be finished, and procedural platform generation.
Then a plan turns the spec into tasks. Each plan carries a goal, the architecture, global constraints and a review focus: the specific risks a reviewer should check, each tied to the test that covers it. Each task names the files it touches, the interfaces it produces and the tests it needs. There are 10 specs and 10 plans, plus a design document of over 2,000 lines.
The engineering
Logic the agent can't hand-wave
Games are hard to test because so much depends on frames, physics and chance. So we kept decisions out of the frame loop. Creature behaviour is written as pure functions that take the random roll as a parameter:
public static HazardChoice DecideAtHazard(bool angry, bool pacing, double roll,
float jumpChance, float wadeChance, float chargeChance)
{
if (pacing)
{
return roll < 0.5 ? HazardChoice.Jump : HazardChoice.Wade;
}
if (roll < jumpChance)
{
return HazardChoice.Jump;
}
float wade = wadeChance + (angry ? chargeChance : 0f);
return roll < jumpChance + wade ? HazardChoice.Wade : HazardChoice.Turn;
} Now "angry walkers wade through mud more often" is a one-line assertion with a fixed roll, not a hope. The same approach covers room picking, enemy fill, combos and co-op rules. Even the rooms are testable: each one is an ASCII text map, and a test checks every map's size, walls and letters.
Tests read as behaviour, which makes them easy for a person to review:
[Test]
public void ARunNeverRepeatsALayout()
{
List<TextAsset> pool = Pool();
for (int seed = 0; seed < 50; seed++)
{
List<TextAsset> run = RoomPool.PickRun(pool, 9, _ => 0, new System.Random(seed));
Assert.AreEqual(9, run.Count);
Assert.AreEqual(9, run.Distinct().Count(), "no repeats");
}
} Tested as we built
Zigland was tested as we built it. Some plans list a task's tests first and say to watch them fail before implementing; others name the tests alongside the code. Either way, the tests landed with the code they cover. By TestFlight the project ran 1,202 automated tests, grouped into 14 categories by area. The rule in CLAUDE.md is simple: after a change, run the categories it touched; run the whole suite before every push.
To keep that cheap, the agent runs tests headless against a symlinked clone of the project, so the open editor stays free for play-testing.
Giving the agent hands
An agent that can only edit files is half-blind. Zigland's agent drives the open Unity editor through a local HTTP interface: recompile, read the console, run tests, enter play mode and take screenshots. A single script exports the Xcode project, builds it, installs it on a connected iPhone and launches it with the log captured. The agent can check its own work the way a person would, which is what makes "verify before done" possible.
Art and sound as code
All the pixel art, over 450 images, comes from Python scripts, and every sound effect is synthesised with numpy. Changing the art means changing a script and re-running it, so it is reviewable and repeatable like the rest of the code.
How we direct agents
Stripped of the game, the practice is four habits:
- Write the rules down. A living
CLAUDE.mdwith code rules, gotchas and dated decisions. If it isn't written, the next session doesn't know it. - Plan before building. Spec, then plan, then tasks with named files, interfaces and tests. The plan is the work order; the agent doesn't freelance.
- Review against named risks. Every plan says what a reviewer should worry about and which test answers it.
- Verify before done. Tests pass, the console is clean, and it works on the device. "It compiles" is not done.
The same practice at a larger scale
Zigland is small. The same practice runs across the Knowby platform, where we designed, architected and developed everything from the mobile apps to the backend services. There, eight CLAUDE.md files cover the servers, web apps, iOS, Android, Flutter, a browser extension and an admin tool. 32 plans and 25 specs sit in the repository, and hundreds of commits are AI-assisted. The rules are stricter for production: every test is watched failing before the fix, the falsification is stated in the pull request, the session that did the work reviews it, and nothing is claimed until it has been verified.
What it taught us
- The bottleneck moves. With agents writing code, the slow part becomes deciding what to build and judging whether it's right. Feel, product calls and trade-offs stay with people.
- Documents beat memory. Every decision written down is one the agent will never quietly undo.
- Testable design pays twice. Pure rule functions made Zigland easier for the agent to get right and easier for us to check.
- Small steps keep it honest. Small, reviewable commits mean a wrong turn costs minutes, not days.
Why it still matters
This is how we build for clients now: faster, but with more discipline, not less. AI agents do a lot of the typing; we own the architecture, the rules, the reviews and the definition of done. If you want that speed without losing control of your codebase, our AI-accelerated engineering page explains how we work, and 25 years of putting AI to work shows where it fits in the longer story.