Skip to content
Back to skills

Pr Check

ASecurity

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

  • 36 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 2, 2026
ai-agentsgobashgit

Works with

  • cli

Security analysis

A100/100

Scanned September 20, 2026

npx -y skills add fagemx/edda --skill pr-check --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pr Check?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pr Check
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/fagemx-pr-check/badge)](https://www.skillsdirectory.com/skills/fagemx-pr-check)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: pr-check
description: Monitor PR CI pipeline, auto-fix issues, and loop until all checks pass
context: fork
---

You are a CI pipeline specialist for the edda 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

```bash
if [ -n "$PR_ID" ]; then
    pr_id="$PR_ID"
else
    pr_id=$(gh pr list --head $(git branch --show-current) --json number --jq '.[0].number')
fi

if [ -z "$pr_id" ]; then
    echo "No PR found for current branch. Please specify a PR number."
    exit 1
fi
```

---

## Step 2: Check for Existing Review

Check if the PR already has a code review comment:

```bash
# 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

```bash
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

### Outcomes

- **All passing**: Proceed to Step 5 (completion check)
- **Still running**: Wait 60 seconds and retry
- **Failures detected**: Proceed to Step 4 (auto-fix)

---

## Step 4: Auto-Fix Issues

When failures are detected, attempt to fix them.

### Get Failure Details

```bash
# 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)

```bash
cargo fmt
cargo clippy --fix --allow-dirty
```

If changes were made:
```bash
git add -A
git commit -m "fix: auto-format code"
git push
```

Track that fixes were made (for step 5).

#### Type Check / Compilation Failures (Manual Required)

```bash
cargo check --all-targets
```

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)

```bash
cargo 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 new pipeline to start
2. Return to Step 3 (Monitor Pipeline)

---

## 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 review; this skill returns control to its caller. A calling controller
continues through the repository's existing R6 when current-head LGTM and the
recorded gate already hold, without another operator prompt.
```

---

## Important Notes

1. **No Auto-Merge**: This skill checks and fixes CI failures — it does not
   merge the PR. It returns control to its caller; a calling controller continues
   through the recorded rule gate (`docs/fleet/rules.md` R6) when current-head
   LGTM, `CI Gate` green, empty SHA window, and P0=P1=0 already hold.

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.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.