Claude-MD-Analyze Command - Comprehensive Directory Analysis for CLAUDE.md Deployment
Analyzes directories to identify optimal CLAUDE.md deployment targets using systematic scoring criteria and developer interaction analysis.
/plugin marketplace add jleechanorg/claude-commands/plugin install claude-commands@claude-commands-marketplaceWhen this command is invoked, YOU (Claude) must execute these steps immediately: This is NOT documentation - these are COMMANDS to execute right now. Use TodoWrite to track progress through multi-phase workflows.
Action Steps:
Action Steps: Discovery Process:
### Phase 2: File Count and Type Analysis
**Action Steps:**
**File Analysis Protocol**:
```bash
### Phase 3: Git Activity Analysis
**Action Steps:**
**Developer Interaction Metrics**:
```bash
### Phase 4: Complexity Assessment
**Action Steps:**
**Structure Depth Analysis**:
```bash
### Phase 5: CLAUDE.md Integration Assessment
**Action Steps:**
**Existing CLAUDE.md Detection**:
```bash
### Phase 7: ๐ ๏ธ IMPLEMENTATION WORKFLOW
**Action Steps:**
1. Review the reference documentation below and execute the detailed steps.
## ๐ REFERENCE DOCUMENTATION
# Claude-MD-Analyze Command - Comprehensive Directory Analysis for CLAUDE.md Deployment
**Purpose**: Automated analysis of directories to identify high-value targets for CLAUDE.md deployment using systematic scoring criteria and developer interaction analysis.
**Usage**: `/claude-md-analyze [directory] [options]` - Analyzes target directory for CLAUDE.md deployment viability
**Type**: Pure LLM-orchestrated command with JSON output for deployment pipeline integration
## ๐จ COMMAND OVERVIEW
The `/claude-md-analyze` command provides comprehensive directory analysis to identify optimal CLAUDE.md deployment targets through:
1. **Directory Discovery**: Recursive scanning with intelligent filtering
2. **Scoring Analysis**: Multi-factor complexity and value assessment
3. **Git Analysis**: Developer interaction frequency and patterns
4. **Exclusion Filtering**: Archive, backup, and generated content detection
5. **JSON Output**: Structured data for deployment decision automation
6. **Quality Integration**: `/fake3` validation compatibility checks
## ๐ฏ ANALYSIS CRITERIA
### Core Threshold Requirements
- **Minimum File Count**: โฅ5 files (configurable via `--min-files` parameter)
- **Developer Activity**: Git log analysis for interaction frequency
- **Directory Complexity**: Structure depth, file type diversity, and development patterns
- **Exclusion Patterns**: Automated filtering of non-development directories
### Scoring Matrix (0-100 scale)
**File Count Score (0-25 points)**:
- 5-10 files: 5 points
- 11-25 files: 10 points
- 26-50 files: 15 points
- 51-100 files: 20 points
- 100+ files: 25 points
**Developer Activity Score (0-30 points)**:
- No commits: 0 points
- 1-10 commits (last 6 months): 5 points
- 11-25 commits: 10 points
- 26-50 commits: 15 points
- 51-100 commits: 20 points
- 100+ commits: 30 points
**Complexity Score (0-30 points)**:
- Single file type: 5 points
- 2-3 file types: 10 points
- 4-6 file types: 15 points
- Mixed development (code + config + docs): 20 points
- Complex development (tests + multiple languages): 25 points
- Enterprise complexity (CI/CD + docs + tests + multi-lang): 30 points
**Structure Depth Score (0-15 points)**:
- 1 level: 3 points
- 2-3 levels: 6 points
- 4-5 levels: 9 points
- 6-7 levels: 12 points
- 8+ levels: 15 points
# Core directory scanning with intelligent filtering
find [target_directory] -type d \
-not -path "*/.*" \
-not -path "*/node_modules/*" \
-not -path "*/venv/*" \
-not -path "*/build/*" \
-not -path "*/dist/*" \
-not -path "*/__pycache__/*" \
-not -path "*/target/*" \
-not -path "*/cache/*" \
-not -path "*/temp/*" \
-not -path "*/tmp/*" | \
head -1000 # Prevent excessive output
Exclusion Pattern Detection:
.zip, .tar.gz, backup, archive, old in pathbuild/, dist/, generated/, auto/, compiled/.git/, .svn/, .hg/ directoriesnode_modules/, vendor/, venv/, virtualenv/.vscode/, .idea/, .vs/, .settings/find [directory] -type f | grep -E '.(py|js|ts|jsx|tsx|java|cpp|c|h|go|rs|rb|php|cs|sql|yaml|yml|json|xml|md|rst|txt|sh|bat|ps1|dockerfile|makefile)$' | wc -l
find [directory] -type f -name "." | sed 's/.*.//' | sort | uniq -c | sort -nr
**File Type Classification**:
- **Core Code**: `.py`, `.js`, `.ts`, `.java`, `.cpp`, `.go`, `.rs`, `.rb`, `.php`, `.cs`
- **Web Frontend**: `.jsx`, `.tsx`, `.vue`, `.html`, `.css`, `.scss`, `.less`
- **Configuration**: `.json`, `.yaml`, `.yml`, `.xml`, `.ini`, `.cfg`, `.conf`
- **Documentation**: `.md`, `.rst`, `.txt`, `.adoc`, `.tex`
- **Scripts**: `.sh`, `.bat`, `.ps1`, `.makefile`, `Dockerfile`
- **Data**: `.sql`, `.csv`, `.json`, `.xml`
# Commit frequency analysis (last 6 months)
git log --since="6 months ago" --oneline [directory] | wc -l
# Author diversity and collaboration patterns
git log --since="6 months ago" --format="%an" [directory] | sort | uniq -c | sort -nr
# File modification frequency
git log --since="6 months ago" --name-only --oneline [directory] | grep -v "^[a-f0-9]" | sort | uniq -c | sort -nr
# Recent activity recency (last commit)
git log -1 --format="%ar" [directory]
Activity Scoring Factors:
find [directory] -type d | awk -F'/' '{print NF-1}' | sort -nr | head -1
find [directory] -mindepth 1 -maxdepth 3 -type d | wc -l
**Development Pattern Recognition**:
- **Test Presence**: Detection of `test/`, `tests/`, `spec/`, `__tests__/` directories
- **Documentation**: `docs/`, `documentation/`, `README.md` presence
- **Configuration Management**: Multiple config files and environments
- **CI/CD Integration**: `.github/`, `.gitlab-ci.yml`, `Jenkinsfile`, `azure-pipelines.yml`
- **Package Management**: `package.json`, `requirements.txt`, `Cargo.toml`, `pom.xml`
# Check for existing CLAUDE.md files in directory tree
find [directory] -name "CLAUDE.md" -o -name "claude.md" -o -name ".claude*"
# Analyze existing file content for conflicts/compatibility
Integration Complexity Factors:
{
"analysis_metadata": {
"timestamp": "2025-01-15T10:30:00Z",
"analyzer_version": "1.0.0",
"target_directory": "/path/to/analyzed/directory",
"analysis_duration_ms": 2500,
"parameters": {
"min_files": 5,
"depth_limit": 10,
"exclude_patterns": ["node_modules", "build", "dist"],
"include_hidden": false
}
},
"summary": {
"total_directories_scanned": 156,
"eligible_directories": 23,
"high_value_targets": 8,
"deployment_recommended": true,
"overall_score": 78.5
},
"directory_rankings": [
{
"path": "/project/src/core",
"rank": 1,
"overall_score": 92.0,
"deployment_priority": "HIGH",
"scores": {
"file_count": 25,
"developer_activity": 28,
"complexity": 26,
"structure_depth": 13
},
"metrics": {
"file_count": 87,
"file_types": 8,
"commits_6mo": 156,
"unique_authors": 6,
"max_depth": 5,
"last_commit": "2 days ago"
},
"analysis_details": {
"file_type_distribution": {
"py": 45,
"ts": 23,
"json": 12,
"md": 5,
"yaml": 2
},
"development_indicators": {
"has_tests": true,
"has_docs": true,
"has_ci_cd": true,
"has_config": true,
"package_management": "requirements.txt"
},
"git_activity": {
"total_commits": 156,
"unique_contributors": ["alice", "bob", "charlie", "diana", "eve", "frank"],
"avg_commits_per_month": 26,
"modification_frequency": "high",
"collaboration_score": 0.85
},
"complexity_factors": {
"subdirectory_count": 12,
"config_files": 8,
"documentation_coverage": "extensive",
"testing_infrastructure": "comprehensive",
"ci_cd_integration": "github_actions"
}
},
"deployment_assessment": {
"claude_md_exists": false,
"integration_complexity": "medium",
"potential_conflicts": [],
"recommended_approach": "full_deployment",
"estimated_setup_time": "15_minutes",
"maintenance_effort": "low"
},
"fake3_compatibility": {
"supported": true,
"estimated_scan_time": "3_minutes",
"expected_issues": "moderate",
"automation_potential": "high"
}
}
],
"excluded_directories": [
{
"path": "/project/node_modules",
"exclusion_reason": "dependency_directory",
"pattern_matched": "node_modules"
},
{
"path": "/project/build",
"exclusion_reason": "generated_content",
"pattern_matched": "build"
}
],
"recommendations": {
"deployment_strategy": "phased_rollout",
"priority_order": [
"/project/src/core",
"/project/services/api",
"/project/tests/integration"
],
"resource_requirements": {
"estimated_total_setup_time": "45_minutes",
"maintenance_overhead": "low",
"training_requirements": "minimal"
},
"risk_assessment": {
"deployment_risk": "low",
"integration_challenges": ["existing_workflows"],
"mitigation_strategies": ["gradual_adoption", "team_training"]
}
},
"quality_metrics": {
"analysis_confidence": 0.92,
"data_completeness": 0.88,
"git_availability": true,
"permission_issues": false,
"scan_limitations": []
}
}
--directory or -d: Target directory to analyze (default: current directory)--min-files: Minimum file count threshold (default: 5)--max-depth: Maximum directory depth to scan (default: 10)--output: Output file path for JSON results (default: stdout)--include-hidden: Include hidden directories/files (default: false)--exclude-patterns: Additional exclusion patterns (comma-separated)--include-patterns: Force inclusion patterns despite exclusions--file-types: Limit analysis to specific file types--git-months: Git analysis timeframe in months (default: 6)--complexity-weights: Custom scoring weights (format: file:25,activity:30,complexity:30,depth:15)--quick-scan: Skip detailed git analysis for faster results--verbose: Include detailed analysis steps in output--fake3-check: Include fake code pattern analysis compatibility--deployment-simulation: Simulate CLAUDE.md deployment process--conflict-detection: Check for potential integration conflictsThe command works through intelligent orchestration of existing tools:
find and ls commands for filesystem analysisgit log, git diff, and git blame for activity metricsgrep, awk, and sed for content pattern recognition/fake3 validation patternsHigh-Value Target Identification:
Risk Assessment:
/claude-md-analyze /project/src --min-files 10 --output analysis.json --verbose
๐ Starting /claude-md-analyze - CLAUDE.md Deployment Analysis
๐ Target: /project/src
โ๏ธ Parameters: min-files=10, max-depth=10, git-months=6
[Phase 1 - Directory Discovery]
๐ Scanning filesystem structure...
๐ Found 156 directories, 847 files
๐ซ Excluded 23 directories (dependencies, build artifacts)
โ
45 directories meet minimum file threshold
[Phase 2 - File Analysis]
๐ Analyzing file types and development patterns...
๐ป Core development files: 234 (67%)
๐งช Test files: 45 (13%)
๐ Documentation: 31 (9%)
โ๏ธ Configuration: 38 (11%)
[Phase 3 - Git Activity Analysis]
๐ Analyzing developer interaction patterns...
๐ฅ 6 unique contributors in last 6 months
๐ 156 commits across analyzed directories
๐ Most recent activity: 2 days ago
๐ฅ High activity directories: 8 identified
[Phase 4 - Complexity Assessment]
๐๏ธ Evaluating directory complexity...
๐ Average depth: 3.2 levels
๐ฏ Enterprise patterns detected: 12 directories
๐งฉ Integration complexity: Medium
[Phase 5 - CLAUDE.md Integration Assessment]
๐ Checking existing CLAUDE.md presence...
๐ No conflicts detected
โ
Clean integration path available
โฑ๏ธ Estimated setup time: 45 minutes total
๐ Analysis Results:
๐ Top Priority: /project/src/core (Score: 92.0)
๐ฅ Second Priority: /project/services/api (Score: 87.5)
๐ฅ Third Priority: /project/tests/integration (Score: 81.2)
๐ High-value targets identified: 8
โ
Deployment recommended: YES
๐ Full results written to: analysis.json
Ready for CLAUDE.md deployment pipeline!
Command succeeds when:
Command provides warnings for:
Command stops early if:
Enhances:
/fake3 - Provides deployment target analysis for code quality automation/execute - Enables automated CLAUDE.md deployment workflows/plan - Informs deployment planning with systematic analysisUses:
find, ls, grep)git log, git diff)Compatible with:
/orchestrate - Supports batch analysis across multiple directories/pr - Provides deployment recommendations for pull request workflowsThe LLM makes intelligent decisions about:
--quick-scan modeThis command embodies the principle: "Systematic analysis enables data-driven deployment decisions while providing comprehensive insights for CLAUDE.md integration success."