From cocosearch
Guides dependency graph exploration using CocoSearch for impact analysis, connection tracing, and hub identification.
How this skill is triggered — by the user, by Claude, or both
Slash command
/cocosearch:cocosearch-depsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A guided workflow for understanding how files connect through dependencies. Use this skill when the goal is specifically about dependency relationships — impact analysis, connection tracing, or hub identification.
A guided workflow for understanding how files connect through dependencies. Use this skill when the goal is specifically about dependency relationships — impact analysis, connection tracing, or hub identification.
When to use this skill vs. others:
| Goal | Skill |
|---|---|
| "What breaks if I change X?" | cocosearch-deps (this skill) |
| "How does X work?" | cocosearch-explore |
| "I need to safely refactor X" | cocosearch-refactoring (uses deps as part of impact analysis) |
| "Trace this bug through call chains" | cocosearch-debugging (uses deps for call tracing) |
| "What are the most connected files?" | cocosearch-deps (this skill) |
| "How are X and Y connected?" | cocosearch-deps (this skill) |
cocosearch.yaml for indexName field -- if found, use itlist_indexes() and match the current project's directory name against available indexes. The MCP tools auto-derive index names from directory paths (e.g., my-project/ -> my_project), so a match is likely if the repo was indexed without a config file.cocosearch.yaml is missing.list_indexes() to confirm project is indexedget_file_dependencies on any known file:get_file_dependencies(file="<any-known-file>", depth=1)
index_codebase with deps extraction or cocosearch deps extract . via CLI."
Do NOT proceed without dependency data -- this skill relies entirely on it.warnings with type deps_outdated or deps_branch_drift:
Warn: "Dependency data is outdated and may not reflect recent changes. Want me to re-extract dependencies first? (index_codebase with extract_deps=True)"
Do NOT proceed without user acknowledgment -- stale deps can lead to incorrect analysis.cocosearch.yaml has linkedIndexes):
warnings array from index_stats() for entries starting with "Linked index"Parse the user's request to determine the exploration mode:
| User says... | Mode | Primary tool |
|---|---|---|
| "What breaks if I change X?" / "Impact of modifying X" | Impact Analysis | get_file_impact |
| "What does X depend on?" / "X's dependencies" | Dependency Exploration | get_file_dependencies |
| "How are X and Y connected?" / "Path between X and Y" | Connection Tracing | Both tools |
| "Most connected files" / "Hub files" / "Critical files" | Hub Identification | Both tools, multiple files |
| "Show only imports" / "What references X?" | Type Filtering | Either tool with dep_type |
If ambiguous: Ask the user which mode they want. Present the five options.
Confirm with user: "I'll run [mode] on <file>. Proceed?"
Goal: Answer "what would be affected if this file changes?"
Run the impact query:
get_file_impact(file="<target_file>", depth=3)
Format results as a tree:
<target_file>
<- <direct_dependent_1> (import)
<- <transitive_dependent_A> (import)
<- <direct_dependent_2> (reference)
<- <direct_dependent_3> (import)
<- <transitive_dependent_B> (import)
<- <transitive_dependent_C> (import)
Assess risk level:
| Dependents | Risk | Recommendation |
|---|---|---|
| 0 | None | File is a leaf -- change freely |
| 1-5 | Low | Review each dependent before changing |
| 6-15 | Medium | Consider incremental changes; check test coverage |
| 16+ | High | High-impact hub -- coordinate changes carefully |
Present summary:
"Changing <target_file> directly affects N files and transitively affects M more. Risk level: [LOW/MEDIUM/HIGH]."
Checkpoint: Offer follow-up actions:
Goal: Answer "what does this file depend on?"
Start shallow:
get_file_dependencies(file="<target_file>", depth=1)
Separate internal vs. external dependencies:
Internal dependencies (within project):
- src/module_a/utils.py (import)
- src/module_b/models.py (import)
External/unresolved:
- os (import, stdlib)
- requests (import, third-party)
Present summary:
"<target_file> depends on N internal files and M external modules."
Checkpoint: Offer follow-up actions:
If user wants transitive tree:
get_file_dependencies(file="<target_file>", depth=3)
Format as indented tree showing the full dependency chain.
Goal: Answer "how are X and Y connected?"
Multi-call orchestration:
get_file_dependencies(file="<file_X>", depth=3)
get_file_impact(file="<file_Y>", depth=3)
If structural path found: "Files X and Y are connected through: X -> A -> B -> Y (via import chains)."
Show the full path with edge types.
If no structural path: "No direct dependency path found between X and Y."
Offer fallback:
search_code(
query="<concept connecting X and Y>",
use_hybrid_search=True,
smart_context=True,
include_deps=True
)
Cross-project search: If
linkedIndexesis configured incocosearch.yaml, searches automatically expand to linked indexes. For cross-project connections, passindex_names=["project1", "project2"].
Query rewrite: If the optional query-rewrite controller is enabled, pass
rewrite_query=Falsewhen searching precise terms (exact identifiers,symbol_name/symbol_typefilters) so they are matched verbatim. No effect when the controller is disabled.
Goal: Find the most connected files in the project.
Strategy: Probe candidate files with both forward and reverse queries, then rank by total connections.
Step 1: Identify candidates. Good candidates include:
__init__.py, index.ts, mod.rs)Ask the user: "Which files should I check, or want me to probe common entry points and init files?"
Step 2: For each candidate, run both queries at depth=1:
get_file_dependencies(file="<candidate>", depth=1)
get_file_impact(file="<candidate>", depth=1)
Step 3: Present ranked table:
| File | Depends On | Depended By | Total | Role |
|------|-----------|-------------|-------|------|
| src/core/models.py | 2 | 18 | 20 | Data hub (heavily imported) |
| src/cli.py | 12 | 1 | 13 | Orchestrator (imports many) |
| src/utils/helpers.py | 1 | 9 | 10 | Utility hub |
Interpret roles:
Checkpoint: "Want me to run full impact analysis on any of these hubs?"
Goal: Filter dependencies by edge type for focused analysis.
Edge types in CocoSearch:
| Type | Meaning | Example |
|---|---|---|
import | Code imports (Python import, JS require/import, Go import) | from utils import helper |
call | Symbol-level calls | helper.process() |
reference | Grammar-level references (metadata.kind for specifics) | Helm chart_member, subchart_of |
Run filtered query:
get_file_dependencies(file="<target_file>", depth=2, dep_type="import")
or
get_file_impact(file="<target_file>", depth=2, dep_type="import")
Compare by type: Run the same query with different dep_type values and present side-by-side:
Import dependencies:
- module_a.py, module_b.py
Reference dependencies:
- config.yaml (chart_member)
- parent/Chart.yaml (subchart_of)
After completing any mode, offer these follow-ups:
search_code with include_deps=True?"search_code(
query="<relevant concept>",
use_hybrid_search=True,
smart_context=True,
include_deps=True
)
--deps flag or deps extract command.For common search tips (hybrid search, smart_context, symbol filtering), see skills/README.md.
For installation instructions, see skills/README.md.
npx claudepluginhub violetcranberry/coco-search --plugin cocosearchAST-aware code search, symbol navigation, and dependency graph analysis via the gcode CLI. Essential for exploring codebases, finding functions/classes, understanding call graphs, and checking blast radius before changes.
Explores codebases using SocratiCode semantic search, dependency graphs, and tools like codebase_search for understanding architecture, finding functions/types, analyzing dependencies, and searching schemas/specs.
Queries codebase knowledge graphs to search functions, trace callers/callees, list file entities, analyze impact, and run SurrealQL. Use for code structure, dependencies, and relationships.