moicle 1.7.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -27
- package/assets/architecture/_shared/severity-levels.md +34 -0
- package/assets/architecture/_shared/stack-detection.md +34 -0
- package/assets/commands/marketing.md +7 -7
- package/assets/skills/docs/sync/SKILL.md +245 -0
- package/assets/skills/docs/write/SKILL.md +274 -0
- package/assets/skills/feature/api/SKILL.md +277 -0
- package/assets/skills/feature/deprecate/SKILL.md +276 -0
- package/assets/skills/feature/new/SKILL.md +273 -0
- package/assets/skills/feature/refactor/SKILL.md +269 -0
- package/assets/skills/fix/hotfix/SKILL.md +233 -0
- package/assets/skills/fix/incident/SKILL.md +360 -0
- package/assets/skills/fix/pr-comment/SKILL.md +186 -0
- package/assets/skills/fix/root-cause/SKILL.md +276 -0
- package/assets/skills/marketing/content/SKILL.md +269 -0
- package/assets/skills/marketing/logo/SKILL.md +252 -0
- package/assets/skills/marketing/seo-blog/SKILL.md +367 -0
- package/assets/skills/marketing/video/SKILL.md +258 -0
- package/assets/skills/research/onboarding/SKILL.md +225 -0
- package/assets/skills/research/spike/SKILL.md +228 -0
- package/assets/skills/research/web/SKILL.md +204 -0
- package/assets/skills/review/architect/SKILL.md +274 -0
- package/assets/skills/review/branch/SKILL.md +277 -0
- package/assets/skills/review/pr/SKILL.md +231 -0
- package/assets/skills/review/tdd/SKILL.md +245 -0
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +2 -2
- package/dist/commands/list.js.map +1 -1
- package/dist/utils/symlink.d.ts +7 -0
- package/dist/utils/symlink.d.ts.map +1 -1
- package/dist/utils/symlink.js +82 -0
- package/dist/utils/symlink.js.map +1 -1
- package/package.json +1 -1
- package/assets/skills/api-integration/SKILL.md +0 -883
- package/assets/skills/architect-review/SKILL.md +0 -393
- package/assets/skills/content-writer/SKILL.md +0 -721
- package/assets/skills/deep-debug/SKILL.md +0 -114
- package/assets/skills/deprecation/SKILL.md +0 -923
- package/assets/skills/documentation/SKILL.md +0 -1333
- package/assets/skills/fix-pr-comment/SKILL.md +0 -283
- package/assets/skills/hotfix/SKILL.md +0 -397
- package/assets/skills/incident-response/SKILL.md +0 -946
- package/assets/skills/logo-design/SKILL.md +0 -477
- package/assets/skills/new-feature/SKILL.md +0 -297
- package/assets/skills/onboarding/SKILL.md +0 -607
- package/assets/skills/pr-review/SKILL.md +0 -620
- package/assets/skills/refactor/SKILL.md +0 -338
- package/assets/skills/research/SKILL.md +0 -124
- package/assets/skills/review-changes/SKILL.md +0 -312
- package/assets/skills/spike/SKILL.md +0 -535
- package/assets/skills/sync-docs/SKILL.md +0 -575
- package/assets/skills/tdd/SKILL.md +0 -828
- package/assets/skills/video-content/SKILL.md +0 -651
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fix-incident
|
|
3
|
+
description: Incident response workflow for handling production issues. Use when there's an incident, outage, production down, or when user says "incident", "outage", "production down", "service down", "emergency".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Incident Response Workflow
|
|
7
|
+
|
|
8
|
+
Structured workflow for handling production incidents from triage to postmortem. **Speed > completeness** during P1/P2 — mitigation first, root cause after.
|
|
9
|
+
|
|
10
|
+
## When to use this skill
|
|
11
|
+
|
|
12
|
+
- ✅ Production is down or degraded right now
|
|
13
|
+
- ✅ Users are impacted, on-call has been paged
|
|
14
|
+
- ✅ Need to coordinate response, mitigation, comms, and postmortem
|
|
15
|
+
- ❌ Bug is reported but no users impacted → use `/fix:hotfix`
|
|
16
|
+
- ❌ Already mitigated, need to find root cause → use `/fix:root-cause`
|
|
17
|
+
- ❌ Postmortem only, no active incident → jump to Phase 5
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Workflow
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
TRIAGE → INVESTIGATE → MITIGATE → RESOLVE → POSTMORTEM
|
|
25
|
+
↓ ↓ ↓ ↓ ↑
|
|
26
|
+
comms comms comms comms learn
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Read Architecture First
|
|
30
|
+
|
|
31
|
+
Before responding:
|
|
32
|
+
1. `~/.claude/architecture/ddd-architecture.md`
|
|
33
|
+
2. Stack-specific doc for the affected service
|
|
34
|
+
3. Runbook for the affected component (`docs/runbooks/` or wiki)
|
|
35
|
+
|
|
36
|
+
## Severity
|
|
37
|
+
|
|
38
|
+
Use `~/.claude/architecture/_shared/severity-levels.md` (incident severity table — P1-P4 with response times).
|
|
39
|
+
|
|
40
|
+
### Ambiguous severity (P2 vs P3)?
|
|
41
|
+
Decide UP if any apply:
|
|
42
|
+
- Revenue impact (checkout, payment, signups blocked)
|
|
43
|
+
- Security risk (auth, data exposure)
|
|
44
|
+
- Data integrity at risk (writes might be lost / corrupted)
|
|
45
|
+
- Regulatory / SLA breach
|
|
46
|
+
- Pattern matches a prior P2+ (e.g., same DB instance flaky again)
|
|
47
|
+
|
|
48
|
+
Otherwise: P3.
|
|
49
|
+
|
|
50
|
+
### Escalation criteria
|
|
51
|
+
|
|
52
|
+
Page or escalate when:
|
|
53
|
+
|
|
54
|
+
| Trigger | Action |
|
|
55
|
+
|---------|--------|
|
|
56
|
+
| P1 on customer-facing system | Page CTO / engineering lead within 15 min |
|
|
57
|
+
| P1 + data loss / breach | Page legal + security lead immediately |
|
|
58
|
+
| P2 lasting >2 hours without mitigation | Page engineering lead, consider promoting to P1 |
|
|
59
|
+
| P1/P2 spanning >1 shift | Schedule formal handoff (see Phase 1.5) |
|
|
60
|
+
| Customer-facing comms required | Notify support + comms lead within 30 min |
|
|
61
|
+
| Public disclosure may be needed (security) | Notify legal + comms + leadership |
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Phase 1: TRIAGE (5–15 min)
|
|
66
|
+
|
|
67
|
+
**Goal:** classify severity, assemble response, start comms.
|
|
68
|
+
|
|
69
|
+
### Actions
|
|
70
|
+
1. Capture: what, when, who's affected, error messages, recent deploys
|
|
71
|
+
2. Assign severity (P1–P4) — use ambiguous-severity rule above
|
|
72
|
+
3. Open incident channel (`#incident-{date}-{short-name}`)
|
|
73
|
+
4. Assign roles:
|
|
74
|
+
- **Incident Commander (IC)** — coordinates, makes decisions
|
|
75
|
+
- **Tech Lead** — investigates / fixes
|
|
76
|
+
- **Comms Lead** — updates stakeholders
|
|
77
|
+
5. Page on-call for affected service
|
|
78
|
+
6. Check escalation criteria above — page additional people if any trigger
|
|
79
|
+
7. Send first status update (template below)
|
|
80
|
+
|
|
81
|
+
### First update template
|
|
82
|
+
```
|
|
83
|
+
[INCIDENT] {severity} {service} — {one-line impact}
|
|
84
|
+
Detected: {timestamp}
|
|
85
|
+
Status: investigating
|
|
86
|
+
Channel: #incident-{slug}
|
|
87
|
+
Next update: {time}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Gate
|
|
91
|
+
- [ ] Severity assigned (and escalation triggered if applicable)
|
|
92
|
+
- [ ] IC + Tech Lead identified
|
|
93
|
+
- [ ] Incident channel open
|
|
94
|
+
- [ ] First status sent
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Phase 1.5: HANDOFF (only if shift change during incident)
|
|
99
|
+
|
|
100
|
+
For incidents spanning >1 shift, do a formal handoff. Skip if same team handles end-to-end.
|
|
101
|
+
|
|
102
|
+
### Handoff template
|
|
103
|
+
```markdown
|
|
104
|
+
## Incident Handoff: {service} {date}
|
|
105
|
+
|
|
106
|
+
**From:** {outgoing IC} → **To:** {incoming IC}
|
|
107
|
+
**Channel:** #incident-{slug}
|
|
108
|
+
**Severity:** {current}
|
|
109
|
+
|
|
110
|
+
### Current state
|
|
111
|
+
- Impact: {what users see right now}
|
|
112
|
+
- Mitigations applied: {list with timestamps}
|
|
113
|
+
- What worked: {list}
|
|
114
|
+
- What didn't: {list}
|
|
115
|
+
|
|
116
|
+
### Active investigations
|
|
117
|
+
- {open question + who was looking into it}
|
|
118
|
+
|
|
119
|
+
### Active hypotheses
|
|
120
|
+
- {hypothesis + evidence for/against}
|
|
121
|
+
|
|
122
|
+
### Open decisions
|
|
123
|
+
- {decision needed + options + recommended choice}
|
|
124
|
+
|
|
125
|
+
### Next steps
|
|
126
|
+
- {action + owner + ETA}
|
|
127
|
+
|
|
128
|
+
### People paged / informed
|
|
129
|
+
- {list with role + when paged}
|
|
130
|
+
|
|
131
|
+
### Pending comms
|
|
132
|
+
- {next update due at HH:MM}
|
|
133
|
+
- {customer-facing status due}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Live walkthrough (5-10 min): outgoing IC walks incoming IC through the timeline + open questions in the incident channel. Both confirm understanding before handoff completes.
|
|
137
|
+
|
|
138
|
+
### Gate
|
|
139
|
+
- [ ] Handoff doc posted in incident channel
|
|
140
|
+
- [ ] Incoming IC acknowledges + confirms understanding
|
|
141
|
+
- [ ] Stakeholders notified of new IC
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Phase 2: INVESTIGATE (parallel with comms)
|
|
146
|
+
|
|
147
|
+
**Goal:** find what's broken — don't fix yet, identify it.
|
|
148
|
+
|
|
149
|
+
### Check in this order
|
|
150
|
+
1. **Recent deploys** — last 24h. Roll back candidate?
|
|
151
|
+
2. **Monitoring dashboards** — error rate, latency, saturation, traffic (the 4 golden signals)
|
|
152
|
+
3. **Logs** — error spikes, new error types
|
|
153
|
+
4. **Dependencies** — upstream services, DB, cache, queue, external APIs
|
|
154
|
+
5. **Infrastructure** — CPU, memory, disk, network, certificate expiry, DNS
|
|
155
|
+
|
|
156
|
+
### Common patterns
|
|
157
|
+
| Symptom | Likely cause |
|
|
158
|
+
|---------|-------------|
|
|
159
|
+
| Errors only on new code path | Bad deploy → rollback |
|
|
160
|
+
| Errors across all paths | Infra (DB, cache, network) |
|
|
161
|
+
| Slow but not erroring | Resource saturation / external API slowdown |
|
|
162
|
+
| Intermittent | Cache, race condition, flapping dependency |
|
|
163
|
+
| Started exactly on a cron tick | Scheduled job |
|
|
164
|
+
|
|
165
|
+
### Gate
|
|
166
|
+
- [ ] Suspected cause identified (even if not yet confirmed)
|
|
167
|
+
- [ ] Mitigation candidates listed
|
|
168
|
+
- [ ] Update sent to incident channel
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Phase 3: MITIGATE (fast, reversible)
|
|
173
|
+
|
|
174
|
+
**Goal:** stop the bleeding. Don't fix root cause yet.
|
|
175
|
+
|
|
176
|
+
### Mitigation options (pick fastest reversible)
|
|
177
|
+
| Option | When | Reversibility |
|
|
178
|
+
|--------|------|---------------|
|
|
179
|
+
| Rollback deploy | Recent deploy is suspect | Easy |
|
|
180
|
+
| Feature flag off | Bad feature behind flag | Easy |
|
|
181
|
+
| Scale up | Resource saturation | Easy |
|
|
182
|
+
| Failover | Region / instance down | Medium |
|
|
183
|
+
| Block traffic | Bot / DDoS | Medium |
|
|
184
|
+
| DB restore | Data corruption | Hard — last resort |
|
|
185
|
+
|
|
186
|
+
### Rules
|
|
187
|
+
- **One change at a time.** If you change 3 things and it gets better, you don't know which fixed it.
|
|
188
|
+
- **Announce before doing.** "Rolling back to {sha} in 60s." Then do it.
|
|
189
|
+
- **Time-box.** If a mitigation doesn't work in 10 min, try the next one.
|
|
190
|
+
|
|
191
|
+
### Verify mitigation
|
|
192
|
+
- [ ] Error rate dropping in monitoring
|
|
193
|
+
- [ ] Users confirming (sample check)
|
|
194
|
+
- [ ] No new alerts firing
|
|
195
|
+
|
|
196
|
+
### Gate
|
|
197
|
+
- [ ] Impact reduced (errors down, users unblocked)
|
|
198
|
+
- [ ] Mitigation status sent to channel
|
|
199
|
+
- [ ] Severity downgraded if appropriate
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Phase 4: RESOLVE
|
|
204
|
+
|
|
205
|
+
**Goal:** apply the permanent fix and verify.
|
|
206
|
+
|
|
207
|
+
### Actions
|
|
208
|
+
1. Confirm root cause (use `/fix:root-cause` workflow if not obvious)
|
|
209
|
+
2. Implement permanent fix following stack architecture
|
|
210
|
+
3. Add test that would have caught this
|
|
211
|
+
4. Deploy fix through normal pipeline (don't skip CI even under pressure — unless explicitly authorized)
|
|
212
|
+
5. Monitor for {N} hours post-deploy
|
|
213
|
+
6. Remove temporary mitigation (e.g., re-enable feature flag) only after fix proven stable
|
|
214
|
+
|
|
215
|
+
### Gate
|
|
216
|
+
- [ ] Root cause confirmed
|
|
217
|
+
- [ ] Fix deployed
|
|
218
|
+
- [ ] Regression test added and passing
|
|
219
|
+
- [ ] Monitoring shows healthy metrics for ≥1 hour
|
|
220
|
+
- [ ] Incident marked resolved in channel
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## Phase 5: POSTMORTEM
|
|
225
|
+
|
|
226
|
+
**Goal:** learn from this so it doesn't happen again. **Blameless.**
|
|
227
|
+
|
|
228
|
+
### Schedule
|
|
229
|
+
- Within 48h of resolution for P1/P2
|
|
230
|
+
- Within 1 week for P3
|
|
231
|
+
- Optional for P4 (only if recurring pattern)
|
|
232
|
+
|
|
233
|
+
### Postmortem template
|
|
234
|
+
|
|
235
|
+
```markdown
|
|
236
|
+
# Postmortem: {service} {date}
|
|
237
|
+
|
|
238
|
+
## Summary
|
|
239
|
+
{1-paragraph: what happened, impact, duration}
|
|
240
|
+
|
|
241
|
+
## Impact
|
|
242
|
+
- Users affected: {N or %}
|
|
243
|
+
- Duration: {detected → mitigated → resolved}
|
|
244
|
+
- Revenue / SLA impact: {if applicable}
|
|
245
|
+
|
|
246
|
+
## Timeline (UTC)
|
|
247
|
+
| Time | Event |
|
|
248
|
+
|------|-------|
|
|
249
|
+
| HH:MM | Deploy of {sha} |
|
|
250
|
+
| HH:MM | First alert fired |
|
|
251
|
+
| HH:MM | IC paged |
|
|
252
|
+
| HH:MM | Mitigation: rollback to {sha} |
|
|
253
|
+
| HH:MM | Error rate normal |
|
|
254
|
+
| HH:MM | Permanent fix deployed |
|
|
255
|
+
|
|
256
|
+
## Root Cause
|
|
257
|
+
{Technical cause — what code / config / data caused this}
|
|
258
|
+
|
|
259
|
+
## Contributing Factors
|
|
260
|
+
- {Factor 1, e.g., test gap}
|
|
261
|
+
- {Factor 2, e.g., missing alert}
|
|
262
|
+
|
|
263
|
+
## What Went Well
|
|
264
|
+
- {e.g., fast detection, clear rollback path}
|
|
265
|
+
|
|
266
|
+
## What Didn't Go Well
|
|
267
|
+
- {e.g., took 20 min to identify suspect deploy}
|
|
268
|
+
|
|
269
|
+
## Action Items
|
|
270
|
+
| # | Action | Owner | Due | Severity |
|
|
271
|
+
|---|--------|-------|-----|----------|
|
|
272
|
+
| 1 | {add alert for X} | @alice | {date} | high |
|
|
273
|
+
| 2 | {add regression test} | @bob | {date} | medium |
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Action item rules
|
|
277
|
+
- Each action item has owner + due date
|
|
278
|
+
- Track to completion (open a ticket, link from postmortem)
|
|
279
|
+
- "Better testing" is NOT an action item — be specific ("add test for X case")
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## Communication
|
|
284
|
+
|
|
285
|
+
### Update frequency by severity
|
|
286
|
+
|
|
287
|
+
| Severity | Update cadence | Channels |
|
|
288
|
+
|----------|---------------|----------|
|
|
289
|
+
| P1 | Every 15 min while investigating; every 30 min after mitigation | Incident channel + status page + customer email if >30 min outage |
|
|
290
|
+
| P2 | Every 30 min while investigating; hourly after mitigation | Incident channel + status page |
|
|
291
|
+
| P3 | Hourly | Incident channel |
|
|
292
|
+
| P4 | At start, on mitigation, on resolution | Incident channel |
|
|
293
|
+
|
|
294
|
+
If nothing new to report, post anyway: "No update — still investigating, next update at HH:MM." Silence creates panic.
|
|
295
|
+
|
|
296
|
+
### Templates
|
|
297
|
+
|
|
298
|
+
**Status update**
|
|
299
|
+
```
|
|
300
|
+
[UPDATE {time} UTC] {severity} {service}
|
|
301
|
+
Impact: {what users see — specific, not "issues"}
|
|
302
|
+
Action: {what we're doing right now}
|
|
303
|
+
ETA mitigation: {time or "unknown"}
|
|
304
|
+
Next update: {time}
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
**Mitigation applied**
|
|
308
|
+
```
|
|
309
|
+
[MITIGATED {time} UTC] {severity} {service}
|
|
310
|
+
Impact: {reduced from X to Y}
|
|
311
|
+
Mitigation: {what we did}
|
|
312
|
+
Permanent fix: {ETA}
|
|
313
|
+
Next update: {time}
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
**Resolved**
|
|
317
|
+
```
|
|
318
|
+
[RESOLVED {time} UTC] {service}
|
|
319
|
+
Total duration: {detected → resolved}
|
|
320
|
+
Root cause: {one line}
|
|
321
|
+
Mitigation: {what we did}
|
|
322
|
+
Permanent fix: {deployed at HH:MM | scheduled by DATE}
|
|
323
|
+
Postmortem: {date} — link to come
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## Hard Rules
|
|
329
|
+
|
|
330
|
+
- **Speed > completeness during P1/P2** — mitigate first, perfect later
|
|
331
|
+
- **One change at a time** during mitigation
|
|
332
|
+
- **Blameless postmortems** — focus on system, not person
|
|
333
|
+
- **Don't skip CI** for the fix unless explicitly authorized by IC
|
|
334
|
+
- **Don't close the incident** until monitoring is healthy for ≥1 hour
|
|
335
|
+
- **Action items must have owner + date** — otherwise they don't happen
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
## Related Skills
|
|
340
|
+
|
|
341
|
+
| When | Use |
|
|
342
|
+
|------|-----|
|
|
343
|
+
| Bug reported but no active incident | `/fix:hotfix` |
|
|
344
|
+
| Root cause unclear, need deep investigation | `/fix:root-cause` |
|
|
345
|
+
| Need to roll back deployment | (use ops runbook, not a skill) |
|
|
346
|
+
| Documenting postmortem as a doc | `/docs:write` |
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## Recommended Agents
|
|
351
|
+
|
|
352
|
+
| Phase | Agent | Purpose |
|
|
353
|
+
|-------|-------|---------|
|
|
354
|
+
| TRIAGE | `@devops` | Infra + monitoring context |
|
|
355
|
+
| INVESTIGATE | Stack-specific dev agent | Code-level debugging |
|
|
356
|
+
| INVESTIGATE | `@security-audit` | If suspected breach / leak |
|
|
357
|
+
| INVESTIGATE | `@db-designer` | If DB / data issue |
|
|
358
|
+
| MITIGATE | `@devops` | Rollback / scale / failover |
|
|
359
|
+
| RESOLVE | Stack-specific dev agent | Permanent fix |
|
|
360
|
+
| POSTMORTEM | `@docs-writer` | Write postmortem doc |
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fix-pr-comment
|
|
3
|
+
description: Fix PR review comments workflow. Use when fixing review comments from a pull request, or when user says "fix pr comment", "fix review comment", "fix-pr-comment", "address pr feedback".
|
|
4
|
+
args: PR_NUMBER
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Fix PR Comment Workflow
|
|
8
|
+
|
|
9
|
+
Fetch all review comments on an open PR, address each, push, and respond back to GitHub.
|
|
10
|
+
|
|
11
|
+
**ARGUMENTS:** `PR_NUMBER` — the PR you authored.
|
|
12
|
+
|
|
13
|
+
## When to use this skill
|
|
14
|
+
|
|
15
|
+
- ✅ Reviewer left comments and you need to address each one
|
|
16
|
+
- ✅ Want to track which comments are resolved vs still open
|
|
17
|
+
- ✅ Need structured responses posted back to GitHub
|
|
18
|
+
- ❌ You are the reviewer → use `/review:pr`
|
|
19
|
+
- ❌ No PR yet → use `/review:branch`
|
|
20
|
+
- ❌ Fix is a brand-new bug surfaced by reviewer → `/fix:hotfix` first, then this skill
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Workflow
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
FETCH → ANALYZE → FIX → RESPOND
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Phase 1: FETCH
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
PR={number}
|
|
36
|
+
gh pr view $PR --json number,title,state,headRefName,baseRefName,author
|
|
37
|
+
gh pr diff $PR
|
|
38
|
+
gh api repos/{owner}/{repo}/pulls/$PR/comments \
|
|
39
|
+
--jq '.[] | {id, path, line, body, user: .user.login, created_at}'
|
|
40
|
+
gh api repos/{owner}/{repo}/pulls/$PR/reviews \
|
|
41
|
+
--jq '.[] | {id, user: .user.login, state, body}'
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Collect into a list. Each comment has: `id`, `file:line`, `author`, `body`, `created_at`.
|
|
45
|
+
|
|
46
|
+
### Gate
|
|
47
|
+
- [ ] All comments fetched (line-level + review-level)
|
|
48
|
+
- [ ] Current diff loaded
|
|
49
|
+
- [ ] PR is open (closed/merged PR → ask if user really wants to revisit)
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Phase 2: ANALYZE
|
|
54
|
+
|
|
55
|
+
For each comment, classify:
|
|
56
|
+
|
|
57
|
+
| Category | Action |
|
|
58
|
+
|----------|--------|
|
|
59
|
+
| **Must-fix** (bug, security, broken test, arch violation) | Fix in this round |
|
|
60
|
+
| **Should-fix** (style, naming, missing test for new code) | Fix unless explicit reason not to |
|
|
61
|
+
| **Discussion** (asking a question, proposing alternative) | Reply with reasoning before fixing |
|
|
62
|
+
| **Nit / preference** (subjective) | Acknowledge + decide; OK to push back politely |
|
|
63
|
+
| **Outdated** (code already changed) | Reply "resolved by {commit}" and resolve thread |
|
|
64
|
+
|
|
65
|
+
Ambiguous comment (e.g., "this feels off")? Ask the reviewer for specifics before guessing.
|
|
66
|
+
|
|
67
|
+
Build a triage table:
|
|
68
|
+
|
|
69
|
+
```markdown
|
|
70
|
+
| # | File:line | Author | Category | Plan |
|
|
71
|
+
|---|-----------|--------|----------|------|
|
|
72
|
+
| 1 | handler.go:42 | @alice | must-fix | extract validation to DTO |
|
|
73
|
+
| 2 | store.go:88 | @bob | discussion | reply: prefer current approach because ... |
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Gate
|
|
77
|
+
- [ ] Every comment classified
|
|
78
|
+
- [ ] Plan written per comment
|
|
79
|
+
- [ ] Ambiguous comments → questions queued for reviewer
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Phase 3: FIX
|
|
84
|
+
|
|
85
|
+
### Rules
|
|
86
|
+
- Fix in order: must-fix → should-fix → discussion outcomes
|
|
87
|
+
- One concern per commit (`fix(handler): validate input in DTO per #pr-comment-1`)
|
|
88
|
+
- After each batch: run build + lint + tests locally
|
|
89
|
+
- Re-run `/review:branch` before pushing
|
|
90
|
+
|
|
91
|
+
### When the fix changes architecture
|
|
92
|
+
If a comment requests something structural (move logic between layers, add a port), use `/feature:refactor` for that subtree, then come back here to respond.
|
|
93
|
+
|
|
94
|
+
### Gate
|
|
95
|
+
- [ ] All must-fix items addressed
|
|
96
|
+
- [ ] Build + lint + tests green
|
|
97
|
+
- [ ] Self-review with `/review:branch` clean
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Phase 4: RESPOND
|
|
102
|
+
|
|
103
|
+
Push commits, then reply on GitHub.
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
git push
|
|
107
|
+
# Reply to each thread
|
|
108
|
+
gh api repos/{owner}/{repo}/pulls/$PR/comments/{comment_id}/replies -f body="..."
|
|
109
|
+
# Or single summary review
|
|
110
|
+
gh pr review $PR --comment --body "$(cat reply.md)"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Reply patterns
|
|
114
|
+
|
|
115
|
+
**Fixed**
|
|
116
|
+
> Fixed in {sha}. {one-line of what changed}.
|
|
117
|
+
|
|
118
|
+
**Pushing back (politely)**
|
|
119
|
+
> Considered this — keeping current approach because {specific reason}. Happy to revisit if you have stronger evidence.
|
|
120
|
+
|
|
121
|
+
**Asking back**
|
|
122
|
+
> Could you clarify what you mean by "this feels off"? Is it about {hypothesis A} or {hypothesis B}?
|
|
123
|
+
|
|
124
|
+
**Resolved by other change**
|
|
125
|
+
> Resolved by {sha} earlier in the chain — line {N} no longer exists.
|
|
126
|
+
|
|
127
|
+
### Resolve threads
|
|
128
|
+
After replying, mark threads resolved (GitHub UI or API). Don't leave dangling threads — reviewer can't tell what's done.
|
|
129
|
+
|
|
130
|
+
### Re-request review
|
|
131
|
+
```bash
|
|
132
|
+
gh pr edit $PR --add-reviewer {original_reviewer}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Gate
|
|
136
|
+
- [ ] Every comment has a reply
|
|
137
|
+
- [ ] Threads resolved where appropriate
|
|
138
|
+
- [ ] Commits pushed
|
|
139
|
+
- [ ] Reviewer re-requested
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Final Report
|
|
144
|
+
|
|
145
|
+
```markdown
|
|
146
|
+
## PR #{N}: comments addressed
|
|
147
|
+
|
|
148
|
+
| # | File:line | Category | Resolution | Commit |
|
|
149
|
+
|---|-----------|----------|------------|--------|
|
|
150
|
+
| 1 | handler.go:42 | must-fix | Extracted validation | abc123 |
|
|
151
|
+
| 2 | store.go:88 | discussion | Replied + kept approach | — |
|
|
152
|
+
| 3 | helper.go:5 | nit | Renamed | def456 |
|
|
153
|
+
|
|
154
|
+
### Build / Lint / Tests: PASS
|
|
155
|
+
### Re-review requested: @{reviewer}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Hard Rules
|
|
161
|
+
|
|
162
|
+
- **Reply to every comment** — silence reads as ignoring
|
|
163
|
+
- **Push back politely** when you have a real reason; never just close threads
|
|
164
|
+
- **One concern per commit** — easier for reviewer to verify
|
|
165
|
+
- **Run `/review:branch` before pushing** — catch easy issues before reviewer round 2
|
|
166
|
+
- **Don't argue style** when the team has a linter — let the tool decide
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Related Skills
|
|
171
|
+
|
|
172
|
+
| When | Use |
|
|
173
|
+
|------|-----|
|
|
174
|
+
| You are the reviewer | `/review:pr` |
|
|
175
|
+
| Self-review before pushing again | `/review:branch` |
|
|
176
|
+
| Reviewer asked for architectural refactor | `/feature:refactor` |
|
|
177
|
+
| Reviewer surfaced a bug needing investigation | `/fix:root-cause` |
|
|
178
|
+
|
|
179
|
+
## Recommended Agents
|
|
180
|
+
|
|
181
|
+
| Phase | Agent | Purpose |
|
|
182
|
+
|-------|-------|---------|
|
|
183
|
+
| ANALYZE | `@code-reviewer` | Triage comments by severity |
|
|
184
|
+
| FIX | Stack-specific dev agent | Apply code changes |
|
|
185
|
+
| FIX | `@security-audit` | If comment flagged security |
|
|
186
|
+
| RESPOND | `@docs-writer` | Polish written replies |
|