From code-analysis
Comprehensive source code analysis on top of GitNexus knowledge graph. Phase 1 (structure, declarations) → Phase 2 (implementation quality, per subsystem) → Phase 3 (deterministic flow + dead code via GitNexus) → Phase 4 (usage docs, optional). Supports glob and natural-language scope. Hard-requires GitNexus MCP and language-pack static tools. Use when the user wants to analyze code quality, understand project structure, or get a full codebase audit.
How this skill is triggered — by the user, by Claude, or both
Slash command
/code-analysis:analyze [glob pattern, default **/*][glob pattern, default **/*]sonnetThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Launches the phased code-analysis pipeline on top of the GitNexus knowledge graph.
Launches the phased code-analysis pipeline on top of the GitNexus knowledge graph.
/analyze # analyze the whole repo (scope=**/*)
/analyze src/**/*.ts # glob scope
/analyze **/*.h, **/*.cpp # multiple globs, comma-separated
/analyze authentication flow # natural-language scope → mcp__gitnexus__query
Before any analysis work, run these checks in this order. Abort with a single consolidated error if any fail.
gitnexus CLI: command -v gitnexus. If absent: "GitNexus is required. Install: npm i -g gitnexus".
GitNexus index for this repo: invoke MCP tool mcp__gitnexus__list_repos. If this repo not listed: "GitNexus has no index. Run: npx gitnexus analyze".
GitNexus index freshness: compare indexed lastCommit vs git rev-parse HEAD. If > 10 commits behind, prompt the user: "Index is N commits behind HEAD. Reindex now? [y/N]". Do not auto-run.
codeanalyzer CLI: command -v codeanalyzer.
Language detection: invoke code-analysis:detect-language for the scope → confirmed primary language.
Language pack load (required): load code-analysis-{lang}:strategy skill.
If not installed: "Language pack code-analysis-{lang} not installed." — abort.
Framework discovery (generic): Enumerate all installed skills matching code-analysis-*:strategy.
For each such strategy, read its framework_detection YAML block (absent for language packs).
A framework strategy matches if:
framework_detection.requires_language equals the confirmed language (or is absent), ANDframework_detection.min_signatures signatures match against the current repo state.Signature kinds:
file_exists: glob pattern — check via Glob or findsource_macro: list of macros — grep source files (use mcp__gitnexus__cypher for existence query: MATCH (n) WHERE n.source CONTAINS macro)source_include: list of include patterns — similar grep checkFor EVERY matching framework strategy, load its skill. Multiple frameworks can match simultaneously. If none match: no framework pack loaded — pure language analysis proceeds.
static_tools verification (aggregated): for each loaded strategy path, invoke:
codeanalyzer list-tools --strategy <path> --no-verify --json > /tmp/<strategy>.json
This emits every declared tool without exiting non-zero on missing ones.
Then locally check each tool.command's first token via shutil.which (or shell command -v):
missing_tools list with {strategy, phase, tool_name, binary} rows for every non-resolvable binary.If missing_tools is non-empty: emit ONE consolidated error block listing every missing item + its install hint (if declared), then abort. Do NOT retry per-issue.
If empty: proceed to Step 9.
Initialize phase-state via MCP: invoke mcp__codeanalyzer__initialize_phase_state with
{ language, framework: <first-matched-framework-or-null>, report_language }. If multiple
frameworks match, framework is a comma-joined string (e.g., "unreal,qt"); downstream
consumers should split on comma.
If the argument is a glob pattern (contains * or /) or empty, use directly (default **/*).
Otherwise treat it as natural language:
mcp__gitnexus__query with {query: "<arg>", limit: 50}..codeanalyzer/config.json under scope_files.On first invocation (no .codeanalyzer/config.json present):
[]), report language (ko/en, default ko)..codeanalyzer/config.json with these + current scope.After the gate passes, delegate to the structure-analyzer agent. Pass: resolved scope, strategy paths, GitNexus repo id.
All aborts emit a single block with every problem plus the specific install commands — no retry-per-issue loops.
npx claudepluginhub juyeongyi/jylee_claude_marketplace --plugin code-analysisGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.