The SCRUB Framework

shape
shape
shape
shape
shape
shape
shape
shape
Prompt Engineering, With Discipline

Ship AI-assisted code that isn't quietly wrong.

Generative AI writes code that compiles, looks idiomatic, and passes its tests — and is wrong in a way only domain knowledge catches. It's not a bug you can patch or wait out. SCRUB is the discipline that closes the gap. Five elements, every prompt, every time.

ScopeConstraintsRestrictionsUsageBehavior
Examples in Practice

Practical AI Assisted Development

A Field Guide to Disciplined Prompt Engineering for Production .NET Code — using the SCRUB Framework.

.NET 10 · Aspire · EF Core 10 · Angular 20
Robert FelkinsArchitect4Hire

The Plausibility Trap

A tip calculation defaulted to 20% instead of the 18% the business runs on. It compiled. It passed its tests. Nobody flagged it in review — because the code looked right. It ran for six months across a hundred and eighty thousand receipts before a customer noticed. That's not a skill bug. It's a context bug — and it's the default outcome when you let an AI fill a gap you never defined.

The AI did the wrong thing

Vague scope produced something other than what you needed. Fixed by S.

The right thing, the wrong way

Correct output, foreign patterns — the drift that quietly makes a codebase inconsistent. Fixed by C.

The Plausibility Trap

Compiles, looks idiomatic, passes its tests, and is silently wrong in a way only domain knowledge catches. Fixed by R.

Works, but not for its caller

Correct in isolation, wrong for its operational context — no audit log, no jurisdiction, no compliance. Fixed by U.

The refactor broke existing behavior

You asked for one change and got ten. Renamed a method, changed a default, broke the callers. Fixed by B.

“In prompt engineering for production code, what you EXCLUDE matters more than what you include.”

Five Elements. Every Prompt. Every Time.

SCRUB is not a template you install or a script you run. It's a checklist you practice — one that names, for each element you skip, exactly which class of bug you just invited.

S

Scope What am I asking for?

Name the exact deliverable. List the methods, the signatures, the file paths. If it takes more than three sentences, split the prompt.

C

Constraints What are the rules of my codebase?

Framework versions, architecture, naming, DI, conventions. Match YOUR codebase — not the generic average of the training data.

R

Restrictions What do I explicitly NOT want?

The most important element. Start every line with "Do NOT," explain WHY, and say what to do INSTEAD. This is what defeats the Plausibility Trap.

The star of the framework
U

Usage Who calls this, and in what world?

Callers, compliance regime, audit expectations, concurrency, latency. The domain context the AI cannot infer and will otherwise invent.

B

Behavior What must NOT change?

The star of Edit Mode. All existing callers compile. All existing tests pass. State it positively AND negatively. Only ADD what you asked for.

What's Inside

The printed companion to a 105-minute conference session — expanded with the context, the anecdotes, the code, and the "I tried it the dumb way first and here's what happened" stories. Eight parts, thirty-six chapters, one runnable reference application.

I

The Problem & The Framework

The Plausibility Trap, meet SCRUB, and a deep dive on every one of the five elements — with the reasoning behind each.

II

Working Across Tools

The same framework across Inline, Chat, Agent Mode, and Edit Mode. Same discipline, shifting syntax.

III

Patterns That Compose

Prompt chaining, tiered restrictions, and layered SCRUB — how the framework earns its keep on real work.

IV

Why This Stack

.NET 10, Aspire, EF Core 10, Angular 20 — every pick defended against the alternative it rejects.

V

Building AspireCafe

A real, runnable cafe POS built end-to-end with ~30 SCRUB prompts. Clone it Monday morning.

VI

Diagnose & Iterate

The Diagnostic Card, the five-step refinement loop, and custom instructions that shrink every prompt.

VII

Make It Yours

Build a prompt library, extend the codebase, and treat prompts like the code they generate.

Reference Appendices

The SCRUB cheat sheet, the full Diagnostic Card, a glossary, and the complete index of AspireCafe prompts.

The AspireCafe Reference App

A real system, not a toy.

AspireCafe is a fully-runnable cafe point-of-sale built across three .NET 10 microservices, an Angular 20 POS, an Aspire AppHost, and a SQL Server backend — every line produced with SCRUB and documented prompt by prompt.

  • Boots on your laptop: build an order, route it to a table, run a simulated payment, watch the trace.
  • Every prompt is documented — including the ones where the AI tried something clever it had to be talked out of.
  • Deliberately incomplete, with TODOs where the exercises begin.
Get the Codebase
A SCRUB prompt, in the wild
[S] Create IOvertimeCalculator scaffold — SIGNATURES ONLY.
[C] .NET 10, primary constructors, existing IPayrollAudit sink.
[R] Do NOT implement the calculation — leave // TODO.
    Do NOT default to federal 1.5x — jurisdiction resolves first.
    Do NOT use double / float — decimal math only.
    Do NOT log SSN, DOB, or bank routing — EmployeeId only.
[U] Called by the HR admin portal. SOC 2 audit on every write.
[B] All existing callers compile unchanged. Only ADD.

Who This Is For

You write code for a living. You ship it to production. This book is for you.

Engineers who ship AI-assisted code to production and have felt — or are about to feel — the cold-sweat panic of code that compiles and quietly does the wrong thing.

Architects who have to sign off on systems built by a mix of developers and three different generative AI tools.

Team leads onboarding juniors who will lean hard on Copilot and Claude Code from day one.

Engineering managers who want to know what disciplined AI-assisted development actually looks like before they defend their tooling to a board.

Write the prompt. Write the restrictions. Verify the output.

Every "AI-generated code is unreliable" complaint is a complaint about an unwritten prompt. SCRUB is how you write it.

Start a Conversation
map
shape
shape