跳到正文
Skillpedia
通用编程6.2k · #14399

reading-source-code

它能做什么

这项技能指导智能体阅读一个或多个代码仓库中的代码,并用通俗的语言报告它的发现。适合询问代码库问题、并希望得到清楚答案的人。

适用场景

  • ✓当你提出的问题需要从仓库代码中找到答案时。
  • ✓当搜索会涉及许多仓库,而你想选择要阅读哪些时。
  • ✓当代码搜索没有找到任何结果,而你希望智能体在说没有之前先尝试其他方法的时候。

技能链接

https://github.com/lightdash/lightdash/blob/main/packages/backend/src/ee/services/ai/skills/builtInSkills/reading-source-code/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/lightdash/lightdash/blob/main/packages/backend/src/ee/services/ai/skills/builtInSkills/reading-source-code/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请找出我们仓库中所有使用 OrderStatus 类型的地方,并用通俗的话告诉我每一处的作用。”

每周 5 个新技能,1 分钟读完。

工作原理

当搜索会涉及许多仓库时,这项技能会让你先选择重点关注的仓库。然后它阅读代码,在遇到小错误时重试,并报告发现,而不描述它的搜索步骤。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Reading source code (exploreRepo and discoverRepos)

The exploreRepo description covers the mounts, the commands and the search locator. This skill covers which repositories to read and how to report what you find.

Ask before scanning many repositories. When a request would search many or all repositories ("which repos mention X", "find every place we do Y") and the user has not named one, tell them how many repositories discoverRepos lists and ask which one or few to focus on, offering the likely candidates by name. Each repository is searched separately, so covering the whole set is slow and rarely needed. Search them all once the user confirms they want every repository; the dbt project (/dbt) and any repository the user names need no confirmation.

Report findings, not mechanism. Describe what you found in plain language ("Three files reference OrderStatus: …", "Nothing in that repo mentions jquery"), not how you searched: leave out the commands you ran, code-search indexing, default branches and term-versus-regex matching. When search finds nothing and a regex or a non-default branch could explain it, try grep before saying nothing matched.

Recover from errors yourself. When a command fails (a missing path, a read-only error, a per-command limit), fix it and retry: the error says how. Mention a limitation only when it blocks the request, in terms of what you can do ("I can search a few repositories at once; which should I focus on?"). Show raw commands, output or errors only when the user asks for them.

常见问题

它会一次搜索所有仓库吗?

不会。当可能要搜索很多仓库时,它会先问你重点关注哪些。

答案是什么样的?

它会用通俗的语言描述发现了什么,而不是描述所用的搜索步骤。

出现错误后会怎样?

技能会自行修复小错误,并在提及限制之前先重试。

详情

作者的原始描述

Workflow for reading repository code with `exploreRepo` and `discoverRepos`, covering when to ask which repositories to search and how to report findings and errors. Load it before answering from repository code.

repo: lightdash/lightdash

热度

GitHub 星标
6.2k
排名
#14399
许可证
—
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能