/ghp:wrap-issue — Close Out an Issue
Flow
Identify the issue. If not specified, infer from the current branch name. The branch naming convention encodes the issue number:
- Milestone issue:
m7/42-batch-tree-eval→ issue #42 - Sub-issue:
m7/42/43-fitness-function→ issue #43 - Standalone:
7-duplicate-fitness→ issue #7
- Milestone issue:
Check sub-issues. Run
gh issue-ext sub list <issue>to find sub-issues. Verify all are closed or ready to close. If any are still open, ask the user whether to close them or stop.Check blockers. Run
gh issue-ext blocking list <issue>to confirm no unresolved blockers remain.Determine the target branch from the current branch name:
- Sub-issue branch
m7/42/43-...→ PR targets the parent issue branchm7/42-... - Issue branch
m7/42-...→ PR targets the milestone branchm7-{name} - Standalone branch → PR targets main
- Sub-issue branch
Set issue status to Review in the Project using
gh pm move <issue> --status review(signals "work complete, PR open for review"). The built-in "Item closed" workflow auto-moves to Done when the PR merges and closes the issue.Create the PR. The PR body must include
closes #<issue>andcloses #<sub-issue>for every completed sub-issue:gh pr create --base m7-new-eval-strategy \ --title "feat(eval): batch tree evaluation #42" \ --body "## Summary <what changed> closes #42 closes #43 closes #44"Write a summary comment on the issue:
gh issue comment 42 --body "## Summary <brief description of what was done, key changes> PR: #N"Clean up branches. After the PR is created, ask the user via
AskUserQuestionwhat to do with the branch:Option Action Keep Leave the branch as-is Delete local only git branch -d <branch>Delete remote only git push origin --delete <branch>Delete both Delete local and remote If there are sub-issue branches that were merged into this branch, ask about each one separately. Switch to the target branch before deleting:
git checkout <target-branch>Notify the user with the PR URL and a summary of what was closed.