add-rule
Add rule
Adds one rule to the gate in the current repository. Run /gate:gate-init first if gate/gate.json does not exist.
A gate rule is mechanical: it reads files in the repository and returns pass or fail with no network, no model call and no judgment. A check that needs judgment belongs in a review skill, outside the gate.
Path A: install a module's check
Modules ship their checks in checks/<rule>.py, with fixtures in checks/fixtures/<rule id>/. Examples: decisions.adr-fields (decisions module) and docs.review (docs module).
-
Find the module's checks folder. In a local clone of this marketplace it is
plugins/<module>/checks/; in the plugin cache it sits next to this plugin:find "$(dirname "$(dirname "${CLAUDE_PLUGIN_ROOT}")")" -maxdepth 3 -type d -name checks -path "*/<module>/*" 2>/dev/nullIf nothing prints, ask the user for the path.
-
Copy without overwriting. The rule file goes to the rules folder named in
gate/gate.json(rules_dir, default.github/actions/gate/rules), the fixtures togate/fixtures/<rule id>/: