forge-rules
Skill2 starsChanged 5 months agoMITView on GitHub
Set up and manage user-authored Forge rules — project constraints that steer
In this repository46 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- forge-opencode/CLAUDE.mdCLAUDE.md
- forge-adoptSkill
- forge-arch-proSkill
- forge-archSkill
- forge-autopilotSkill
- forge-autopilot-stopSkill
- forge-build-proSkill
- forge-buildSkill
- forge-deploySkill
- forge-doctorSkill
- dreamer-runSkill
- forge-evalSkill
- forge-feedbackSkill
- flowSkill
- forge-force-advanceSkill
- graduateSkill
- health-checkSkill
- forge-initSkill
- forge-monitorSkill
- forge-orchestrateSkill
- forge-plan-proSkill
- forge-planSkill
- preflightSkill
- forge-product-proSkill
- forge-productSkill
- forge-releaseSkill
- forge-resolveSkill
- forge-resumeSkill
- forge-retroSkill
- forge-reviewSkill
- forge-set-profileSkill
- skill-creatorSkill
- forge-spec-proSkill
- forge-specSkill
- forge-sprint-proSkill
- forge-sprintSkill
- forge-srs-proSkill
- forge-srsSkill
- forge-statusSkill
- forge-trace-matrixSkill
- forge-uninstallSkill
- forge-validateSkill
- watchSkill
- watch-stopSkill
- forge-whySkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
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
- Distinctive: line 40
Add a new rule (refuses to overwrite an existing file):
- Very specific: line 55
If the user is setting up rules for the first time, run init, then open the created .forge/rules/00-style.md and tailor it (or add a new …
- Very specific: line 60
After writing/editing rule files, run validate and relay any WARN lines.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
forge-rules — author & manage project rules
User rules are Markdown files under .forge/rules/*.md with YAML frontmatter
(description, scope, stages?, globs?, priority?) + a body (the rule text). They
steer Forge's agents without changing code: Forge injects them into context at the right
moments. They are advisory — they never block a write (REQ-RULES-010).
Scope model (mirrors Cursor project rules)
always— injected every session (within the ≤2000-token context budget).stage— injected only when the pipeline is on a listedstages:number.glob— surfaced when writing a file matchingglobs:(advisory feedback).manual— never auto-injected; referenced explicitly by name.
When to Use
- User runs
/forge:rules [init|list|add|validate]. - User wants Forge to "always"/"never" do something, or to enforce a convention scoped to a stage or a set of files.
Subcommands
Scaffold the rules directory (idempotent — never clobbers existing files):
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/rules.py init --cwd .Add a new rule (refuses to overwrite an existing file):
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/rules.py add <name> --scope <always|stage|glob|manual> --description "..." --cwd .List the active rules / validate them:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/rules.py list --cwd .
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/rules.py validate --cwd .How to run
- If the user is setting up rules for the first time, run
init, then open the created.forge/rules/00-style.mdand tailor it (oradda new rule). - For
add, pick the scope from the user's intent: a blanket convention →always; tied to a phase (e.g. only during build/eval) →stagewithstages:; tied to file types (e.g. UI files) →globwithglobs:. - After writing/editing rule files, run
validateand relay anyWARNlines. - Tell the user where rules take effect:
always/stagerules appear in the next session-start context block;globrules surface as advisory feedback when a matching file is written. Seereferences/rules-format.mdfor the full schema.
Notes
- Rules are advisory and never block writes — they nudge, they don't gate.
- No
.forge/rules/directory ⇒ the whole feature is a silent no-op (existing Forge behavior is unchanged). - Rule injection shares the session-start token budget with lessons; keep rule bodies short and high-signal.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

