Systematically analyze open issues in target repositories, score them by fixability, and select the best candidates to work on. Produces a structured analysis document with root cause hypotheses and fix approaches.
Use cases: Open-source contribution targeting, sprint planning, backlog grooming, bug triage.
GitHub CLI must be authenticated — issue fetching relies on gh API calls:
bash
gh auth status # Must show "Logged in"
If not configured, ask the user to provide:
gh auth login or set export GH_TOKEN=<token>Without auth, API rate limits will block bulk issue fetching.
For each target repository, fetch open issues:
bash
# Fetch bug-labeled issues
gh issue list --repo {owner}/{repo} --label bug --state open --limit 30 \
--json number,title,body,labels,comments,createdAt,updatedAt
# Also check these labels
gh issue list --repo {owner}/{repo} --label "good first issue" --state open --limit 10 \
--json number,title,body,labels,comments,createdAt
gh issue list --repo {owner}/{repo} --label "help wanted" --state open --limit 10 \
--json number,title,body,labels,comments,createdAt
If no label filtering works, fetch recent open issues:
bash
gh issue list --repo {owner}/{repo} --state open --limit 50 \
--json number,title,body,labels,comments,createdAt
Rate each issue on these factors:
Factor3 (High)2 (Medium)1 (Low)ReproducibilityClear repro steps, stack tracePartial descriptionVague "doesn't work"ScopeSingle module/file2-3 filesCross-cutting concernComplexityLogic bug, missing checkAlgorithm issueArchitecture redesignCommunity signalMultiple reports, 👍Some engagementSingle report, no reactionFreshnessRecent, no PR attemptsModerate ageOld, multiple failed PRsTestabilityCan write automated testPartially testableManual testing only
Total score = sum of all factors (max 18).
Selection criteria (in priority order):
Red flags — skip issues if:
gh pr list --repo owner/repo --search "fixes #{number}")For each selected issue:
Write {workspace}/issue-analysis.md:
markdown
# Issue Analysis — {Repository/Campaign Name}
> Generated: {date}
## Summary
| # | Repository | Issue | Title | Score | Effort | Status |
|---|-----------|-------|-------|-------|--------|--------|
| 1 | owner/repo | #123 | Bug title | 16/18 | Low | Selected |
| 2 | owner/repo | #456 | Bug title | 12/18 | Medium | Selected |
| 3 | owner/repo | #789 | Bug title | 8/18 | High | Skipped |
---
## Detailed Analysis
### owner/repo — Selected: #123 — Bug title
- **Score**: 16/18 (Repro: 3, Scope: 3, Complexity: 3, Signal: 2, Fresh: 3, Testable: 2)
- **Root cause**: {hypothesis}
- **Fix approach**: {description}
- **Files to modify**: `path/to/file.py`, `tests/test_file.py`
- **Effort estimate**: Low (< 1 hour)
- **Risk**: Low — straightforward null check
- **Dependencies**: None
### owner/repo — Skipped: #789 — Bug title
- **Reason**: Requires architecture redesign, score 8/18
{workspace}/issue-analysis.md — Per-repo issue analysis with selections