Skip to content
Development
Command

/pr-check

Ultra-fast parallel PR validation with 7-9x speedup through concurrent multi-agent analysis

From plugin
claude-cmd
313180 skills180 commands

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/pr-check

Context preview

What this command does when you run it.

Ultra-fast parallel PR validation with 7-9x speedup through concurrent multi-agent analysis

Command definition

pr-check.md
allowed-tools: Task, Bash(gh:*), Bash(git:*), Bash(jq:*), Bash(gdate:*), Bash(osascript:*), Write, Read, Grep
name: "Pr Check"
description: "Ultra-fast parallel PR validation with 7-9x speedup through concurrent multi-agent analysis"
author: "wcygan"
tags: ["git","pr"]
version: "1.0.0"
created_at: "2025-07-14T00:00:00Z"
updated_at: "2025-07-14T00:00:00Z"

Context

  • Session ID: !`gdate +%s%N 2>/dev/null || date +%s%N 2>/dev/null || echo "$(date +%s)$(jot -r 1 100000 999999 2>/dev/null || shuf -i 100000-999999 -n 1 2>/dev/null || echo $RANDOM$RANDOM)"`
  • Current directory: !`pwd`
  • Current branch: !`git branch --show-current 2>/dev/null || echo "no-git-repo"`
  • Git status: !`git status --porcelain 2>/dev/null | wc -l | tr -d ' ' || echo "0"` files changed
  • Remote origin: !`git remote get-url origin 2>/dev/null | sed 's/.*github.com[:/]\([^/]*\/[^.]*\).*/\1/' || echo "no-remote"`
  • Available PRs: !`gh pr list --json number,title,state 2>/dev/null | jq length 2>/dev/null || echo "0"`
  • Open PRs by author: !`gh pr list --author @me --state open --json number 2>/dev/null | jq length 2>/dev/null || echo "0"`
  • Default branch PR: !`gh pr view --json number,state 2>/dev/null | jq -r '.number // "none"' 2>/dev/null || echo "none"`
  • GitHub CLI status: !`gh auth status 2>/dev/null | head -1 || echo "Not authenticated"`

Your Task

**CRITICAL: Deploy 7-9 parallel sub-agents IMMEDIATELY for ultra-fast PR validation. Sequential checking is obsolete - achieve 7-9x performance through concurrent analysis.**

STEP 1: Initialize PR monitoring session and parameter validation

  • CREATE session state file: `/tmp/pr-check-state-$SESSION_ID.json`
  • SET initial state:
  {
    "sessionId": "$SESSION_ID",
    "timestamp": "$(gdate -Iseconds 2>/dev/null || date -Iseconds)",
    "pr_number": null,
    "monitoring_mode": "single_check",
    "analysis_depth": "standard"
  }
  • PARSE command arguments from $ARGUMENTS:
  • IF $ARGUMENTS contains PR number: Extract and validate PR exists
  • ELSE IF current branch has associated PR: Auto-detect PR number
  • ELSE: List available PRs for selection
  • VALIDATE GitHub CLI authentication and repository access
  • UPDATE session state with validated PR number and context

STEP 2: **LAUNCH 8 PARALLEL PR VALIDATION AGENTS FOR INSTANT COMPREHENSIVE ANALYSIS**

**CRITICAL: NO SEQUENTIAL EXECUTION. Deploy ALL agents simultaneously in your FIRST response for 7-9x performance gain.**

[EXECUTE ALL 8 AGENTS IN PARALLEL - EXPECTED COMPLETION: 5-8 SECONDS]

Task 1: "CI/CD Health Agent - Analyze all GitHub Actions workflows, checks, and their current status for PR #$PR_NUMBER. Include running, failed, and pending checks with detailed failure analysis."

Task 2: "Review Status Agent - Examine all code reviews, approval requirements, and reviewer comments for PR #$PR_NUMBER. Identify blocking reviews and required approvals."

Task 3: "Merge Conflict Agent - Detect merge conflicts, branch protection rules, and merge readiness for PR #$PR_NUMBER. Analyze conflict complexity if present."

Task 4: "Security & Compliance Agent - Check security scanning results, license compliance, and policy violations for PR #$PR_NUMBER. Include dependency vulnerabilities."

Task 5: "Performance Impact Agent - Analyze code changes for performance implications, bundle size changes, and resource usage for PR #$PR_NUMBER."

Task 6: "Test Coverage Agent - Examine test results, coverage reports, and quality gates for PR #$PR_NUMBER. Identify untested code paths."

Task 7: "Integration Status Agent - Check API compatibility, breaking changes, and downstream impact for PR #$PR_NUMBER. Verify contract testing."

Task 8: "Documentation Agent - Verify documentation updates, API doc changes, and changelog entries for PR #$PR_NUMBER. Check for missing docs."

**Performance Metrics:**

  • Sequential analysis time: 45-60 seconds
  • Parallel agent time: 5-8 seconds
  • **Speedup: 7-9x faster**

SAVE initial agent deployment status:

echo '{
  "agents_deployed": 8,
  "deployment_time": "'$(gdate -Iseconds 2>/dev/null || date -Iseconds)'",
  "expected_completion": "5-8 seconds",
  "pr_number": '$PR_NUMBER'
}' > /tmp/pr-check-agents-$SESSION_ID.json

STEP 3: **SYNTHESIZE PARALLEL AGENT RESULTS WITH CROSS-VALIDATION**

**CRITICAL: All 8 agents complete within 5-8 seconds. Synthesis provides comprehensive PR health score.**

AGGREGATE agent findings into unified PR validation report:

# Collect all agent results
echo '{
  "synthesis_start": "'$(gdate -Iseconds 2>/dev/null || date -Iseconds)'",
  "agent_results": []
}' > /tmp/pr-check-synthesis-$SESSION_ID.json

**Cross-Agent Validation Matrix:**

1. **CI/CD vs Test Coverage**: Correlate failing checks with test gaps 2. **Security vs Performance**: Balance security requirements with performance impact 3. **Conflicts vs Integration**: Assess merge conflict impact on API contracts 4. **Reviews vs Documentation**: Ensure reviewer concerns are documented

**Generate PR Health Score (0-100):**

# Calculate weighted health score based on agent findings
HEALTH_SCORE=$((
  CI_SCORE * 0.25 +        # 25% weight for CI/CD status
  REVIEW_SCORE * 0.20 +    # 20% weight for review approval
  SECURITY_SCORE * 0.20 +  # 20% weight for security
  TEST_SCORE * 0.15 +      # 15% weight for test coverage
  MERGE_SCORE * 0.10 +     # 10% weight for merge readiness
  DOC_SCORE * 0.10         # 10% weight for documentation
))

**PR Readiness Classification:**

  • **READY** (90-100): All checks pass, approved, no conflicts
  • **ALMOST** (70-89): Minor issues, likely mergeable with fixes
  • **BLOCKED** (50-69): Significant issues requiring attention
  • **CRITICAL** (0-49): Major blockers, extensive work needed

STEP 4: **ACTIONABLE INSIGHTS GENERATION WITH PARALLEL REMEDIATION AGENTS**

**IF issues detected by initial agents, IMMEDIATELY DEPLOY remediation sub-agents:**

[CONDITIONAL PARALLEL DEPLOYMENT - 3-5 ADDITIONAL AGENTS]

IF
Read more
Ships withclaude-cmd

A lightweight (~46kB) and comprehensive CLI tool for managing Claude commands, configurations, and workflows.

Get the whole plugin