/orchestra:fix-pipeline-dbt-taskfrom orchestra
Fixes a failed dbt Core task in an Orchestra Pipeline by reproducing the issue, applying code/config fixes, validating on a branch, confirming, and merging. Works standalone or after identify-pipeline-error classification.
Ships in orchestra. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Fix → validate on a branch → confirm → merge. Narrate each step briefly, like a data engineer. Never print secrets/tokens.
MCP is preferred but optional. If the Orchestra MCP tools aren't present, use the public REST API directly with $ORCHESTRA_API_KEY (check the env — it's often already set). For git, $GITHUB_TOKEN is usually set too.
If neither MCP nor a key is available, point the user at the Orchestra MCP setup docs (https://docs.getorchestra.io/docs/mcp) or ask for an API key, then stop.
Base: https://app.getorchestra.io/api/engine/public — header Authorization: Bearer $ORCHESTRA_API_KEY.
identify-pipeline-error hands you: the pipeline run ID (RID), pipeline ID (PID), the failed dbt task run ID (TRID), integration=DBT_CORE, the run branch/commit, the task's taskParameters, and the cause classification (a dbt code/config issue). Use them directly — don't re-run the identification.
If invoked standalone (no handoff): run identify-pipeline-error first, or do its minimum yourself — GET /pipeline_runs/<RID> then GET /task_runs?pipeline_ids=<PID>&page_size=50&time_from=<now-7d>&time_to=<now> (filter to this RID client-side; the pipeline_run_ids filter does not work on /task_runs, defaults to the last 24 hours without the window) to find the FAILED dbt task.
Capture taskParameters exactly — especially branch, commands, project_dir, use_state_orchestration. These are run inputs you must preserve on retry. The pipeline run's branch is where the Orchestra YAML lives; the dbt clone branch is a separate task param (commonly an input like dbt_branch).
Pull the logs you'll fix against:
GET /pipeline_runs/<RID>/task_runs/<TRID>/logs # list filenames
GET /pipeline_runs/<RID>/task_runs/<TRID>/logs/download?filename=1/debug_task # URL-encode spaces, e.g. 1/dbt%20run
debug_task = dbt debug (config/YAML validation); dbt run / dbt build = compile + execution.
You were routed here because the cause is a dbt code/config issue, so fix it in the repo. If while reproducing you find the real cause is not a code fix — a data-quality / source-freshness failure (don't edit data), an infra/timeout, an Orchestra-pipeline misconfig, or an upstream ingestion problem — stop and hand back to identify-pipeline-error rather than editing code. (Source-freshness ERROR STALE lines are a data issue, not code; they rarely fail a dbt run — don't chase them unless they're the terminal error.)
A failed dbt run reports one error; broken branches often hide several layered behind it. Don't fix-one-and-retry blindly — reproduce locally and clear them in one branch:
git clone --depth 1 -b <dbt_branch> https://x-access-token:[email protected]/<org>/<repo>.git
cd <repo>/<project_dir>
export DBT_PROFILES_DIR=$PWD # write a dummy snowflake profiles.yml; parse never connects
pip install -q dbt-<adapter>
dbt parse --no-version-check # catches YAML + ref/source + compilation errors offline
dbt parse finds YAML and ref/source errors with no warehouse. Runtime SQL errors (e.g. invalid identifier) only surface on an actual dbt run — so expect to iterate steps 3–5.
Fixing strategy: typos (ref('customersdfdfd_clean')→customers_clean, site_nadfdfdme→site_name) fix in place. For damage beyond a typo (missing *, passthrough, dropped commas, mangled blocks), diff against a known-good branch (usually main, which builds green) and restore that file rather than guessing the intended logic.
storageProvider). Never label a code fix "user action" — open the PR.POST /pipelines/<PID>/start
{ "branch": "<yaml-branch, e.g. main>",
"continueDownstreamRun": true,
"runInputs": { "dbt_branch": "<fix-branch>", "dbt_command": "run" } }
If branch isn't an input, tell the user it can't be hotfixed until they parameterise it (add inputs.dbt_branch) — don't guess.
3. Run the whole pipeline, not just the dbt task. A real ETL flow is python → dbt → reverse-ETL/BI; dbt is rarely the last step. A full /start (no taskIds) runs the entire DAG top-to-bottom — prefer it. If you instead target the failed task ("taskIds": ["<TID>"]) or use "retryFromFailed": true to skip an expensive upstream, you must also send "continueDownstreamRun": true, or every task after the fixed one is skipped and the pipeline only looks fixed. Targeted retries also assume the fixed task's upstream inputs already exist — if not, do a full run.
4. dbt run / build materialises tables. If the env is Production, get the user's OK first unless they've said to proceed. Then it's their call.
Poll GET /pipeline_runs/<RID> (MCP get_pipeline_run) ~every 20s, one line per check:
▶ Run e2049b86 — RUNNING (0:42)
✅ Run e2049b86 — SUCCEEDED (1:44)
A very-fast SUCCEEDED can be a stale first read — re-check completedAt/message before trusting it. On failure, immediately diagnose the new error (it's progress if the run got further) and loop to step 3.
Confirm the whole pipeline, not just the dbt task. "Fixed" means the pipeline run is SUCCEEDED with every task green — not just that the dbt task passed. Check the run status, then list its task runs (GET /task_runs?pipeline_ids=<PID> filtered to the RID) and confirm none are FAILED. A downstream task (reverse-ETL, BI refresh, notification) can fail on the dbt output even when dbt itself is fine. When green end-to-end, merge the PR. As a last check, re-run with the original failing params to prove the real config is fixed.
## Fixed: <pipeline name>
- Final run: <id> — SUCCEEDED
- Root cause: <one line; note if reported error masked deeper bugs>
- Fixes: <table/list of file → bug → fix>
- PR: <link, merged>
/start by default; for targeted/retryFromFailed retries always add "continueDownstreamRun": true, and confirm every task in the run is green.update_pipeline; GitHub-backed need repo commits.list_* calls; mind the 7-day metadata window.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
19 skills in this plugin
/account-health-checkAudit an Orchestra workspace/account against Orchestra's best practices and produce a read-only health report — findings grouped by area, each tagged with severity, evidence, and a fix recommendation, written to a markdown file plus a chat summary. Use whenever the user wants an "account review", "workspace audit", "health check", "best-practice review", "onboarding review", or asks "is my Orchestra set up correctly?", "what should I improve?", "are we following best practices?", "review my pipelines", or "audit my workspace". Also trigger when the user mentions reviewing pipeline design, environment/promotion setup, Git/CI-CD coverage, alerting coverage, connections/secrets hygiene, concurrency, cost, RBAC, repeated tasks (MetaEngine), metadata/lineage, auto-fix agents, or hybrid-deployment fit across their Orchestra account. This skill only inspects and reports — it never edits pipelines or changes settings.
/build-data-reconciliation-pipelineBuilds Orchestra pipeline YAML using the native Data Reconciliation tasks (DATA_RECONCILIATION_MANUAL_QUERY, DATA_RECONCILIATION_CURSOR_FIELD) to prove two data stores match — the "did the migration land correctly" check between a source and destination integration (SNOWFLAKE, SQL_SERVER, DATABRICKS, any pairing). Use whenever the user wants to compare, validate, or reconcile data across two systems for a migration, replatform, cutover, or CDC/replication setup — phrases like "make sure the migration matches", "reconcile Snowflake and Databricks", "validate the cutover", "did we lose any rows moving to the new warehouse", "set up drift monitoring", or any mention of Data Reconciliation / DataRec. Produces a one-off full-match validation pipeline plus, optionally, an ongoing cursor-field drift monitor. Don't use create-orchestra-pipeline for this — Data Reconciliation tasks have sharp edges (single-scalar results, thresholds that silently no-op if omitted) covered in this skill's references.
/configure-dbt-build-afterConfigure dbt model build_after for Orchestra state-aware orchestration — author the config.freshness.build_after block (count, period, updates_on) on dbt models so Orchestra rebuilds a model only after a minimum SLA window AND when its upstream data is fresh, then ensure use_state_orchestration is enabled on the Orchestra dbt task. Use when asked to set up build_after, configure per-model rebuild SLAs, gate model rebuilds on upstream freshness, stop unnecessary dbt rebuilds, or set up state-aware orchestration in Orchestra. Trigger on phrases like "configure build_after", "add build_after", "only rebuild when upstream is fresh", "per-model SLA", "updates_on any/all", or "stop rebuilding models that haven't changed" in a dbt or Orchestra context. build_after is warehouse-agnostic (same config for Snowflake, BigQuery, Databricks, MotherDuck) but depends on source freshness being configured — the source/freshness-signal half is the separate configure-dbt-source-freshness skill./configure-dbt-source-freshnessConfigure dbt source freshness for Orchestra state-aware orchestration — author warn_after/error_after thresholds and loaded_at_field/loaded_at_query in a dbt project's sources YAML, getting the warehouse details right for Snowflake, BigQuery, Databricks, or MotherDuck/DuckDB, then enable use_state_orchestration on the Orchestra dbt task. Use when asked to set up dbt source freshness, configure freshness checks, detect stale sources, set up state-aware orchestration in Orchestra, or make Orchestra skip downstream models when upstream data hasn't changed. Trigger on phrases like "add source freshness", "configure freshness", "set up state aware orchestration", "skip models when sources are stale", "loaded_at_field", or "warn_after/error_after" in a dbt or Orchestra context. This is the source/freshness-signal half of state-aware orchestration; configuring per-model rebuild SLAs (build_after) is the separate configure-dbt-build-after skill./create-orchestra-pipelineCreate, validate, and remediate Orchestra pipeline definitions, as YAML or OML. Use when asked to build a new pipeline, add tasks to an existing pipeline, fix pipeline validation errors, or author Orchestra workflow definitions from a description. Trigger on phrases like "create a pipeline", "add a dbt task", "write orchestra yaml", "write orchestra oml", "fix validate errors", or when editing `.yml`, `.yaml` or `.oml` files under orchestra/ or similar pipeline directories.
/databricks-cost-auditRuns a daily, one-off Databricks cost-optimisation audit. Executes 10 checks against Databricks system tables (billing, compute, query history, lakeflow), writes ranked findings with estimated $ savings to a Delta table, and returns a summary highlighting what's new today vs. still-open. Use when the user asks to audit Databricks spend, find cost savings, run the daily cost check, or review compute/warehouse/storage waste. Triggers: "databricks cost audit", "check our databricks spend", "cost optimisation", "run the daily audit".npx claudepluginhub orchestra-hq/orchestra-skills --plugin orchestraOther plugins' skills for the same job