计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
migrating-dbt-core-to-v2【效率与协作】Use when a user needs help triaging dbt-core to dbt v2 migration errors. Runs dbt-autofix first, then classifies remaining errors into actionable categories (auto-fixable, guided fixes, needs input, blocked).
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Help users understand which v2 migration errors they can fix themselves vs which are blocked on v2 updates. Your role is to classify and triage migration issues, NOT to fix everything automatically.
Key principle: Not all migration issues are fixable in your project. Some require v2 updates. Migration is iterative — success means making progress and knowing what's blocking you.
This skill is a strict procedure, not general guidance.
The assistant must follow this order:
dbt debugdbt-autofix, then review its changesHard rules:
dbt1065 package version compatibility warnings specifically (e.g. Package '<package_name>' requires dbt version [>=1.2.0, <2.0.0]) — ignore these. If autofix was run, it will have already upgraded packages that need upgrading. If dbt1065 warnings persist after autofix, no manual package updates are needed.The base command defaults to dbt compile, or a different command if the user specifies one (e.g. dbt build, dbt test --select tag:my_tag), or the contents of repro_command.txt if that file exists in the project root.
Normalize the static-analysis mode on whichever command you land on: if it does not already contain a --static-analysis flag, append --static-analysis strict. If it already specifies one explicitly (e.g. --static-analysis off or unsafe), leave it as-is — do not append a second, conflicting flag. This applies whether the command came from the user or from repro_command.txt; a file containing bare dbt compile still gets strict appended.
Plain dbt compile still performs full parsing, graph building, and config compilation, and surfaces real failures from those checks. But without strict mode, static analysis findings about column/schema existence are only reported as warnings, not build-blocking failures. A project can report zero errors under plain dbt compile while strict mode fails it on real column-existence problems. Always run with strict mode at least once before telling the user the project is v2-compatible.
Before doing anything else, ask the user if they'd like to verify their credentials work on v2.
Ask: "Would you like to start by running dbt debug to verify your credentials and connection work on v2? This catches environment issues early before we dig into migration errors."
Run:
dbt debug
What to check in the output:
dbt debug fails:profiles.yml and credentials before proceeding. Migration triage can't begin until the connection works.dbt debug checks may not be relevant to the migrationdbt debug succeeds:Confirm the environment is healthy and proceed to Step 1.
That's fine — proceed to Step 1. But if connection errors appear later during classification, circle back and suggest running dbt debug.
Before classifying any errors, ensure the user has run dbt-autofix on their project.
Prompt the user to run dbt-autofix (a first-party tool maintained by dbt Labs that automatically fixes common deprecation patterns):
uvx --from git+https://github.com/dbt-labs/dbt-autofix.git dbt-autofix deprecations
Important: Wait for autofix to complete before proceeding with classification.
Before analyzing any migration errors, you MUST understand what autofix changed:
Review the git diff (if project is in git):
git diff HEAD~1
Read autofix logs (if available):
Key things to look for:
meta:?Why this matters: Some migration errors may be CAUSED by autofix bugs or incorrect transformations. Understanding what autofix changed helps you:
Do not proceed with classification until you understand autofix's changes.
Use the 4-category framework to triage errors. For the full pattern catalog see the Error Patterns Reference. For detailed category definitions see Classification Categories.
Can fix automatically with HIGH confidence
warn_if='{{ "text" }}'analyses/ files (dbt0209, dbt0404, or other codes < 1000) — analyses are optional query files, not production models. The correct fix is to add {{ config(static_analysis='off') }} at the top of the analysis SQL file. Do not rewrite the SQL or remove content — just disable static analysis for that file.Can fix with user approval — show diffs first
config.require('meta').key to config.meta_require('key').meta_get() error (dbt1501) — dict.meta_get() to dict.get()FunctionResolutionFailed causes are not this pattern) — a common v2-strict-mode pattern. See Case-Sensitive Identifier Mismatches for the fix procedurestatic_analysis: offmeta:dbt1065 package compatibility warnings (e.g. Package '<package_name>' requires dbt version [>=1.2.0, <2.0.0]) are not errors — autofix handles package upgrades. If dbt1065 warnings persist after autofix, no manual action is needed.static_analysis: off for the model--models/-m, replace with --select/-sSELECT 1 or column listRequires user decision — multiple valid approaches
analyses/ queries — ask if analysis is actively usedRequires v2 updates — not directly fixable in user code.
When an error is Category D:
Category D signals:
WebFetch with URL https://api.github.com/search/issues?q=repo:dbt-labs/dbt-fusion+<error_code>+<keywords>&type=issues to find existing issues. Don't tell the user to search manually — do it yourself.panic!, internal error, RUST_BACKTRACEnot yet implemented: Adapter::methodBefore classifying UnresolvedIdentifier/FunctionResolutionFailed as Category D, complete warehouse verification first — the error message alone can't distinguish a real bug from a cache artifact.
When classifying errors, check in this order:
site:github.com/dbt-labs/dbt-fusion/issues <error_code> <keywords> — Category D if open issue with no workaroundInclude autofix context at the start of your analysis:
Autofix Review:
- Files changed by autofix: X files
- Key changes: [brief summary]
- Potential autofix issues: [if any detected]
Format your analysis clearly:
Analysis Complete - Found X errors
Category A (Auto-fixable - Safe): Y issues
Static analysis in 3 analyses/ — Can disable automatically
Quote nesting in config — Can fix automatically
Category B (Guided fixes - Need approval): Z issues
config.require('meta') API change (3 files) — I'll show exact diffs
Unused schema entries (2 files) — I'll show what to remove
Source name mismatches (1 file) — Needs alignment with YAML
Category C (Needs your input): W issues
Permission error in model orders — Hardcoded table name - is this a ref or source?
Failing analysis — Is this actively used or can we disable it?
Category D (Blocked - Not fixable in project): V issues
MiniJinja conformance gap — v2 fix needed (issue #1234)
Recording/replay error — Test framework issue, not a product bug
Recommendation: [What should happen next]
Before fixing anything, ensure you've reviewed autofix changes (see Step 1).
After classification:
Critical validation rule: After EVERY fix, re-run the repro command (see Repro Command Behavior) — NOT just dbt parse.
Handle cascading errors: Fixing one error often reveals another underneath. This is expected. Report new errors and classify them.
Same-node latent duplicates: static analysis reports only the FIRST error per node, even when a file has multiple instances of the exact same bug (e.g. two reserved-word columns quoted with the wrong case in the same SELECT). After fixing a reported error, re-scan the rest of that same file for the identical pattern before considering the node done — don't wait for a recompile to surface it one at a time.
Track progress:
Progress Update:
Errors resolved: 5
Static analysis in analyses (auto-fixed)
Config API x2 (guided fixes - you approved)
Pending your input: 2
Permission error in orders
Analysis file decision
Blocked on v2: 3
MiniJinja issue (#1234)
Framework error (test infrastructure)
Next: [What to do next]
dbt parse alone for validation: Use the repro command (see Repro Command Behavior)dbt debug first: If you see connection or credential errors during triage, suggest running dbt debug to verify the environmentdbt1065 package version compatibility warnings specifically (e.g. Package '<package_name>' requires dbt version [>=1.2.0, <2.0.0]) — ignore these. Autofix upgrades packages that need it; if dbt1065 warnings remain after autofix, no manual package updates are needed.