explore-code
Explore code structure, architecture, files, directories, and component relationships using the OpenTrace knowledge graph. Use this skill for ANY question about the codebase that the graph might answer — including browsing, searching, and understanding code organization. Triggers on: - Structure: "how does X work", "what calls X", "show me the architecture", "where is X defined" - Browsing: "what's in X", "show me X", "look at X", "list the files in X", "what directories are there" - Discovery: "find X", "what examples exist", "what services/classes/files are there" - Exploration: "walk me through X", "give me an overview", "help me understand X" - General: any question about repo structure, code organization, or component relationships
The user wants to explore or understand something about the codebase. Use the OpenTrace knowledge graph to answer their question.
Query
$ARGUMENTS
Instructions
Use the OpenTrace MCP tools to investigate. Follow this approach:
-
Orient — Call
get_statsto see what's indexed (node types and counts). This tells you what's available in the graph. -
Search — Use
search_graphto find nodes matching the user's query. UsenodeTypesto filter when appropriate:- Architecture questions → "Service,Repository"
- Code questions → "Class,Function,Module"
- File/directory browsing → "File,Directory"
- Data questions → "Database,DBTable"
- Infrastructure → "Deployment,Cluster,Namespace"
- Unsure → omit
nodeTypesto search everything
-
Inspect — Use
get_nodeon the best matches to see full details and neighbors. -
Trace — Use
traverse_graphto follow relationships:- "What calls X?" →
direction: incoming - "What does X depend on?" →
direction: outgoing - "What's in X?" →
direction: outgoing(CONTAINS relationships) - "How are X and Y connected?" → traverse from both and find common nodes
- "What calls X?" →
-
List — Use
list_nodeswhen the user wants to see all items of a type (e.g. all services, all files in a directory). -
Read source — If nodes have a
pathproperty and the user needs code details, useReadto show the source.
Response Guidelines
- Lead with a clear, concise answer before showing supporting details
- Show relationships as paths:
ServiceA --CALLS--> ServiceB --READS--> DatabaseC - Group related information (structure, dependencies, consumers)
- Offer to drill deeper if the graph reveals more to explore
- If the graph doesn't have the data, say so and fall back to
Glob/Grep/Read