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,312 +0,0 @@
1
- ---
2
- name: review-changes
3
- description: Review local branch changes for architecture compliance, conventions, and code quality before pushing/PR. Stack-aware — detects the project stack and applies the matching rules. Use when user says "review changes", "review branch", "check branch", "check changes", "review my code", "review before pr".
4
- args: "[BASE_BRANCH]"
5
- ---
6
-
7
- # Review Local Branch Changes
8
-
9
- Review all code changes on the current branch (vs a base branch) for **architecture compliance**, **stack conventions**, and **code quality**. Focus on changed files only — not the entire codebase. This is the pre-PR companion to `pr-review` (which reviews remote PRs).
10
-
11
- **ARGUMENTS:** (optional) base branch to compare against. Default: `main` (or `master` if `main` does not exist).
12
-
13
- ---
14
-
15
- ## Phase 0: Detect Stack & Load Architecture
16
-
17
- Before reviewing, detect the project stack and load the matching architecture doc.
18
-
19
- ### Stack Detection
20
- | File | Stack | Architecture Doc |
21
- |------|-------|------------------|
22
- | `go.mod` | Go | `go-backend.md` |
23
- | `package.json` + `@nestjs/core` | NestJS | `nodejs-nestjs.md` |
24
- | `package.json` + `vite.config.*` | React | `react-frontend.md` |
25
- | `package.json` + `remix.config.*` | Remix | `remix-fullstack.md` |
26
- | `pubspec.yaml` | Flutter | `flutter-mobile.md` |
27
- | `composer.json` | Laravel | `laravel-backend.md` |
28
-
29
- ### Architecture Files Location (in priority order)
30
- ```
31
- .claude/architecture/{name}.md # Project-specific
32
- ~/.claude/architecture/{name}.md # Global
33
- ```
34
-
35
- Also read `ddd-architecture.md` / `clean-architecture.md` as the cross-stack baseline.
36
-
37
- ### Gate
38
- - [ ] Stack detected (ask user if ambiguous — e.g., multi-stack monorepo)
39
- - [ ] Architecture doc loaded
40
- - [ ] Forbidden imports list extracted
41
-
42
- ---
43
-
44
- ## Phase 1: Collect Changes
45
-
46
- ```bash
47
- # Resolve base branch
48
- BASE=${1:-main}
49
- git rev-parse --verify "$BASE" >/dev/null 2>&1 || BASE=master
50
-
51
- echo "=== Base: $BASE ==="
52
-
53
- echo "=== Changed files ==="
54
- git diff "$BASE"...HEAD --name-only --diff-filter=ACMR
55
-
56
- echo "=== Diff stat ==="
57
- git diff "$BASE"...HEAD --stat
58
-
59
- echo "=== Commits ==="
60
- git log "$BASE"..HEAD --oneline
61
- ```
62
-
63
- Categorize changed files by layer (map per architecture doc):
64
-
65
- | DDD Layer | Typical Paths |
66
- |-----------|---------------|
67
- | Domain | `domain/`, `internal/domain/`, `src/domain/`, `lib/domain/` |
68
- | Application | `application/`, `internal/application/`, `src/application/` |
69
- | Infrastructure | `infrastructure/`, `internal/infrastructure/`, `src/infrastructure/` |
70
- | Presentation / UI | `controllers/`, `pages/`, `components/`, `views/`, `ports/http/` |
71
- | Persistence models | `models/`, `entities/` (ORM), `prisma/`, `migrations/` |
72
- | Config / Bootstrap | `config/`, `bootstrap/`, `cmd/`, `main.*` |
73
-
74
- Read ALL changed files before reviewing — never skim.
75
-
76
- ---
77
-
78
- ## Phase 2: Build & Lint
79
-
80
- Run the stack's build + lint commands from the architecture doc:
81
-
82
- ```bash
83
- # Go
84
- go build ./... && go vet ./...
85
-
86
- # NestJS / TypeScript
87
- pnpm typecheck || npx tsc --noEmit
88
- pnpm lint || npx eslint "{src,test}/**/*.ts"
89
-
90
- # Laravel
91
- composer dump-autoload && ./vendor/bin/phpstan analyse
92
-
93
- # Flutter
94
- dart analyze
95
-
96
- # React / Remix
97
- pnpm typecheck && pnpm lint
98
- ```
99
-
100
- If build/typecheck/lint fails → report immediately as **CRITICAL**. Stop further review until these pass.
101
-
102
- ---
103
-
104
- ## Phase 3: Architecture Checks (on changed files only)
105
-
106
- Apply the rules from the stack's architecture doc ONLY to changed files. Do not re-review unchanged code.
107
-
108
- ### 3.1 Domain Layer (if changed)
109
-
110
- | # | Rule | Check |
111
- |---|------|-------|
112
- | D1 | Domain purity | No forbidden imports (ORM, HTTP framework, cache client, queue, auth SDK) |
113
- | D2 | No cross-domain imports | Domain A must NOT import Domain B (only shared kernel allowed) |
114
- | D3 | No persistence-model imports | Domain must NOT import ORM entity classes / persistence models |
115
- | D4 | Entity behavior | Not just data bag — has methods with state transitions |
116
- | D5 | Entity raises events | Raises/collects events on state change (if architecture uses events) |
117
- | D6 | Ports in ports/ folder | Interfaces MUST be in `ports/`, NOT inline in use-cases |
118
- | D7 | One port per file | Each interface in a separate file |
119
- | D8 | Ports use domain types | Return domain entities/value objects, not raw primitives |
120
- | D9 | Value objects stdlib only | VOs import only stdlib — no domain/shared, no framework |
121
- | D10 | Use-case no infra imports | Only entities + ports + events + value-objects |
122
-
123
- ```bash
124
- # Generic domain-purity check (adapt FORBIDDEN for stack)
125
- CHANGED_DOMAIN=$(git diff "$BASE"...HEAD --name-only --diff-filter=ACMR \
126
- | grep -E '^(src|internal|lib)/domain/' || true)
127
-
128
- if [ -n "$CHANGED_DOMAIN" ]; then
129
- # Example forbidden-imports regex — replace per stack from architecture doc
130
- # Go: '"gorm.io|"github.com/gin|"github.com/redis|"firebase.google.com|"github.com/hibiken'
131
- # Nest: '"@nestjs/|"typeorm"|"@nestjs/typeorm|"ioredis|"bullmq|"passport'
132
- # Lara: 'Illuminate\\Database|Illuminate\\Http'
133
- FORBIDDEN='<PUT STACK FORBIDDEN REGEX HERE>'
134
- echo "=== D1: Domain purity ==="
135
- echo "$CHANGED_DOMAIN" | xargs grep -lEn "$FORBIDDEN" 2>/dev/null \
136
- && echo "FAIL" || echo "PASS"
137
- fi
138
- ```
139
-
140
- ### 3.2 Application Layer (if changed)
141
-
142
- | # | Rule | Check |
143
- |---|------|-------|
144
- | A1 | Handler is thin | No business logic — parse input → call service/use-case → return output |
145
- | A2 | Service justified | Only when real orchestration exists (multiple use-cases, cross-cutting). Single-use-case forwarders are a smell — inject the use-case directly |
146
- | A3 | Listener is side-effect only | No business logic — notifications, SSE, queue jobs, analytics only |
147
- | A4 | Listener registered | Event registered in the registry / `event.emitter` module |
148
- | A5 | Event names match | Event name string matches registry registration |
149
- | A6 | DTOs validated at boundary | All controller inputs validated via schema/validator at entry |
150
- | A7 | Composition root | Handlers/controllers must NOT build dependencies inline — all wiring lives in the composition root (bootstrap/module) |
151
-
152
- ### 3.3 Infrastructure Layer (if changed)
153
-
154
- | # | Rule | Check |
155
- |---|------|-------|
156
- | I1 | Repository has no business logic | Pure persistence — queries, saves, deletes |
157
- | I2 | Mappers exist | Explicit mapping between domain entity and ORM/persistence model |
158
- | I3 | Implements port interface | Returns domain types per port contract |
159
- | I4 | Context/transaction propagation | Uses project's context/transaction pattern consistently |
160
-
161
- ### 3.4 Persistence Models (if changed)
162
-
163
- | # | Rule | Check |
164
- |---|------|-------|
165
- | M1 | ORM models outside domain | Persistence models live in infrastructure, NOT in domain |
166
- | M2 | Migrations added for schema changes | Any schema change has a matching migration file |
167
- | M3 | JSON / nullable columns correctly typed | Pointer/nullable types used where the column allows NULL |
168
-
169
- ---
170
-
171
- ## Phase 4: Stack-Specific Conventions
172
-
173
- Read the **Conventions** / **Hard Rules** section from the architecture doc and check changed files against them. Common cross-stack checks:
174
-
175
- | # | Rule | Check |
176
- |---|------|-------|
177
- | G1 | No swallowed errors | No empty `catch`/`if err != nil {}` that discards errors — must handle or rethrow |
178
- | G2 | Goroutine/async context | Fire-and-forget async work uses background context, NOT request context |
179
- | G3 | API-facing entities have serialization tags | `json:"..."` (Go), class-transformer/serializer decorators, `JsonSerializable`, etc. |
180
- | G4 | No secrets in code | No hardcoded tokens, keys, passwords |
181
- | G5 | Parameterized queries | No raw string-interpolated SQL |
182
- | G6 | Input validation at boundary | All external input validated before touching domain |
183
-
184
- ---
185
-
186
- ## Phase 5: Code Quality (Manual)
187
-
188
- Read the diff carefully. Look for:
189
-
190
- | # | Area | What to look for |
191
- |---|------|-----------------|
192
- | Q1 | Logic correctness | Off-by-one, nil/null deref, wrong condition, missing edge case |
193
- | Q2 | Error handling | Errors returned/wrapped, not silently ignored |
194
- | Q3 | Concurrency safety | Race conditions, shared mutable state, goroutine/async leaks |
195
- | Q4 | Resource leaks | Unclosed connections, HTTP bodies, file handles, subscriptions |
196
- | Q5 | Naming clarity | Variables/functions clearly describe intent |
197
- | Q6 | Dead code | Unreachable code, unused variables, commented-out blocks |
198
- | Q7 | Duplication | Significant copy-paste across changed files |
199
- | Q8 | Breaking changes | API contract changes, removed fields, changed behavior |
200
- | Q9 | Over-engineering | Abstractions not justified by the change — fewer layers is usually better |
201
- | Q10 | Test coverage | New logic has tests; bug fixes have regression tests |
202
-
203
- ---
204
-
205
- ## Phase 6: Tests
206
-
207
- ```bash
208
- # Run tests for changed domains / features only
209
- CHANGED_DOMAINS=$(git diff "$BASE"...HEAD --name-only --diff-filter=ACMR \
210
- | grep -E '/(domain|modules|features)/' \
211
- | sed -E 's|.*(domain\|modules\|features)/([^/]+)/.*|\2|' \
212
- | sort -u)
213
-
214
- for d in $CHANGED_DOMAINS; do
215
- echo "--- Testing $d ---"
216
- # Go: go test ./internal/domain/$d/... -v
217
- # Nest: npx jest src/domain/$d
218
- # Lara: ./vendor/bin/phpunit --filter $d
219
- # Flutter: flutter test test/domain/$d
220
- done
221
-
222
- echo "=== Full test suite ==="
223
- # Stack's full test command
224
- ```
225
-
226
- ---
227
-
228
- ## Phase 7: Report
229
-
230
- ```markdown
231
- ## Code Review: {branch} → {base}
232
-
233
- ### Summary
234
- - **Stack:** {stack}
235
- - **Architecture doc:** {path}
236
- - **Commits:** {count}
237
- - **Files changed:** {count} ({additions}+ / {deletions}-)
238
- - **Areas affected:** {domain list / feature list}
239
-
240
- ### Build, Lint, Types
241
- | Check | Status |
242
- |-------|--------|
243
- | Build | PASS/FAIL |
244
- | Lint | PASS/FAIL |
245
- | Types | PASS/FAIL |
246
-
247
- ### Architecture Checks
248
- | # | Rule | Status | Details |
249
- |---|------|--------|---------|
250
- | D1 | Domain purity | PASS/FAIL | {file:line} |
251
- | ... | ... | ... | ... |
252
-
253
- ### Conventions
254
- | # | Rule | Status | Details |
255
- |---|------|--------|---------|
256
- | G1 | No swallowed errors | PASS/WARN | {file:line} |
257
-
258
- ### Code Quality
259
- | # | Area | Status | Details |
260
- |---|------|--------|---------|
261
- | Q1 | Logic correctness | OK/ISSUE | ... |
262
-
263
- ### Tests
264
- | Check | Status |
265
- |-------|--------|
266
- | Changed area tests | PASS/FAIL |
267
- | Full test suite | PASS/FAIL |
268
-
269
- ### Issues Found
270
- | # | Severity | File:Line | Description | Suggested Fix |
271
- |---|----------|-----------|-------------|---------------|
272
- | 1 | CRITICAL/HIGH/MEDIUM/LOW | path:123 | ... | ... |
273
-
274
- ### Verdict
275
- {APPROVED / CHANGES REQUESTED}
276
- ```
277
-
278
- ---
279
-
280
- ## Severity Levels
281
-
282
- | Level | Meaning | Examples |
283
- |-------|---------|---------|
284
- | CRITICAL | Build fails, crash, data loss, security hole | Build error, nil deref, SQL injection, circular import, leaked secret |
285
- | HIGH | Architecture violation, silent bug | Domain imports ORM, cross-domain import, swallowed error, race condition |
286
- | MEDIUM | Convention violation, code smell | Missing serialization tags, business logic in handler, no tests for new logic |
287
- | LOW | Style, naming, minor improvement | File naming, redundant code, unclear name |
288
-
289
- **CRITICAL + HIGH = CHANGES REQUESTED** (must fix before PR)
290
- **MEDIUM only = CHANGES REQUESTED** (should fix)
291
- **LOW only = APPROVED with suggestions**
292
-
293
- ---
294
-
295
- ## Phase 8: Fix (if user confirms)
296
-
297
- If user says to fix:
298
- 1. Fix each issue in order: CRITICAL → HIGH → MEDIUM → LOW
299
- 2. Re-run build/lint/tests after each batch
300
- 3. Re-run the full review when all fixed
301
- 4. Report final status
302
-
303
- ---
304
-
305
- ## Relationship to Other Skills
306
-
307
- | Skill | When to use |
308
- |-------|-------------|
309
- | `review-changes` (this) | Local branch changes, pre-push / pre-PR |
310
- | `pr-review` | Remote PR review via `gh pr` — includes posting feedback to GitHub |
311
- | `architect-review` | Deep DDD architecture audit of a domain (not just changes) |
312
- | `fix-pr-comment` | Fix feedback posted on an existing PR |