agentleFS
fagemxfagemx/edda/.claude/skills/pr-check/SKILL.md

pr-check

Skill36 starsChanged 2 months agoApache-2.0View on GitHub

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

  • Commits and pushes

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. 0 are common, 14 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 14

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check if the PR already has a code review comment:

    line 53
  2. Distinctive:

    Look for review comments containing patterns like:

    line 60
  3. Distinctive:

    Wait 60 seconds for pipeline to stabilize before first check.

    line 75
  4. Distinctive:

    Still running: Wait 60 seconds and retry

    line 98
  5. Distinctive:

    When failures are detected, attempt to fix them.

    line 105
  6. Distinctive:

    If changes were made:

    line 126
  7. Distinctive:

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

    line 175
  8. Distinctive:

    Wait 60 seconds for new pipeline to start

    line 176
  9. Distinctive:

    After all CI checks pass:

    line 183
  10. Distinctive:

    If any fix commits were made during this process:

    line 187
  11. Very specific:

    Run /pr-review again to review the new changes

    line 188
  12. Distinctive:

    Test failures require manual fixes

    line 229
  13. Distinctive:

    Always check status first: - Don't assume pipeline state

    line 267
  14. Distinctive:

    Auto-fix conservatively: - Only fix lint/format, not logic

    line 268
  15. Distinctive:

    No silent failures: - Always communicate the outcome

    line 271

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

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:

# 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

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

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

cargo fmt
cargo clippy --fix --allow-dirty

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 / Compilation Failures (Manual Required)

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)

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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.