| name | rule-creator |
| description | Claude Code rule management at project and user level. Use when defining conventions, scoping, listing, editing, extracting, or deleting rules. Not for procedural workflows, lifecycle hooks, or one-off task instructions. |
Rule Creator
Creates rules at project or user level and manages the rule set at both.
Triggers and dispatch
| Signal in input | Mode | Load |
|---|
| "create / add / new rule", "convention", "standard", or a declarative description with no verb | create | classify-and-context.md, then rule-format.md |
| "list / show rules", "what rules exist" | list | modes.md |
| "edit / update / change rule X" | edit | modes.md, rule-format.md |
| "extract / split / move from AGENTS.md / CLAUDE.md", "AGENTS.md / CLAUDE.md is too big" | extract | modes.md |
| "delete / remove rule X" | delete | modes.md |
A rule has two independent axes:
| Axis | Values | Materializes as |
|---|
| Level | user (~/.claude/rules/) / project (.claude/rules/) | the directory written to |
| Scope | unconditional / path-scoped | absence or presence of paths: frontmatter |
Project rules take priority over user rules. user + path-scoped is unavailable, so a path signal resolves the level to project.
Workflow
trigger → dispatch → classify → context → destination → render → write
| |
v v
list/edit refuse (procedural / lifecycle / one-off)
extract/del
Create runs the classifier and context check before rendering the template. Other modes skip classification.
Create gates (run in order)
- Classify input. Procedural multi-step → refuse and recommend authoring a skill instead. Lifecycle event → refuse and recommend a hook. One-off task → refuse, suggest doing it directly. Declarative convention → proceed. See classify-and-context.md.
- Context check. Stack mismatch, duplicate topic across both levels, or contradiction with a memory file → flag and ask before writing. Same reference.
- Destination decision. Level from explicit signals; no signal → ask. Scope from path signals. Same reference.
- Render. Use the flexible rule template in rule-format.md. Keep the explanation paragraph; add principles, an
Incorrect/Correct pair, or a reference only when that section clarifies or verifies the constraint.
- Verifiability checklist. Run the three checks in rule-format.md. Fail any → rewrite before saving.
- Write. New topic → new file under the chosen level's rules directory, named for the topic: kebab-case descriptive noun, lowercase ASCII, hyphens only (
testing.md, api-design.md — never rules.md or misc.md). Discovery is recursive, so a subdirectory (frontend/testing.md) is available when a level accumulates enough topics to group them. A shared destination writes the file to the named directory and links it into this project only. Existing topic without conflict → append H2. Existing topic with conflict → ask user.