Skip to main content
Agent skill

Merge Wave

Triage N open PRs with sharded test262 results, rank by net pass delta, merge winners, close catastrophes. Use when multiple PRs have completed CI and you want to land a batch.

Get started

Get the complete skill folder, including its scripts and reference files.

When to use this skill

Use Merge Wave when an AI agent needs a reusable SKILL.md workflow for this job: Triage N open PRs with sharded test262 results, rank by net pass delta, merge winners, close catastrophes. Use when multiple PRs have completed CI and you want to land a batch.

When not to use it

Skip Merge Wave when the task is outside the coding category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.

How to install

Where will you use it?

Install scope
Claude Code folder setup
mkdir -p ~/.claude/skills/merge-wave
# Save SKILL.md to ~/.claude/skills/merge-wave/SKILL.md
  1. Claude Code personal install: place the skill and its bundled files at ~/.claude/skills/merge-wave/SKILL.md. For a shared project, commit the folder at .claude/skills/merge-wave/ instead.
  2. Current Claude Code detects SKILL.md changes in watched directories during the session. If you just created a top-level skills directory, run /reload-skills. Check that the skill is listed before testing its trigger.
  3. For Claude chat or Cowork in the Desktop app, manage uploaded skills in Customize > Skills; copying files into a local Claude Code folder is not a Desktop install. Other agents may use different install locations.

Full install guide for Claude, Cursor, and Codex →

Try a starter prompt

After installing the skill, paste this starter prompt into your agent to verify it triggers on a small task.

Starter prompt
Use the Merge Wave skill for this task: Multiple PRs ready to merge after a morning of dev work. Confirm any required inputs or files before making changes.

What supports this recommendation?

80/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.

Documentation
87/100
Practical detail
92/100
Source evidence
58/100
Source signals
72/100
Model compatibility evidence
  • claudeinferred

    The skill text mentions Claude or a closely associated term. This is keyword-derived compatibility; no hands-on model test is recorded.

  • chatgptuntested

    No model-specific signal or recorded compatibility test was found.

  • geminiuntested

    No model-specific signal or recorded compatibility test was found.

  • copilotuntested

    No model-specific signal or recorded compatibility test was found.

  • llamauntested

    No model-specific signal or recorded compatibility test was found.

  • perplexityuntested

    No model-specific signal or recorded compatibility test was found.

  • mistraluntested

    No model-specific signal or recorded compatibility test was found.

  • grokuntested

    No model-specific signal or recorded compatibility test was found.

Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.

What this skill does

# Merge Wave Protocol

Triage every open PR that has finished sharded test262 CI, compute its real net delta, and execute a ranked merge order in one pass.

## When to use

- Multiple PRs ready to merge after a morning of dev work - After a sprint's worth of issues finished CI at roughly the same time - When you want to cross a pass-rate milestone in one batch

## Step 1: Gather candidate PRs

```bash gh pr list --limit 20 --json number,title,headRefName,mergeable,mergeStateStatus ```

Filter to PRs with `mergeStateStatus: UNSTABLE | CLEAN | BEHIND` — skip `DIRTY` (conflict, ping dev to refresh) and `DRAFT`.

## Step 2: Download every PR's merged-report artifact

The sharded workflow uploads `test262-merged-report` per run. Find each PR's run ID via the `merge shard reports` check:

```bash mkdir -p output/pr-artifacts for pr in <LIST>; do run_id=$(gh pr view $pr --json statusCheckRollup --jq '.statusCheckRollup[] | select(.name=="merge shard reports") | .detailsUrl' | grep -oE 'runs/[0-9]+' | head -1 | cut -d/ -f2) mkdir -p output/pr-artifacts/pr-$pr gh run download $run_id -n test262-merged-report -D output/pr-artifacts/pr-$pr >/dev/null 2>&1 done ```

Artifact filenames: `test262-report-merged.json`, `test262-regressions.txt`, `test262-results-merged.jsonl`.

## Step 3: Compute and rank net deltas

```bash BASELINE=$(python3 -c "import json; d=json.load(open('benchmarks/results/test262-current.json')); print(d['summary']['pass'])")

for pr in <LIST>; do rpt=output/pr-artifacts/pr-$pr/test262-report-merged.json [ -f "$rpt" ] && python3 -c " import json d=json.load(open('$rpt')) s=d['summary'] delta=s['pass']-$BASELINE print(f'PR #$pr pass={s[\"pass\"]} delta={delta:+d} ce={s[\"compile_error\"]}') " done | sort -t= -k3 -n -r ```

## Step 4: Classify each PR

Thresholds (tune per context):

| Delta | Action | |-------|--------| | **< −500** | CATASTROPHIC → close immediately with diagnosis. Do NOT merge. | | **−500 to −20** | Real regression → close, open follow-up issue, ask dev to investigate root cause | | **−20 to +20** | MARGINAL → check if regressions are false positives; if yes merge, if no close | | **+20 to +100** | GOOD → sample regressions, admin-merge if regressions are false positives or acceptable | | **+100+** | STRONG → admin-merge, flag regressions in a follow-up issue |

Sample regressions for any PR where the regression count is > 5% of the delta:

```bash head -40 output/pr-artifacts/pr-<NUM>/test262-regressions.txt ```

Look for known false-positive patterns (see `feedback_regression_analysis.md`): harness wrapper coincidence, `String.prototype` wrapper tests, test expecting SyntaxError where we throw a different error at a matching phase, etc.

## Step 5: Execute the ranked merges

Descending by net delta, skipping catastrophes and conflicts:

```bash gh pr merge <NUM> --merge --admin --body "Net +<DELTA> pass. <CLASSIFICATION NOTES>." ```

Use `--admin` when `mergeStateStatus: UNSTABLE` (sharded CI flagged regressions but the net is positive). Use plain `--merge` (no `--admin`) when `mergeStateStatus: CLEAN`.

## Step 6: Close losers

```bash gh pr close <NUM> --comment "Net <DELTA> pass. <ROOT CAUSE IF KNOWN>. Reopening issue for a narrower retry." ```

## Step 7: Refresh ALL open PR branches (required after every wave)

After each merge, main advances. Every open PR branch needs origin/main merged in so the quality gate ("Verify origin/main is merged into branch") stays green. Do this for ALL open branches, not just DIRTY ones:

```bash gh pr list --state open --json number,headRefName --jq '.[].headRefName' | while read branch; do wt="/workspace/.claude/worktrees/$branch" if [ -d "$wt" ]; then git -C "$wt" fetch origin main git -C "$wt" merge origin/main --no-edit \ && git -C "$wt" push origin "$branch" \ && echo "✓ refreshed $branch" \ || echo "⚠ CONFLICT on $branch" else echo "→ no local worktree for $branch — send dev a refresh request" fi done ```

For every DIRTY (conflicting) PR with a good pre-wave delta, also `SendMessage` to the assigned dev:

> "PR #NNN conflicts with new main after today's merges. Please `git merge origin/main` in your worktree, resolve, push. Your pre-merge delta was +NNN."

## Step 8: Verify and log

```bash git fetch origin main --quiet git log --oneline origin/main -<NUM_MERGES+2> ```

Append to `plan/diary.md`: - PRs merged with deltas - PRs closed with reasons - Follow-up issues filed - Total net delta - Gap to next milestone

## Output

A short summary to the user:

``` Merged: #43 (+258), #68 (+106), #71 (+56), #64 (+34) Closed: #72 (catastrophic -18504), #75 (-114), #65 (orphaned +2) DIRTY: #74 (dev-1016 refreshing) Net: +454 pass. Baseline 20711 → ~21165. Gap to 50%: ~400. ```

## Notes

- **Baseline drift during merge:** the deltas you computed are vs the *old* baseline. Each merge adds its pass delta but also potentially introduces new regressions that weren't visible in per-PR CI. The final sharded refresh commit is the source of truth. - **Skip-CI tag on baseline refresh:** baseline commits include `[skip ci]` to avoid retriggering the sharded workflow. PR #70 added an explicit Pages deploy dispatch so the landing page still updates. - **Allow-regressions override:** if the post-merge sharded run fails on regressions, re-run with `gh workflow run "Test262 Sharded" --ref main -f allow_regressions=true` to force the baseline refresh.

Intended uses

  • Multiple PRs ready to merge after a morning of dev work
  • After a sprint's worth of issues finished CI at roughly the same time
  • When you want to cross a pass-rate milestone in one batch

Implementation notes

  • Review the source instructions and adapt inputs before running the workflow.

Try it, then tell us how it went

A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.