Guide to writing .claude/rules/*.md files — auto-applied constraints scoped by file patterns. Use when creating or updating rules for code conventions, quality standards, or file-specific guidance.
Guides the creation of auto-applied file-specific constraints for code conventions and project standards.
npx claudepluginhub captaincrouton89/crouton-kitThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Rules are constraints Claude follows automatically when working with matching files. They live in .claude/rules/ or a plugin's rules/ directory.
---
paths:
- "src/api/**/*.ts"
- "**/*.test.ts"
---
Declarative constraints here.
**/*.ts — all TypeScript filessrc/**/* — everything under src/{src,lib}/**/*.ts — multiple directoriespaths entirely for rules that apply everywhereRules without paths load every session. Rules with paths only load when Claude works with matching files.
Be declarative — state what should/shouldn't be done, not step-by-step procedures.
Be specific — "Use 2-space indentation" not "format properly."
Skip the obvious — don't restate best practices Claude already knows. Only specify what's unique to your project.
One topic per file — testing.md, security.md, not everything.md. Organize with subdirectories for grouping.
Provide alternatives — never write "Don't do X" without saying what to do instead.
paths)