<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Benjamin Prieur on Medium]]></title>
        <description><![CDATA[Stories by Benjamin Prieur on Medium]]></description>
        <link>https://medium.com/@benMobileDev?source=rss-eaf4b601373b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Benjamin Prieur on Medium</title>
            <link>https://medium.com/@benMobileDev?source=rss-eaf4b601373b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 11:32:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@benMobileDev/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[I Stopped Writing iOS Code. Here’s the System That Replaced Me.]]></title>
            <link>https://medium.com/@benMobileDev/i-stopped-writing-ios-code-heres-the-system-that-replaced-me-a24a76f33446?source=rss-eaf4b601373b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a24a76f33446</guid>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[harness-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Benjamin Prieur]]></dc:creator>
            <pubDate>Wed, 01 Apr 2026 09:42:51 GMT</pubDate>
            <atom:updated>2026-04-01T09:42:51.044Z</atom:updated>
            <content:encoded><![CDATA[<p>Last year I made a decision that felt either very smart or very reckless: I stopped writing iOS code myself.</p><p>Not because I couldn’t. I’ve spent 15 years building iOS apps. These days I’m both a Staff Engineer on this project and an Engineering Manager with five direct reports. But I had a hypothesis: what if the job of a senior iOS engineer isn’t to write the code — it’s to <strong><em>design the system that writes the code</em></strong>?</p><p>The first few weeks suggested I was very, very wrong.</p><p>The app is a fantasy card game built on soccer players. You collect cards, build a club that earns coins every second, and attack rival clubs to steal their best players. Win a battle, take their card. Lose, and they take yours. Real-time card auctions, live bidding, a WebSocket-backed game loop, Apple App Attest, GraphQL, SwiftUI with iOS 18 and 26 features. Not a toy project. Not a weekend side thing. A production app with multiple environments, Fastlane lanes, certificate management, and a growing feature surface.</p><p>Almost none of the feature code in it was written by me. But it took a while to get there.</p><h3><strong>What “AI writes the code” actually means</strong></h3><p>Let me be precise, because most “AI writes code” takes are hand-wavy.</p><p>The workflow in outline:</p><ol><li>Feature request lands in Linear</li><li>Claude agent (running on Claude Opus) picks it up, reads the spec and the codebase docs</li><li>Agent produces a structured implementation plan — files, steps, UI states, verified API fields</li><li>I review and approve the plan — the highest-leverage moment, before any code is written</li><li>Agent implements the feature, writes tests, and runs lint</li><li>A dedicated code-reviewer agent reads the diff and raises any issues — up to three rounds</li><li>Agent commits, pushes, and opens a GitLab MR</li><li>I review the MR</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-MknjVrooyBupKZBU8T6PQ.png" /></figure><p>My job is to review the plan — catching anything architecturally wrong before a line is written — and then review the MR. The architectural decisions, the module boundaries, the tradeoffs — those are still mine. What I’ve delegated is the implementation: the typing, the wiring, the boilerplate, the iteration.</p><p>The “almost 0 human LOC” claim is literal. The Battle feature — VS reveals, card selection, victory and defeat animations — I didn’t write a single line of it. Same story for My Club, Draft, Arena, Stories. The infrastructure itself was built by iterating with AI — not a single line written by hand. Everything has been the agents.</p><h3><strong>It’s not a new idea — just a new kind of team</strong></h3><p>Here’s the analogy that makes this click: think about how a well-run engineering team actually operates.</p><p>The architect defines the structure. The tech lead sets the conventions, reviews the proposals, and approves the approach before anyone writes a line. The developers implement, test, and open PRs. The lead reviews. Nobody expects the architect to write every feature themselves — that’s not where their judgment is best spent.</p><p>That’s exactly the structure here. I’m the architect and tech lead. The agents are the developers. They follow the conventions I wrote, implement against the plans I approved, and open MRs I review. The division of responsibility isn’t new. What’s new is that the developers are AI agents, they’ve read every line of the codebase, and they’re always available.</p><p>The question worth asking isn’t “can AI write code?” It’s the same question you’d ask about any team: does everyone know the architecture, follow the conventions, and produce work that can be reviewed and shipped? Build the right system, and the answer can be yes.</p><h3><strong>Why it works when it shouldn’t</strong></h3><p>If you’ve tried using AI to write production code, you’ve probably hit the same wall: the AI confidently generates plausible-looking code that doesn’t fit the codebase, hallucinates APIs, ignores conventions, and produces what I’ve come to call <strong><em>AI slop</em></strong> — technically compiling but architecturally wrong. In one early session, the agent built an entire feature by calling services directly from the view layer, bypassing the dependency injection system entirely. It compiled. Every test passed. And it would have quietly rotted the architecture if I hadn’t caught it in review.</p><p>The reason most AI coding setups fail isn’t the model. It’s the absence of context.</p><p>A senior engineer who joins a team doesn’t just read the code — they absorb the unwritten rules. How the team handles errors. Why dependency injection is done this way and not that way. What “clean code” means <strong><em>here</em></strong>, not in the abstract. This institutional knowledge lives in people’s heads, and AI doesn’t have a head.</p><p>My bet was: what if you put all of that into writing? What if the documentation was so thorough, so precise, and so continuously maintained that an AI agent could actually navigate the codebase the way a senior engineer would? The answer turned out to be a 13-file convention system — one document per pattern domain — that every agent reads before touching a single file.</p><h3><strong>Building a codebase AI can actually navigate</strong></h3><p>The fix is embarrassingly simple: write it down. All of it.</p><p>The codebase has a docs system that reads more like a design document for the agents than a README for humans:</p><ul><li>`docs/architecture.md` — the full module map, dependency graph, and layer definitions with strict rules (domain models can’t import the API layer, Views can’t call Services directly)</li><li>`docs/conventions/` — 10 separate convention files covering SwiftUI patterns, ViewModel architecture, GraphQL, routing, testing, DI, code style, git workflow, domain models, and Tuist config</li><li>`docs/golden-principles.md` — opinionated rules that exist specifically to prevent common AI mistakes</li><li>`docs/quality-scorecard.md` — live coverage grades per domain, updated from `xccov` after test runs</li><li>`docs/adr/` — Architecture Decision Records explaining <strong><em>why</em></strong> key decisions were made</li><li>`AGENTS.md` — the entry point for any agent, pointing to everything else</li></ul><p>None of this is novel. Good teams write documentation. What’s different here is <strong><em>who reads it</em></strong>.</p><h4><strong>The motivated reader problem</strong></h4><p>Human engineers read docs reluctantly. It’s not a character flaw — it’s rational. If you can figure out the pattern from reading two files of existing code, why read the 800-word convention doc?</p><p>AI agents are different. If the docs are wrong, the agents make wrong decisions. A hallucinated design token leads to a build failure. An ignored convention gets flagged in code review and bounces the MR. The agents have every incentive to read carefully, because they pay the cost of getting it wrong.</p><p>This flips the usual dynamic. Instead of maintaining docs for hypothetical future engineers who might read them, you’re maintaining docs for a system that <strong><em>will always read them</em></strong> and whose output quality directly reflects their accuracy.</p><p>Doc-gardening — periodic reviews to catch stale architecture diagrams, outdated coverage numbers, superseded ADRs — stops being chore work and starts being a system requirement.</p><h4><strong>The golden principles: fighting AI slop</strong></h4><p>The `golden-principles.md` file deserves special mention. Every rule in it exists because an agent did something plausible but wrong, and we encoded the fix.</p><p>A few examples:</p><p>&gt; <strong>Always use `SpacingTokens`</strong>— never hardcode spacing values</p><p>An agent will reach for `padding(16)` because that’s what 10,000 Stack Overflow posts show. Our codebase uses a token system. The principle makes the rule explicit and unambiguous.</p><p>&gt; <strong>Always select `id`</strong> on every GraphQL object type in queries — Apollo cache normalization depends on it; missing `id` causes cache misses and stale data</p><p>An agent writing a GraphQL fragment has no idea about Apollo’s cache normalization behavior unless you tell it. Now it knows.</p><p>&gt; <strong>One ViewModel per screen, never shared across screens</strong></p><p>This one prevents a whole class of subtle state bugs. An agent optimizing for code reuse might naturally reach for a shared ViewModel. The principle tells it not to.</p><p>The golden principles are also enforced mechanically where possible — SwiftLint custom rules catch the things that are automatable. The docs cover the rest.</p><h4><strong>Why a single CLAUDE.md breaks at scale</strong></h4><p>The instinct most people have is to put everything in one file. A big `CLAUDE.md` at the root: architecture, conventions, principles, patterns, all of it. It works fine for a small project. It falls apart on anything real.</p><p>Two problems. First, context windows are finite. When you dump 5,000 words of conventions into every agent invocation, you’re spending tokens on routing rules when the agent is writing a ViewModel, and spending tokens on ViewModel patterns when the agent is configuring a Tuist target. The relevant signal drowns in noise.</p><p>Second, and more subtle: AI agents don’t get worse at following rules when there are fewer rules — they get <strong><em>better</em></strong>. Precision requires focus. A 200-line conventions file for SwiftUI patterns is more reliably followed than the same 200 lines buried in a 2,000-line omnibus doc.</p><h4><strong>Lazy-loading context</strong></h4><p>The doc structure is a tree, not a file. `AGENTS.md` is the entry point — a short file that orients the agent and points it to everything else. It doesn’t contain the conventions. It contains a map.</p><p>That map routes the agent based on task type. There’s a `rule-loading.md` file with an explicit decision table:</p><ul><li>Writing or modifying a View? → Load `conventions/swiftui-patterns.md`</li><li>Writing a ViewModel? → Load `conventions/view-model.md`</li><li>Adding a GraphQL query or fragment? → Load `conventions/graphql.md`</li><li>Adding a route or deeplink? → Load `conventions/routing.md`</li><li>Writing tests? → Load `conventions/testing.md`</li></ul><p>The agent reads this table at the start of every task and fetches only the docs relevant to what it’s about to do. A feature that touches GraphQL and SwiftUI loads two convention files — not ten.</p><p>This matters beyond efficiency. When a convention doc is short and focused, it’s easier to keep accurate. A 150-line SwiftUI conventions file gets reviewed and updated. A 1,500-line monolith gets ignored. The lazy-loading architecture forces modular docs, which forces maintained docs. The structure and the quality are inseparable.</p><h3><strong>The pipeline: from Linear ticket to merged MR</strong></h3><p>Here’s what actually happens when a feature needs to be built.</p><p>The `linear-implementer` agent picks up the issue and fetches the full spec from Linear via the MCP connector. It greps the codebase to verify every design token, GraphQL field, and helper function it plans to use actually exists before writing a single line of code. Then it produces a structured plan: implementation steps in order, every file to create or modify, a state matrix covering every UI state the screen needs to handle, and any non-obvious architectural decisions called out explicitly.</p><p>That plan comes to me. I approve it, push back on it, or send the agent back to clarify. This is the highest-leverage moment: before any code is written, when changes are cheap.</p><p>After approval, the agent creates a git worktree using the branch name from Linear — all work happens in isolation, master stays clean. Then it builds in order: GraphQL fragment → Apollo codegen → domain adapter (`toDomain()`) → domain model → service layer (actor with a protocol for testability) → ViewModel (`@Observable @MainActor`) → SwiftUI view (thin, no business logic) → route registration.</p><p>After implementation: `tuist test` until tests pass, then a `lint-format` sub-agent on the changed files. Then something I find particularly elegant: a `code-reviewer` sub-agent reads the diff and produces a structured verdict. Critical items must be resolved before the agent can proceed — up to three review rounds. Unresolved items go into the MR description for me to catch.</p><p>If everything clears: stage only the touched files (never `git add -A`), commit with a conventional commit message, confirm with me, push, open the MR via `glab`.</p><h4><strong>Closing the visual feedback loop with Tuist Previews</strong></h4><p><a href="https://tuist.dev/">Tuist</a> is an open-source command-line tool that sits on top of Xcode. Instead of managing `.xcodeproj` files by hand — a notoriously conflict-prone experience — you define your project structure in Swift code and let Tuist generate everything. It also handles modularization, binary caching to speed up builds, and smart test selection. For this project it’s the backbone of the build pipeline: `tuist test` runs the test suite, and Tuist Previews are how visual QA happens without ever touching TestFlight.</p><p>Code review tells you whether the implementation is correct. It doesn’t tell you whether the screen <strong><em>looks right</em></strong>. For a game app with real-time card auctions, animated battle reveals, and a custom design system, that gap matters.</p><p>This is where Tuist Previews come in. After the agent pushes the branch, a single command builds the app and generates a shareable link — no App Store Connect, no TestFlight processing delay:</p><pre>tuist share - configuration Debug - platform iOS</pre><p>The link installs directly on device. Tap it on your iPhone, the build lands in seconds, and you walk through the new feature exactly as a user would. The agent writes correct code, but it can’t feel whether a gesture is awkward or a loading state is too abrupt. Tuist Previews make visual QA a zero-friction step rather than a full TestFlight cycle. The review loop shrinks from hours to minutes.</p><h4><strong>What the human does</strong></h4><ol><li>Write (or review) the Linear ticket spec</li><li>Approve the implementation plan</li><li>Confirm the push</li><li>Open the Tuist Preview on device</li><li>Review the MR</li></ol><p>The whole middle — exploration, implementation, testing, code review, iteration — runs without me.</p><h4><strong>The agent remembers — and teaches</strong></h4><p>The `linear-implementer` has a persistent memory directory inside the repo, version-controlled and shared across sessions. When it discovers a pattern worth preserving — a subtle build quirk, a GraphQL codegen gotcha, a testing pattern that works — it writes it down. The next session starts with that context already loaded.</p><p>Does the reverse happen — does the system teach <strong><em>me</em></strong> things? Mostly through `/insight`. That’s a skill I run periodically, not to review the code, but to review the <strong><em>system itself</em></strong>. It reads the agent definitions, the workflow docs, and recent MR history, then asks: are there patterns the pipeline handles poorly? Are there recurring friction points that should be automated? When it finds something, it doesn’t just flag it — it drafts the missing agent or skill.</p><p>Outside of that, the more interesting dynamic is divergence. Occasionally I review an MR and think: <strong><em>I’d have done this differently</em></strong>. Not wrong — it compiles, the tests pass, the conventions are followed — just not the choice I’d have made. Sometimes I push back. Sometimes I sit with it and realize the agent’s approach is actually fine, and I was just defending a preference I’d never examined. That’s a quiet kind of feedback you don’t get when you write everything yourself.</p><h3><strong>What it can’t do (yet)</strong></h3><p>This workflow works for well-specced features where the design space is reasonably constrained. Vague tickets produce vague plans — the approval gate catches it, but it means you either sharpen the spec yourself or send the agent back to ask clarifying questions.</p><p>It doesn’t handle cross-cutting refactors well. Renaming a core protocol that touches 40 files across three modules is technically within the agent’s capability, but it’s the kind of change where I want more control.</p><p>And it can’t replace the judgment call of <strong><em>what to build</em></strong>. That’s still mine.</p><h3><strong>What the numbers actually say</strong></h3><p>I don’t have A/B-tested velocity metrics or a control group. What I have is the git log, and it tells an honest story.</p><p>The project started in January 2026. In the first month: 40 commits. The docs were thin, the conventions were still being defined, and the agents needed a lot of correction. By February, with the convention system in place: 164 commits. March: 267 — and the month isn’t finished.</p><p>That’s the curve I’d expect if the hypothesis is right. Velocity should <strong><em>increase</em></strong> as the codebase matures, not decrease, because the agents are reading better docs. Traditional solo codebases go the other way: the more code there is, the slower each addition gets.</p><p>After 10 weeks: 143,000 lines of non-generated Swift. Five fully shipped feature domains. 704 tests. Thirteen convention documents. Four ADRs. One engineer — who is also an Engineering Manager running a team of five direct reports.</p><p>That last part is the real metric. This wasn’t built in a focused sprint with nothing else on the calendar. It was built alongside 1:1s, roadmap conversations, and everything else that comes with managing people. The system doesn’t just produce output quickly — it produces output in the gaps. That’s a different claim than raw speed, and I think it’s the more useful one.</p><p>The system is a multiplier, not a replacement. The engineer who designed it — who wrote the docs, the golden principles, the agent workflow, the test infrastructure — that’s where the leverage comes from. The agents carry the implementation load. The human focuses on the decisions that actually matter.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a24a76f33446" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>