This skill provides a comprehensive context extraction system for large codebases. It intelligently analyzes code structure, dependencies, and relationships to extract relevant context for understanding, debugging, or modifying code.
A powerful tool for extracting and analyzing context from large codebases. This skill helps you understand code structure, dependencies, and relationships across complex projects.
Extract full context from a codebase:
python context_extractor.py --target-path /path/to/project --mode full --output context.md
# Get a high-level summary
python context_extractor.py --target-path ./project --mode summary
# Then get full details
python context_extractor.py --target-path ./project --mode full --output full_context.md
# Search for a class or function
python context_extractor.py --target-path ./project --mode targeted --focus "UserService"
# Generate dependency graph as JSON
python context_extractor.py --target-path ./project --mode dependency --format json --output deps.json
# Extract context for a specific module
python context_extractor.py --target-path ./project/module --mode full --output review_context.md
Performs comprehensive analysis of the entire codebase:
Focuses on specific entities:
Analyzes code dependencies:
Quick overview without details:
Human-readable format with:
Machine-readable format for:
Structured format that's:
Simple plain text:
--target-path PATH Path to codebase (required)
--mode MODE Extraction mode (required)
--output FILE Output file path (optional, defaults to stdout)
--focus QUERY Entity to focus on (for targeted mode)
--depth N Maximum traversal depth
--include-tests Include test files in analysis
--language LANG Programming language (auto-detected)
--format FORMAT Output format: markdown, json, yaml, text
--exclude PATTERNS Comma-separated exclusion patterns
python context_extractor.py \
--target-path ~/projects/my-app \
--mode full \
--format markdown \
--output analysis.md
python context_extractor.py \
--target-path ~/projects/web-app \
--mode targeted \
--focus "api" \
--format json
python context_extractor.py \
--target-path ~/projects/large-app \
--mode full \
--exclude "*/migrations/*,*/fixtures/*" \
--output context.md
python context_extractor.py \
--target-path ~/projects/app/core \
--mode full \
--include-tests \
--output core_analysis.md
# Generate context for PR review
python context_extractor.py \
--target-path ./changed-files \
--mode full \
--output pr_context.md
# Extract API documentation
python context_extractor.py \
--target-path ./src/api \
--mode full \
--format markdown \
--output API_REFERENCE.md
# Check for circular dependencies
python context_extractor.py \
--target-path ./src \
--mode dependency \
--format json \
| jq '.circular_dependencies'
Add support for new languages by:
extract_imports() and extract_entities()--exclude to skip irrelevant directories--depth for very large codebasessummary mode for quick checks--target-path is correct--focus to narrow scope--depth limitpython context_extractor.py \
--target-path ./project \
--mode full \
--exclude "*/generated/*,*.pb.go,*_pb2.py"
# Count total functions
python context_extractor.py --target-path . --mode full --format json \
| jq '[.files[].entities[] | select(.type=="function")] | length'
# Analyze multiple projects
for project in ~/projects/*; do
python context_extractor.py \
--target-path "$project" \
--mode summary \
--output "${project##*/}_summary.md"
done
To extend the analyzer:
LanguageAnalyzer subclassesThis skill is part of the codebase analysis toolkit.
npx skills add lofcz/codebase-context-extractor下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer