arrow_back Back to Rules
rules Rule

Context Rules — Agent Routing

Governs how the agent loads and prioritizes context — loading order, project isolation, beads lifecycle, and the Two-Tier Progressive Disclosure mechanism for rules.

Context Rules — Agent Routing & Context Loading

This rule governs how the agent loads and prioritizes context within the workspace. It defines the loading order, project isolation boundaries, beads lifecycle, and the Two-Tier Progressive Disclosure mechanism for rules.


1. Context Loading Priority

MUST load context in this sequence (highest priority first):

  1. Project ContractProjects/<project>/project.md
  2. Project RulesProjects/<project>/.agent/rules/
  3. Workspace Rules.agent/rules/
  4. ArtifactsProjects/<project>/artifacts/
  5. Active MemoryProjects/<project>/.beads/
  6. Abstract KnowledgeAreas/
  7. ReferenceResources/

2. Isolation & Relevance

  • 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.

3. Beads Lifecycle

Beads capture project-specific decisions, failures, and quirks in Projects/<project>/.beads/. They are allowed to be messy and partial during active development.

MUST perform “Graduation Review” before archiving — move valuable knowledge to Areas/, Resources/, or .agent/rules/.


4. Rules Loading — Two-Tier Progressive Disclosure

Tier 1 (ALWAYS): Read .agent/rules.md (~20 lines, ~200 tokens). Memorize the trigger table, load rule files on demand.

Tier 2 (CONDITIONAL): Check Projects/<project>/.agent/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 extension of agent-behavior.md §4:

## File Guards
| File pattern   | MUST re-read | Reason                |
| :------------- | :----------- | :-------------------- |
| `path/to/file` | rule-name.md | Why this guard exists |

References


→ Back to Rules Catalog