This skill should be used when creating rule files, organizing conventions, or when ".claude/rules/", "FORMATTING.md", "create rule", or "project conventions" are mentioned.
Create reusable instruction files in .claude/rules/ for project conventions.
| Aspect | CLAUDE.md | .claude/rules/ | |--------|-----------|----------------| | Loading | Automatic at session start | On-demand via reference | | Content | Project setup, key commands | Reusable conventions | | Size | Concise (~200-500 lines) | Can be detailed | | Scope | This specific project | Patterns across files |
Put in CLAUDE.md: One-off instructions, project-specific commands, key file locations.
Put in rules/: Formatting conventions, architecture patterns, workflow guidelines, commit standards.
.md extensionAPI-PATTERNS.md, CODE-REVIEW.mdGood: FORMATTING.md, TESTING.md, COMMITS.md
Bad: formatting.md, MyRules.md, everything.md
.claude/rules/
├── FORMATTING.md # Code style, output conventions
├── TESTING.md # Test patterns, coverage requirements
├── COMMITS.md # Commit message format, PR conventions
├── ARCHITECTURE.md # Component structure, file organization
└── SECURITY.md # Security guidelines, auth patterns
Rules files should be scannable and actionable:
# Topic Name
Brief description of what this covers.
## Section 1
| Pattern | Example | Notes |
|---------|---------|-------|
| ... | ... | ... |
## Section 2
**Do:**
- Specific guideline
**Don't:**
- Anti-pattern to avoid
## Examples
{ concrete examples }
Reference rules explicitly - they're not auto-loaded:
# CLAUDE.md
## Code Style
Follow `.claude/rules/FORMATTING.md` for all code conventions.
## Testing
See `.claude/rules/TESTING.md` for TDD patterns.
Use @ syntax to include content from other files:
# .claude/rules/FORMATTING.md
@./project-specific/FORMATTING.md
This keeps rules DRY by pointing to authoritative sources.
Plugins can organize shared rules internally:
my-plugin/
├── .claude-plugin/
│ └── plugin.json
├── skills/
│ └── my-skill/
│ └── SKILL.md # Can reference ../../rules/FORMATTING.md
└── rules/
├── FORMATTING.md
└── PATTERNS.md
Important limitation: Shared rules only work WITHIN a single plugin. When plugins are installed, Claude Code copies them to a cache directory. Paths that traverse outside the plugin root (like ../other-plugin/rules/) won't work after installation.
For cross-plugin patterns: Use skill invocation instead of file references. Reference related skills by name (e.g., "load the outfitter:formatting skill") rather than file paths.
TOPIC.md in .claude/rules/Don't:
EVERYTHING.mdDo:
@ when availableSearch for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer