Skip to content

feat(skills): Add PR batch merge skill for autonomous operations #637

@cursor

Description

@cursor

Summary

Create a skill for batch-merging multiple PRs with auto-merge, handling the common pattern of merging all APPROVED PRs.

Use Case

During autonomous PR monitoring (Session 106), the agent needed to:

  1. List all open PRs
  2. Filter to APPROVED PRs
  3. Check merge readiness for each
  4. Enable auto-merge with correct strategy (squash)
  5. Monitor merge progress

This required many individual commands and could be simplified.

Proposed Skill

Invoke-PRBatchMerge.ps1 (or batch-merge-prs.sh for bash)

Parameters

Parameter Type Description
-Filter string Filter: "approved", "ready", "all"
-Strategy string Merge strategy: "squash", "merge", "rebase"
-AutoMerge switch Enable auto-merge instead of immediate merge
-DeleteBranch switch Delete branch after merge
-DryRun switch Show what would be merged without merging

Example Usage

# Merge all approved PRs with squash
./Invoke-PRBatchMerge.ps1 -Filter approved -Strategy squash -AutoMerge -DeleteBranch

# Dry run to see what would be merged
./Invoke-PRBatchMerge.ps1 -Filter approved -DryRun

Output

{
  "processed": 8,
  "autoMergeEnabled": 8,
  "alreadyMerged": 0,
  "failed": 0,
  "prs": [
    {"number": 625, "action": "auto-merge-enabled"},
    {"number": 603, "action": "auto-merge-enabled"}
  ]
}

Benefits

  • Reduces token usage for batch operations
  • Standardizes merge strategy across PRs
  • Provides consistent error handling
  • Enables monitoring mode for autonomous agents

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-infrastructureBuild, CI/CD, configurationarea-skillsSkills documentation and patternsbugSomething isn't workingenhancementNew feature or requestpriority:P2Normal: Standard enhancement or bug fix, moderate impact

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions