Agent skill
repo-analyzer
Code repository analysis and technical documentation generation skill
Install this agent skill to your Project
npx add-skill https://github.com/chaorenex1/coding-workflow/tree/main/skills/repo-analyzer
SKILL.md
Repo Analyzer Skill
A comprehensive code repository analysis and technical documentation generation skill that scans repositories and generates detailed summary reports.
Purpose
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
When to Use This Skill
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
How It Works
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
Usage
Basic Usage
python repo_analyzer.py /path/to/repository
With Output File
python repo_analyzer.py /path/to/repository --output report.md
With Custom Depth
python repo_analyzer.py /path/to/repository --depth 3
Parameters
| 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 |
Output Format
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
Installation
Project-Level Installation
# Copy skill to project .claude directory
cp -r generated-skills/repo-analyzer .claude/skills/
User-Level Installation
# Copy skill to user .claude directory
cp -r generated-skills/repo-analyzer ~/.claude/skills/
Files
repo_analyzer.py- Main analysis scriptrequirements.txt- Python dependenciesSKILL.md- This documentation fileexamples/- Example analysis reports
Dependencies
- Python 3.8+
pyyaml- For parsing YAML configuration filestoml- For parsing TOML configuration fileschardet- For file encoding detection
Examples
Analyze Current Repository
python repo_analyzer.py .
Generate Report for Specific Path
python repo_analyzer.py /projects/my-app --output my_analysis.md
Analyze with Custom Settings
python repo_analyzer.py /path/to/repo --depth 3 --include-risks false --verbose true
Limitations
- 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
Best Practices
- 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
Troubleshooting
Common Issues
- 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
Debug Mode
Enable verbose logging for detailed processing information:
python repo_analyzer.py /path/to/repo --verbose true
Related Skills
quality-reviewer- For detailed code quality analysisarchitecture-validator- For architectural pattern validationdependency-auditor- For security vulnerability scanning
Contributing
To contribute to this skill:
- Fork the repository
- Create a feature branch
- Implement your changes
- Add tests if applicable
- Submit a pull request
License
This skill is released under the MIT License.
Changelog
v1.0.0
- 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.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
memex-fallback
Fallback to memex-cli when codeagent-wrapper is unavailable. Automatically converts codeagent-wrapper syntax to memex-cli stdin protocol and executes.
tdd
Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.
codex-cli-bridge
Bridge between Claude Code and OpenAI Codex CLI - generates AGENTS.md from CLAUDE.md, provides Codex CLI execution helpers, and enables seamless interoperability between both tools
git-code-review
Get git records for specified users and days, perform code review for each commit, and generate detailed code review reports
component-tester
This skill should be used when the user asks to "test memex-cli", "test code-with-codex", "test ux-design-gemini", "test /multcode", "run component tests", "validate workflow components", "run integration tests", or "verify plugin functionality". Provides comprehensive testing framework for coding-workflow plugin components.
test-case-organizer
This skill should be used when the user asks to "测试用例整理", "测试整理", "organize test cases", "reorganize tests", "consolidate scattered tests", or mentions test cases scattered in business code that need to be moved to proper test directories.
Didn't find tool you were looking for?