Diagnose and fix CI failures on a PR, push fixes
Diagnoses and fixes CI failures on pull requests by analyzing logs and pushing verified corrections.
npx claudepluginhub open-horizon-labs/bottleThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Fix CI failures on a pull request. Work in an isolated worktree, diagnose failures from check run logs, apply fixes, verify, and push.
/oh-ci <pr-number>
<pr-number> - the pull request number with failing CIissue/<number>)Read dive context (if available) for project background:
cat .wm/dive_context.md 2>/dev/null || echo "No dive context"
Get PR branch info and create worktree:
# Save original directory for cleanup
ORIGINAL_DIR=$(pwd)
# Get the PR branch name
BRANCH=$(gh pr view <pr-number> --json headRefName -q .headRefName)
# Fetch and create worktree tracking the remote branch
git fetch origin
git worktree add .worktrees/ci-<pr-number> -B $BRANCH origin/$BRANCH
cd .worktrees/ci-<pr-number>
sg init
Fetch CI check run details and logs:
# Get the head SHA
HEAD_SHA=$(gh pr view <pr-number> --json headRefName,commits -q '.commits[-1].oid')
# List all check runs for this commit
gh api repos/{owner}/{repo}/commits/${HEAD_SHA}/check-runs --jq '.check_runs[] | select(.conclusion == "failure") | {name: .name, id: .id, conclusion: .conclusion}'
# For each failed check run, get the log
gh api repos/{owner}/{repo}/check-runs/{check_run_id}/annotations
If check run logs are insufficient, also try:
# Get workflow run logs (GitHub Actions)
gh run view --log-failed
Diagnose failures:
Fix the code:
git add)sg review on staged changesVerify the fix locally:
# Run the same checks that failed, if possible
# For TypeScript projects:
pnpm typecheck 2>&1 || true
pnpm test 2>&1 || true
pnpm lint 2>&1 || true
# For Rust projects:
cargo check 2>&1 || true
cargo test 2>&1 || true
cargo clippy 2>&1 || true
Adapt commands to the project's build system (check package.json scripts, Makefile, etc.).
Commit fixes:
git commit -m "fix: resolve CI failures on PR #<pr-number>
- <summary of each fix>
Fixes #<descendant-issue> (if any)"
Push:
git push
Cleanup worktree:
cd $ORIGINAL_DIR
git worktree remove .worktrees/ci-<pr-number>
Exit and report:
If sg review finds non-trivial issues during the fix, create GitHub issues:
PARENT_ISSUE=${BRANCH#issue/}
NEW_ISSUE=$(gh issue create \
--title "Fix: <brief description>" \
--body "Spawned from #${PARENT_ISSUE} during CI fix on PR #<pr-number>.
## Context
<what was found>
## Acceptance
- [ ] Fix applied
- [ ] CI passes" \
--assignee @me | grep -oE '[0-9]+$')
Complete ALL descendant issues before the final push.
CRITICAL: You MUST signal completion when done. Call the signal_completion tool as your FINAL action.
Signal based on outcome:
| Outcome | Call |
|---|---|
| CI fixed, changes pushed | signal_completion(status: "success", pr: "<pr-url>") |
| Needs human decision | signal_completion(status: "blocked", blocker: "<reason>") |
| Unrecoverable failure | signal_completion(status: "error", error: "<reason>") |
| If you do not signal, the orchestrator will not know you are done and the session becomes orphaned. |
Fallback: If the signal_completion tool is not available, output your completion status as your final message in the format: COMPLETION: status=<status> pr=<url> or COMPLETION: status=<status> error=<reason>.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.