Skip to content

AI Apps That Work / the template

A Next.js starter that knows when its AI failed.

Most starters connect a chat box to an API and stop there. This one records every AI result and what the user did next, so you and your coding agent can see which results users had to redo, who they were, and what each one cost.

Then your agent fixes the worst one first, and proves the fix on real past requests before your users see it.

The template, in development

$149$249

One payment. Founding price for the first 50 builders.

  • Next.js and TypeScript, with any AI provider
  • Records every AI result and what the user did next
  • A report of who the AI fails for, and what it costs
  • Instructions and skills for Claude Code, Cursor and Codex

One email when it's ready. No newsletter.

Works for any AI step, not just chat

Each kind of AI step has its own sign that a result needed a redo. The template knows ten kinds, so it can score your app from what users already do, without rating buttons.

Make
Creates new content from a request: an image, a post, slides, advice
Redo when the user hit “try again” or never used it
Answer
Replies to a question that has a right answer: a support reply, a policy question, a how-to
Redo when the user asked again, corrected it, or asked for a human
Transform
Reshapes material faithfully: a rewrite, a translation, text to speech
Redo when the user undid or rewrote it
Extract
Pulls out what's in the input: fields from a PDF, speech to text, text from a photo
Redo when someone fixed a field
Judge
Gives a label, score or choice that can be checked now: moderation, routing, a guardrail
Redo when a person overruled it
Find
Picks the few relevant items out of many: search, recommendations
Redo when the user ignored the results or searched again
Predict
Makes an estimate that can only be checked later: will this lead buy, is this fraud, when will it arrive
Redo when it turned out far off
Plan
Turns a goal into steps: a research plan, a multi-step task
Redo when it got stuck or had to start over
Act
Takes one action with side effects: send an email, take a payment, call an API
Redo when it failed or got undone
Learn
Updates a model or prompt from examples: a voice clone, prompt tuning
Redo when the new version isn't better than the old one

The list is a draft while the template is in development. Two kinds need extra care: users often can't tell you a decision or a prediction was wrong, so you check a small sample by hand or wait for the real outcome.

Real apps chain several steps

Each step reports on its own, so the report can say which one let the user down.

  • Support botFindAnswerJudge (hand to a human?)Act (open a ticket)
  • Invoice readerExtractJudge (needs review?)
  • Lead scorerExtractPredict
  • Email agentFindMakeJudgeAct
  • TranslatorTransform
  • Headshot appMake

One AI result, fully accounted for

This is what the template stores for every AI result, so your agent can learn from it. Here is one answer from a support bot, with notes. Field names may change.

{
  "id": "res_0142",
  "block": "answer",
Which block. Tells the template what “worked” means for this result: here, the customer didn't ask again.
  "model": "anthropic/claude-haiku-5.5",
Which model. Switch models and you can still compare before and after.
  "prompt": "answer@v4",
Which prompt version. Prompts are versioned. A version that has shipped never changes.
  "variant": "B",
Which variant. A new prompt or model goes to some users first.
  "plan": "pro",
Which customer and plan. So AI cost per customer and per plan sit next to what they pay.
  "segment": ["billing", "lang:de"],
Who it was for. So the report shows who the AI fails for, not one average.
  "worked_first_time": false,
Did it work first time. No. The customer asked the same question again. Recorded on the server, where ad blockers can't drop it.
  "retry_of": "res_0139",
History. A try again is a new result that points at the old one. Nothing is overwritten.
  "cost_usd": 0.0024,
What it cost. Every try is costed, so real cost per result is a query, not a guess.
  "in_test_set": true
Test set. Real requests become a test set your agent replays before any change ships.
}

Find the customers who cost more than they pay

Credits that can't lose money
Credit prices come from the real cost per result, counting the tries users threw away, so a heavy user can't cost more than they pay.
AI cost per customer and per plan
Next to what each customer pays, so you can see which plan the AI is eating.
The numbers you already watch
AI bill as a % of revenue, free-to-paid conversion and churn, on the same page as how often the AI works first time.

Work out your real cost per result now, free

Example: AI cost per customer by plan
PlanPays a monthAI cost a monthAI bill as % of revenue
Free$0$0.18n/a
Pro$19.00$2.1011%
Team$79.00$14.2018%
Example numbers, per customer. The Team plan is where the AI bill grows fastest.

What you get for $149

  • A Next.js and TypeScript codebase you own, with your own database and AI provider keys
  • A record of every AI result: the prompt and model version behind it, what it cost, and what the user did next
  • The report: how often each AI step worked first time, who it fails for, and what the redos cost
  • Prompts and models in versions, with each change sent to some users first
  • A test set of real past requests that your agent replays before any change ships
  • Credit pricing worked out from the real cost per result, and AI cost per customer and per plan
  • AGENTS.md and skills for Claude Code, Cursor and Codex

One payment: $149 for the first 50 builders, then $249. Coming later: a retrofit kit for apps you've already built.

The template, in development

$149$249

One payment. Founding price for the first 50 builders.

  • Next.js and TypeScript, with any AI provider
  • Records every AI result and what the user did next
  • A report of who the AI fails for, and what it costs
  • Instructions and skills for Claude Code, Cursor and Codex

One email when it's ready. No newsletter.

Questions people ask

What do I get when it's ready?

A Next.js and TypeScript codebase you own, for one payment: everything in the list above. The founding price is $149 for the first 50 builders, then $249.

Can I build my kind of app with it?

If your app has an AI step that makes, answers, rewrites, pulls out, decides, finds, predicts, plans, acts or learns, it's built for that. The list is still being finalised, so tell us what you're building when you join the waitlist.

What does “credits that can't lose money” mean?

Credit prices are worked out from your real cost per result, which counts the tries users threw away, plus payment fees and your margin. If a result usually takes two tries, the price already covers both.

Does my coding agent need special setup?

No. Claude Code, Cursor and Codex read AGENTS.md and skills from the repository on their own, so they follow the template's rules from the first feature you ask for.