←   AI-Native Development

SAMPLE SESSION · MODULES 02–03

Context, plan, evidence: a change cycle you can defend in review

A representative lecture from the middle of the course. It replaces ad hoc prompting with a repeatable cycle: build the context pack, get a plan before an implementation, and require evidence rather than reassurance.

12 slidesAbout 40 minutes of teaching plus a 35-minute exerciseInstructor notes included

Illustrative teaching material for AI-Native Development. Condensed for the web; the live session includes the walkthrough, the handout and the exercise review.

Slide 1 of 12

AI-NATIVE DEVELOPMENT · SESSION 02

Your next development skill
is direction.

What to supply, what to ask for, and what to refuse to accept.

THE UNCOMFORTABLE FINDING

Typing was never
the bottleneck.

Understanding an unfamiliar system, choosing an approach, and deciding whether a change is safe are the constraints. None of them improve because completions arrive faster — but all three improve when you change how you direct the work.

THE CYCLE

Six stages, two checkpoints, one decision log

THE CHANGE CYCLE · DIAMONDS ARE HUMAN CHECKPOINTS01RequestAmbiguous by default02Context packFiles, conventions, invariants03Change planApproach + trade-offs04ImplementSmall, reviewable steps05EvidenceTests, reproduction, logs06Review & shipDecision log attachedA checkpoint you would not defend in a code review is not a checkpoint.
The checkpoints are before implementation and before merge. Everything else can move as fast as you like.

THE INPUT

Output quality tracks context quality, not model size

WHAT GOES IN THE CONTEXT PACKWHAT QUIETLY RUINS ITArchitecture in five sentencesThe three files that matterNaming and error conventionsInvariants that must stay trueWhat is out of scopeHow the change will be tested×The whole repository×Nothing but the ticket title×Stale documentation×Secrets and customer data×Six competing conventions×A solution disguised as context
Most disappointing results are context failures wearing a capability costume.

WORKED EXAMPLE

A context pack that fits on one screen

context.md · billing service
# Billing service — context for this change

## Shape
PHP 8.2, no framework. HTTP entry points in www/, domain logic in app/.
MySQL via PDO only — no ORM. Stripe is the single payment provider.

## The three files that matter here
app/registration.php      creates and transitions registrations
app/payment-confirmation.php  the only place a payment becomes 'paid'
www/webhook.php           the only trusted source of payment truth

## Invariants — must still hold after the change
I1  A registration is only ever marked paid from a verified webhook.
I2  Every outbound message is written to registration_emails first.
I3  No code path outside app/ opens a database transaction.
I4  Money is integer minor units. Never a float, anywhere.

## Conventions
Functions, not classes, unless state genuinely persists.
Errors throw; callers at the HTTP boundary translate to responses.
Every query is a prepared statement. No exceptions, including admin.

## Out of scope for this change
Refunds, currency conversion, the admin UI, anything in database/.

## How this will be tested
The existing webhook integration suite, plus one new boundary case.

Six invariants and three file paths outperform forty thousand tokens of repository. State what must stay true — a model cannot infer what was never written down.

THE ASK

Ask for a plan. Reject it cheaply.

What you ask for

  • The approach, in five sentences
  • Two alternatives considered and dropped, with reasons
  • Which files will change and roughly how much
  • Which invariant each change could threaten
  • The tests that will demonstrate it worked
  • Anything it had to assume because you did not say

What you look for

  • An assumption you did not intend
  • A change reaching outside the stated scope
  • A missing failure case
  • Tests that restate the implementation
  • Confidence where the context was thin

The assumptions list is the most valuable output in the cycle. It is the model telling you exactly where your context pack was incomplete.

THE REVIEW

Six lenses, same order, every time

SIX LENSES · APPLY ALL SIX, IN THIS ORDER, EVERY TIME01CorrectnessDoes it do what was asked, including the case nobody mentioned?02ContractDoes it honour the interfaces and invariants around it?03SecurityInput validation, authorisation, secrets, dependency provenance.04TestsDo they derive from the requirement, or merely echo the implementation?05MaintainabilityWill the next person understand why, not just what?06Blast radiusWhat breaks if this is wrong, and how fast can it be undone?
Generated code carries the same review obligation as any contribution — arguably more, since nobody has held the whole of it in their head.

THE DOMINANT RISK

Plausible failure: fluent, structured, confidently wrong

  1. 01
    The API that does not exist

    A method with exactly the right name and signature for the job, on a library that never shipped it.

  2. 02
    The test that agrees with the bug

    Derived from the implementation rather than the requirement, so it passes and proves nothing.

  3. 03
    The silent contract break

    A refactor that preserves every call site and quietly changes what null means at one of them.

  4. 04
    The convincing explanation

    A fluent account of why the fix works, produced without executing anything.

  5. 05
    The scope creep with good manners

    Four improvements you did not ask for, folded into the diff you did.

SELECTION

Choosing a model without chasing a leaderboard

TaskWhat it needsSensible defaultWhere the checkpoint goes
Explain unfamiliar codeBreadth, long contextFast general modelYou verify against the code itself
Draft tests from a specInstruction adherenceFast general modelTests derive from the spec, not the diff
Design a change in a complex domainReasoning depthStrongest availablePlan reviewed before implementation
Mechanical refactor across many filesConsistency, toolingCoding agent with test accessFull suite green before review
Anything touching secrets or customer dataData boundary controlWhatever your policy permitsHuman before it leaves the machine
Debug a reproducible failureHypothesis generationFast model, several attemptsReproduction stops reproducing

Cost and latency belong in this table too. A slower model that halves review time is usually the cheaper one.

HONESTY

Measure what you would defend to a sceptic

MetricWhy it is honestHow to read it
Review time per changeSpeed that moves work into review is not speedShould fall, or at least hold, as throughput rises
Rework rateCounts change that had to be revisitedA rising rate cancels the throughput gain
Change-failure rateCounts what reached users and failedThe number that decides whether this is working
Defect escape rateFound after release rather than in reviewTells you whether review is real or ceremonial
Time to first reproductionDebugging leverage, isolatedWhere assistance reliably helps most

Deliberately absent: lines generated, suggestions accepted, percentage of code written by AI. None of them survive contact with a sceptical stakeholder.

YOUR METHOD

The playbook you leave with

You will refine this in the capstone. Start here.

  • A context pack lives in the repository and is updated, not re-invented per developer.
  • Invariants are written down where both humans and models will read them.
  • A plan is requested and reviewed before any non-trivial implementation.
  • Changes stay small enough to review honestly in one sitting.
  • Tests derive from the requirement, never from the diff.
  • A fix ships with a reproduction that no longer reproduces.
  • A decision log records what you accepted, what you rejected, and why.
  • Data boundaries are decided before the convenient paste, not after.

YOUR TURN

The exercise

Take the supplied repository and the seeded bug. Build a context pack, request a plan, reject it once with a specific reason, then ship a fix with a regression test and a decision log.

  • 10 minutes on the context pack
  • 15 minutes on plan and implementation
  • 10 minutes writing the decision log

Use the arrow keys to move through the deck. Press N for instructor notes, A to read every slide on one page.

THIS IS ONE SESSION OF 6

The full course goes
considerably deeper.

6 modules, three applied assignments, a capstone and a final exam. Starts 2 November 2026.