A coach’s methodology, taken from a one-week prototype to a production app live with its first users as a freemium product, in about five weeks. People often reach for it in a hard moment, so the AI is safe by construction. I built it solo, with a fleet of AI coding agents.
The client
Restored Minds is the work of Matt Codde, LCSW. His Triple-A Response® is a solution-focused method for breaking the OCD-and-anxiety loop: Agree and Disengage → Allow the Anxiety → Attack the Anxiety. Matt had a proven methodology, an audience, and a Kajabi-hosted course business. What he didn’t have was software that could deliver the method’s daily practice at scale: a public assessment that meets people where they are, converts them to a paid trial, and then composes a personalized daily plan for each user, every day, without a human in the loop.
He had also been carrying the idea for a decade. The first version of Restored Minds dates to 2016, and the app existed in his head for most of that run, held back by the belief that software was outside what he could do. “It was way beyond anything that I really knew how to do,” he says. “I don’t have the team for it. I don’t have the capacity.”
In Matt’s words, the job was to take “everything I know” from working with someone one-on-one and give it to them “on the go every day.”
The real problem
Most “AI wellness app” briefs end at a chatbot. Matt knew from the start that for his methodology, a chatbot is actively harmful.
The Triple-A Response rests on non-resistance. The problem is never the content of an intrusive thought; it’s the compulsion loop (obsession → anxiety → compulsion → relief → reinforcement). That single fact cascades into hard product constraints:
- No reassurance. Reassurance-seeking is itself a compulsion. An AI that says “you’ll be fine” feeds the loop it’s meant to break.
- No engaging thought content. The AI must never discuss whether a fear is “rational” or “real.” That’s the compulsion in disguise.
- No scores or levels. A score reinforces “this is a problem to be solved,” which contradicts the non-resistance frame. The app reads the user’s internal state to decide what to give them next, but the user must never see the measurement.
- No clinical labels. “Fear loops,” never “OCD.” “Obsessive-compulsive fears,” never “disorder.” People reading it are often in a heightened state; the language stays experiential.
- No PII in prompts. Ever.
- No outcome prediction. The single most damaging slip on harm-themed fears is an AI promising the feared event won’t happen (a covert safety behavior). The honest move is to act against the compulsion and let the fear stay openly unresolved.
Get any of these wrong and you’ve broken the methodology. So the build sorts them by how hard each one can be enforced. Where a constraint is structural, it is structural: the app refuses to boot if any theme is missing its body anchor or its refusal language, and no user PII is interpolable into a prompt at all. Where a constraint governs generated prose (no reassurance, no outcome prediction), a written instruction is all you can enforce up front, so the build pairs it with an automated audit of what actually reached the page. Knowing which constraints get which treatment is most of the work.
Matt’s framing of the project, from the first day: “It wasn’t about could we do this — of course we could. It was about should we do this, and how do we do this in a way that’s going to serve people, but it’s also doing it responsibly.”
Under the hood: constraints as code. The project’s
CLAUDE.md(the living engineering contract) encodes every constraint as a non-negotiable rule, and every AI agent working in the repo loads it before touching a file. “No user-visible scores” is enforced by omission in the server-rendered HTML: the system’s read of the user’s emotional position and stage of resistance exists, drives every composition decision, and is reachable only behind an admin check. The score card and/progressroute that existed in early prototypes were deleted at Matt’s call, once the methodology implication surfaced.
The product
A single conversion arc, two surfaces joined by a paywall:
01
Public assessment
No clinical language. Filters to the user’s specific theme.
02
AI-composed results
The “loop map,” personalized to the user’s theme.
03
Paid trial
The Stripe paywall, reached by intent.
04
Daily flow
Check-in → AI daily plan → releases, meditations, “I’m Stuck.”
A visitor takes a structured assessment that routes them to one of 31 fear themes (45 today). An AI generation composes a personalized “loop map” results page, and that page is the conversion moment. After a paid trial begins, the authenticated app delivers the daily practice: a check-in, an AI-composed daily plan built around the Triple-A method, and a curated library of audio releases, meditations, and “I’m Stuck” protocols.
Matt is precise about the scope: “We didn’t just build an app — we built the entire funnel.” That funnel is three products: a free assessment that works out where someone is, a free loop map that delivers real value in exchange for an email, and the subscription app behind it. The first two bring people in, and the subscription is what they pay for.
The stack is mature and chosen on purpose: Rails 8, Hotwire, PostgreSQL, Tailwind, deployed on Railway, with RubyLLM → OpenRouter for AI and the model chosen per prompt: Opus for the conversion-critical results, Haiku for the high-volume daily flow, and a Sonnet escalation for the harm-content themes’ daily plans. A solo-maintained product lives or dies on how much the framework gives you for free; every dependency added is one someone has to keep alive.
Three decisions worth their tradeoffs
Config-as-code. The assessment questions, the AI system prompts, the 45 theme protocols, the education library, and the legal documents all live in versioned source files in the repo. They ship and roll back atomically with deploys, are reviewable in pull requests, and can’t drift out from under the code that depends on them. The tradeoff is no non-technical editing UI, and it was the right call: this is authored content, and “reviewable in a PR” beats “editable in prod” for something Matt has to stand behind.
Internal classification the user never sees. The system models each user’s emotional position and stage of resistance to decide which meditation, intention, and framing to compose next. That classification drives every composition decision and is structurally walled off from the UI. The user receives “the next right thing” and never sees a dashboard of their own struggles.
Free assessment, paid practice. The gate is at generation. The check-in is open to everyone. For a non-subscriber, the personalized daily plan never gets generated in the first place. There’s no hidden version to leak. A just-converted user gets their plan immediately because checkout reconciles the subscription synchronously before redirecting. The paywall is the conversion point, and the user reaches it by intent.
The hard problems
1. Safe AI for the hardest moments
The constraints above are enforced at three separate layers:
- Prompt construction. Prompts receive only anonymized, structured context: no names, emails, or free text. No free text ever reaches the AI. Every input the AI sees is a structured choice: a toggle, slider, or selection. The model can never be handed crisis content the app isn’t equipped to handle.
- Theme-faithful generation. Every theme carries a distilled protocol (body anchor, compulsion-payoff-denial rule, opposite-action menu, refusal language, crisis indicators), and the app raises at boot if any theme is missing one of them. Eight harm-content themes are flagged
theme_locked, which forces the prompt to anchor “do the opposite” against the compulsion, never the thought content. Thought content is the single most dangerous place for an AI to freelance. - A self-auditing verifier. After every results and daily-plan generation in production, an asynchronous LLM judge grades the output against eight methodology criteria:
no_reassurance,no_outcome_prediction,no_thought_content_engagement,non_clinical_language,no_pii_leak,body_anchor_referenced,opposite_action_grounded, andharm_lockin_respected. It grades the rendered page text the user actually sees, because a malformed payload can pass schema validation while the reader falls back to safe boilerplate. On any failed criterion it persists a verdict and fires a structuredprotocol_driftalert.
Under the hood: why grade the rendered page. The verifier re-renders the generation to text through the same engine the live page uses, then asks a skeptical judge to cite a verbatim quote as evidence for each verdict: “fail only on a clear violation; when in doubt, prefer n/a; never invent a violation.” It’s QA. On drift it persists and alerts, and auto-regeneration was deliberately left unbuilt. The methodology stays the source of truth; the machine just flags where the output drifted from it.
2. Personalization across every theme, validated before it shipped
“Looks fine on the three themes I checked” is how method-fidelity bugs reach users. Two custom harnesses made the quality bar evidence-based:
ai:compareruns a real prompt against multiple candidate models side-by-side, with anonymized sample contexts and cost/latency/token stats, so a model bump is a decision backed by a report.ai:sweepexercises the real generation path across every theme in the config, both flows, and dumps a self-describing review packet, including a high-signal “generated fields that never reached the rendered page” diff. That diff caught a real bug where the AI produced content the page silently dropped.
Every user-facing prompt change goes to Matt for sign-off before it’s enabled in production. That’s a standing rule in the engineering contract, and it’s held by people. The harnesses exist to make that human review fast and grounded in real output.
3. Production hardening for billing and PII
The work that doesn’t demo well:
- Passwordless OTP auth, hardened against session fixation, with per-email-and-purpose lockout and codes that can’t cross purposes.
- PII encrypted at rest via Active Record Encryption, with a boot-time guard that raises if encryption keys are missing in production, so a regression that would store plaintext fails loudly at boot.
- Idempotent Stripe webhooks recorded before processing, tolerant of unknown users, with a stale-event guard so a late delivery can’t resurrect a canceled subscription. Errors in the checkout and portal flows are reported.
- Account deletion that tears down the Stripe customer before destroying the local record; email changes recorded append-only.
- Errors raised and reported. A failed AI call surfaces, a webhook signature mismatch surfaces, a billing error is reported. Background jobs retry with backoff, then fail loudly to the alerting stack.
How the engagement was staged
Nothing was built on day one. The engagement opened with a one-day Deep Dive on the business as a whole. “We didn’t just go through the app,” Matt says. “We went through the entire business and, like, what is this going to serve?” Its output was a decision document: a plan, a scoped prototype, and an estimate of what a full build would take.
That plan made the next commitment small. A one-week prototype, deliberately rough and live on the internet, went to a few users for validation. What they found shaped the Build that followed: three weeks of building, then two weeks getting it ready for launch. A second group, the founding members, used the built app before the public launch.
It’s not like, ‘Okay Matt, go find the money and then we’ll build it.’ You said: we’re going to start small, agree on what success looks like, and when we hit that mark, we’ll decide if we want to keep going.
Each stage was priced on its own, so Matt never had more on the line than the next stage needed, and when it came time to decide, he already had the evidence.
How it was built: multi-agent orchestration
Restored Minds was built solo by orchestrating a fleet of AI coding agents:
- An orchestrator session scopes the work into an epic plus issues, and decides which run in parallel and which wait their turn. That’s what keeps parallel agents from colliding.
- Worker agents each implement one issue in an isolated git worktree with its own database, self-test, and open a draft pull request.
- A separate review session reviewed every build-phase PR. Author and reviewer must be different.
- A human gates the ship. No PR merges without explicit human confirmation, and anything touching billing, auth, PII, or data is read by a person first. No AI-only path ships those.
The speed came from the rigor that was already in place: 1,209 tests at launch, real CI, a separate reviewer on every PR, and a human gate on anything that touches money or data. Take away the tests and the review discipline and the same approach produces fast garbage. The 206 PRs merged by launch only happened because the guardrails held.
Results
At launch, after about five weeks (three weeks of build and two weeks getting ready for launch, after a one-week prototype):
- A freemium product live with its first users: public assessment → AI results → Stripe trial → daily flow, end to end.
- 206 merged pull requests, 1,209 automated tests, and a full CI pipeline (lint, dependency audit, Brakeman, unit/integration/system tests).
- 31 themes of personalized AI generation faithful to the method, each validated before shipping and continuously audited in production by an eight-criterion verifier.
- Real third-party integrations live: Stripe, Postmark, Cloudflare R2, Sentry/Better Stack, Kajabi. All of it is deployed on Railway with a dedicated background-job worker.
Matt financed the build himself. Two cohorts of real users vetted the product before the public launch, and the feedback he relays back is the kind you can’t engineer: “This has helped me so much.”
And it kept going. The product has stayed under the same discipline in the months since: 400 merged pull requests, 1,900+ tests, and 45 themes as of September 2026, against 206, 1,209 and 31 at launch. The work ran through a beta build sprint, a founder program, and an ongoing retainer. Launch was one stage in the engagement, and the engagement is still going.
The result that matters most: a product whose creator can stand behind every word it generates. The methodology survived contact with software intact, and the system is built to keep it that way.
A feature Matt cut
A personalized Triple-A walkthrough was built and tested against the methodology, and then reverted at Matt’s call in favor of static, Matt-approved results copy. Personalization at that point in the funnel risked drifting from the method. The test harnesses existed so he could make that call on evidence, even though it meant deleting a clever feature.
Stack
- Ruby on Rails 8
- Hotwire
- PostgreSQL
- Tailwind
- RubyLLM / OpenRouter
- Stripe
- Railway