| created | "2025-12-17T00:00:00.000Z" |
| modified | "2026-05-09T00:00:00.000Z" |
| reviewed | "2026-02-09T00:00:00.000Z" |
| description | Manage modular rules in .claude/rules/ with path-specific globs. Use when adding or listing rules, syncing with CLAUDE.md, or validating path frontmatter. |
| allowed-tools | Read, Write, Edit, Bash, Glob, AskUserQuestion |
| name | blueprint-rules |
Manage modular rules for the project. Rules are markdown files in .claude/rules/ that provide context-specific instructions to Claude.
When to Use This Skill
| Use this skill when... | Use alternative when... |
|---|
| Need to create/edit modular rules in .claude/rules/ | Use /blueprint:claude-md for single-file project instructions |
| Want to list all project and user-level rules | Use /blueprint:generate-rules to auto-generate from PRDs |
| Need to add path-specific rules for certain file types | Just need to view CLAUDE.md structure |
| Managing user-level rules (~/.claude/rules/) | Need to sync rules with existing CLAUDE.md |
Rules Hierarchy (precedence low → high)
| Level | Location | Scope |
|---|
| User-level | ~/.claude/rules/*.md | Personal rules across all projects |
| Project rules | .claude/rules/*.md (no paths) | All files in this project |
| Path-specific rules | .claude/rules/*.md (with paths) | Only matched files |
Project rules override user-level rules. Path-specific rules load conditionally when working on matching files.
Steps:
-
Check blueprint status:
- Read
docs/blueprint/manifest.json
- Check if modular rules are enabled
- If not enabled, offer to enable:
Use AskUserQuestion:
question: "Modular rules are not enabled. Would you like to enable them?"
options:
- "Yes, create .claude/rules/ structure" → enable and continue
- "No, use single CLAUDE.md" → exit
-
Determine action (use AskUserQuestion):
question: "What would you like to do with modular rules?"
options:
- "List existing rules" → show project and user-level rules
- "Add a new rule" → create new rule file
- "Edit existing rule" → modify rule
- "Generate rules from PRDs" → auto-generate from requirements
- "Manage user-level rules" → personal rules in ~/.claude/rules/
- "Sync rules with CLAUDE.md" → bidirectional sync
- "Validate rules" → check for issues
-
List existing rules:
- Scan
.claude/rules/ recursively for .md files
- Scan
~/.claude/rules/ for user-level rules
- Parse frontmatter for
paths field (if scoped)
- Display:
📜 Modular Rules
User-Level Rules (~/.claude/rules/ — personal, all projects):
- preferences.md - Personal coding style
- workflow.md - Personal workflow habits
Project Global Rules (apply to all files):
- development.md - TDD workflow and conventions
- testing.md - Test requirements
Path-Specific Rules (apply to specific paths):
- frontend/react.md - paths: ["src/components/**/*.{ts,tsx}"]
- backend/api.md - paths: ["src/api/**/*.ts"]
Total: 6 rules (2 user-level, 2 global, 2 path-specific)
-
Add a new rule (use AskUserQuestion):
question: "What type of rule would you like to create?"
options:
- "Development workflow" → development.md template
- "Testing requirements" → testing.md template
- "Code style/conventions" → code-style.md template
- "Architecture patterns" → architecture.md template
- "Language-specific" → prompt for language
- "Framework-specific" → prompt for framework
- "Custom" → blank template with guidance
Then ask:
question: "Should this rule apply to all files or specific paths?"
options:
- "All files (global)" → no paths frontmatter
- "Specific file patterns" → prompt for glob patterns
-
Rule file templates:
Global rule template:
Common Rule Patterns:
| Rule Type | Suggested Path | Scope Pattern |
|---|
| React components | rules/frontend/react.md | ["**/*.{tsx,jsx}"] |
| API handlers | rules/backend/api.md | ["src/{api,routes}/**/*"] |
| Database models | rules/backend/models.md | ["src/{models,db}/**/*"] |
| Test files | rules/testing.md | ["**/*.{test,spec}.*"] |
| Documentation | rules/docs.md | ["**/*.md", "docs/**/*"] |
| Config files | rules/config.md | ["*.config.{js,ts,mjs}", ".env*"] |