Skip to content

Commit d50b60e

Browse files
authored
chore(claude): create triage command (#14791)
Adds a new `/triage` slash command to streamline the GitHub issue investigation workflow. This command automates the process of validating issues, identifying code locations, and determining next steps. Usage: `/triage <issue-number-or-url>` - Accepts issue number or URL as argument - Fetches issue data via `gh` CLI - Uses Explore agent for codebase investigation - Generates structured triage report with validity verdict, confidence level, code locations, and fix direction - Auto-saves findings to `.claude/artifacts/triage-<issue-number>.md` - Offers post-triage options: create failing test, generate resolution plan, or complete
1 parent 20914cc commit d50b60e

1 file changed

Lines changed: 108 additions & 0 deletions

File tree

.claude/commands/triage.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
description: Triage a GitHub issue and present findings on validity, code locations, and optionally create a failing test or resolution plan.
3+
argument-hint: <issue-number-or-url>
4+
allowed-tools: Bash(gh issue view:*), Task, TodoWrite, Write, AskUserQuestion
5+
---
6+
7+
# Triage GitHub Issue
8+
9+
Quickly triage GitHub issues to determine validity and identify where the issue exists in code. Do not write code during triage.
10+
11+
## Process
12+
13+
### Step 1: Validate & Fetch
14+
15+
1. Check if `$ARGUMENTS` provided - if missing, ask user and stop
16+
2. Create TodoWrite with: Fetch and validate issue data | Investigate codebase | Analyze validity and generate report | Offer next steps
17+
3. Fetch issue data: `gh issue view $ARGUMENTS --json author,title,number,body,comments,labels,url`
18+
4. If command fails: Inform user and stop
19+
5. Extract title, body, comments, labels, state, URL
20+
6. Verify issue has sufficient info to investigate
21+
22+
### Step 2: Investigate
23+
24+
1. Use Task tool with subagent_type=Explore to examine relevant parts of codebase
25+
2. Think step by step through the code paths involved until you understand the relevant files, functions, and logic
26+
3. Focus on understanding the problem space before judging validity
27+
28+
### Step 3: Analyze & Report
29+
30+
1. Think step by step about whether this issue is valid - be critical and consider alternative explanations
31+
2. Determine verdict: Valid | Invalid | Needs Info
32+
3. Determine confidence: High | Medium | Low
33+
4. If valid: Think deeply about the root cause before proposing fix direction
34+
5. Generate findings using output structure below
35+
6. Auto-save to `.claude/artifacts/triage-<issue-number>.md`
36+
7. Present findings to user
37+
38+
### Step 4: Offer Next Steps
39+
40+
Use AskUserQuestion with multiSelect: true:
41+
42+
"What would you like to do next?"
43+
44+
- **Create failing test** - Write integration test that reproduces the issue
45+
- **Create resolution plan** - Generate full plan using `/superpowers:write-plan`
46+
- **Done for now** - End triage
47+
48+
If user selects test: Write an integration test that reproduces the issue.
49+
If user selects plan: Use `/superpowers:write-plan` to create detailed implementation plan.
50+
51+
## Output Structure
52+
53+
```markdown
54+
# Triage: #<issue-number> - <title>
55+
56+
**Verdict:** Valid | Invalid | Needs Info
57+
**Confidence:** High | Medium | Low
58+
59+
## Problem
60+
61+
1-2 sentences on what's broken and why.
62+
63+
## Reproduction
64+
65+
Steps to reproduce from investigation:
66+
67+
1. ...
68+
2. ...
69+
70+
## Code Locations
71+
72+
- `path/file.ts:123` - what's here
73+
- `path/other.ts:456` - related
74+
75+
## Fix Direction
76+
77+
Brief hints on potential approach (not full plan):
78+
79+
- Consider X
80+
- May need to change Y
81+
82+
## Issue Link
83+
84+
<url>
85+
```
86+
87+
## When to Stop
88+
89+
**STOP immediately when:**
90+
91+
- `$ARGUMENTS` not provided (ask for it)
92+
- `gh issue view` command fails
93+
- Issue not found or inaccessible
94+
- Cannot understand issue after investigation
95+
- Insufficient information to determine validity
96+
97+
**Ask for clarification rather than guessing.**
98+
99+
## Remember
100+
101+
- Create TodoWrite with 4 steps upfront
102+
- Mark steps in_progress before starting, completed after finishing
103+
- Use Explore agent for investigation
104+
- Be critical about issue validity
105+
- Auto-save findings to `.claude/artifacts/`
106+
- Single question at end with multi-select options
107+
- DO NOT write code during triage (tests come after, if requested)
108+
- Stop when blocked, don't guess

0 commit comments

Comments
 (0)