MIGRATE CLAUDE.md into modular .claude/rules/ directory structure following Claude Code's rules system. Converts monolithic CLAUDE.md into organized, path-specific rule files with glob patterns...
Converts a monolithic CLAUDE.md file into Claude Code's modular .claude/rules/ directory structure. This enables better organization, path-specific rules, and progressive disclosure of project instructions.
Users invoke this skill by saying:
Use this skill when:
.claude/rules/ systemActions:
What to expect:
Common Sections to Look For:
Actions:
Decision Points:
Standard Directory Pattern:
.claude/rules/
āāā core.md # Core execution rules (orchestration, agents)
āāā code-style.md # Language-agnostic code conventions
āāā testing.md # Testing requirements
āāā security.md # Security protocols
āāā git.md # Git and commit standards
āāā stack.md # Tech stack defaults
āāā frontend/
ā āāā react.md # React conventions (path: src/**/*.tsx)
ā āāā styles.md # CSS/styling rules (path: **/*.css, **/*.scss)
āāā backend/
āāā api.md # API guidelines (path: src/api/**/*.ts)
āāā database.md # Database rules (path: src/db/**/*.ts)
Actions:
.claude/rules/ directoryYAML Frontmatter Format:
---
paths: src/api/**/*.ts
---
Glob Pattern Examples:
**/*.ts - All TypeScript filessrc/api/**/* - Everything under src/api/{src,lib}/**/*.tsx - TSX files in src or lib*.md - Markdown files in root onlyContent Organization Tips:
Non-Negotiable Rules:
core.md for critical execution rulesLarge Sections:
frontend/components.md, frontend/hooks.md, frontend/state.mdCross-Cutting Concerns:
security.mdfrontend/security.md and backend/security.md with specific rulesEnvironment-Specific Rules:
development.md and production.md if neededActions:
Validation Checklist:
# Check rules are loaded
ls -la .claude/rules/
# Verify frontmatter syntax (no errors when Claude loads)
# Claude Code will validate on next invocation
# Compare content (line counts should be similar)
wc -l .claude/CLAUDE.md
find .claude/rules/ -name "*.md" -exec wc -l {} + | tail -1
Actions:
.claude/CLAUDE.md.backupCommit Message Format:
refactor(rules): migrate CLAUDE.md to modular rules system
- Split monolithic CLAUDE.md into organized rule files
- Created .claude/rules/ with core, frontend, backend structure
- Added path-specific rules using glob patterns
- Preserved all original content
BREAKING: CLAUDE.md moved to .claude/rules/ directory
Before (CLAUDE.md):
# Claude Code Configuration
## Code Quality Checks
Before marking ANY task complete:
1. Run getDiagnostics on all modified files
2. Fix ALL linting/type errors
## React Guidelines
Use functional components with hooks.
Props should be typed with interfaces.
## API Development
All endpoints must have error handling.
Use Zod for request validation.
After (.claude/rules/):
.claude/rules/
āāā core.md
ā ## Code Quality Checks
ā Before marking ANY task complete:
ā 1. Run getDiagnostics on all modified files
ā 2. Fix ALL linting/type errors
ā
āāā frontend/
ā āāā react.md
ā ---
ā paths: src/**/*.tsx
ā ---
ā # React Guidelines
ā Use functional components with hooks.
ā Props should be typed with interfaces.
ā
āāā backend/
āāā api.md
---
paths: src/api/**/*.ts
---
# API Development
All endpoints must have error handling.
Use Zod for request validation.
This skill is successful when:
Before marking complete, verify:
.claude/rules/ directory exists.md extensionSee reference.md for:
See examples.md for:
Works with:
.claude/rules/*.md)Related Skills:
context-management - for managing project contextdocumentation-suite - for documenting the rules structurerules-migration | Created: 2025-12-10 | Updated: 2025-12-10