Version: 1.5.4
Governs how the agent loads and prioritizes context within the workspace. Defines loading order, project isolation, beads lifecycle, and the Two-Tier Progressive Disclosure mechanism for rules.
- Type: Global (all projects)
- Priority: π‘ Important
- Trigger: Loading context, starting session, detecting project
MUST load context in this sequence (highest priority first):
- Project Contract β
Projects/<project>/project.md - Project Rules β
Projects/<project>/.agents/rules/ - Workspace Rules β
.agents/rules/ - Artifacts β
Projects/<project>/artifacts/ - Active Memory β
Projects/<project>/.beads/ - Abstract Knowledge β
Areas/ - Reference β
Resources/
- MUST search active project folder first.
- MUST NOT read from
Archive/unless user requests historical data. - MUST NOT scan other projects unless working on integration.
- SHOULD prefer
.beads/over general docs for recurring issues.
Beads capture project-specific decisions, failures, and quirks in Projects/<project>/.beads/. Allowed to be messy and partial during active development. MUST perform "Graduation Review" before archiving β move valuable knowledge to Areas/, Resources/, or .agents/rules/.
Tier 1 (ALWAYS): Read .agents/rules.md (~20 lines, ~200 tokens). Memorize trigger table, load rule files on demand.
Tier 2 (CONDITIONAL): Check Projects/<project>/.agents/rules.md. If exists, read index and load rules when triggers match. If missing, skip.
Standard index format:
| Rule | Trigger | File | Pri |
| :-------- | :--------------------- | :---------- | :-- |
| Rule Name | When to load this rule | filename.md | π΄ |File Guards format (optional, extends agent-behavior.md Β§4):
## File Guards
| File pattern | MUST re-read | Reason |
| :------------- | :----------- | :-------------------- |
| `path/to/file` | rule-name.md | Why this guard exists |- Rule Layers Architecture
- Context Recovery
- Agent Behavior β Context Recovery protocol
- Source:
templates/common/agents/rules/context-rules.md