No slash command · from code-search
Routes code investigations into four modes (bug, test gap, architecture, implementation) and runs the corresponding query sequence. Use when asked to trace, debug, or analyze code structure.
Ships in code-search. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
One investigation, one mode. Pick the mode from the request, announce it, then run that
mode's sequence. The retrieval mechanics live in the code-search:search skill; this skill is
about which questions to ask and in what order.
| Mode | Trigger keywords | Question sequence |
|---|---|---|
| Bug | debug, error, broken, failing, crash | full context → inbound → outbound → transitive impact |
| Test gap | test, coverage, edge case, mock | inbound filtered to test files → gap detection |
| Architecture | architecture, design, structure, layer | structural map → centrality → dependency closure |
| Implementation (default) | how does, implementation, data flow | locate → inbound → outbound → full context |
Collision order: Bug > Test > Architecture > Implementation. No keyword matches → Implementation.
Announce the routing before executing it — print the query, the chosen mode, and the one-line reason. A wrong route is then correctable in one turn instead of after the investigation is spent.
scope instead.BLOCKED: when none was set), and let the
dispatching orchestrator ask.Use when: "what is the architecture", "how are the layers structured", "find the design patterns", "map the system".
The highest-centrality symbols are the architecture. Start there, and skip the leaves.
Find the layers by running the same structural query against three vocabulary families and reading the file distribution of the results:
code_search(query: "controller handler endpoint route") # presentation
code_search(query: "service business logic domain") # business
code_search(query: "repository persistence database query") # data
Boundaries and wiring show up under interface contract abstract, inject provider module
and config bootstrap initialize.
Find the patterns the same way — the pattern names are in the source:
code_search(query: "factory create builder")
code_search(query: "interface abstract contract")
code_search(query: "event emit subscribe")
code_search(query: "repository persist unit of work")
Then take the closure. Direct callers are one level; the blast radius of an architectural change is the transitive closure, grouped by depth.
find_dependents(symbol: "PaymentService")
impact(symbol: "PaymentService", max_depth: 3)
Report: detected pattern, core abstractions with their centrality tier and file:line, the layer diagram, the major flows, and the health indicators.
Architecture knowledge is expensive to re-derive and cheap to record. Write it down once
derived — as bullet summaries plus file:line pointers, never pasted code. Code goes
stale on the next edit; pointers survive it.
Use when: "how does X work", "trace the data flow", "where is X defined".
Edge kind matters as much as edge existence: call, import, extends and implements
have different blast radii. Say which kind an edge is when it changes the conclusion.
Direct callers are one level. impact is the transitive closure. Refactoring decisions
need the closure; a direct-caller count under-states the work every time.
Before editing: confirm the symbol resolves, confirm its current signature, think, then edit. Never grep → read → edit. Index-derived signatures are captured at index time and can lag the file — when the name is overloaded or generic, read the declaration at the returned span rather than trusting the summary.
Report: primary location with file:line, inbound edges, outbound edges, and the
end-to-end flow.
Use when: "what is tested", "find the coverage gaps", "audit test quality", "missing tests", "edge cases".
Tests appear in the graph as callers of the code they test. Zero test callers on code that has production callers is the high-priority case.
Take the inbound edges of each critical symbol.
Classify each caller as test or production by path, using one pattern set:
*.test.* *.spec.* __tests__/ tests/
*_test.go *_test.py test_*.py src/test/java/ *_test.rs
Report both counts. Production callers > 0 and test callers = 0 is the finding worth escalating; low-centrality untested code is not a gap worth reporting.
The convention is incomplete, and the verdict must say so. Filename matching misses
integration tests in non-standard locations, inline test modules (Rust #[cfg(test)]),
end-to-end suites that reach the code indirectly, and any language whose convention is not
in the list above. A "0 test callers" result from filename matching alone is a hypothesis,
not a coverage verdict.
Two methods will disagree, and that is information. Mock registration (vi.mock,
jest.mock) and generated cases (describe.each) are call sites that AST edges miss but a
reference-level lookup finds. When the two counts differ, report both rather than picking
one.
Report: framework, test file count, a per-function table of test callers, then the high-priority list (production callers, no test callers) and the medium list (few test callers, no error scenarios).
Use when: "why is X broken", "find the bug source", "root cause analysis", "trace this error".
Trace backwards through callers to find the cause; trace forwards through callees to find the effect. The full chain is the root-cause picture.
Check the type boundary explicitly. Mismatches between a symbol's actual signature and what its callers assume are a leading cause of runtime errors, and they are invisible in a call graph that only records that an edge exists. Read the declaration and read one caller.
Error origin hunting: map the error vocabulary (throw error exception), locate the
error type, then take its inbound edges — whoever constructs it is where the condition is
detected.
State mutation tracking: locate the mutator (set state update mutate), then enumerate
who calls it.
Report: symptom → the backwards call chain → root cause with file:line → the evidence
that establishes it → the count of affected locations. Every step carries its evidence; a
root cause asserted without a chain is a guess.
Zero inbound edges has three readings, and they are not interchangeable:
Never collapse the three. Report which one you concluded and the evidence for it.
This skill does not authorise deletion. A dead-code verdict needs all three of: zero inbound edges, low centrality, and not exported — an export is a public contract whose consumers may be outside this tree. Even with all three, the finding is labelled requires manual review until a human has checked it against the dynamic-dispatch list above.
High centrality with zero callers means something broke recently — a deleted call site, a botched merge — and is an investigation, not a cleanup. Low centrality with zero callers is a cleanup candidate, which is a proposal, not a verdict.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub madappgang/magus --plugin code-search4 skills in this plugin
/deep-analysisAudits a codebase across seven dimensions, from architecture to code health, scoring each finding with evidence. Use for a full codebase review, tech-debt assessment, or post-incident analysis./searchFinds code by meaning, structure or exact text, then reads only the spans returned. Use when searching a codebase, locating a symbol, tracing callers, or about to open three or more files./setupSets up code-search in a project (search engine, index and settings) through its setup CLI, asking before every change. Use when code-search setup is incomplete, or the user asks to set up, reconfigure or upgrade code search.Other plugins' skills for the same job