moicle 1.3.1 → 1.6.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 +17 -5
- package/assets/agents/developers/nodejs-backend-dev.md +92 -0
- package/assets/agents/developers/react-frontend-dev.md +32 -19
- package/assets/architecture/ddd-architecture.md +337 -0
- package/assets/architecture/go-backend.md +770 -693
- package/assets/architecture/laravel-backend.md +388 -156
- package/assets/architecture/nodejs-nestjs.md +949 -0
- package/assets/architecture/react-frontend.md +216 -145
- package/assets/skills/architect-review/SKILL.md +292 -372
- package/assets/skills/deep-debug/SKILL.md +114 -0
- package/assets/skills/new-feature/SKILL.md +232 -252
- package/assets/skills/refactor/SKILL.md +261 -679
- package/assets/skills/research/SKILL.md +124 -0
- package/assets/skills/review-changes/SKILL.md +312 -0
- package/assets/skills/sync-docs/SKILL.md +115 -74
- package/assets/templates/go-gin/CLAUDE.md +671 -121
- package/assets/templates/react-vite/CLAUDE.md +204 -128
- package/package.json +1 -1
- package/assets/architecture/clean-architecture.md +0 -143
- package/assets/skills/go-module/SKILL.md +0 -77
- package/assets/skills/ship/SKILL.md +0 -297
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deep-debug
|
|
3
|
+
description: Deep bug investigation workflow for hard-to-trace errors. Systematic root cause analysis — no guessing, no blind fixes. Use when user says "deep debug", "deep-debug", "trace bug", "find root cause", "hard bug", "investigate bug".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Deep Bug Investigation Workflow
|
|
7
|
+
|
|
8
|
+
For hard bugs that have been "fixed" multiple times without success. DO NOT guess — trace step by step to the root cause.
|
|
9
|
+
|
|
10
|
+
## Step 1: Collect evidence
|
|
11
|
+
|
|
12
|
+
Record exactly, DO NOT interpret:
|
|
13
|
+
|
|
14
|
+
- Exact error message
|
|
15
|
+
- Stack trace: file, line number, call chain
|
|
16
|
+
- Which environment is affected (production/staging/local)
|
|
17
|
+
- Happens every time or only in certain cases
|
|
18
|
+
|
|
19
|
+
## Step 2: Verify the code that is actually running
|
|
20
|
+
|
|
21
|
+
DO NOT assume the code on production = the code on local.
|
|
22
|
+
|
|
23
|
+
- Identify the exact version/commit currently deployed
|
|
24
|
+
- Compare it against the code you are reading locally
|
|
25
|
+
- If they DIFFER → read the deployed version before analyzing further
|
|
26
|
+
|
|
27
|
+
## Step 3: Trace the execution path
|
|
28
|
+
|
|
29
|
+
This is the most important step. Go from entry point → to the failing line. Trace EVERY step, DO NOT skip.
|
|
30
|
+
|
|
31
|
+
### 3a. Entry point → Error line
|
|
32
|
+
|
|
33
|
+
- Where does the request/event/job enter from?
|
|
34
|
+
- Which function calls which function? Follow the stack trace exactly.
|
|
35
|
+
- How is data passed through each layer?
|
|
36
|
+
|
|
37
|
+
### 3b. Where does the data at the failing line come from?
|
|
38
|
+
|
|
39
|
+
- Where is the faulty variable created/loaded from?
|
|
40
|
+
- Loaded directly from source (DB, API) or from cache/session?
|
|
41
|
+
- Does it go through serialize → unserialize?
|
|
42
|
+
- Does it go through any transform/convert?
|
|
43
|
+
|
|
44
|
+
### 3c. Type & state at the moment of failure
|
|
45
|
+
|
|
46
|
+
- What is the actual type of the variable? (string, object, null, enum...)
|
|
47
|
+
- What type does the code expect?
|
|
48
|
+
- Why does the actual type differ from the expected one?
|
|
49
|
+
|
|
50
|
+
### 3d. Framework internals (when the error is inside vendor/library)
|
|
51
|
+
|
|
52
|
+
- Read the source code at the EXACT line number from the stack trace
|
|
53
|
+
- Trace backwards: who calls that method, and with what arguments
|
|
54
|
+
- What condition drives the code into the failing branch
|
|
55
|
+
|
|
56
|
+
## Step 4: Find the root cause — Answer 3 questions
|
|
57
|
+
|
|
58
|
+
1. **Why does it fail?** — The specific technical cause
|
|
59
|
+
2. **Why didn't it fail before?** — What changed
|
|
60
|
+
3. **Reproduction conditions?** — When it fails, when it doesn't
|
|
61
|
+
|
|
62
|
+
If you can't answer all 3 → go back to Step 3, trace further.
|
|
63
|
+
|
|
64
|
+
## Step 5: Check hidden state sources
|
|
65
|
+
|
|
66
|
+
"Sometimes works, sometimes doesn't" bugs are usually caused by hidden state. Check in this order:
|
|
67
|
+
|
|
68
|
+
### Cache / Serialization
|
|
69
|
+
|
|
70
|
+
- Does the object pulled from cache lose any internal state? (transient fields, lazy-loaded properties, runtime caches)
|
|
71
|
+
- Does stale cache contain the old data format while new code expects the new format?
|
|
72
|
+
- Does serialize/unserialize change the type? (int↔float, null handling, enum↔string)
|
|
73
|
+
|
|
74
|
+
### Database / Storage
|
|
75
|
+
|
|
76
|
+
- Do collation/encoding affect comparisons?
|
|
77
|
+
- Do default values in the DB match the code's expectations?
|
|
78
|
+
- Has the schema been updated on production yet?
|
|
79
|
+
|
|
80
|
+
### Runtime cache / Compiled cache
|
|
81
|
+
|
|
82
|
+
- Any compiled/cached config, routes, or views that haven't been cleared?
|
|
83
|
+
- Does the bytecode cache (OPcache, compiled assets) serve the old file?
|
|
84
|
+
- Does CDN/proxy cache serve a stale asset?
|
|
85
|
+
|
|
86
|
+
### Environment
|
|
87
|
+
|
|
88
|
+
- Are env vars on production correct/complete?
|
|
89
|
+
- Does the runtime version (PHP, Node, Go, Python, etc.) differ from local?
|
|
90
|
+
- Do dependency versions differ?
|
|
91
|
+
|
|
92
|
+
## Step 6: Fix
|
|
93
|
+
|
|
94
|
+
Only fix once you have answered the 3 questions from Step 4. The fix must:
|
|
95
|
+
|
|
96
|
+
- Address the root cause, not the symptom
|
|
97
|
+
- Handle the edge case discovered (stale cache, type mismatch)
|
|
98
|
+
- Be defensive at data boundaries (cache, DB, external API) — not in internal logic
|
|
99
|
+
- Not break the normal code path in order to patch an edge case
|
|
100
|
+
|
|
101
|
+
## Step 7: Verify
|
|
102
|
+
|
|
103
|
+
- Reproduce the failure conditions from Step 4 → confirm the fix works
|
|
104
|
+
- Check the normal code path still works
|
|
105
|
+
- If cache-related → test both fresh load and cached load
|
|
106
|
+
- Verify against the actually deployed version (repeat Step 2)
|
|
107
|
+
|
|
108
|
+
## IMPORTANT
|
|
109
|
+
|
|
110
|
+
- **DO NOT GUESS** — Trace evidence, do not infer from variable names or "maybe it's..."
|
|
111
|
+
- **DO NOT FIX BEFORE UNDERSTANDING** — Fixing without knowing the root cause = creating a new bug
|
|
112
|
+
- **VERIFY DEPLOYED CODE** — Always check the running version, never assume production = local
|
|
113
|
+
- **CHECK CACHE FIRST** — Most "sometimes works, sometimes doesn't" bugs come from stale cached state
|
|
114
|
+
- **ONE ROOT CAUSE** — Every bug has one root cause. If multiple possibilities remain → trace further
|
|
@@ -1,317 +1,297 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: new-feature
|
|
3
|
-
description:
|
|
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]"
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
# Feature Development Workflow
|
|
7
|
+
# DDD Feature Development Workflow
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
Build a new feature following DDD architecture, with automated checks after each phase and a review loop that keeps fixing until all checks pass.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
**ARGUMENTS:** `<domain> <feature>` — e.g., `wallet savings`, `notification broadcast`, `catalog products`
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
## Read Architecture First
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
~/.claude/architecture/
|
|
17
|
-
├── clean-architecture.md # Core principles for all projects
|
|
18
|
-
├── flutter-mobile.md # Flutter + Riverpod
|
|
19
|
-
├── react-frontend.md # React + Vite + TypeScript
|
|
20
|
-
├── go-backend.md # Go + Gin
|
|
21
|
-
├── laravel-backend.md # Laravel + PHP
|
|
22
|
-
├── remix-fullstack.md # Remix fullstack
|
|
23
|
-
└── monorepo.md # Monorepo structure
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
### Project-specific (if exists)
|
|
27
|
-
```
|
|
28
|
-
.claude/architecture/ # Project overrides
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
**Follow the structure and patterns defined in these files exactly.**
|
|
15
|
+
**Before starting, MUST read TWO files:**
|
|
32
16
|
|
|
33
|
-
|
|
17
|
+
1. **Core DDD spec**: `.claude/architecture/ddd-architecture.md`
|
|
18
|
+
2. **Stack-specific doc**: detect stack → read the corresponding architecture doc
|
|
34
19
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
| REVIEW | `@perf-optimizer` | Performance optimization |
|
|
44
|
-
| TEST | `@test-writer` | Unit/integration/e2e tests |
|
|
45
|
-
| COMPLETE | `@docs-writer` | Documentation (if needed) |
|
|
46
|
-
|
|
47
|
-
## Workflow Overview
|
|
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` |
|
|
48
28
|
|
|
29
|
+
### Architecture Files Location
|
|
49
30
|
```
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
└──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘
|
|
53
|
-
│ │
|
|
54
|
-
└──────◀───────┘
|
|
55
|
-
Feedback Loop
|
|
31
|
+
.claude/architecture/{name}.md # Project-specific (priority)
|
|
32
|
+
~/.claude/architecture/{name}.md # Global
|
|
56
33
|
```
|
|
57
34
|
|
|
58
35
|
---
|
|
59
36
|
|
|
60
|
-
##
|
|
61
|
-
|
|
62
|
-
**Goal**: Understand requirements and break down into tasks
|
|
63
|
-
|
|
64
|
-
### Actions
|
|
65
|
-
1. Clarify requirements with user
|
|
66
|
-
2. **Identify project stack** (Flutter, React, Go, Laravel, Remix, etc.)
|
|
67
|
-
3. **Read the appropriate architecture doc** for this stack
|
|
68
|
-
4. Identify affected files/modules based on architecture
|
|
69
|
-
5. List acceptance criteria
|
|
70
|
-
6. Create task breakdown using TodoWrite
|
|
71
|
-
|
|
72
|
-
### Output
|
|
73
|
-
```markdown
|
|
74
|
-
## Feature: [Name]
|
|
75
|
-
|
|
76
|
-
### Stack & Architecture
|
|
77
|
-
- Stack: [Flutter/React/Go/Laravel/Remix]
|
|
78
|
-
- Architecture Doc: [path to architecture file]
|
|
79
|
-
|
|
80
|
-
### Requirements
|
|
81
|
-
- [ ] Requirement 1
|
|
82
|
-
- [ ] Requirement 2
|
|
37
|
+
## Workflow
|
|
83
38
|
|
|
84
|
-
### Affected Areas (based on architecture)
|
|
85
|
-
- [Layer/Module 1]
|
|
86
|
-
- [Layer/Module 2]
|
|
87
|
-
|
|
88
|
-
### Tasks
|
|
89
|
-
1. Task 1
|
|
90
|
-
2. Task 2
|
|
91
39
|
```
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
40
|
+
PHASE 1: Analyze & Plan
|
|
41
|
+
→ PHASE 2: Build Domain Layer
|
|
42
|
+
→ PHASE 3: Build Infrastructure Layer
|
|
43
|
+
→ PHASE 4: Build Application Layer
|
|
44
|
+
→ PHASE 5: Registration & Wiring
|
|
45
|
+
→ PHASE 6: Domain Tests
|
|
46
|
+
→ REVIEW LOOP (run /architect-review, fix issues, repeat until clean)
|
|
47
|
+
```
|
|
98
48
|
|
|
99
49
|
---
|
|
100
50
|
|
|
101
|
-
##
|
|
51
|
+
## PHASE 1: Analyze & Plan
|
|
52
|
+
|
|
53
|
+
### 1.1 Read Architecture Docs
|
|
54
|
+
1. Read `ddd-architecture.md` (core DDD rules)
|
|
55
|
+
2. Read stack-specific architecture doc
|
|
56
|
+
3. Extract: DDD directory structure, layer rules, hard rules, forbidden imports, check scripts
|
|
57
|
+
|
|
58
|
+
### 1.2 Read Reference Module
|
|
59
|
+
Pick a SMALL existing module in the project as reference. Read ALL its files to understand exact patterns:
|
|
60
|
+
- Entities, value objects, events, ports, usecases
|
|
61
|
+
- Service, handler, DTOs, listeners
|
|
62
|
+
- Infrastructure store/API implementations
|
|
63
|
+
- Registration in router/provider/registry
|
|
64
|
+
|
|
65
|
+
### 1.3 Plan Feature
|
|
66
|
+
Present to user:
|
|
67
|
+
- All entities and their fields
|
|
68
|
+
- All endpoints/screens/UI (depending on stack)
|
|
69
|
+
- All domain events
|
|
70
|
+
- All value objects
|
|
71
|
+
- Business rules summary
|
|
72
|
+
- Files to create/modify
|
|
73
|
+
|
|
74
|
+
### Rule Check Phase 1
|
|
75
|
+
- [ ] Architecture docs read and understood
|
|
76
|
+
- [ ] Reference module read
|
|
77
|
+
- [ ] Plan presented and **user CONFIRMED** before continuing
|
|
102
78
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
### Actions
|
|
106
|
-
1. **Re-read architecture doc** for the specific stack
|
|
107
|
-
2. Apply architecture principles from the doc:
|
|
108
|
-
- Identify which layers are affected
|
|
109
|
-
- Define components for each layer
|
|
110
|
-
- Follow naming conventions from doc
|
|
79
|
+
---
|
|
111
80
|
|
|
112
|
-
|
|
81
|
+
## PHASE 2: Build Domain Layer
|
|
82
|
+
|
|
83
|
+
Create in order: value objects → entities → events → ports → usecases
|
|
84
|
+
|
|
85
|
+
### 2.1 Value Objects (`valueobjects/`)
|
|
86
|
+
- Typed values with behavior methods
|
|
87
|
+
- Status with `IsTerminal()`, `CanTransitionTo()`
|
|
88
|
+
- **Only stdlib imports** — read Forbidden Imports from architecture doc
|
|
89
|
+
|
|
90
|
+
### 2.2 Entities (`entities/`)
|
|
91
|
+
- Constructor function/method
|
|
92
|
+
- Behavior methods that raise events (state transitions, calculations)
|
|
93
|
+
- Guard methods (isActive, canXxx)
|
|
94
|
+
- Business error types
|
|
95
|
+
- Only imports: stdlib + valueobjects + domain/shared
|
|
96
|
+
|
|
97
|
+
### 2.3 Events (`events/`)
|
|
98
|
+
- One file per event
|
|
99
|
+
- Extend/embed base event type
|
|
100
|
+
- Carry data needed by listeners (userID, amounts, names)
|
|
101
|
+
|
|
102
|
+
### 2.4 Ports (`ports/`)
|
|
103
|
+
- One file per interface
|
|
104
|
+
- Store interfaces use domain entity types and value objects
|
|
105
|
+
- DTOs for complex query results live here
|
|
106
|
+
- No infrastructure imports
|
|
107
|
+
|
|
108
|
+
### 2.5 UseCases (`usecases/`)
|
|
109
|
+
- Constructor with port dependencies + event dispatcher
|
|
110
|
+
- Split by concern: one file per action group
|
|
111
|
+
- Business logic lives HERE
|
|
112
|
+
- Dispatch entity events after successful save
|
|
113
|
+
- **No infrastructure imports** — read Forbidden Imports from architecture doc
|
|
114
|
+
|
|
115
|
+
### Rule Check Phase 2
|
|
116
|
+
Run the **Domain Purity** check scripts from the stack architecture doc:
|
|
117
|
+
```bash
|
|
118
|
+
# Example (Go):
|
|
119
|
+
go build ./internal/domain/$DOMAIN/... && echo "PASS" || echo "FAIL"
|
|
120
|
+
go vet ./internal/domain/$DOMAIN/... && echo "PASS" || echo "FAIL"
|
|
121
|
+
grep -rn {forbidden_imports} internal/domain/$DOMAIN/ && echo "FAIL" || echo "PASS"
|
|
122
|
+
|
|
123
|
+
# Example (React):
|
|
124
|
+
npx tsc --noEmit && echo "PASS" || echo "FAIL"
|
|
125
|
+
grep -rn "from 'react'" src/domain/$DOMAIN/ && echo "FAIL" || echo "PASS"
|
|
126
|
+
|
|
127
|
+
# Example (Flutter):
|
|
128
|
+
dart analyze lib/domain/$DOMAIN/ && echo "PASS" || echo "FAIL"
|
|
129
|
+
grep -rn "package:flutter" lib/domain/$DOMAIN/ && echo "FAIL" || echo "PASS"
|
|
130
|
+
```
|
|
113
131
|
|
|
114
|
-
|
|
115
|
-
```markdown
|
|
116
|
-
## Architecture Design
|
|
132
|
+
---
|
|
117
133
|
|
|
118
|
-
|
|
119
|
-
- Architecture Doc: [path]
|
|
120
|
-
- Pattern: [pattern from doc]
|
|
134
|
+
## PHASE 3: Build Infrastructure Layer
|
|
121
135
|
|
|
122
|
-
###
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
-
|
|
136
|
+
### 3.1 Persistence Models (if applicable)
|
|
137
|
+
- ORM models, Prisma schema, Freezed classes
|
|
138
|
+
- Table/collection configuration
|
|
139
|
+
- Helper functions for atomic updates
|
|
126
140
|
|
|
127
|
-
###
|
|
128
|
-
|
|
141
|
+
### 3.2 Store/API Implementation
|
|
142
|
+
- Implements port interfaces from domain
|
|
143
|
+
- Compile-time interface check (where language supports it)
|
|
144
|
+
- Mapper functions: domain entity ↔ persistence model
|
|
145
|
+
- NO business logic — pure persistence/communication
|
|
146
|
+
- Use context consistently
|
|
129
147
|
|
|
130
|
-
###
|
|
131
|
-
|
|
148
|
+
### Rule Check Phase 3
|
|
149
|
+
```bash
|
|
150
|
+
# Build infrastructure layer
|
|
151
|
+
{stack_build_command_for_infra}
|
|
132
152
|
```
|
|
133
153
|
|
|
134
|
-
### Gate
|
|
135
|
-
- [ ] Design follows architecture doc
|
|
136
|
-
- [ ] Layers properly defined
|
|
137
|
-
- [ ] Dependencies follow doc patterns
|
|
138
|
-
|
|
139
154
|
---
|
|
140
155
|
|
|
141
|
-
##
|
|
156
|
+
## PHASE 4: Build Application Layer
|
|
142
157
|
|
|
143
|
-
|
|
158
|
+
### 4.1 Service
|
|
159
|
+
- Thin wrapper delegating to usecases
|
|
160
|
+
- Can orchestrate cross-domain calls if needed
|
|
144
161
|
|
|
145
|
-
###
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
4. Use patterns defined in doc (DI, state management, etc.)
|
|
162
|
+
### 4.2 Transport/Handler/Controller/Screen
|
|
163
|
+
- Registration/wiring function: create store → usecase → service → handler → routes
|
|
164
|
+
- Thin handlers: parse input → call service → return output
|
|
165
|
+
- DTOs in separate file
|
|
150
166
|
|
|
151
|
-
###
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
### Directory Structure (from doc)
|
|
158
|
-
[Follow exact structure from architecture doc]
|
|
167
|
+
### 4.3 Listeners (if domain has events)
|
|
168
|
+
- One file per event
|
|
169
|
+
- Side-effects only (notifications, SSE, analytics, async jobs)
|
|
170
|
+
- Use background context for async work
|
|
171
|
+
- Register in event bus/registry
|
|
159
172
|
|
|
160
|
-
###
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
[Follow conventions defined in architecture doc]
|
|
173
|
+
### Rule Check Phase 4
|
|
174
|
+
```bash
|
|
175
|
+
# Build application layer
|
|
176
|
+
{stack_build_command_for_application}
|
|
165
177
|
```
|
|
166
178
|
|
|
167
|
-
### Gate
|
|
168
|
-
- [ ] Structure matches architecture doc
|
|
169
|
-
- [ ] All layers implemented per doc
|
|
170
|
-
- [ ] Code compiles without errors
|
|
171
|
-
- [ ] Basic functionality works
|
|
172
|
-
|
|
173
179
|
---
|
|
174
180
|
|
|
175
|
-
##
|
|
176
|
-
|
|
177
|
-
**Goal**: Review code quality against architecture doc
|
|
181
|
+
## PHASE 5: Registration & Wiring
|
|
178
182
|
|
|
179
|
-
###
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
- [ ] Layer boundaries respected
|
|
183
|
-
- [ ] Dependencies flow correctly
|
|
184
|
-
- [ ] Patterns used correctly
|
|
183
|
+
### 5.1 Router/Provider Registration
|
|
184
|
+
- Add routes/screens/providers for the new module
|
|
185
|
+
- Wire service dependencies between modules if needed
|
|
185
186
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
- [ ] Proper authentication/authorization
|
|
187
|
+
### 5.2 Persistence Setup
|
|
188
|
+
- Add model migrations/schemas
|
|
189
|
+
- Run migrations if needed
|
|
190
190
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
- [ ] No obvious bottlenecks
|
|
191
|
+
### 5.3 Event Registry
|
|
192
|
+
- Register all new event listeners
|
|
193
|
+
- Verify event name strings match between events and registry
|
|
195
194
|
|
|
196
|
-
###
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
### Architecture Compliance: [Pass/Fail]
|
|
201
|
-
- Reference: [architecture doc]
|
|
202
|
-
- Issues: [list]
|
|
203
|
-
|
|
204
|
-
### Quality: [Good/Needs Work]
|
|
205
|
-
- Issues: [list]
|
|
206
|
-
|
|
207
|
-
### Security: [Pass/Fail]
|
|
208
|
-
- Issues: [list]
|
|
209
|
-
|
|
210
|
-
### Performance: [Pass/Fail]
|
|
211
|
-
- Issues: [list]
|
|
195
|
+
### Rule Check Phase 5
|
|
196
|
+
```bash
|
|
197
|
+
# Full build
|
|
198
|
+
{stack_full_build_command}
|
|
212
199
|
```
|
|
213
200
|
|
|
214
|
-
|
|
215
|
-
- [ ] Architecture doc followed
|
|
216
|
-
- [ ] No critical issues
|
|
217
|
-
- [ ] Security issues resolved
|
|
201
|
+
---
|
|
218
202
|
|
|
219
|
-
|
|
220
|
-
|
|
203
|
+
## PHASE 6: Domain Tests
|
|
204
|
+
|
|
205
|
+
### 6.1 Value Object Tests
|
|
206
|
+
- All status transitions
|
|
207
|
+
- Terminal states
|
|
208
|
+
- Behavior methods
|
|
209
|
+
- Edge cases
|
|
210
|
+
|
|
211
|
+
### 6.2 Entity Tests
|
|
212
|
+
- Constructor
|
|
213
|
+
- State transitions
|
|
214
|
+
- Event collection after state change
|
|
215
|
+
- Guard methods
|
|
216
|
+
- Edge cases (boundary values)
|
|
217
|
+
|
|
218
|
+
### 6.3 UseCase Tests
|
|
219
|
+
- Mock port interfaces
|
|
220
|
+
- Happy path for each method
|
|
221
|
+
- Validation errors
|
|
222
|
+
- Business rules
|
|
223
|
+
- Event dispatching
|
|
224
|
+
|
|
225
|
+
### Rule Check Phase 6
|
|
226
|
+
```bash
|
|
227
|
+
# Run domain tests
|
|
228
|
+
{stack_test_command_for_domain}
|
|
229
|
+
```
|
|
221
230
|
|
|
222
231
|
---
|
|
223
232
|
|
|
224
|
-
##
|
|
233
|
+
## REVIEW LOOP
|
|
225
234
|
|
|
226
|
-
**
|
|
235
|
+
After all phases complete, run the architecture review. **Keep looping until ALL checks pass.**
|
|
227
236
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
237
|
+
```
|
|
238
|
+
LOOP:
|
|
239
|
+
1. Run /architect-review {stack} {domain}
|
|
240
|
+
2. Collect violations
|
|
241
|
+
3. IF violations with severity >= MEDIUM:
|
|
242
|
+
a. Fix all violations
|
|
243
|
+
b. Run build to verify
|
|
244
|
+
c. Run tests to verify
|
|
245
|
+
d. GOTO 1
|
|
246
|
+
4. IF score >= B:
|
|
247
|
+
BREAK → Final Report
|
|
248
|
+
```
|
|
234
249
|
|
|
235
|
-
|
|
236
|
-
```bash
|
|
237
|
-
# Use test command from architecture doc
|
|
238
|
-
flutter test # Flutter
|
|
239
|
-
go test ./... # Go
|
|
240
|
-
bun test # React/Remix
|
|
241
|
-
php artisan test # Laravel
|
|
242
|
-
```
|
|
250
|
+
---
|
|
243
251
|
|
|
244
|
-
|
|
245
|
-
- [ ] Tests follow architecture doc patterns
|
|
246
|
-
- [ ] All tests pass
|
|
247
|
-
- [ ] Coverage acceptable
|
|
252
|
+
## Final Report
|
|
248
253
|
|
|
249
|
-
|
|
250
|
-
If tests fail → Return to IMPLEMENT → Fix → Re-test
|
|
254
|
+
When review loop passes:
|
|
251
255
|
|
|
252
|
-
|
|
256
|
+
```markdown
|
|
257
|
+
## Feature Complete: {domain}/{feature}
|
|
253
258
|
|
|
254
|
-
|
|
259
|
+
### Files Created
|
|
260
|
+
- List all new files
|
|
255
261
|
|
|
256
|
-
|
|
262
|
+
### Files Modified
|
|
263
|
+
- List all modified files
|
|
257
264
|
|
|
258
|
-
###
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
- [ ] Code formatted (use formatter from doc)
|
|
262
|
-
- [ ] No TODO comments left
|
|
265
|
+
### Endpoints/Screens (depending on stack)
|
|
266
|
+
| Method/Route | Description |
|
|
267
|
+
|-------------|-------------|
|
|
263
268
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
git commit -m "feat: [feature description]"
|
|
268
|
-
```
|
|
269
|
+
### Domain Events
|
|
270
|
+
| Event | Listeners |
|
|
271
|
+
|-------|-----------|
|
|
269
272
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
```
|
|
273
|
+
### Test Coverage
|
|
274
|
+
- X test files, Y test functions
|
|
275
|
+
- Areas covered: value objects, entities, usecases
|
|
274
276
|
|
|
275
|
-
###
|
|
276
|
-
-
|
|
277
|
-
-
|
|
278
|
-
-
|
|
279
|
-
-
|
|
277
|
+
### Review Status: ALL CHECKS PASS
|
|
278
|
+
- Build: PASS
|
|
279
|
+
- Lint: PASS
|
|
280
|
+
- Domain purity: PASS
|
|
281
|
+
- Tests: PASS (X/X)
|
|
282
|
+
- Architecture score: {A/B}
|
|
283
|
+
```
|
|
280
284
|
|
|
281
285
|
---
|
|
282
286
|
|
|
283
|
-
##
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
|
289
|
-
|
|
|
290
|
-
|
|
|
291
|
-
|
|
|
292
|
-
|
|
|
293
|
-
|
|
|
294
|
-
| Monorepo | `monorepo.md` |
|
|
295
|
-
|
|
296
|
-
### Phase Summary
|
|
297
|
-
| Phase | Key Actions |
|
|
298
|
-
|-------|-------------|
|
|
299
|
-
| PLAN | Read arch doc, clarify, breakdown |
|
|
300
|
-
| DESIGN | Design per arch doc |
|
|
301
|
-
| IMPLEMENT | Code per arch doc |
|
|
302
|
-
| REVIEW | Check arch compliance |
|
|
303
|
-
| TEST | Test per arch doc patterns |
|
|
304
|
-
| COMPLETE | Commit, PR |
|
|
305
|
-
|
|
306
|
-
### When to Loop Back
|
|
307
|
-
- **REVIEW fails** → Return to IMPLEMENT
|
|
308
|
-
- **TEST fails** → Return to IMPLEMENT
|
|
309
|
-
- **Requirements change** → Return to PLAN
|
|
310
|
-
|
|
311
|
-
### Success Criteria
|
|
312
|
-
Feature is complete when:
|
|
313
|
-
1. Follows architecture doc
|
|
314
|
-
2. All acceptance criteria met
|
|
315
|
-
3. All tests passing
|
|
316
|
-
4. Code review passed
|
|
317
|
-
5. Committed/PR created
|
|
287
|
+
## Recommended Agents
|
|
288
|
+
|
|
289
|
+
| Phase | Agent | Purpose |
|
|
290
|
+
|-------|-------|---------|
|
|
291
|
+
| PLAN | `@clean-architect` | Architecture design |
|
|
292
|
+
| IMPLEMENT | Stack-specific dev agent | Code per architecture |
|
|
293
|
+
| IMPLEMENT | `@db-designer` | Database schema |
|
|
294
|
+
| IMPLEMENT | `@api-designer` | API design |
|
|
295
|
+
| REVIEW | `@code-reviewer` | Code quality |
|
|
296
|
+
| REVIEW | `@security-audit` | Security check |
|
|
297
|
+
| TEST | `@test-writer` | Write tests |
|