跳到正文
Skillpedia
数据库6.2k · #14400

repository-writeback

它能做什么

这项技能指导通过拉取请求修改 dbt 项目的语义层。适合希望智能体更新其 dbt 模型的字段说明、指标备注和提示的分析工程师。

适用场景

  • ✓当你想通过拉取请求更新 dbt 项目中的字段说明时。
  • ✓当你想添加 AI 提示,告诉智能体某个问题应使用哪个字段时。
  • ✓当已合并的拉取请求需要跟进依赖于它的内容的时候。

技能链接

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

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

使用方法

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

可直接粘贴的消息

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

可以这样问 AI

“请更新订单模型中营收指标的说明,并提交一个包含该改动的拉取请求。”

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

工作原理

这项技能要求智能体先阅读目标文件,确认确实需要改动,然后用明确指定的文件提交拉取请求。它会解释字段说明与 AI 提示的区别,以及如何让两者各得其所。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Repository writeback

editDbtProject changes this project's semantic layer through a pull request; its description and parameters cover the call and the prompt. This skill covers what to change and what follows.

Ask or act. When the user's request already asks for the change ("fix it", "open a PR", "clean these up", "update the descriptions"), call editDbtProject without asking again. When you suggest a fix the user did not ask for, offer it, naming the fields involved, and wait for a yes. When it is unclear whether a request should land in the repository at all, ask one short question.

Read first. Before editDbtProject, read the files you intend to change with exploreRepo: confirm the change is needed (when the code already does what was asked, say so instead of opening an empty pull request), name the exact target file in the prompt, and match the surrounding conventions.

Descriptions and AI hints. A field carries two metadata channels:

  • description defines what the field is (its grain, its source, what it measures), and people read it in the catalog and the UI.
  • ai_hint (model- and field-level) tells the agent when to choose this field over a similar one: routing directives ("use this metric for X; combine with Y to break down by Z"), join recipes, and caveats such as "not suitable for X, use other_model".

Put agent steering in ai_hint and keep description edits to the field's own definition: steering in a description pollutes the human-facing semantic layer and fits it to one question. Disambiguate two legitimately similar fields that cannot be merged with an ai_hint on each.

Impact of removals and renames. When a change removes or renames a field, call analyzeFieldImpact right after editDbtProject starts, for each field id that goes away (the old id for a rename), and add a few lines to your reply: whether it breaks content, the totals (charts, dashboards, dependent metrics, scheduled deliveries) and the most notable items, or that nothing references the field. The check is advisory: the pull request stands whatever it returns. Skip it for additions and for description- or SQL-only edits.

Value correctness. The impact check shows what would break, not whether the numbers survive. When a change claims to preserve values (merging duplicate metrics, replacing or repointing a field, splitting a metric into parts that should sum back to it, refactoring a field's SQL), prove the claim before calling the change safe, with the cheapest sufficient method:

  • By construction: read the field definitions and the model SQL (with exploreRepo when the metadata is not enough). The same aggregation over the same rows, a uniqueness or non-null guarantee (a row_number() = 1 dedup, a primary key) or a split whose parts partition the original is enough; state the guarantee in plain terms.
  • By data: when the SQL cannot guarantee it (unions, multi-stream models, nullable join keys, differing filters or grains), query the fields at a total grain and across a time dimension and check the expected relationship on every row: equality for a replacement or dedup, parts summing to the original for a split.

Settle it before calling editDbtProject when you can, otherwise in the same turn, and report it with the impact. When the numbers diverge, name the rows or periods that differ and rework the change or ask the user how to proceed rather than calling it safe. Skip this for additions and description- or label-only edits.

Splitting work into pull requests. Group edits that belong together (several description fixes on one model, the changes that add one metric) in one pull request, and split unrelated changes with startNewPullRequest so each can be reviewed and merged alone; when unsure, prefer a new pull request, since a spare one is easy to close and mixed changes are not easy to separate. When the split is obvious, make it and tell the user what went where. When a broad request ("improve the semantic layer") could reasonably be one pull request or several, lay out the groupings and ask before opening any.

listWorkstreams shows the pull requests this thread opened, getPullRequestDiff what one contains, and closePullRequest discards one the user asks to drop, for example after you fold its change into the one you continue with prUrl.

After a merge. Merging from the pull request card in the thread recompiles the project and sends you a follow-up turn that p

常见问题

说明和 AI 提示有什么区别?

说明描述字段是什么,而 AI 提示告诉智能体何时应选择该字段。

它会不经询问就提交拉取请求吗?

如果你的请求已经要求进行改动,它会提交拉取请求;否则它会提出改动并等待你同意。

它会先检查改动吗?

会。它会先阅读文件,如果代码已经符合要求,它会说明这一点。

详情

作者的原始描述

Workflow for semantic-layer pull requests (`editDbtProject`), covering when to ask first, descriptions versus AI hints, impact and value checks, splitting work into pull requests, and the content migration after a merge. Load it before changing the dbt project and when a merged pull request needs follow-up.

repo: lightdash/lightdash

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能