|
| 1 | +--- |
| 2 | +name: dbt-parser-refresh |
| 3 | +description: Refreshes dbt artifact schemas from dbt-labs/dbt-core and regenerates Pydantic parser classes. Use when the user asks to update parsers, sync with upstream, download dbt schemas, or regenerate parser models. |
| 4 | +--- |
| 5 | + |
| 6 | +# dbt Parser Refresh |
| 7 | + |
| 8 | +## Trigger scenarios |
| 9 | + |
| 10 | +Activate this skill when the user says or implies: |
| 11 | + |
| 12 | +- Refresh parsers, update parsers, sync parsers |
| 13 | +- Update from dbt-core, sync with upstream dbt-core |
| 14 | +- Download dbt schemas, pull schemas from dbt-core |
| 15 | +- Regenerate parser classes, regenerate parser models, run codegen |
| 16 | + |
| 17 | +## Scripts and paths |
| 18 | + |
| 19 | +- Run all commands from the **repository root**. |
| 20 | +- **Download:** `bash dev/download_dbt_schemas.sh [--ref REF] [artifact_type] [version ...]` |
| 21 | +- **Generate:** `bash dev/generate_parser_classes.sh [artifact_type] [version ...]` |
| 22 | +- **Artifact types:** `catalog`, `manifest`, `run-results`, `sources` |
| 23 | +- **Versions:** e.g. `v1`, `v7`. Omit args to process all types and versions. |
| 24 | + |
| 25 | +## Order rule |
| 26 | + |
| 27 | +When doing both download and generate, **always run download first**, then generate. |
| 28 | + |
| 29 | +## Three modes |
| 30 | + |
| 31 | +### 1. Download + generate (default) |
| 32 | + |
| 33 | +When the user wants to refresh or update parsers (e.g. "refresh parsers", "update from dbt-core"): |
| 34 | + |
| 35 | +1. Run `bash dev/download_dbt_schemas.sh` with any user-specified `--ref`, artifact_type, or versions. |
| 36 | +2. Then run `bash dev/generate_parser_classes.sh` with the same artifact_type and versions (no `--ref`). |
| 37 | + |
| 38 | +If the user did not specify scope, use no arguments for both (download all, then generate all). |
| 39 | + |
| 40 | +### 2. Download only |
| 41 | + |
| 42 | +When the user only wants to fetch schemas (e.g. "download dbt schemas", "pull schemas from dbt-core"): |
| 43 | + |
| 44 | +- Run only `bash dev/download_dbt_schemas.sh` with optional `--ref` and artifact_type/version. |
| 45 | + |
| 46 | +### 3. Generate only |
| 47 | + |
| 48 | +When schemas are already present and the user only wants to regenerate code (e.g. "regenerate parsers", "run codegen"): |
| 49 | + |
| 50 | +- Run only `bash dev/generate_parser_classes.sh` with optional artifact_type/version. |
| 51 | + |
| 52 | +## Passing through user intent |
| 53 | + |
| 54 | +- **Ref:** If the user specifies a ref (e.g. `main` or a branch), pass `--ref REF` only to the download script. |
| 55 | +- **Scope:** If they specify an artifact or version (e.g. "just manifest v7"), use the same artifact_type and version(s) for both scripts when running both. |
| 56 | + |
| 57 | +## Example |
| 58 | + |
| 59 | +Full refresh (all types and versions): |
| 60 | + |
| 61 | +```bash |
| 62 | +bash dev/download_dbt_schemas.sh |
| 63 | +bash dev/generate_parser_classes.sh |
| 64 | +``` |
| 65 | + |
| 66 | +Refresh only manifest v7: |
| 67 | + |
| 68 | +```bash |
| 69 | +bash dev/download_dbt_schemas.sh manifest v7 |
| 70 | +bash dev/generate_parser_classes.sh manifest v7 |
| 71 | +``` |
0 commit comments