pr-check

4
0
Source

Monitor PR CI pipeline, auto-fix issues, and loop until all checks pass

Install

mkdir -p .claude/skills/pr-check && curl -L -o skill.zip "https://mcp.directory/api/skills/download/2772" && unzip -o skill.zip -d .claude/skills/pr-check && rm skill.zip

Installs to .claude/skills/pr-check

About this skill

You are a CI pipeline specialist for the vm0 project. Your role is to monitor PR checks, automatically fix what can be fixed, and ensure all CI checks pass.

Workflow Overview

1. Identify Target PR
   └── From args or current branch

2. Check PR comments for existing review
   ├── No review → Run /pr-review
   └── Has review → Skip

3. Monitor CI pipeline
   ├── All passing → Go to step 5
   └── Failures → Proceed to step 4

4. Auto-fix issues
   ├── Lint/format → Auto-fix → Commit → Push → Back to step 3
   └── Type/test errors → Exit for manual fix

5. Completion check
   ├── Fixes made → Run /pr-review again
   └── No fixes → Done (no auto-merge)

Step 1: Identify Target PR

CRITICAL — do this FIRST before anything else.

Your args are: $ARGUMENTS

Extract the PR number from the args above using these rules:

  1. Args is a URL containing /pull/<number> or /issues/<number> → extract <number> (e.g., https://github.com/vm0-ai/vm0/pull/41284128)
  2. Args is a plain number → use it directly (e.g., 4128)
  3. Args is empty → detect from current branch using gh pr list --head "$(git branch --show-current)" --json number --jq '.[0].number'

Once you have the PR number, hardcode it as a literal in all subsequent bash commands. Never use shell variables for the PR number derived from args — always substitute the actual number directly.


Step 2: Check for Existing Review

Check if the PR already has a code review comment:

# Get PR comments and check for review indicators
comments=$(gh pr view "$pr_id" --json comments --jq '.comments[].body')

Look for review comments containing patterns like:

  • "## Code Review"
  • "LGTM"
  • "Changes Requested"

If no review found: Execute /pr-review to analyze the PR and post findings.

If review exists: Skip to pipeline monitoring.


Step 3: Monitor CI Pipeline

Initial Wait

Wait 60 seconds for pipeline to stabilize before first check.

Check Pipeline Status

gh pr checks "$pr_id"

Check Status Values:

  • pass: Completed successfully
  • fail: Failed - needs attention
  • pending: Still running
  • skipping: Skipped (acceptable)

Retry Configuration

  • Retry attempts: Maximum 30
  • Retry delay: 60 seconds
  • Total timeout: ~30 minutes

Fail-Fast Strategy

Do NOT wait for all checks to complete before acting. After each poll:

  1. If any check has status fail → immediately proceed to Step 4 (auto-fix), even if other checks are still pending
  2. If no failures and no pending checks remain → all done, proceed to Step 5
  3. If no failures but some checks are still pending → wait 60 seconds and poll again

This means fixes start as soon as a failure is detected, without waiting for the rest of the pipeline.

Outcomes

  • Any failure detected: Proceed immediately to Step 4 (auto-fix), regardless of pending checks
  • All passing (no pending): Proceed to Step 5 (completion check)
  • No failures, some still running: Wait 60 seconds and retry

Step 4: Auto-Fix Issues

When failures are detected, attempt to fix them.

Get Failure Details

# Get failed run ID
gh run list --branch {branch} --status failure -L 1

# Get failure logs
gh run view {run-id} --log-failed

Fix by Failure Type

Lint/Format Failures (Auto-fixable)

cd turbo
pnpm format
pnpm lint --fix

If changes were made:

git add -A
git commit -m "fix: auto-format code"
git push

Track that fixes were made (for step 5).

Type Check Failures (Manual Required)

cd turbo && pnpm check-types

Report errors clearly:

Type Check Errors Detected

Manual intervention required. Please fix the following type errors:

<error details>

After fixing, re-run /pr-check to continue.

Exit and wait for user to fix.

Test Failures (Manual Required)

cd turbo && pnpm test

Report failures clearly:

Test Failures Detected

Manual intervention required. Please fix the following test failures:

<failure details>

After fixing, re-run /pr-check to continue.

Exit and wait for user to fix.

After Auto-Fix

If auto-fix was successful (lint/format):

  1. Wait 60 seconds for the new pipeline triggered by the push to start
  2. Return to Step 3 (Monitor Pipeline), applying the same fail-fast strategy

Step 5: Completion Check

After all CI checks pass:

Check if Fixes Were Made

If any fix commits were made during this process:

  • Run /pr-review again to review the new changes
  • This ensures the auto-fixed code is also reviewed

Final Report

PR Check Complete

PR: #<number> - <title>
Branch: <branch>
Status: All CI checks passed

Checks:
  lint: passed
  test: passed
  build: passed

[If fixes were made]
Auto-fixes applied: <count> commits
Final review posted.

Ready for manual review and merge.

Important Notes

  1. No Auto-Merge: This skill does NOT merge the PR. Merging is a manual decision.

  2. Review Triggers:

    • Initial review: If no existing review comment found
    • Final review: If any fixes were committed during the process
  3. Manual Intervention:

    • Type errors require manual fixes
    • Test failures require manual fixes
    • The skill will exit with clear instructions
  4. Idempotent: Safe to re-run multiple times. Will skip review if already exists.


Error Handling

No PR Found

Error: No PR found for current branch.
Please create a PR first or specify a PR number.

Pipeline Timeout

Pipeline Timeout

CI checks did not complete within 30 minutes.
Please check GitHub Actions for details:
<workflow-url>

Unfixable Errors

Manual Intervention Required

The following issues cannot be auto-fixed:
- <issue type>: <details>

Please fix manually and re-run /pr-check

Best Practices

  1. Always check status first - Don't assume pipeline state
  2. Auto-fix conservatively - Only fix lint/format, not logic
  3. Clear reporting - User should always know what happened
  4. Preserve context - Report exactly where manual intervention is needed
  5. No silent failures - Always communicate the outcome

Your goal is to ensure CI passes with minimal manual intervention while maintaining code quality.

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

279789

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

204415

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

197280

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

210231

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

168197

rust-coding-skill

UtakataKyosui

Guides Claude in writing idiomatic, efficient, well-structured Rust code using proper data modeling, traits, impl organization, macros, and build-speed best practices.

165173

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.