Context Switch
← All references
Library / Working with AI
Reviewed Oct 2026

Building Software with AI

Prototype to learn, then freeze boundaries and build reliably.

01 / table

Different phases, different AI jobs

PhaseGoalAI role
PrototypeDiscover interaction and behaviorExplore and challenge disposable ideas
TransitionDocument golden behaviors and ownershipAudit source-of-truth paths and invariants
Real buildMake implementation maintainableSmall bounded changes, tests and QA
Make the prototype answer a question: Name the uncertainty the prototype should resolve. Use representative data (synthetic, sanitized, or explicitly authorized) and familiar components where they affect that question, and include realistic exceptions. Record what it demonstrated and what remains untested. A search prototype should show whether people find useful results across representative queries, including weak or empty ones; a polished screen with hand-picked results cannot. A realistic prototype can support a product decision without proving production readiness. Further reading: Inside Reddit Proto: Real Data, Constrained Prototypes, and a Better Handoff (Claire Vo, How I AI, Oct 2026).
02 / cards

Before production code

Source of truth

Exact frontend, backend, schema, and deployment paths.

Behavior contract

What must always remain true independent of model output.

Golden behaviors

Written expected user outcomes before implementing.

Ownership map

Which layer owns routing, validation, persistence, and authority.

Provider spike

Real schema, cost, latency, failures.

Smoke gate

Deployed journeys proving baseline usability.

03 / flow

Repair loop

ReproduceFailing testFind owning layerRemove conflictFixFull suite + deployed check
04 / table

AI as separate jobs

RoleUse
ArchitectFind simplest owning design and invariants
BuilderImplement one bounded slice
QAAttack assumptions and capture regressions
ProductTest actual user confusion and value
05 / list

Working rules

GOING DEEPER

Three debugging lessons from real builds

Symptom → actual cause → reusable lesson

SymptomWhat went wrongProduct/engineering lesson
Wrong factual answerFrontend used the wrong execution path; the model was not the owning layerCheck routing, retrieval, context and authoritative state before prompt changes
Broken deployed modalConflicting CSS/JS visibility mechanisms and accumulated overridesRemove the conflict; give the behavior one owner instead of patching again
AI calls felt slowModel inference dominated latency, not SQLMeasure provider timing and optimize the real bottleneck; use interaction design or genuine streaming where useful

Complexity worth keeping vs removing

Useful complexityAvoidable complexity
Explicit authority and product invariantsDuplicate runtime paths and ambiguous routing
Meaningful state transitions and review historyPatch-on-patch CSS or hidden fallback behavior
User journeys learned through testingMultiple files claiming to own the same behavior
Deployed smoke gate: The repair loop is reproduce → failing test → identify owner → remove conflicts → fix → full tests → deployed-browser check. Convert important bugs into regression coverage, and preserve the prototype → transition → maintainable build phase boundary.