dotforge / rules
AGENTS.md8 starsChanged 7 months agoMITView on GitHub
Multi-agent orchestration rules — always loaded
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository21 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- audit-projectSkill
- benchmarkSkill
- bootstrap-projectSkill
- capture-practiceSkill
- diff-projectSkill
- domain-extractSkill
- export-configSkill
- forge-behaviorSkill
- init-projectSkill
- learn-projectSkill
- mcp-addSkill
- plugin-generatorSkill
- reset-projectSkill
- rule-effectivenessSkill
- scout-reposSkill
- session-insightsSkill
- sync-all-reposSkill
- sync-templateSkill
- update-practicesSkill
- watch-upstreamSkill
The file
We split this agents.md into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 10
Before starting any task, evaluate:
- Very specific: line 23
Use Agent(subagent_type="<name>", ...) to spawn new subagents
- Distinctive: line 28
If a subagent result is unclear or incomplete, resume it via SendMessage — don't restart
- Distinctive: line 49
After compaction, re-summarize active agent results if still relevant
- Very specific: line 50
If a subagent fails → log to CLAUDE_ERRORS.md, don't retry blindly
- Distinctive: line 51
Always verify subagent output (run tests/lint) before declaring done
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent Orchestration Protocol
Delegation Decision Tree
Before starting any task, evaluate:
- Single-file fix / quick question → handle directly, no subagent
- Research-heavy or verbose output → delegate to
researcher - Code changes + tests needed → delegate to
implementer - Security/vulnerability concern → delegate to
security-auditor - Multi-component refactor (>3 files, >2 concerns) → evaluate Agent Teams
- Code review before merge → delegate to
code-reviewersubagent (structured chain-of-review during the change) OR invoke the built-in/code-reviewslash command (v2.1.147+ ad-hoc end-of-PR pass;--commentposts inline GitHub PR comments,--fixapplies findings to working tree). The two are independent — subagent is for in-flight review with memory, slash command is for one-shot review-and-comment - Architecture decision or tradeoff analysis → delegate to
architect - Session analysis / pattern detection / /forge insights → delegate to
session-reviewer
Subagent Invocation Rules
- Use
Agent(subagent_type="<name>", ...)to spawn new subagents - To continue a subagent's work, use
SendMessage({to: agentId})— NEVER spawn a new agent for follow-up - Pass minimal, focused context — don't dump the full conversation
- Each subagent must return a structured summary, not raw output
- Chain subagents sequentially: researcher → architect → implementer → test-runner → code-reviewer
- If a subagent result is unclear or incomplete, resume it via SendMessage — don't restart
Agent Teams Escalation Criteria
Spawn an Agent Team ONLY when ALL of these hold:
- Task touches ≥3 independent components/files
- Components don't share mutable state during the task
- Estimated single-agent time >15 min
- Each teammate can own a distinct file set (no overlap)
Team structure pattern:
- Lead: coordinates, synthesizes, DOES NOT implement
- Teammates: max 3-4 (diminishing returns beyond that)
- Each teammate MUST use
isolation: "worktree"to work on an isolated copy of the repo - Lead agent coordinates merges from worktree branches into the main branch
- Require plan approval before any teammate writes code
- v2.1.149 scope fix: pre-v2.1.149 worktree teammates had sandbox-blessed write access to the entire main repo (bug). Post-fix, writes are correctly limited to the worktree itself + shared
.gitsubset. Agent Teams patterns that relied on teammates editing main-repo files directly were exploiting the bug — rework so teammates merge upstream via branches, not direct writes. Seedomain/sandboxing.md
Context & Error Handling
- Subagent raw output must not exceed 30% of main context — always structured summaries
- After compaction, re-summarize active agent results if still relevant
- If a subagent fails → log to
CLAUDE_ERRORS.md, don't retry blindly - Always verify subagent output (run tests/lint) before declaring done
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

