Collect pending worktree commits into a PR for review. Use this skill when subdirectory worktrees have accumulated 4-7+ commits that should be batched together and submitted for review...
You are a coordinator agent that gathers matched function commits from subdirectory worktrees into PRs for review. Your job is to batch commits efficiently and create well-organized pull requests.
Use /collect-for-pr when:
melee-agent worktree list --commits
This shows all subdirectory worktrees with their pending commits. Look for:
Automatic limits: The collect command now automatically limits PRs to 7 function match commits by default. Fix-up commits (build fixes, header updates, etc.) don't count toward this limit.
--max-functions N to adjust the limit--no-limit to collect all pending commitsAlways preview what will be collected. The --source-dir parameter is required:
melee-agent worktree collect --source-dir lb --dry-run
This shows:
Review the output for:
If the dry run looks good, collect and create the PR:
melee-agent worktree collect --source-dir lb --create-pr
This will:
upstream/master (named batch/lb-YYYYMMDD)Custom branch name (optional):
melee-agent worktree collect --source-dir lb --create-pr --branch "batch/lb-module-cleanup"
If cherry-picks fail:
For failed commits:
After creating the PR, use the feedback command to monitor for issues:
# Get all PR feedback in one call
melee-agent pr feedback https://github.com/doldecomp/melee/pull/XXXX
# JSON output for automated processing
melee-agent pr feedback https://github.com/doldecomp/melee/pull/XXXX --json
This command consolidates:
If issues are found:
melee-agent pr feedback to verify fixesAfter the PR is merged, clean up empty worktrees:
melee-agent worktree prune --dry-run # Preview
melee-agent worktree prune # Execute
Each subdirectory worktree is collected separately. Consider each subdirectory independently:
| Situation | Recommendation |
|---|---|
| 5-7 function matches in a subdirectory | Yes, good batch size (default limit) |
| 8+ function matches | Run collect (it will auto-limit to 7, defer the rest) |
| 2-4 function matches but work has stopped | Yes, ship what's ready |
| 1-2 function matches with active work ongoing | Wait for more |
| Many fix-up commits | Include them - they don't count toward limit |
Note: The --max-functions limit only counts function match commits. Fix-up commits
(build fixes, header updates, signature changes) are always included and don't count.
worktree listShows all subdirectory worktrees with status:
worktree collect --source-dir <subdir>Cherry-picks commits from a specific subdirectory branch:
--source-dir to specify which subdirectory to collectbatch/<subdir>-YYYYMMDD)--create-prworktree pruneRemoves worktrees with no pending commits:
--force to remove with uncommitted changes--max-age N to only prune old worktreespr feedback <url>Gets all feedback on a PR in one call:
--json for agent-friendly output# Check what's available
melee-agent worktree list --commits
# Output shows:
# lb: 6 commits (match, match, match, fixup, match, match)
# ft-chara-ftFox: 2 commits (match, fixup)
# gr: 2 commits (match, match)
# Preview collection for lb subdirectory
melee-agent worktree collect --source-dir lb --dry-run
# Shows commits from lb that will be cherry-picked
# Classifies each as [match] or [fixup]
# Create the PR for lb
melee-agent worktree collect --source-dir lb --create-pr
# Creates batch/lb-20241230 branch, cherry-picks commits, creates PR
# Returns PR URL: https://github.com/doldecomp/melee/pull/XXXX
# Monitor PR for issues
melee-agent pr feedback https://github.com/doldecomp/melee/pull/XXXX
# Shows CI status, review comments, decomp-dev report, action items
# If CI fails or reviewers request changes, fix and push
# Then re-check:
melee-agent pr feedback https://github.com/doldecomp/melee/pull/XXXX
# After PR merges, clean up
melee-agent worktree prune
IMPORTANT: Before creating a PR, you MUST review ALL commits in the batch against this checklist. These are common issues identified from doldecomp/melee PR reviews:
Run melee-agent hook validate - ALL issues below will block the commit:
Use true/false not TRUE/FALSE
Float literals need F suffix
1.0F not 1.0 for f32 valuesHex literals use uppercase
0xABCD not 0xabcdDon't use raw struct accesses/pointer arithmetic
*(s32*)((u8*)ptr + 0x10)M2C_FIELD(ptr, 0x10, s32) or fill in actual struct fieldsDon't add unnecessary extern declarations
extern UNK_T lbl_804D1234; at file topDon't rename descriptive symbols to address-based names
ItemStateTable_GShell → it_803F5BA8clang-format must pass
git clang-format before committingsymbols.txt must be updated
No implicit function declarations
Header signatures must match implementations
No local scratch URLs in commits
melee-agent sync production before committing to sync scratchesnzxt-discord.local, 10.200.0.1, localhost:8000 will be rejectedUse bool return type for boolean functions
bool not s32Change argument/field types instead of casting
Keep temporary struct types instead of raw pointer arithmetic
Don't modify unrelated files
.gitkeep), revert itDon't mess with NonMatching/symbols.txt incorrectly
Always use m2c first
Before running melee-agent worktree collect --create-pr:
# 1. Run automated checks
melee-agent hook validate -v
# 2. Review each commit's diff for manual issues
git log upstream/master..HEAD --oneline # List commits
git show <hash> # Review each commit
# 3. Search for common issues
grep -r "TRUE\|FALSE" melee/src/ # Boolean literals
grep -rn "0x[0-9a-f]*[a-f]" melee/src/ # Lowercase hex
# 4. If issues found, fix them BEFORE creating PR
# Make fix commits on the subdirectory worktrees
| Issue | Solution |
|---|---|
| Branch already exists | Use --branch to specify different name |
| Cherry-pick conflict | Commits stay on subdirectory branch for later |
| No pending commits | Nothing to collect - keep working |
| Push failed | Check git remote auth, push manually if needed |
| PR creation failed | Branch is ready, create PR manually via GitHub |
/decomp: Commits accumulate on subdirectory worktrees/decomp-fixup: Check if fixes should go in same batch