MCPInstall

sc-pr-fix

Create PR and iteratively fix CI failures with interactive confirmation. Automates branch creation, commit, push, PR creation, and CI monitoring until all checks pass.

Installs
91
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/tony363/superclaude --skill sc-pr-fix
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads sc-pr-fix automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

PR Fix Skill

Create pull requests and interactively fix CI check failures until all pass.

Quick Start

# Create PR from current changes
/sc:pr-fix "fix: resolve test failures" --branch fix/tests

# Dry run to preview
/sc:pr-fix "feat: new feature" --dry-run

# With custom PR details
/sc:pr-fix "chore: update deps" --title "Update dependencies" --body "Monthly update"

# Auto-fix low-risk issues
/sc:pr-fix "fix: lint errors" --auto-fix

Behavioral Flow

  1. Validate - Check git state, ensure changes exist
  2. Branch - Create and checkout new branch
  3. Commit - Stage all changes and commit with provided message
  4. Push - Push branch to origin
  5. PR Create - Create pull request via gh CLI
  6. Monitor - Poll CI status at configured interval
  7. Fix Loop - For each failing check:
    • Parse failure logs
    • Propose fix (with PAL MCP assistance for complex issues)
    • Prompt user for confirmation (interactive mode)
    • Apply fix and push
    • Re-monitor checks
  8. Complete - All checks pass or max attempts reached

Flags

FlagTypeDefaultDescription
--branchstringautoNew branch name (auto: pr-fix/<timestamp>)
--basestringmainTarget branch for PR
--titlestringcommit msgPR title
--bodystringautoPR description body
--dry-runboolfalsePreview operations without executing
--auto-fixboolfalseAuto-apply low-risk fixes, prompt only for high-risk
--max-fix-attemptsint5Max CI fix iterations (hard cap: 5)
--poll-intervalint30Seconds between CI status checks
--no-pushboolfalseCreate branch and commit but do not push/PR

Interactive Mode

By default, the skill prompts before each fix:

================================================================================
CI Check Failed: build (lint)                                   Attempt 2 of 5
================================================================================

Error Summary:
  - src/component.ts:42:15 - Missing semicolon (semi)
  - src/utils.ts:18:1 - Unexpected console statement (no-console)

Proposed Fix:
  1. Add semicolon at src/component.ts:42
  2. Remove console.log at src/utils.ts:18

Risk Level: LOW (auto-fixable lint errors)

--------------------------------------------------------------------------------
[A]pply fix  [S]kip this check  [V]iew full log  [Q]uit
>

Use --auto-fix to skip prompts for low-risk fixes (lint, formatting). High-risk fixes (test changes, security, core logic) always prompt.

Risk Classification

LevelExamplesBehavior
LOWLint errors, formatting, whitespaceAuto-fix if --auto-fix
MEDIUMTest updates, documentationAlways prompt
HIGHCore logic, security, API changesAlways prompt + PAL review

Evidence Requirements

This skill requires evidence of successful operations:

  • Git operations must succeed (branch created, pushed)
  • PR creation must return valid PR URL
  • CI status must be retrievable via gh CLI
  • Fix attempts must show file diffs

Tool Coordination

  • Bash - Git and gh CLI execution
  • Read - Analyze failure logs and source code
  • Edit - Apply fixes to source files
  • AskUserQuestion - Interactive prompts for fix confirmation
  • PAL MCP debug - Diagnose complex CI failures
  • PAL MCP codereview - Validate fix quality before applying

MCP Integration

  • PAL MCP debug - Root cause analysis for CI failures
  • PAL MCP codereview - Review proposed fixes before applying

Safety Mechanisms

  1. Hard cap: Maximum 5 fix iterations (cannot be overridden)
  2. Stagnation detection: Same error 3 consecutive times = abort
  3. Oscillation detection: Fix-revert-fix pattern = abort
  4. Interactive confirmation: All structural changes require approval
  5. Never skip checks: Must fix or explicitly abort - no skipping
  6. Backup branch: Creates backup/<branch>-<timestamp> before starting

CI Status Polling

The skill polls GitHub Actions check status using:

gh pr checks <pr_number> --json name,state,conclusion,url

Poll behavior:

  • Initial wait: 10 seconds after push (allow CI to start)
  • Poll interval: --poll-interval seconds (default: 30)
  • Timeout: 10 minutes for checks to complete
  • Handles pending, queued, in_progress, and completed states

Failure Log Parsing

Supported CI output formats:

  • ESLint/TSLint JSON format
  • pytest output with tracebacks
  • ruff/flake8 format
  • Jest/Vitest output format
  • Generic error patterns (error:, ERROR, failed)
  • GitHub Actions annotations

Examples

Basic PR Creation with Fix Loop

/sc:pr-fix "fix: resolve ESLint errors"

Output:

Creating branch: pr-fix/20240115-143022
Committing: fix: resolve ESLint errors
Pushing to origin...
Creating PR #42: fix: resolve ESLint errors

Monitoring CI checks...
  - lint: pending
  - test: pending

[30s later]
  - lint: failed
  - test: passed

Parsing lint failures...
Found 2 errors in 1 file.

================================================================================
CI Check Failed: lint                                           Attempt 1 of 5
================================================================================
...
[A]pply fix  [S]kip  [V]iew log  [Q]uit
> a

Applying fix...
Pushing fix commit...
Monitoring CI checks...
  - lint: passed
  - test: passed

All checks passed! PR #42 is ready for review.
PR URL: https://github.com/owner/repo/pull/42

Feature PR with Details

/sc:pr-fix "feat: add user dashboard" \
  --branch feat/user-dashboard \
  --title "Add User Dashboard Component" \
  --body "Implements user dashboard as per spec #42"

Preview Mode

/sc:pr-fix "refactor: cleanup utils" --dry-run

Output:

[DRY RUN] Would execute:
  1. git checkout -b pr-fix/20240115-143022
  2. git add -A
  3. git commit -m "refactor: cleanup utils"
  4. git push -u origin pr-fix/20240115-143022
  5. gh pr create --base main --title "refactor: cleanup utils"
  6. Monitor CI and fix failures interactively

No changes made.

Auto-Fix Low-Risk Issues

/sc:pr-fix "fix: formatting" --auto-fix

With --auto-fix, LOW risk fixes (lint, formatting) are applied automatically. MEDIUM and HIGH risk fixes still prompt for confirmation.

Termination Conditions

The fix loop terminates when:

ConditionExit StatusMessage
All checks passSUCCESS"All checks passed! PR ready for review."
Max attempts (5)FAILED"Max fix attempts reached. Manual intervention required."
Stagnation (3x same error)FAILED"Same error persists after 3 attempts. Aborting."
User quitsABORTED"Fix loop aborted by user."
CI timeoutTIMEOUT"CI checks did not complete within timeout."

Commit Message Format

Fix commits follow Conventional Commits:

fix(ci): resolve <check_name> failures

- <description of fix 1>
- <description of fix 2>

Automated fix by sc-pr-fix skill

Scripts

This skill uses Python helper scripts in scripts/:

  • check_pr_status.py - Poll PR check status via gh pr checks
  • parse_check_failures.py - Parse CI failure logs to extract errors
  • fix_orchestrator.py - Coordinate fix loop with safety mechanisms

Error Handling

ScenarioBehavior
No git repoExit with error message
Dirty working treePrompt: stash, commit, or abort
Branch already existsPrompt for different name
Push failsCheck permissions, offer retry
PR creation failsShow gh CLI error, suggest manual
CI timeoutReport status, offer to continue monitoring
Parse failureFall back to raw log display
Fix application failsIncrement attempt counter, continue loop
User abortsClean exit with status summary

FAQ

What does the sc-pr-fix skill do?

Create PR and iteratively fix CI failures with interactive confirmation. Automates branch creation, commit, push, PR creation, and CI monitoring until all checks pass.

How do I install sc-pr-fix?

Run npx skills add https://github.com/tony363/superclaude --skill sc-pr-fix in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/sc-pr-fix/ (personal) or .claude/skills/sc-pr-fix/ (project).

Which AI agents can use sc-pr-fix?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is sc-pr-fix safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains sc-pr-fix?

It is published by tony363 in tony363/superclaude. It has 91 recorded installs.

More from tony363/superclaude

View all →

agent-performance-engineer

tony363/superclaude

Expert performance engineer specializing in system optimization, bottleneck identification, and scalability engineering. Masters performance testing, profiling, and tuning across applications, databases, and infrastructure with focus on achieving optimal response times and resource efficiency.

agent-security-engineer

tony363/superclaude

Expert infrastructure security engineer specializing in DevSecOps, cloud security, and compliance frameworks. Masters security automation, vulnerability management, and zero-trust architecture with emphasis on shift-left security practices.

Security392 installs

sc-estimate

tony363/superclaude

Provide development estimates for tasks, features, or projects with intelligent analysis. Use when planning timelines, assessing complexity, or scoping resources.

agent-fullstack-developer

tony363/superclaude

End-to-end feature owner with expertise across the entire stack. Delivers complete solutions from database to UI with focus on seamless integration and optimal user experience.

Frontend & Design154 installs

sc-design

tony363/superclaude

Design system architecture, APIs, and component interfaces with comprehensive specifications. Use when planning architecture, designing APIs, creating component interfaces, or modeling databases.

Frontend & Design113 installs

agent-technical-writer

tony363/superclaude

Expert technical writer specializing in clear, accurate documentation and content creation. Masters API documentation, user guides, and technical content with focus on making complex information accessible and actionable for diverse audiences.

Docs & Writing108 installs

Popular code quality & workflow skills

View category →

grill-me

mattpocock/skills

A relentless interview to sharpen a plan or design.

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

handoff

mattpocock/skills

Compact the current conversation into a handoff document for another agent to pick up.

domain-modeling

mattpocock/skills

Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.

codebase-design

mattpocock/skills

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.

diagnosing-bugs

mattpocock/skills

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.