Building a native iOS app with AI agents, where every rule has to fail something A developer built murm, a native iOS photo-carousel app, almost entirely with AI agents, relying on enforced checks rather than written instructions to keep agent-written code in line. Rules in a docs/ folder carry short IDs that must appear in the names of tests proving them, a script verifies every cited ID exists and is defined once, and import-graph checks keep the layout engine deterministic and free of UIKit, SwiftUI and Vision. Claude Code hooks block known agent mistakes, and an independent Codex review on each pull request caught a test that would have passed even if an app update lost or swapped photos. I wanted to see what happens when you build with AI agents on a project you can't throw away: a native iOS app on the App Store, used by real people. It's called murm . You pick 20, 30, 40 photos, and murm lays out the pages of your carousel with paper, frames and stickers. No account, right on your iPhone. From the first commit on October 9 to today: I wrote one or two of those PRs by hand, because I wanted to. AI agents wrote the rest. What kept the code from turning into a mess were the checks I built around the agents. An agent starts every session knowing nothing about the project. Telling it the rules isn't enough: it forgets them, or bends them when a test is in the way. So if a rule matters, breaking it has to fail something: a test, a check or a hook. The repo has a docs/ folder with the product contracts: the user journey, the rules that apply everywhere, and one brief per feature. Each rule has a short ID: The ID goes in the name of the test that proves the rule: func test F5 sameSeedSameHash { ... } func test F3 faceNeverCut { ... } A script checks that every ID cited in code, tests and commits exists in the docs, and that each one is defined only once. If an agent invents an ID, the check fails. And when I change F3, grep F3 shows me everything that depends on it. The engine that lays out the pages has to be deterministic: the same photos and the same seed give the same carousel, pixel for pixel. Without that, I can't reproduce a bug from its seed, and a test that compares pages can pass on one run and fail on the next. Agents like to reach for .random , Date and UUID . So: Set and Dictionary from one process to the next. Loop over a dictionary while placing photos, and the same seed gives a different page. Same photos, same seed, two separate processes: identical hash. A different seed gives a different page. PHPicker ──▶ MurmMedia ──▶ MurmEngine ──▶ MurmStore ──▶ MurmRender App resizes + lays out saves every draws the page Vision once the pages change undo screen + export Every package except the app is plain Swift, with no UIKit and no SwiftUI. The engine doesn't even import Vision: it receives faces and subjects as plain data. A script reads the import graph and fails if that changes. It looks like bureaucracy, but it pays off: In TypeScript terms: Swift packages are like workspaces in a monorepo, and this rule is an ESLint no-restricted-imports you can't turn off. I use Claude Code, which has hooks. The ones I kept: .swift file is formatted right away git add -A I drop unfinished assets into the repo folder, and they ended up in a commit , git reset --soft main it quietly undid work merged in the meantime , and unquoted heredocs, one of which ran a command inside backticks in a commit message. Each of these started as a real accident. The rule I follow now: the first time, I write the rule down. Only when the same mistake comes back in a different PR does it get a check. Otherwise I'd have more checks than code. When a PR opens, a hook starts an independent review by a different model, Codex, which leaves its comments on the PR. The agent that wrote the code reads those comments and fixes them. Then I review, merge and test on my phone. My favorite catch: Claude wrote a test to prove that a project opens the same after an app update. It compared the position of each piece on the page. Codex pointed out that the test would still pass if the update lost or swapped the photos, as long as the frames stayed in place. The fix compares the page pixels and a hash of each photo file before and after the update. The update proof only compares generic labels and the rounded rectangles of the pieces. If the update keeps the geometry but loses the photo files or changes their content, the comparison can still pass, even after Undo/Redo. — Codex, reviewing the PR The bar I set early was simple: can someone use it without asking me anything? TestFlight feedback turned into issues, then short briefs, then PRs. Some of it no check could ever catch. Starting a project used to be one screen: Automatic or Blank, plus background, sticker theme and number of pages. Every rule passed. But it felt like filling out a form. What people asked for was to see ready-made templates right on the home screen and start from one. That became the new home. For a while, Codex reviewed each PR using the review instructions from the PR's own branch. So a PR could loosen the rule that was judging it, and the review would follow the looser rule. Nobody did it on purpose, but nothing stopped it either. Now the reviewer reads its instructions from the base branch, and a PR that loosens a rule or removes a check gets flagged until I approve it. It's still not airtight: the checks themselves run from the PR's branch. Learning Swift turned out to be the easy part. Most of my time went into deciding the rules. murm is on the App Store https://apps.apple.com/app/id6823764116 . And if you want the small, disposable version of this experiment, I wrote about building an ASCII art converter using only prompts https://dev.to/andraderaul/how-i-built-a-cyberpunk-ascii-art-converter-using-only-prompts-3ijm . Do you have a check or a hook that exists because of a real accident? I'd like to hear the story.