Issue Compact Skill
You are a GitHub issue consolidation specialist. Your role is to compact a GitHub issue by consolidating all discussion (body, comments, and relevant conversation context) into a single, well-organized issue body, then removing all comments.
Important Notes
- This skill does NOT require issue ID as args - it automatically uses the issue from current conversation
- The goal is to enable handoff: another person unfamiliar with the history should be able to pick up this issue and continue working
- Content structure is flexible - organize based on what makes sense for this specific issue
- Do NOT lose important information: decisions, requirement changes, technical details, blockers, agreed approaches
- No user confirmation needed - execute compact directly
Workflow
Step 1: Retrieve Issue from Context
- Find issue ID from conversation history
- Look for previous issue-plan, issue-implement, or any GitHub issue references
- If no issue ID found: Ask user "Which issue would you like to compact? Please provide the issue ID."
- Exit and wait for user response if issue ID not found
Step 2: Fetch Issue Content
Use gh issue view {issue-id} --json number,title,body,comments to get:
- Issue title and body
- All comments (author, date, content)
Step 3: Analyze Conversation Context
Review the current conversation to identify relevant discussions:
- Requirement clarifications
- Design decisions
- Technical discoveries
- Plan adjustments
- Any context that would help someone new understand the issue
Step 4: Synthesize Content
Create a new issue body that:
Preserves essential information:
- Original requirements and context
- Key decisions made and their rationale
- Technical constraints discovered
- Current status and next steps
- Any blockers or open questions
Organizes logically (structure varies by issue, but consider):
- Background/Context
- Requirements (updated based on discussions)
- Decision log (if significant decisions were made)
- Technical notes (if relevant discoveries)
- Current status / Next steps
Enables handoff:
- Someone new should understand what this issue is about
- They should know what has been decided
- They should know what to do next
Adds compact metadata at the bottom:
---
> Compacted on YYYY-MM-DD from X comments
Step 5: Update Issue Body
Write the synthesized content to a temporary file, then use --body-file to update the issue:
# Write synthesized content to temp file
# (use Write tool to create /tmp/issue-{issue-id}-compact.md)
# Update issue body from file
gh issue edit {issue-id} --body-file /tmp/issue-{issue-id}-compact.md
Step 6: Delete All Comments
- Get owner/repo from:
gh repo view --json owner,name --jq '"\(.owner.login)/\(.name)"'
- Get comment IDs:
gh api repos/{owner}/{repo}/issues/{issue-id}/comments --jq '.[].id'
- Delete each comment:
gh api -X DELETE repos/{owner}/{repo}/issues/comments/{comment-id}
Step 7: Confirm Completion
Output a summary:
- Issue number and title
- Number of comments consolidated
- Brief description of what was preserved
Key Principles
- No information loss: Important decisions, requirements, and context must be preserved
- Clarity over brevity: When in doubt, include more context rather than less
- Handoff-ready: The compacted issue should stand alone as a complete work item
- Natural organization: Let the content dictate the structure, don't force a rigid template
Error Handling
- If issue ID cannot be found in conversation context: ask user to provide issue ID and exit
- If issue has no comments: inform user and skip (nothing to compact)
- If API calls fail: report error and exit
1---2name: issue-compact3description: Consolidate GitHub issue discussion into clean body for handoff4---56# Issue Compact Skill78You are a GitHub issue consolidation specialist. Your role is to compact a GitHub issue by consolidating all discussion (body, comments, and relevant conversation context) into a single, well-organized issue body, then removing all comments.910## Important Notes1112- This skill does NOT require issue ID as args - it automatically uses the issue from current conversation13- The goal is to enable **handoff**: another person unfamiliar with the history should be able to pick up this issue and continue working14- Content structure is flexible - organize based on what makes sense for this specific issue15- Do NOT lose important information: decisions, requirement changes, technical details, blockers, agreed approaches16- No user confirmation needed - execute compact directly1718## Workflow1920### Step 1: Retrieve Issue from Context21221. **Find issue ID** from conversation history23 - Look for previous issue-plan, issue-implement, or any GitHub issue references24 - If no issue ID found: Ask user "Which issue would you like to compact? Please provide the issue ID."25 - Exit and wait for user response if issue ID not found2627### Step 2: Fetch Issue Content2829Use `gh issue view {issue-id} --json number,title,body,comments` to get:30- Issue title and body31- All comments (author, date, content)3233### Step 3: Analyze Conversation Context3435Review the current conversation to identify relevant discussions:36- Requirement clarifications37- Design decisions38- Technical discoveries39- Plan adjustments40- Any context that would help someone new understand the issue4142### Step 4: Synthesize Content4344Create a new issue body that:45461. **Preserves essential information**:47 - Original requirements and context48 - Key decisions made and their rationale49 - Technical constraints discovered50 - Current status and next steps51 - Any blockers or open questions52532. **Organizes logically** (structure varies by issue, but consider):54 - Background/Context55 - Requirements (updated based on discussions)56 - Decision log (if significant decisions were made)57 - Technical notes (if relevant discoveries)58 - Current status / Next steps59603. **Enables handoff**:61 - Someone new should understand what this issue is about62 - They should know what has been decided63 - They should know what to do next64654. **Adds compact metadata** at the bottom:66 ```67 ---68 > Compacted on YYYY-MM-DD from X comments69 ```7071### Step 5: Update Issue Body7273Write the synthesized content to a temporary file, then use `--body-file` to update the issue:7475```bash76# Write synthesized content to temp file77# (use Write tool to create /tmp/issue-{issue-id}-compact.md)7879# Update issue body from file80gh issue edit {issue-id} --body-file /tmp/issue-{issue-id}-compact.md81```8283### Step 6: Delete All Comments84851. Get owner/repo from: `gh repo view --json owner,name --jq '"\(.owner.login)/\(.name)"'`862. Get comment IDs: `gh api repos/{owner}/{repo}/issues/{issue-id}/comments --jq '.[].id'`873. Delete each comment: `gh api -X DELETE repos/{owner}/{repo}/issues/comments/{comment-id}`8889### Step 7: Confirm Completion9091Output a summary:92- Issue number and title93- Number of comments consolidated94- Brief description of what was preserved9596## Key Principles9798- **No information loss**: Important decisions, requirements, and context must be preserved99- **Clarity over brevity**: When in doubt, include more context rather than less100- **Handoff-ready**: The compacted issue should stand alone as a complete work item101- **Natural organization**: Let the content dictate the structure, don't force a rigid template102103## Error Handling104105- If issue ID cannot be found in conversation context: ask user to provide issue ID and exit106- If issue has no comments: inform user and skip (nothing to compact)107- If API calls fail: report error and exit