with one click
rules-manager
// Create and maintain agent rules in AGENTS.md and .agents/rules/. Use for project rules, conventions, constraints, rule indexes, or requests to add or optimize agent rules.
// Create and maintain agent rules in AGENTS.md and .agents/rules/. Use for project rules, conventions, constraints, rule indexes, or requests to add or optimize agent rules.
A brief description of what this skill does
Set up per-worktree environments for Claude Code, Cursor, or Codex. Use for worktree-ready repos, IDE environment config, worktree-up/down scripts, or dev.sh wiring.
Create or edit Claude, Codex, and Cursor skills/rules. Use for SKILL.md, .cursor/rules, AGENTS.md, skill prompts, frontmatter, references, scripts, and discovery rules.
Expert guidance for creating, building, and using Claude Code agents and the Task tool. Use when working with agents, setting up agent configurations, understanding how agents work, or using the Task tool to launch specialized agents.
| name | rules-manager |
| description | Create and maintain agent rules in AGENTS.md and .agents/rules/. Use for project rules, conventions, constraints, rule indexes, or requests to add or optimize agent rules. |
| argument-hint | [init | add <rule-name> | optimize | task description] |
<core_principle> Rules consume tokens on every agent run. Keep them minimal, specific, and discoverable.
Two-tier system:
CRITICAL invariant: Every file in .agents/rules/ must be referenced in AGENTS.md so agents know it exists. AGENTS.md without a reference = orphaned rule = invisible to agents.
</core_principle>
<file_layout>
project-root/
āāā AGENTS.md # Index + universal rules (always loaded)
āāā .agents/
āāā rules/
āāā changelog.md # Rule for changelog management
āāā testing.md # Rule for tests
āāā deployment.md # Rule for deployment
AGENTS.md must contain a ## Rules section listing each .agents/rules/*.md file with a one-line description.
</file_layout>
<agents_md_template> Minimal AGENTS.md with rules index:
# Project Name
Short description (1-2 lines).
## Tech Stack
- [Non-obvious tech only]
## Commands
- `[dev]` - Dev server
- `[test]` - Run tests
## Rules
The detailed rules live in `.agents/rules/`. Read the relevant file before acting:
- **Changelog** - [.agents/rules/changelog.md](.agents/rules/changelog.md) - When/how to update CHANGELOG.md
- **Testing** - [.agents/rules/testing.md](.agents/rules/testing.md) - Test conventions and coverage
- **Deployment** - [.agents/rules/deployment.md](.agents/rules/deployment.md) - Deploy checklist
## Universal Rules
- [2-3 critical rules that apply everywhere]
The ## Rules section is the index. Each bullet = one file in .agents/rules/. The ## Universal Rules section holds short, project-wide constraints that don't deserve their own file.
</agents_md_template>
<rule_file_template>
Each .agents/rules/<name>.md should be focused, short, and actionable.
# [Rule Title]
Short purpose statement (1 line).
## When this applies
- [Specific triggers - what task/context loads this rule]
## Rules
- [Specific, actionable rule]
- [Another rule with example if format matters]
## Example
[3-5 line concrete example, only if needed]
Size target: 20-60 lines per rule file. If longer, split into multiple files. </rule_file_template>
<writing_rules> Be specific, never vague:
NO: "Update changelog properly"
YES: "Append entry to CHANGELOG.md under ## Unreleased before every PR. Format: - [type] description (#PR)"
Prohibitions beat positive guidance:
NO: "Try to write tests"
YES: "NEVER merge without a passing test for the changed behavior"
Emphasis hierarchy: CRITICAL > NEVER > ALWAYS > IMPORTANT
**CRITICAL**: Never commit secretsDo NOT include:
/rules-manager init - Bootstrap AGENTS.md + .agents/rules/When the argument contains init:
package.json or equivalent for name, stack, scripts.AGENTS.md or .agents/rules/ already exists, read them and ASK before overwriting.## Rules index, ready to populate..agents/rules/ directory - Empty for now. New rules added via add workflow.Target AGENTS.md size at init: under 40 lines.
/rules-manager add <name> - Add a new ruleWhen the argument starts with add:
changelog). Ask user if unclear.init first..agents/rules/<name>.md - Use the rule file template. Keep it 20-60 lines.## Rules section - Add a one-line bullet pointing to the new file:
- **<Title>** - [.agents/rules/<name>.md](.agents/rules/<name>.md) - <one-line purpose>
CRITICAL: Step 5 is non-negotiable. A rule file without an index entry is invisible.
/rules-manager optimize - Audit and clean upWhen the argument contains optimize:
.agents/rules/..agents/rules/, verify there's a matching bullet in AGENTS.md ## Rules. Flag missing entries.Target sizes:
When the argument is a free-form task (e.g., "add a rule about how we tag releases"):
add with auto-derived name.add workflow.
<rules_for_this_skill>
## Rules index when creating a file in .agents/rules/.agents/rules/ (not inline in AGENTS.md), unless the rule is 1-2 lines and fits the universal section.
</rules_for_this_skill><reference_guides>