repository-writeback
Skill này làm gì
Skill này hướng dẫn thay đổi semantic layer của một dự án dbt thông qua pull request. Skill dành cho kỹ sư analytics muốn agent cập nhật mô tả trường, ghi chú chỉ số và gợi ý AI cho các mô hình dbt.
Khi nào nên dùng
- ✓Khi bạn muốn cập nhật mô tả trường trong một dự án dbt qua pull request.
- ✓Khi bạn muốn thêm gợi ý AI để cho agent biết nên dùng trường nào cho một câu hỏi.
- ✓Khi một pull request đã gộp cần theo dõi thêm nội dung phụ thuộc vào nó.
Liên kết skill
https://github.com/lightdash/lightdash/blob/main/packages/backend/src/ee/services/ai/skills/builtInSkills/repository-writeback/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Cập nhật mô tả các chỉ số doanh thu trong mô hình orders, rồi mở một pull request chứa thay đổi này.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill yêu cầu agent đọc các file đích trước, xác nhận thay đổi là cần thiết, rồi mở pull request với đúng file đã nêu. Skill giải thích sự khác nhau giữa mô tả của trường và gợi ý AI, và cách giữ mỗi thứ ở đúng chỗ.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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:
descriptiondefines 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, useother_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
exploreRepowhen the metadata is not enough). The same aggregation over the same rows, a uniqueness or non-null guarantee (arow_number() = 1dedup, 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
Câu hỏi thường gặp
Mô tả khác gợi ý AI ở điểm nào?
Mô tả cho biết trường là gì, còn gợi ý AI cho agent biết khi nào nên chọn trường đó.
Skill có mở pull request mà không hỏi không?
Nếu yêu cầu của bạn đã nêu rõ thay đổi, skill sẽ mở pull request; nếu không, skill đề xuất thay đổi và chờ bạn đồng ý.
Skill có kiểm tra thay đổi trước không?
Có. Skill đọc các file trước và nói rõ nếu code đã làm đúng như yêu cầu.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 6.2k
- Vị trí xếp hạng
- #14400
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
breakup-pr
6.2kGiúp agent của bạn tách một pull request lớn thành các phần nhỏ, xếp chồng lên nhau, để có thể xem xét và gộp từng phần một.
lightdash-agent-slack-messaging
6.2kGiúp agent của bạn viết báo cáo bảo trì và hoạt động cho quản trị viên Lightdash rõ ràng, thân thiện, chỉ dựa trên bằng chứng có sẵn.
developing-in-lightdash
6.2kGiúp agent của bạn đọc, tạo và chỉnh sửa dashboard và biểu đồ Lightdash dưới dạng JSON, kèm cài đặt của từng loại biểu đồ.
filter-expressions
6.2kGiúp agent của bạn viết biểu thức lọc đúng cho truy vấn số liệu Lightdash, kể cả lọc trên các chỉ số tùy chỉnh.
Skill tương tự
discrawl
394kCho phép agent của bạn tìm kiếm và tóm tắt kho lưu trữ tin nhắn Discord trên máy, kiểm tra độ mới của dữ liệu và đọc tin nhắn trực tiếp.
clickhouse-io
280kGiúp agent của bạn tối ưu truy vấn và schema trong ClickHouse theo thực hành tốt nhất cho phân tích dữ liệu hiệu năng cao khi truy vấn chậm.
scientific-db-pubmed-database
280kGiúp agent của bạn tìm bài báo khoa học trong lĩnh vực y sinh. Hữu ích cho nghiên cứu cần thông tin y khoa cụ thể.