Skip to content

Commit 6bfc865

Browse files
authored
feat: add bug-triage Claude skill (#4109)
1 parent d12c5c9 commit 6bfc865

1 file changed

Lines changed: 191 additions & 0 deletions

File tree

.claude/skills/bug-triage/SKILL.md

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
---
2+
name: bug-triage
3+
description: Triage open Comet issues marked `requires-triage` per the project bug triage guide. Applies the recommended priority and area labels, removes `requires-triage`, and files a dated summary issue listing what was done. A human reviews the summary issue and closes it when satisfied.
4+
---
5+
6+
Run a bug triage pass for the `apache/datafusion-comet` repository.
7+
8+
## Overview
9+
10+
This skill triages every open issue carrying the `requires-triage` label. For
11+
each one it:
12+
13+
1. Decides a priority and area labels using the project's triage guide.
14+
2. Applies those labels via `gh`.
15+
3. Removes the `requires-triage` label.
16+
4. Records the decision (with rationale) in a single dated summary issue.
17+
18+
A human reviewer reads the summary issue, sanity-checks the calls, and closes
19+
it when satisfied. Any label correction is done by the reviewer directly on the
20+
affected issue.
21+
22+
The triage criteria come from the project's own guide. Read it before doing any
23+
classification work; do not rely on memory.
24+
25+
## Step 1: Read the Triage Guide
26+
27+
Read the canonical guide in this repository:
28+
29+
```
30+
docs/source/contributor-guide/bug_triage.md
31+
```
32+
33+
Use the priority decision tree, escalation triggers, area labels, and
34+
prioritization principles from that guide. If the guide and this skill ever
35+
disagree, the guide wins. Do not paraphrase the guide; quote the labels and
36+
criteria verbatim when classifying.
37+
38+
## Step 2: Gather Issues That Need Triage
39+
40+
Fetch all open issues labeled `requires-triage`:
41+
42+
```bash
43+
gh issue list \
44+
--repo apache/datafusion-comet \
45+
--label requires-triage \
46+
--state open \
47+
--limit 200 \
48+
--json number,title,author,createdAt,labels,body,url
49+
```
50+
51+
If the list is empty, stop and tell the user there is nothing to triage. Do not
52+
file an empty summary issue and do not modify any labels.
53+
54+
## Step 3: Classify Each Issue
55+
56+
For each issue, review the title and body and determine:
57+
58+
1. **Priority label** (exactly one): apply the decision tree from the guide.
59+
- `priority:critical` for correctness issues (silent wrong results, data
60+
corruption) and security vulnerabilities
61+
- `priority:high` for crashes, panics, segfaults, NPEs on supported paths
62+
- `priority:medium` for functional bugs / performance regressions with
63+
workarounds
64+
- `priority:low` for test-only, CI flakes, tooling, cosmetic
65+
2. **Area labels** (zero or more): from the area table in the guide
66+
(`area:writer`, `area:shuffle`, `area:aggregation`, `area:scan`,
67+
`area:expressions`, `area:ffi`, `area:ci`) plus the pre-existing area
68+
indicators (`native_datafusion`, `native_iceberg_compat`, `spark 4`,
69+
`spark sql tests`).
70+
3. **Escalation note**: if the issue matches an escalation trigger from the
71+
guide (e.g., a `priority:high` crash that may also produce wrong results),
72+
note it in the summary.
73+
74+
## Step 4: Skip Issues You Cannot Confidently Classify
75+
76+
If an issue lacks reproduction steps or is otherwise too ambiguous to classify
77+
with confidence:
78+
79+
- **Do not** apply a priority label.
80+
- **Do not** remove `requires-triage`.
81+
- **Do not** comment on the issue or ask the reporter for more info from this
82+
skill (that is the human reviewer's call).
83+
- Record it in the summary under a "Skipped — needs more info" section so the
84+
reviewer can follow up.
85+
86+
Guessing is worse than skipping.
87+
88+
## Step 5: Apply Labels
89+
90+
For each issue you classified in Step 3, apply the labels and remove
91+
`requires-triage` in a single `gh` call:
92+
93+
```bash
94+
gh issue edit <NUMBER> \
95+
--repo apache/datafusion-comet \
96+
--add-label "priority:high,area:expressions" \
97+
--remove-label "requires-triage"
98+
```
99+
100+
Notes:
101+
102+
- Pass the labels as a single comma-separated string (no spaces around commas).
103+
- Quote labels that contain spaces (e.g., `"spark 4"`).
104+
- Only add labels that already exist in the repo. If a label from the guide is
105+
missing in the repo, skip it for that issue and record a note in the summary
106+
rather than creating new labels.
107+
- Do not comment on the issue.
108+
109+
If `gh issue edit` fails for any issue, leave that issue's `requires-triage`
110+
label intact and record the failure in the summary under a "Failed to label"
111+
section.
112+
113+
## Step 6: File the Summary Issue
114+
115+
Compute today's date in `YYYY-MM-DD` form (use the system date, not memory):
116+
117+
```bash
118+
TRIAGE_DATE=$(date -u +%Y-%m-%d)
119+
```
120+
121+
Title: `Bug triage results: ${TRIAGE_DATE}`
122+
123+
Body: a markdown report with these sections, in this order:
124+
125+
1. **Header**
126+
- Date, total issues processed, and counts per priority
127+
- Link to `docs/source/contributor-guide/bug_triage.md`
128+
- Note that labels have already been applied; the reviewer should spot-check
129+
and close this issue when satisfied
130+
2. **Triaged** — one subsection per priority, ordered highest priority first
131+
(`priority:critical`, then `priority:high`, then `priority:medium`, then
132+
`priority:low`). Omit any subsection whose count is zero. Do **not** use a
133+
markdown table anywhere in this section; use nested bullet lists only.
134+
135+
Within each subsection, one top-level bullet per issue:
136+
137+
```
138+
### priority:critical
139+
140+
- <issue title> ([#1234](https://github.com/apache/datafusion-comet/issues/1234))
141+
- Area labels: `area:expressions`, `area:scan`
142+
- Rationale: one sentence tying the call to the guide
143+
```
144+
145+
The issue number (not the title) is the link target. The title is plain
146+
text. If there are no area labels, write `Area labels: none`.
147+
148+
3. **Escalations to consider** (omit section if empty) — bullet per issue with
149+
the same `<title> ([#N](url))` form, plus a sub-bullet explaining the
150+
trigger from the guide.
151+
4. **Skipped — needs more info** (omit if empty) — bullet per issue with the
152+
same `<title> ([#N](url))` form, plus a sub-bullet explaining what is
153+
missing.
154+
5. **Failed to label** (omit if empty) — bullet per issue with the same
155+
`<title> ([#N](url))` form, plus a sub-bullet quoting the `gh` error.
156+
157+
File the issue with `gh`. Use a temp file for the body to keep quoting sane:
158+
159+
```bash
160+
gh issue create \
161+
--repo apache/datafusion-comet \
162+
--title "Bug triage results: ${TRIAGE_DATE}" \
163+
--body-file /tmp/triage-summary-${TRIAGE_DATE}.md
164+
```
165+
166+
Do not add labels to the summary issue itself.
167+
168+
After creating the issue, print its URL.
169+
170+
## Output to the User
171+
172+
Report back:
173+
174+
1. Number of `requires-triage` issues processed
175+
2. Counts per priority that were applied
176+
3. Number skipped (needs more info) and number failed
177+
4. URL of the new summary issue
178+
179+
Do not paste the full per-issue listing back into the chat; it is in the
180+
summary issue.
181+
182+
## What This Skill Must Not Do
183+
184+
- Do not invent priority or area labels that are not in the guide
185+
- Do not create new labels in the repo
186+
- Do not comment on the triaged issues
187+
- Do not close any triaged issue
188+
- Do not file the summary issue if there were zero `requires-triage` issues
189+
- Do not re-label issues that were skipped or failed (leave `requires-triage`
190+
in place so they show up in the next pass)
191+
- Do not include AI/Claude attribution in the summary issue

0 commit comments

Comments
 (0)