| name | codegraph-query-language |
| description | Reference skill for the codegraph query expression language. Use when constructing codegraph query commands to explore the graph, trace dependencies, find violations, or understand architecture structure. |
| origin | codegraph |
Codegraph Query Language Skill
Reference for writing codegraph query "<expression>" commands.
When to Use
- Exploring dependencies of a specific node
- Finding all callers/callees of a function
- Locating policy violations programmatically
- Identifying cross-layer edges
- Building custom architecture reports
Core Query Patterns
Dependency Traversal
codegraph query "callees(services/user_service.py::UserService::create_user)"
codegraph query "callers(codegraph/index.py::build_index)"
codegraph query "transitive_callees(codegraph/cli.py::main)"
codegraph path codegraph/extractor.py codegraph/graph_build.py
Subsystem Queries
codegraph query "SELECT nodes IN subsystem(payment)"
codegraph query "SELECT subsystem WHERE root=services/payment_service.py"
codegraph query "SELECT edges WHERE crosses_subsystem=true"
Violation Queries
codegraph query "SELECT nodes WHERE has_violation=true"
codegraph query "SELECT edges WHERE edge_type='frontend_to_backend'"
codegraph query "SELECT frontend_calls WHERE unmatched=true"
Node Filtering
codegraph query "SELECT nodes WHERE arch_layer='Service'"
codegraph query "SELECT nodes WHERE fan_out > 12"
codegraph query "SELECT nodes WHERE callers=0 AND callees=0"
codegraph query "SELECT nodes WHERE intent=null"
Cycle Detection
codegraph policy --cycles
codegraph query "SELECT cycles WHERE length > 1"
Node ID Format
relative/path/to/file.py::ClassName::method_name
relative/path/to/file.py::ClassName (class-level)
relative/path/to/file.py (module-level)
Examples:
codegraph/index.py::build_index
codegraph/extractor.py::Extractor::extract
sample_project/services/user_service.py::UserService::create_user
Workflow Graph Queries
codegraph workflow --trace --level function
codegraph workflow --archi
codegraph workflow --include-imports
Semantic Graph Queries (Graph2)
codegraph semantic show codegraph/extractor.py::Extractor --json
codegraph semantic summary --json
codegraph semantic check --json
Explain a Node
codegraph explain codegraph/analyzer.py::Analyzer
codegraph explain codegraph/analyzer.py::Analyzer --json
Useful Composition Patterns
Find all nodes touched by a change
codegraph path <changed_module> <target_module>
codegraph query "transitive_callees(<changed_module>)"
Check before deleting a function
codegraph query "callers(<node_id>)"
Trace a failing API route
codegraph query "callers(backend/api.py::get_orders)"
codegraph query "callees(backend/api.py::get_orders)"