Triage Issue
$ARGUMENTS
Investigate a bug, find root cause, and create a GitHub issue with a TDD fix plan. Mostly hands-off.
Usage
/triage-issue [bug description or symptom]
What This Command Does
- Captures problem description (ONE question max)
- Explores codebase deeply for root cause
- Identifies fix approach
- Designs TDD fix plan (RED→GREEN cycles)
- Creates GitHub issue via
gh issue create
Process
1. Capture the Problem
Get brief description. If not provided, ask ONE question: "What's the problem you're seeing?"
Do NOT ask follow-up questions. Start investigating immediately.
2. Explore and Diagnose
Use Agent (subagent_type=Explore) to deeply investigate:
| 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 |
3. Identify Fix Approach
Determine:
- Minimal change to fix root cause
- Affected modules/interfaces
- Behaviors to verify via tests
- Classification: regression, missing feature, or design flaw
4. Design TDD Fix Plan
Ordered list of RED→GREEN cycles. Each cycle is one vertical slice:
- RED: Specific test capturing broken/missing behavior
- GREEN: Minimal code change to pass that test
Rules:
- Tests verify behavior through public interfaces
- One test at a time, vertical slices
- Tests must survive internal refactors
- Describe behaviors and contracts, not internal structure
5. Create GitHub Issue
Use gh issue create with template below. Share URL immediately.
Issue Template
Problem
- What happens (actual behavior)
- What should happen (expected behavior)
- How to reproduce
Root Cause Analysis
What was found during investigation:
- The code path involved
- Why the current code fails
- Contributing factors
Do NOT include file paths, line numbers, or implementation details. Describe modules, behaviors, and contracts.
TDD Fix Plan
RED: Write test that [expected behavior]
GREEN: [Minimal change to pass]
RED: Write test that [next behavior]
GREEN: [Minimal change to pass]
REFACTOR: [Cleanup after all tests pass]
Acceptance Criteria
Rules
- MUST explore the codebase for root cause before filing — symptoms masquerade as causes often
- MUST propose a TDD fix plan with ordered RED→GREEN cycles, each a vertical slice
- NEVER ask follow-up clarifying questions; one initial question maximum, then investigate autonomously
- NEVER include file paths, function names, or line numbers in the issue body — they go stale before the issue is picked up
- CRITICAL: the issue must be reproducible. If reproduction steps cannot be determined from the investigation, say so explicitly in the Problem section — do not fabricate them.
- MANDATORY: file the issue immediately via
gh issue create and share the URL — do not ask the user to review a draft first
Gotchas
gh issue create without --body opens $EDITOR. In automated flows the skill hangs — always pass the body file or inline text.
- "Root cause" often turns out to be two concurrent issues. If the investigation keeps branching, file the most-probable primary cause and note the secondary as a follow-up in the same issue.
- TDD plans with more than ~5 RED→GREEN cycles usually conceal a deeper design issue. Short plans (2-3 cycles) reflect confident root-cause identification; long plans reflect fishing.
- The
debugger agent explored autonomously but returns a narrative. Parse it for: confirmed hypothesis, code paths, and recent changes. Discard speculation.
- Bugs in framework-adjacent code (middleware, ORM hooks) require test setup that mirrors the framework's call context. A TDD plan that writes the test "like a unit test" may not actually reproduce the framework bug.
When NOT to Use
- For a conversational bug report from a non-engineer — use
/qa-session first, which returns refined reports this skill can then process
- For a specific reproducible error with known root cause — use
/fix directly
- For architectural-scale problems — use
/architecture-audit
- For creating issues from a PRD — use
/prd-to-issues
- For debugging without filing an issue — use
/debug
1---2name: triage-issue3description: "Bug triage: explores codebase for root cause, files GitHub issue with TDD fix plan. Triggers: triage, investigate bug, fix plan, root cause, file issue, bug report."4user-invocable: true5effort: high6argument-hint: "[bug description or symptom]"7agent: debugger8context: fork9allowed-tools: Read, Grep, Glob, Bash, Agent10---1112# Triage Issue1314$ARGUMENTS1516Investigate a bug, find root cause, and create a GitHub issue with a TDD fix plan. Mostly hands-off.1718## Usage1920```21/triage-issue [bug description or symptom]22```2324## What This Command Does25261. **Captures** problem description (ONE question max)272. **Explores** codebase deeply for root cause283. **Identifies** fix approach294. **Designs** TDD fix plan (RED→GREEN cycles)305. **Creates** GitHub issue via `gh issue create`3132## Process3334### 1. Capture the Problem3536Get brief description. If not provided, ask ONE question: "What's the problem you're seeing?"3738Do NOT ask follow-up questions. Start investigating immediately.3940### 2. Explore and Diagnose4142Use Agent (subagent_type=Explore) to deeply investigate:4344| Target | What to look for |45|--------|-----------------|46| Manifestation | Where the bug appears (entry points, UI, API) |47| Code path | Trace the flow from trigger to symptom |48| Root cause | Why it fails (not just the symptom) |49| Related code | Similar patterns, adjacent modules, existing tests |50| Recent changes | `git log` on relevant files |51| Working patterns | Similar code elsewhere that works correctly |5253### 3. Identify Fix Approach5455Determine:56- Minimal change to fix root cause57- Affected modules/interfaces58- Behaviors to verify via tests59- Classification: regression, missing feature, or design flaw6061### 4. Design TDD Fix Plan6263Ordered list of RED→GREEN cycles. Each cycle is one vertical slice:6465- **RED**: Specific test capturing broken/missing behavior66- **GREEN**: Minimal code change to pass that test6768Rules:69- Tests verify behavior through public interfaces70- One test at a time, vertical slices71- Tests must survive internal refactors72- Describe behaviors and contracts, not internal structure7374### 5. Create GitHub Issue7576Use `gh issue create` with template below. Share URL immediately.7778## Issue Template7980<issue-template>8182## Problem8384- What happens (actual behavior)85- What should happen (expected behavior)86- How to reproduce8788## Root Cause Analysis8990What was found during investigation:91- The code path involved92- Why the current code fails93- Contributing factors9495Do NOT include file paths, line numbers, or implementation details. Describe modules, behaviors, and contracts.9697## TDD Fix Plan98991. **RED**: Write test that [expected behavior]100 **GREEN**: [Minimal change to pass]1011022. **RED**: Write test that [next behavior]103 **GREEN**: [Minimal change to pass]104105**REFACTOR**: [Cleanup after all tests pass]106107## Acceptance Criteria108109- [ ] Criterion 1110- [ ] All new tests pass111- [ ] Existing tests still pass112113</issue-template>114115## Rules116117- **MUST** explore the codebase for root cause before filing — symptoms masquerade as causes often118- **MUST** propose a TDD fix plan with ordered RED→GREEN cycles, each a vertical slice119- **NEVER** ask follow-up clarifying questions; one initial question maximum, then investigate autonomously120- **NEVER** include file paths, function names, or line numbers in the issue body — they go stale before the issue is picked up121- **CRITICAL**: the issue must be reproducible. If reproduction steps cannot be determined from the investigation, say so explicitly in the Problem section — do not fabricate them.122- **MANDATORY**: file the issue immediately via `gh issue create` and share the URL — do not ask the user to review a draft first123124## Gotchas125126- `gh issue create` without `--body` opens `$EDITOR`. In automated flows the skill hangs — always pass the body file or inline text.127- "Root cause" often turns out to be two concurrent issues. If the investigation keeps branching, file the most-probable primary cause and note the secondary as a follow-up in the same issue.128- TDD plans with more than ~5 RED→GREEN cycles usually conceal a deeper design issue. Short plans (2-3 cycles) reflect confident root-cause identification; long plans reflect fishing.129- The `debugger` agent explored autonomously but returns a narrative. Parse it for: confirmed hypothesis, code paths, and recent changes. Discard speculation.130- Bugs in framework-adjacent code (middleware, ORM hooks) require test setup that mirrors the framework's call context. A TDD plan that writes the test "like a unit test" may not actually reproduce the framework bug.131132## When NOT to Use133134- For a conversational bug report from a non-engineer — use `/qa-session` first, which returns refined reports this skill can then process135- For a specific reproducible error with known root cause — use `/fix` directly136- For architectural-scale problems — use `/architecture-audit`137- For creating issues from a PRD — use `/prd-to-issues`138- For debugging without filing an issue — use `/debug`