Create GitHub issues with duplicate detection and codebase analysis. Use when you discover a bug, improvement, or issue that wasn't in the original scope/spec during development...
This skill helps create well-researched GitHub issues while preventing duplicates and wasted effort.
Activate this skill when:
If the issue description is vague or missing, ask the user:
"What issue would you like to create? Describe the bug, feature, or improvement."
Before creating, verify this isn't already solved:
Search codebase for related keywords:
# Use Grep/Glob to find relevant code
Check recent commits (filter by relevant keywords):
# Generic recent commits
gh api repos/{owner}/{repo}/commits --jq '.[0:20] | .[] | "\(.sha[0:7]) \(.commit.message | split("\n")[0])"'
# Targeted search for specific keywords (more useful)
gh api repos/{owner}/{repo}/commits --jq '[.[] | select(.commit.message | test("KEYWORD1|KEYWORD2"; "i"))] | .[0:10] | .[] | "\(.sha[0:7]) \(.commit.message | split("\n")[0])"'
Replace KEYWORD1|KEYWORD2 with terms relevant to the issue (e.g., "retweet|repost" for a retweet bug).
If already fixed/implemented, inform the user:
"It looks like this might already be addressed. I found [what you found]. Are you aware of this?"
Options: "Show me the existing solution", "Create the issue anyway", "Cancel"
Search for duplicates:
Search open issues:
gh issue list --state open --limit 50 --json number,title,body,labels,url
Search closed issues:
gh issue list --state closed --limit 30 --json number,title,body,labels,url,closedAt
Keyword search:
gh search issues --repo {owner}/{repo} "keywords" --limit 20 --json number,title,body,url,state
Fetch details with comments for promising matches:
gh issue view <number> --json number,title,body,comments,labels,state
Based on findings:
EXACT DUPLICATE:
"I found an existing issue #[number] - [title] that matches this. What would you like to do?"
RELATED ISSUE:
"I found related issue #[number]. Your issue could be a comment, sub-issue, or separate. Preference?"
CLOSED ISSUE:
"This was previously reported as #[number] and [fixed/rejected]. Context: [summary]. Still want to proceed?"
If you have enough context:
Structure the issue:
## Summary
[1-2 sentences]
## Context
[Background, how discovered, why it matters]
## Current Behavior (for bugs)
[What happens now]
## Expected Behavior
[What should happen]
## Potential Implementation (optional)
### Approach 1: [Name]
- Description
- Files: `path/to/file.ts`
## Additional Context
[Related issues, screenshots, etc.]
Present a concise summary (don't overwhelm with details upfront):
"Ready to create issue:
Title: [title] Summary: [1-2 sentences max]
Does this look good?"
Options: "Create the issue", "Show more details", "Edit first", "Cancel"
If user selects "Show more details", then display:
gh issue create --title "type(area): description" --body "$(cat <<'EOF'
[structured content]
EOF
)"
Then display the URL and issue number.
To create as a sub-issue, say:
"I'll activate the gh-subissues skill to create this as a sub-issue of #[parent]."
Then use the Skill tool to invoke gh-subissues.
When you notice an issue while working on something else:
Briefly mention it to the user:
"While working on [current task], I noticed [issue]. This seems out of scope for the current work. Would you like me to create an issue to track this for later?"
If user agrees, run through this workflow
If user declines, continue with the current task
This prevents scope creep while ensuring important issues aren't forgotten.
Use conventional format:
fix(area): brief description - Bug fixesfeat(area): brief description - New featuresrefactor(area): brief description - Code improvementsdocs(area): brief description - Documentationchore(area): brief description - MaintenanceIf the user provides screenshots or images for the issue:
.context/attachments/)# Create or reuse a draft release for issue assets
gh release view issue-assets 2>/dev/null || \
gh release create issue-assets --draft --title "Issue Assets" --notes "Screenshots for issues"
# Copy and rename with issue prefix (e.g., 216-description.png)
cp "path/to/screenshot.png" /tmp/{issue#}-{description}.png
# Upload the renamed file
gh release upload issue-assets /tmp/{issue#}-{description}.png
# Get the URL
gh release view issue-assets --json assets --jq '.assets[] | select(.name | startswith("{issue#}")) | "\(.name): \(.url)"'
gh issue edit {issue#} --body "$(cat <<'EOF'
[issue body with images]

EOF
)"
Naming convention: {issue#}-{description}.png (e.g., 216-xfeed-display.png, 216-xcom-expected.png)
Note: The gh CLI cannot upload images directly to issues (feature requested since 2020). Release assets are the cleanest workaround that keeps images within the repo's GitHub ecosystem.