> **Principal Software Engineer** · March 2025 to present
> Source: https://www.simonbetton.com/case-studies/house-of-doge.md (markdown only; there is no HTML page for this document).
> Index of case studies: https://www.simonbetton.com/case-studies/index.md

# Case study: Such - a Dogecoin wallet for everyday payments

## Quick facts

|  |  |
| --- | --- |
| **Role** | Principal Software Engineer at House of Doge; founding engineer on the mobile client |
| **Company** | House of Doge |
| **Product** | Such, a consumer Dogecoin wallet with merchant payment tools, on iOS and Android |
| **Timeline** | March 2025 to present; first commit 3 April 2025. Repository figures are as of August 2026 |
| **Team** | 16 contributors over the life of the repository, five to ten committing in any given month from August 2025 |
| **Scale** | About 94,000 lines of hand-written TypeScript and TSX in 1,130 files (118,700 lines in 1,336 files including generated Protobuf code), 4,832 commits on the main branch, about 820 pull requests merged |
| **My share** | 1,032 of the 4,832 commits on main (21%), the only committer for the first eleven weeks, and the merger on 236 of the 749 pull-request merge commits |

## Overview

I was the founding engineer on Such's mobile client, and most of the decisions I made there were about how a growing team and its AI agents would work in one repository. I was the only committer for the first eleven weeks and set the package layout, the layering rules, and the CI and build pipeline the team still ships through. I owned the wallet, authentication, secure storage and storage layers. I merged 236 of the 749 pull requests on main, which made review the main way I shaped code I did not write. When written conventions started to decay, I moved the repository onto enforceable ones: a typography lint rule that fails the build, the migration to Oxlint and Oxfmt, a hard complexity ceiling, and an advisory code-health gate on every pull request. I initiated the architecture decision records and the domain glossary. And I standardised the team's agent tooling on a locked, versioned skill set and wrote the two repository-specific skills that colleagues now maintain. The rest of this page is the detail behind that paragraph.

Such is a non-custodial Dogecoin wallet with a merchant side for invoices, quick charges and hosted payment links: keys are generated, held and used to sign on the device, and the backend never sees a secret. The app moves money, so a bug can cost a user real funds with no undo; a bad release sits on devices until the store approves the next one; and a small team ships it quickly against a moving backend, so the codebase has to be legible to people who did not write it, including AI agents. This is about the mobile client; the backend and the Rust signing library are separate systems I integrated rather than built.

## The problem

When I made the first commit in April 2025 there was no client. The backend contract was being defined in Protobuf in a separate repository and changed weekly. The cryptography lived in a Rust library wrapped as a native module, and the client had to consume it without holding key material in JavaScript longer than necessary. And the team was going to grow into an app with a dozen or more user flows, which without hard boundaries import each other until the app is one large connected component. The problem that mattered most only became visible later: AI coding tools became useful during the project's life, but only as useful as the context the repository gave them, and a repository written for humans who already know the conventions is one an agent will guess at, and so will the next engineer.

## Setting the shape

From the first commit on 3 April 2025 until a colleague joined on 18 June, I was the only committer, and 117 of the first 200 commits on main are mine.

The repository is a pnpm workspace driven by Turborepo: the mobile app, an on-device Storybook, and about twenty internal packages split by responsibility rather than technology. Cross-package imports go through each package's declared entry point, so a package can restructure internally without breaking its consumers.

The layering rule is short enough to hold in your head. Route files are thin and only wire a screen. Screen logic lives in the feature that owns it. Feature-only UI stays inside its feature; anything two features need moves into a shared package. Features do not import each other. The rule is written down in the repository's code-quality skill, and the team has since agreed to relax it: a few hub features (account, profile, transfer, authentication) may be imported by other features. The package-level boundaries held as written.

I created the design system package with the first commit, with Storybook on device so it could be reviewed in isolation. About a fifth of its commits are mine, but most of its roughly 94 component modules and 68 stories were built by colleagues, and the move from NativeWind to Uniwind for Tailwind v4 was a colleague's migration.

## The delivery pipeline I set up

The first commit also set up how the team ships. The CI workflow ran lint, format and typecheck jobs on every pull request, on every push to main and in the merge queue, with the Turborepo remote cache shared across runs. A new push cancels the superseded run on a branch, but never on main, so every commit on main has a complete record. The build configuration in that commit defined EAS profiles for development clients, internal simulator previews and production, with app version numbers owned remotely by EAS rather than edited by hand in the repository.

I kept extending that pipeline as the team grew. I added the test job in July 2025, Expo Doctor checks in January 2026, and a dead-code and duplication analysis job in April 2026. In June 2026 I added a seven-day minimum release age on third-party packages, so a compromised or broken release has a week to be caught before it can enter the lockfile. In July 2026 came the code-health gate described below. Twelve of the CI workflow's twenty-one commits on main are mine.

In July 2025 I started end-to-end testing: the Maestro package with the first flow, which loads the home screen, and the first Android and iOS workflows, which started EAS end-to-end runs on manual dispatch and on a weekly schedule from main. Colleagues have since done most of the work on both; most commits to the Maestro flows are a colleague's, and the flows now run on every pull request on self-hosted runners that colleagues built (see below).

The pipeline stops short of continuous deployment. A merge to main is tested but not released: store builds go through EAS with version numbers incremented automatically, and then through App Store and Play review. For an app that moves money, where a bad build stays on devices until the store approves the next one, I think that is the right call. What I owned was delivery for one product team of 16 contributors, not delivery practice across the organisation.

## The layers I owned

The wallet, authentication, secure storage and storage packages are where I wrote most of the code and made the decisions.

On Android, seed phrases are stored in SharedPreferences, encrypted using the Android Keystore system. On iOS, they are stored in Keychain as `kSecClassGenericPassword` items. Users can also opt in to storing their seed phrases in Apple iCloud.

Encrypted backup to the user's own cloud storage uses AES-256-GCM with a PBKDF2-derived key, a versioned payload schema so a future format change is detectable rather than a silent decryption failure, and classified failures so the UI can say "wrong password" rather than "something went wrong".

Remote authentication is anonymous public-key login, which fits a wallet: the user's identity is their key rather than an email address. The client derives an authentication keypair from the on-device seed, signs a server challenge, and exchanges the signature for a session token held in secure storage. Device authentication is layered on top and separate on purpose: a valid backend token does not prove the person holding the phone is the owner, so sensitive actions run through a gate that resolves either authenticated or cancelled, and a dismissed prompt cannot fall through into a signed transaction. A colleague later found and fixed the remaining hole: the guard has to sit on the screen owning the secret rather than on the button that navigates to it, because every screen in an Expo Router app is deep-linkable.

Local persistence has three tiers chosen by durability need: encrypted secure storage for secrets, MMKV for fast synchronous reads, and async storage for larger structured data, with a migration runner that stops a shipped storage change from bricking an existing install.

Client observability is Sentry, and in August 2025 I wrote down why it is not OpenTelemetry: on React Native there was no reliable auto-instrumentation or async context propagation, and a mobile-first SDK gave more out of the box. I also wrote the log-level policy, which defines each level by its operational meaning for a wallet.

## Making the conventions enforceable

The design system had typography components from the first commit, but by mid-2026 raw text primitives had crept back in across the app. In the first week of June 2026 I swept the app back onto the typography components and wrote a lint rule that fails the build if a raw text primitive is used where a typography component belongs. The rule matters more than the components; a convention without enforcement decays the moment someone is in a hurry.

Those checks also had to be fast enough for people to live with. Engineers were finding ESLint and Prettier slow across the monorepo in their IDEs. There had been attempts to optimise the setup for short-term relief; two weeks after the typography work I migrated the repository to Oxlint and Oxfmt and carried the rule across as an in-house plugin. The difference was noticeable because the tooling stopped being noticeable: formatting and linting no longer felt like a wait while editing, and the CI feedback loop was faster too. The quality expectations stayed high; meeting them became less intrusive.

The same migration set a cyclomatic complexity ceiling as a hard error. A colleague then added a cognitive-complexity budget of 15, using SonarSource's metric, as a warning first, and wrote the second in-house lint plugin.

I added the advisory code-health gate that runs on every pull request, posting only the issues the pull request introduced relative to the merge base and deliberately not failing the check, and wrote the false-positive register that records which findings are intentional so triage does not restart from zero. Advisory-only was the way to introduce it without red-crossing other people's work on day one.

I also introduced Fallow and React Doctor to help engineers catch recurring problems in AI-assisted changes and bring them back to the project's patterns. The repository-specific instructions, later skills, told agents how we expected work to be shaped; the analysis tools gave engineers findings to act on and discuss in peer review.

Fallow's CRAP scores were useful for deciding where that review needed more attention. Change Risk Anti-Patterns combines cyclomatic complexity with test coverage:

```text
CRAP = CC² × (1 - coverage/100)³ + CC
```

Here CC is cyclomatic complexity and coverage is a percentage. The score gives more weight to complex code with little test coverage. It added context to the complexity ceilings: a function with necessary branching and good coverage called for a different discussion from one with the same branching and little coverage. We could look at simplifying the function, covering more of its behaviour, or both. The score helped focus that discussion; it did not replace review or the existing limits.

## Agent context as a versioned artifact

Agent instruction files were in the repository from 4 April 2025, the day after the initial commit, and 39 of the 49 commits to them on main since are mine. In March 2026 I standardised the agent tooling on a locked, versioned skill set installed through an open command-line tool: the lockfile is committed, installation fans out to Claude Code, Cursor, Codex, and OpenCode from one source of truth, and in May I added a staleness check that refreshes skills weekly on install rather than leaving everyone on whatever they fetched months ago. That makes agent context reproducible: a new engineer's agent behaves like everyone else's on day one, and a change in agent behaviour can be traced to a lockfile diff.

In June 2026 I migrated the repository's accumulated instruction documents into two repository-specific skills. The first encodes the authentication contract: the login pipeline, the device authentication gate and when to use it, seed phrase handling, and the safety rules stated plainly, such as that sensitive routes guard themselves rather than trust the button that navigated there. The second encodes architecture and code quality: package boundaries, feature layout, the complexity budgets and what to do when one trips, and the exact commands that make up a sufficient validation run. Colleagues have revised both since, as a shared contract should be.

Both open with the same instruction, and I think it is the most important line in either document: prefer live repository evidence over this document, and if they disagree, follow the code and say so. A stale skill therefore degrades into a hint rather than a confidently wrong instruction. A document an agent will act on has to name the decision procedure, and stating a rule that precisely is the same work as making it clear enough for a new hire. Model Context Protocol servers for the design tool, build platform, code host and dead-code analyser sit alongside, so an agent can read a design or query build state rather than guess.

Of the 4,832 commits on main, 185 carry an AI co-author trailer, under 4%, 14 of them mine. Agents have been most valuable on wide mechanical changes with a mechanical test, such as migrating the component library off ref forwarding for React 19 or converting text usage to typography components, and least useful where the correct answer depends on a constraint outside the repository, in Apple's documentation or in a measurement, which is why so much of the work above went into moving specifications into the repository.

## What colleagues led

Several of the most technically interesting parts of the repository are colleagues' work, and I want to be precise about them. The transfer screen was rebuilt by a colleague in mid-2026 as an explicit state machine with a pure, directly unit-tested reducer and a single orchestrator for side effects, and their decision record is honest about the cost. The DogeConnect merchant payment path, was implemented mostly by colleagues: before any amount is rendered it checks that a hash of the relay's public key matches the bytes in the QR code, verifies a BIP-340 Schnorr signature over the payload, and rejects expired requests; I contributed to it and reviewed it but did not design it. The build and release infrastructure is the most unusual engineering in the project and is almost entirely colleagues' work: local builds on ephemeral macOS virtual machines, iOS branch builds delivered through TestFlight via a never-published shell app record, build provenance carried in the app manifest, and one distributed trace per pipeline run. I initiated the architecture decision records and the domain glossary, but the records for those choices, and the glossary that pinned the project's terms for builds, distribution and the two invoice types, were written by colleagues from June 2026. The glossary has since split the way domain-driven design would split it: alongside the repository-wide glossary, the transfer, account, QR scanner, diagnostics and support-messaging features each have their own glossary, so a term means one thing inside the feature that owns it. The repository never uses the DDD label, and I reviewed and merged that work rather than writing it. Colleagues also wrote the git worktree lanes that let several agents build and drive the app at once on one machine, the feature-flag layer, the validated Protobuf type variants that remove optional chaining from the UI, and the pnpm dependency catalog and isolated linker. I merged a good deal of this work, and review is not authorship.

## Agentic features in the product

There are none, and I think that is correct for a non-custodial wallet today. The application contains no model inference and no calls to a model provider. A language model in the payment path puts a non-deterministic component into a flow where the user is authorising an irreversible transfer of their own funds, and no argument for it survives the question "what happens when it is wrong about the amount". Where a conversational surface helps, which is support, the product uses a human-backed messaging platform with a plain email fallback, built by a colleague.

## Technologies and standards

Cryptography and protocols: BIP-39 mnemonic seed phrases, hierarchical deterministic key derivation, BIP-340 Schnorr signatures, SHA-256, AES-256-GCM, PBKDF2, the DogeConnect payment protocol, and challenge-response public-key authentication.

Client platform: Expo SDK 57, React Native 0.86, React 19.2 with the React Compiler, Expo Router, TypeScript 6, Reanimated, MMKV, Nitro Modules, Rive, and Expo's secure store and local authentication modules.

Data and state: Protobuf with Buf code generation, Connect RPC, protovalidate, TanStack Query with persistence, Zustand, Zod, and result types via neverthrow.

Styling: Tailwind v4 through Uniwind, class-variance-authority, and a token-based semantic theme.

Quality and tooling: pnpm workspaces, Turborepo, Oxlint and Oxfmt with two in-house plugins, cyclomatic and cognitive complexity rules, Jest with React Native Testing Library, Maestro, Storybook on device, Fallow including CRAP scoring, and React Doctor alongside the advisory code-health gate.

Delivery and operations: GitHub Actions with Turborepo remote caching and a merge queue, EAS Build profiles with remotely managed app versions, EAS local builds on self-hosted runners, TestFlight distribution through a shell app record, Sentry, Pino, Statsig with OpenFeature, and OpenTelemetry tracing of the pipeline into Honeycomb.

## Results

The change I saw in the team was fast delivery using shared styles and patterns, with a high standard of work. Engineers spent less time waiting for linting and formatting, CI returned feedback sooner, and the combination of project skills and code analysis helped keep AI-assisted changes consistent with the rest of the app. Developer sentiment improved too: the tooling was something people could trust to help them, with less friction in the editing loop. These are qualitative observations, not a measured throughput or defect-rate comparison.

The codebase reached about 94,000 hand-written lines across 1,130 TypeScript files and roughly 820 merged pull requests from 16 contributors, and the package layout set in the first eleven weeks still describes it. Correctness pressure sits in automation rather than review comments: 120 Jest test files, an end-to-end Maestro run per pull request, the complexity ceilings, the typography rule, the code-health gate, and a seven-day minimum release age on third-party packages. Agent context is a versioned, reproducible artifact rather than per-developer configuration, with written contracts that tell agents to verify against live code.

This is a live product whose commercial metrics I am not going to publish; I do not have crash-rate, funds-at-risk or delivery-speed figures I can share, and I have not measured whether the agent tooling changed throughput.

## What I would do differently

I would write the domain glossary and the repository-specific skills at the start rather than a year in. Both arrived in mid-2026, and the terminology drift the glossary fixed had already cost review time and at least one bug from two people meaning different things by the same word. The architecture decision records also started in June 2026, at my initiative and written by colleagues; the Sentry decision I wrote down in August 2025 is the only early one, and every early decision deserved a record like it.

I would enforce the architectural boundaries by lint from the first month, the way the typography convention eventually was. Typography components existed from the initial commit, decayed until a lint rule arrived fourteen months later, and have held since. Feature isolation was written down just as clearly, was never given a rule, and the team agreed to relax it around a few hub features, a reasonable call; but a relaxed rule needs lint as much as a strict one. Writing a convention in a skill makes agents and new engineers aware of it; only enforcement makes it true.

I would graduate the advisory code-health gate faster; advisory-only was the right way to introduce it, but it stayed advisory longer than needed once the signal proved out. And I would be more disciplined about which work goes to an agent: the successes cluster in wide mechanical changes with mechanical verification, and the time I lost was mostly on tasks where the constraint lived outside the repository, which I could have predicted more often than I did.
