Skip to main content

Quick-Reference Cards

All 24patterns at a glance. Each card shows the pattern's intent, key signals, difficulty, and keywords.

Chapter 1Foundation

1.1Beginner

Convention File

Make implicit project rules explicit in a file the agent always reads, so it follows your standards without being told each time.

Signals

  • You find yourself typing the same correction in multiple agent sessions
  • Agent output passes tests but fails code review for style violations
  • New team members (and agents) make the same mistakes repeatedly
CLAUDE.mdconventionsproject rulescoding standards
1.2Beginner

Safety Net

Establish automated checks (tests, types, linting) as guardrails so agent mistakes get caught immediately, not in production.

Signals

  • You discover agent-introduced bugs during manual testing
  • The agent's changes pass initial review but break in CI
  • You're afraid to let the agent modify shared utilities
testinglintingtype checkingguardrails
1.3Advanced

Memory Layer

Use persistent context files to maintain project knowledge across sessions, eliminating repetitive re-explanation.

Signals

  • You spend the first 10+ minutes of each session re-explaining context
  • The agent re-discovers the same gotcha you encountered two sessions ago
  • Multi-session projects lose momentum because continuity is lost
memorypersistent contextsession continuityauto-memory
1.4Advanced

Agent-Friendly Architecture

Organize code with clear boundaries, named modules, and explicit interfaces so agents can navigate and modify it confidently.

Signals

  • The agent frequently imports from the wrong module or abstraction layer
  • You have to tell the agent "no, use the one in `/lib/payments`, not `/utils/stripe`"
  • Agent-generated code works but violates your intended architecture
architecturecode organizationmodule boundariesinterfaces

Chapter 2Context

2.1Intermediate

Context Priming

Front-load the most relevant files and decisions before making a request, so the agent starts from understanding rather than guessing.

Signals

  • Agent output is structurally correct but uses the wrong patterns, types, or conventions
  • You frequently say "no, look at how we do it in X"
  • The agent asks basic questions about your codebase that could be answered by reading a file
contextprimingfront-loadingfiles
2.2Intermediate

Scope Fence

Explicitly constrain the agent's working area to prevent drift into unrelated code, keeping changes focused and reviewable.

Signals

  • Code reviews reveal agent changes to files you didn't expect to be modified
  • Diffs are consistently 3-5x larger than the task warranted
  • The agent "helpfully" refactors code adjacent to what you asked for
scopeconstraintsboundariesdrift
2.3Intermediate

Progressive Disclosure

Reveal project complexity incrementally instead of dumping everything at once, avoiding context overload.

Signals

  • The agent's output touches systems you didn't ask it to modify
  • You provide 10+ files of context for a task that should need 2-3
  • The agent tries to "account for" every system it can see, even irrelevant ones
progressive disclosureincremental contextcomplexity managementcontext window
2.4Beginner

Anchor Point

Reference specific files, functions, and line numbers to ground the agent in concrete code rather than abstract descriptions.

Signals

  • The agent asks "which file should I look at?" — you should have told it
  • The agent modifies the wrong file or function and you have to redirect
  • Your requests use words like "the thing that handles X" instead of naming it
anchorspecific referencesfile pathsfunction names

Chapter 3Task

3.1Intermediate

Vertical Slice

Break features into thin end-to-end slices rather than horizontal layers, giving the agent complete context for each piece.

Signals

  • The agent builds infrastructure that can't be tested until other layers are done
  • Integration at the end reveals mismatches between layers the agent built separately
  • Long conversations where the agent loses context about what it built earlier
vertical slicetask decompositionend-to-endfeature slicing
3.2Beginner

Checkpoint Loop

Work in small cycles of do-then-verify instead of one big request, catching drift early before it compounds.

Signals

  • You frequently discover multiple interconnected errors in agent output
  • Reviewing agent changes takes longer than making them yourself would have
  • Errors in early code cascade into later code, requiring extensive rework
checkpointincrementalverifyiterate
3.3Advanced

Scaffold First

Have the agent build types, interfaces, and structure before filling in implementation, establishing constraints that guide the rest.

Signals

  • The agent creates data transformation layers to bridge inconsistent shapes
  • Function signatures change as the agent discovers what it actually needs mid-implementation
  • Type definitions are scattered across implementation files instead of centralized
scaffoldtypes firstinterfacesstructure
3.4Advanced

Parallel Fan-Out

Split independent subtasks across concurrent agent sessions to multiply throughput without multiplying errors.

Signals

  • You have 3+ independent tasks that follow the same pattern
  • You're building them one at a time and each feels repetitive
  • The tasks share types or interfaces but don't share implementation logic
parallelconcurrentfan-outmulti-session

Chapter 4Steering

4.1Intermediate

Test-First Steering

Write failing tests first so the agent has a concrete, verifiable target instead of an ambiguous description.

Signals

  • Agent output is structurally correct but uses wrong values, types, or behavior
  • You find yourself writing detailed prose descriptions of exact return shapes
  • The agent makes reasonable but wrong assumptions about edge cases
TDDtest-firstfailing testsspecification
4.2Beginner

Example-Driven Spec

Show the desired output shape rather than describing it abstractly, reducing interpretation error.

Signals

  • Agent output has the right logic but wrong data shape, naming, or format
  • You find yourself writing long descriptions of what the output should look like
  • The agent asks clarifying questions about format, structure, or naming conventions
examplesspecificationoutput shapeconcrete
4.3Intermediate

Negative Space

Define what the agent should NOT do, because constraints eliminate more bad output than instructions produce good output.

Signals

  • Agent output is technically impressive but over-engineered for the task
  • You think "I didn't ask for that" when reviewing agent changes
  • The agent installs dependencies or creates abstractions unprompted
negative spaceconstraintsdon'tsboundaries
4.4Intermediate

Constraint Over Instruction

Specify boundaries and invariants rather than step-by-step procedures, giving the agent room to find good solutions within your guardrails.

Signals

  • You write detailed step-by-step instructions and the agent follows them literally, missing edge cases
  • The agent's solution works but you can see a better approach it didn't consider
  • You care more about what the code *does* than how it's structured internally
constraintsinvariantsboundariesdeclarative

Chapter 5Verification

5.1Beginner

Incremental Verification

Verify each unit of work as it is produced, not the whole batch at the end, so errors surface while they are cheap to fix and trivially attributable.

Signals

  • Test failures arrive in clusters spanning multiple modules at once
  • You spend more time finding which change broke something than fixing it
  • The agent reports "done" and verification is a separate phase you dread
verificationincrementalearly detectionerror attribution
5.2Intermediate

Adversarial Review

Have a separate agent or a fresh context attack the work, because the agent that produced it shares the blind spots that produced the bug.

Signals

  • The agent reviews its own work and reliably declares it correct
  • Bugs that ship were "reviewed" — the review missed what the code missed
  • Reviews come back fluent and reassuring but never find anything real
adversarial reviewcritic agentmulti-agentself-review bias
5.3Intermediate

Regression Guard

Pin the existing behavior with characterization tests before the agent touches the code, so "it still works" is a check the machine runs, not a hope you hold.

Signals

  • Refactors that "passed all tests" still broke behavior in production
  • Critical paths have load-bearing behavior no test actually asserts
  • You hesitate to let the agent touch certain modules at all
regressioncharacterization testsgolden masterrefactoring
5.4Beginner

Diff Review

Read every changed line before accepting. The agent's summary is its intent; the diff is what it actually did — and they are not the same artifact.

Signals

  • You accept agent work after reading its summary, not its diff
  • Changes you never asked for surface later — in staging, or in production
  • Diffs are routinely large enough that you skim instead of read
diff reviewcode reviewagent outputgit diff

Chapter 6Recovery

6.1Beginner

Clean Slate

When the context is poisoned and the agent is looping, discard the conversation and restart from a tight written brief instead of arguing the agent out of its own history.

Signals

  • You're more than ~15 turns deep and circling the same problem
  • Corrections half-land — the agent blends your fix with its old approach
  • A wrong assumption keeps resurfacing after you've addressed it
clean slatecontext resetfresh sessionagent looping
6.2Beginner

Rollback Point

Commit known-good states before risky agent work so reverting is one command, not an archaeology dig through entangled changes.

Signals

  • "Get back to working" means hand-reverting changes from memory
  • Your only undo is `git checkout .`, which also discards the good work
  • Risky agent runs start from uncommitted, unmarked working trees
rollbackgit commitcheckpointrevert
6.3Intermediate

Reproduction First

When fixes keep missing, stop requesting fixes and require a deterministic reproduction first — an agent patching a bug it cannot reproduce is guessing.

Signals

  • Multiple deployed "fixes" and the bug is still exactly as alive
  • Fixes are justified by plausible theory, never by an observed failure
  • Each attempt targets a different root cause than the last
reproductiondebuggingdeterministicfailing test
6.4Intermediate

Postmortem Note

After a recovery, encode the root cause into the persistent layer — a convention, a memory, a test — so the same failure cannot recur instead of recurring every session.

Signals

  • The agent reproduces a failure you already recovered from once
  • Recovery knowledge lives in your head and closed threads, nowhere a session reads
  • Onboarding a new session means re-learning the same project landmines
postmortemroot causeinstitutional memoryconvention file