repository-writeback
What it does
This skill guides changes to the semantic layer of a dbt project through a pull request. It is for analytics engineers who want the agent to update field descriptions, metric notes and hints for their dbt models.
When to use it
- ✓When you want to update field descriptions in a dbt project through a pull request.
- ✓When you want to add AI hints that tell an agent which field to use for a question.
- ✓When a merged pull request needs follow-up on the content that depends on it.
Skill link
https://github.com/lightdash/lightdash/blob/main/packages/backend/src/ee/services/ai/skills/builtInSkills/repository-writeback/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Update the descriptions of the revenue metrics in the orders model, and open a pull request with the change.”
5 new skills a week. 1 minute to read.
How it works
The skill tells the agent to read the target files first, confirm the change is needed and then open the pull request with the exact file named. It explains the difference between a field's description and its AI hint, and how to keep each one in the right place.
Technical content (original SKILL.md)
Original text by the author, straight from 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:
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
FAQ
What is the difference between a description and an AI hint?
A description says what a field is, while an AI hint tells an agent when to choose that field.
Will it open a pull request without asking?
If your request already asks for the change, it opens the pull request; otherwise it offers the change and waits for a yes.
Does it check the change first?
Yes, it reads the files first and says so if the code already does what was asked.
Details
Original description by the author
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
Popularity
- GitHub stars
- 6.2k
- Ranking position
- #14400
- License
- —
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
breakup-pr
6.2kHelps your agent split a large pull request into smaller, stacked slices that can be reviewed and merged one at a time.
lightdash-agent-slack-messaging
6.2kHelps your agent write clear, friendly maintenance and activity reports for Lightdash administrators, based only on the evidence it has.
developing-in-lightdash
6.2kHelps your agent read, create and edit Lightdash dashboards and charts as JSON, including each chart type's settings.
filter-expressions
6.2kHelps your agent write correct filter expressions for Lightdash metric queries, including filters on custom metrics.
Similar skills
discrawl
394kLets your agent search and summarize a saved local archive of Discord messages, check how fresh it is, and read direct messages.
clickhouse-io
280kHelps your agent optimize queries and schemas in ClickHouse databases. It applies best practices for high-performance analytical workloads. Use when analytical queries are too slow.
scientific-db-pubmed-database
280kHelps your agent search for scientific articles in the biomedical field. It's useful for research needing specific medical information.