rules-management
Skill10 starsChanged 39 days agoMITView on GitHub
Manage project-level agent behavioural rules recorded in a single rules file. Use when the user says 'new rule', 'add a rule', 'record that', 'make a rule that', 'note this', 'take note of', 'new instruction', or asks to codify an agent directive. Read the rules file to check existing rules before adding a new one. DO NOT use for ephemeral notes, one-off instructions, or instructions that belong in the project's own agent-facing docs. Triggers: 'new rule', 'add a rule', 'record that', 'make a rule', 'codify this', 'rule about', 'create a directive', 'note this', 'take note of', 'new instruction'.
In this repository81 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/development/biome-complete/AGENTS.mdAGENTS.md
- skills/development/bun-development/AGENTS.mdAGENTS.md
- skills/development/commanderjs/AGENTS.mdAGENTS.md
- skills/documentation/markdown-authoring/AGENTS.mdAGENTS.md
- skills/package-mgmt/mise-complete/AGENTS.mdAGENTS.md
- skills/testing/bdd-testing/AGENTS.mdAGENTS.md
- agents-mdSkill
- cache-auditSkill
- context-radar-auditSkill
- create-contextSkill
- guided-interviewSkill
- handover-document-creatorSkill
- load-contextSkill
- pick-modelSkill
- pinSkill
- professional-honestySkill
- save-contextSkill
- session-reflectionSkill
- socratic-methodSkill
- vault-captureSkill
- vault-consolidateSkill
- vault-fetchSkill
- vault-searchSkill
- bird-fortune-political-satireSkill
- brooker-esque-media-satireSkill
- clarke-dawe-esqueSkill
- comedy-style-skill-generatorSkill
- cunk-esque-mockumentarySkill
- gervais-esque-cringe-satireSkill
- monty-python-esqueSkill
- pryor-esque-confessional-standupSkill
- rock-esque-observational-standupSkill
- biome-completeSkill
- bun-developmentSkill
- commanderjsSkill
- conventional-commitsSkill
- humanizerSkill
- journal-entry-importSkill
- markdown-authoringSkill
- mermaid-diagramsSkill
- plain-englishSkill
- professional-communicationSkill
- sop-structureSkill
- logql-generatorSkill
- mise-completeSkill
- context-indexSkill
- create-context-fileSkill
- follow-upSkill
- goal-trackerSkill
- nasa-pm-lessonsSkill
- plan-createSkill
- plan-executeSkill
- plan-reviewSkill
- risk-registerSkill
- tech-debtSkill
- tech-evaluationSkill
- blast-radiusSkill
- bridgeSkill
- challengeSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 12 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
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 13
Only invoke this skill when the user explicitly requests a new rule -- do not infer rule creation from unrelated conversation.
- Distinctive: line 34
All agent rules reside in a single file (path shown in Quick Start above).
- Distinctive: line 38
Create a new rule whenever the user says something like:
- Very specific: line 50
Read the existing rules file first (see Quick Start) -- check every ### Rule: heading to avoid duplicates
- Distinctive: line 51
If a rule with the same directive already exists, inform the user and do NOT create a duplicate
- Distinctive: line 58
Every rule entry MUST include:
- Very specific: line 68
After appending, run scripts/validate-rules.sh validate to verify the entry appears correctly and the file still has valid structure -- …
- Distinctive: line 79
NEVER: add a rule without reading the existing rules file first.
- Distinctive: line 120
NEVER: create a rule for memory or ephemeral notes.
- Distinctive: line 129
Prefer ALWAYS/NEVER phrasing for directives (e.g., "NEVER recommend a dependency without checking the registry")
- Distinctive: line 130
Always include a rationale so future readers understand why the rule exists
- Distinctive: line 131
Read existing rules before adding -- no duplicates
- Distinctive: line 133
If the user asks for a rule that overlaps with an existing one, suggest amending rather than duplicating
- Distinctive: line 134
PREFER merging related rules into a single entry TYPICALLY over scattering them across multiple entries
≈ “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
Rules Management
Manage project-level agent behavioural rules.
Prerequisites
- The rules file (path shown in Quick Start below) must exist in the repository root. If it is missing, create it with a
# Agent Rulesheading first. - Only invoke this skill when the user explicitly requests a new rule -- do not infer rule creation from unrelated conversation.
- Depends on the user providing a clear behavioural directive; if the instruction is vague, ask for clarification before writing.
- The rule schema (
assets/schemas/rule-entry.schema.json) and template (assets/templates/rule-entry.yaml) define the structured title/directive/rationale shape a rule entry MUST have.
Quick Start
# Read current rules
cat .claude/RULES.md
# Validate the rules file against the schema before or after editing it
./scripts/validate-rules.sh validate .claude/RULES.md
# Generate a correctly-formatted entry from the template instead of hand-writing one
./scripts/validate-rules.sh generate "<title>" "<directive>" "<rationale>"→ Produces the full current ruleset for duplicate checking, and a schema-validated way to both read and write entries.
Where Rules Live
All agent rules reside in a single file (path shown in Quick Start above). This is the authoritative source that all agents read before acting in this repository.
When to Use
Create a new rule whenever the user says something like:
- "New rule: ..."
- "Add a rule that ..."
- "Record that ..."
- "Make a rule about ..."
- "Codify this as a rule"
- "Note this" / "Take note of ..."
- "New instruction: ..."
The user's instruction becomes the rule body. You MUST:
- Read the existing rules file first (see Quick Start) -- check every
### Rule:heading to avoid duplicates - If a rule with the same directive already exists, inform the user and do NOT create a duplicate
- Append the new rule following the format below -- PREFER
scripts/validate-rules.sh generateover hand-typing the three-line block - Inform the user you've added it
- Confirm by running
scripts/validate-rules.sh validatebefore treating the change as done -- TYPICALLY this is the same command as the Quick Start validation step
Rule Format
Every rule entry MUST include:
### Rule: <short imperative title>
**Directive:** <clear actionable instruction -- prefer ALWAYS/NEVER phrasing>
**Rationale:** <why this rule exists -- one or two sentences>After appending, run scripts/validate-rules.sh validate to verify the entry appears correctly and the file still has valid structure -- RECOMMENDED over eyeballing a raw cat of the file, since the script checks against the schema instead of just human judgment.
When NOT to Use
- Ephemeral notes or one-off instructions -- use a context file or tell the user directly
- Instructions that belong in AGENTS.md (repo map, workflow, tool conventions)
- Personal preferences that don't affect agent behaviour
- "Remember this" or "save this for later" -- route to vault-capture instead
Anti-Patterns
NEVER add a rule without reading the existing rules file first. WHY: Blind appending creates duplicate or conflicting directives, violating the single-source-of-truth contract and confusing future agents. SYMPTOM: Two rules with near-identical directives, or a new rule that quietly contradicts one added months earlier. BAD:
readFile(rulesFile, append=true)GOOD:
rules = readFile(rulesFile)
if hasDuplicate(rules, userDirective):
informUser("This rule already exists")
else:
append(rules, newEntry)CONSEQUENCE: The rules file grows contradictory or redundant entries, and future agents cannot tell which directive is authoritative.
NEVER accept a vague user instruction as the rule body. WHY: A rule like "use good logging" is not actionable. Every rule must have a precise ALWAYS/NEVER directive and a rationale. BAD:
- Don't use bad loggingGOOD:
### Rule: Always use structured logging
**Directive:** ALWAYS use structured logging (JSON) for production services.
**Rationale:** Structured logs enable aggregation, search, and alerting.CONSEQUENCE: An unactionable rule cannot be checked or enforced, so it is silently ignored the first time it is inconvenient.
NEVER create a rule for memory or ephemeral notes.
WHY: Rules are behavioural directives binding all agents. Ephemeral notes belong in a context file or vault, not in the rules file.
BAD: Appending "remember we tried Postgres once and it was slow" as a rule entry.
GOOD: Route it to vault-capture or a dated context finding instead, and only add a rule if it implies a binding, checkable directive.
CONSEQUENCE: The rules file grows unbounded with noise, reducing signal-to-noise ratio and causing agents to skip reading it.
Mindset
- Rules are binding for all agents in this repository -- be precise and unambiguous
- Prefer ALWAYS/NEVER phrasing for directives (e.g., "NEVER recommend a dependency without checking the registry")
- Always include a rationale so future readers understand why the rule exists
- Read existing rules before adding -- no duplicates
- Rules should be few and high-signal -- avoid documenting the obvious
- If the user asks for a rule that overlaps with an existing one, suggest amending rather than duplicating
- PREFER merging related rules into a single entry TYPICALLY over scattering them across multiple entries
References
rule-format.md-- the three-part Rule/Directive/Rationale structure, plus title, directive, and rationale conventionsrule-entry.schema.json-- the JSON Schema enforcing the structured shape of a rule entryrule-entry.yaml-- the template consumed byscripts/validate-rules.sh generate
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.

