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.
Files changed (53) hide show
  1. package/README.md +76 -27
  2. package/assets/architecture/_shared/severity-levels.md +34 -0
  3. package/assets/architecture/_shared/stack-detection.md +34 -0
  4. package/assets/commands/marketing.md +7 -7
  5. package/assets/skills/docs/sync/SKILL.md +245 -0
  6. package/assets/skills/docs/write/SKILL.md +274 -0
  7. package/assets/skills/feature/api/SKILL.md +277 -0
  8. package/assets/skills/feature/deprecate/SKILL.md +276 -0
  9. package/assets/skills/feature/new/SKILL.md +273 -0
  10. package/assets/skills/feature/refactor/SKILL.md +269 -0
  11. package/assets/skills/fix/hotfix/SKILL.md +233 -0
  12. package/assets/skills/fix/incident/SKILL.md +360 -0
  13. package/assets/skills/fix/pr-comment/SKILL.md +186 -0
  14. package/assets/skills/fix/root-cause/SKILL.md +276 -0
  15. package/assets/skills/marketing/content/SKILL.md +269 -0
  16. package/assets/skills/marketing/logo/SKILL.md +252 -0
  17. package/assets/skills/marketing/seo-blog/SKILL.md +367 -0
  18. package/assets/skills/marketing/video/SKILL.md +258 -0
  19. package/assets/skills/research/onboarding/SKILL.md +225 -0
  20. package/assets/skills/research/spike/SKILL.md +228 -0
  21. package/assets/skills/research/web/SKILL.md +204 -0
  22. package/assets/skills/review/architect/SKILL.md +274 -0
  23. package/assets/skills/review/branch/SKILL.md +277 -0
  24. package/assets/skills/review/pr/SKILL.md +231 -0
  25. package/assets/skills/review/tdd/SKILL.md +245 -0
  26. package/dist/commands/list.d.ts.map +1 -1
  27. package/dist/commands/list.js +2 -2
  28. package/dist/commands/list.js.map +1 -1
  29. package/dist/utils/symlink.d.ts +7 -0
  30. package/dist/utils/symlink.d.ts.map +1 -1
  31. package/dist/utils/symlink.js +82 -0
  32. package/dist/utils/symlink.js.map +1 -1
  33. package/package.json +1 -1
  34. package/assets/skills/api-integration/SKILL.md +0 -883
  35. package/assets/skills/architect-review/SKILL.md +0 -393
  36. package/assets/skills/content-writer/SKILL.md +0 -721
  37. package/assets/skills/deep-debug/SKILL.md +0 -114
  38. package/assets/skills/deprecation/SKILL.md +0 -923
  39. package/assets/skills/documentation/SKILL.md +0 -1333
  40. package/assets/skills/fix-pr-comment/SKILL.md +0 -283
  41. package/assets/skills/hotfix/SKILL.md +0 -397
  42. package/assets/skills/incident-response/SKILL.md +0 -946
  43. package/assets/skills/logo-design/SKILL.md +0 -477
  44. package/assets/skills/new-feature/SKILL.md +0 -297
  45. package/assets/skills/onboarding/SKILL.md +0 -607
  46. package/assets/skills/pr-review/SKILL.md +0 -620
  47. package/assets/skills/refactor/SKILL.md +0 -338
  48. package/assets/skills/research/SKILL.md +0 -124
  49. package/assets/skills/review-changes/SKILL.md +0 -312
  50. package/assets/skills/spike/SKILL.md +0 -535
  51. package/assets/skills/sync-docs/SKILL.md +0 -575
  52. package/assets/skills/tdd/SKILL.md +0 -828
  53. package/assets/skills/video-content/SKILL.md +0 -651
@@ -1,393 +0,0 @@
1
- ---
2
- name: architect-review
3
- description: DDD architecture compliance review with automated checks and review loop. Use when user says "architect-review", "architecture review", "review architecture", "check architecture", "review ddd", "ddd review".
4
- args: "[ARCHITECTURE_NAME] [DOMAIN]"
5
- ---
6
-
7
- # DDD Architecture Review
8
-
9
- Review codebase against DDD architecture guidelines with automated checks and a review loop that keeps fixing until all checks pass.
10
-
11
- ## Usage
12
-
13
- ```bash
14
- /architect-review go-backend wallet
15
- /architect-review react-frontend
16
- /architect-review
17
- ```
18
-
19
- ## Supported Architectures
20
-
21
- Check for architecture files in these locations (in order):
22
- 1. **Project-specific**: `.claude/architecture/`
23
- 2. **Global**: `~/.claude/architecture/`
24
-
25
- ### Built-in Architectures
26
-
27
- | Name | File | Aliases |
28
- |------|------|---------|
29
- | `ddd-architecture` | `ddd-architecture.md` | `ddd`, `core` |
30
- | `go-backend` | `go-backend.md` | `go` |
31
- | `react-frontend` | `react-frontend.md` | `react` |
32
- | `flutter-mobile` | `flutter-mobile.md` | `flutter` |
33
- | `laravel-backend` | `laravel-backend.md` | `laravel` |
34
- | `remix-fullstack` | `remix-fullstack.md` | `remix` |
35
- | `monorepo` | `monorepo.md` | `mono` |
36
-
37
- ---
38
-
39
- ## Phase 0: RESOLVE ARCHITECTURE
40
-
41
- ### If argument provided
42
- 1. Normalize name using alias table
43
- 2. Search: `.claude/architecture/{name}.md` → `~/.claude/architecture/{name}.md`
44
- 3. Found → Phase 1
45
- 4. Not found → REJECT with available architectures list. **STOP.**
46
-
47
- ### If NO argument
48
- 1. Auto-detect stack from project files:
49
- - `go.mod` → `go-backend`
50
- - `package.json` + `vite.config` → `react-frontend`
51
- - `pubspec.yaml` → `flutter-mobile`
52
- - `composer.json` → `laravel-backend`
53
- - `remix.config` → `remix-fullstack`
54
- 2. If detected → confirm with user
55
- 3. If not detected → list available, ask user to select
56
-
57
- ### Gate
58
- - [ ] Architecture file loaded
59
- - [ ] Domain name identified (if provided)
60
-
61
- ---
62
-
63
- ## Phase 1: LOAD GUIDELINE & EXTRACT RULES
64
-
65
- Read the architecture file completely. Also read `ddd-architecture.md` (core DDD spec) as the base reference.
66
-
67
- ### Extract from architecture doc:
68
-
69
- 1. **DDD Directory Structure** — expected folder layout
70
- 2. **Layer Rules** — import/dependency rules per layer
71
- 3. **Hard Rules** — forbidden imports, naming conventions
72
- 4. **Forbidden Imports** — specific packages/modules NOT allowed in domain
73
- 5. **Check Scripts** — automated bash commands for validation
74
- 6. **Wiring Pattern** — how modules are registered
75
- 7. **Test Patterns** — how each layer should be tested
76
-
77
- ### Gate
78
- - [ ] Core DDD rules loaded
79
- - [ ] Stack-specific rules loaded
80
- - [ ] Check scripts extracted
81
- - [ ] Review checklist prepared
82
-
83
- ---
84
-
85
- ## Phase 2: AUTOMATED CHECKS
86
-
87
- Run the check scripts from the architecture doc. These vary per stack but follow this pattern:
88
-
89
- ### Standard Checks (all stacks)
90
-
91
- ```bash
92
- echo "=== R1: Build ==="
93
- {stack_build_command} && echo "PASS" || echo "FAIL"
94
-
95
- echo "=== R2: Lint/Vet ==="
96
- {stack_lint_command} && echo "PASS" || echo "FAIL"
97
-
98
- echo "=== R3: Domain Purity (no framework imports) ==="
99
- {grep_forbidden_imports_in_domain} && echo "FAIL" || echo "PASS"
100
-
101
- echo "=== R4: No Cross-Domain Imports ==="
102
- {check_domain_A_not_importing_domain_B} && echo "FAIL" || echo "PASS"
103
-
104
- echo "=== R5: No Circular Imports ==="
105
- {build_and_check_cycles} && echo "FAIL" || echo "PASS"
106
-
107
- echo "=== R6: Tests Exist ==="
108
- {find_test_files_in_domain} | wc -l
109
-
110
- echo "=== R7: Tests Pass ==="
111
- {stack_test_command} && echo "PASS" || echo "FAIL"
112
-
113
- echo "=== R8: Wiring Registered ==="
114
- {check_routes_or_providers_registered}
115
-
116
- echo "=== R9: Event Names Match Registry ==="
117
- {check_event_names_consistency}
118
-
119
- echo "=== R10: Async Context Safety ==="
120
- {check_no_request_context_in_goroutines}
121
- ```
122
-
123
- ### Stack-Specific Check Scripts
124
-
125
- Read the **Check Scripts** section from the loaded architecture doc and run those exact commands.
126
-
127
- ### Output
128
- Record PASS/FAIL for each check. Continue to Phase 3 regardless — manual review catches what automated checks miss.
129
-
130
- ### Gate
131
- - [ ] All automated checks executed
132
- - [ ] Results recorded
133
-
134
- ---
135
-
136
- ## Phase 3: ARCHITECTURE REVIEW (Manual)
137
-
138
- Read files and check DDD compliance. Focus on **architecture structure**, NOT business logic correctness.
139
-
140
- ### 3.1 Directory Structure
141
-
142
- | # | Check | What to look for |
143
- |---|-------|-----------------|
144
- | D1 | Domain dir exists | `domain/{domain}/` with proper subdirs |
145
- | D2 | Required subdirs | `entities/`, `ports/`, `usecases/` at minimum |
146
- | D3 | Value objects separate | `valueobjects/` dir, NOT mixed in `entities/` |
147
- | D4 | Events separate | `events/` dir with 1 file per event |
148
- | D5 | Application layer | `application/ports/{transport}/`, `services/`, `listeners/` |
149
- | D6 | Infrastructure layer | Implements port interfaces |
150
- | D7 | No legacy dirs | No `modules/`, `pkg/` (for Go), or flat structure |
151
-
152
- ### 3.2 Entities
153
-
154
- | # | Check | What to look for |
155
- |---|-------|-----------------|
156
- | E1 | Has constructor | Factory function/method: `New{Entity}()`, `create()`, etc. |
157
- | E2 | Has behavior methods | State transitions, calculations, guard checks — NOT anemic |
158
- | E3 | Raises domain events | Collects/emits events on state changes |
159
- | E4 | No framework imports | Only stdlib + domain/shared + valueobjects |
160
- | E5 | Has mappers (if applicable) | ToModel/FromModel or equivalent for persistence mapping |
161
-
162
- ### 3.3 Value Objects
163
-
164
- | # | Check | What to look for |
165
- |---|-------|-----------------|
166
- | VO1 | Separate directory | In `valueobjects/`, NOT in `entities/` |
167
- | VO2 | Only stdlib imports | No external packages, no domain/shared |
168
- | VO3 | Immutable with behavior | Typed values with query methods (IsPending, CanTransitionTo) |
169
- | VO4 | Used by entities/ports | Entities and ports reference VO types, not raw strings |
170
-
171
- ### 3.4 Ports
172
-
173
- | # | Check | What to look for |
174
- |---|-------|-----------------|
175
- | P1 | `ports/` folder exists | MUST have `ports/` — inline interfaces in usecases is a violation |
176
- | P2 | One file per port | `{store_name}.go/.ts/.dart/.php` — not all in one file |
177
- | P3 | Interface + related DTOs | Each file has interface + its param/result types |
178
- | P4 | Domain types in signatures | Return entities/VOs, not primitives for typed values |
179
- | P5 | Platform-agnostic naming | `URLParser`, NOT `ShopeeURLParser` |
180
- | P6 | No infrastructure imports | Only stdlib + entities + valueobjects + shared |
181
-
182
- ### 3.5 Events
183
-
184
- | # | Check | What to look for |
185
- |---|-------|-----------------|
186
- | EV1 | One file per event | `{event_name}` naming, not multiple events in one file |
187
- | EV2 | Extends base event | Embeds/extends shared BaseEvent |
188
- | EV3 | Carries data for listeners | UserID, amounts, names — enough for side-effects |
189
- | EV4 | Name matches registry | Event name string matches event bus registration |
190
-
191
- ### 3.6 UseCases
192
-
193
- | # | Check | What to look for |
194
- |---|-------|-----------------|
195
- | U1 | Uses port interfaces | From `ports/` package, NOT inline interface definitions |
196
- | U2 | Split by concern | One file per action group, max ~200 lines per file |
197
- | U3 | Business logic lives here | Not in controller, not in store, not in service |
198
- | U4 | No infrastructure imports | No ORM, no HTTP framework, no cache client |
199
- | U5 | Dispatches domain events | After successful persistence, dispatches collected events |
200
- | U6 | No `deps.go` or similar | Interfaces MUST be in `ports/`, not inline |
201
-
202
- ### 3.7 Services
203
-
204
- | # | Check | What to look for |
205
- |---|-------|-----------------|
206
- | SVC1 | Thin wrapper | Delegates to usecases, no business logic |
207
- | SVC2 | No infrastructure imports | No ORM, no HTTP framework |
208
-
209
- ### 3.8 Handlers/Controllers
210
-
211
- | # | Check | What to look for |
212
- |---|-------|-----------------|
213
- | H1 | Registration function | `Register{Module}Routes` or equivalent wiring |
214
- | H2 | Thin handlers | Parse input -> call service -> return output |
215
- | H3 | No business logic | Logic is in usecases, not here |
216
- | H4 | DTOs separate | Request/Response types in separate file |
217
-
218
- ### 3.9 Listeners
219
-
220
- | # | Check | What to look for |
221
- |---|-------|-----------------|
222
- | L1 | One per event | `on_{event_name}` naming |
223
- | L2 | Side-effects only | Notifications, SSE, analytics — no business logic |
224
- | L3 | Registered in event bus | Listed in registry/event bus setup |
225
- | L4 | Background context | Async work uses background context, not request context |
226
-
227
- ### 3.10 Infrastructure/Store
228
-
229
- | # | Check | What to look for |
230
- |---|-------|-----------------|
231
- | I1 | Implements port interface | All methods from the port interface |
232
- | I2 | Has mappers | Converts between domain entities and persistence models |
233
- | I3 | No business logic | Pure persistence — queries, saves, deletes |
234
- | I4 | Compile-time check | Interface compliance verified at compile time (where possible) |
235
-
236
- ### Gate
237
- - [ ] All 10 areas reviewed
238
- - [ ] Findings categorized by severity
239
-
240
- ---
241
-
242
- ## Phase 4: REPORT
243
-
244
- ### Severity Levels
245
-
246
- | Level | Meaning | Examples |
247
- |-------|---------|---------|
248
- | **CRITICAL** | Architecture broken | Build fails, circular imports, domain imports framework |
249
- | **HIGH** | DDD violation | Cross-domain import, business logic in wrong layer, no ports dir, inline interfaces |
250
- | **MEDIUM** | Structure issue | Anemic entity, fat controller, missing events, missing tests, missing json tags |
251
- | **LOW** | Convention issue | File naming, redundant code, DTOs in wrong package |
252
-
253
- **ALL levels must be fixed.**
254
-
255
- ### Report Template
256
-
257
- ```markdown
258
- ## Architecture Review: {architecture} / {domain}
259
-
260
- ### Automated Checks
261
- | # | Check | Status |
262
- |---|-------|--------|
263
- | R1 | Build | PASS/FAIL |
264
- | R2 | Lint/Vet | PASS/FAIL |
265
- | R3 | Domain purity | PASS/FAIL |
266
- | R4 | No cross-domain imports | PASS/FAIL |
267
- | R5 | No circular imports | PASS/FAIL |
268
- | R6 | Tests exist | PASS/WARN |
269
- | R7 | Tests pass | PASS/FAIL |
270
- | R8 | Wiring registered | PASS/FAIL |
271
- | R9 | Event names consistent | PASS/N/A |
272
- | R10 | Async context safety | PASS/N/A |
273
-
274
- ### Architecture Review
275
- | Area | Status | Violations |
276
- |------|--------|------------|
277
- | Directory Structure (D1-D7) | OK/ISSUE | ... |
278
- | Entities (E1-E5) | OK/ISSUE | ... |
279
- | Value Objects (VO1-VO4) | OK/ISSUE | ... |
280
- | Ports (P1-P6) | OK/ISSUE | ... |
281
- | Events (EV1-EV4) | OK/N/A | ... |
282
- | UseCases (U1-U6) | OK/ISSUE | ... |
283
- | Services (SVC1-SVC2) | OK/ISSUE | ... |
284
- | Handlers (H1-H4) | OK/ISSUE | ... |
285
- | Listeners (L1-L4) | OK/N/A | ... |
286
- | Infrastructure (I1-I4) | OK/ISSUE | ... |
287
-
288
- ### Violations Found
289
- 1. [SEVERITY] Code — file:line — description
290
- 2. ...
291
-
292
- ### Recommended Fixes
293
- 1. Fix description
294
- 2. ...
295
-
296
- ### Overall Score: {A/B/C/D/F}
297
- ```
298
-
299
- ### Scoring
300
-
301
- | Score | Criteria |
302
- |-------|----------|
303
- | **A** | 0 violations, all automated checks PASS |
304
- | **B** | 0 CRITICAL/HIGH, max 3 MEDIUM |
305
- | **C** | 0 CRITICAL, max 2 HIGH |
306
- | **D** | Has CRITICAL or 3+ HIGH |
307
- | **F** | Multiple CRITICAL, architecture fundamentally broken |
308
-
309
- ### Gate
310
- - [ ] Report generated
311
- - [ ] Score calculated
312
- - [ ] All violations listed with file:line
313
-
314
- ---
315
-
316
- ## Phase 5: REVIEW LOOP (if user confirms fix)
317
-
318
- **Keep looping until ALL checks pass and score is A or B.**
319
-
320
- ```
321
- LOOP:
322
- 1. Fix all violations found in report
323
- 2. Run automated checks (Phase 2)
324
- 3. Run architecture review (Phase 3)
325
- 4. Collect violations
326
- 5. IF violations with severity >= MEDIUM:
327
- a. Fix violations
328
- b. GOTO 1
329
- 6. IF only LOW violations or none:
330
- BREAK → Report final status
331
- ```
332
-
333
- ### After Each Fix Iteration
334
- ```bash
335
- # Verify build still works
336
- {stack_build_command}
337
-
338
- # Verify tests still pass
339
- {stack_test_command}
340
-
341
- # Re-check domain purity
342
- {grep_forbidden_imports_in_domain}
343
- ```
344
-
345
- ---
346
-
347
- ## Calling from Other Skills
348
-
349
- This skill is designed to be called by `new-feature` and `refactor` skills at the end of their workflows:
350
-
351
- ```
352
- # From new-feature skill, after Phase 5 (registration):
353
- → Run /architect-review {detected_stack} {domain}
354
- → Review loop until score >= B
355
-
356
- # From refactor skill, after Phase 4 (cleanup):
357
- → Run /architect-review {detected_stack} {domain}
358
- → Review loop until score >= B
359
- ```
360
-
361
- When called from another skill:
362
- - Skip Phase 0 (architecture already known)
363
- - Skip user confirmation for fixes (auto-fix in loop)
364
- - Report final score back to calling skill
365
-
366
- ---
367
-
368
- ## Quick Reference
369
-
370
- ### Architecture Files Location
371
- ```
372
- .claude/architecture/{name}.md # Project-specific (priority)
373
- ~/.claude/architecture/{name}.md # Global
374
- ```
375
-
376
- ### Aliases
377
- ```
378
- ddd → ddd-architecture
379
- go → go-backend
380
- react → react-frontend
381
- flutter → flutter-mobile
382
- laravel → laravel-backend
383
- remix → remix-fullstack
384
- mono → monorepo
385
- ```
386
-
387
- ### Review Areas (10)
388
- ```
389
- D: Directory Structure E: Entities VO: Value Objects
390
- P: Ports EV: Events U: UseCases
391
- SVC: Services H: Handlers L: Listeners
392
- I: Infrastructure
393
- ```