name: investigate-issue description: Gather context and requirements for a GitHub issue using gh issue view and related commands disable-model-invocation: true
Investigate GitHub Issue
Investigate a GitHub issue to understand requirements and context.
Your Task
When given an issue number or URL, gather all relevant information.
Investigation Steps
1. View Issue Details
gh issue view {number} --json title,body,labels,milestone,state,comments,assignees
2. View Issue Comments
gh issue view {number} --comments
3. Check Related Issues
# Search for related issues
gh issue list --search "{keywords} in:title,body" --state all --limit 10
4. Check Linked PRs
# View PRs that reference this issue
gh pr list --search "#{number}" --state all
5. View Closed Related Issues
gh issue list --state closed --search "{keywords}" --limit 5 --json number,title,body
Output Format
Provide a summary including:
- Issue Overview: Title, state, labels, milestone
- Summary: What the issue is about
- Tasks: Outstanding tasks from the checkbox list
- Technical Context: Key technical details
- Acceptance Criteria: What defines "done"
- Related Issues/PRs: Any linked work
- Blockers: Any dependencies or blockers identified
Sub-Issues Investigation
If the issue has sub-issues:
# Get issue ID for GraphQL
gh issue view {number} --json id --jq ".id"
# Query sub-issues (if any)
gh api graphql \
-H "GraphQL-Features: sub_issues" \
-f query='
query($id: ID!) {
node(id: $id) {
... on Issue {
subIssues(first: 20) {
nodes {
number
title
state
}
}
}
}
}
' \
-f id="{issue_id}"
Instructions
- Fetch the full issue details
- Parse the body to identify tasks, technical details, and acceptance criteria
- Check for related issues and PRs
- Summarize findings for the user
- Identify any blockers or dependencies
- Suggest next steps if appropriate