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,276 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feature-deprecate
|
|
3
|
+
description: Deprecation workflow for safely removing features or code. Use when deprecating, removing features, sunsetting functionality, or when user says "deprecate", "remove feature", "sunset", "phase out", "delete feature".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Deprecation Workflow
|
|
7
|
+
|
|
8
|
+
Safely sunset a feature, API, or module without breaking users. Built around a **timeline** (T-90 → T+30) and the principle that **announce → warn → migrate → remove → monitor**.
|
|
9
|
+
|
|
10
|
+
## When to use this skill
|
|
11
|
+
|
|
12
|
+
- ✅ Sunsetting a public API endpoint, SDK method, or user-facing feature
|
|
13
|
+
- ✅ Removing an internal module that other domains depend on
|
|
14
|
+
- ✅ Migrating consumers from v1 → v2 of anything
|
|
15
|
+
- ❌ Just deleting unused dead code (no consumers) → just delete in PR with explanation
|
|
16
|
+
- ❌ Renaming an internal helper → just rename, no deprecation needed
|
|
17
|
+
- ❌ Removing a feature behind a flag with 0 users → just remove the flag
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Workflow
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
IDENTIFY → PLAN → MIGRATE → REMOVE → VERIFY
|
|
25
|
+
↓ ↓ ↓ ↓ ↓
|
|
26
|
+
announce warn migrate remove monitor
|
|
27
|
+
(T-90) (T-60) (T-30) (T-0) (T+30)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Read Architecture First
|
|
31
|
+
|
|
32
|
+
Read `~/.claude/architecture/ddd-architecture.md` + stack doc to understand layer impact before any deprecation.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Deprecation Strategy
|
|
37
|
+
|
|
38
|
+
| Strategy | When | Timeline |
|
|
39
|
+
|----------|------|----------|
|
|
40
|
+
| **Soft** | Internal API, replacement available, low usage | Announce → warn → migrate → remove (1–3 months) |
|
|
41
|
+
| **Hard** | Security issue, breaking infra change | Announce + remove fast (days to weeks, with mitigation) |
|
|
42
|
+
| **Versioned** | Public API, breaking change | Run v1 + v2 side-by-side, sunset v1 over months/years |
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Phase 1: IDENTIFY
|
|
47
|
+
|
|
48
|
+
**Goal:** know what you're removing and who depends on it.
|
|
49
|
+
|
|
50
|
+
### Actions
|
|
51
|
+
1. Define the target: feature / endpoint / module / class / method
|
|
52
|
+
2. Find ALL usages:
|
|
53
|
+
```bash
|
|
54
|
+
# adapt per stack
|
|
55
|
+
grep -rn "{symbol}" --include="*.{ext}" .
|
|
56
|
+
# for APIs, check access logs:
|
|
57
|
+
{log_query for endpoint hits over last 30/90 days}
|
|
58
|
+
```
|
|
59
|
+
3. Identify consumers:
|
|
60
|
+
- Internal teams / services
|
|
61
|
+
- External users / SDK consumers
|
|
62
|
+
- Third-party integrations
|
|
63
|
+
- Docs and tutorials that reference it
|
|
64
|
+
4. Assess impact (per architecture layer):
|
|
65
|
+
- Which layers reference it (domain / application / infra)?
|
|
66
|
+
- Cross-domain consumers?
|
|
67
|
+
- Breaking change severity?
|
|
68
|
+
5. Find replacement (or document "no replacement, here's the workaround")
|
|
69
|
+
|
|
70
|
+
### Output
|
|
71
|
+
|
|
72
|
+
```markdown
|
|
73
|
+
## Deprecation Analysis: {target}
|
|
74
|
+
|
|
75
|
+
### What
|
|
76
|
+
- Type: {feature / API / class / method / module}
|
|
77
|
+
- Location: {file:line(s)}
|
|
78
|
+
- Reason: {security / consolidation / better alternative / cost / etc.}
|
|
79
|
+
|
|
80
|
+
### Replacement
|
|
81
|
+
- {New API / pattern, with migration mapping}
|
|
82
|
+
- OR: {no replacement — rationale}
|
|
83
|
+
|
|
84
|
+
### Usage
|
|
85
|
+
- Internal callers: {list with team contacts}
|
|
86
|
+
- External callers (last 30d): {N requests / N unique tokens}
|
|
87
|
+
- Docs referencing it: {list}
|
|
88
|
+
|
|
89
|
+
### Impact
|
|
90
|
+
- Layers affected: {domain / application / infra}
|
|
91
|
+
- Severity: {breaking / non-breaking}
|
|
92
|
+
- Estimated migration effort per consumer: {hours}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Gate
|
|
96
|
+
- [ ] All usages found (internal + external)
|
|
97
|
+
- [ ] Stakeholders listed with contacts
|
|
98
|
+
- [ ] Replacement defined (or explicit "no replacement")
|
|
99
|
+
- [ ] Impact severity assessed
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Phase 2: PLAN
|
|
104
|
+
|
|
105
|
+
**Goal:** lock the timeline and the communication plan.
|
|
106
|
+
|
|
107
|
+
### Timeline template
|
|
108
|
+
|
|
109
|
+
| Phase | Date | Action |
|
|
110
|
+
|-------|------|--------|
|
|
111
|
+
| T-90 | {date} | Announce deprecation (changelog + email + docs banner) |
|
|
112
|
+
| T-60 | {date} | Add runtime warning (log / response header) |
|
|
113
|
+
| T-30 | {date} | Hard warning (UI banner / error in non-prod) |
|
|
114
|
+
| T-0 | {date} | Remove. Return 410 Gone for APIs |
|
|
115
|
+
| T+30 | {date} | Remove deprecation code itself, archive docs |
|
|
116
|
+
|
|
117
|
+
**Adjust** based on strategy: hard = days, public API = months/quarters.
|
|
118
|
+
|
|
119
|
+
### Comms checklist
|
|
120
|
+
- [ ] CHANGELOG entry
|
|
121
|
+
- [ ] Release notes
|
|
122
|
+
- [ ] Email to known consumers
|
|
123
|
+
- [ ] Docs banner on the deprecated feature page
|
|
124
|
+
- [ ] Migration guide written (with code diff before/after)
|
|
125
|
+
- [ ] Slack / forum announcement
|
|
126
|
+
- [ ] Updated SDK (if applicable) with deprecation in code
|
|
127
|
+
|
|
128
|
+
### Gate
|
|
129
|
+
- [ ] Timeline locked with dates
|
|
130
|
+
- [ ] Migration guide drafted
|
|
131
|
+
- [ ] Comms plan signed off by stakeholders
|
|
132
|
+
- [ ] Replacement available and documented
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Phase 3: MIGRATE
|
|
137
|
+
|
|
138
|
+
**Goal:** make consumers stop using the deprecated thing.
|
|
139
|
+
|
|
140
|
+
### Add deprecation markers (in code)
|
|
141
|
+
|
|
142
|
+
Pick the language idiom — show **what** is deprecated, **when** it goes away, and **what to use instead**.
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
/** @deprecated Removed on {date}. Use `newFunction()`. See {link}. */
|
|
146
|
+
export function oldFunction() { ... }
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
```go
|
|
150
|
+
// Deprecated: removed on {date}. Use NewFunction instead. See {link}.
|
|
151
|
+
func OldFunction() { ... }
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
```php
|
|
155
|
+
/**
|
|
156
|
+
* @deprecated since 2.0.0, removed in 3.0.0. Use newMethod(). See {link}.
|
|
157
|
+
*/
|
|
158
|
+
public function oldMethod() { ... }
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
```dart
|
|
162
|
+
@Deprecated('Removed on {date}. Use newWidget(). See {link}.')
|
|
163
|
+
class OldWidget { ... }
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Add runtime signal (for APIs)
|
|
167
|
+
- Response header: `Deprecation: true` + `Sunset: {RFC 3339 date}` + `Link: <docs>; rel="deprecation"`
|
|
168
|
+
- Server log: `deprecated.endpoint.called` with caller identity
|
|
169
|
+
- Metric: counter of deprecated calls, broken down by consumer
|
|
170
|
+
|
|
171
|
+
### Migrate internal consumers proactively
|
|
172
|
+
- Open PRs against internal consumers yourself when possible
|
|
173
|
+
- Track migration progress (% consumers migrated)
|
|
174
|
+
|
|
175
|
+
### Gate
|
|
176
|
+
- [ ] Deprecation markers in code
|
|
177
|
+
- [ ] Runtime signals in place (headers, logs, metrics)
|
|
178
|
+
- [ ] Internal usage trending down (verify weekly)
|
|
179
|
+
- [ ] Migration guide proven by ≥1 consumer
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Phase 4: REMOVE
|
|
184
|
+
|
|
185
|
+
**Goal:** delete the deprecated thing safely.
|
|
186
|
+
|
|
187
|
+
### Pre-removal checks
|
|
188
|
+
- [ ] Today's date ≥ T-0
|
|
189
|
+
- [ ] Usage metric shows 0 calls (or only known stragglers with explicit waiver)
|
|
190
|
+
- [ ] Final removal warning sent to remaining consumers
|
|
191
|
+
- [ ] Replacement still works and is documented
|
|
192
|
+
|
|
193
|
+
### Removal steps
|
|
194
|
+
1. Delete the code + tests + docs
|
|
195
|
+
2. For APIs: return `410 Gone` (NOT 404 — different meaning) with migration link in body
|
|
196
|
+
3. Remove DB columns / tables in a follow-up migration (NOT same PR — keep removal reversible)
|
|
197
|
+
4. Update CHANGELOG: "Removed: {thing}. See migration guide {link}."
|
|
198
|
+
5. Deploy through normal pipeline
|
|
199
|
+
|
|
200
|
+
### Gate
|
|
201
|
+
- [ ] Code, tests, docs removed
|
|
202
|
+
- [ ] API returns 410 (if applicable)
|
|
203
|
+
- [ ] CHANGELOG entry
|
|
204
|
+
- [ ] Deployed to all environments
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Phase 5: VERIFY (T+30)
|
|
209
|
+
|
|
210
|
+
**Goal:** confirm clean removal.
|
|
211
|
+
|
|
212
|
+
### Checks
|
|
213
|
+
- [ ] No errors related to the removed code in monitoring
|
|
214
|
+
- [ ] No customer support tickets about the missing feature
|
|
215
|
+
- [ ] No leftover references in code (grep for the symbol)
|
|
216
|
+
- [ ] Deprecation infra (warning headers, log alerts) cleaned up
|
|
217
|
+
- [ ] DB cleanup migration applied (if any)
|
|
218
|
+
|
|
219
|
+
### Final report
|
|
220
|
+
|
|
221
|
+
```markdown
|
|
222
|
+
## Deprecation Complete: {target}
|
|
223
|
+
|
|
224
|
+
### Timeline
|
|
225
|
+
- Announced: {date}
|
|
226
|
+
- Removed: {date}
|
|
227
|
+
- Verified: {date}
|
|
228
|
+
|
|
229
|
+
### Outcome
|
|
230
|
+
- Consumers migrated: {N/N}
|
|
231
|
+
- Errors post-removal: {0 / N — explanation}
|
|
232
|
+
- Replacement adoption: {%}
|
|
233
|
+
|
|
234
|
+
### Cleanup
|
|
235
|
+
- [x] Code removed
|
|
236
|
+
- [x] Tests removed
|
|
237
|
+
- [x] Docs removed
|
|
238
|
+
- [x] DB columns dropped (in {migration})
|
|
239
|
+
- [x] Deprecation infra cleaned
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## Anti-Patterns
|
|
245
|
+
|
|
246
|
+
- **Silent removal** — removing without warning. Always announce first.
|
|
247
|
+
- **Vague deprecation** — `@deprecated` with no date and no replacement. Always include both.
|
|
248
|
+
- **Forever-deprecation** — marking deprecated and never removing. Set the date.
|
|
249
|
+
- **Returning 404 instead of 410** — 404 = "doesn't exist", 410 = "intentionally gone". Use 410.
|
|
250
|
+
- **Same-PR removal of API + DB columns** — keep removal reversible; drop columns in a follow-up.
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## Related Skills
|
|
255
|
+
|
|
256
|
+
| When | Use |
|
|
257
|
+
|------|-----|
|
|
258
|
+
| Adding the replacement first | `/feature:new` |
|
|
259
|
+
| Restructuring the code that uses the deprecated thing | `refactor` |
|
|
260
|
+
| Documenting the migration guide | `/docs:write` |
|
|
261
|
+
| Reviewing the removal PR | `/review:pr` |
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## Recommended Agents
|
|
266
|
+
|
|
267
|
+
| Phase | Agent | Purpose |
|
|
268
|
+
|-------|-------|---------|
|
|
269
|
+
| IDENTIFY | `@refactor` | Dependency analysis |
|
|
270
|
+
| IDENTIFY | `@code-reviewer` | Find all usages |
|
|
271
|
+
| PLAN | `@clean-architect` | Migration strategy |
|
|
272
|
+
| PLAN | `@api-designer` | API versioning |
|
|
273
|
+
| PLAN | `@docs-writer` | Deprecation notice + migration guide |
|
|
274
|
+
| MIGRATE | Stack-specific dev agent | Code changes |
|
|
275
|
+
| VERIFY | `@test-writer` | Migration tests |
|
|
276
|
+
| VERIFY | `@code-reviewer` | Final review |
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feature-new
|
|
3
|
+
description: DDD feature development workflow with phase-based checks and review loop. Use when implementing new features, building functionality, or when user says "implement feature", "add feature", "build feature", "create feature", "new feature".
|
|
4
|
+
args: "[DOMAIN] [FEATURE]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# DDD Feature Development Workflow
|
|
8
|
+
|
|
9
|
+
Build a new feature following DDD layers with rule checks per phase and a final review loop until score ≥ B.
|
|
10
|
+
|
|
11
|
+
**ARGUMENTS:** `<domain> <feature>` — e.g., `wallet savings`, `notification broadcast`, `catalog products`
|
|
12
|
+
|
|
13
|
+
## When to use this skill
|
|
14
|
+
|
|
15
|
+
- ✅ Feature spans multiple DDD layers (domain + app + infra)
|
|
16
|
+
- ✅ The approach is well-understood (no major research / prototype needed)
|
|
17
|
+
- ✅ You want automated architecture review at the end
|
|
18
|
+
- ❌ Quick bug fix → use `/fix:hotfix`
|
|
19
|
+
- ❌ Don't know the right approach yet → `/research:web` or `/research:spike` first
|
|
20
|
+
- ❌ Restructuring existing code → use `/feature:refactor`
|
|
21
|
+
|
|
22
|
+
## Read Architecture First
|
|
23
|
+
|
|
24
|
+
Detect stack via `~/.claude/architecture/_shared/stack-detection.md`. Load `ddd-architecture.md` + the stack doc — extract directory layout, layer rules, forbidden imports, check scripts before any code.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Workflow
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
1 PLAN → 2 DOMAIN → 3 INFRA → 4 APP → 5 WIRE → 6 TESTS → REVIEW LOOP
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Phase 1: PLAN
|
|
37
|
+
|
|
38
|
+
### 1.1 Read a reference module
|
|
39
|
+
Pick the smallest existing module in the project as a template. Read ALL its files end-to-end:
|
|
40
|
+
- entities, value objects, events, ports, usecases
|
|
41
|
+
- service, handler, DTOs, listeners
|
|
42
|
+
- infrastructure store/API
|
|
43
|
+
- registration in router/provider/registry
|
|
44
|
+
|
|
45
|
+
### 1.2 Plan the feature
|
|
46
|
+
|
|
47
|
+
Present to the user:
|
|
48
|
+
|
|
49
|
+
```markdown
|
|
50
|
+
## Feature Plan: {domain}/{feature}
|
|
51
|
+
|
|
52
|
+
### Entities + fields
|
|
53
|
+
- `{Entity}` — {field: type, with constraint}
|
|
54
|
+
- ...
|
|
55
|
+
|
|
56
|
+
### Value Objects
|
|
57
|
+
- `{Status}` — states: {list}, transitions: {list}
|
|
58
|
+
- ...
|
|
59
|
+
|
|
60
|
+
### Endpoints / screens / commands
|
|
61
|
+
| Method | Path | Purpose |
|
|
62
|
+
|--------|------|---------|
|
|
63
|
+
| POST | /api/v1/wallets/:id/savings | Open savings account |
|
|
64
|
+
|
|
65
|
+
### Domain events
|
|
66
|
+
| Event | Triggered when | Listeners |
|
|
67
|
+
|-------|----------------|-----------|
|
|
68
|
+
| `SavingsAccountOpened` | After Account.open() succeeds | NotificationListener |
|
|
69
|
+
|
|
70
|
+
### Business rules
|
|
71
|
+
- Cannot open savings if main balance < min threshold
|
|
72
|
+
- Interest accrues nightly via scheduled job
|
|
73
|
+
- ...
|
|
74
|
+
|
|
75
|
+
### Files to create
|
|
76
|
+
- `domain/wallet/entities/savings_account.go`
|
|
77
|
+
- `domain/wallet/valueobjects/savings_status.go`
|
|
78
|
+
- `domain/wallet/ports/savings_store.go`
|
|
79
|
+
- `domain/wallet/usecases/open_savings.go`
|
|
80
|
+
- `application/ports/http/savings_handler.go`
|
|
81
|
+
- `infrastructure/database/savings_store.go`
|
|
82
|
+
- (+ tests for each domain file)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Gate
|
|
86
|
+
- [ ] Architecture docs read
|
|
87
|
+
- [ ] Reference module read end-to-end
|
|
88
|
+
- [ ] Plan presented
|
|
89
|
+
- [ ] **User CONFIRMED** before any code is written
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Phase 2: DOMAIN LAYER
|
|
94
|
+
|
|
95
|
+
Build in order: **value objects → entities → events → ports → usecases**.
|
|
96
|
+
|
|
97
|
+
- **Value Objects** — typed values with behavior (`IsTerminal()`, `CanTransitionTo()`). Stdlib imports only.
|
|
98
|
+
- **Entities** — constructor + behavior methods + guard methods (`isActive()`, `canXxx()`) + business error types. Raise events on state change. Imports: stdlib + valueobjects + domain/shared.
|
|
99
|
+
- **Events** — one file per event, extend base event, carry data listeners need.
|
|
100
|
+
- **Ports** — one file per interface. Store ports use domain types. Platform-agnostic naming. No infra imports.
|
|
101
|
+
- **UseCases** — constructor with port deps + event dispatcher. Split by concern. Business logic lives here. Dispatch events after persistence. No infra imports.
|
|
102
|
+
|
|
103
|
+
### Gate
|
|
104
|
+
```bash
|
|
105
|
+
{build_domain} && echo PASS || echo FAIL
|
|
106
|
+
{grep_forbidden in domain/} && echo FAIL || echo PASS
|
|
107
|
+
{cross_domain_check} && echo FAIL || echo PASS
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Phase 3: INFRASTRUCTURE LAYER
|
|
113
|
+
|
|
114
|
+
### 3.1 Persistence models (if applicable)
|
|
115
|
+
- ORM models, Prisma schema, Freezed classes
|
|
116
|
+
- Table/collection config
|
|
117
|
+
- Helpers for atomic updates
|
|
118
|
+
|
|
119
|
+
### 3.2 Store / API implementations
|
|
120
|
+
- Implements port interfaces from domain
|
|
121
|
+
- Compile-time interface check (where supported)
|
|
122
|
+
- Mapper functions: domain entity ↔ persistence model
|
|
123
|
+
- NO business logic
|
|
124
|
+
- Use context consistently
|
|
125
|
+
|
|
126
|
+
### Gate
|
|
127
|
+
- [ ] Infra build passes
|
|
128
|
+
- [ ] All ports from Phase 2 have an implementation
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Phase 4: APPLICATION LAYER
|
|
133
|
+
|
|
134
|
+
### 4.1 Service
|
|
135
|
+
- Thin wrapper delegating to usecases
|
|
136
|
+
- Can orchestrate cross-domain calls
|
|
137
|
+
|
|
138
|
+
### 4.2 Handler / Controller / Screen
|
|
139
|
+
- Wiring function: store → usecase → service → handler → routes
|
|
140
|
+
- Thin: parse → service → respond
|
|
141
|
+
- DTOs in separate file
|
|
142
|
+
|
|
143
|
+
### 4.3 Listeners (if domain raises events)
|
|
144
|
+
- One file per event
|
|
145
|
+
- Side-effects only (notifications, SSE, analytics, jobs)
|
|
146
|
+
- Background context for async work
|
|
147
|
+
- Register in event bus
|
|
148
|
+
|
|
149
|
+
### Gate
|
|
150
|
+
- [ ] App build passes
|
|
151
|
+
- [ ] Every event has a registered listener (if needed)
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Phase 5: WIRING
|
|
156
|
+
|
|
157
|
+
### 5.1 Router / Provider
|
|
158
|
+
- Add routes / screens / providers for the new module
|
|
159
|
+
- Wire service dependencies if cross-module
|
|
160
|
+
|
|
161
|
+
### 5.2 Persistence setup
|
|
162
|
+
- Add migrations / schema files
|
|
163
|
+
- Run migrations on dev DB
|
|
164
|
+
|
|
165
|
+
### 5.3 Event registry
|
|
166
|
+
- Register all new listeners
|
|
167
|
+
- Verify event name strings match across event ↔ registry
|
|
168
|
+
|
|
169
|
+
### Gate
|
|
170
|
+
- [ ] Full build passes
|
|
171
|
+
- [ ] Routes / providers registered
|
|
172
|
+
- [ ] Migrations applied locally
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Phase 6: TESTS
|
|
177
|
+
|
|
178
|
+
### Value Object tests
|
|
179
|
+
- All status transitions
|
|
180
|
+
- Terminal states
|
|
181
|
+
- Behavior methods
|
|
182
|
+
- Edge cases
|
|
183
|
+
|
|
184
|
+
### Entity tests
|
|
185
|
+
- Constructor
|
|
186
|
+
- State transitions
|
|
187
|
+
- Event collection after change
|
|
188
|
+
- Guard methods
|
|
189
|
+
- Boundary values
|
|
190
|
+
|
|
191
|
+
### UseCase tests
|
|
192
|
+
- Mock port interfaces
|
|
193
|
+
- Happy path per method
|
|
194
|
+
- Validation errors
|
|
195
|
+
- Business rules
|
|
196
|
+
- Event dispatching
|
|
197
|
+
|
|
198
|
+
### Gate
|
|
199
|
+
- [ ] All domain tests pass
|
|
200
|
+
- [ ] Coverage on new code ≥ 80%
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Review Loop
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
LOOP:
|
|
208
|
+
1. /review:architect {stack} {domain}
|
|
209
|
+
2. IF violations severity ≥ MEDIUM:
|
|
210
|
+
fix all → build → tests → GOTO 1
|
|
211
|
+
3. IF score ≥ B → BREAK
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Final Report
|
|
217
|
+
|
|
218
|
+
```markdown
|
|
219
|
+
## Feature Complete: {domain}/{feature}
|
|
220
|
+
|
|
221
|
+
### Files
|
|
222
|
+
- Created: {N}, Modified: {N}
|
|
223
|
+
|
|
224
|
+
### Endpoints / Screens
|
|
225
|
+
| Method | Route | Description |
|
|
226
|
+
|--------|-------|-------------|
|
|
227
|
+
|
|
228
|
+
### Domain Events
|
|
229
|
+
| Event | Listeners |
|
|
230
|
+
|-------|-----------|
|
|
231
|
+
|
|
232
|
+
### Test coverage
|
|
233
|
+
- {N} test files, {M} cases — value objects + entities + usecases
|
|
234
|
+
|
|
235
|
+
### Review score: {A/B}
|
|
236
|
+
- Build / Lint / Domain purity / Tests: all PASS
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Hard Rules
|
|
242
|
+
|
|
243
|
+
- **Read reference module first** — your code should look like the rest of the codebase
|
|
244
|
+
- **User confirms the plan** before any code is written
|
|
245
|
+
- **Phase order is sequential** — don't skip ahead
|
|
246
|
+
- **Domain has zero framework imports** — enforce via grep in Phase 2 gate
|
|
247
|
+
- **Listeners handle side-effects** — never call notifications/SSE/analytics from usecase
|
|
248
|
+
- **Don't merge with score < B** — fix violations or document the waiver
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Related Skills
|
|
253
|
+
|
|
254
|
+
| When | Use |
|
|
255
|
+
|------|-----|
|
|
256
|
+
| Don't know approach yet | `/research:web` → then this skill |
|
|
257
|
+
| Want to validate by prototyping | `/research:spike` → then this skill |
|
|
258
|
+
| Adding only an endpoint | `/feature:api` |
|
|
259
|
+
| Restructuring existing module | `/feature:refactor` |
|
|
260
|
+
| Architecture check (called automatically in Phase 7) | `/review:architect` |
|
|
261
|
+
| Write tests inline (TDD style) | `/review:tdd` |
|
|
262
|
+
|
|
263
|
+
## Recommended Agents
|
|
264
|
+
|
|
265
|
+
| Phase | Agent | Purpose |
|
|
266
|
+
|-------|-------|---------|
|
|
267
|
+
| PLAN | `@clean-architect` | Architecture design |
|
|
268
|
+
| BUILD | Stack-specific dev agent | Implementation |
|
|
269
|
+
| BUILD | `@db-designer` | Schema if new tables needed |
|
|
270
|
+
| BUILD | `@api-designer` | API surface if exposed |
|
|
271
|
+
| TESTS | `@test-writer` | Domain tests |
|
|
272
|
+
| REVIEW | `@code-reviewer` | Code quality |
|
|
273
|
+
| REVIEW | `@security-audit` | Security check |
|