Claude-skill-registry claude-md-creator
Use when creating CLAUDE.md files, updating existing CLAUDE.md, validating CLAUDE.md structure, or auto-fixing CLAUDE.md issues. Load for setting up project instructions, global guidelines, local overrides, or modular rules. Handles global (~/.claude/CLAUDE.md), project (.claude/CLAUDE.md), local (CLAUDE.local.md), and rules (.claude/rules/*.md) with smart project detection and template generation.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/claude-md-creator" ~/.claude/skills/majiayu000-claude-skill-registry-claude-md-creator && rm -rf "$T"
manifest:
skills/data/claude-md-creator/SKILL.mdsource content
CLAUDE.md Creator
Create, validate, and maintain CLAUDE.md files with intelligent project detection.
Workflow Decision Tree
User Request │ ┌───────────┴───────────┐ │ What's needed? │ └───────────┬───────────┘ ┌──────────────┼──────────────┐ │ │ │ Create new Update existing Validate/Fix │ │ │ ┌────┴────┐ ┌────┴────┐ ┌───┴────┐ │ │ │ │ │ │ Which Detect Merge Auto-fix Auto-fix type? context changes issues issues │ │ │ │ │ Detect Project Ask Run Run context type user fix fix │ │ changes script script └────┬────┘ │ │ │ │ │ │ │ Generate Generate Validate Validate content content output output │ │ │ │ └───────────┴────────┴─────────┘ │ Write to file
Quick Start
| Task | Command |
|---|---|
| Create project CLAUDE.md | |
| Update existing file | |
| Validate file | |
| Auto-fix issues | |
| Detect context | |
Step 1: Determine CLAUDE.md Type
Script:
scripts/detect-claude-type.py
Detection Logic:
| Context | Path | Size Target | When to Use |
|---|---|---|---|
| Global | | 50-150 lines | Personal preferences across all projects |
| Project | | 100-300 lines | Team instructions for this project |
| Local | | <50 lines | Personal overrides for this project |
| Rules | | 20-100 each | Modular topics by subject |
Step 2: Detect Project Type
Script:
scripts/detect-project.py
Scans for project markers to generate smart defaults:
| Marker | Language | Framework | Template Used |
|---|---|---|---|
+ "next" | TypeScript | Next.js | |
+ "react" + "vite" | TypeScript | Vite React | |
+ "fastapi" | Python | FastAPI | |
+ "django" | Python | Django | |
| Rust | - | |
| Go | - | |
| None detected | - | - | |
Step 3: Generate CLAUDE.md
Script:
scripts/generate-claude-md.py
Template Selection:
Base template (assets/*.template.md) + Language template (assets/framework-templates/*.md) + Project-specific data (detected) = Final CLAUDE.md
Step 4: Validate Structure
Script:
scripts/validate-claude-md.py
Checks Performed:
| Category | Check | Error Level |
|---|---|---|
| Frontmatter | Valid YAML fence | ❌ Error |
| Frontmatter | Required fields | ❌ Error |
| Structure | Section headers | ⚠️ Warning |
| Best practices | Line count | ⚠️ Warning |
| Best practices | Table format | ⚠️ Warning |
| Content | Command validity | ⚠️ Warning |
| Content | Path references | ⚠️ Warning |
Step 5: Auto-Fix Issues
Script:
scripts/auto-fix-claude-md.py
Auto-Fixes:
| Issue | Fix | Backup |
|---|---|---|
| Missing frontmatter | Add YAML fence | ✅ Yes |
| Empty sections | Remove or placeholder | ✅ Yes |
| Malformed tables | Convert to proper Markdown | ✅ Yes |
| Extra blank lines | Collapse to 1 line | No |
| Inconsistent headings | Normalize to H2/H3 | ✅ Yes |
| Missing commands | Add from project detection | ✅ Yes |
Run modes:
# Dry run ./auto-fix-claude-md.py --dry-run <path> # Auto-fix all ./auto-fix-claude-md.py <path> # Fix specific category ./auto-fix-claude-md.py --category structure <path>
Step 6: Update Existing
Script:
scripts/update-claude-md.py
Merge Strategy:
- Read existing CLAUDE.md
- Detect project changes
- Ask user what to update
- Preserve custom sections
- Write updated file
Best Practices
| Principle | Target |
|---|---|
| Tables > Prose | Use tables for commands, configs |
| Specific commands | Extract real commands from package.json |
| Line targets | Global: 50-150, Project: 100-300, Local: <50, Rules: 20-100 |
| Progressive disclosure | Quick start → detailed → references |
Resources
scripts/
| Script | Purpose | When to Use |
|---|---|---|
| Determine CLAUDE.md type | Auto-detection |
| Scan project markers | Before generation |
| Create from templates | New file creation |
| Check structure | After edits |
| Fix issues | Validation fails |
| Update existing | Project changes |
references/
| File | Load When |
|---|---|
| Writing content |
| Understanding errors |
| Extending detection |
| Real-world patterns |
assets/
| File | Purpose |
|---|---|
| Personal preferences |
| Team instructions |
| Personal overrides |
| Modular topics |
| Language/framework additions |