| name | description | author | version | tags | |||||
|---|---|---|---|---|---|---|---|---|---|
repo-analyzer |
Code repository analysis and technical documentation generation skill |
Claude Code Skills Factory |
1.0.0 |
|
A comprehensive code repository analysis and technical documentation generation skill that scans repositories and generates detailed summary reports.
This skill analyzes code repositories to generate comprehensive technical documentation including:
- Repository overview and purpose
- Directory structure and responsibilities
- Technology stack and dependencies
- Core modules and business domains
- Key execution workflows
- Architecture design and extension patterns
- Onboarding guidance
- Risk analysis and technical debt
Use this skill when you need to:
- Understand a new codebase quickly
- Generate technical documentation for a repository
- Analyze repository architecture and dependencies
- Create onboarding guides for new developers
- Assess technical debt and maintenance risks
The skill performs an 8-step analysis:
- Repository Global Scan - Scans directory structure, identifies languages, counts files
- Project Positioning - Infers project purpose from README, directory names, dependencies
- Directory Structure Mapping - Analyzes key directory responsibilities and relationships
- Tech Stack Analysis - Parses dependency files, analyzes technology choices
- Core Module Abstraction - Identifies core modules and business boundaries
- Execution Flow Analysis - Traces program startup and typical execution paths
- Onboarding Path Generation - Creates safe modification points and reading order
- Risk Assessment - Identifies potential maintenance risks and technical debt
python repo_analyzer.py /path/to/repositorypython repo_analyzer.py /path/to/repository --output report.mdpython repo_analyzer.py /path/to/repository --depth 3| Parameter | Description | Default |
|---|---|---|
repository_path |
Path to the repository to analyze | Required |
--output |
Output file path for the report | repo_analysis_report.md |
--depth |
Directory scanning depth | 2 |
--include-risks |
Include risk assessment section | true |
--verbose |
Enable verbose logging | false |
The skill generates a comprehensive Markdown report with the following sections:
- Repository Overview - Project type, purpose, scale, complexity
- Project Structure - Core directory responsibilities and relationships
- Technology Stack - Core frameworks, infrastructure, middleware
- Core Modules & Business Domains - Key business modules and collaboration patterns
- Key Execution Workflows - Program startup and typical request paths
- Architecture Design - Architectural style, design patterns, extension paths
- Quick Start Guide - Recommended reading order, safe modification points
- Risk Points & Considerations - Potential maintenance risks and pitfalls
# Copy skill to project .claude directory
cp -r generated-skills/repo-analyzer .claude/skills/# Copy skill to user .claude directory
cp -r generated-skills/repo-analyzer ~/.claude/skills/repo_analyzer.py- Main analysis scriptrequirements.txt- Python dependenciesSKILL.md- This documentation fileexamples/- Example analysis reports
- Python 3.8+
pyyaml- For parsing YAML configuration filestoml- For parsing TOML configuration fileschardet- For file encoding detection
python repo_analyzer.py .python repo_analyzer.py /projects/my-app --output my_analysis.mdpython repo_analyzer.py /path/to/repo --depth 3 --include-risks false --verbose true- Analysis is based on static code structure, not runtime behavior
- Business logic inference is limited to code organization patterns
- Dependency analysis requires standard package manager files
- Complex monorepos may require deeper scanning depth
- Start with default settings - Use depth=2 for most repositories
- Review inferred information - Always validate inferred project purposes
- Customize for complex repos - Increase depth for deeply nested structures
- Combine with manual review - Use the report as a starting point for deeper analysis
- Permission errors - Ensure read access to the repository directory
- Encoding issues - The skill uses chardet to detect file encodings
- Missing dependencies - Install required packages from requirements.txt
- Large repositories - May take longer to process; consider increasing timeout
Enable verbose logging for detailed processing information:
python repo_analyzer.py /path/to/repo --verbose truecode-reviewer- For detailed code quality analysisarchitecture-validator- For architectural pattern validationdependency-auditor- For security vulnerability scanning
To contribute to this skill:
- Fork the repository
- Create a feature branch
- Implement your changes
- Add tests if applicable
- Submit a pull request
This skill is released under the MIT License.
- Initial release with 8-step analysis framework
- Support for multiple dependency file formats
- Markdown report generation
- Configurable scanning depth
Note: This skill generates documentation based on code structure analysis. Always validate the generated insights with domain experts and actual code behavior.