From deep-dive-analysis
AI-powered systematic codebase analysis. Combines structure extraction with semantic understanding to produce documentation capturing WHAT, WHY, HOW, and CONSEQUENCES. Includes pattern recognition, red flag detection, flow tracing, and quality assessment. TRIGGER WHEN: encountering unfamiliar code, before major refactoring, or when documentation is stale or missing DO NOT TRIGGER WHEN: the task is outside the specific scope of this component.
npx claudepluginhub acaprino/alfio-claude-plugins --plugin deep-dive-analysisThis skill uses the workspace's default tool permissions.
This skill combines **mechanical structure extraction** with **Claude's semantic understanding** to produce comprehensive codebase documentation. Unlike simple AST parsing, this skill captures:
references/AI_ANALYSIS_METHODOLOGY.mdreferences/ANTIREZ_COMMENTING_STANDARDS.mdreferences/DEEP_DIVE_PLAN.mdreferences/SEMANTIC_PATTERNS.mdreferences/analysis-templates.mdscripts/analyze_file.pyscripts/ast_parser.pyscripts/check_progress.pyscripts/classifier.pyscripts/comment_rewriter.pyscripts/doc_review.pyscripts/progress_tracker.pyscripts/rewrite_comments.pyscripts/usage_finder.pytemplates/analysis_report.mdtemplates/semantic_analysis.mdFetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Retrieves current documentation, API references, and code examples for libraries, frameworks, SDKs, CLIs, and services via Context7 CLI. Ideal for API syntax, configs, migrations, and setup queries.
Uses ctx7 CLI to fetch current library docs, manage AI coding skills (install/search/generate), and configure Context7 MCP for AI editors.
This skill combines mechanical structure extraction with Claude's semantic understanding to produce comprehensive codebase documentation. Unlike simple AST parsing, this skill captures:
Mechanical Analysis (Scripts):
Semantic Analysis (Claude AI):
Documentation Maintenance:
Use this skill when:
THE DOCUMENTATION GENERATED BY THIS SKILL IS THE ABSOLUTE AND UNQUESTIONABLE SOURCE OF TRUTH FOR YOUR PROJECT.
ANY INFORMATION NOT VERIFIED WITH IRREFUTABLE EVIDENCE FROM SOURCE CODE IS FALSE, UNRELIABLE, AND UNACCEPTABLE.
[UNVERIFIED - REQUIRES CODE CHECK]file.py::Class.method), never line numbers -- line numbers break on any editSee references/analysis-templates.md for the full verification trust model, temporal purity principle, and documentation status markers.
After analysis completes, consult the right file for your task:
| Your Task | Start With | Also Check |
|---|---|---|
| Onboarding / understanding the project | 07-final-report, 01-structure | 04-semantics |
| Writing new feature | 01-structure (Where to Add), 02-interfaces | 04-semantics |
| Fixing a bug | 03-flows, 05-risks | 01-structure |
| Refactoring | 01-structure, 04-semantics, 05-risks | 03-flows |
| Code review | 02-interfaces, 05-risks | 06-documentation |
| Updating documentation | 06-documentation, 04-semantics | 02-interfaces |
The analysis NEVER reads or includes contents from sensitive files: .env, .env.*, credentials.*, secrets.*, *.pem, *.key, *.p12, *.pfx, id_rsa*, id_ed25519*, .npmrc, .pypirc, .netrc, or any file containing API keys, passwords, or tokens. If encountered, note file existence only - never quote contents.
python .claude/skills/deep-dive-analysis/scripts/analyze_file.py \
--file src/utils/circuit_breaker.py \
--output-format markdown
Parameters:
--file / -f: Relative path to file - REQUIRED--output-format / -o: Output format (json, markdown, summary) - default: summary--find-usages / -u: Find all usages of exported symbols - default: false--update-progress / -p: Update analysis_progress.json - default: falsepython .claude/skills/deep-dive-analysis/scripts/check_progress.py \
--phase 1 --status pending
python .claude/skills/deep-dive-analysis/scripts/analyze_file.py \
--symbol CircuitBreaker --file src/utils/circuit_breaker.py
python .claude/skills/deep-dive-analysis/scripts/analyze_file.py \
--phase 1 --output-format markdown --output-file docs/01_domains/COMMON_LIBRARY.md
python .claude/skills/deep-dive-analysis/scripts/doc_review.py scan \
--path docs/ --output doc_health_report.json
python .claude/skills/deep-dive-analysis/scripts/doc_review.py validate-links \
--path docs/ --fix
python .claude/skills/deep-dive-analysis/scripts/doc_review.py verify \
--doc docs/agents/lifecycle.md --source src/agents/lifecycle.py
python .claude/skills/deep-dive-analysis/scripts/doc_review.py update-indexes \
--search-index docs/00_navigation/SEARCH_INDEX.md \
--by-domain docs/00_navigation/BY_DOMAIN.md
python .claude/skills/deep-dive-analysis/scripts/doc_review.py full-maintenance \
--path docs/ --auto-fix --output doc_health_report.json
Executes: scan health, validate/fix links, identify obsolete files, update indexes, generate report.
python .claude/skills/deep-dive-analysis/scripts/rewrite_comments.py analyze \
src/main.py --report
python .claude/skills/deep-dive-analysis/scripts/rewrite_comments.py scan \
src/ --recursive --issues-only
python .claude/skills/deep-dive-analysis/scripts/rewrite_comments.py report \
src/ --output comment_health.md
python .claude/skills/deep-dive-analysis/scripts/rewrite_comments.py rewrite \
src/main.py --apply --backup
python .claude/skills/deep-dive-analysis/scripts/rewrite_comments.py standards
| Classification | Criteria | Verification |
|---|---|---|
| Critical | Handles authentication, security, encryption, sensitive data | Mandatory |
| High-Complexity | >300 LOC, >5 dependencies, state machines, async patterns | Mandatory |
| Standard | Normal business logic, data models, utilities | Recommended |
| Utility | Pure functions, helpers, constants | Optional |
| Layer | What | Who Does It |
|---|---|---|
| 1. WHAT | Classes, functions, imports | Scripts (AST) |
| 2. HOW | Algorithm details, data flow | Claude's first pass |
| 3. WHY | Business purpose, design decisions | Claude's deep analysis |
| 4. WHEN | Triggers, lifecycle, concurrency | Claude's behavioral analysis |
| 5. CONSEQUENCES | Side effects, failure modes | Claude's systems thinking |
| Pattern Type | Examples | Documentation Focus |
|---|---|---|
| Architectural | Repository, Service, CQRS, Event-Driven | Responsibilities, boundaries |
| Behavioral | State Machine, Strategy, Observer, Chain | Transitions, variations |
| Resilience | Circuit Breaker, Retry, Bulkhead, Timeout | Thresholds, fallbacks |
| Data | DTO, Value Object, Aggregate | Invariants, relationships |
| Concurrency | Producer-Consumer, Worker Pool | Thread safety, backpressure |
ARCHITECTURE:
- GOD CLASS: >10 public methods or >500 LOC
- CIRCULAR DEPENDENCY: A -> B -> C -> A
- LEAKY ABSTRACTION: Implementation details in interface
RELIABILITY:
- SWALLOWED EXCEPTION: Empty catch blocks
- MISSING TIMEOUT: Network calls without timeout
- RACE CONDITION: Shared mutable state without sync
SECURITY:
- HARDCODED SECRET: Passwords, API keys in code
- SQL INJECTION: String concatenation in queries
- MISSING VALIDATION: Unsanitized user input
1. SCRIPTS RUN FIRST -> classifier.py, ast_parser.py, usage_finder.py
2. CLAUDE ANALYZES -> Read source, apply semantic questions, recognize patterns, identify red flags
3. CLAUDE DOCUMENTS -> Use template, explain WHY not just WHAT, document contracts
4. VERIFY -> Check against runtime behavior, validate with code traces
1. CLASSIFY -> LOC, dependencies, critical patterns, assign classification
2. READ & MAP -> AST structure, classes, functions, constants, state mutations
3. DEPENDENCY CHECK -> Internal imports, external imports, external calls
4. CONTEXT ANALYSIS -> Symbol usages, importing modules, message flows
5. RUNTIME VERIFICATION (Critical/High-Complexity) -> Log analysis, flow verification
6. DOCUMENTATION -> Update progress, generate report, cross-reference
--update-progressreferences/analysis-templates.md - Verification trust model, temporal purity principle, documentation status markers, comment classification, maintenance workflowsreferences/AI_ANALYSIS_METHODOLOGY.md - Complete analysis methodologyreferences/SEMANTIC_PATTERNS.md - Pattern recognition guidereferences/ANTIREZ_COMMENTING_STANDARDS.md - Comment taxonomyreferences/DEEP_DIVE_PLAN.md - Master analysis plan with all phase definitionstemplates/semantic_analysis.md - AI-powered per-file analysis templatetemplates/analysis_report.md - Module-level report templatescripts/ - Python analysis tools
analyze_file.py - Source code analysis (Phases 1-7)check_progress.py - Progress trackingdoc_review.py - Documentation maintenance (Phase 8)comment_rewriter.py - Comment analysis enginerewrite_comments.py - Comment quality CLI tool