一键导入
ci-green-runner
Fix a failing CI run end-to-end: download logs, diagnose failures, apply code fixes, run local tests, push, poll CI, and iterate until green.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Fix a failing CI run end-to-end: download logs, diagnose failures, apply code fixes, run local tests, push, poll CI, and iterate until green.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
End-to-end interactive workflow to ship a Power BI report from a Delta Lake. Studies source data, builds dbt dims/facts, iterates on a matplotlib PBI-style mockup with the user, lays down semantic-model relationships + DAX measures (TMDL), and finally emits PBIR visual JSON so the report renders in Fabric. Skips the Power BI UI almost entirely.
Run the spark-dbt regression testing loop. Iteratively install, lint, run, and test dbt projects against a local Spark environment until all models and tests pass.
Interactive workflow to design a Kimball STAR-schema dbml file from a directory of local Delta tables and a list of business questions. Profiles the source data with DuckDB, proposes conformed + local dims and fact tables, validates that every business question can be answered on the proposed model, surfaces bonus insights from sample data, and emits a committed authoring-style .dbml as the design spec for a new dbt project. The dbml is the only artefact that lands in git.
Interactive workflow to create Bronze-to-Silver Spark transformations. Discovers source data, catalogs existing transformers, validates schema design with the user, generates code (Constants, Loader, Transformer, Driver), registers tables for VACUUM, creates unit tests, and validates via spark-submit.
Create unit test YAML definitions that mock upstream model inputs and validate expected outputs for dbt models. Use when adding unit tests for a dbt model in projects/spark-dbt/ or practicing TDD on a new dim_* / fct_* before wiring it into the DAG. Includes the dbt-fabricspark Spark data-type caveat.
Retrieve and search dbt / dbt-fabricspark documentation in LLM-friendly Markdown. Use when looking up dbt configs (materializations, snapshots, sources, tests, contracts), dbt-fabricspark adapter options, or any docs.getdbt.com page.
| name | ci-green-runner |
| description | Fix a failing CI run end-to-end: download logs, diagnose failures, apply code fixes, run local tests, push, poll CI, and iterate until green. |
| user-invocable | true |
End-to-end workflow to take a failing CI run and iterate until the pipeline is green: diagnose → fix → validate → push → poll → repeat.
NEVER git add or git commit until ALL local validation passes. Make all code changes first, validate with local tests, THEN commit and push as a single atomic unit.
When fixing CI failures, fix the root cause — never skip or weaken tests.
If multiple failures exist, fix ALL of them before pushing. Don't push partial fixes that will just fail again on a different error.
/workspaces/spark-sandbox (Nx monorepo)gh CLI for logs, run status, and pollingralph-spark-scala — Scala/Spark compile → build → test → spark-submitralph-spark-dbt — dbt install → lint → run → testnpx tsx tools/scripts/ralph.ts <skill.md> -n <iterations>gh run watchUse the ask_user tool to prompt the user for two pieces of information:
Which PR has the failing CI? Provide the full GitHub URL.
Example:
https://github.com/mdrakiburrahman/spark-sandbox/pull/38
Which CI run failed? Provide the GitHub Actions run or job URL.
Example:
https://github.com/mdrakiburrahman/spark-sandbox/actions/runs/23462909750/job/68268576002?pr=38
Parse from these URLs:
Ensure you are on the correct branch and up to date:
gh pr view <number> --json headRefName --jq '.headRefName'
git checkout <headRefName>
git pull origin <headRefName>
Confirm working tree is clean:
git status
gh run view <run-id> --log-failed > /tmp/ci-failed-log.txt
Search the logs systematically for failure signals:
# Look for test failures, compilation errors, and runtime errors
grep -i -E '(FAIL|✕|✗|FAILED|error|Error|ERROR|Compilation Error)' /tmp/ci-failed-log.txt \
| grep -v -E '(failureaccess|failed 0|fails on invalid)' \
| head -60
For each failure found, extract surrounding lines to understand the full error:
grep -n '<failure_pattern>' /tmp/ci-failed-log.txt
sed -n '<start>,<end>p' /tmp/ci-failed-log.txt
Categorize each failure:
| Failure Type | Example |
|---|---|
| dbt compilation error | dbt could not find a macro with the name "X" |
| Delta/Spark runtime error | DELTA_ZORDERING_ON_PARTITION_COLUMN |
| Scala test failure | Tests: succeeded N, failed M |
| Jest/integration test failure | ✕ test name |
| Build failure | [error] Compilation failed |
| Python test failure | FAILED tests/test_X.py::test_Y |
For each failure, trace it back to the source code:
grep, glob, or explore agents to locate the codeUse explore agents in parallel for independent investigations:
task(agent_type="explore", prompt="Investigate <failure description>. Find <relevant code>.")
Make all fixes before any commit:
Classify changes to determine which local validation is needed:
| Path pattern | Affected project | Local validation command |
|---|---|---|
projects/spark-scala/** | spark-scala | cd projects/spark-scala && sbt test |
projects/spark-dbt/dbt-*/** | dbt-jaffle-shop / dbt-adventureworks / dbt-dataops | npx nx run dbt-<name>:test --TARGET=local-local |
projects/spark-dbt/** | spark-dbt (shared lifecycle) | npx nx affected -t test (fans out to the affected dbt-* projects) |
projects/spark-python/** | spark-python | npx nx run spark-python:test |
projects/fabric/** | fabric | No local tests available |
*.md, tools/**, docs/** | none | No validation needed |
Based on the change classification, run the appropriate tests.
cd /workspaces/spark-sandbox/projects/spark-scala
# Run the specific affected test class first (fast feedback)
sbt "<module>/testOnly <TestClassName>"
# Then run full test suite
sbt test
cd /workspaces/spark-sandbox/projects/spark-dbt
source .venv/bin/activate
cd <dbt-project>
dbt debug --target local-local
dbt deps
dbt build --target local-local
cd /workspaces/spark-sandbox
npx nx run spark-python:test
If any local validation fails, fix the code and re-run. Do NOT proceed until all local tests pass.
git add -A
git commit -m "fix: <brief description of all fixes>
<bullet list of what was fixed and why>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>"
git push origin <branch>
gh run list -L 5 --json databaseId,headBranch,status,conclusion,createdAt \
| python3 -c "
import json, sys
runs = json.load(sys.stdin)
for r in runs:
if r['headBranch'] == '<branch>':
print(f\"ID: {r['databaseId']} Status: {r['status']} Conclusion: {r['conclusion']}\")
"
gh run watch <run-id> --exit-status
This command blocks until the run completes. CI runs typically take 15-25 minutes.
If the run fails:
gh run view <new-run-id> --log-failed > /tmp/ci-failed-log.txt
git add -A
git commit --amend --no-edit
git push --force-with-lease origin <branch>
Repeat this loop until CI is green.
Confirm:
gh run view <run-id> --json status,conclusion --jq '.conclusion'
# Should output "success"
git status
# Should show clean working tree
Report the results to the user with a summary of what was fixed.