Use when creating, organizing, or improving Claude Code rules files in .claude/rules/ — modular project or user-level instructions that Claude automatically loads
From menpx claudepluginhub baleen37/bstack --plugin bstackThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Implements structured self-debugging workflow for AI agent failures: capture errors, diagnose patterns like loops or context overflow, apply contained recoveries, and generate introspection reports.
Rules are markdown files Claude Code automatically loads as memory. Use them to encode persistent standards without bloating CLAUDE.md.
| Scope | Path | Priority |
|---|---|---|
| User (global) | ~/.claude/rules/*.md | Lower (loaded first) |
| Project | .claude/rules/*.md | Higher (overrides user rules) |
All .md files in these directories are automatically loaded. Project rules have the same priority as .claude/CLAUDE.md. More specific (project) instructions override broader (user) ones.
---
paths:
- "**/*.ts"
- "src/components/**"
---
# Rule Title
Rule content here.
paths frontmatter is optional. Without it, the rule applies unconditionally.
| Use CLAUDE.md for | Use rules/ for |
|---|---|
| Project overview, key files, architecture | Focused behavioral standards |
| One-liner conventions | Anything >10 lines |
| Onboarding context | Domain-specific rules (security, testing, style) |
Rule of thumb: If a section in CLAUDE.md stands alone as a topic, it's a rule file candidate.
.claude/rules/
security.md # no hardcoded secrets, input validation
testing.md # TDD workflow, coverage requirements
git-workflow.md # commit format, PR process
coding-style.md # naming, file size limits
agents.md # when to delegate to subagents
frontend/
components.md # React patterns, component structure
styling.md # CSS/Tailwind conventions
backend/
api.md # REST conventions, error responses
database.md # query patterns, migration rules
Apply rules only when working with matching files:
---
paths:
- "**/*.test.ts"
- "**/*.spec.ts"
---
# Test File Standards
- Always use `describe`/`it` blocks
- Mock external dependencies at module boundary
- No `console.log` in tests
Glob patterns supported: **/*.ts, src/**/*, *.md, src/components/*.tsx
git-workflow.md not rules1.mdpaths sparingly — only when the rule genuinely doesn't apply globallyfrontend/, backend/, infra/| Mistake | Fix |
|---|---|
| Duplicating CLAUDE.md content | Rules replace CLAUDE.md sections, not supplement |
| One giant rules file | Split by topic |
| Paths on universal rules | Remove paths if it applies everywhere |
| Vague rules ("write good code") | Concrete and specific ("max 200 lines per file") |