Smart GitHub Issue Creation
This skill helps create well-researched GitHub issues while preventing duplicates and wasted effort.
When to Use This Skill
Activate this skill when:
- You discover a bug or issue that's outside the current task's scope
- You notice something that should be fixed but isn't part of the current spec
- The user mentions wanting to "track this for later" or "create an issue"
- You find an improvement opportunity while working on something else
- The user explicitly asks to create an issue or file a bug
Workflow
Step 1: Clarify the Issue
If the issue description is vague or missing, ask the user:
"What issue would you like to create? Describe the bug, feature, or improvement."
Step 2: Check if Already Fixed/Implemented
Before creating, verify this isn't already solved:
Search codebase for related keywords:
# Use Grep/Glob to find relevant code
Check recent commits:
gh api repos/{owner}/{repo}/commits --jq '.[0:20] | .[] | "\(.sha[0:7]) \(.commit.message | split("\n")[0])"'
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"
Step 3: Check Existing GitHub Issues
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?"
- Options: "Add comment to existing", "View details", "Create anyway", "Cancel"
RELATED ISSUE:
"I found related issue #[number]. Your issue could be a comment, sub-issue, or separate. Preference?"
- Options: "Add as comment", "Create as sub-issue (I'll activate gh-subissues skill)", "Create separate issue"
CLOSED ISSUE:
"This was previously reported as #[number] and [fixed/rejected]. Context: [summary]. Still want to proceed?"
Step 4: Research Potential Solutions
If you have enough context:
- Explore codebase for patterns and relevant files
- Use web search via Task tool for best practices
- Formulate 1-3 approaches with:
- Brief description
- Files that would need changes
- Trade-offs (if applicable)
Step 5: Draft Issue Content
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.]
Step 6: Confirm Before Creating
Present your findings:
"Here's the issue I'm planning to create:
Title: [title]
Summary: [summary]
Key findings: [what you discovered]
Ready to create?"
Options: "Create the issue", "Edit first", "Show details", "Cancel"
Step 7: Create the Issue
gh issue create --title "type(area): description" --body "$(cat <<'EOF'
[structured content]
EOF
)"
Then display the URL and issue number.
Sub-Issue Support
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.
During Development: Out-of-Scope Issues
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.
Issue Title Conventions
Use conventional format:
fix(area): brief description - Bug fixes
feat(area): brief description - New features
refactor(area): brief description - Code improvements
docs(area): brief description - Documentation
chore(area): brief description - Maintenance
Notes
- Always prioritize preventing duplicates - saves everyone time
- Be thorough but concise - don't overwhelm the user
- For simple, clearly new issues, streamline the process
- Keep the user informed at each decision point
1---2name: new-issue-23description: 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. Triggers on phrases like "create an issue", "file a bug", "this should be tracked", "we should fix this later", "out of scope issue", "noticed a problem", "found a bug".4---56# Smart GitHub Issue Creation78This skill helps create well-researched GitHub issues while preventing duplicates and wasted effort.910## When to Use This Skill1112Activate this skill when:13- You discover a bug or issue that's **outside the current task's scope**14- You notice something that should be fixed but isn't part of the current spec15- The user mentions wanting to "track this for later" or "create an issue"16- You find an improvement opportunity while working on something else17- The user explicitly asks to create an issue or file a bug1819## Workflow2021### Step 1: Clarify the Issue2223If the issue description is vague or missing, ask the user:24> "What issue would you like to create? Describe the bug, feature, or improvement."2526### Step 2: Check if Already Fixed/Implemented2728Before creating, verify this isn't already solved:29301. **Search codebase** for related keywords:31 ```bash32 # Use Grep/Glob to find relevant code33 ```34352. **Check recent commits:**36 ```bash37 gh api repos/{owner}/{repo}/commits --jq '.[0:20] | .[] | "\(.sha[0:7]) \(.commit.message | split("\n")[0])"'38 ```39403. **If already fixed/implemented**, inform the user:41 > "It looks like this might already be addressed. I found [what you found]. Are you aware of this?"4243 Options: "Show me the existing solution", "Create the issue anyway", "Cancel"4445### Step 3: Check Existing GitHub Issues4647Search for duplicates:48491. **Search open issues:**50 ```bash51 gh issue list --state open --limit 50 --json number,title,body,labels,url52 ```53542. **Search closed issues:**55 ```bash56 gh issue list --state closed --limit 30 --json number,title,body,labels,url,closedAt57 ```58593. **Keyword search:**60 ```bash61 gh search issues --repo {owner}/{repo} "keywords" --limit 20 --json number,title,body,url,state62 ```63644. **Fetch details with comments for promising matches:**65 ```bash66 gh issue view <number> --json number,title,body,comments,labels,state67 ```68695. **Based on findings:**7071 **EXACT DUPLICATE:**72 > "I found an existing issue #[number] - [title] that matches this. What would you like to do?"73 - Options: "Add comment to existing", "View details", "Create anyway", "Cancel"7475 **RELATED ISSUE:**76 > "I found related issue #[number]. Your issue could be a comment, sub-issue, or separate. Preference?"77 - Options: "Add as comment", "Create as sub-issue (I'll activate gh-subissues skill)", "Create separate issue"7879 **CLOSED ISSUE:**80 > "This was previously reported as #[number] and [fixed/rejected]. Context: [summary]. Still want to proceed?"8182### Step 4: Research Potential Solutions8384If you have enough context:85861. **Explore codebase** for patterns and relevant files872. **Use web search** via Task tool for best practices883. **Formulate 1-3 approaches** with:89 - Brief description90 - Files that would need changes91 - Trade-offs (if applicable)9293### Step 5: Draft Issue Content9495Structure the issue:9697```markdown98## Summary99[1-2 sentences]100101## Context102[Background, how discovered, why it matters]103104## Current Behavior (for bugs)105[What happens now]106107## Expected Behavior108[What should happen]109110## Potential Implementation (optional)111### Approach 1: [Name]112- Description113- Files: `path/to/file.ts`114115## Additional Context116[Related issues, screenshots, etc.]117```118119### Step 6: Confirm Before Creating120121Present your findings:122> "Here's the issue I'm planning to create:123>124> **Title:** [title]125> **Summary:** [summary]126> **Key findings:** [what you discovered]127>128> Ready to create?"129130Options: "Create the issue", "Edit first", "Show details", "Cancel"131132### Step 7: Create the Issue133134```bash135gh issue create --title "type(area): description" --body "$(cat <<'EOF'136[structured content]137EOF138)"139```140141Then display the URL and issue number.142143## Sub-Issue Support144145To create as a sub-issue, say:146> "I'll activate the gh-subissues skill to create this as a sub-issue of #[parent]."147148Then use the Skill tool to invoke `gh-subissues`.149150## During Development: Out-of-Scope Issues151152When you notice an issue while working on something else:1531541. **Briefly mention it** to the user:155 > "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?"1561572. **If user agrees**, run through this workflow1583. **If user declines**, continue with the current task159160This prevents scope creep while ensuring important issues aren't forgotten.161162## Issue Title Conventions163164Use conventional format:165- `fix(area): brief description` - Bug fixes166- `feat(area): brief description` - New features167- `refactor(area): brief description` - Code improvements168- `docs(area): brief description` - Documentation169- `chore(area): brief description` - Maintenance170171## Notes172173- Always prioritize preventing duplicates - saves everyone time174- Be thorough but concise - don't overwhelm the user175- For simple, clearly new issues, streamline the process176- Keep the user informed at each decision point