| created | "2026-04-23T00:00:00.000Z" |
| modified | "2026-04-23T00:00:00.000Z" |
| reviewed | "2026-04-23T00:00:00.000Z" |
| allowed-tools | Bash(gh pr checks *), Bash(gh pr view *), Bash(gh run view *), Bash(gh run list *), Bash(gh repo view *), Bash(git status *), Bash(git diff *), Bash(git log *), Bash(git add *), Bash(git commit *), Bash(git push *), Bash(pre-commit *), Bash(npm run *), Bash(uv run *), Read, Edit, Grep, Glob, TodoWrite, mcp__github__pull_request_read |
| args | [pr-number] [--auto-fix] [--push] |
| argument-hint | [pr-number] [--auto-fix] [--push] |
| disable-model-invocation | true |
| description | Analyze and fix failing PR checks. Use when the user asks to fix the PR,
resolve failing CI checks, diagnose red GitHub Actions runs, auto-fix
lint/type/test failures on a pull request, or reproduce CI errors locally
before pushing corrections.
|
| name | git-fix-pr |
Context
- Repo: !
git remote get-url origin
- Current branch: !
git branch --show-current
- Git status: !
git status --porcelain=v2 --branch
- Staged changes: !
git diff --cached --numstat
- Unstaged changes: !
git diff --numstat
- Recent commits: !
git log --format='%h %s' --max-count=5
Parameters
Parse these parameters from the command (all optional):
$1: PR number (if not provided, detect from current branch)
--auto-fix: Automatically apply fixes for common issues
--push: Push fixes to the branch after committing
Your task
Analyze and fix failing PR checks.
Step 1: Determine PR
- Get PR number from argument or detect from current branch
- Fetch PR status using
gh pr checks <pr-number> or mcp__github__pull_request_read
Step 2: Analyze Failures
- Identify failing checks from PR status
- Research error messages in workflow logs
- Categorize failures:
- Linting errors
- Type errors
- Test failures
- Build errors
Step 3: Reproduce Locally
- Run tests locally to reproduce issues
- Run linters to check for style issues
- Run type checker if applicable
Step 4: Apply Fixes (if --auto-fix)
Based on failure type:
-
Linting errors: Run appropriate linters/formatters
uv run ruff check --fix .
uv run ruff format .
npm run lint -- --fix
-
Type errors: Fix type annotations or implementations
-
Test failures: Fix failing tests or implementation bugs
Step 5: Commit and Push (if --push)
- Stage fixes:
git add -u
- Commit:
git commit -m "fix: resolve CI failures"
- Push:
git push
Step 6: Verify
- Re-run checks locally to verify fixes
- Monitor PR checks after push
Common Fix Patterns
| Check Type | Common Fixes |
|---|
| Linting | Run formatter, fix import order |
| Types | Add type annotations, fix mismatches |
| Tests | Fix assertions, update snapshots |
| Build | Fix imports, resolve dependencies |
See Also
- github-actions-inspection skill for workflow analysis
- git-branch-pr-workflow skill for PR patterns