Skip to content
Skills Library
AI & agents · Writing

rules-management

/rules-management

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 instructio

Repository
tekhne ↗
Licence
MIT
Last repository change
21.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
22
Scripts
1
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 21.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/validate-rules.sh

What it does and when to use it

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 instructio

Triggers from the description

new ruleadd a rulerecord thatmake a rule thatnote thistake note ofnew instructions own agent-facing docs. Triggers:
Original author description

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 instructio

How it works

  1. Prerequisites
  2. Quick Start
  3. Where Rules Live
  4. When to Use
  5. Rule Format
  6. When NOT to Use
  7. Anti-Patterns
  8. Mindset
  9. References
Original SKILL.md headings · 137 lines, 865 words
SKILL.md preview
---
name: rules-management
description: "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'."
---

# 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

```bash
# 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:

```markdown
### 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:**

```markdown
readFile(rulesFile, append=true)
```

**GOOD:**

```markdown
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:**

```markdown
- Don't use bad logging
```

**GOOD:**

```markdown
### 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`](references/rule-format.md) -- the three-part Rule/Directive/Rationale structure, plus title, directive, and rationale conventions
- [`rule-entry.schema.json`](assets/schemas/rule-entry.schema.json) -- the JSON Schema enforcing the structured shape of a rule entry
- [`rule-entry.yaml`](assets/templates/rule-entry.yaml) -- the template consumed by `scripts/validate-rules.sh generate`
Files in this package (22)
  • SKILL.md 6 KB
  • .audits/2026-10-02/Analysis.md 1 KB
  • .audits/2026-10-02/Remediation.md 1 KB
  • .audits/2026-10-02/audit.json 1 KB
  • assets/schemas/rule-entry.schema.json 1 KB
  • assets/templates/rule-entry.yaml 1 KB
  • evals/instructions.json 3 KB
  • evals/summary.json 1 KB
  • evals/scenario-01/capability.txt 1 KB
  • evals/scenario-01/criteria.json 1 KB
  • evals/scenario-01/task.md 1 KB
  • evals/scenario-02/capability.txt 1 KB
  • evals/scenario-02/criteria.json 1 KB
  • evals/scenario-02/task.md 1 KB
  • evals/scenario-03/capability.txt 1 KB
  • evals/scenario-03/criteria.json 1 KB
  • evals/scenario-03/task.md 1 KB
  • evals/scenario-04/capability.txt 1 KB
  • evals/scenario-04/criteria.json 1 KB
  • evals/scenario-04/task.md 2 KB
  • references/rule-format.md 1 KB
  • scripts/validate-rules.sh 6 KB

Versions

The database has no other skills named rules-management.

Database snapshot: 13.11.2026 · package version e611ec9ec1d5 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 3 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90writing-for-agents
    Writing documents for agents. Use when creating or editing a skill, agent definition, rule, the project instruction file, or when writing a directive or brief another agent will execute.
  • 100create-rule
    Create Cursor rules for persistent AI guidance. Use when the user wants to create a rule, add coding standards, set up project conventions, configure file-specific patterns, create RULE.md files, or asks about .cursor/rules/ or AGENTS.md.
  • 90writing-for-agents
    Writing documents for agents. Use when creating or editing a skill, agent definition, rule, the project instruction file, or when writing a directive or brief another agent will execute.
  • 100rule-analyzer
    Classifies every rule under docs/instructions/rules as deterministic, heuristic or unverifiable, embeds stable RL-hash markers, spots rules already enforced by existing tools and rule conflicts, and writes a draft rule-script-map.yml through src/rule-scripts/apply.ts. Use when…
  • 100create-rule
    Create Cursor rules for persistent AI guidance. Use when user wants to create a rule, add coding standards, project conventions, file-specific patterns, or mentions ".cursor/rules", "AGENTS.md", "cursor rule", "coding standard", "convention", or "AI guidance".
  • 80cmk:agent-instructions
    Use when the user asks to "set up CLAUDE.md", "set up AGENTS.md", "agent instructions", "add engineering rules", "make the instructions thinner", or needs to establish or maintain a thin, multi-vendor root instruction file backed by on-demand engineering rules under docs/rules/.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.