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。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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
评论
- …
同一仓库的更多技能
breakup-pr
6.2k帮你的智能体把一个大型拉取请求拆分成较小的、可堆叠的切片,每次可以审阅并合并一个。
lightdash-agent-slack-messaging
6.2k帮你的智能体根据现有证据,为 Lightdash 管理员撰写简短、友好的维护与活动报告。
developing-in-lightdash
6.2k帮你的智能体以 JSON 形式读取、创建和编辑 Lightdash 仪表板与图表,包括每种图表类型的设置。
filter-expressions
6.2k帮你的智能体为 Lightdash 指标查询编写正确的筛选表达式,包括针对自定义指标的筛选。