agentleFS
pantheon-orgpantheon-org/tekhne/skills/agentic-harness/rules-management/SKILL.md

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'.

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

    Only invoke this skill when the user explicitly requests a new rule -- do not infer rule creation from unrelated conversation.

    line 13
  2. Distinctive:

    All agent rules reside in a single file (path shown in Quick Start above).

    line 34
  3. Distinctive:

    Create a new rule whenever the user says something like:

    line 38
  4. Very specific:

    Read the existing rules file first (see Quick Start) -- check every ### Rule: heading to avoid duplicates

    line 50
  5. Distinctive:

    If a rule with the same directive already exists, inform the user and do NOT create a duplicate

    line 51
  6. Distinctive:

    Every rule entry MUST include:

    line 58
  7. Very specific:

    After appending, run scripts/validate-rules.sh validate to verify the entry appears correctly and the file still has valid structure -- …

    line 68
  8. Distinctive:

    NEVER: add a rule without reading the existing rules file first.

    line 79
  9. Distinctive:

    NEVER: create a rule for memory or ephemeral notes.

    line 120
  10. Distinctive:

    Prefer ALWAYS/NEVER phrasing for directives (e.g., "NEVER recommend a dependency without checking the registry")

    line 129
  11. Distinctive:

    Always include a rationale so future readers understand why the rule exists

    line 130
  12. Distinctive:

    Read existing rules before adding -- no duplicates

    line 131
  13. Distinctive:

    If the user asks for a rule that overlaps with an existing one, suggest amending rather than duplicating

    line 133
  14. Distinctive:

    PREFER merging related rules into a single entry TYPICALLY over scattering them across multiple entries

    line 134

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

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 Rules heading 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:

  1. Read the existing rules file first (see Quick Start) -- check every ### Rule: heading to avoid duplicates
  2. If a rule with the same directive already exists, inform the user and do NOT create a duplicate
  3. Append the new rule following the format below -- PREFER scripts/validate-rules.sh generate over hand-typing the three-line block
  4. Inform the user you've added it
  5. Confirm by running scripts/validate-rules.sh validate before 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 logging

GOOD:

### 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 conventions
  • rule-entry.schema.json -- the JSON Schema enforcing the structured shape of a rule entry
  • rule-entry.yaml -- the template consumed by scripts/validate-rules.sh generate

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.

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.