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'.
64
76%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./skills/agentic-harness/rules-management/SKILL.mdManage project-level agent behavioural rules.
# Agent Rules heading first.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.# 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.
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.
Create a new rule whenever the user says something like:
The user's instruction becomes the rule body. You MUST:
### Rule: heading to avoid duplicatesscripts/validate-rules.sh generate over hand-typing the three-line blockscripts/validate-rules.sh validate before treating the change as done -- TYPICALLY this is the same command as the Quick Start validation stepEvery 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.
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.
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 by scripts/validate-rules.sh generatea1083f4
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.