{"name":"fix-ci-until-green","description":"Runs a loop on an open pull request until it is green - fetch check results and review comments with gh, fix high and medium feedback, fix CI failures at the root cause, verify locally, push, wait for checks and review bots, and repeat; stops at human approval or merge gates. Use when the user says keep going until CI passes, address the review comments and get my PR green, or babysit this PR.","category":"debugging","tags":["ci","github"],"models":["any"],"proven":false,"passing_families":0,"model_testing":"Not yet model-tested; testing Jan 2027","url":"https://theskillvault.ai/skills/fix-ci-until-green","api_url":"https://theskillvault.ai/api/skills/fix-ci-until-green","raw_url":"https://theskillvault.ai/api/skills/fix-ci-until-green/raw","body":"# Fix a PR until its checks pass\n\nGetting a pull request merged is often a loop: CI fails, a reviewer comments, you fix, push and wait. This skill runs that loop for you and stops where a human has to decide.\n\n## When to use\n- You opened a PR and want the agent to keep fixing until CI is green.\n- Reviewers or review bots left comments and you want the real ones fixed.\n- You are about to step away and want the PR moving while you are gone.\n\n## When not to use\n- You want one red check explained before anything changes. Use fix-failing-ci-checks.\n- You want help judging whether review comments are right. Use respond-to-code-review-prompt.\n\n## Steps\n1. Check access with `gh auth status`, then find the PR: `gh pr view --json number,url,headRefName,isDraft,reviewDecision`. Stop if there is no PR.\n2. Agree the rules with the user once: may the agent commit and push to this branch on its own? If not, it shows each fix and waits.\n3. Read review feedback: `gh pr view <pr> --comments` and `gh api repos/{owner}/{repo}/pulls/<pr>/comments`. Sort comments into must-fix (bugs, broken behaviour, security), should-fix, and nits. Skip resolved threads and informational bot notes.\n4. Fix must-fix and should-fix items. Check each against the real code first, and fix every place the same problem appears. List the nits and ask which to do.\n5. Read CI: `gh pr checks <pr>`. For each failed GitHub Actions job, run `gh run view <run-id> --log-failed` and find the first real error.\n6. Say the cause in one line before editing (\"fails because X in Y\"), then fix the root cause. Add a focused test when the bug had none.\n7. Verify locally: re-run the failing test, linter or type checker. Do not push a failure you can reproduce.\n8. Commit with a clear message and push (`git push`, never a force-push unless asked).\n9. Wait for checks with `gh pr checks <pr> --watch`. Wait for review bots too, but not for human approval or the draft flag.\n10. When checks pass, read comments once more. If new must-fix feedback arrived, go back to step 4. Otherwise report.\n\n## When to stop and ask\n- The same failure survives two fix attempts.\n- A comment is unclear, or two reviewers disagree.\n- The failure is infrastructure: a runner outage, a missing secret or a quota.\n- Only human gates remain: required approvals, the draft flag or merge rules.\n- The branch needs a rebase or has conflicts.\n\n## Gotchas\n- Never print or echo secrets while debugging a failed job. Check that a secret name exists, not its value.\n- Never make CI green by deleting tests, skipping checks, or adding `--no-verify`, unless the user explicitly asks.\n- Each push restarts the checks. Batch related fixes into one commit to save CI minutes.\n- Do not mark a draft PR ready or merge it unless the user asks.\n\n## Portability\nWorks with any language and test runner. If you use GitLab, Bitbucket or another host, the loop is the same with that host's CLI or API instead of gh. Checks from other CI providers show up in `gh pr checks` with a link; open that link instead of guessing.\n\n## Done when\n- All required checks the agent can affect are green.\n- Every must-fix and should-fix comment is fixed or answered with a reason.\n- The user has a short report: what changed, what was skipped and which human gates remain.\n\n## Example prompt\n\"Keep iterating on my PR until CI passes. Fix the real review comments, ask me about the nits, and stop when only approval is left.\"\n\n---\nModified from \"iterate-pr\" in getsentry/skills (Apache-2.0, Copyright 2025 Functional Software, Inc. dba Sentry). Original: https://github.com/getsentry/skills/blob/0c464f411bdfb8d4c12314b36264d06cb2f60270/skills/iterate-pr/SKILL.md. Changes by TheSkillVault are listed in the metadata above and in NOTICE.txt. See LICENSE.txt.","files":["LICENSE.txt","NOTICE.txt"],"license":"Apache-2.0","license_name":"Apache License 2.0","license_url":"https://www.apache.org/licenses/LICENSE-2.0","attribution":"Based on work by David Cramer (Sentry, getsentry/skills iterate-pr) (Copyright 2025 Functional Software, Inc. dba Sentry. Apache License 2.0 text in LICENSE.txt, attributions in NOTICE.txt, Apache License 2.0), https://github.com/getsentry/skills/blob/0c464f411bdfb8d4c12314b36264d06cb2f60270/skills/iterate-pr/SKILL.md; adapted by TheSkillVault, https://theskillvault.ai","install":{"claude_code":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/fix-ci-until-green/raw' -o ~/'.claude/skills/fix-ci-until-green/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/fix-ci-until-green/files/LICENSE.txt' -o ~/'.claude/skills/fix-ci-until-green/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/fix-ci-until-green/files/NOTICE.txt' -o ~/'.claude/skills/fix-ci-until-green/NOTICE.txt'","cursor":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/fix-ci-until-green/raw' -o '.cursor/skills/fix-ci-until-green/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/fix-ci-until-green/files/LICENSE.txt' -o '.cursor/skills/fix-ci-until-green/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/fix-ci-until-green/files/NOTICE.txt' -o '.cursor/skills/fix-ci-until-green/NOTICE.txt'","agents":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/fix-ci-until-green/raw' -o '.agents/skills/fix-ci-until-green/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/fix-ci-until-green/files/LICENSE.txt' -o '.agents/skills/fix-ci-until-green/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/fix-ci-until-green/files/NOTICE.txt' -o '.agents/skills/fix-ci-until-green/NOTICE.txt'","mcp_url":"https://theskillvault.ai/mcp","cursor_mcp_deeplink":"cursor://anysphere.cursor-deeplink/mcp/install?name=theskillvault&config=eyJ1cmwiOiJodHRwczovL3RoZXNraWxsdmF1bHQuYWkvbWNwIn0%3D","mcp_config":{"mcpServers":{"theskillvault":{"url":"https://theskillvault.ai/mcp"}}}},"bundles":[],"tested_on":[{"family":"chatgpt","name":"ChatGPT","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"claude","name":"Claude","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"gemini","name":"Gemini","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"grok","name":"Grok","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"llama","name":"Llama","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"deepseek","name":"DeepSeek","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"mistral","name":"Mistral","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"qwen","name":"Qwen","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"kimi","name":"Kimi K","outcome":null,"date":null,"source":null,"counts":false,"stale":false}],"proven_rule":{"threshold":5,"window_days":365,"computed_at":"2026-11-03T21:40:06.669Z"}}