The Engineering of Intent, Chapter 23: Context Pack Recipes

This is Part 23 of a series walking through my book The Engineering of Intent. In the previous chapter, we watched a narrated session of a real day. Chapter 23 opens Part VIII of the book — the pattern catalog — starting with twelve ready-to-adapt Context Pack recipes.


Twelve Situations. Twelve Packs. Copy and Adapt.

Chapter 9 argued that context engineering is the highest-leverage activity in AI-native development. Chapter 23 makes the argument portable: twelve Context Pack recipes for the situations I actually build packs for, each with the target situation, the files to include, a size budget, and the most common failure mode.


The Twelve

  1. Greenfield — new project, first week. 3K–6K tokens. Biggest failure: over-specifying architecture before the first shippable increment tests the hypothesis.
  2. Legacy Monolith — 10K–15K tokens. Document the parts where work happens; accept that the dark corners stay dark. Agents stop-and-ask in unfamiliar territory.
  3. Migration (A to B, coexisting) — 8K–12K tokens. Explicit guardrails preventing “helpful” modernization of the old side. Agents have a bias toward modernization.
  4. Microservices — 5K–8K per service. Service-specific agents.md plus shared conventions.md. Enforce shared with automation.
  5. Library — 4K–8K tokens. public-api.md + invariants.md + correct/incorrect examples. Omit internals for API-design tasks.
  6. Security-Sensitive — 6K–10K tokens. threat-model.md + forbidden-patterns.md. “Be secure” is not actionable.
  7. Frontend — 6K–10K tokens. Design-system docs + component naming + state-management rules + 3–5 reference components.
  8. Data Engineering — 6K–10K tokens. Schemas + pipeline map + SLAs. Omitting SLAs produces correct-but-operationally-broken pipelines.
  9. Debugging — 4K–8K tokens. Symptom + repro + recent changes + relevant source + pertinent traces. Exclude everything else.
  10. Refactor — 5K–10K tokens. Current code + concrete target (ideally an example already done elsewhere) + call-site list. “Make it cleaner” is not a target.
  11. Exploration — 3K–5K tokens. Problem + constraints + two or three existing solutions from other codebases. Do not ask the agent to decide.
  12. Onboarding — 3K–5K tokens. One-page overview + day-one tasks + core-module pointers + explicit “what to stop and ask about.”
💡 Key idea: The size budgets are not suggestions. They are guardrails. Every recipe has a different context-economy profile, and the budget encodes what belongs in that situation. When the pack wants to grow past the budget, it’s telling you something — usually that the task has widened and needs to be split rather than that the pack needs to be longer.

The Pattern Underneath All Twelve

“Every recipe has a ‘what NOT to include’ section as important as the ‘what to include.’ The hardest part of Context Pack design is not what to put in. It’s what to leave out — and the recipes that perform best in practice are the ones with the most disciplined exclusions.”

⚠ The kitchen-sink reflex: When in doubt, engineers throw more in. The result is an agent that drowns instead of focuses. Debugging benefits disproportionately from tight context — the recipe limits it to 8K tokens for a reason. Be ruthless.

Next up — Chapter 24: The Failure Mode Catalog. If Chapter 23 is the positive pattern language, Chapter 24 is the negative one — the named failure modes I’ve catalogued from advising distressed AI-native projects, and how to spot each one before it ships.


📖 Want the full picture?

The chapter gives each of the twelve recipes in full: target situation, files to include, size budget, common failure mode, and a copy-and-adapt template you can load into your repo this afternoon.

Get The Engineering of Intent on Amazon →

2026-05-09

Sho Shimoda

I share and organize what I’ve learned and experienced.