Agent practice

Context rules for focused AI sessions

Smaller rooms. Better doors. Written handoffs.

The principle

AI agents do better work when they are given a bounded job, a named source of truth, and a clear finish line.

The expensive failure mode is not that the agent lacks context. It is that the agent carries every context at once: product vision, design language, evidence law, dirty git state, unfinished tasks, and an old conversation thread that has already gone stale.

Your goal is to make each session feel like a focused work room. The agent should know which documents matter, which rules are hard, what it is allowed to touch, and when to stop.

Do not feed the whole library when the job needs one shelf. Point the agent at the shelf, name the rule that wins, and ask for a compact handoff when the room closes.

Priority rules

The habits that save the most context first.

01
Rule

Use one task per session.

Impact
Very high
Effort
Low
Remedy
Split broad goals into bounded rooms with one outcome, one route, one story arc, or one decision.
02
Rule

Define done up front.

Impact
Very high
Effort
Low
Remedy
Give the agent a finish line: files changed, route working, tests run, commit made, handoff written.
03
Rule

Set a token or time budget.

Impact
Very high
Effort
Low
Remedy
Make the agent stop, summarize, or ask before a useful run turns into a long inhale of context.
04
Rule

Name the canonical context docs.

Impact
Very high
Effort
Low
Remedy
Tell the agent which PRD, design system, decision doc, or skill wins for the task at hand.
05
Rule

Route context by task type.

Impact
Very high
Effort
Medium
Remedy
Load product docs for product behavior, design docs for UI, ledger rules for evidence, and voice docs for output.
06
Rule

Ask for a handoff before stopping.

Impact
High
Effort
Low
Remedy
Every long session should leave the next session a compact resume point instead of relying on chat memory.
07
Rule

Search before reading.

Impact
High
Effort
Low
Remedy
Use targeted search to find the right files, then read slices. Do not start by opening the whole corpus.
08
Rule

Keep long instructions modular.

Impact
High
Effort
Medium
Remedy
AGENTS.md should route and protect. Skills and docs should carry specialized product, design, and evidence detail.
09
Rule

Report conflicts before editing.

Impact
High
Effort
Low
Remedy
When the PRD, design system, and constitution disagree, make the agent name the conflict before it chooses.
10
Rule

Clean the workspace noise.

Impact
Medium
Effort
Low
Remedy
Backups, generated files, media, and unrelated dirty changes make every status check louder than it needs to be.
11
Rule

Avoid side quests.

Impact
Medium
Effort
Low
Remedy
Do not stack “while you are in there” work onto a session that already has a clear goal.
12
Rule

Use lower effort for rote work.

Impact
Medium
Effort
Low
Remedy
Save high reasoning for product judgment, architecture, and hard tradeoffs. Mechanical audits do not always need it.
Context routing

Reviewing the PRD or design system is useful only when the task calls for it.

Front-loading context is a thing. It is just easy to overdo. The better habit is selective loading: tell the agent which context to use, which context not to load, and what to do if the documents disagree.

Use PRDs for product behavior. Use the design system for UI. Use AGENTS.md for non-negotiable operating rules. Use voice docs for career outputs. Use the long rationale only when the product direction itself is being debated.

Source map

Tell the agent which document wins.

01

Product behavior

Use docs/product/leadjr-prd.md when the task is about page purpose, IA, naming, objects, or feature fit.

02

North-star strategy

Use docs/product/prd-vision.md when the task is architectural, strategic, or needs the larger promise.

03

Visual system

Use design.md and web/lib/design-tokens.ts when the task touches UI, layout, components, or page polish.

04

Design infrastructure

Use docs/decisions/2026-05-design-system-source.md when changing tokens, design-system pages, or component inventory.

05

Evidence discipline

Use AGENTS.md and the evidence-ledger skill when attribution, sources, claims, registry, or narrative defensibility matters.

06

Voice and outputs

Use content/voice docs when writing resumes, case studies, interview answers, or public-facing career copy.

Prompt templates

Start with the room, the rules, and the exit.

01

Bounded Implementation

Task:
[one concrete outcome]

Context:
Use [specific doc or skill]. Do not load the full site brain unless blocked.

Scope:
Only inspect/change [files, routes, tables, feature area].

Definition of done:
[tests, browser check, commit, handoff]

Budget:
Spend up to [X] tokens or [Y] minutes. If not done, stop and write a handoff.

Output:
Brief final summary: changed files, verification, next step.
02

Context Routing

Context routing:
- For product behavior, use docs/product/leadjr-prd.md.
- For north-star or architecture tension, use docs/product/prd-vision.md.
- For UI and visual rules, use design.md and web/lib/design-tokens.ts.
- For evidence integrity, AGENTS.md wins.
- If these conflict, stop and summarize the conflict before editing.
- Do not read docs/product/origin-rationale.md unless the task changes product direction.
03

Long Session Handoff

Before stopping, write a compact handoff:
- Goal and current status.
- Branch and latest commit.
- Files changed and why.
- Commands run and results.
- Open risks or blockers.
- Exact next action.

Keep it short enough that the next session can resume from the handoff instead of re-reading the whole thread.
04

Review Before Build

Review the relevant context first, then act.

Use:
- AGENTS.md for hard operating rules.
- [specific PRD] for product intent.
- [specific design doc] for UI rules.
- Search before opening corpus files.

Return:
1. What matters for this task.
2. Any conflict or ambiguity.
3. The smallest implementation plan.
4. Then make the change unless blocked.
New chat

Start the next chat with the map, not the memory.

A new chat should not inherit the whole old chat. It should inherit the current ticket, the current handoff, and the rules that decide what context to load.

For any ticket or feature with server behavior, production data, multiple routes, or Linear context, start by asking Codex to draft the working prompt. That prompt becomes the room the next session works inside.

Use the ticket-start skill when the first question is not "change this file" but "what do we need to know before this is safe to change?"

01

Start with the ticket-start skill.

For ticket or feature work, ask for a bounded prompt before implementation. The skill finds the relevant docs, files, data paths, routes, risks, and verification commands.

02

Bring the handoff, not the history.

Paste or point to the latest handoff, branch, commit, ticket, and current blocker. Avoid replaying the full prior conversation.

03

Name the server/data expectation.

Say whether local-only is enough, or whether the agent must prove Turso, production env vars, deployed routes, and dependent pages.

04

Make the stop condition explicit.

Give the agent a token or time budget and require a handoff if the ticket is not complete inside that budget.

01

Start A Ticket Chat

Use $ticket-start-context.

Ticket:
[ticket key, Linear link, or pasted ticket]

Goal:
Draft the working prompt before implementation.

Required:
- Read the ticket first if tools are available.
- Search the repo for the ticket key, feature terms, routes, tables, scripts, env vars, and dependent surfaces.
- Identify canonical context docs and which source wins if they conflict.
- Identify what must not be touched.
- Identify server/data expectations, including whether local SQLite is enough or Turso/main-site behavior must be proven.
- Identify verification commands and browser checks.
- Draft a bounded execution prompt with budget and definition of done.

Do not edit code yet.

Output:
A compact ticket-start packet and a ready-to-run implementation prompt.
Working rhythm

The best sessions feel less like chats and more like small engineering tickets.

A strong agent session has an intake, a scope, an operating contract, a verification step, and a handoff. It can still be exploratory. It can still be creative. The structure is not there to make the work rigid. It is there so the agent does not pay the full context cost for every small decision.

“Give the agent a room, not a continent.”