
pr-check
by vm0-ai
the easiest way to run natural language-described workflows automatically
SKILL.md
name: pr-check description: Monitor PR CI pipeline, auto-fix issues, and loop until all checks pass allowed-tools: Bash, Read, Grep, Glob, Edit context: fork
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
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 successfullyfail: Failed - needs attentionpending: Still runningskipping: 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)
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):
- Wait 60 seconds for new pipeline to start
- 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-reviewagain 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
-
No Auto-Merge: This skill does NOT merge the PR. Merging is a manual decision.
-
Review Triggers:
- Initial review: If no existing review comment found
- Final review: If any fixes were committed during the process
-
Manual Intervention:
- Type errors require manual fixes
- Test failures require manual fixes
- The skill will exit with clear instructions
-
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
- Always check status first - Don't assume pipeline state
- Auto-fix conservatively - Only fix lint/format, not logic
- Clear reporting - User should always know what happened
- Preserve context - Report exactly where manual intervention is needed
- No silent failures - Always communicate the outcome
Your goal is to ensure CI passes with minimal manual intervention while maintaining code quality.
Score
Total Score
Based on repository quality metrics
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
1ヶ月以内に更新
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
Reviews
Reviews coming soon


