moicle 2.0.0 → 2.2.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 +20 -9
- 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 +159 -519
- package/assets/skills/docs/write/SKILL.md +89 -186
- package/assets/skills/feature/new/SKILL.md +152 -192
- package/assets/skills/feature/refactor/SKILL.md +152 -233
- package/assets/skills/fix/hotfix/SKILL.md +139 -305
- package/assets/skills/fix/incident/SKILL.md +107 -19
- package/assets/skills/fix/pr-comment/SKILL.md +98 -224
- package/assets/skills/fix/root-cause/SKILL.md +161 -104
- package/assets/skills/{docs → marketing}/content/SKILL.md +4 -4
- 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 +127 -510
- package/assets/skills/research/spike/SKILL.md +128 -436
- package/assets/skills/research/web/SKILL.md +124 -83
- package/assets/skills/review/architect/SKILL.md +157 -306
- package/assets/skills/review/branch/SKILL.md +153 -208
- package/assets/skills/review/pr/SKILL.md +129 -519
- package/assets/skills/review/tdd/SKILL.md +108 -69
- package/bin/cli.js +2 -2
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +176 -8
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +31 -1
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +30 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +64 -8
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/utils/symlink.d.ts +1 -0
- package/dist/utils/symlink.d.ts.map +1 -1
- package/dist/utils/symlink.js +8 -6
- package/dist/utils/symlink.js.map +1 -1
- package/package.json +1 -1
- package/assets/skills/docs/logo/SKILL.md +0 -492
- package/assets/skills/docs/video/SKILL.md +0 -666
|
@@ -6,86 +6,69 @@ args: "[ARCHITECTURE_NAME] [DOMAIN]"
|
|
|
6
6
|
|
|
7
7
|
# DDD Architecture Review
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Audit a codebase (or a single domain) against DDD rules with automated checks, manual review, and a fix loop until score ≥ B.
|
|
10
10
|
|
|
11
11
|
## When to use this skill
|
|
12
12
|
|
|
13
|
-
- ✅ Verify DDD compliance
|
|
13
|
+
- ✅ Verify DDD compliance after `/feature:new` or `/feature:refactor`
|
|
14
14
|
- ✅ Periodic audit of an existing codebase
|
|
15
|
-
- ✅
|
|
16
|
-
- ❌
|
|
17
|
-
- ❌
|
|
18
|
-
- ❌
|
|
15
|
+
- ✅ Quality gate before merging architectural changes
|
|
16
|
+
- ❌ Full PR review (arch + code + security + tests) → use `/review:pr`
|
|
17
|
+
- ❌ Self-review own branch before push → use `/review:branch`
|
|
18
|
+
- ❌ Security-only audit → use `@security-audit` agent
|
|
19
19
|
|
|
20
20
|
## Usage
|
|
21
21
|
|
|
22
|
-
```bash
|
|
23
|
-
/review:architect go-backend wallet
|
|
24
|
-
/review:architect react-frontend
|
|
25
|
-
/review:architect
|
|
26
22
|
```
|
|
23
|
+
/review:architect <architecture> [domain]
|
|
24
|
+
/review:architect # auto-detect stack
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Examples: `/review:architect go-backend wallet`, `/review:architect react-frontend`.
|
|
27
28
|
|
|
28
|
-
## Supported
|
|
29
|
+
## Supported architectures
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
Aliases: `ddd → ddd-architecture`, `go → go-backend`, `react → react-frontend`, `flutter → flutter-mobile`, `laravel → laravel-backend`, `remix → remix-fullstack`, `nestjs → nodejs-nestjs`, `mono → monorepo`.
|
|
32
|
+
|
|
33
|
+
Files live at `.claude/architecture/{name}.md` (project) → `~/.claude/architecture/{name}.md` (global).
|
|
34
|
+
|
|
35
|
+
---
|
|
33
36
|
|
|
34
|
-
|
|
37
|
+
## Workflow
|
|
35
38
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
| `go-backend` | `go-backend.md` | `go` |
|
|
40
|
-
| `react-frontend` | `react-frontend.md` | `react` |
|
|
41
|
-
| `flutter-mobile` | `flutter-mobile.md` | `flutter` |
|
|
42
|
-
| `laravel-backend` | `laravel-backend.md` | `laravel` |
|
|
43
|
-
| `remix-fullstack` | `remix-fullstack.md` | `remix` |
|
|
44
|
-
| `monorepo` | `monorepo.md` | `mono` |
|
|
39
|
+
```
|
|
40
|
+
RESOLVE → LOAD RULES → AUTOMATED CHECKS → MANUAL REVIEW → REPORT → FIX LOOP
|
|
41
|
+
```
|
|
45
42
|
|
|
46
43
|
---
|
|
47
44
|
|
|
48
45
|
## Phase 0: RESOLVE ARCHITECTURE
|
|
49
46
|
|
|
50
|
-
###
|
|
51
|
-
1. Normalize
|
|
52
|
-
2.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
1. Auto-detect stack from project files:
|
|
58
|
-
- `go.mod` → `go-backend`
|
|
59
|
-
- `package.json` + `vite.config` → `react-frontend`
|
|
60
|
-
- `pubspec.yaml` → `flutter-mobile`
|
|
61
|
-
- `composer.json` → `laravel-backend`
|
|
62
|
-
- `remix.config` → `remix-fullstack`
|
|
63
|
-
2. If detected → confirm with user
|
|
64
|
-
3. If not detected → list available, ask user to select
|
|
47
|
+
### Argument provided
|
|
48
|
+
1. Normalize via alias table → search project then global
|
|
49
|
+
2. Found → Phase 1. Not found → reject with available list, STOP.
|
|
50
|
+
|
|
51
|
+
### No argument
|
|
52
|
+
1. Detect stack via `~/.claude/architecture/_shared/stack-detection.md`
|
|
53
|
+
2. Detected → confirm with user. Not detected → list options, ask.
|
|
65
54
|
|
|
66
55
|
### Gate
|
|
67
56
|
- [ ] Architecture file loaded
|
|
68
|
-
- [ ] Domain
|
|
57
|
+
- [ ] Domain identified (if scoped)
|
|
69
58
|
|
|
70
59
|
---
|
|
71
60
|
|
|
72
|
-
## Phase 1: LOAD
|
|
61
|
+
## Phase 1: LOAD RULES
|
|
73
62
|
|
|
74
|
-
Read
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
3. **Hard Rules** — forbidden imports, naming conventions
|
|
81
|
-
4. **Forbidden Imports** — specific packages/modules NOT allowed in domain
|
|
82
|
-
5. **Check Scripts** — automated bash commands for validation
|
|
83
|
-
6. **Wiring Pattern** — how modules are registered
|
|
84
|
-
7. **Test Patterns** — how each layer should be tested
|
|
63
|
+
Read `ddd-architecture.md` (core) + the stack doc. Extract:
|
|
64
|
+
- DDD directory layout
|
|
65
|
+
- Layer import rules + forbidden imports
|
|
66
|
+
- Hard rules (HR1-HR15)
|
|
67
|
+
- Stack-specific check scripts
|
|
68
|
+
- Wiring + test patterns
|
|
85
69
|
|
|
86
70
|
### Gate
|
|
87
|
-
- [ ] Core
|
|
88
|
-
- [ ] Stack-specific rules loaded
|
|
71
|
+
- [ ] Core + stack rules loaded
|
|
89
72
|
- [ ] Check scripts extracted
|
|
90
73
|
- [ ] Review checklist prepared
|
|
91
74
|
|
|
@@ -93,215 +76,130 @@ Read the architecture file completely. Also read `ddd-architecture.md` (core DDD
|
|
|
93
76
|
|
|
94
77
|
## Phase 2: AUTOMATED CHECKS
|
|
95
78
|
|
|
96
|
-
Run the check scripts from the architecture doc.
|
|
97
|
-
|
|
98
|
-
### Standard Checks (all stacks)
|
|
79
|
+
Run the stack-specific check scripts from the architecture doc. They follow this universal pattern (adapt per stack):
|
|
99
80
|
|
|
100
81
|
```bash
|
|
101
|
-
echo "
|
|
102
|
-
{
|
|
103
|
-
|
|
104
|
-
echo "
|
|
105
|
-
{
|
|
106
|
-
|
|
107
|
-
echo "
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
echo "
|
|
111
|
-
{check_domain_A_not_importing_domain_B} && echo "FAIL" || echo "PASS"
|
|
112
|
-
|
|
113
|
-
echo "=== R5: No Circular Imports ==="
|
|
114
|
-
{build_and_check_cycles} && echo "FAIL" || echo "PASS"
|
|
115
|
-
|
|
116
|
-
echo "=== R6: Tests Exist ==="
|
|
117
|
-
{find_test_files_in_domain} | wc -l
|
|
118
|
-
|
|
119
|
-
echo "=== R7: Tests Pass ==="
|
|
120
|
-
{stack_test_command} && echo "PASS" || echo "FAIL"
|
|
121
|
-
|
|
122
|
-
echo "=== R8: Wiring Registered ==="
|
|
123
|
-
{check_routes_or_providers_registered}
|
|
124
|
-
|
|
125
|
-
echo "=== R9: Event Names Match Registry ==="
|
|
126
|
-
{check_event_names_consistency}
|
|
127
|
-
|
|
128
|
-
echo "=== R10: Async Context Safety ==="
|
|
129
|
-
{check_no_request_context_in_goroutines}
|
|
82
|
+
echo "R1: Build" ; {build} && echo PASS || echo FAIL
|
|
83
|
+
echo "R2: Lint/Vet" ; {lint} && echo PASS || echo FAIL
|
|
84
|
+
echo "R3: Domain pure" ; {grep_forbidden in domain/} && echo FAIL || echo PASS
|
|
85
|
+
echo "R4: No cross-dom" ; {grep_domain_A in domain_B} && echo FAIL || echo PASS
|
|
86
|
+
echo "R5: No cycles" ; {cycle_check} && echo FAIL || echo PASS
|
|
87
|
+
echo "R6: Tests exist" ; {find_tests_in_domain} | wc -l
|
|
88
|
+
echo "R7: Tests pass" ; {test} && echo PASS || echo FAIL
|
|
89
|
+
echo "R8: Wiring reg" ; {check_routes_registered}
|
|
90
|
+
echo "R9: Event names" ; {check_event_consistency}
|
|
91
|
+
echo "R10: Async ctx" ; {check_no_request_context_in_goroutines}
|
|
130
92
|
```
|
|
131
93
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
Read the **Check Scripts** section from the loaded architecture doc and run those exact commands.
|
|
135
|
-
|
|
136
|
-
### Output
|
|
137
|
-
Record PASS/FAIL for each check. Continue to Phase 3 regardless — manual review catches what automated checks miss.
|
|
94
|
+
Record PASS/FAIL per check. Continue to Phase 3 either way — manual review catches what automated misses.
|
|
138
95
|
|
|
139
96
|
### Gate
|
|
140
|
-
- [ ] All automated checks
|
|
141
|
-
- [ ]
|
|
97
|
+
- [ ] All 10 automated checks run
|
|
98
|
+
- [ ] PASS/FAIL recorded
|
|
142
99
|
|
|
143
100
|
---
|
|
144
101
|
|
|
145
|
-
## Phase 3:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
###
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
###
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|---|-------|-----------------|
|
|
215
|
-
| SVC1 | Thin wrapper | Delegates to usecases, no business logic |
|
|
216
|
-
| SVC2 | No infrastructure imports | No ORM, no HTTP framework |
|
|
217
|
-
|
|
218
|
-
### 3.8 Handlers/Controllers
|
|
219
|
-
|
|
220
|
-
| # | Check | What to look for |
|
|
221
|
-
|---|-------|-----------------|
|
|
222
|
-
| H1 | Registration function | `Register{Module}Routes` or equivalent wiring |
|
|
223
|
-
| H2 | Thin handlers | Parse input -> call service -> return output |
|
|
224
|
-
| H3 | No business logic | Logic is in usecases, not here |
|
|
225
|
-
| H4 | DTOs separate | Request/Response types in separate file |
|
|
226
|
-
|
|
227
|
-
### 3.9 Listeners
|
|
228
|
-
|
|
229
|
-
| # | Check | What to look for |
|
|
230
|
-
|---|-------|-----------------|
|
|
231
|
-
| L1 | One per event | `on_{event_name}` naming |
|
|
232
|
-
| L2 | Side-effects only | Notifications, SSE, analytics — no business logic |
|
|
233
|
-
| L3 | Registered in event bus | Listed in registry/event bus setup |
|
|
234
|
-
| L4 | Background context | Async work uses background context, not request context |
|
|
235
|
-
|
|
236
|
-
### 3.10 Infrastructure/Store
|
|
237
|
-
|
|
238
|
-
| # | Check | What to look for |
|
|
239
|
-
|---|-------|-----------------|
|
|
240
|
-
| I1 | Implements port interface | All methods from the port interface |
|
|
241
|
-
| I2 | Has mappers | Converts between domain entities and persistence models |
|
|
242
|
-
| I3 | No business logic | Pure persistence — queries, saves, deletes |
|
|
243
|
-
| I4 | Compile-time check | Interface compliance verified at compile time (where possible) |
|
|
102
|
+
## Phase 3: MANUAL REVIEW
|
|
103
|
+
|
|
104
|
+
Focus on **architecture structure**, not business correctness. 10 areas:
|
|
105
|
+
|
|
106
|
+
### D — Directory Structure
|
|
107
|
+
- D1 `domain/{domain}/` exists with proper subdirs
|
|
108
|
+
- D2 Has `entities/`, `ports/`, `usecases/` at minimum
|
|
109
|
+
- D3 `valueobjects/` separate (not mixed in entities)
|
|
110
|
+
- D4 `events/` separate, 1 file per event
|
|
111
|
+
- D5 Application layer: `ports/{transport}/`, `services/`, `listeners/`
|
|
112
|
+
- D6 Infrastructure implements ports
|
|
113
|
+
- D7 No legacy dirs (`modules/`, flat structure)
|
|
114
|
+
|
|
115
|
+
### E — Entities
|
|
116
|
+
- E1 Has constructor (`New{Entity}` / `create()`)
|
|
117
|
+
- E2 Has behavior methods (NOT anemic)
|
|
118
|
+
- E3 Raises domain events on state change
|
|
119
|
+
- E4 No framework imports
|
|
120
|
+
- E5 Has mappers (if persisted)
|
|
121
|
+
|
|
122
|
+
### VO — Value Objects
|
|
123
|
+
- VO1 In `valueobjects/`, not entities
|
|
124
|
+
- VO2 Only stdlib imports
|
|
125
|
+
- VO3 Immutable with behavior methods
|
|
126
|
+
- VO4 Used by entities + ports (not raw strings)
|
|
127
|
+
|
|
128
|
+
### P — Ports
|
|
129
|
+
- P1 `ports/` dir exists (no inline interfaces in usecases)
|
|
130
|
+
- P2 One file per port
|
|
131
|
+
- P3 Each file has interface + related DTOs
|
|
132
|
+
- P4 Domain types in signatures (not primitives)
|
|
133
|
+
- P5 Platform-agnostic naming (`URLParser` not `ShopeeURLParser`)
|
|
134
|
+
- P6 No infrastructure imports
|
|
135
|
+
|
|
136
|
+
### EV — Events
|
|
137
|
+
- EV1 One file per event
|
|
138
|
+
- EV2 Extends base event type
|
|
139
|
+
- EV3 Carries data for listeners
|
|
140
|
+
- EV4 Name matches registry
|
|
141
|
+
|
|
142
|
+
### U — UseCases
|
|
143
|
+
- U1 Uses port interfaces (not inline)
|
|
144
|
+
- U2 Split by concern (≤200 lines/file)
|
|
145
|
+
- U3 Business logic lives here (not in handler / store / service)
|
|
146
|
+
- U4 No infrastructure imports
|
|
147
|
+
- U5 Dispatches events after persistence
|
|
148
|
+
- U6 No `deps.go` inline interfaces
|
|
149
|
+
|
|
150
|
+
### SVC — Services
|
|
151
|
+
- SVC1 Thin wrapper, delegates to usecases
|
|
152
|
+
- SVC2 No infrastructure imports
|
|
153
|
+
|
|
154
|
+
### H — Handlers / Controllers
|
|
155
|
+
- H1 Has registration function
|
|
156
|
+
- H2 Thin (parse → service → respond)
|
|
157
|
+
- H3 No business logic
|
|
158
|
+
- H4 DTOs in separate file
|
|
159
|
+
|
|
160
|
+
### L — Listeners
|
|
161
|
+
- L1 One per event (`on_{event}` naming)
|
|
162
|
+
- L2 Side-effects only
|
|
163
|
+
- L3 Registered in event bus
|
|
164
|
+
- L4 Background context (not request ctx)
|
|
165
|
+
|
|
166
|
+
### I — Infrastructure
|
|
167
|
+
- I1 Implements port interface
|
|
168
|
+
- I2 Has mappers (domain ↔ persistence)
|
|
169
|
+
- I3 No business logic
|
|
170
|
+
- I4 Compile-time interface check (where possible)
|
|
244
171
|
|
|
245
172
|
### Gate
|
|
246
173
|
- [ ] All 10 areas reviewed
|
|
247
|
-
- [ ] Findings categorized by severity
|
|
174
|
+
- [ ] Findings categorized by severity (see `~/.claude/architecture/_shared/severity-levels.md`)
|
|
248
175
|
|
|
249
176
|
---
|
|
250
177
|
|
|
251
178
|
## Phase 4: REPORT
|
|
252
179
|
|
|
253
|
-
### Severity Levels
|
|
254
|
-
|
|
255
|
-
| Level | Meaning | Examples |
|
|
256
|
-
|-------|---------|---------|
|
|
257
|
-
| **CRITICAL** | Architecture broken | Build fails, circular imports, domain imports framework |
|
|
258
|
-
| **HIGH** | DDD violation | Cross-domain import, business logic in wrong layer, no ports dir, inline interfaces |
|
|
259
|
-
| **MEDIUM** | Structure issue | Anemic entity, fat controller, missing events, missing tests, missing json tags |
|
|
260
|
-
| **LOW** | Convention issue | File naming, redundant code, DTOs in wrong package |
|
|
261
|
-
|
|
262
|
-
**ALL levels must be fixed.**
|
|
263
|
-
|
|
264
|
-
### Report Template
|
|
265
|
-
|
|
266
180
|
```markdown
|
|
267
181
|
## Architecture Review: {architecture} / {domain}
|
|
268
182
|
|
|
269
|
-
### Automated
|
|
183
|
+
### Automated (R1-R10)
|
|
270
184
|
| # | Check | Status |
|
|
271
185
|
|---|-------|--------|
|
|
272
186
|
| R1 | Build | PASS/FAIL |
|
|
273
|
-
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
| R5 | No circular imports | PASS/FAIL |
|
|
277
|
-
| R6 | Tests exist | PASS/WARN |
|
|
278
|
-
| R7 | Tests pass | PASS/FAIL |
|
|
279
|
-
| R8 | Wiring registered | PASS/FAIL |
|
|
280
|
-
| R9 | Event names consistent | PASS/N/A |
|
|
281
|
-
| R10 | Async context safety | PASS/N/A |
|
|
282
|
-
|
|
283
|
-
### Architecture Review
|
|
187
|
+
| ... | ... | ... |
|
|
188
|
+
|
|
189
|
+
### Manual review
|
|
284
190
|
| Area | Status | Violations |
|
|
285
191
|
|------|--------|------------|
|
|
286
|
-
| Directory
|
|
287
|
-
| Entities (E1-E5) | OK/ISSUE | ... |
|
|
288
|
-
|
|
|
289
|
-
| Ports (P1-P6) | OK/ISSUE | ... |
|
|
290
|
-
| Events (EV1-EV4) | OK/N/A | ... |
|
|
291
|
-
| UseCases (U1-U6) | OK/ISSUE | ... |
|
|
292
|
-
| Services (SVC1-SVC2) | OK/ISSUE | ... |
|
|
293
|
-
| Handlers (H1-H4) | OK/ISSUE | ... |
|
|
294
|
-
| Listeners (L1-L4) | OK/N/A | ... |
|
|
295
|
-
| Infrastructure (I1-I4) | OK/ISSUE | ... |
|
|
296
|
-
|
|
297
|
-
### Violations Found
|
|
298
|
-
1. [SEVERITY] Code — file:line — description
|
|
299
|
-
2. ...
|
|
192
|
+
| Directory (D1-D7) | OK / ISSUE | ... |
|
|
193
|
+
| Entities (E1-E5) | OK / ISSUE | ... |
|
|
194
|
+
| ... | ... | ... |
|
|
300
195
|
|
|
301
|
-
###
|
|
302
|
-
1.
|
|
196
|
+
### Violations
|
|
197
|
+
1. [SEVERITY] code:file:line — description
|
|
303
198
|
2. ...
|
|
304
199
|
|
|
200
|
+
### Recommended fixes
|
|
201
|
+
1. ...
|
|
202
|
+
|
|
305
203
|
### Overall Score: {A/B/C/D/F}
|
|
306
204
|
```
|
|
307
205
|
|
|
@@ -309,97 +207,50 @@ Read files and check DDD compliance. Focus on **architecture structure**, NOT bu
|
|
|
309
207
|
|
|
310
208
|
| Score | Criteria |
|
|
311
209
|
|-------|----------|
|
|
312
|
-
| **A** | 0 violations, all
|
|
210
|
+
| **A** | 0 violations, all R1-R10 PASS |
|
|
313
211
|
| **B** | 0 CRITICAL/HIGH, max 3 MEDIUM |
|
|
314
212
|
| **C** | 0 CRITICAL, max 2 HIGH |
|
|
315
213
|
| **D** | Has CRITICAL or 3+ HIGH |
|
|
316
|
-
| **F** | Multiple CRITICAL
|
|
214
|
+
| **F** | Multiple CRITICAL — architecture broken |
|
|
317
215
|
|
|
318
216
|
### Gate
|
|
319
217
|
- [ ] Report generated
|
|
320
218
|
- [ ] Score calculated
|
|
321
|
-
- [ ] All violations
|
|
219
|
+
- [ ] All violations have file:line
|
|
322
220
|
|
|
323
221
|
---
|
|
324
222
|
|
|
325
|
-
## Phase 5:
|
|
326
|
-
|
|
327
|
-
**Keep looping until ALL checks pass and score is A or B.**
|
|
223
|
+
## Phase 5: FIX LOOP (if user confirms)
|
|
328
224
|
|
|
329
225
|
```
|
|
330
226
|
LOOP:
|
|
331
|
-
1. Fix all violations
|
|
332
|
-
2.
|
|
333
|
-
3.
|
|
334
|
-
4.
|
|
335
|
-
5. IF
|
|
336
|
-
a. Fix violations
|
|
337
|
-
b. GOTO 1
|
|
338
|
-
6. IF only LOW violations or none:
|
|
339
|
-
BREAK → Report final status
|
|
227
|
+
1. Fix all violations
|
|
228
|
+
2. Re-run automated checks (Phase 2)
|
|
229
|
+
3. Re-run manual review (Phase 3)
|
|
230
|
+
4. IF violations severity ≥ MEDIUM → GOTO 1
|
|
231
|
+
5. IF only LOW or none → BREAK, final report
|
|
340
232
|
```
|
|
341
233
|
|
|
342
|
-
|
|
343
|
-
```bash
|
|
344
|
-
# Verify build still works
|
|
345
|
-
{stack_build_command}
|
|
346
|
-
|
|
347
|
-
# Verify tests still pass
|
|
348
|
-
{stack_test_command}
|
|
349
|
-
|
|
350
|
-
# Re-check domain purity
|
|
351
|
-
{grep_forbidden_imports_in_domain}
|
|
352
|
-
```
|
|
234
|
+
Verify after each iteration: build passes, tests pass, domain purity holds.
|
|
353
235
|
|
|
354
236
|
---
|
|
355
237
|
|
|
356
|
-
## Calling from
|
|
357
|
-
|
|
358
|
-
This skill is designed to be called by `/feature:new` and `/feature:refactor`s at the end of their workflows:
|
|
238
|
+
## Calling from other skills
|
|
359
239
|
|
|
360
|
-
|
|
361
|
-
# From new-feature skill, after Phase 5 (registration):
|
|
362
|
-
→ Run /review:architect {detected_stack} {domain}
|
|
363
|
-
→ Review loop until score >= B
|
|
364
|
-
|
|
365
|
-
# From refactor skill, after Phase 4 (cleanup):
|
|
366
|
-
→ Run /review:architect {detected_stack} {domain}
|
|
367
|
-
→ Review loop until score >= B
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
When called from another skill:
|
|
240
|
+
`/feature:new` and `/feature:refactor` call this skill at the end of their workflows. When called from another skill:
|
|
371
241
|
- Skip Phase 0 (architecture already known)
|
|
372
242
|
- Skip user confirmation for fixes (auto-fix in loop)
|
|
373
|
-
- Report final score back to
|
|
243
|
+
- Report final score back to caller
|
|
374
244
|
|
|
375
245
|
---
|
|
376
246
|
|
|
377
|
-
##
|
|
378
|
-
|
|
379
|
-
### Architecture Files Location
|
|
380
|
-
```
|
|
381
|
-
.claude/architecture/{name}.md # Project-specific (priority)
|
|
382
|
-
~/.claude/architecture/{name}.md # Global
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
### Aliases
|
|
386
|
-
```
|
|
387
|
-
ddd → ddd-architecture
|
|
388
|
-
go → go-backend
|
|
389
|
-
react → react-frontend
|
|
390
|
-
flutter → flutter-mobile
|
|
391
|
-
laravel → laravel-backend
|
|
392
|
-
remix → remix-fullstack
|
|
393
|
-
mono → monorepo
|
|
394
|
-
```
|
|
247
|
+
## Hard Rules
|
|
395
248
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
I: Infrastructure
|
|
402
|
-
```
|
|
249
|
+
- **All CRITICAL/HIGH must be fixed** before merge
|
|
250
|
+
- **MEDIUM allowed with waiver** (explicit decision + comment)
|
|
251
|
+
- **Don't grade-inflate** — if it's a HIGH, mark HIGH
|
|
252
|
+
- **Don't skip Phase 3** — automated checks miss structural issues
|
|
253
|
+
- **File:line for every violation** — author shouldn't have to grep
|
|
403
254
|
|
|
404
255
|
---
|
|
405
256
|
|
|
@@ -407,17 +258,17 @@ I: Infrastructure
|
|
|
407
258
|
|
|
408
259
|
| When | Use |
|
|
409
260
|
|------|-----|
|
|
410
|
-
| Full PR review (arch + code
|
|
261
|
+
| Full PR review (arch + code + security + tests) | `/review:pr` |
|
|
411
262
|
| Self-review own branch before push | `/review:branch` |
|
|
412
|
-
| Refactor to fix violations
|
|
263
|
+
| Refactor to fix violations | `/feature:refactor` |
|
|
413
264
|
| Add tests if missing | `/review:tdd` |
|
|
414
|
-
| Called from `/feature:new` /
|
|
265
|
+
| Called from `/feature:new` / `/feature:refactor` | automatic |
|
|
415
266
|
|
|
416
267
|
## Recommended Agents
|
|
417
268
|
|
|
418
269
|
| Phase | Agent | Purpose |
|
|
419
270
|
|-------|-------|---------|
|
|
420
271
|
| LOAD | `@clean-architect` | Interpret architecture rules |
|
|
421
|
-
| AUTOMATED
|
|
422
|
-
| MANUAL
|
|
272
|
+
| AUTOMATED | `@devops` | Build / lint / test scripts |
|
|
273
|
+
| MANUAL | `@code-reviewer` | Spot violations |
|
|
423
274
|
| FIX | Stack-specific dev agent | Apply fixes |
|