rules-management

Manage project-level agent behavioural rules in a single schema-validated rules file.

Updated Apr 9, 2014
One-click install
npx skills add https://github.com/thoroc/thoroc.github.io --skill rules-management-thoroc
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rules-management
Source: https://github.com/thoroc/thoroc.github.io/tree/main/.agents/skills/rules-management
Command: npx skills add https://github.com/thoroc/thoroc.github.io --skill rules-management-thoroc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq, yq, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve? Teams working with AI agents need a single, authoritative place to record binding behavioural directives, but ad-hoc rule writing leads to duplicates, vague unenforceable instructions, and rules files polluted with ephemeral notes. ## Core Features & Use Cases - Duplicate-checked rule creation: Reads the existing rules file and checks every ### Rule: heading before appending, surfacing overlaps and suggesting amendments instead of duplicates. - Schema-validated entries: Enforces a three-part structure (Rule title, Directive, Rationale) via a JSON Schema, with a validate-rules.sh script that can validate the file or generate correctly formatted entries. - Scope discipline: Rejects vague directives and ephemeral notes, routing memory-style requests to vault-capture instead of the rules file. - Use Case: A user says "New rule: never merge a PR touching the delivery Lambda without running the retry-sweep acceptance test." The skill reads the existing rules, generates a schema-valid entry with an ALWAYS/NEVER directive and rationale, validates the file, and confirms the addition. ## Quick Start Ask the agent to add a new rule, for example: "New rule: always run the typecheck before committing changes to the i18n dictionary."

Frequently Asked Questions about rules-management

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new agent rule to a project rules file?▼

State the rule explicitly, for example "New rule: always validate input before processing." The skill reads the existing rules file to check for duplicates, generates a three-part entry (title, directive, rationale) using the validation script, and validates the file before confirming.

What format should an agent behavioural rule follow?▼

Each rule needs a `### Rule:` heading with a short imperative title, a Directive line using ALWAYS/NEVER phrasing, and a Rationale explaining why it exists. The JSON Schema in assets/schemas enforces all three required fields.

How do I validate a rules file against a JSON schema?▼

Run `./scripts/validate-rules.sh validate .agents/RULES.md` to perform structural and schema checks on every rule entry. The script reports missing directives, empty rationales, and schema violations, exiting non-zero on failure.

When should I not create a rule for an instruction?▼

Do not create rules for ephemeral notes, one-off instructions, personal preferences, or content that belongs in the project's own agent-facing docs like repo maps and workflow conventions. Memory-style "remember this" requests should be routed to vault-capture instead.

What happens if a new rule duplicates an existing one?▼

The skill reads every existing `### Rule:` heading before appending and surfaces any overlap explicitly. It suggests amending the existing rule rather than duplicating, and only creates a separate entry after user confirmation.