Context Architect
Preserve decision quality as context grows. Treat context as an index to trusted state, not as an archive of the conversation.
Build the working set
Maintain five distinct blocks. Keep each one compact and update it when reality changes.
Mission
- Objective and observable definition of done
- User authorization boundary and explicit exclusions
- Invariants that must survive every handoff
Evidence map
- Record each decision-relevant fact as: claim, source pointer, observation time, and freshness risk.
- Prefer files, commands, tests, API results, and current UI state over earlier summaries.
- Separate observation from inference. Mark unverified memory or screen history as potentially stale.
Decision ledger
- Preserve decisions that constrain later work: choice, rationale, rejected alternatives, consequences, and invalidation trigger.
- Summarize the decision rather than copying dialogue. Do not turn a temporary workaround into a permanent rule.
Open loops
- Track unresolved questions, failed checks, blockers, risky assumptions, and promised follow-ups.
- Give every open loop a next probe or a condition that would close it.
Execution cursor
- State the last verified action, current artifact or system state, exact next safe action, and relevant rollback point.
- Use concrete paths, identifiers, revisions, or commands when they prevent rediscovery. Never include secrets.
Pack context by temperature
- Hot: objective, authority boundary, current state, active evidence, and next action. Keep these directly visible.
- Warm: decisions and facts likely to affect the next few steps. Compress them to one useful sentence plus a source pointer.
- Cold: completed exploration, superseded hypotheses, and background material. Retain only a labeled path or link unless it proves a disputed claim.
Promote an item when it becomes decision-relevant. Demote or remove it when it no longer changes the next action. Repetition is not importance.
Refresh at state boundaries
Refresh the working set after a user changes scope, after a material mutation, before a risky action, before handoff or compaction, and whenever a source may have drifted.
- Re-verify cheap, time-sensitive facts instead of copying them forward.
- Mark replaced decisions as superseded so an old constraint cannot silently return.
- Record failed experiments only when they rule out a credible path or change the next decision.
- Keep answer-only and review-only tasks read-only. Do not create or commit a context file unless the task authorizes project documentation or the user asks for one.
Produce a handoff packet
When another agent, session, or future run must continue the work, deliver:
Mission:
Done means:
Authority and exclusions:
Current verified state:
Evidence pointers:
Decisions and rationale:
Open loops and risks:
Exact next action:
Recheck before acting:
Write it so the next worker can act without replaying the transcript, while still knowing where to verify every consequential claim.
Run the recovery test
Before declaring the context ready, confirm a fresh worker can answer all five questions from the packet:
- What outcome is required?
- What changes are authorized or forbidden?
- What is verified now, and where is the evidence?
- What remains unresolved, and what is the next safe action?
- Which facts or decisions could become stale?
If any answer requires guessing or rereading the full conversation, tighten the working set before handoff.
1---2name: context-architect3description: Structure long-running, multi-file, or handoff-prone work into a compact evidence-linked context that survives compaction and agent transitions. Use when a task spans multiple phases, sources, decisions, or sessions; do not use for short self-contained requests.4license: MIT5---67# Context Architect89Preserve decision quality as context grows. Treat context as an index to trusted state, not as an archive of the conversation.1011## Build the working set1213Maintain five distinct blocks. Keep each one compact and update it when reality changes.14151. **Mission**16 - Objective and observable definition of done17 - User authorization boundary and explicit exclusions18 - Invariants that must survive every handoff19202. **Evidence map**21 - Record each decision-relevant fact as: claim, source pointer, observation time, and freshness risk.22 - Prefer files, commands, tests, API results, and current UI state over earlier summaries.23 - Separate observation from inference. Mark unverified memory or screen history as potentially stale.24253. **Decision ledger**26 - Preserve decisions that constrain later work: choice, rationale, rejected alternatives, consequences, and invalidation trigger.27 - Summarize the decision rather than copying dialogue. Do not turn a temporary workaround into a permanent rule.28294. **Open loops**30 - Track unresolved questions, failed checks, blockers, risky assumptions, and promised follow-ups.31 - Give every open loop a next probe or a condition that would close it.32335. **Execution cursor**34 - State the last verified action, current artifact or system state, exact next safe action, and relevant rollback point.35 - Use concrete paths, identifiers, revisions, or commands when they prevent rediscovery. Never include secrets.3637## Pack context by temperature3839- **Hot:** objective, authority boundary, current state, active evidence, and next action. Keep these directly visible.40- **Warm:** decisions and facts likely to affect the next few steps. Compress them to one useful sentence plus a source pointer.41- **Cold:** completed exploration, superseded hypotheses, and background material. Retain only a labeled path or link unless it proves a disputed claim.4243Promote an item when it becomes decision-relevant. Demote or remove it when it no longer changes the next action. Repetition is not importance.4445## Refresh at state boundaries4647Refresh the working set after a user changes scope, after a material mutation, before a risky action, before handoff or compaction, and whenever a source may have drifted.4849- Re-verify cheap, time-sensitive facts instead of copying them forward.50- Mark replaced decisions as superseded so an old constraint cannot silently return.51- Record failed experiments only when they rule out a credible path or change the next decision.52- Keep answer-only and review-only tasks read-only. Do not create or commit a context file unless the task authorizes project documentation or the user asks for one.5354## Produce a handoff packet5556When another agent, session, or future run must continue the work, deliver:5758```markdown59Mission:60Done means:61Authority and exclusions:62Current verified state:63Evidence pointers:64Decisions and rationale:65Open loops and risks:66Exact next action:67Recheck before acting:68```6970Write it so the next worker can act without replaying the transcript, while still knowing where to verify every consequential claim.7172## Run the recovery test7374Before declaring the context ready, confirm a fresh worker can answer all five questions from the packet:75761. What outcome is required?772. What changes are authorized or forbidden?783. What is verified now, and where is the evidence?794. What remains unresolved, and what is the next safe action?805. Which facts or decisions could become stale?8182If any answer requires guessing or rereading the full conversation, tighten the working set before handoff.