Project & Agent Rules Plugin (SuperPi.Extension behaviour).
Implements rule loading and injection semantics:
- Walks up from workspace directories to the repository root discovering
AGENTS.md,GEMINI.md, and.agents/rules/*.md, plus global config rules (<global config>/AGENTS.md). - Deduplicates all rules by canonical resolved path so a rule file is never injected twice.
- Enforces the Per-File Limit (
24,000bytes), truncating cleanly on line boundaries when a rule file exceeds24,000bytes. - Enforces the Aggregate Rules Budget (
20,000tokens /~80,000bytes): rules within budget are inlined as<RULE[path]>blocks inside api.systemsection (id: "user_rules"); over-budget rules are demoted to file-path pointers so the agent can read them on demand.
Summary
Functions
Formats discovered rule files under token_budget (20,000 tokens), demoting over-budget files
to path pointers.
Truncates raw rule text to @per_file_byte_limit (24,000 bytes) on a line boundary.
Functions
Formats discovered rule files under token_budget (20,000 tokens), demoting over-budget files
to path pointers.
Truncates raw rule text to @per_file_byte_limit (24,000 bytes) on a line boundary.