Every rule in this framework was born from a real failure. That standard applies to contributions too.
Rules require a named incident. Before a rule is merged, it must include:
- What happened (what the agent did wrong)
- When it happened (month-year precision is fine)
- What it cost (time, broken systems, wasted work)
- What the rule prevents
Rules without incident reports are advice, not enforcement. Advice is easier to ignore.
Good PR: "Added Gate 5 — dormant code check. In 2026-04, an agent proposed 8 phases of governance work on a file with zero callers. This gate requires a caller-grep before any remediation plan is proposed."
Not a good PR: "Added a rule about always writing tests, seems like good practice."
This framework is Claude Code-specific in its hook implementations. Rule prose is portable to other agent platforms, but hooks use Claude Code's PreToolUse/PostToolUse lifecycle. If you're adapting hooks for another platform, note it in the PR.
- Fork the repo
- Add your rule to
examples/claude-code-rules/or your hook toexamples/hooks/ - Reference it from
AGENT_FRAMEWORK.mdif it's a new behavioral section - Add an entry to
INCIDENTS.mdfor the incident that produced the rule - Open a PR with a description that includes the incident summary
CI on every PR: .github/workflows/doc-link-check.yml (lychee link-check), .github/workflows/rules-lint.yml (hook fail-mode + blast-radius annotation lint, Done Criteria schema validation via scripts/validate-done-criteria.py, empty-rule-body gate). Final review of behavioral content is still manual.