|
| 1 | +# Project Context |
| 2 | + |
| 3 | +<!-- ctx:copilot --> |
| 4 | +<!-- DO NOT REMOVE: This marker indicates ctx-managed content --> |
| 5 | + |
| 6 | +## Context System |
| 7 | + |
| 8 | +This project uses Context (`ctx`) for persistent AI context |
| 9 | +management. Your memory is NOT ephemeral — it lives in `.context/` files. |
| 10 | + |
| 11 | +## On Session Start |
| 12 | + |
| 13 | +Read these files **in order** before starting any work: |
| 14 | + |
| 15 | +1. `.context/CONSTITUTION.md` — Hard rules, NEVER violate |
| 16 | +2. `.context/TASKS.md` — Current work items |
| 17 | +3. `.context/CONVENTIONS.md` — Code patterns and standards |
| 18 | +4. `.context/ARCHITECTURE.md` — System structure |
| 19 | +5. `.context/DECISIONS.md` — Architectural decisions with rationale |
| 20 | +6. `.context/LEARNINGS.md` — Gotchas, tips, lessons learned |
| 21 | +7. `.context/GLOSSARY.md` — Domain terms and abbreviations |
| 22 | +8. `.context/AGENT_PLAYBOOK.md` — How to use this context system |
| 23 | + |
| 24 | +After reading, confirm: "I have read the required context files and I'm |
| 25 | +following project conventions." |
| 26 | + |
| 27 | +## When Asked "Do You Remember?" |
| 28 | + |
| 29 | +**Do this FIRST (silently):** |
| 30 | +- Read `.context/TASKS.md` |
| 31 | +- Read `.context/DECISIONS.md` and `.context/LEARNINGS.md` |
| 32 | +- Check `.context/sessions/` for recent session files |
| 33 | + |
| 34 | +**Then respond with a structured readback:** |
| 35 | +1. **Last session**: cite the most recent session topic and date |
| 36 | +2. **Active work**: list pending or in-progress tasks |
| 37 | +3. **Recent context**: mention 1-2 recent decisions or learnings |
| 38 | +4. **Next step**: offer to continue or ask what to focus on |
| 39 | + |
| 40 | +**Never** lead with "I don't have memory." The `.context/` files are |
| 41 | +your memory. Read them silently, then present what you found as recall. |
| 42 | + |
| 43 | +## Session Persistence |
| 44 | + |
| 45 | +After completing meaningful work, save a session summary to |
| 46 | +`.context/sessions/`. |
| 47 | + |
| 48 | +### Session File Format |
| 49 | + |
| 50 | +Create a file named `YYYY-MM-DD-topic.md`: |
| 51 | + |
| 52 | +```markdown |
| 53 | +# Session: YYYY-MM-DD — Brief Topic Description |
| 54 | + |
| 55 | +## What Was Done |
| 56 | +- Describe completed work items |
| 57 | + |
| 58 | +## Decisions |
| 59 | +- Key decisions made and their rationale |
| 60 | + |
| 61 | +## Learnings |
| 62 | +- Gotchas, tips, or insights discovered |
| 63 | + |
| 64 | +## Next Steps |
| 65 | +- Follow-up work or remaining items |
| 66 | +``` |
| 67 | + |
| 68 | +### When to Save |
| 69 | + |
| 70 | +- After completing a task or feature |
| 71 | +- After making architectural decisions |
| 72 | +- After a debugging session |
| 73 | +- Before ending the session |
| 74 | +- At natural breakpoints in long sessions |
| 75 | + |
| 76 | +## Context Updates During Work |
| 77 | + |
| 78 | +Proactively update context files as you work: |
| 79 | + |
| 80 | +| Event | Action | |
| 81 | +|-----------------------------|-------------------------------------| |
| 82 | +| Made architectural decision | Add to `.context/DECISIONS.md` | |
| 83 | +| Discovered gotcha/bug | Add to `.context/LEARNINGS.md` | |
| 84 | +| Established new pattern | Add to `.context/CONVENTIONS.md` | |
| 85 | +| Completed task | Mark [x] in `.context/TASKS.md` | |
| 86 | + |
| 87 | +## Self-Check |
| 88 | + |
| 89 | +Periodically ask yourself: |
| 90 | + |
| 91 | +> "If this session ended right now, would the next session know what happened?" |
| 92 | +
|
| 93 | +If no — save a session file or update context files before continuing. |
| 94 | + |
| 95 | +## CLI Commands |
| 96 | + |
| 97 | +If `ctx` is installed, use these commands: |
| 98 | + |
| 99 | +```bash |
| 100 | +ctx status # Context summary and health check |
| 101 | +ctx agent # AI-ready context packet |
| 102 | +ctx drift # Check for stale context |
| 103 | +ctx recall list # Recent session history |
| 104 | +``` |
| 105 | + |
| 106 | +<!-- ctx:copilot:end --> |
0 commit comments