# Ghp:wrap Issue

> Close out an issue. Writes a summary comment, creates a PR to the milestone branch (or main for standalone issues), and closes all completed sub-issues.

- Skill: `fredericosantos/ghp-wrap-issue` (Agent Skill)
- Install (CLI): `npx skillmds@latest add fredericosantos/ghp-wrap-issue`
- Raw SKILL.md: https://api.skillmd.com/api/skills/fredericosantos/ghp-wrap-issue/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: fredericosantos (https://skillmd.com/u/fredericosantos)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/fredericosantos/ghp-wrap-issue

---


# /ghp:wrap-issue — Close Out an Issue

## Flow

1. **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

2. **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.

3. **Check blockers.** Run `gh issue-ext blocking list <issue>` to confirm no unresolved blockers remain.

4. **Determine the target branch** from the current branch name:
   - Sub-issue branch `m7/42/43-...` → PR targets the parent issue branch `m7/42-...`
   - Issue branch `m7/42-...` → PR targets the milestone branch `m7-{name}`
   - Standalone branch → PR targets main

5. **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.

6. **Create the PR.** The PR body must include `closes #<issue>` and `closes #<sub-issue>` for every completed sub-issue:

   ```bash
   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"
   ```

7. **Write a summary comment** on the issue:
   ```bash
   gh issue comment 42 --body "## Summary
   <brief description of what was done, key changes>

   PR: #N"
   ```

8. **Clean up branches.** After the PR is created, ask the user via `AskUserQuestion` what 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:
   ```bash
   git checkout <target-branch>
   ```

9. **Notify the user** with the PR URL and a summary of what was closed.

