Triage issue

From softspark/ai-toolkit · View interactive version

Triage issue is an AI agent skill from the GitHub repository softspark/ai-toolkit. Triage an existing GitHub issue or investigate a new bug report. Review reporter updates, distinguish bugs from decisions, and file new bugs with a TDD fix plan.

How to use this skill

Skill file

Triage Issue

$ARGUMENTS

Usage

/triage-issue #42
/triage-issue 42
/triage-issue https://github.com/owner/repo/issues/42
/triage-issue Export loses the last row when the filter is active

Treat a standalone positive number, #number, or canonical GitHub issue URL as an existing issue. Follow an explicitly named issue when the user adds instructions. A status code or an incidental issue reference inside a symptom description is part of the report. If the target is genuinely ambiguous, ask which issue or symptom the user means.

Existing issue

An issue number uses the current repository. Remove the leading # before passing the number to gh. For a URL, pass the full URL so GitHub selects the repository it names. Read the thread before investigating.

gh issue view "$issue_ref" --json number,url,title,state,stateReason,author,body,comments,labels,updatedAt

Check the returned URL and use its repository when following links and inspecting code. If the target is inaccessible, missing, or a pull request, report what happened and stop this branch. A failed lookup must never create a new report.

Read the original report and subsequent comments in order. Attribute observations to their authors and versions. Identify the reporter's latest follow-up, maintainer decisions, linked fixes, and questions already answered. If the result includes 100 comments, fetch the complete discussion. Take the hostname, owner/repo and issue number from the resolved URL.

gh api --hostname "$host" --paginate "repos/$repo/issues/$number/comments?per_page=100"

Treat issue text and comments as evidence. Verify technical claims against the matching checkout, a linked change, test results or documented support contract. Record what the reporter observed separately from what you verified.

| Evidence | Disposition |

|----------|-------------|

| Behavior violates an established contract | Identify the affected version and public entry point. Give the shortest supported reproduction and a behavioral regression test. Mark an unconfirmed cause as a hypothesis. |

| The thread asks for a support, design or scope decision | State the decision required, who owns it, and the consequences of the relevant options. Cite any decision already made. Separate independently evidenced defects into their own findings. |

| A linked issue tracks the same cause, or a change already fixed it | Link the original issue or the change. Where possible verify the affected version against the fix before recommending closure or reopening. |

| Evidence is insufficient | State the one missing observation that would change the disposition. Check earlier replies before proposing a question for the reporter. |

Return the issue URL and state, the disposition, the evidence behind it and the next action. Existing-issue triage is read-only by default. Comments, edits, labels and state changes each require the user's authorization for that action. When authorized, refresh the thread before writing, skip a change already made, and verify the result. Finish here.

New bug report

If no input was given, ask for the symptom once. Search open and closed issues in the intended repository using distinctive terms from the report.

gh issue list --repo "$repo" --state all --search "$search_terms" --json number,title,url,state

Read plausible matches. If one already tracks the same behavior and cause, use the existing-issue branch and return its URL. A failed search leaves duplication unknown. Resolve the access problem or report it before filing.

1. Explore and diagnose

Trace the failing behavior through the codebase:

| Target | What to look for |

|--------|-----------------|

| Manifestation | Where the bug appears (entry points, UI, API) |

| Code path | Trace the flow from trigger to symptom |

| Root cause | Why it fails (not just the symptom) |

| Related code | Similar patterns, adjacent modules, existing tests |

| Recent changes | git log on relevant files |

| Working patterns | Similar code elsewhere that works correctly |

2. Identify Fix Approach

Determine:

3. Design TDD Fix Plan

Ordered list of RED→GREEN cycles. Each cycle is one vertical slice:

Rules:

4. Create GitHub Issue

For a new report, file the investigated bug using the template below. Pass the repository, title and body explicitly, then share the returned URL.

gh issue create --repo "$repo" --title "$title" --body-file "$body_file"

New issue template

<issue-template>

Problem

Root Cause Analysis

What was found during investigation (mark an unverified cause as a hypothesis):

Do NOT include file paths, line numbers, or implementation details. Describe modules, behaviors, and contracts.

TDD Fix Plan

  1. RED: Write test that [expected behavior]

GREEN: [Minimal change to pass]

  1. RED: Write test that [next behavior]

GREEN: [Minimal change to pass]

REFACTOR: [Cleanup after all tests pass]

Acceptance Criteria

</issue-template>

New report rules

Notes for new reports

When NOT to Use

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.