@uoyo/mvtt 2.0.0-beta.0 → 2.0.0-beta.2

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 (151) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +194 -209
  3. package/dist/build/assembler.d.ts.map +1 -1
  4. package/dist/build/assembler.js +2 -0
  5. package/dist/build/assembler.js.map +1 -1
  6. package/dist/build/plan-validator.d.ts +26 -0
  7. package/dist/build/plan-validator.d.ts.map +1 -0
  8. package/dist/build/plan-validator.js +225 -0
  9. package/dist/build/plan-validator.js.map +1 -0
  10. package/dist/build/section-loader.d.ts.map +1 -1
  11. package/dist/build/section-loader.js +45 -9
  12. package/dist/build/section-loader.js.map +1 -1
  13. package/dist/cli.d.ts.map +1 -1
  14. package/dist/cli.js +2 -11
  15. package/dist/cli.js.map +1 -1
  16. package/dist/commands/doctor.d.ts.map +1 -1
  17. package/dist/commands/doctor.js +0 -1
  18. package/dist/commands/doctor.js.map +1 -1
  19. package/dist/commands/install.d.ts +1 -4
  20. package/dist/commands/install.d.ts.map +1 -1
  21. package/dist/commands/install.js +18 -14
  22. package/dist/commands/install.js.map +1 -1
  23. package/dist/commands/migrate.d.ts +16 -0
  24. package/dist/commands/migrate.d.ts.map +1 -0
  25. package/dist/commands/migrate.js +118 -0
  26. package/dist/commands/migrate.js.map +1 -0
  27. package/dist/commands/update.d.ts.map +1 -1
  28. package/dist/commands/update.js +35 -2
  29. package/dist/commands/update.js.map +1 -1
  30. package/dist/fs/core-manifest.d.ts +17 -0
  31. package/dist/fs/core-manifest.d.ts.map +1 -0
  32. package/dist/fs/core-manifest.js +76 -0
  33. package/dist/fs/core-manifest.js.map +1 -0
  34. package/dist/fs/install-manifest.d.ts +1 -2
  35. package/dist/fs/install-manifest.d.ts.map +1 -1
  36. package/dist/fs/install-manifest.js +1 -2
  37. package/dist/fs/install-manifest.js.map +1 -1
  38. package/dist/fs/materialize.d.ts.map +1 -1
  39. package/dist/fs/materialize.js +23 -3
  40. package/dist/fs/materialize.js.map +1 -1
  41. package/dist/types/core-manifest.d.ts +12 -0
  42. package/dist/types/core-manifest.d.ts.map +1 -0
  43. package/dist/types/core-manifest.js +2 -0
  44. package/dist/types/core-manifest.js.map +1 -0
  45. package/dist/types/registry.d.ts +13 -5
  46. package/dist/types/registry.d.ts.map +1 -1
  47. package/install-manifest.yaml +31 -27
  48. package/package.json +57 -57
  49. package/registry.yaml +198 -209
  50. package/sources/defaults/config.yaml +27 -30
  51. package/sources/defaults/project-context.yaml +15 -26
  52. package/sources/defaults/session.yaml +31 -23
  53. package/sources/knowledge/core/manifest.yaml +4 -45
  54. package/sources/sections/activation-load-config.md +11 -5
  55. package/sources/sections/activation-load-context.md +26 -11
  56. package/sources/sections/activation-preflight.md +14 -4
  57. package/sources/sections/footer-next-steps.md +35 -9
  58. package/sources/sections/output-language-constraint.md +11 -0
  59. package/sources/sections/role-header.md +13 -13
  60. package/sources/sections/session-update.md +47 -0
  61. package/sources/skills/mvt-analyze/business.md +69 -33
  62. package/sources/skills/mvt-analyze/manifest.yaml +90 -89
  63. package/sources/skills/mvt-analyze-code/business.md +82 -35
  64. package/sources/skills/mvt-analyze-code/manifest.yaml +96 -88
  65. package/sources/skills/mvt-bug-detect/business.md +101 -0
  66. package/sources/skills/mvt-bug-detect/manifest.yaml +84 -0
  67. package/sources/skills/mvt-check-context/business.md +89 -42
  68. package/sources/skills/mvt-check-context/manifest.yaml +63 -74
  69. package/sources/skills/mvt-cleanup/business.md +80 -31
  70. package/sources/skills/mvt-cleanup/manifest.yaml +85 -93
  71. package/sources/skills/mvt-config/business.md +94 -26
  72. package/sources/skills/mvt-config/manifest.yaml +96 -108
  73. package/sources/skills/mvt-create-skill/business.md +231 -111
  74. package/sources/skills/mvt-create-skill/manifest.yaml +91 -79
  75. package/sources/skills/mvt-design/business.md +116 -34
  76. package/sources/skills/mvt-design/manifest.yaml +96 -105
  77. package/sources/skills/mvt-fix/business.md +132 -28
  78. package/sources/skills/mvt-fix/manifest.yaml +85 -86
  79. package/sources/skills/mvt-help/business.md +74 -70
  80. package/sources/skills/mvt-help/manifest.yaml +67 -61
  81. package/sources/skills/mvt-implement/business.md +91 -32
  82. package/sources/skills/mvt-implement/manifest.yaml +80 -96
  83. package/sources/skills/mvt-init/business.md +164 -49
  84. package/sources/skills/mvt-init/manifest.yaml +101 -93
  85. package/sources/skills/mvt-manage-context/business.md +175 -0
  86. package/sources/skills/mvt-manage-context/manifest.yaml +123 -0
  87. package/sources/skills/mvt-plan-dev/business.md +75 -0
  88. package/sources/skills/mvt-plan-dev/manifest.yaml +91 -0
  89. package/sources/skills/mvt-quick-dev/business.md +99 -0
  90. package/sources/skills/mvt-quick-dev/manifest.yaml +69 -0
  91. package/sources/skills/mvt-refactor/business.md +104 -33
  92. package/sources/skills/mvt-refactor/manifest.yaml +86 -101
  93. package/sources/skills/mvt-resume/business.md +137 -0
  94. package/sources/skills/mvt-resume/manifest.yaml +71 -0
  95. package/sources/skills/mvt-review/business.md +112 -49
  96. package/sources/skills/mvt-review/manifest.yaml +87 -106
  97. package/sources/skills/mvt-status/business.md +71 -24
  98. package/sources/skills/mvt-status/manifest.yaml +66 -74
  99. package/sources/skills/mvt-sync-context/business.md +150 -25
  100. package/sources/skills/mvt-sync-context/manifest.yaml +96 -84
  101. package/sources/skills/mvt-template/business.md +96 -49
  102. package/sources/skills/mvt-template/manifest.yaml +63 -71
  103. package/sources/skills/mvt-test/business.md +104 -36
  104. package/sources/skills/mvt-test/manifest.yaml +102 -111
  105. package/sources/skills/mvt-update-plan/business.md +72 -0
  106. package/sources/skills/mvt-update-plan/manifest.yaml +132 -0
  107. package/sources/templates/analyze-output/body.md +15 -38
  108. package/sources/templates/analyze-output/manifest.yaml +11 -11
  109. package/sources/templates/design-output/body.md +17 -50
  110. package/sources/templates/design-output/manifest.yaml +11 -11
  111. package/sources/templates/implement-output/body.md +11 -32
  112. package/sources/templates/implement-output/manifest.yaml +11 -11
  113. package/sources/templates/project-context/body.md +13 -0
  114. package/sources/templates/project-context/manifest.yaml +12 -0
  115. package/sources/templates/review-output/body.md +11 -45
  116. package/sources/templates/review-output/manifest.yaml +11 -11
  117. package/sources/templates/test-output/body.md +7 -31
  118. package/sources/templates/test-output/manifest.yaml +11 -11
  119. package/dist/fs/protection.d.ts +0 -15
  120. package/dist/fs/protection.d.ts.map +0 -1
  121. package/dist/fs/protection.js +0 -16
  122. package/dist/fs/protection.js.map +0 -1
  123. package/sources/knowledge/core/review-principles.md +0 -51
  124. package/sources/knowledge/patterns/clean-architecture/manifest.yaml +0 -66
  125. package/sources/knowledge/patterns/clean-architecture/review-checklist.md +0 -230
  126. package/sources/knowledge/patterns/ddd/manifest.yaml +0 -83
  127. package/sources/knowledge/patterns/ddd/review-checklist.md +0 -226
  128. package/sources/knowledge/patterns/ddd/tactical-patterns.md +0 -12
  129. package/sources/knowledge/patterns/frontend-react/manifest.yaml +0 -44
  130. package/sources/knowledge/patterns/frontend-react/review-checklist.md +0 -78
  131. package/sources/knowledge/patterns/manifest.yaml +0 -113
  132. package/sources/skills/mvt-add-context/business.md +0 -47
  133. package/sources/skills/mvt-add-context/manifest.yaml +0 -83
  134. package/sources/templates/analyze-code-output/body.md +0 -44
  135. package/sources/templates/analyze-code-output/manifest.yaml +0 -11
  136. package/sources/templates/cleanup-output/body.md +0 -9
  137. package/sources/templates/cleanup-output/manifest.yaml +0 -11
  138. package/sources/templates/config-output/body.md +0 -11
  139. package/sources/templates/config-output/manifest.yaml +0 -11
  140. package/sources/templates/context-check-output/body.md +0 -32
  141. package/sources/templates/context-check-output/manifest.yaml +0 -11
  142. package/sources/templates/fix-output/body.md +0 -30
  143. package/sources/templates/fix-output/manifest.yaml +0 -11
  144. package/sources/templates/init-output/body.md +0 -34
  145. package/sources/templates/init-output/manifest.yaml +0 -11
  146. package/sources/templates/refactor-output/body.md +0 -32
  147. package/sources/templates/refactor-output/manifest.yaml +0 -11
  148. package/sources/templates/status-output/body.md +0 -36
  149. package/sources/templates/status-output/manifest.yaml +0 -11
  150. package/sources/templates/sync-context-output/body.md +0 -16
  151. package/sources/templates/sync-context-output/manifest.yaml +0 -11
@@ -1,51 +0,0 @@
1
- # Code Review Principles
2
-
3
- Actionable checklist for reviewing code quality. Use during `#review` and as reference during `#implement`.
4
-
5
- ## Naming & Readability
6
-
7
- - [ ] Classes/functions named by **what they do**, not how they do it
8
- - [ ] No abbreviations unless universally understood (e.g., `id`, `url`, `http`)
9
- - [ ] Boolean variables/methods start with `is`, `has`, `can`, `should`
10
- - [ ] Collections named as plural nouns; single items as singular
11
- - [ ] No "Manager", "Helper", "Utils" god-classes — split by responsibility
12
-
13
- ## Single Responsibility
14
-
15
- - [ ] Each class/module has **one reason to change**
16
- - [ ] Functions do **one thing** and are ≤ 30 lines (guideline, not hard rule)
17
- - [ ] If you need "and" to describe what a function does → split it
18
-
19
- ## Dependency Direction
20
-
21
- - [ ] Business logic does NOT import framework/infrastructure code
22
- - [ ] Dependencies point **inward** (infrastructure → application → domain)
23
- - [ ] External services accessed through **interfaces/abstractions**
24
- - [ ] No circular dependencies between modules
25
-
26
- ## Error Handling
27
-
28
- - [ ] Errors are handled at the **appropriate level** (not swallowed silently)
29
- - [ ] Fail fast: validate inputs at entry points
30
- - [ ] No empty catch blocks
31
- - [ ] Error messages include **context** (what failed, why, what to do)
32
-
33
- ## Duplication & Abstraction
34
-
35
- - [ ] No copy-paste blocks — extract shared logic into functions
36
- - [ ] But: don't merge similar-looking code that changes for **different reasons**
37
- - [ ] Abstractions are justified by **current** requirements, not hypothetical ones
38
- - [ ] No dead code or commented-out blocks
39
-
40
- ## State & Side Effects
41
-
42
- - [ ] Mutable state is **minimized** and localized
43
- - [ ] Functions clearly indicate whether they have side effects
44
- - [ ] No hidden global state mutations
45
- - [ ] Concurrent access to shared state is protected
46
-
47
- ## Testing Indicators
48
-
49
- - [ ] Public API has clear contracts that are testable
50
- - [ ] Dependencies are injectable (not hard-coded `new`)
51
- - [ ] No logic in constructors that makes testing difficult
@@ -1,66 +0,0 @@
1
- id: "clean-architecture"
2
- type: "pattern"
3
- name: "Clean Architecture"
4
- version: "1.0"
5
- description: "Robert C. Martin's Clean Architecture for testable, maintainable systems"
6
-
7
- token_estimate:
8
- total: 800
9
- breakdown:
10
- - file: review-checklist.md
11
- tokens: 800
12
- load_priority: 1
13
- summary: "Clean Architecture compliance checklist"
14
-
15
- loading_strategy:
16
- level_1_manifest_only:
17
- tokens: 150
18
- use_case: "Check available Clean Architecture patterns"
19
-
20
- level_2_full:
21
- tokens: 800
22
- use_case: "Complete Clean Architecture review guidance"
23
-
24
- loading:
25
- priority: 10
26
- auto_load: false
27
-
28
- files:
29
- - path: "review-checklist.md"
30
- description: "Checklist for reviewing code against Clean Architecture"
31
- required: true
32
- tokens: 800
33
-
34
- attributes:
35
- terminology:
36
- entity: "Entity"
37
- use_case: "Use Case"
38
- interface_adapter: "Interface Adapter"
39
- framework: "Framework"
40
- boundary: "Boundary"
41
- presenter: "Presenter"
42
- controller: "Controller"
43
- gateway: "Gateway"
44
- request_model: "Request Model"
45
- response_model: "Response Model"
46
- view_model: "View Model"
47
-
48
- checklist:
49
- - "Dependencies point inward"
50
- - "Entities are pure business objects"
51
- - "Use Cases contain application logic"
52
- - "Interfaces defined by inner layer"
53
- - "Frameworks are details"
54
- - "Database is a detail"
55
- - "UI is a detail"
56
- - "Testable without external dependencies"
57
-
58
- scenarios:
59
- - name: "Design application architecture"
60
- files: ["overview.md"]
61
-
62
- - name: "Code review"
63
- files: ["review-checklist.md"]
64
-
65
- - name: "Understand layer separation"
66
- files: ["overview.md"]
@@ -1,230 +0,0 @@
1
- # Clean Architecture Review Checklist
2
-
3
- Specific review criteria for Clean Architecture implementations.
4
-
5
- ## The Dependency Rule
6
-
7
- ### Inward Dependencies
8
-
9
- - [ ] Entities have no outward dependencies
10
- - [ ] Use Cases depend only on Entities
11
- - [ ] Interface Adapters depend on Use Cases/Entities
12
- - [ ] Frameworks only depend on Interface Adapters
13
-
14
- ### No Circular Dependencies
15
-
16
- - [ ] Inner layers don't reference outer layers
17
- - [ ] No imports from outer to inner
18
- - [ ] Abstractions defined in inner layer
19
- - [ ] Implementations provided by outer layer
20
-
21
- ---
22
-
23
- ## Entities Layer
24
-
25
- ### Purity
26
-
27
- - [ ] No framework dependencies
28
- - [ ] No database annotations
29
- - [ ] No external library imports
30
- - [ ] Pure business objects
31
-
32
- ### Business Rules
33
-
34
- - [ ] Critical business rules in entities
35
- - [ ] Enterprise-wide rules captured
36
- - [ ] Behavior, not just data
37
- - [ ] Reusable across applications
38
-
39
- ### Independence
40
-
41
- - [ ] Would exist without application
42
- - [ ] Not affected by use case changes
43
- - [ ] Not affected by UI changes
44
- - [ ] Not affected by database changes
45
-
46
- ---
47
-
48
- ## Use Cases Layer
49
-
50
- ### Application Logic
51
-
52
- - [ ] Application-specific rules here
53
- - [ ] Orchestrates entity behavior
54
- - [ ] Coordinates data flow
55
- - [ ] Single responsibility per use case
56
-
57
- ### Interface Definitions
58
-
59
- - [ ] Input/Output ports defined here
60
- - [ ] Repository interfaces defined here
61
- - [ ] External service interfaces defined here
62
- - [ ] Inner layer controls contracts
63
-
64
- ### Data Flow
65
-
66
- - [ ] Request models for input
67
- - [ ] Response models for output
68
- - [ ] No framework objects cross boundaries
69
- - [ ] Simple data structures at boundaries
70
-
71
- ---
72
-
73
- ## Interface Adapters Layer
74
-
75
- ### Controllers
76
-
77
- - [ ] Receives external input
78
- - [ ] Converts to use case format
79
- - [ ] No business logic
80
- - [ ] Thin layer
81
-
82
- ### Presenters
83
-
84
- - [ ] Formats use case output
85
- - [ ] Creates view models
86
- - [ ] No business logic
87
- - [ ] UI-specific formatting only
88
-
89
- ### Gateways
90
-
91
- - [ ] Implements interfaces from use cases
92
- - [ ] Converts external data formats
93
- - [ ] Handles external system details
94
- - [ ] Abstracts infrastructure
95
-
96
- ### Repository Implementations
97
-
98
- - [ ] Implements domain interfaces
99
- - [ ] Handles persistence details
100
- - [ ] Converts between domain and persistence models
101
- - [ ] No business logic
102
-
103
- ---
104
-
105
- ## Frameworks Layer
106
-
107
- ### Framework Isolation
108
-
109
- - [ ] Framework code contained here
110
- - [ ] Not leaking into inner layers
111
- - [ ] Configuration in this layer
112
- - [ ] Easy to replace framework
113
-
114
- ### Database
115
-
116
- - [ ] Treated as a detail
117
- - [ ] Repository implementations here
118
- - [ ] ORM configuration here
119
- - [ ] No SQL in inner layers
120
-
121
- ### UI Framework
122
-
123
- - [ ] Treated as a detail
124
- - [ ] Views/components here
125
- - [ ] Routing configuration here
126
- - [ ] No UI logic in inner layers
127
-
128
- ---
129
-
130
- ## Boundary Crossing
131
-
132
- ### Data Transfer
133
-
134
- - [ ] Simple data structures cross boundaries
135
- - [ ] No entity leakage to outer layers
136
- - [ ] Request/Response models used
137
- - [ ] Mapping at boundaries
138
-
139
- ### Dependency Inversion
140
-
141
- - [ ] Inner layer defines interfaces
142
- - [ ] Outer layer implements
143
- - [ ] Injection at composition root
144
- - [ ] No new operator for implementations in inner layers
145
-
146
- ---
147
-
148
- ## Testability
149
-
150
- ### Unit Testing
151
-
152
- - [ ] Entities testable without mocks
153
- - [ ] Use cases testable with mock gateways
154
- - [ ] No framework needed for core tests
155
- - [ ] Fast execution
156
-
157
- ### Integration Testing
158
-
159
- - [ ] Can test with real implementations
160
- - [ ] Boundaries make integration clear
161
- - [ ] External systems mockable
162
- - [ ] End-to-end scenarios testable
163
-
164
- ---
165
-
166
- ## Code Organization
167
-
168
- ### Package/Namespace Structure
169
-
170
- - [ ] Clear separation by layer
171
- - [ ] Consistent naming convention
172
- - [ ] Easy to locate code
173
- - [ ] Dependencies visible in imports
174
-
175
- ### Module Boundaries
176
-
177
- - [ ] Modules respect layer boundaries
178
- - [ ] Inter-module dependencies follow rules
179
- - [ ] Clear public APIs per module
180
- - [ ] Internal details hidden
181
-
182
- ---
183
-
184
- ## Anti-Patterns to Watch
185
-
186
- ### Dependency Violations
187
-
188
- - [ ] No direct database access in use cases
189
- - [ ] No framework objects in entities
190
- - [ ] No UI concerns in business logic
191
- - [ ] No outward dependencies from core
192
-
193
- ### Bloated Layers
194
-
195
- - [ ] Controllers are thin
196
- - [ ] Use cases are focused
197
- - [ ] No "god" objects
198
- - [ ] Single responsibility maintained
199
-
200
- ### Missing Abstraction
201
-
202
- - [ ] External services behind interfaces
203
- - [ ] Database behind repositories
204
- - [ ] Third-party libraries wrapped
205
- - [ ] Detail changes don't affect core
206
-
207
- ---
208
-
209
- ## Severity Levels
210
-
211
- ### Critical
212
-
213
- - Dependencies point outward (violates core rule)
214
- - Business logic in controllers/presenters
215
- - Framework leakage into entities
216
- - Direct database access in use cases
217
-
218
- ### Major
219
-
220
- - Missing boundary interfaces
221
- - Use case doing too much
222
- - Entity with infrastructure concerns
223
- - Circular dependencies
224
-
225
- ### Minor
226
-
227
- - Inconsistent layer naming
228
- - Missing mapping at boundary
229
- - Test depends on framework
230
- - Response model too complex
@@ -1,83 +0,0 @@
1
- id: "ddd"
2
- type: "pattern"
3
- name: "Domain-Driven Design"
4
- version: "1.0"
5
- description: "Tactical and strategic patterns for complex domain modeling"
6
-
7
- token_estimate:
8
- total: 1400
9
- breakdown:
10
- - file: tactical-patterns.md
11
- tokens: 800
12
- load_priority: 1
13
- summary: "DDD key rules"
14
- - file: review-checklist.md
15
- tokens: 600
16
- load_priority: 2
17
- summary: "DDD compliance checklist"
18
-
19
- loading_strategy:
20
- level_1_overview:
21
- description: "Read manifest only for summary"
22
- tokens: 150
23
- use_case: "Check available DDD patterns"
24
-
25
- level_2_full:
26
- description: "Load complete knowledge files"
27
- tokens: 1400
28
- use_case: "Complete DDD implementation guidance"
29
-
30
- loading:
31
- priority: 10
32
- auto_load: false
33
-
34
- files:
35
- - path: "tactical-patterns.md"
36
- description: "Key rules for DDD building blocks"
37
- required: true
38
- tokens: 800
39
-
40
- - path: "review-checklist.md"
41
- description: "Checklist for reviewing DDD code"
42
- required: false
43
- tokens: 600
44
-
45
- attributes:
46
- terminology:
47
- aggregate: "Aggregate"
48
- aggregate_root: "Aggregate Root"
49
- entity: "Entity"
50
- value_object: "Value Object"
51
- domain_event: "Domain Event"
52
- domain_service: "Domain Service"
53
- repository: "Repository"
54
- factory: "Factory"
55
- bounded_context: "Bounded Context"
56
- ubiquitous_language: "Ubiquitous Language"
57
- context_map: "Context Map"
58
- anti_corruption_layer: "Anti-Corruption Layer"
59
- shared_kernel: "Shared Kernel"
60
- customer_supplier: "Customer-Supplier"
61
-
62
- checklist:
63
- - "Aggregate boundaries protect invariants"
64
- - "Entities have identity and lifecycle"
65
- - "Value objects are immutable"
66
- - "Domain events capture state changes"
67
- - "Repositories only for aggregates"
68
- - "No anemic domain models"
69
- - "Business logic in domain layer"
70
- - "Ubiquitous language used consistently"
71
-
72
- scenarios:
73
- - name: "Design domain model"
74
- files: ["overview.md", "tactical-patterns.md"]
75
-
76
- - name: "Code review"
77
- files: ["review-checklist.md"]
78
-
79
- - name: "Understand DDD concepts"
80
- files: ["overview.md"]
81
-
82
- - name: "Event-driven design"
83
- files: ["tactical-patterns.md"]
@@ -1,226 +0,0 @@
1
- # DDD Review Checklist
2
-
3
- Specific review criteria for Domain-Driven Design implementations.
4
-
5
- ## Aggregate Design
6
-
7
- ### Boundaries
8
-
9
- - [ ] Aggregate boundaries align with consistency requirements
10
- - [ ] Aggregates are as small as possible
11
- - [ ] Cross-aggregate references are by ID, not object reference
12
- - [ ] Each aggregate can be persisted independently
13
-
14
- ### Root Entity
15
-
16
- - [ ] Only the root is accessible from outside
17
- - [ ] Root enforces all aggregate invariants
18
- - [ ] Root controls access to internal entities
19
- - [ ] External changes go through root methods
20
-
21
- ### Invariants
22
-
23
- - [ ] All business rules enforced within aggregate
24
- - [ ] Invalid state cannot be created
25
- - [ ] Invariants checked on every state change
26
- - [ ] Constructors/factories ensure valid initial state
27
-
28
- ---
29
-
30
- ## Entity Design
31
-
32
- ### Identity
33
-
34
- - [ ] Entity has clear identity
35
- - [ ] ID type is appropriate (Guid, long, etc.)
36
- - [ ] ID generation strategy is defined
37
- - [ ] Equality based on ID
38
-
39
- ### Encapsulation
40
-
41
- - [ ] Private setters for properties
42
- - [ ] State changes through methods
43
- - [ ] No direct collection manipulation
44
- - [ ] Internal state properly protected
45
-
46
- ### Behavior
47
-
48
- - [ ] Rich behavior, not just data
49
- - [ ] Methods named using domain language
50
- - [ ] Business logic in entity, not services
51
- - [ ] Validation in business methods
52
-
53
- ---
54
-
55
- ## Value Object Design
56
-
57
- ### Immutability
58
-
59
- - [ ] All properties are readonly
60
- - [ ] No methods that modify state
61
- - [ ] "Modification" returns new instance
62
- - [ ] Thread-safe by design
63
-
64
- ### Equality
65
-
66
- - [ ] Equality based on all attributes
67
- - [ ] GetHashCode implemented correctly
68
- - [ ] Equals handles null properly
69
- - [ ] Consistent with domain semantics
70
-
71
- ### Validation
72
-
73
- - [ ] Validated in constructor
74
- - [ ] Invalid values throw exceptions
75
- - [ ] No partial/invalid instances possible
76
- - [ ] Error messages are meaningful
77
-
78
- ---
79
-
80
- ## Domain Event Design
81
-
82
- ### Structure
83
-
84
- - [ ] Named in past tense
85
- - [ ] Contains all relevant context
86
- - [ ] Immutable after creation
87
- - [ ] Includes timestamp
88
-
89
- ### Usage
90
-
91
- - [ ] Events raised when significant things happen
92
- - [ ] Events capture business meaning
93
- - [ ] Handlers don't modify originating aggregate
94
- - [ ] Event naming uses ubiquitous language
95
-
96
- ---
97
-
98
- ## Repository Design
99
-
100
- ### Interface
101
-
102
- - [ ] Interface defined in Domain layer
103
- - [ ] One repository per aggregate type
104
- - [ ] Methods use domain language
105
- - [ ] Returns domain objects, not persistence entities
106
-
107
- ### Implementation
108
-
109
- - [ ] Implementation in Infrastructure layer
110
- - [ ] Abstract persistence details
111
- - [ ] Handle concurrency appropriately
112
- - [ ] Efficient queries for use cases
113
-
114
- ---
115
-
116
- ## Domain Service Design
117
-
118
- ### Responsibility
119
-
120
- - [ ] Stateless operations only
121
- - [ ] Clear reason why not in an entity
122
- - [ ] Named using domain language
123
- - [ ] Single responsibility
124
-
125
- ### Dependencies
126
-
127
- - [ ] Depends on interfaces, not implementations
128
- - [ ] Can be injected
129
- - [ ] Doesn't hold state between calls
130
- - [ ] Accesses aggregates through repositories
131
-
132
- ---
133
-
134
- ## Layer Architecture
135
-
136
- ### Domain Layer
137
-
138
- - [ ] Contains entities, value objects, domain services
139
- - [ ] No dependencies on infrastructure
140
- - [ ] No framework annotations (if possible)
141
- - [ ] Pure business logic only
142
-
143
- ### Application Layer
144
-
145
- - [ ] Orchestrates domain objects
146
- - [ ] Handles transactions
147
- - [ ] No business logic here
148
- - [ ] Coordinates between aggregates
149
-
150
- ### Infrastructure Layer
151
-
152
- - [ ] Repository implementations
153
- - [ ] External service integrations
154
- - [ ] Framework-specific code
155
- - [ ] Depends on domain layer
156
-
157
- ---
158
-
159
- ## Ubiquitous Language
160
-
161
- ### Naming
162
-
163
- - [ ] Code uses domain terminology
164
- - [ ] Same terms as domain experts
165
- - [ ] Consistent across codebase
166
- - [ ] Reflects actual business concepts
167
-
168
- ### Documentation
169
-
170
- - [ ] Domain concepts documented
171
- - [ ] Glossary maintained
172
- - [ ] Code comments use domain language
173
- - [ ] Team understands terminology
174
-
175
- ---
176
-
177
- ## Anti-Patterns to Watch
178
-
179
- ### Anemic Domain Model
180
-
181
- - [ ] Entities have behavior, not just data
182
- - [ ] Business logic not in services alone
183
- - [ ] Domain objects are more than DTOs
184
-
185
- ### Big Ball of Mud
186
-
187
- - [ ] Clear bounded contexts
188
- - [ ] Explicit boundaries
189
- - [ ] Context relationships defined
190
-
191
- ### God Aggregate
192
-
193
- - [ ] Aggregates are focused
194
- - [ ] Not too many entities
195
- - [ ] Clear consistency needs
196
-
197
- ### Repository for Non-Aggregates
198
-
199
- - [ ] Repositories only for aggregate roots
200
- - [ ] No repositories for entities within aggregates
201
- - [ ] No repositories for value objects
202
-
203
- ---
204
-
205
- ## Severity Levels for DDD Issues
206
-
207
- ### Critical
208
-
209
- - Aggregate boundaries don't protect invariants
210
- - Business rules can be bypassed
211
- - Invalid domain state possible
212
- - Security vulnerabilities through domain bypass
213
-
214
- ### Major
215
-
216
- - Anemic domain model
217
- - Repository for non-aggregate
218
- - Business logic in wrong layer
219
- - Missing domain events for important occurrences
220
-
221
- ### Minor
222
-
223
- - Naming doesn't match ubiquitous language
224
- - Aggregate slightly too large
225
- - Value object could be extracted
226
- - Event naming not in past tense
@@ -1,12 +0,0 @@
1
- # DDD Tactical Patterns — Key Rules
2
-
3
- Quick reference for key rules when applying DDD.
4
-
5
- ## Key Rules
6
-
7
- 1. **One repository per aggregate root** — never for child entities
8
- 2. **Reference other aggregates by ID** — not by object reference
9
- 3. **Keep aggregates small** — only include what must be immediately consistent
10
- 4. **Domain layer has zero infrastructure imports** — dependency inversion
11
- 5. **Events are immutable facts** — include all context needed to understand what happened
12
- 6. **Value Objects validate in constructor** — always valid or not created
@@ -1,44 +0,0 @@
1
- id: "frontend-react"
2
- type: "pattern"
3
- name: "Frontend (React)"
4
- version: "1.0"
5
- description: "Modern React frontend application patterns"
6
-
7
- token_estimate:
8
- total: 3000
9
- breakdown:
10
- - file: review-checklist.md
11
- tokens: 800
12
- load_priority: 3
13
- summary: "React code review checklist"
14
-
15
- loading_strategy:
16
- level_1_manifest_only:
17
- tokens: 150
18
- use_case: "Check React pattern info"
19
-
20
- files:
21
- - path: "review-checklist.md"
22
- description: "React code review checklist"
23
- required: false
24
- tokens: 800
25
-
26
- scenarios:
27
- - name: "Code review"
28
- files: ["review-checklist.md"]
29
-
30
- applicable_project_types:
31
- - web-app
32
- - spa
33
- - pwa
34
-
35
- frameworks:
36
- - react
37
- - next.js
38
- - remix
39
- - vite-react
40
-
41
- not_recommended_for:
42
- - backend-api
43
- - cli
44
- - library (unless UI library)