deep-dive-analysis
AI-powered systematic codebase analysis. Combines structure extraction with semantic understanding to produce documentation capturing WHAT, WHY, HOW, and CONSEQUENCES. Multi-language: Python, Java, JavaScript, TypeScript, SQL, PL/SQL, Rust. 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.
What this skill does
# Deep Dive Analysis Skill ## Overview This skill combines **mechanical structure extraction** with **Claude's semantic understanding** to produce comprehensive codebase documentation. Unlike simple AST parsing, this skill captures: - **WHAT** the code does (structure, functions, classes) - **WHY** it exists (business purpose, design decisions) - **HOW** it integrates (dependencies, contracts, flows) - **CONSEQUENCES** of changes (side effects, failure modes) ## Language Support | Language | Extensions | Structural extraction | Comment rewriting | |---|---|---|---| | Python | `.py`, `.pyi` | stdlib `ast` (always available) | `#` line + docstrings | | Java | `.java` | tree-sitter (preferred) or regex | `//`, `/* */`, Javadoc `/** */` | | JavaScript | `.js`, `.mjs`, `.cjs`, `.jsx` | tree-sitter (preferred) or regex | `//`, `/* */`, JSDoc `/** */` | | TypeScript | `.ts`, `.tsx`, `.mts`, `.cts` | tree-sitter (preferred) or regex; adds interfaces, enums, type aliases | `//`, `/* */`, JSDoc `/** */` | | SQL | `.sql`, `.ddl`, `.dml` | regex DDL (tables, views, indexes, sequences, types, functions, procedures, triggers) | `--`, `/* */` | | PL/SQL (Oracle) | `.pks`, `.pkb`, `.plsql`, `.pls`, `.pck`, `.prc`, `.fnc`, `.trg` | regex (packages, package bodies, type bodies, cursors, exceptions, %TYPE/%ROWTYPE references) | `--`, `/* */` | | Rust | `.rs` | tree-sitter (preferred) or regex; structs, enums, traits, impls (with `Trait for Type` naming), mods, unions, type aliases | `//`, `/* */`, rustdoc `///` / `//!` / `/** */` / `/*! */` | `.sql` files are disambiguated against PL/SQL by inspecting content for Oracle-specific markers (`CREATE OR REPLACE PACKAGE`, `DBMS_OUTPUT`, `%TYPE`, `%ROWTYPE`, `UTL_FILE`, `PRAGMA AUTONOMOUS`, etc.). PostgreSQL `plpgsql` is correctly classified as SQL. ## Prerequisites The scripts are designed to work **out of the box** with just the Python stdlib. Tree-sitter is optional and improves accuracy for Java / JavaScript / TypeScript: ```bash # Optional: install for higher-fidelity parsing pip install -r scripts/requirements.txt # or uv pip install -r scripts/requirements.txt ``` What changes when tree-sitter is installed: - **Java**: nested classes, generic type parameters, annotations, multi-line declarations parsed correctly. Without it, the regex fallback still finds top-level classes, methods, imports, and constants. - **JavaScript / TypeScript**: arrow functions in object/class properties, decorators, template literals, JSX elements parsed correctly. Without it, the regex fallback handles top-level declarations, ES6 `import`/`export`, and CommonJS `require`. - **Rust**: lifetimes, generic bounds (`where` clauses), impl blocks with trait bounds, attribute macros parsed correctly. Without it, the regex fallback still finds top-level fns, structs/enums/traits/impls/mods, use declarations, and UPPER_CASE constants. - **Python / SQL / PL-SQL**: no change. Python always uses stdlib `ast`; SQL/PL-SQL always use the regex DDL extractor. The active parser is reported in `ParseResult.notes` and in the CLI output: `parser=stdlib-ast`, `parser=tree-sitter`, or `parser=regex-fallback`. ### Capabilities **Mechanical Analysis (Scripts):** - Extract code structure (classes, functions, imports) - Map dependencies (internal/external) - Find symbol usages across the codebase - Track analysis progress - Classify files by criticality **Semantic Analysis (Claude AI):** - Recognize architectural and design patterns - Identify red flags and anti-patterns - Trace data and control flows - Document contracts and invariants - Assess quality and maintainability **Documentation Maintenance:** - Review and maintain documentation (Phase 8) - Fix broken links and update navigation indexes - Analyze and rewrite code comments (antirez standards) **Use this skill when:** - Analyzing a codebase you're unfamiliar with - Generating documentation that explains WHY, not just WHAT - Identifying architectural patterns and anti-patterns - Performing code review with semantic understanding - Onboarding to a new project ## Prerequisites This skill is invoked by the `/deep-dive-analysis` command. The command creates and manages state automatically in `.deep-dive/` under the target directory: 1. **`.deep-dive/state.json`** -- phase tracking (auto-created by the command) 2. **`.deep-dive/<phase-number>-<name>.md`** -- per-phase output documents The legacy standalone flow using `analysis_progress.json` and `DEEP_DIVE_PLAN.md` at project root is no longer the primary path -- prefer invoking `/deep-dive-analysis <target>`. ## CRITICAL PRINCIPLE: ABSOLUTE SOURCE OF TRUTH > **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.** ### Mandatory Rules (VIOLATION = FAILURE) 1. **NEVER** document anything without reading the actual source code first 2. **NEVER** assume any existing documentation, comment, or docstring is accurate 3. **NEVER** write documentation based on memory, inference, or "what should be" 4. **ALWAYS** derive truth EXCLUSIVELY from reading and tracing actual code 5. **ALWAYS** provide source file + qualified symbol name for every technical claim 6. **ALWAYS** verify state machines, enums, constants against actual definitions 7. **TREAT** all pre-existing docs as unverified claims requiring validation 8. **MARK** any unverifiable statement as `[UNVERIFIED - REQUIRES CODE CHECK]` 9. **USE** qualified symbol names in markers (`file.py::Class.method`), never line numbers -- line numbers break on any edit See `references/analysis-templates.md` for the full verification trust model, temporal purity principle, and documentation status markers. ## Output Usage Guide 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 | ## Forbidden Files 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. ## Available Commands ### 1. Analyze Single File ```bash # Python python .claude/skills/deep-dive-analysis/scripts/analyze_file.py \ --file src/utils/circuit_breaker.py \ --output-format markdown # Java python .claude/skills/deep-dive-analysis/scripts/analyze_file.py \ --file src/main/java/com/example/UserService.java # TypeScript python .claude/skills/deep-dive-analysis/scripts/analyze_file.py \ --file src/services/auth.ts # SQL / PL-SQL python .claude/skills/deep-dive-analysis/scripts/analyze_file.py \ --file migrations/0042_users.sql python .claude/skills/deep-dive-analysis/scripts/analyze_file.py \ --file packages/user_pkg.pkb ``` **Parameters:** - `--file` / `-f`: Relative path to file - **REQUIRED**. Any supported extension (see Language Support table). - `--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: false ### 2. Check Progress ```bash python .claude/skills/deep-dive-analysis/scripts/check_progress.py \ --phase 1 --status pending ``` ### 3. Find Usages ```bash python .claude/skills/d
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.