code-crumbs
Use the codebase knowledge graph for structural code queries. Use to explore the codebase, understand the architecture, what functions exist, show me the structure, who calls this function, what does X call, trace the call chain, find callers of, show dependencies, impact analysis, dead code, unused functions, high fan-out, refactor candidates, code quality audit, graph query syntax, Cypher query examples, edge types, how to use search_graph.
- License 许可
- MIT
- 最近更新
- 2026-11-10
- Stars
- ★ 16
- Forks
- 9
01 前言 Front Matter
- name
- code-crumbs
- description
- Use the codebase knowledge graph for structural code queries. Use to explore the codebase, understand the architecture, what functions exist, show me the structure, who calls this function, what does X call, trace the call chain, find callers of, show dependencies, impact analysis, dead code, unused functions, high fan-out, refactor candidates, code quality audit, graph query syntax, Cypher query examples, edge types, how to use search_graph.
03 SKILL.md 正文
Crumbs — Knowledge Graph Tools
Graph tools return precise structural results in ~500 tokens vs ~80K for grep.
Quick Decision Matrix
| Question | Tool call |
|---|---|
| Who calls X? | trace_path(direction="inbound") |
| What does X call? | trace_path(direction="outbound") |
| Full call context | trace_path(direction="both") |
| Find by name pattern | search_graph(name_pattern="...") |
| Read exact source | get_code_snippet(qualified_name="...") |
| Dead code | search_graph(max_degree=0, exclude_entry_points=true) |
| Cross-service edges | query_graph with Cypher |
| Project structure | get_architecture |
| Text search | search_code(pattern="...") |
| File neighborhood | graph_star(center, max_depth) |
| Dependency path A→B | graph_path(from, to) |
All tools are prefixed code_crumbs_ (e.g. code_crumbs_search_graph).
Exploration Workflow
project_status— check if the project is indexedget_graph_schema— understand node/edge typessearch_graph(label="Function", name_pattern=".*Pattern.*")— find codeget_code_snippet(qualified_name="project.path.FuncName")— read source
Tracing Workflow
search_graph(name_pattern=".*FuncName.*")— discover exact nametrace_path(function_name="FuncName", direction="both", depth=3)— trace
Quality Analysis
- Dead code:
search_graph(max_degree=0, exclude_entry_points=true) - High fan-out:
search_graph(min_degree=10, relationship="CALLS"), inspect outbound trace - High fan-in:
search_graph(min_degree=10, relationship="CALLS"), inspect inbound trace
Topology
Whole-graph algorithms over the same code graph — reach for these when the question is about structure across many files rather than one symbol.
| Question | Tool call |
|---|---|
| What sits around this file? | graph_star(center, max_depth) |
| How does A depend on B? | graph_path(from, to) |
| Which files are hot / central? | graph_hotspots |
| Where are the dependency cycles? | graph_cycles |
| How big is each feature area? | graph_volumes |
| Where should I cut for a refactor? | graph_refactor |
| Graph-wide counters | graph_stats |
Drift over time is CLI-only: crumbs graph snapshot > baseline.json, later crumbs graph diff baseline.json.
Core Tools
project_status, list_projects, index, search_graph, search_code,
trace_path, query_graph, get_graph_schema, get_code_snippet, get_architecture,
graph_star, graph_path, graph_hotspots, graph_cycles, graph_volumes,
graph_refactor, graph_stats
Edge Types
CALLS, HTTP_CALLS, IMPORTS, DEFINES, DEFINES_METHOD, USAGE, FILE_CHANGES_WITH, CONTAINS_FILE, CONTAINS_FOLDER, WRITES, INHERITS, RAISES, SEMANTICALLY_RELATED, SIMILAR_TO
Cypher Examples (for query_graph)
MATCH (a)-[r:HTTP_CALLS]->(b) RETURN a.name, b.name, r.url_path, r.confidence LIMIT 20
MATCH (f:Function) WHERE f.name =~ '.*Handler.*' RETURN f.name, f.file_path LIMIT 50
MATCH (a)-[r:CALLS]->(b) WHERE a.name = 'main' RETURN b.name
Gotchas
search_graph(relationship="HTTP_CALLS")filters nodes by degree — usequery_graphwith Cypher to see actual edges.query_graphcan return huge rows — addLIMIT.trace_pathneeds exact-ish names — usesearch_graph(name_pattern=...)first.get_code_snippetreturns exact source in one call — prefer it over search-then-read.direction="outbound"misses cross-service callers — usedirection="both".- Results paginate — check
has_moreand useoffset.
Prose, not code
Crumbs also indexes markdown docs and past sessions — see the docs-crumbs skill.
Most relevant here: never grep/read a whole README/ROADMAP/PLAN to find a section, use
search_unified(target="documents") instead. Also search_sessions for past conversations
and context for anchored context packs.
04 同仓库更多 Skills
why
Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds. Discovers available MCPs and queries each evidence category (source control, issue tracker, long-form docs, real-time chat, infrastructure observability, error tracking, product analytics warehouse) in parallel, then returns a cited read on decisions and tradeoffs. Use how for runtime behavior.
unslop
Cut AI tells from any writing.
typescript-best-practices
TypeScript best practices. Use when reading or editing any .ts or .tsx file.
technical-writing
Layered technical-writing standard: Diátaxis structure, Google developer style sentences, STE instruction rules, Global English syntax. Use for /skill:technical-writing or when writing or reviewing docs, RFCs, readmes, PR descriptions, or commit messages.
teach
Explain a body of work plainly so a person actually understands it. Runs the `how` and `why` skills and weaves what they find into one clear explanation. Use for 'teach me this', 'help me really understand X', 'explain this change or subsystem to me'.
tdd
Use only when the user explicitly asks for TDD, a failing test, or a regression test, OR when the bug has an obvious cheap local test target. Skip when the test path is unclear, expensive, integration-heavy, or not requested.