‹ 首页

call-chain

@athola · 收录于 1 周前

Traces execution paths through the code graph with criticality scoring and Mermaid charts. Use when understanding how a function propagates through the system.

适合你,如果需要理清代码中函数如何传播并找出关键路径

/ 下载安装
call-chain.skill双击,或拖进 Claude 桌面版 / Cowork,即完成安装↓ .skill↓ .zip
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code~/.claude/skills/(项目级 .claude/skills/)
Codex CLI~/.codex/skills/
Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add athola/claude-night-market/call-chain
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- athola/claude-night-market/call-chain
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify athola/claude-night-market/call-chain
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
324GitHub stars
待重算上下文体积
镜像托管

怎么用

技能原文 SKILL.md作者撰写 · MIT · 0980a33

Call Chain Tracing

Trace execution flows through the codebase using the code knowledge graph.

Prerequisites

This skill requires the gauntlet plugin for graph data. Discover it:

GRAPH_QUERY=$(find ~/.claude/plugins -name "graph_query.py" -path "*/gauntlet/*" 2>/dev/null | head -1)

If gauntlet is not installed: Fall back to static analysis. Use grep to trace function calls and build a Mermaid diagram manually from import/call patterns. Skip graph-specific steps.

If installed but no graph.db: Tell the user to run /gauntlet-graph build.

Steps
  1. Accept target: Get a function name or entry point from the user (or trace all entry points).
  1. Run flow tracing (requires gauntlet): ```bash python3 "$GRAPH_QUERY" --action flows --depth 15 ```

To filter by entry point: ``bash python3 "$GRAPH_QUERY" --action flows --entry "main" ``

Fallback (no gauntlet): Trace calls with rg (or grep): ``bash # Prefer rg (ripgrep) for speed; fall back to grep if command -v rg &>/dev/null; then rg -n "function_name\(" --type py . | head -20 else grep -rn "function_name(" --include="*.py" . | head -20 fi `` Build the call tree manually from search results.

  1. Display as indented tree: ``` main() [criticality: 0.72] -> validate_input() -> parse_config() -> process_data() -> db.execute_query() -> cache.store() -> send_response() ```
  1. Generate Mermaid flowchart: ```mermaid flowchart LR main --> validate_input main --> process_data main --> send_response validate_input --> parse_config process_data --> db.execute_query process_data --> cache.store ```
  1. Show criticality breakdown:
  2. File spread: how many files the flow touches
  3. Security sensitivity: auth/crypto code in the path
  4. Test coverage gaps: untested nodes in the flow
Criticality Scoring

| Factor | Weight | Meaning | |--------|--------|---------| | File spread | 0.30 | Touches many files | | Security | 0.25 | Contains auth/crypto code | | External calls | 0.20 | Unresolved dependencies | | Test gap | 0.15 | Untested nodes in flow | | Depth | 0.10 | Deep call chains |

Exit Criteria
  • [ ] Indented call tree displayed for the target function with criticality scores in the form [criticality: N.NN]
  • [ ] Mermaid flowchart LR generated with edges representing each caller-to-callee relationship in the traced path
  • [ ] Criticality breakdown table shown covering: file spread, security sensitivity, external calls, test gap, and depth
  • [ ] If gauntlet is not installed, fallback to static rg/grep analysis is used and the absence of graph data is noted
  • [ ] If gauntlet is installed but graph.db is absent, user is told to run /gauntlet-graph build before the skill halts
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。