AGENT SKILL
代码库结构与依赖发现
codebase-discovery
在规划或修改代码之前,定位行为实现所在位置及其依赖关系。当存在本地知识图谱时使用它,否则回退到 explore/grep,并将过期判定规则集中在一处维护。与语言和框架无关。
- License 许可
- MIT
- 最近更新
- 2026-11-05
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- codebase-discovery
- license
- MIT
- metadata
- { "author": "shahboura", "version": "1.0.0", "audience": "developers", "workflow": "discovery" }
- description
- Find where behavior lives and what depends on it before planning or changing code. Uses a local knowledge graph when present, falls back to explore/grep, and keeps the staleness rule in one place. Language- and framework-agnostic.
- compatibility
- opencode
02 资源文件 1
- 参考文档agents/openai.yaml265 B
03 SKILL.md 正文
Codebase Discovery
What I do
- Locate the code path that owns a behavior, its callers, and reuse candidates.
- Choose the cheapest reliable method: graph query when available, else explore/grep/read.
When to use me
Structural questions only: "what calls X", "where is Y handled", "what depends on this", "is there already a Z", pre-change blast radius, cross-module planning.
Not for: edits where the path is already known and no structural question is
asked, benchmarks, a pure diff review, or post-change blast radius (use
code-change-impact).
Method
- Check
graphify-out/graph.json.- Exists and
graphify-usageis available: load it and usequery|path|explain. - Absent, the command is missing or fails, or the skill is unavailable: use
exploreif your agent may dispatch it, otherwisegrep/glob, thenreadto confirm.
- Exists and
- Staleness: refresh when the graph is older than the newest tracked code file
(
find . -newer graphify-out/graph.json -name '*.ts' -print -quit), whengit status --porcelainshows code edits, or after changing code. Portable mtime:node -p "Math.floor(require('fs').statSync('graphify-out/graph.json').mtimeMs/1000)". Without shell: do not claim freshness; say it may be stale and use the fallback. After doc edits rungraphify extract . --backend deepseekthengraphify cluster-only .. - Confirm: a graph hit is a location, not proof. Open the file before claiming behavior.
- Report locations as
path:line; separate "found" from "inferred". Stop when the call path is closed or two sources agree.
Related
code-change-impact— post-change blast radius.graphify-usage(host) — CLI contract and query syntax.
04 同仓库更多 Skills
Python 编程开发
python
暂无简介
★ 2
文档有效性校验
docs-validation
暂无简介
★ 2
Python 编程开发
python
暂无简介
★ 2
文档有效性校验
docs-validation
暂无简介
★ 2
Python 编程开发
python
暂无简介
★ 2
文档校验
docs-validation
暂无简介
★ 2