Frameworks are easy to describe. These are the working documents behind them: the templates I start from, and real examples taken from the products in my case studies. Nothing here is a mock-up. Where something is designed but not yet run, it says so.
1. AI feature spec (template)
Every AI feature I scope answers the same seven questions before anyone writes a prompt. Filled-in versions are the "Decisions at a Glance" tables in the Ultipad, RAGOS, and DeepAgent for funnels case studies.
| Section | What it must answer |
|---|---|
| 1. Should this be AI? | The user problem, today's workaround, and an AIM score. Below 10, stop: traditional software wins. |
| 2. Is the data sufficient? | What the model sees at decision time, where it comes from, how fresh it is, and what's missing. |
| 3. Acceptable failure mode | The wrong output we can live with, and the one we can't. The second one needs a structural guard, not a prompt. |
| 4. Architecture that limits the damage | Workflow or agent, which model does which job, and where deterministic code takes over. |
| 5. How it's evaluated | The metric, the threshold, the golden set, and the release rule. Written before the build. |
| 6. Cost at production scale | Cost per successful outcome, not per call, at expected volume, plus the latency budget. |
| 7. Where humans stay in control | Every approval point, every override, and who owns the escalation. |
Close with out of scope and kill criteria. If you can't say what would make you stop, you're not ready to build.
2. Evaluation plan (as run on RAGOS)
This is the plan the RAGOS eval pipeline actually runs. The reasoning is in Faithfulness over accuracy.
| Primary metric | Faithfulness: does the answer stay inside what retrieval returned? |
| Floor | 0.85. Below it the model is confabulating, and the first suspect is retrieval, not the prompt. |
| Live result | 0.96 faithfulness in live use |
| Phase A | Retrieval quality on a golden set of known-answer queries. Are the right chunks coming back? |
| Phase B | The full pipeline on representative queries: expansion, retrieval, reranking, generation, citation. |
| Phase C | Real production conversations, scored by an LLM judge against the retrieved context. |
| Golden set | Half the test questions harvested from real user feedback. Every 👍/👎 feeds the set. |
| Release rule | Every deploy runs the golden-set gate. A failing deploy rolls back automatically. |
| Cost | ~$0.001 per grounded answer, cheap enough to judge every answer, not a sample. |
| Doc-gap loop | When the docs don't contain the answer, the gap is logged and lands in a weekly digest. |
3. Decision records
Three real decisions, written the way I record them: context, decision, alternatives, consequences.
DR-01 · Score spec drift with a decision model, not an LLM (Ultipad)
- Context: AI coding agents produce valid code that can still be wrong for the product. We needed to check every commit against the approved spec.
- Decision: a typed decision model returns an alignment probability for each commit. It's advisory: it flags the owner and never blocks the merge.
- Alternatives: an LLM judge that writes a paragraph we then parse for a verdict (slower, costlier, fragile to parse); a hard blocking gate (a drift detector that blocks is one that gets uninstalled).
- Consequences: cheap and fast enough to score every commit. On-spec work scores around 89% aligned, an unrelated commit around 25%. The known gap: commits that bypass the loop are never scored.
DR-02 · Self-host the RAG pipeline, no Dify or LangFlow (RAGOS)
- Context: the product's value is answers people can verify against their own documents. That trust lives in retrieval and citation.
- Decision: own the pipeline end to end: custom orchestration, Qdrant hybrid retrieval, reranking, one model gateway.
- Alternatives: a hosted RAG builder. Faster at month one, but its abstraction sits on the critical path of user trust and can't be tuned when trust breaks.
- Consequences: more work up front, and full control of the eval loop. Model choice stays a per-query product decision through one gateway, not an architecture rewrite.
DR-03 · Enforce agent approval on the server, not in the prompt (DeepAgent for funnels)
- Context: agents that deploy live funnels on a $6M/day checkout. An agent proposing a bad funnel is acceptable. An agent changing anything unapproved is not.
- Decision: two server-side layers. LangGraph interrupts on every mutating tool, and a deterministic gate refuses execution without explicit approval in the current turn.
- Alternatives: instructing the agent to wait for approval. A prompt is a request, not a barrier.
- Consequences: a slightly slower flow with one human click per plan. The prompt becomes defence in depth, and "nothing mutates without approval" is a property of the system.
4. Experiment design: value-first onboarding (Ultipad)
Designed, not yet run. From the Ultipad honest teardown.
| Problem | Four human steps before an agent delivers any value. Cold start kills the loop. |
| Control | Ceremony-first onboarding: evidence → decision → spec → approval → agent value. |
| Treatment | Value-first: the spec is auto-drafted from the developer's first prompt, then approved retroactively. |
| Hypothesis | Value-first raises week-4 loop completion without raising drift incidents. |
| Primary metric | Week-4 loop completion rate |
| Guardrail | Spec approval stays human. If auto-draft quietly becomes auto-approve, the test measures a different product. |
| Kill criterion | If teams using the gate ship wrong features at the same rate as teams without it, the gate is theater. |