moicle 2.3.0 → 3.0.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.
Files changed (32) hide show
  1. package/README.md +36 -47
  2. package/assets/commands/marketing.md +6 -6
  3. package/assets/skills/docs/sync/SKILL.md +195 -157
  4. package/assets/skills/feature/build/SKILL.md +891 -0
  5. package/assets/skills/feature/track/SKILL.md +157 -0
  6. package/assets/skills/fix/bug/SKILL.md +449 -0
  7. package/assets/skills/fix/incident/SKILL.md +6 -6
  8. package/assets/skills/marketing/brand/SKILL.md +304 -0
  9. package/assets/skills/marketing/content/SKILL.md +199 -141
  10. package/assets/skills/research/explore/SKILL.md +392 -0
  11. package/assets/skills/review/code/SKILL.md +622 -0
  12. package/dist/commands/install/usage.js +2 -2
  13. package/dist/commands/install/usage.js.map +1 -1
  14. package/package.json +1 -1
  15. package/assets/skills/docs/write/SKILL.md +0 -274
  16. package/assets/skills/feature/api/SKILL.md +0 -277
  17. package/assets/skills/feature/deprecate/SKILL.md +0 -276
  18. package/assets/skills/feature/new/SKILL.md +0 -273
  19. package/assets/skills/feature/refactor/SKILL.md +0 -269
  20. package/assets/skills/fix/hotfix/SKILL.md +0 -233
  21. package/assets/skills/fix/pr-comment/SKILL.md +0 -186
  22. package/assets/skills/fix/root-cause/SKILL.md +0 -276
  23. package/assets/skills/marketing/logo/SKILL.md +0 -252
  24. package/assets/skills/marketing/seo-blog/SKILL.md +0 -367
  25. package/assets/skills/marketing/video/SKILL.md +0 -258
  26. package/assets/skills/research/onboarding/SKILL.md +0 -225
  27. package/assets/skills/research/spike/SKILL.md +0 -228
  28. package/assets/skills/research/web/SKILL.md +0 -204
  29. package/assets/skills/review/architect/SKILL.md +0 -274
  30. package/assets/skills/review/branch/SKILL.md +0 -277
  31. package/assets/skills/review/pr/SKILL.md +0 -231
  32. package/assets/skills/review/tdd/SKILL.md +0 -245
@@ -1,269 +0,0 @@
1
- ---
2
- name: feature-refactor
3
- description: DDD refactoring workflow with phase-based checks and review loop. Refactor existing code to DDD architecture or improve existing DDD structure. Use when user says "refactor", "clean up", "improve code", "restructure", "migrate to ddd", "refactor ddd".
4
- args: "[MODULE] [DOMAIN]"
5
- ---
6
-
7
- # DDD Refactor Workflow
8
-
9
- Restructure existing code into DDD layers, or fix drift in an existing DDD module. **Preserves behavior** — refactor structure, never change logic.
10
-
11
- **ARGUMENTS:** `<module> <domain>` — e.g., `marketing notification`, `users identity`, `products catalog`
12
-
13
- ## When to use this skill
14
-
15
- - ✅ Migrating a legacy module into DDD layers
16
- - ✅ Existing DDD module has drifted (fat controller, anemic entity, mixed concerns)
17
- - ✅ Splitting one domain into multiple bounded contexts
18
- - ❌ Building a brand-new feature → use `/feature-new`
19
- - ❌ Just renaming files / variables → just do it
20
- - ❌ Fixing a bug → use `/fix-hotfix` or `/fix-root-cause`
21
-
22
- ## Read Architecture First
23
-
24
- Detect stack via `~/.claude/architecture/_shared/stack-detection.md`. Load `ddd-architecture.md` + stack doc.
25
-
26
- ---
27
-
28
- ## Workflow
29
-
30
- ```
31
- 0 FOUNDATION → 1 ANALYZE → 2 DOMAIN → 3 INFRA → 4 APP → 5 TESTS → 6 CLEANUP → REVIEW LOOP
32
- ```
33
-
34
- Each phase has a Rule Check. Do not skip any phase.
35
-
36
- ---
37
-
38
- ## Phase 0: FOUNDATION
39
-
40
- **New project (no `domain/` yet):** create
41
- - `domain/shared/` — base event types, event collector, dispatcher interface
42
- - Event bus infrastructure
43
- - App bootstrap/config struct
44
-
45
- **Existing project:** verify
46
- ```bash
47
- ls {domain_root}/shared/ 2>/dev/null && echo PASS || echo NEED SETUP
48
- ls {eventbus_path}/ 2>/dev/null && echo PASS || echo NEED SETUP
49
- ```
50
-
51
- If FAIL → set up foundation before continuing.
52
-
53
- ### Gate
54
- - [ ] Shared domain types exist
55
- - [ ] Event infrastructure exists (if domain raises events)
56
-
57
- ---
58
-
59
- ## Phase 1: ANALYZE
60
-
61
- **Goal:** read ALL source files in the old module before touching anything.
62
-
63
- ### Read
64
- - All files in the module dir
65
- - Related models / types / enums
66
- - Routes / providers / screens for this module
67
- - Existing tests (CRITICAL — used in Phase 5)
68
-
69
- ### Output to user
70
- ```markdown
71
- ## Refactor Plan: {module} → {domain}
72
-
73
- ### Current state
74
- - Entities/models: {list with fields}
75
- - Usecases (functions): {list with 1-line logic summary}
76
- - DTOs: {list}
77
- - Cross-module calls: {list}
78
- - Side-effects: {notifications / SSE / analytics / async jobs}
79
- - External deps: {DB, cache, messaging}
80
- - Endpoints/screens: {list with method + path}
81
- - Test files: {list with case counts}
82
-
83
- ### Proposed DDD structure
84
- - Value objects to extract: {list}
85
- - Entities: {list}
86
- - Events: {list}
87
- - Ports: {list}
88
- - Usecases: {list}
89
- - Listeners: {list}
90
- ```
91
-
92
- ### Gate
93
- - [ ] All module files read
94
- - [ ] Plan presented to user
95
- - [ ] **User CONFIRMED** before continuing
96
-
97
- ---
98
-
99
- ## Phase 2: DOMAIN LAYER
100
-
101
- Create `domain/{domain}/` (or add to existing).
102
-
103
- ### Order: VO → entities → events → ports → usecases
104
-
105
- - **Value Objects** (`valueobjects/`) — extract typed values (status strings, rates, amounts). Immutable + behavior methods. Stdlib imports only.
106
- - **Entities** (`entities/`) — convert old models. Constructor + behavior methods + event collection. Add mappers to/from persistence. No framework imports.
107
- - **Events** (`events/`) — one file per event. Extract from existing direct side-effect calls.
108
- - **Ports** (`ports/`) — one file per interface. Store ports (persistence), adapter ports (external services). Platform-agnostic naming (`URLParser` not `ShopeeURLParser`). No infra imports.
109
- - **UseCases** (`usecases/`) — extract business logic from old controllers/handlers/services. Import from `ports/`. Split by concern, ≤200 lines/file. No infra imports.
110
-
111
- ### Gate
112
- ```bash
113
- {build_domain} && echo PASS || echo FAIL
114
- {grep_forbidden in domain/} && echo FAIL || echo PASS
115
- {cross_domain_check} && echo FAIL || echo PASS
116
- ```
117
-
118
- ---
119
-
120
- ## Phase 3: INFRASTRUCTURE LAYER
121
-
122
- - Implement port interfaces from `domain/{domain}/ports/`
123
- - Mapper functions: domain entity ↔ persistence model
124
- - Compile-time interface check (where supported)
125
- - NO business logic
126
- - Keep existing persistence models in place
127
-
128
- ### Gate
129
- - [ ] Infra build passes
130
- - [ ] All port interfaces implemented
131
-
132
- ---
133
-
134
- ## Phase 4: APPLICATION LAYER
135
-
136
- ### 4.1 Listeners (extract side-effects)
137
- **CRITICAL:** Side-effects (notifications, SSE, analytics, jobs) **MUST NOT** be called directly in usecases or infra. Flow must be: entity collects event → usecase dispatches → listener handles.
138
-
139
- - One file per event listener
140
- - Register in event bus
141
-
142
- ### 4.2 Service
143
- - Thin wrapper, delegates to usecases. No business logic.
144
-
145
- ### 4.3 Handler / Controller / Screen
146
- - Registration / wiring function
147
- - Thin: parse → service → return
148
- - DTOs in separate file
149
- - **All endpoints must match the old paths + methods**
150
-
151
- ### Gate
152
- - [ ] App build passes
153
- - [ ] Every old endpoint has a new handler at the same path
154
-
155
- ---
156
-
157
- ## Phase 5: TESTS
158
-
159
- **CRITICAL:** read old tests first, copy every scenario. Do not lose coverage.
160
-
161
- 1. Read all old test files
162
- 2. List all test cases + business scenarios
163
- 3. Write domain tests covering all of them
164
-
165
- ### What to test
166
- - **Entities** — behavior methods, edge cases, business rules (pure, no mocks)
167
- - **UseCases** — happy + error paths, validation, event collection (mock ports)
168
- - **Value Objects** — transitions, calculations, edge cases (pure)
169
-
170
- ### Gate
171
- - [ ] Old test count ≤ new test count
172
- - [ ] Every old scenario covered
173
- - [ ] `{test_command}` passes
174
-
175
- ---
176
-
177
- ## Phase 6: INTEGRATION & CLEANUP
178
-
179
- ### 6.1 Wire up the new module
180
- - Add registration calls in router / provider / registry
181
- - Remove old module registrations
182
- - Endpoints/screens match old paths
183
-
184
- ### 6.2 Remove old module
185
- - Delete old directory **only after** build + tests pass
186
- - Do NOT delete shared models/types other modules still use
187
-
188
- ### Gate
189
- ```bash
190
- {full_build} && echo PASS || echo FAIL
191
- test -d {old_module_path} && echo "FAIL: still there" || echo PASS
192
- grep -r "{old_import_path}" --include="*.{ext}" . && echo "FAIL: stale imports" || echo PASS
193
- ```
194
-
195
- ---
196
-
197
- ## Review Loop
198
-
199
- After Phase 6, call `/review-architect {stack} {domain}`. Loop until score ≥ B.
200
-
201
- ```
202
- LOOP:
203
- 1. /review-architect {stack} {domain}
204
- 2. IF violations severity ≥ MEDIUM:
205
- fix all → full build → all tests → GOTO 1
206
- 3. IF score ≥ B → BREAK
207
- ```
208
-
209
- ---
210
-
211
- ## Final Report
212
-
213
- ```markdown
214
- ## Refactor Complete: {module} → {domain}
215
-
216
- ### Changes
217
- - Files created: {N}
218
- - Files modified: {N}
219
- - Files deleted: {N}
220
-
221
- ### Endpoints preserved
222
- | Old path | New handler | Status |
223
- |----------|-------------|--------|
224
-
225
- ### Domain events introduced
226
- | Event | Listener(s) |
227
- |-------|-------------|
228
-
229
- ### Tests
230
- - Files: {N}, cases: {M}
231
- - All old scenarios migrated: YES
232
-
233
- ### Review score: {A/B}
234
- - Build / Lint / Domain purity / Old module removed / No stale imports / Tests: all PASS
235
- ```
236
-
237
- ---
238
-
239
- ## Hard Rules
240
-
241
- - **Preserve behavior** — never change business logic during refactor
242
- - **MUST read old tests** before writing new ones (no scenario lost)
243
- - **MUST read old code** carefully — don't invent logic from variable names
244
- - **All endpoints keep their paths** — refactor is invisible to clients
245
- - **Don't skip phases** — Rule Checks gate the next phase
246
- - **Multiple modules → same domain:** first module creates the domain dir, others add to it
247
- - **One module at a time** — finish one before starting the next
248
-
249
- ---
250
-
251
- ## Related Skills
252
-
253
- | When | Use |
254
- |------|-----|
255
- | Building from scratch (no existing code) | `/feature-new` |
256
- | Just adding tests to untested code | `/review-tdd` |
257
- | Reviewing the refactor before merging | `/review-branch` |
258
- | Final architecture check (called automatically in review loop) | `/review-architect` |
259
-
260
- ## Recommended Agents
261
-
262
- | Phase | Agent | Purpose |
263
- |-------|-------|---------|
264
- | ANALYZE | `@refactor` | Identify refactor scope |
265
- | ANALYZE | `@code-reviewer` | Smell detection |
266
- | PLAN | `@clean-architect` | Architecture alignment |
267
- | BUILD | Stack-specific dev agent | Implementation |
268
- | TESTS | `@test-writer` | Domain tests |
269
- | REVIEW | `@code-reviewer` | Final quality check |
@@ -1,233 +0,0 @@
1
- ---
2
- name: fix-hotfix
3
- description: Quick bug fix workflow with rollback plan. Use when fixing bugs, hotfixes, urgent issues, production bugs, or when user says "fix bug", "hotfix", "urgent fix", "production issue".
4
- ---
5
-
6
- # Hotfix Workflow
7
-
8
- Fast-track bug fix with a rollback plan. Use when the cause is identifiable in under an hour of investigation.
9
-
10
- ## When to use this skill
11
-
12
- - ✅ Bug is reproducible and root cause is clear (or quickly identifiable)
13
- - ✅ Need a fix shipped fast with a rollback plan
14
- - ✅ Severity ranges from low (minor UI) to high (feature broken)
15
- - ❌ Production is down right now → use `/fix-incident` first
16
- - ❌ Bug has been "fixed" multiple times and keeps returning → use `/fix-root-cause`
17
- - ❌ Building a new feature → use `/feature-new`
18
-
19
- ## Read Architecture First
20
-
21
- Read `ddd-architecture.md` + stack-specific doc — the fix must land in the right layer (usecase / handler / infra) per architecture rules.
22
-
23
- ## Severity
24
-
25
- Use `~/.claude/architecture/_shared/severity-levels.md` (incident table). Hotfix typically covers P2-P4. P1 → start with `/fix-incident` for triage / comms.
26
-
27
- ---
28
-
29
- ## Workflow
30
-
31
- ```
32
- IDENTIFY → REPRODUCE → FIX → VERIFY → DEPLOY
33
- ↑ ↓
34
- └── ROLLBACK (if needed)
35
- ```
36
-
37
- ---
38
-
39
- ## Phase 1: IDENTIFY (≤15 min)
40
-
41
- **Goal:** capture exactly what's broken — no speculation.
42
-
43
- ### Capture
44
- - Error message / stack trace (verbatim)
45
- - Steps to reproduce
46
- - Expected vs actual behavior
47
- - Environment (prod / staging / dev)
48
- - Affected users (all / subset / specific tenant)
49
- - Recent deploys / config changes (last 24-48h)
50
-
51
- ### 5 Whys (worked example)
52
- > Q1: Why does checkout fail? A1: `OrderService.calculate` returns NaN.
53
- > Q2: Why NaN? A2: `quantity * price` where price is undefined.
54
- > Q3: Why undefined? A3: New SKUs from supplier feed have null price.
55
- > Q4: Why null? A4: Feed schema added optional `price` field, defaulted to null.
56
- > Q5: Why didn't validation catch it? A5: Import worker skips schema validation for "perf".
57
-
58
- → Root cause: skipped validation in import worker. Fix at the import boundary, not in checkout.
59
-
60
- ### Gate
61
- - [ ] Error captured verbatim
62
- - [ ] Reproduction steps known (or "intermittent" noted)
63
- - [ ] Severity assigned (P2 / P3 / P4)
64
- - [ ] Root cause identified (use `/fix-root-cause` if 5 Whys doesn't converge)
65
-
66
- ---
67
-
68
- ## Phase 2: REPRODUCE (≤30 min)
69
-
70
- **Goal:** reproduce locally before changing any code.
71
-
72
- ### Steps
73
- 1. Check out the deployed commit (NOT main if main has drifted)
74
- 2. Reproduce with the exact data / inputs from Phase 1
75
- 3. If you can't reproduce → it's environment-specific. Check:
76
- - Env vars on prod vs local
77
- - DB state / data shape
78
- - Cache / CDN state
79
- - Runtime version differences
80
-
81
- ### Gate
82
- - [ ] Reproduced locally on the deployed commit
83
- - [ ] OR documented why local reproduction is impossible + plan to test on staging
84
-
85
- ---
86
-
87
- ## Phase 3: FIX
88
-
89
- **Goal:** smallest correct change at the right layer.
90
-
91
- ### Rules
92
- - Fix at the **root cause**, not the symptom
93
- - Land the fix in the right layer (boundary validation → handler/DTO; business rule → usecase; data shape → infra mapper)
94
- - **Add a regression test first** (RED), then make it pass (GREEN). See `/review-tdd`.
95
- - Don't refactor on the fix — separate PR
96
- - If the fix requires schema migration, plan it as 2 deploys (compatible code first, then migration)
97
-
98
- ### Boundary defense
99
- For data-shape bugs (null where not expected, type mismatch from external API): defend at the **trust boundary** (handler / adapter), not inside business logic.
100
-
101
- ### Gate
102
- - [ ] Regression test added (red → green)
103
- - [ ] Fix is in the right layer (per architecture)
104
- - [ ] No unrelated changes in the PR
105
- - [ ] Existing tests still pass
106
-
107
- ---
108
-
109
- ## Phase 4: VERIFY
110
-
111
- **Goal:** confirm fix works without breaking other paths.
112
-
113
- ### Local
114
- - [ ] Original failure no longer reproducible
115
- - [ ] All tests pass (`{test command}`)
116
- - [ ] Linter clean
117
- - [ ] Build green
118
-
119
- ### Staging (if available)
120
- - [ ] Deploy to staging
121
- - [ ] Reproduce the failure scenario — should pass
122
- - [ ] Smoke-test adjacent features (anything sharing the code path)
123
- - [ ] Monitor logs for 5-15 min
124
-
125
- ### Gate
126
- - [ ] Local + staging both verified
127
- - [ ] No regressions in adjacent features
128
-
129
- ---
130
-
131
- ## Phase 5: DEPLOY
132
-
133
- ### Pre-deploy checklist
134
- - [ ] PR reviewed (`/review-branch` self + `/review-pr` from teammate)
135
- - [ ] Rollback plan documented (see below)
136
- - [ ] On-call notified
137
- - [ ] CHANGELOG entry
138
-
139
- ### Rollback plan
140
- Document **before** deploying:
141
- - Rollback method: `revert PR` / `redeploy commit {sha}` / `feature flag off` / `DB migration down`
142
- - Estimated rollback time
143
- - Who has authority to roll back (usually IC or on-call)
144
- - Signal to roll back (specific metric + threshold)
145
-
146
- ### Deploy steps
147
- 1. Deploy via normal pipeline (don't skip CI even under pressure)
148
- 2. Watch metrics + logs for the symptom + adjacent code paths
149
- 3. Hold deploy attention for at least 1× normal request cycle (15-30 min)
150
-
151
- ### Gate
152
- - [ ] Deployed successfully
153
- - [ ] Symptom no longer occurring
154
- - [ ] No new errors in monitoring
155
- - [ ] Stakeholders notified
156
-
157
- ---
158
-
159
- ## Phase 6: ROLLBACK (if Phase 5 verify fails)
160
-
161
- ### When to roll back
162
- - Error rate increases post-deploy
163
- - New error type appears
164
- - Adjacent feature breaks
165
- - Performance degrades meaningfully
166
-
167
- ### How
168
- 1. Announce: "Rolling back {fix} in 60s due to {observation}"
169
- 2. Execute: revert / redeploy previous / flip flag / migration down
170
- 3. Verify rollback: metrics return to baseline
171
- 4. Post-mortem the rollback — what was missed in Phase 3/4?
172
-
173
- ---
174
-
175
- ## Final Report
176
-
177
- ```markdown
178
- ## Hotfix: {short description}
179
-
180
- ### Root cause
181
- {From Phase 1, 5 Whys final answer}
182
-
183
- ### Fix
184
- - File: `path/to/file:line`
185
- - Layer: {handler / usecase / infra / etc.}
186
- - Approach: {boundary defense / logic correction / data migration}
187
-
188
- ### Tests
189
- - Regression test: {file:line}
190
- - All tests passing
191
-
192
- ### Deploy
193
- - Deployed: {timestamp}
194
- - Verified: {timestamp + how}
195
- - Rollback plan: {revert / redeploy / flag / migration}
196
-
197
- ### Severity: {P2 / P3 / P4}
198
- ### Status: SHIPPED ✅ (or ROLLED BACK + reason)
199
- ```
200
-
201
- ---
202
-
203
- ## Hard Rules
204
-
205
- - **Reproduce before fixing** — no fix lands without local repro
206
- - **Regression test required** — every fix gets a test that would have caught it
207
- - **Fix at the root, not the symptom** — patching the symptom invites the bug back
208
- - **No drive-by refactor** — fix PR is focused, refactor goes in a separate PR
209
- - **Always have a rollback plan** documented before deploy
210
- - **Don't skip CI** under pressure — bypassing CI is what causes the next incident
211
-
212
- ---
213
-
214
- ## Related Skills
215
-
216
- | When | Use |
217
- |------|-----|
218
- | Production is down right now | `/fix-incident` first, then hotfix |
219
- | Bug keeps coming back after fixes | `/fix-root-cause` |
220
- | Need to write regression test first | `/review-tdd` |
221
- | Bug is on an open PR | `/fix-pr-comment` |
222
- | Self-review before opening PR | `/review-branch` |
223
-
224
- ## Recommended Agents
225
-
226
- | Phase | Agent | Purpose |
227
- |-------|-------|---------|
228
- | IDENTIFY | Stack-specific dev agent | Read error context |
229
- | FIX | Stack-specific dev agent | Apply the fix |
230
- | FIX | `@security-audit` | Security-related bugs |
231
- | VERIFY | `@test-writer` | Regression test |
232
- | VERIFY | `@code-reviewer` | Quick code review |
233
- | DEPLOY | `@devops` | CI/CD + monitoring |
@@ -1,186 +0,0 @@
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 |