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.md
source 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

TaskCommand
Create project CLAUDE.md
scripts/generate-claude-md.py --type project
Update existing file
scripts/update-claude-md.py <path>
Validate file
scripts/validate-claude-md.py <path>
Auto-fix issues
scripts/auto-fix-claude-md.py <path>
Detect context
scripts/detect-claude-type.py

Step 1: Determine CLAUDE.md Type

Script:

scripts/detect-claude-type.py

Detection Logic:

ContextPathSize TargetWhen to Use
Global
~/.claude/CLAUDE.md
50-150 linesPersonal preferences across all projects
Project
.claude/CLAUDE.md
100-300 linesTeam instructions for this project
Local
CLAUDE.local.md
<50 linesPersonal overrides for this project
Rules
.claude/rules/*.md
20-100 eachModular topics by subject

Step 2: Detect Project Type

Script:

scripts/detect-project.py

Scans for project markers to generate smart defaults:

MarkerLanguageFrameworkTemplate Used
package.json
+ "next"
TypeScriptNext.js
nodejs.md
package.json
+ "react" + "vite"
TypeScriptVite React
nodejs.md
requirements.txt
+ "fastapi"
PythonFastAPI
python.md
requirements.txt
+ "django"
PythonDjango
python.md
Cargo.toml
Rust-
rust.md
go.mod
Go-
go.md
None detected--
general.md

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:

CategoryCheckError Level
FrontmatterValid YAML fence❌ Error
FrontmatterRequired fields❌ Error
StructureSection headers⚠️ Warning
Best practicesLine count⚠️ Warning
Best practicesTable format⚠️ Warning
ContentCommand validity⚠️ Warning
ContentPath references⚠️ Warning

Step 5: Auto-Fix Issues

Script:

scripts/auto-fix-claude-md.py

Auto-Fixes:

IssueFixBackup
Missing frontmatterAdd YAML fence✅ Yes
Empty sectionsRemove or placeholder✅ Yes
Malformed tablesConvert to proper Markdown✅ Yes
Extra blank linesCollapse to 1 lineNo
Inconsistent headingsNormalize to H2/H3✅ Yes
Missing commandsAdd 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:

  1. Read existing CLAUDE.md
  2. Detect project changes
  3. Ask user what to update
  4. Preserve custom sections
  5. Write updated file

Best Practices

PrincipleTarget
Tables > ProseUse tables for commands, configs
Specific commandsExtract real commands from package.json
Line targetsGlobal: 50-150, Project: 100-300, Local: <50, Rules: 20-100
Progressive disclosureQuick start → detailed → references

Resources

scripts/

ScriptPurposeWhen to Use
detect-claude-type.py
Determine CLAUDE.md typeAuto-detection
detect-project.py
Scan project markersBefore generation
generate-claude-md.py
Create from templatesNew file creation
validate-claude-md.py
Check structureAfter edits
auto-fix-claude-md.py
Fix issuesValidation fails
update-claude-md.py
Update existingProject changes

references/

FileLoad When
best-practices.md
Writing content
validation-rules.md
Understanding errors
project-detection.md
Extending detection
examples/
Real-world patterns

assets/

FilePurpose
global.template.md
Personal preferences
project.template.md
Team instructions
local.template.md
Personal overrides
rule.template.md
Modular topics
framework-templates/*.md
Language/framework additions