git-fix-pr

v2026.09.24

Failing PR checks — reproduce locally, patch the code, push the fix. Use when asked to fix a PR, resolve red CI, or auto-fix lint/test failures.

GitHub
安装命令
npx skhub add laurigates/git-fix-pr
Markdown
SKILL.md

When to Use This Skill

Use this skill when...Use the alternative when...
Fixing failing CI checks on an existing PR (lint, type, test)Use git-pr-feedback to address reviewer comments rather than CI failures
Reproducing red GitHub Actions runs locally before pushing correctionsUse gh-workflow-monitoring to passively watch a run rather than fix it
Auto-applying lint/format/type fixes and pushing them to the PR branchUse git-conflicts when the failure is a merge conflict, not a check
Diagnosing why a pull request is red after a pushUse git-triage to sweep many PRs at once instead of fixing one

Context

  • Repo: !git remote -v
  • 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

  1. Get PR number from argument or detect from current branch
  2. Fetch PR status using gh pr checks <pr-number> or mcp__github__pull_request_read

Step 2: Analyze Failures

  1. Identify failing checks from PR status
  2. Research error messages in workflow logs
  3. Categorize failures:
    • Linting errors
    • Type errors
    • Test failures
    • Build errors

Step 3: Reproduce Locally

  1. Run tests locally to reproduce issues
  2. Run linters to check for style issues
  3. Run type checker if applicable

Step 4: Apply Fixes (if --auto-fix)

Based on failure type:

  • Linting errors: Run appropriate linters/formatters

    # Python
    uv run ruff check --fix .
    uv run ruff format .
    
    # JavaScript/TypeScript
    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)

  1. Stage fixes: git add -u
  2. Commit: git commit -m "fix: resolve CI failures"
  3. Push: git push

Step 6: Verify

  1. Re-run checks locally to verify fixes
  2. Monitor PR checks after push

Common Fix Patterns

Check TypeCommon Fixes
LintingRun formatter, fix import order
TypesAdd type annotations, fix mismatches
TestsFix assertions, update snapshots
BuildFix imports, resolve dependencies

See Also

  • github-actions-inspection skill for workflow analysis
  • git-branch-pr-workflow skill for PR patterns
发现
标签

此技能尚未发布标签。

版本
最新版本元数据

版本

v2026.09.24

发布时间

2026年9月24日

分类

未分类

许可证

MIT

源路径

git-plugin/skills/git-fix-pr

默认分支

main

最新提交

1668324

Tree SHA

b2d4cc3