agentleFS
tonmoy007tonmoy007/forge-plugins/skills/forge-rules/SKILL.md

forge-rules

Skill2 starsChanged 5 months agoMITView on GitHub

Set up and manage user-authored Forge rules — project constraints that steer

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
  1. Distinctive:

    Add a new rule (refuses to overwrite an existing file):

    line 40
  2. Very specific:

    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 …

    line 55
  3. Very specific:

    After writing/editing rule files, run validate and relay any WARN lines.

    line 60

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 listed stages: number.
  • glob — surfaced when writing a file matching globs: (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

  1. 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 rule).
  2. For add, pick the scope from the user's intent: a blanket convention → always; tied to a phase (e.g. only during build/eval) → stage with stages:; tied to file types (e.g. UI files) → glob with globs:.
  3. After writing/editing rule files, run validate and relay any WARN lines.
  4. Tell the user where rules take effect: always/stage rules appear in the next session-start context block; glob rules surface as advisory feedback when a matching file is written. See references/rules-format.md for 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.

Download now (ZIP)

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.