GitHub Issue Organizer
Systematically inventory, classify, and organize open GitHub Issues.
Workflow
Run the following five steps in order.
Step 1: Understand the Current State
Use the gh CLI to fetch every open issue and summarize the current backlog.
Complete retrieval guarantee: gh issue list --limit is an upper bound, and the default limit is 30. Open issues beyond the limit are silently omitted. Do not let counting or retrieval stop at the default limit.
- Count issues with a sufficiently high limit:
gh issue list --state open --limit 100000 --json number --jq 'length'.
- Fetch all issues with a limit at least as large as the actual issue count. For large repositories, use
gh api --paginate "repos/{owner}/{repo}/issues?state=open&per_page=100" | jq -s 'add | [.[] | select(.pull_request | not)]'. --paginate emits one JSON array per page, so applying --jq page by page splits the result. Use jq -s 'add' to combine all pages first, then remove PRs returned by the Issues endpoint by excluding entries with .pull_request.
# Fetch all open issues with labels, author, and timestamps. Set --limit above the open issue count.
gh issue list --state open --limit 1000 --json number,title,labels,author,createdAt,updatedAt,body
# Count issues by label.
gh issue list --state open --limit 1000 --json labels --jq '[.[].labels[].name] | group_by(.) | map({label: .[0], count: length}) | sort_by(-.count)'
Summarize the result as a table:
| Item |
Count |
| Total open issues |
N |
| CodeRabbit-generated |
N |
| Human-reported |
N |
At this stage, use only two high-level buckets: generated and human-reported. Total equals CodeRabbit-generated plus human-reported. The CodeRabbit criteria are author coderabbitai or a label containing coderabbit; other bots such as github-actions[bot] are not CodeRabbit. Step 2 defines the detailed extraction commands. Treat Step 1 counts as a preliminary overview, then produce final category counts in Step 5 after classification.
Step 2: Classify Issues
Classify each issue into the categories below.
Classification Criteria
| Category |
Rule |
| CodeRabbit-generated |
Author is coderabbitai, or any label contains coderabbit. Other automation bots such as github-actions[bot] are not included; put non-CodeRabbit bot issues in Other. |
| Human-reported bug |
Issue has the bug label, or the title contains clear bug wording such as bug, defect, failure, or broken. |
| Human-reported feature request |
Labels include enhancement or feature. |
| Epic / refactoring |
Labels include refactoring or epic, or the title contains Phase or refactoring. |
| Other |
Every issue that does not match the four categories above, including human-created issues with no bug, feature, or epic signal, and non-CodeRabbit bot issues such as Dependabot. |
Evaluate categories from top to bottom and use the first match. After CodeRabbit-generated, check bug, then feature request, then Epic / refactoring, and finally Other. This guarantees every issue belongs to exactly one category and keeps Step 5 totals consistent. The reliable bug signal is the bug label; title keywords are best-effort language-dependent helpers. If an unlabeled issue is hard to classify mechanically, leave it in Other and ask for a label when needed.
Classification Commands
# Extract CodeRabbit-generated issues. Keep this aligned with the classification table.
gh issue list --state open --limit 1000 --json number,title,author,labels --jq '[.[] | select(.author.login == "coderabbitai" or (.labels | any(.name | ascii_downcase | contains("coderabbit"))))]'
# Extract human-reported issues by negating the CodeRabbit condition.
gh issue list --state open --limit 1000 --json number,title,author,labels --jq '[.[] | select((.author.login == "coderabbitai" or (.labels | any(.name | ascii_downcase | contains("coderabbit")))) | not)]'
Step 3: Group Related Work
Group classified issues by root cause or theme.
Grouping Dimensions
- Code area: target module, crate, package, service, or UI area.
- Root cause: shared design problem, such as locking strategy, type design, encapsulation, or error handling.
- Work granularity: independently fixable versus more efficient as a batch.
Output Format
## Group: [Theme]
- Related issues: #N, #M, #K
- Root cause: [Explanation]
- Proposed handling: [Individual / Batch]
- Estimated effort: [Small / Medium / Large]
Step 4: Decide Close Candidates With Code Verification
For each issue, decide whether it is already resolved by reading the current code.
Do not rely only on PR history or commit logs. Always inspect the current code.
Verification Steps
Run these steps for each issue:
Parse the issue body and extract:
- Target file paths
- Target symbols, such as function names, structs, classes, traits, or types
- The reported problem
- Quoted code snippets
Check whether the target code still exists:
# When a file path is known.
test -f <file-path>
# Search current code for symbols, function names, or type names.
rg -n "<symbol>|<function>|<type>" .
# Search for distinctive snippets or error messages from the issue.
rg -n "<distinctive-string>" .
If rg is unavailable, use the best available file-read or grep equivalent.
If the current path or name is found, continue to step 3.
If it is not found, do not immediately mark the target as gone. It may have been renamed, moved, or split. Track it through git history so a still-valid issue is not closed incorrectly:
# Track file renames and moves.
git log --follow -M --oneline -- <file-path>
git log -p -M --follow -- <file-path> # Inspect moved paths and changed content.
# Find where a symbol may have moved.
git log -S'<symbol>' --oneline --all # Commits where the string occurrence count changed.
git log -G'<symbol>' --oneline --all # Commits with diffs containing the string.
# Search broadly for possible renamed terms in the current codebase.
rg -n "<renamed-candidate>|<related-term>" .
- If a rename or move is found, inspect the new path or name in step 3. Do not treat it as gone.
- If git history shows deletion and no moved target, mark it as Target gone.
Git history is only for locating the current code. The resolved/unresolved decision must still come from reading the current implementation.
Read the relevant code for the target symbol, including renamed or moved targets:
# Read the relevant range when line numbers are known.
sed -n '<start-line>,<end-line>p' <file-path>
# Search around the target.
rg -n "<symbol>|<reported-pattern>" <file-path>
If a file-read tool is available, use it to inspect the relevant section directly.
Symbolic tools such as Serena may be used as optional helpers only when available; do not depend on them.
Check:
- Does the reported problematic pattern still exist?
- Did refactoring make the report obsolete?
- Has the exact requested fix already been applied?
Record one status for each issue:
| Status |
Rule |
Evidence format |
| Closable |
Current code shows the report has been resolved. |
"Checked <symbol> in <file>; the reported <problem> is resolved by <current implementation>." |
| Target gone |
The target file or symbol no longer exists, and git history shows no rename or move target. |
"<file> was deleted; git log --follow showed no moved target" or "<symbol> no longer exists." |
| Unresolved |
Current code still contains the reported problem. |
"Checked <symbol> in <file>; the reported <problem> still exists." |
| Needs confirmation |
Code alone cannot decide because the result depends on design intent or product direction. |
State why the decision cannot be made from code alone. |
| Duplicate |
The same report is already covered by another issue. |
State the duplicate issue number. |
Decision Principles
- Do not mark an issue as closable without reading code. Do not infer resolution from PR titles, commit messages, or merge history alone.
- Do not assume missing file or symbol equals deletion. Before using Target gone, follow renames and moves with
git log --follow -M, git log -S, and git log -G; if a moved target exists, inspect that current code.
- Inspect the relevant current code for every issue.
- CodeRabbit issues usually point to a concrete file and line, so inspect that exact location first.
- For large issue sets, use agent tooling to verify issues in parallel when available.
Close Comment Format
When closing an issue, include code-verification evidence in this format:
## Resolution Check
- Checked target: `<symbol>` in `<file-path>`
- Result: `<reported problem>` is resolved by `<specific current implementation>`
- Related: [PR #N / Refactoring Phase X] when applicable
Closing this issue.
Important: Do not close issues until the user approves the proposed close list. The skill may prepare the analysis automatically, but the actual close action requires user approval.
Step 5: Report
Report the analysis in the format below.
Summary
## Issue Inventory Summary
| Category | Count | Close candidates | Remaining |
|----------|-------|------------------|-----------|
| CodeRabbit-generated | N | N | N |
| Human-reported bug | N | N | N |
| Human-reported feature request | N | N | N |
| Epic / refactoring | N | N | N |
| Other | N | N | N |
| Total | N | N | N |
Close Candidates
## Close Candidates
| # | Title | Status | Checked location | Evidence |
|---|-------|--------|------------------|----------|
| #N | ... | Closable | `Bar::baz()` in `src/actor/foo.rs` | Reported mutex usage has been replaced with `Arc<RwLock>`. |
| #N | ... | Target gone | `src/old_module.rs` | File was deleted. |
| #N | ... | Duplicate | - | Same report as #M. |
Group Details
For each group, include:
- Related issues
- Root cause
- Recommended action: close, fix, or defer
- Batch proposal for issues that should be handled together
Priority Proposal
Recommend the order for remaining issues:
- High: Safety or correctness issues
- Medium: Design or maintainability improvements
- Low: Style or minor improvements
gh CLI Command Reference
# Detailed issue list.
gh issue list --state open --limit 1000 --json number,title,labels,author,createdAt,updatedAt,body,comments
# Issues with a specific label.
gh issue list --state open --limit 1000 --label "bug" --json number,title
# Issue details.
gh issue view <number> --json number,title,body,labels,author,comments
# Close an issue with a comment.
gh issue close <number> --comment "Reason"
# Add a label to an issue.
gh issue edit <number> --add-label "label-name"
# Recently merged PRs.
gh pr list --state merged --limit 50 --json number,title,mergedAt
# Files changed by a PR.
gh pr view <number> --json files
Notes
- Close decisions must be based on reading current code. Do not decide from PR history, commit messages, or titles alone.
- Close actions require user approval. The skill can prepare the findings, but the user must approve actual closures.
- Prefer
rg, file read, git log --follow -M, git log -S, and git log -G for code verification. Use symbolic tools such as Serena only as optional helpers when available.
- CodeRabbit issues usually include concrete file and line references, so inspect those locations directly.
- CodeRabbit issue sets can be large; group them first to understand the shape of the backlog before close-candidate verification.
- To process many issues efficiently, inspect issues about the same file together.
- When issue bodies are long, use
--jq to extract only the needed fields.
- Leave ambiguous issues as Needs confirmation and ask the user to decide.
1---2name: j5ik2o-gh-issue-organizer3description: Systematically inventory and organize GitHub Issues. Classify open issues, group related work, identify close candidates, prioritize remaining work, and propose useful batches. This includes separating CodeRabbit-generated issues from human-reported issues, grouping by root cause, and finding completed issues that can be closed. Trigger on GitHub Issue organization requests such as "organize issues", "triage GitHub issues", "audit open issues", "close stale issues", or "prioritize issues".4---56# GitHub Issue Organizer78Systematically inventory, classify, and organize open GitHub Issues.910## Workflow1112Run the following five steps in order.1314### Step 1: Understand the Current State1516Use the `gh` CLI to fetch every open issue and summarize the current backlog.1718> **Complete retrieval guarantee**: `gh issue list --limit` is an upper bound, and the default limit is 30. Open issues beyond the limit are silently omitted. Do not let counting or retrieval stop at the default limit.19> - Count issues with a sufficiently high limit: `gh issue list --state open --limit 100000 --json number --jq 'length'`.20> - Fetch all issues with a limit at least as large as the actual issue count. For large repositories, use `gh api --paginate "repos/{owner}/{repo}/issues?state=open&per_page=100" | jq -s 'add | [.[] | select(.pull_request | not)]'`. `--paginate` emits one JSON array per page, so applying `--jq` page by page splits the result. Use `jq -s 'add'` to combine all pages first, then remove PRs returned by the Issues endpoint by excluding entries with `.pull_request`.2122```bash23# Fetch all open issues with labels, author, and timestamps. Set --limit above the open issue count.24gh issue list --state open --limit 1000 --json number,title,labels,author,createdAt,updatedAt,body2526# Count issues by label.27gh issue list --state open --limit 1000 --json labels --jq '[.[].labels[].name] | group_by(.) | map({label: .[0], count: length}) | sort_by(-.count)'28```2930Summarize the result as a table:3132| Item | Count |33|------|-------|34| Total open issues | N |35| CodeRabbit-generated | N |36| Human-reported | N |3738> At this stage, use only two high-level buckets: generated and human-reported. Total equals CodeRabbit-generated plus human-reported. The CodeRabbit criteria are author `coderabbitai` or a label containing `coderabbit`; other bots such as `github-actions[bot]` are not CodeRabbit. Step 2 defines the detailed extraction commands. Treat Step 1 counts as a preliminary overview, then produce final category counts in Step 5 after classification.3940### Step 2: Classify Issues4142Classify each issue into the categories below.4344#### Classification Criteria4546| Category | Rule |47|----------|------|48| **CodeRabbit-generated** | Author is `coderabbitai`, or any label contains `coderabbit`. Other automation bots such as `github-actions[bot]` are not included; put non-CodeRabbit bot issues in Other. |49| **Human-reported bug** | Issue has the `bug` label, or the title contains clear bug wording such as `bug`, `defect`, `failure`, or `broken`. |50| **Human-reported feature request** | Labels include `enhancement` or `feature`. |51| **Epic / refactoring** | Labels include `refactoring` or `epic`, or the title contains `Phase` or `refactoring`. |52| **Other** | Every issue that does not match the four categories above, including human-created issues with no bug, feature, or epic signal, and non-CodeRabbit bot issues such as Dependabot. |5354> Evaluate categories from top to bottom and use the first match. After CodeRabbit-generated, check bug, then feature request, then Epic / refactoring, and finally Other. This guarantees every issue belongs to exactly one category and keeps Step 5 totals consistent. The reliable bug signal is the `bug` label; title keywords are best-effort language-dependent helpers. If an unlabeled issue is hard to classify mechanically, leave it in Other and ask for a label when needed.5556#### Classification Commands5758```bash59# Extract CodeRabbit-generated issues. Keep this aligned with the classification table.60gh issue list --state open --limit 1000 --json number,title,author,labels --jq '[.[] | select(.author.login == "coderabbitai" or (.labels | any(.name | ascii_downcase | contains("coderabbit"))))]'6162# Extract human-reported issues by negating the CodeRabbit condition.63gh issue list --state open --limit 1000 --json number,title,author,labels --jq '[.[] | select((.author.login == "coderabbitai" or (.labels | any(.name | ascii_downcase | contains("coderabbit")))) | not)]'64```6566### Step 3: Group Related Work6768Group classified issues by root cause or theme.6970#### Grouping Dimensions71721. **Code area**: target module, crate, package, service, or UI area.732. **Root cause**: shared design problem, such as locking strategy, type design, encapsulation, or error handling.743. **Work granularity**: independently fixable versus more efficient as a batch.7576#### Output Format7778```md79## Group: [Theme]80- Related issues: #N, #M, #K81- Root cause: [Explanation]82- Proposed handling: [Individual / Batch]83- Estimated effort: [Small / Medium / Large]84```8586### Step 4: Decide Close Candidates With Code Verification8788For each issue, decide whether it is already resolved by **reading the current code**.89Do not rely only on PR history or commit logs. Always inspect the current code.9091#### Verification Steps9293**Run these steps for each issue:**94951. **Parse the issue body** and extract:96 - Target file paths97 - Target symbols, such as function names, structs, classes, traits, or types98 - The reported problem99 - Quoted code snippets1001012. **Check whether the target code still exists**:102 ```bash103 # When a file path is known.104 test -f <file-path>105106 # Search current code for symbols, function names, or type names.107 rg -n "<symbol>|<function>|<type>" .108109 # Search for distinctive snippets or error messages from the issue.110 rg -n "<distinctive-string>" .111 ```112 If `rg` is unavailable, use the best available file-read or grep equivalent.113 If the current path or name is found, continue to step 3.114115 **If it is not found, do not immediately mark the target as gone.** It may have been renamed, moved, or split. Track it through git history so a still-valid issue is not closed incorrectly:116 ```bash117 # Track file renames and moves.118 git log --follow -M --oneline -- <file-path>119 git log -p -M --follow -- <file-path> # Inspect moved paths and changed content.120121 # Find where a symbol may have moved.122 git log -S'<symbol>' --oneline --all # Commits where the string occurrence count changed.123 git log -G'<symbol>' --oneline --all # Commits with diffs containing the string.124125 # Search broadly for possible renamed terms in the current codebase.126 rg -n "<renamed-candidate>|<related-term>" .127 ```128 - If a rename or move is found, inspect the new path or name in step 3. Do not treat it as gone.129 - If git history shows deletion and no moved target, mark it as **Target gone**.130131 Git history is only for locating the current code. The resolved/unresolved decision must still come from reading the current implementation.1321333. **Read the relevant code** for the target symbol, including renamed or moved targets:134 ```bash135 # Read the relevant range when line numbers are known.136 sed -n '<start-line>,<end-line>p' <file-path>137138 # Search around the target.139 rg -n "<symbol>|<reported-pattern>" <file-path>140 ```141 If a file-read tool is available, use it to inspect the relevant section directly.142 Symbolic tools such as Serena may be used as optional helpers only when available; do not depend on them.143144 Check:145 - Does the reported problematic pattern still exist?146 - Did refactoring make the report obsolete?147 - Has the exact requested fix already been applied?1481494. **Record one status for each issue**:150151| Status | Rule | Evidence format |152|--------|------|-----------------|153| **Closable** | Current code shows the report has been resolved. | "Checked `<symbol>` in `<file>`; the reported `<problem>` is resolved by `<current implementation>`." |154| **Target gone** | The target file or symbol no longer exists, and git history shows no rename or move target. | "`<file>` was deleted; `git log --follow` showed no moved target" or "`<symbol>` no longer exists." |155| **Unresolved** | Current code still contains the reported problem. | "Checked `<symbol>` in `<file>`; the reported `<problem>` still exists." |156| **Needs confirmation** | Code alone cannot decide because the result depends on design intent or product direction. | State why the decision cannot be made from code alone. |157| **Duplicate** | The same report is already covered by another issue. | State the duplicate issue number. |158159#### Decision Principles160161- **Do not mark an issue as closable without reading code**. Do not infer resolution from PR titles, commit messages, or merge history alone.162- **Do not assume missing file or symbol equals deletion**. Before using Target gone, follow renames and moves with `git log --follow -M`, `git log -S`, and `git log -G`; if a moved target exists, inspect that current code.163- Inspect the relevant current code for every issue.164- CodeRabbit issues usually point to a concrete file and line, so inspect that exact location first.165- For large issue sets, use agent tooling to verify issues in parallel when available.166167#### Close Comment Format168169When closing an issue, include code-verification evidence in this format:170171```md172## Resolution Check173174- Checked target: `<symbol>` in `<file-path>`175- Result: `<reported problem>` is resolved by `<specific current implementation>`176- Related: [PR #N / Refactoring Phase X] when applicable177178Closing this issue.179```180181**Important**: Do not close issues until the user approves the proposed close list. The skill may prepare the analysis automatically, but the actual close action requires user approval.182183### Step 5: Report184185Report the analysis in the format below.186187#### Summary188189```md190## Issue Inventory Summary191192| Category | Count | Close candidates | Remaining |193|----------|-------|------------------|-----------|194| CodeRabbit-generated | N | N | N |195| Human-reported bug | N | N | N |196| Human-reported feature request | N | N | N |197| Epic / refactoring | N | N | N |198| Other | N | N | N |199| Total | N | N | N |200```201202#### Close Candidates203204```md205## Close Candidates206207| # | Title | Status | Checked location | Evidence |208|---|-------|--------|------------------|----------|209| #N | ... | Closable | `Bar::baz()` in `src/actor/foo.rs` | Reported mutex usage has been replaced with `Arc<RwLock>`. |210| #N | ... | Target gone | `src/old_module.rs` | File was deleted. |211| #N | ... | Duplicate | - | Same report as #M. |212```213214#### Group Details215216For each group, include:217218- Related issues219- Root cause220- Recommended action: close, fix, or defer221- Batch proposal for issues that should be handled together222223#### Priority Proposal224225Recommend the order for remaining issues:2262271. **High**: Safety or correctness issues2282. **Medium**: Design or maintainability improvements2293. **Low**: Style or minor improvements230231## gh CLI Command Reference232233```bash234# Detailed issue list.235gh issue list --state open --limit 1000 --json number,title,labels,author,createdAt,updatedAt,body,comments236237# Issues with a specific label.238gh issue list --state open --limit 1000 --label "bug" --json number,title239240# Issue details.241gh issue view <number> --json number,title,body,labels,author,comments242243# Close an issue with a comment.244gh issue close <number> --comment "Reason"245246# Add a label to an issue.247gh issue edit <number> --add-label "label-name"248249# Recently merged PRs.250gh pr list --state merged --limit 50 --json number,title,mergedAt251252# Files changed by a PR.253gh pr view <number> --json files254```255256## Notes257258- **Close decisions must be based on reading current code**. Do not decide from PR history, commit messages, or titles alone.259- **Close actions require user approval**. The skill can prepare the findings, but the user must approve actual closures.260- Prefer `rg`, file read, `git log --follow -M`, `git log -S`, and `git log -G` for code verification. Use symbolic tools such as Serena only as optional helpers when available.261- CodeRabbit issues usually include concrete file and line references, so inspect those locations directly.262- CodeRabbit issue sets can be large; group them first to understand the shape of the backlog before close-candidate verification.263- To process many issues efficiently, inspect issues about the same file together.264- When issue bodies are long, use `--jq` to extract only the needed fields.265- Leave ambiguous issues as Needs confirmation and ask the user to decide.