Community研究与数据分析github.com

duongphuhiep/dakubo-skills

从给定的符号或代码位置向上追溯完整的调用链,直到所有能到达它的入口点(HTTP 控制器、main 函数、页面组件、路由等)。适用于任何被 CodeGraph 索引的语言。在修改函数、方法或类之前进行影响范围分析。

dakubo-skills 是什么?

该技能利用 CodeGraph 索引,从指定的代码位置(符号名、文件路径或 `file:line` 引用)向上追溯完整的调用链,直到所有能够到达该位置的入口点,例如 HTTP 控制器、main 函数、页面组件或路由。它支持任何被 CodeGraph 索引的语言,包括 C#、Java、Kotlin、Go、TypeScript、JavaScript、Rust、C、C++、Vue、JSX、TSX、Terraform 和 Helm YAML 等。该技能内置了循环检测(标记为 `⟳ cycle`)、深度上限(6 跳,标记为 `⚠ depth cap`)以及入口节点自动识别(如路由、控制器、main 函数)。在修改函数、方法或类之前,开发者可以使用该技能进行影响范围分析,以评估更改的潜在影响,从而避免意外的破坏。该技能通过一个独立的 Bun 脚本实现,要求项目中已存在 `.codegraph/` 目录。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/duongphuhiep/dakubo-skills/tree/HEAD/package/skills/dakubo-find-call-chain

Installed? Explore more 研究与数据分析 skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

此技能需要 Bun。脚本使用 bun:sqlite。

从给定的代码位置向上追溯调用链,直到所有能到达它的入口点。

支持的语言:任何被 CodeGraph 索引的语言(C#、Java、Kotlin、Go、TypeScript、JavaScript、Rust、C、C++、Vue、JSX、TSX、Terraform、Helm YAML …)

输入:符号名、文件路径或 file:line 引用。示例:

  • FindToolNameCollisions
  • ToolsMappingExtensions.cs:145
  • src/services/auth.ts:89
  • CheckCertificate

要求:项目中必须已索引 CodeGraph(存在 .codegraph/ 目录)。如果缺少该目录,请告知用户先运行 codegraph init。


步骤

1. 运行脚本

脚本位于此技能基础目录下的 scripts/find-call-chain.ts。从项目文件夹运行它,因为它从当前文件夹查找 .codegraph/:

bun <技能基础目录>/scripts/find-call-chain.ts "<输入>"

将完整的输出原样展示给用户。

2. 多个符号匹配

如果脚本输出“Multiple symbols matched”,列出显示的候选符号,并要求用户使用他们想要的符号的 file:line 引用重新运行。

3. 未找到符号

如果脚本以“No symbol found”退出:

  • 尝试其他拼写或使用 file:line 引用
  • 确认 CodeGraph 是最新的:codegraph index

终端节点检测(内置于脚本中——无需 LLM 判断)

当满足以下条件时,脚本会停止遍历分支:

条件示例
kind = route(CodeGraph 原生)任何框架的路由节点
语言名称模式匹配*Controller (C#/Java)、*Activity (Kotlin)、main (Go/Rust/C)、*Page/*Route (TS/JS)
没有调用者调用图中的叶节点
深度上限(6 跳)在树中标记为 ⚠ depth cap
检测到循环在树中标记为 ⟳ cycle

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

duongphuhiep/dakubo-skills

Use when the user wants to respond to a code review remark by adding a clarifying comment to the source code — so the reviewer understands the reasoning and won't raise the same remark again. Triggers on "answer remark #N", "add comment to address reviewer concern", "document why we did X", or any request to resolve a review finding through in-code explanation rather than a code change.

duongphuhiep/dakubo-skills

Use when the user wants to reply to a code review remark on a GitHub pull request and resolve its thread. Triggers on "answer remark #N in the PR", "reply to the reviewer", or "resolve this review comment".

duongphuhiep/dakubo-skills

Use when the user wants to see unresolved PR comments, review remarks, or outstanding feedback on a pull request.

duongphuhiep/dakubo-skills

Consolidates multiple fragmented OpenSpec capability folders under openspec/specs/ into a single main feature spec, through a staged/approved workflow. Use this whenever the user says openspec/specs/ is cluttered, has too many similar or overlapping capability folders, asks to merge/consolidate/combine specs, wants to clean up specs split across several separate change archives (e.g. specs/user-show/, specs/user-detail/ that should really be one specs/user-management/), or asks to check/apply a pending merged spec under openspec/specs/.merged-specs/. Do NOT use this for a normal single /opsx:archive of one change — only for merging several already-archived, already-existing spec folders together.

相关技能