| name | claude-md-generator |
| description | Automatically generates claude.md files for new folders/modules following hierarchical structure. Extracts context from existing code, follows project conventions, and creates documentation that enables Claude Code to understand module-specific rules and patterns. |
| allowed-tools | read, write, glob, search, codebase_search |
| version | 1 |
| best_practices | ["Extract context from existing code in target directory","Follow hierarchical claude.md structure (root → subdirectories)","Reference parent claude.md for inheritance","Include module-specific rules and patterns","Validate generated claude.md structure"] |
| error_handling | graceful |
| streaming | supported |
| templates | ["module","feature","component","api","service"] |
claude.md Generator Skill - Automatically generates claude.md files for new folders/modules that enable Claude Code to understand module-specific rules, patterns, and conventions.
- Creating new modules or feature folders
- Adding new major components or subsystems
- Introducing new APIs or services
- Setting up new directories that need documentation
- Ensuring claude.md exists where required
Step 1: Identify Target Location
Determine where claude.md should be created:
- Check if target directory exists
- Identify parent directory and its claude.md (if exists)
- Understand module purpose from directory structure
- Check for existing claude.md in target directory
Step 2: Extract Context from Code
Analyze existing code to understand module:
- Read key files in target directory (index files, main components, etc.)
- Identify patterns and conventions used
- Extract dependencies and relationships
- Understand module responsibilities
- Note any special rules or guidelines
Step 3: Load Template
Load claude.md template from .claude/templates/claude-md-template.md:
- Use template as base structure
- Customize sections based on module type
- Include module-specific information
Step 4: Generate claude.md Content
Create claude.md following this structure:
# [Module/Feature Name]
## Purpose
[What this module/feature does - extracted from code analysis]
## Key Patterns
[Important patterns and conventions found in code]
## Rules & Guidelines
[Module-specific rules and guidelines]
## Dependencies
[Key dependencies and relationships]
## Usage Examples
[How to use this module/feature - from code examples]
Step 5: Inherit from Parent
If parent directory has claude.md:
- Reference parent claude.md for inherited rules
- Add module-specific overrides
- Maintain consistency with parent guidelines
Step 6: Validate Generated File
Ensure generated claude.md:
- Follows template structure
- Has all required sections
- Uses consistent formatting
- Has valid markdown syntax
- References parent claude.md if applicable
</execution_process>
**Integration with Developer Agent**:
When Developer agent creates new modules:
1. Developer creates module structure
2. Developer invokes claude-md-generator: "Generate claude.md for [path]"
3. Skill analyzes code and generates claude.md
4. Developer reviews and customizes as needed
**Module claude.md**