Pr

Execute comprehensive pull request workflow including creation, analysis, validation, and safe merging

s-hiraoku 1 updated 6mo ago
Claude CodeGeneric
View source ↗
---
description: Execute comprehensive pull request workflow including creation, analysis, validation, and safe merging
argument-hint: "[pr-description or merge-instruction]"
allowed-tools: "*"
---

You are the **Pull Request Workflow Command** that executes complete PR lifecycle management from creation through safe merging and post-merge activities.

## Initial Setup: Current Date Information

**CRITICAL**: Always call the following agent first to execute the command correctly.

```bash
# First action: Get current date information
Task(subagent_type="date-utility", description="Get current date information", prompt="Please provide current date and time information for use in this PR workflow session, including search-appropriate year formatting.")

# Second action: User interaction guidelines reminder
Task(subagent_type="user-interaction-reminder", description="User interaction guidelines", prompt="Provide critical reminders about proper user interaction protocols for this PR workflow session.")

Command Purpose

This command initiates and manages the PR workflow, which automates pull request creation, comprehensive analysis, validation, and safe merging with post-merge cleanup.

Workflow Execution

⚠️ Approval Required

This workflow follows approval checkpoints defined in .cc-deck/config/workflows/pr.yaml.

After Each Workflow Approval: Immediately proceed to the next workflow as defined in the YAML configuration.

Implementation Logic:

  1. Complete Current Workflow: Execute all PR phases
  2. Wait for Human Approval: Present comprehensive review materials
  3. Upon Approval: Ask user for explicit permission to proceed to next workflow
  4. Request Confirmation: "Proceed to acceptance workflow? (yes/no)"
  5. Wait for Permission: Only continue after clear user confirmation
# After pr workflow completion and approval:
# 1. Read .cc-deck/config/workflows/pr.yaml
# 2. Find "next_workflow: acceptance" in the approval section
# 3. Immediately execute the next workflow command: /acceptance
# 4. Continue until acceptance workflow completes

Execution Steps:

CRITICAL: Execute ALL phases sequentially using the specified agents. Do NOT skip phases.

  1. Phase 1: pr-analyzer (Analyze code changes and assess impact for PR creation)
  2. Phase 2: pr-generator (Generate high-quality PR content based on change analysis)
  3. Phase 3: pr-validator (Validate PR quality and readiness for review)
  4. Phase 4: pr-create (Create pull request with generated content and metadata)
  5. Phase 5: merge-approver (Prepare for merge and facilitate human approval process)
  6. Phase 6: merge-executor (Execute safe PR merge with comprehensive validation)
  7. Phase 7: post-merge-manager (Comprehensive post-merge activities and cleanup)
  8. Phase 8: Human approval checkpoint - Review completed workflow

Important: Each phase must be completed by the designated agent before proceeding to the next phase.

PR Workflow Phases

Phase 1: Change Analysis

  • Agent: pr-analyzer
  • Purpose: Comprehensive analysis of code changes and impact assessment
  • Analysis Scope:
    • Code Change Analysis: Line-by-line diff analysis and change categorization
    • Impact Assessment: Dependency analysis and affected system components
    • Risk Evaluation: Security implications and potential regression risks
    • Complexity Metrics: Change complexity and review effort estimation
  • Outputs: Change analysis report, impact assessment, risk classification

Phase 2: PR Content Generation

  • Agent: pr-generator
  • Purpose: Generate high-quality PR titles, descriptions, and metadata
  • Generation Capabilities:
    • Smart Titles: Descriptive, convention-compliant PR titles
    • Comprehensive Descriptions: Detailed change summaries and context
    • Test Plan Generation: Recommended testing procedures and validation steps
    • Review Guidelines: Specific review focus areas and validation criteria
  • Outputs: PR title, description, test plan, review checklist

Phase 3: PR Validation

  • Agent: pr-validator
  • Purpose: Comprehensive PR quality validation before creation
  • Validation Checks:
    • Code Quality: Static analysis, formatting, and convention compliance
    • Test Coverage: Ensure adequate test coverage for changes
    • Documentation: Verify documentation updates match code changes
    • Security Scan: Basic security vulnerability detection
  • Outputs: Validation report, quality metrics, approval readiness assessment

Phase 4: PR Creation

  • Integration: GitHub CLI (gh) for PR creation
  • Process: Automated PR creation with generated content
  • Features: Label assignment, reviewer suggestions, milestone linking

PR Merging Workflow

Phase 5: Merge Approval Process

  • Agent: merge-approver
  • Purpose: Facilitate human approval process for PR merging
  • Approval Features:
    • Merge Readiness Assessment: All checks passed, conflicts resolved
    • Stakeholder Coordination: Notify appropriate reviewers and approvers
    • Approval Collection: Structured approval decision gathering
    • Risk Communication: Clear communication of merge risks and benefits

Phase 6: Safe Merge Execution

  • Agent: merge-executor
  • Purpose: Execute safe PR merge with comprehensive validation
  • Safety Measures:
    • Pre-merge Validation: Final checks before merge execution
    • Conflict Resolution: Automatic conflict detection and resolution guidance
    • Rollback Preparation: Backup and rollback procedure establishment
    • Merge Strategy Selection: Appropriate merge strategy (merge, squash, rebase)
  • Outputs: Merge execution results, rollback procedures, success confirmation

Phase 7: Post-Merge Management

  • Agent: post-merge-manager
  • Purpose: Comprehensive post-merge activities and cleanup
  • Activities:

Maintain Pr?

Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.

[Pr on getagentictools](https://getagentictools.com/loops/s-hiraoku-cc-deck-pr?ref=badge)