Skip to content
05 · Field Guide

Context engineering

If prompting is writing one good brief, context engineering is setting up the entire studio so the collaborator can work well.

Prompting is one moment; context is the environment

A prompt tells the AI what you want now. Context engineering is the deliberate work of giving the AI the right information, instructions, examples, tools, and feedback throughout the project.

Good context answers questions such as:

  • What are we building, and why?
  • Who is it for?
  • What evidence do we have?
  • What already exists?
  • Which design and content rules are fixed?
  • Which technical choices have already been made?
  • What may the agent change?
  • How will we know the result works?

The context stack

Think of context as seven layers. The lower layers change slowly; the upper layers change for each task.

  1. 01
    Product truth
    Purpose, audience, problem, evidence, domain language.
  2. 02
    Experience model
    Journeys, information architecture, key flows, states, and principles.
  3. 03
    Design and content system
    Tokens, components, typography, voice, patterns, and accessibility rules.
  4. 04
    Technical environment
    Framework, folder structure, data model, dependencies, commands, and constraints.
  5. 05
    Working rules
    What the agent may edit, conventions to follow, checks to run, and how to report changes.
  6. 06
    Current task
    The exact feature, bug, or outcome being worked on now.
  7. 07
    Evidence from the latest attempt
    Screenshots, errors, test results, feedback, or changed requirements.

Project context versus task prompt

Project context is long-lived. It should not need to be rewritten for every change.

Example:

project context · markdown
# Product
Creative Recharge helps desk-based workers choose a short, realistic break.

# Audience
Busy people with 5–15 minutes and no specialist equipment.

# Experience principles
- Calm, quick, and non-judgemental.
- One question at a time.
- Never imply medical or therapeutic benefit.

# Design system
- 4px spacing base.
- High-contrast neutral palette with one green accent.
- Use semantic HTML and visible focus states.

# Technical foundation
- React and TypeScript.
- Motion.dev for restrained transitions.
- No backend; suggestions are stored in local data.

A task prompt is temporary and specific:

task prompt · markdown
Build the result card shown after the three questions.
Use the existing Button and Surface components.
Include title, duration, short instruction, Start again action, and a copy-link action.
Do not change global styles or the question flow.
Verify keyboard focus and the 320px mobile layout.

Keeping these separate prevents the AI from reinterpreting the whole product every time you request a small change.

Persistent project instructions

Coding tools can read durable project instruction files such as AGENTS.md, CLAUDE.md, or tool-specific project rules. Names and exact behaviour differ by tool, but the purpose is similar: keep important guidance close to the work.

Useful persistent instructions include:

  • the product in one paragraph;
  • user and experience principles;
  • the approved stack;
  • file and component conventions;
  • design tokens and component sources;
  • content and accessibility rules;
  • commands to run after changes;
  • files or areas that must not be modified;
  • how the agent should summarise work and flag uncertainty.

Context for an existing product

Before changing an existing codebase, ask the agent to inspect rather than immediately implement:

prompt
Before editing anything, inspect the repository and tell me:
1. the framework and project structure;
2. where design tokens and shared components live;
3. how similar features are implemented;
4. the relevant tests and run commands;
5. any risks or ambiguities you see.
Then propose a small implementation plan. Wait for approval before editing.

This reduces accidental duplication and helps the new work fit the system already in place.

Context from Figma, screenshots, and references

A picture communicates visual direction quickly, but it leaves important questions unanswered. Whenever you provide a design reference, add:

  • what must match closely;
  • what is only inspiration;
  • expected behaviour and states;
  • responsive rules;
  • exact content versus placeholder content;
  • available assets and licences;
  • component and token mappings;
  • accessibility requirements.

Context hygiene

Context becomes harmful when it is stale, contradictory, sensitive, or enormous.

Use these habits:

  • provide the smallest complete set of relevant sources;
  • label facts, assumptions, decisions, and open questions separately;
  • give dates or versions to time-sensitive material;
  • remove resolved alternatives from active instructions;
  • never paste secrets, private participant data, or production credentials;
  • summarise long research into traceable findings, then link to source evidence;
  • start a fresh task conversation when an old one has accumulated irrelevant directions;
  • ask the agent to state which files and rules it used.

A reusable context template

context template · markdown
# Role
Act as a senior [discipline] collaborating with our team.

# Objective
What outcome are we trying to create, and why now?

# Product context
What is the product, its value, and its current state?

# Users and evidence
Who is affected? What do we know, from which source? What is still an assumption?

# Scope
What is included? What is explicitly out of scope?

# Journey and information architecture
Where does this work sit? What happens before and after?

# Requirements and states
What must it do? Include default, loading, empty, success, error, and permission states where relevant.

# Discipline layer
Interaction model, visual direction, tone of voice, or research evidence.

# Design-system context
Approved tokens, components, patterns, and references.

# Technical context
Stack, existing architecture, data, dependencies, and constraints.

# Accessibility and responsive behaviour
Keyboard, screen reader, contrast, reduced motion, zoom, and target viewport expectations.

# Constraints and risks
What must not change? What legal, privacy, security, time, or policy limits apply?

# Acceptance criteria
Observable conditions that define done.

# Validation
What should be run, inspected, or tested?

# Execution
First inspect and plan. Build one small slice. Summarise changes, evidence, and remaining uncertainty.
Study check
  • Separate the project context and current task for one piece of work.
  • Identify one stale or contradictory instruction that could confuse an agent.
  • Write three observable acceptance criteria instead of saying “make it better.”