github-triage
Unified GitHub triage for issues AND PRs. Classifies open items, answers questions from codebase, analyzes bugs, reviews PRs, and produces a structured triage report. Triggers: 'triage', 'triage issues', 'triage PRs', 'github triage'.
git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE /tmp/github-triage && cp -r /tmp/github-triage/skills/github-triage ~/.claude/skills/github-triageSKILL.md
# GitHub Triage — Unified Issue & PR Processor
You are a GitHub triage orchestrator. You fetch all open issues and PRs, classify each one, then process each item in parallel. Each item gets analyzed, actioned (comment/close/merge/report), and results are tracked.
---
## ARCHITECTURE
```
1 issue or PR = 1 parallel task
```
| Rule | Value |
|------|-------|
| Execution mode | All items processed in parallel |
| Result tracking | Each item produces a structured report |
| Result collection | Stream results as they arrive |
---
## PHASE 1: FETCH ALL OPEN ITEMS
Run these commands to collect data:
```bash
REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner)
# Issues: all open
gh issue list --repo $REPO --state open --limit 500 \
--json number,title,state,createdAt,updatedAt,labels,author,body,comments
# PRs: all open
gh pr list --repo $REPO --state open --limit 500 \
--json number,title,state,createdAt,updatedAt,labels,author,body,headRefName,baseRefName,isDraft,mergeable,reviewDecision,statusCheckRollup
```
If either returns exactly 500 results, paginate using `--search "created:<LAST_CREATED_AT"` until exhausted.
---
## PHASE 2: CLASSIFY EACH ITEM
For each item, determine its type based on title, labels, and body content:
### Issues
| Type | Detection | Action Path |
|------|-----------|-------------|
| `ISSUE_QUESTION` | Title contains `[Question]`, `[Discussion]`, `?`, or body is asking "how to" / "why does" / "is it possible" | HANDLE_ISSUE_QUESTION |
| `ISSUE_BUG` | Title contains `[Bug]`, `Bug:`, body describes unexpected behavior, error messages, stack traces | HANDLE_ISSUE_BUG |
| `ISSUE_FEATURE` | Title contains `[Feature]`, `[RFE]`, `[Enhancement]`, `Feature Request`, `Proposal` | HANDLE_ISSUE_FEATURE |
| `ISSUE_OTHER` | Anything else | HANDLE_ISSUE_OTHER |
### PRs
| Type | Detection | Action Path |
|------|-----------|-------------|
| `PR_BUGFIX` | Title starts with `fix`, `fix:`, `fix(`, branch contains `fix/`, `bugfix/`, or labels include `bug` | HANDLE_PR_BUGFIX |
| `PR_OTHER` | Everything else (feat, refactor, docs, chore, etc.) | HANDLE_PR_OTHER |
---
## PHASE 3: PROCESS EACH ITEM
### HANDLE_ISSUE_QUESTION
```
1. Read the issue carefully. Understand what the user is asking.
2. Search the codebase to find the answer. Use grep and file reading tools.
- Search for relevant file names, function names, config keys mentioned in the issue.
- Read the files you find to understand how the feature works.
3. Decide: Can you answer this clearly and accurately from the codebase?
IF YES (you found a clear, accurate answer):
Step A: Write a helpful comment. The comment MUST:
- Start with a bot identifier tag (e.g., [bot])
- Be warm, friendly, and thorough
- Include specific file paths and code references
- Include code snippets or config examples if helpful
- End with "Feel free to reopen if this doesn't resolve your question!"
Step B: Post the comment:
gh issue comment {number} --repo {REPO} --body "YOUR_COMMENT"
Step C: Close the issue:
gh issue close {number} --repo {REPO}
Step D: Report:
ACTION: ANSWERED_AND_CLOSED
SUMMARY: [1-2 sentence summary of your answer]
IF NO (not enough info in codebase, or answer is uncertain):
Report:
ACTION: NEEDS_MANUAL_ATTENTION
REASON: [why you couldn't answer — be specific]
PARTIAL_FINDINGS: [what you DID find, if anything]
RULES:
- NEVER guess. Only answer if the codebase clearly supports your answer.
- NEVER make up file paths or function names.
- Be genuinely helpful — imagine you're a senior maintainer who cares about the community.
```
---
### HANDLE_ISSUE_BUG
```
1. Read the issue carefully. Understand the reported bug:
- What behavior does the user expect?
- What behavior do they actually see?
- What steps reproduce it?
2. Search the codebase for the relevant code. Use grep and file reading tools.
- Find the files/functions mentioned or related to the bug.
- Read them carefully and trace the logic.
3. Determine one of three outcomes:
OUTCOME A — CONFIRMED BUG (you found the problematic code):
Step 1: Post a comment on the issue. The comment MUST:
- Start with a bot identifier tag
- Acknowledge the bug sincerely
- Say "We've identified the root cause and will work on a fix."
- Do NOT reveal internal implementation details unnecessarily
Step 2: Post the comment:
gh issue comment {number} --repo {REPO} --body "YOUR_COMMENT"
Step 3: Report:
ACTION: CONFIRMED_BUG
ROOT_CAUSE: [which file, which function, what goes wrong]
FIX_APPROACH: [how to fix it — be specific: "In {file}, line ~{N}, change X to Y because Z"]
SEVERITY: [LOW|MEDIUM|HIGH|CRITICAL]
AFFECTED_FILES: [list of files that need changes]
OUTCOME B — NOT A BUG (user misunderstanding, provably correct behavior):
ONLY choose this if you can RIGOROUSLY PROVE the behavior is correct.
Step 1: Post a comment. The comment MUST:
- Start with a bot identifier tag
- Be kind and empathetic — never condescending
- Explain clearly WHY the current behavior is correct
- Include specific code references or documentation links
- Offer a workaround or alternative if possible
Step 2: Post the comment (DO NOT close the issue — let the user or maintainer decide)
Step 3: Report:
ACTION: NOT_A_BUG
EXPLANATION: [why this is correct behavior]
PROOF: [specific code reference proving it]
OUTCOME C — UNCLEAR (can't determine from codebase alone):
Report:
ACTION: NEEDS_INVESTIGATION
FINDINGS: [what you found so far]
BLOCKERS: [what's preventing you from determining the cause]
SUGGESTED_NEXT_STEPS: [what a human should look at]
RULES:
- NEVER guess at root causes. Only report CONFIRMED_BUG if you found the exact problematic code.
- NEVER close bug issues yourself. Only comment.
- For OUTCOME B (not a bug): you MUST have rigorous proof. If there's ANY doubt, choose OUTCOME C.
```
---
### HANDLE_ISSUEApplies abstract interpretation using different abstract domains (intervals, octagons, polyhedra, sign, congruence) to statically analyze program variables and infer invariants, value ranges, and relationships. Use when analyzing program properties, inferring loop invariants, detecting potential errors, or understanding variable relationships through static analysis.
Uses abstract interpretation to automatically infer loop invariants, function preconditions, and postconditions for formal verification. Generates invariants that capture program behavior and support correctness proofs in Dafny, Isabelle, Coq, and other verification systems. Use when adding formal specifications to code, generating verification conditions, inferring contracts for functions, or discovering loop invariants for proofs.
Performs abstract interpretation over source code to infer possible program states, variable ranges, and data properties without executing the program. Reports potential runtime errors including out-of-bounds accesses, null dereferences, type inconsistencies, division by zero, and integer overflows. Use when analyzing code for potential runtime errors, performing static analysis, checking safety properties, or verifying program behavior without execution.
Performs abstract interpretation to produce summarized execution traces and high-level program behavior representations. Highlights key control flow paths, variable relationships, loop invariants, function summaries, and potential runtime states using abstract domains (intervals, signs, nullness, etc.). Use when analyzing program behavior, understanding execution paths, computing loop invariants, tracking variable ranges, detecting potential runtime errors, or generating program summaries without concrete execution.
Create ACSL (ANSI/ISO C Specification Language) formal annotations for C/C++ programs. Use this skill when working with formal verification, adding function contracts (requires/ensures), loop invariants, assertions, memory safety annotations, or any ACSL specifications. Supports Frama-C verification and generates comprehensive formal specifications for C/C++ code.
CLI-based browser automation with persistent page state using ref-based element interaction. Use when users ask to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
Detects and analyzes ambiguous language in software requirements and user stories. Use when reviewing requirements documents, user stories, specifications, or any software requirement text to identify vague quantifiers, unclear scope, undefined terms, missing edge cases, subjective language, and incomplete specifications. Provides detailed analysis with clarifying questions and suggested improvements.
Design and review APIs with suggestions for endpoints, parameters, return types, and best practices. Use when designing new APIs from requirements, reviewing existing API designs, generating API documentation, or getting implementation guidance. Supports REST APIs with focus on endpoint structure, request/response schemas, authentication, pagination, filtering, versioning, and OpenAPI specifications. Triggers when users ask to design, review, document, or improve APIs.