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,338 +0,0 @@
1
- ---
2
- name: 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
- Refactor existing code into DDD architecture, or improve existing DDD structure. Execute phases sequentially, run rule checks after each phase.
10
-
11
- **ARGUMENTS:** `<module> <domain>` — e.g., `marketing notification`, `users identity`, `products catalog`
12
-
13
- ## Read Architecture First
14
-
15
- **Before starting, MUST read TWO files:**
16
-
17
- 1. **Core DDD spec**: `.claude/architecture/ddd-architecture.md`
18
- 2. **Stack-specific doc**: detect stack → read the corresponding architecture doc
19
-
20
- ### Stack Detection
21
- | File | Stack Doc |
22
- |------|-----------|
23
- | `go.mod` | `go-backend.md` |
24
- | `package.json` + `vite.config.*` | `react-frontend.md` |
25
- | `pubspec.yaml` | `flutter-mobile.md` |
26
- | `composer.json` | `laravel-backend.md` |
27
- | `remix.config.*` | `remix-fullstack.md` |
28
-
29
- ### Architecture Files Location
30
- ```
31
- .claude/architecture/{name}.md # Project-specific (priority)
32
- ~/.claude/architecture/{name}.md # Global
33
- ```
34
-
35
- ---
36
-
37
- ## Workflow
38
-
39
- ```
40
- PHASE 0: Foundation Check
41
- → PHASE 1: Analyze Current Module
42
- → PHASE 2: Build Domain Layer
43
- → PHASE 3: Build Infrastructure Layer
44
- → PHASE 4: Build Application Layer
45
- → PHASE 5: Domain Tests
46
- → PHASE 6: Integration & Cleanup
47
- → REVIEW LOOP (run /architect-review, fix, repeat until clean)
48
- ```
49
-
50
- Each phase has a Rule Check. DO NOT skip any phase.
51
-
52
- ---
53
-
54
- ## PHASE 0: Foundation Check
55
-
56
- Verify DDD foundation exists in the project.
57
-
58
- ### For new DDD projects (no domain/ dir yet)
59
- Create shared foundation:
60
- - `domain/shared/` — base event types, event collector, event dispatcher interface
61
- - Event bus / dispatcher infrastructure
62
- - Bootstrap/app config struct
63
-
64
- ### For existing DDD projects
65
- Verify foundation is intact:
66
- ```bash
67
- # Check shared domain types exist
68
- ls {domain_root}/shared/ 2>/dev/null && echo "PASS" || echo "NEED SETUP"
69
-
70
- # Check event infrastructure exists (if applicable)
71
- ls {eventbus_path}/ 2>/dev/null && echo "PASS" || echo "NEED SETUP"
72
- ```
73
-
74
- If any FAIL → create foundation first before proceeding.
75
-
76
- ---
77
-
78
- ## PHASE 1: Analyze Current Module
79
-
80
- Read ALL source files before making any changes.
81
-
82
- ### Actions
83
- 1. Read all files in the current module/feature directory
84
- 2. Read related models/types
85
- 3. Read related enums/constants
86
- 4. Read current routes/screens/providers for this module
87
-
88
- ### Output (report to user)
89
- - All entities/models and their fields
90
- - All usecases (functions/methods) and their logic
91
- - All DTOs (request/response structs)
92
- - All validators (if any)
93
- - All cross-module calls
94
- - All events/side-effects (notifications, SSE, analytics)
95
- - All external dependencies (DB, cache, messaging, etc.)
96
- - All endpoints/screens/UI elements
97
-
98
- ### Rule Check Phase 1
99
- - [ ] All module files read and understood
100
- - [ ] All entities, usecases, dependencies, endpoints listed
101
- - [ ] Report presented to user and **CONFIRM received** before continuing
102
-
103
- ---
104
-
105
- ## PHASE 2: Create Domain Layer
106
-
107
- Create `domain/{domain}/` (if first module in this domain) or add to existing.
108
-
109
- ### 2.1 Value Objects (`valueobjects/`)
110
- - Extract typed values from existing code (status strings, rates, amounts)
111
- - Immutable with behavior methods
112
- - **Only stdlib imports** — check Forbidden Imports from architecture doc
113
-
114
- ### 2.2 Entities (`entities/`)
115
- - Convert existing model fields to domain entity
116
- - Add constructor function/method
117
- - Add behavior methods (state transitions, calculations)
118
- - Add event collection (collect events on state changes)
119
- - Add mappers to/from persistence models (if applicable)
120
- - **No framework imports**
121
-
122
- ### 2.3 Events (`events/`)
123
- - One file per domain event
124
- - Extend/embed base event type
125
- - Carry data needed by listeners
126
- - Extract from existing direct side-effect calls (SSE, notifications, etc.)
127
-
128
- ### 2.4 Ports (`ports/`)
129
- - One file per port interface
130
- - Store ports: persistence interface from existing repository/DB calls
131
- - Adapter ports: external service interfaces
132
- - Platform-agnostic naming
133
- - **No infrastructure imports**
134
-
135
- ### 2.5 UseCases (`usecases/`)
136
- - Extract business logic from existing controllers/handlers/services
137
- - Import port interfaces from `ports/`
138
- - Split by concern: one file per action group
139
- - Business logic lives HERE
140
- - **No infrastructure imports**
141
-
142
- ### Rule Check Phase 2
143
- Run check scripts from architecture doc:
144
- ```bash
145
- # Build domain layer
146
- {stack_build_command_for_domain}
147
-
148
- # Check domain purity
149
- {grep_forbidden_imports_in_domain} && echo "FAIL" || echo "PASS"
150
-
151
- # Check no cross-domain imports
152
- {check_cross_domain_imports}
153
- ```
154
-
155
- ---
156
-
157
- ## PHASE 3: Create Infrastructure Layer
158
-
159
- ### 3.1 Store/API Implementation
160
- - Implement interfaces from `domain/{domain}/ports/`
161
- - Use mapper functions (domain entity ↔ persistence model)
162
- - Compile-time interface check (where possible)
163
- - NO business logic — pure persistence
164
- - Keep existing persistence models where they are
165
-
166
- ### Rule Check Phase 3
167
- ```bash
168
- # Build infrastructure
169
- {stack_build_command_for_infra}
170
- ```
171
-
172
- ---
173
-
174
- ## PHASE 4: Create Application Layer
175
-
176
- ### 4.1 Listeners (extract from existing side-effects)
177
- - **CRITICAL:** Side-effects (notifications, SSE, analytics, async jobs) MUST NOT be called directly in usecases or infrastructure
178
- - They MUST flow through: entity collects events → usecase dispatches → listener handles
179
- - One file per event listener
180
- - Register in event bus/registry
181
-
182
- ### 4.2 Service
183
- - Thin wrapper delegating to domain usecases
184
- - NO business logic
185
-
186
- ### 4.3 Handler/Controller/Screen
187
- - Registration/wiring function
188
- - Thin: parse input → call service → return output
189
- - DTOs in separate file
190
- - All endpoints/routes must match the old ones (same path + method)
191
-
192
- ### Rule Check Phase 4
193
- ```bash
194
- # Build application layer
195
- {stack_build_command_for_application}
196
- ```
197
-
198
- ---
199
-
200
- ## PHASE 5: Domain Tests
201
-
202
- **CRITICAL:** MUST read old tests before writing new ones. Copy all test cases and business scenarios to domain tests. Do not lose any test coverage.
203
-
204
- ### 5.1 Process
205
- 1. Read ALL test files in old module
206
- 2. List all test cases and business scenarios
207
- 3. Write domain tests covering all those scenarios
208
- 4. Focus on business logic (pure unit tests, no integration needed yet)
209
-
210
- ### 5.2 Entity Tests
211
- - Behavior methods (state transitions, validations, calculations)
212
- - Edge cases (zero values, boundary conditions)
213
- - Business rules
214
- - NO mocking needed — pure tests
215
-
216
- ### 5.3 UseCase Tests
217
- - Mock port interfaces
218
- - All business flows (happy path + error cases)
219
- - Input validation
220
- - Domain event collection (if applicable)
221
-
222
- ### Rule Check Phase 5
223
- ```bash
224
- # Run domain tests
225
- {stack_test_command_for_domain}
226
- ```
227
-
228
- ---
229
-
230
- ## PHASE 6: Integration & Cleanup
231
-
232
- ### 6.1 Update Router/Provider/Registry
233
- - Add new registration calls
234
- - Remove old module routes/registrations
235
- - All endpoints/screens must match the old ones
236
-
237
- ### 6.2 Remove Old Module
238
- - Delete old module directory ONLY AFTER verifying build + test pass
239
- - DO NOT delete shared models/types that other modules still use
240
-
241
- ### Rule Check Phase 6
242
- ```bash
243
- # Full build
244
- {stack_full_build_command}
245
-
246
- # Verify old module removed
247
- test -d {old_module_path} && echo "FAIL: old module exists" || echo "PASS"
248
-
249
- # Verify no old imports remain
250
- grep -r "{old_module_import}" --include="*.{ext}" . && echo "FAIL: old imports" || echo "PASS"
251
- ```
252
-
253
- ---
254
-
255
- ## REVIEW LOOP
256
-
257
- After all phases complete, run the full architecture review. **Keep looping until ALL checks pass.**
258
-
259
- ```
260
- LOOP:
261
- 1. Run /architect-review {stack} {domain}
262
- 2. Collect violations
263
- 3. IF violations with severity >= MEDIUM:
264
- a. Fix all violations
265
- b. Run full build to verify
266
- c. Run all tests to verify
267
- d. GOTO 1
268
- 4. IF score >= B:
269
- BREAK → Final Report
270
- ```
271
-
272
- ---
273
-
274
- ## Final Report
275
-
276
- When review loop passes with score >= B:
277
-
278
- ```markdown
279
- ## Refactor Complete: {module} → {domain}
280
-
281
- ### Files Created
282
- - List all new files
283
-
284
- ### Files Modified
285
- - List all modified files
286
-
287
- ### Files Deleted
288
- - List old module files removed
289
-
290
- ### Endpoints/Screens Preserved
291
- | Before | After | Status |
292
- |--------|-------|--------|
293
- | All old routes | Same routes, new handlers | Verified |
294
-
295
- ### Domain Events
296
- | Event | Listeners |
297
- |-------|-----------|
298
-
299
- ### Test Coverage
300
- - X test files, Y test functions
301
- - All old test cases migrated: YES
302
- - Areas covered: value objects, entities, usecases
303
-
304
- ### Review Status: ALL CHECKS PASS
305
- - Build: PASS
306
- - Lint: PASS
307
- - Domain purity: PASS
308
- - Old module removed: PASS
309
- - No old imports: PASS
310
- - Tests: PASS (X/X)
311
- - Architecture score: {A/B}
312
- ```
313
-
314
- ---
315
-
316
- ## Interaction Rules
317
-
318
- 1. After each phase, report Rule Check results to user
319
- 2. If a rule fails → auto-fix if you know how, otherwise ask user
320
- 3. **DO NOT skip any phase** — all rules must pass before moving to next
321
- 4. If unsure about business logic → **READ the old code carefully, DO NOT invent new logic**
322
- 5. Preserve behavior — refactor structure only, DO NOT change logic
323
- 6. **MUST read old test files** before writing new tests
324
- 7. When multiple modules map to same domain → first module creates domain dir, subsequent add to it
325
- 8. After completing a module, ask user if they want to refactor the next module
326
-
327
- ---
328
-
329
- ## Recommended Agents
330
-
331
- | Phase | Agent | Purpose |
332
- |-------|-------|---------|
333
- | ANALYZE | `@refactor` | Identify refactoring opportunities |
334
- | ANALYZE | `@code-reviewer` | Code smell detection |
335
- | PLAN | `@clean-architect` | Architecture alignment |
336
- | REFACTOR | Stack-specific dev agent | Code per architecture |
337
- | TEST | `@test-writer` | Write domain tests |
338
- | REVIEW | `@code-reviewer` | Final quality check |
@@ -1,124 +0,0 @@
1
- ---
2
- name: research
3
- description: Research solutions on the internet for a given topic or the current conversation context. Use when user says "research", "tìm giải pháp", "search solution", "investigate", "find best practice", "so sánh giải pháp".
4
- args: "[TOPIC]"
5
- ---
6
-
7
- # Research Solutions
8
-
9
- Research solutions on the internet for a specific problem — either from an explicit topic argument or by analyzing the current conversation context.
10
-
11
- **ARGUMENTS:** (optional) Topic or question to research. If omitted, analyze the current conversation (recent messages, IDE selection, task at hand) to determine what to research.
12
-
13
- ---
14
-
15
- ## Step 1: Identify What to Research
16
-
17
- ### Mode 1: Argument provided
18
- - Use the argument directly as the research topic.
19
- - If the argument is too broad, narrow it down using project context (stack, architecture, current task) before searching.
20
-
21
- ### Mode 2: No argument
22
- - Analyze the current conversation: recent messages, IDE file selection, active task
23
- - Identify: what is the user doing, what problem they hit, what solution they need
24
- - **Summarize the problem back to the user and get confirmation** before burning search budget
25
-
26
- ---
27
-
28
- ## Step 2: Detect Project Context
29
-
30
- Before researching, detect the project's tech stack so results can be filtered for relevance:
31
-
32
- | File | Stack |
33
- |------|-------|
34
- | `go.mod` | Go (note version from `go` directive) |
35
- | `package.json` | Node.js — inspect dependencies to pick framework (NestJS / Vite+React / Remix / etc.) |
36
- | `pubspec.yaml` | Flutter / Dart |
37
- | `composer.json` | PHP / Laravel |
38
- | `Cargo.toml` | Rust |
39
- | `pyproject.toml` / `requirements.txt` | Python |
40
-
41
- Also check `.claude/architecture/` for the architecture doc in use — this shapes which patterns are idiomatic for the project.
42
-
43
- ---
44
-
45
- ## Step 3: Research on the Internet
46
-
47
- Use **WebSearch** and **WebFetch** to find solutions.
48
-
49
- ### Search strategy
50
- 1. **Broad first**: Overview, best practices, common approaches
51
- 2. **Deep dive**: Read official docs, GitHub issues, Stack Overflow, authoritative blog posts
52
- 3. **Compare alternatives**: If multiple solutions exist, list pros/cons of each
53
-
54
- ### Source priority
55
- 1. Official documentation
56
- 2. GitHub issues / release notes (for quirks and known-bug context)
57
- 3. Stack Overflow (accepted answers with high scores)
58
- 4. Authoritative blogs (Anthropic, framework authors, well-known engineers)
59
- 5. Recent articles > old articles — prefer results within the last 2 years unless the topic is evergreen
60
-
61
- ### Search tips
62
- - **Prefer English queries** — results are richer and more recent
63
- - Include library + version when the topic is version-sensitive (e.g., `nestjs 10 typeorm migrations`)
64
- - Cross-validate across at least 2–3 independent sources before concluding
65
- - When results conflict, prefer the most recent + most authoritative source and note the conflict
66
-
67
- ---
68
-
69
- ## Step 4: Synthesize Results
70
-
71
- Present the findings in this format:
72
-
73
- ```markdown
74
- ## Problem
75
- {Short summary of the problem being solved, with project context — stack, constraints, goal}
76
-
77
- ## Solutions Found
78
-
79
- ### Solution 1: {Name}
80
- - **Description:** {How it works}
81
- - **Pros:** {...}
82
- - **Cons:** {...}
83
- - **Fit for this project:** {High / Medium / Low — why}
84
- - **Source:** {link}
85
-
86
- ### Solution 2: {Name} (if applicable)
87
- - ...
88
-
89
- ## Recommendation
90
- {Which solution fits best for this project and why — reference architecture doc / stack conventions}
91
-
92
- ## Code Example (if applicable)
93
- {Minimal snippet showing the recommended approach, adapted to the project's stack and conventions}
94
-
95
- ## Caveats / Known Issues
96
- - {Gotcha 1}
97
- - {Gotcha 2}
98
-
99
- ## References
100
- - {link 1} — {what this source gave us}
101
- - {link 2} — {...}
102
- ```
103
-
104
- ---
105
-
106
- ## Rules
107
-
108
- - **Research and propose — do NOT implement.** Wait for user confirmation before touching code.
109
- - **Consider project context:** tech stack, architecture, conventions. A solution that is idiomatic in one project can be wrong in another.
110
- - **Narrow scope when too broad:** if the topic is too wide (e.g., "how to do auth"), ask the user to narrow it (e.g., "JWT refresh flow with NestJS + TypeORM").
111
- - **Flag stale answers:** if the top answers are old (3+ years) and the library has had major versions since, mention it and check release notes.
112
- - **No hallucinated APIs:** if you're uncertain whether a method/option exists, verify in official docs before recommending.
113
- - **Cite sources:** every non-trivial claim should have a link.
114
-
115
- ---
116
-
117
- ## When to Use Other Skills Instead
118
-
119
- | Situation | Use instead |
120
- |-----------|-------------|
121
- | You're debugging a known bug (not researching options) | `deep-debug` |
122
- | You want to prototype a chosen approach | `spike` |
123
- | You already know the approach and want to implement it | `new-feature` / `hotfix` |
124
- | You want to write up the research as a design doc | `documentation` |