specsmd 0.0.1
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 +300 -0
- package/bin/cli.js +21 -0
- package/flows/aidlc/README.md +372 -0
- package/flows/aidlc/agents/construction-agent.md +81 -0
- package/flows/aidlc/agents/inception-agent.md +95 -0
- package/flows/aidlc/agents/master-agent.md +61 -0
- package/flows/aidlc/agents/operations-agent.md +89 -0
- package/flows/aidlc/commands/construction-agent.md +63 -0
- package/flows/aidlc/commands/inception-agent.md +55 -0
- package/flows/aidlc/commands/master-agent.md +47 -0
- package/flows/aidlc/commands/operations-agent.md +77 -0
- package/flows/aidlc/context-config.yaml +41 -0
- package/flows/aidlc/memory-bank.yaml +104 -0
- package/flows/aidlc/quick-start.md +315 -0
- package/flows/aidlc/skills/construction/bolt-list.md +163 -0
- package/flows/aidlc/skills/construction/bolt-replan.md +343 -0
- package/flows/aidlc/skills/construction/bolt-start.md +289 -0
- package/flows/aidlc/skills/construction/bolt-status.md +185 -0
- package/flows/aidlc/skills/construction/navigator.md +196 -0
- package/flows/aidlc/skills/inception/bolt-plan.md +338 -0
- package/flows/aidlc/skills/inception/context.md +171 -0
- package/flows/aidlc/skills/inception/intent-create.md +211 -0
- package/flows/aidlc/skills/inception/intent-list.md +124 -0
- package/flows/aidlc/skills/inception/navigator.md +207 -0
- package/flows/aidlc/skills/inception/requirements.md +227 -0
- package/flows/aidlc/skills/inception/review.md +248 -0
- package/flows/aidlc/skills/inception/story-create.md +304 -0
- package/flows/aidlc/skills/inception/units.md +271 -0
- package/flows/aidlc/skills/master/analyze-context.md +132 -0
- package/flows/aidlc/skills/master/answer-question.md +141 -0
- package/flows/aidlc/skills/master/explain-flow.md +146 -0
- package/flows/aidlc/skills/master/project-init.md +281 -0
- package/flows/aidlc/skills/master/route-request.md +126 -0
- package/flows/aidlc/skills/operations/build.md +237 -0
- package/flows/aidlc/skills/operations/deploy.md +259 -0
- package/flows/aidlc/skills/operations/monitor.md +265 -0
- package/flows/aidlc/skills/operations/navigator.md +209 -0
- package/flows/aidlc/skills/operations/verify.md +224 -0
- package/flows/aidlc/templates/construction/bolt-template.md +193 -0
- package/flows/aidlc/templates/construction/bolt-types/bdd-construction-bolt.md +250 -0
- package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt/adr-template.md +49 -0
- package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt/ddd-01-domain-model-template.md +55 -0
- package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt/ddd-02-technical-design-template.md +67 -0
- package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt/ddd-03-test-report-template.md +62 -0
- package/flows/aidlc/templates/construction/bolt-types/ddd-construction-bolt.md +528 -0
- package/flows/aidlc/templates/construction/bolt-types/simple-construction-bolt.md +273 -0
- package/flows/aidlc/templates/construction/bolt-types/spike-bolt.md +240 -0
- package/flows/aidlc/templates/construction/bolt-types/tdd-construction-bolt.md +259 -0
- package/flows/aidlc/templates/construction/construction-log-template.md +129 -0
- package/flows/aidlc/templates/construction/standards/coding-standards.md +29 -0
- package/flows/aidlc/templates/construction/standards/system-architecture.md +22 -0
- package/flows/aidlc/templates/construction/standards/tech-stack.md +19 -0
- package/flows/aidlc/templates/inception/inception-log-template.md +134 -0
- package/flows/aidlc/templates/inception/project/README.md +55 -0
- package/flows/aidlc/templates/inception/requirements-template.md +144 -0
- package/flows/aidlc/templates/inception/stories-template.md +38 -0
- package/flows/aidlc/templates/inception/story-template.md +147 -0
- package/flows/aidlc/templates/inception/system-context-template.md +29 -0
- package/flows/aidlc/templates/inception/unit-brief-template.md +177 -0
- package/flows/aidlc/templates/inception/units-template.md +52 -0
- package/flows/aidlc/templates/standards/catalog.yaml +345 -0
- package/flows/aidlc/templates/standards/coding-standards.guide.md +553 -0
- package/flows/aidlc/templates/standards/data-stack.guide.md +162 -0
- package/flows/aidlc/templates/standards/tech-stack.guide.md +280 -0
- package/lib/InstallerFactory.js +36 -0
- package/lib/cli-utils.js +372 -0
- package/lib/constants.js +31 -0
- package/lib/installer.js +314 -0
- package/lib/installers/AntigravityInstaller.js +22 -0
- package/lib/installers/ClaudeInstaller.js +85 -0
- package/lib/installers/ClineInstaller.js +21 -0
- package/lib/installers/CodexInstaller.js +21 -0
- package/lib/installers/CopilotInstaller.js +113 -0
- package/lib/installers/CursorInstaller.js +63 -0
- package/lib/installers/GeminiInstaller.js +75 -0
- package/lib/installers/KiroInstaller.js +22 -0
- package/lib/installers/OpenCodeInstaller.js +22 -0
- package/lib/installers/RooInstaller.js +22 -0
- package/lib/installers/ToolInstaller.js +73 -0
- package/lib/installers/WindsurfInstaller.js +76 -0
- package/lib/markdown-validator.ts +175 -0
- package/lib/yaml-validator.ts +99 -0
- package/package.json +65 -0
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
# Bolt Type: DDD Construction
|
|
2
|
+
|
|
3
|
+
## Mandatory Output Rules (READ FIRST)
|
|
4
|
+
|
|
5
|
+
- 🚫 **NEVER** use ASCII tables for options - they break at different terminal widths
|
|
6
|
+
- ✅ **ALWAYS** use numbered list format: `N - **Option**: Description`
|
|
7
|
+
- ✅ **ALWAYS** use status indicators: ✅ (done) ⏳ (current) [ ] (pending) 🚫 (blocked)
|
|
8
|
+
|
|
9
|
+
## Success Metrics
|
|
10
|
+
|
|
11
|
+
- ✅ Activities presented as numbered lists (not tables)
|
|
12
|
+
- ✅ Stage progress shown with status indicators
|
|
13
|
+
- ✅ Human checkpoints clearly marked
|
|
14
|
+
|
|
15
|
+
## Failure Modes
|
|
16
|
+
|
|
17
|
+
- ❌ Using ASCII table for activities
|
|
18
|
+
- ❌ Auto-advancing without human confirmation
|
|
19
|
+
- ❌ Skipping stages
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## ⛔ CRITICAL: Stage Execution Sequence
|
|
24
|
+
|
|
25
|
+
**Stages MUST be executed in this exact order:**
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
Stage 1: Domain Model → Stage 2: Technical Design → Stage 3: ADR Analysis (optional) → Stage 4: Implement → Stage 5: Test
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Stage Overview:**
|
|
32
|
+
|
|
33
|
+
- ✅/[ ] **1. Domain Model** (Required) → `ddd-01-domain-model.md`
|
|
34
|
+
- ✅/[ ] **2. Technical Design** (Required) → `ddd-02-technical-design.md`
|
|
35
|
+
- ✅/[ ] **3. ADR Analysis** (Optional) → `adr-{n}-{slug}.md` (zero or more)
|
|
36
|
+
- ✅/[ ] **4. Implement** (Required) → Source code
|
|
37
|
+
- ✅/[ ] **5. Test** (Required) → Tests + `ddd-03-test-report.md`
|
|
38
|
+
|
|
39
|
+
**Rules**:
|
|
40
|
+
|
|
41
|
+
- Each stage MUST be completed before the next begins
|
|
42
|
+
- Stage 3 can be skipped if no ADR-worthy decisions are identified
|
|
43
|
+
- **⛔ Human validation is MANDATORY at each stage checkpoint - STOP and WAIT for approval**
|
|
44
|
+
- NEVER skip to implementation without completing Domain Model and Technical Design
|
|
45
|
+
- NEVER auto-advance to next stage without explicit user confirmation
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Metadata
|
|
50
|
+
|
|
51
|
+
```yaml
|
|
52
|
+
bolt_type: ddd-construction-bolt
|
|
53
|
+
name: DDD Construction Bolt
|
|
54
|
+
description: Domain-Driven Design construction with modeling, design, implementation, and testing
|
|
55
|
+
version: 2.0.0
|
|
56
|
+
suitable_for:
|
|
57
|
+
- Domain-heavy business logic
|
|
58
|
+
- Complex entity relationships
|
|
59
|
+
- Services requiring clear bounded contexts
|
|
60
|
+
stages_count: 5
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Overview
|
|
66
|
+
|
|
67
|
+
This bolt type implements Domain-Driven Design (DDD) methodology through five sequential stages. Each stage builds upon the previous, ensuring complete design before implementation.
|
|
68
|
+
|
|
69
|
+
**Best For**:
|
|
70
|
+
|
|
71
|
+
- Business logic with complex domain rules
|
|
72
|
+
- Systems requiring clear entity boundaries
|
|
73
|
+
- Services with rich domain models
|
|
74
|
+
- Applications needing ubiquitous language alignment
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Stages
|
|
79
|
+
|
|
80
|
+
### Stage 1: Domain Model
|
|
81
|
+
|
|
82
|
+
**Objective**: Create a static domain model using DDD principles
|
|
83
|
+
|
|
84
|
+
**Duration**: Hours (typically 1-4 hours depending on complexity)
|
|
85
|
+
|
|
86
|
+
**⛔ CONSTRAINTS**:
|
|
87
|
+
|
|
88
|
+
- **FORBIDDEN**: Reading, analyzing, or modifying ANY source code files
|
|
89
|
+
- **ONLY OUTPUT**: Documentation artifact (`ddd-01-domain-model.md`)
|
|
90
|
+
|
|
91
|
+
**Activities**:
|
|
92
|
+
|
|
93
|
+
1 - **Identify domain entities**: Document entities and their properties
|
|
94
|
+
2 - **Define value objects**: Capture immutable objects with equality by value
|
|
95
|
+
3 - **Model aggregates**: Define aggregate roots and their boundaries
|
|
96
|
+
4 - **Capture domain events**: Document events triggered by domain operations
|
|
97
|
+
5 - **Define domain services**: Design services for complex cross-entity operations
|
|
98
|
+
6 - **Design repository interfaces**: Define contracts for data access
|
|
99
|
+
7 - **Document ubiquitous language**: Create glossary of domain terms
|
|
100
|
+
|
|
101
|
+
**Artifact**: `ddd-01-domain-model.md`
|
|
102
|
+
**Template**: `.specsmd/aidlc/templates/construction/bolt-types/ddd-construction-bolt/ddd-01-domain-model-template.md`
|
|
103
|
+
**Location**: Path defined by `schema.bolts` in `.specsmd/aidlc/memory-bank.yaml`
|
|
104
|
+
*(Default: `memory-bank/bolts/{bolt-id}/ddd-01-domain-model.md`)*
|
|
105
|
+
|
|
106
|
+
**Template Structure**:
|
|
107
|
+
|
|
108
|
+
```markdown
|
|
109
|
+
---
|
|
110
|
+
stage: model
|
|
111
|
+
bolt: {bolt-id}
|
|
112
|
+
created: {timestamp}
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Static Model: {unit-name}
|
|
116
|
+
|
|
117
|
+
### Entities
|
|
118
|
+
|
|
119
|
+
- **{Entity Name}**: {Properties} - {Business Rules}
|
|
120
|
+
- **{Entity Name}**: {Properties} - {Business Rules}
|
|
121
|
+
|
|
122
|
+
### Value Objects
|
|
123
|
+
|
|
124
|
+
- **{Value Object}**: {Properties} - {Constraints}
|
|
125
|
+
|
|
126
|
+
### Aggregates
|
|
127
|
+
|
|
128
|
+
- **{Aggregate Root}**: Members: {list} - Invariants: {rules}
|
|
129
|
+
|
|
130
|
+
### Domain Events
|
|
131
|
+
|
|
132
|
+
- **{Event Name}**: Trigger: {condition} - Payload: {data}
|
|
133
|
+
|
|
134
|
+
### Domain Services
|
|
135
|
+
|
|
136
|
+
- **{Service Name}**: Operations: {list} - Dependencies: {list}
|
|
137
|
+
|
|
138
|
+
### Repository Interfaces
|
|
139
|
+
|
|
140
|
+
- **{Repository Name}**: Entity: {type} - Methods: {list}
|
|
141
|
+
|
|
142
|
+
### Ubiquitous Language
|
|
143
|
+
|
|
144
|
+
- **{Term}**: {Definition}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Completion Criteria**:
|
|
148
|
+
|
|
149
|
+
- [ ] All domain entities identified and documented
|
|
150
|
+
- [ ] Business rules captured for each entity
|
|
151
|
+
- [ ] Aggregate boundaries defined
|
|
152
|
+
- [ ] Domain events specified
|
|
153
|
+
- [ ] Repository interfaces defined
|
|
154
|
+
- [ ] All stories covered by domain model
|
|
155
|
+
|
|
156
|
+
**⛔ HUMAN Checkpoint**: Present completion summary and **STOP**. Wait for user to confirm before proceeding to Stage 2.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
### Stage 2: Technical Design
|
|
161
|
+
|
|
162
|
+
**Objective**: Transform static model into technical architecture
|
|
163
|
+
|
|
164
|
+
**Duration**: Hours (typically 2-4 hours)
|
|
165
|
+
|
|
166
|
+
**⛔ CONSTRAINTS**:
|
|
167
|
+
|
|
168
|
+
- **FORBIDDEN**: Reading, analyzing, or modifying ANY source code files
|
|
169
|
+
- **ONLY OUTPUT**: Documentation artifact (`ddd-02-technical-design.md`)
|
|
170
|
+
|
|
171
|
+
**Activities**:
|
|
172
|
+
|
|
173
|
+
1 - **Select architectural pattern**: Choose and document architecture decision
|
|
174
|
+
2 - **Design layer structure**: Define responsibilities for each layer
|
|
175
|
+
3 - **Design API contracts**: Create OpenAPI/GraphQL specifications
|
|
176
|
+
4 - **Design data persistence**: Plan schema and migrations
|
|
177
|
+
5 - **Apply security patterns**: Document security approach
|
|
178
|
+
6 - **Design for NFRs**: Plan performance and scalability approach
|
|
179
|
+
7 - **Plan integrations**: Document integration points
|
|
180
|
+
|
|
181
|
+
**Artifact**: `ddd-02-technical-design.md`
|
|
182
|
+
**Template**: `.specsmd/aidlc/templates/construction/bolt-types/ddd-construction-bolt/ddd-02-technical-design-template.md`
|
|
183
|
+
**Location**: Path defined by `schema.bolts` in `.specsmd/aidlc/memory-bank.yaml`
|
|
184
|
+
*(Default: `memory-bank/bolts/{bolt-id}/ddd-02-technical-design.md`)*
|
|
185
|
+
|
|
186
|
+
**Template Structure**:
|
|
187
|
+
|
|
188
|
+
```markdown
|
|
189
|
+
---
|
|
190
|
+
stage: design
|
|
191
|
+
bolt: {bolt-id}
|
|
192
|
+
created: {timestamp}
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Technical Design: {unit-name}
|
|
196
|
+
|
|
197
|
+
### Architecture Pattern
|
|
198
|
+
{Selected pattern and rationale}
|
|
199
|
+
|
|
200
|
+
### Layer Structure
|
|
201
|
+
```text
|
|
202
|
+
|
|
203
|
+
┌─────────────────────────────┐
|
|
204
|
+
│ Presentation │ API/UI
|
|
205
|
+
├─────────────────────────────┤
|
|
206
|
+
│ Application │ Use Cases
|
|
207
|
+
├─────────────────────────────┤
|
|
208
|
+
│ Domain │ Business Logic
|
|
209
|
+
├─────────────────────────────┤
|
|
210
|
+
│ Infrastructure │ Database/External
|
|
211
|
+
└─────────────────────────────┘
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### API Design
|
|
216
|
+
|
|
217
|
+
- **{Endpoint}**: {Method} - Request: {schema} - Response: {schema}
|
|
218
|
+
|
|
219
|
+
### Data Model
|
|
220
|
+
|
|
221
|
+
- **{Table}**: Columns: {list} - Relationships: {list}
|
|
222
|
+
|
|
223
|
+
### Security Design
|
|
224
|
+
|
|
225
|
+
- **{Concern}**: {Approach}
|
|
226
|
+
|
|
227
|
+
### NFR Implementation
|
|
228
|
+
|
|
229
|
+
- **{Requirement}**: {Design Approach}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**Completion Criteria**:
|
|
233
|
+
|
|
234
|
+
- [ ] Architecture pattern selected and documented
|
|
235
|
+
- [ ] All layers designed with responsibilities
|
|
236
|
+
- [ ] API contracts defined
|
|
237
|
+
- [ ] Database schema designed
|
|
238
|
+
- [ ] NFRs addressed in design
|
|
239
|
+
- [ ] Security patterns applied
|
|
240
|
+
|
|
241
|
+
**⛔ HUMAN Checkpoint**: Present completion summary and **STOP**. Wait for user to confirm before proceeding to Stage 3.
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
### Stage 3: ADR Analysis (Optional)
|
|
246
|
+
|
|
247
|
+
**Objective**: Capture significant architectural decisions before implementation
|
|
248
|
+
|
|
249
|
+
**Duration**: Minutes to hours (depends on complexity and number of ADRs)
|
|
250
|
+
|
|
251
|
+
**⛔ CONSTRAINTS**:
|
|
252
|
+
|
|
253
|
+
- **OPTIONAL**: This stage can be skipped if no ADR-worthy decisions are identified
|
|
254
|
+
- **REQUIRED**: Must have completed `Domain Model` and `Technical Design` stages first
|
|
255
|
+
- **OUTPUT**: ADR documents (if any created)
|
|
256
|
+
|
|
257
|
+
**When to Create ADRs**:
|
|
258
|
+
|
|
259
|
+
Suggest an ADR when you identify:
|
|
260
|
+
|
|
261
|
+
- **New architectural pattern not in standards**: CQRS, event sourcing, saga → Not in standards, affects future development
|
|
262
|
+
- **Technology choice not covered by tech-stack**: New library or service → Team should understand the rationale
|
|
263
|
+
- **Trade-off decision**: Performance vs simplicity, consistency vs availability → Documents "why" for future reference
|
|
264
|
+
- **Security/compliance approach**: Auth strategy, data handling → Critical decisions need justification
|
|
265
|
+
- **Integration pattern**: API design, event contracts → Affects other systems/teams
|
|
266
|
+
- **Intentional deviation from standards**: Exception with reasoning → Prevents confusion, documents reasoning
|
|
267
|
+
|
|
268
|
+
**Activities**:
|
|
269
|
+
|
|
270
|
+
1 - **Review domain model and technical design**: Understand decisions made
|
|
271
|
+
2 - **Compare against project standards**: Identify gaps
|
|
272
|
+
3 - **Identify ADR-worthy decisions**: Create decision list
|
|
273
|
+
4 - **Present opportunities to user**: Get user selection
|
|
274
|
+
5 - **Create ADR documents**: Generate selected ADRs
|
|
275
|
+
|
|
276
|
+
**Artifact**: `adr-{number}-{slug}.md` (zero or more)
|
|
277
|
+
**Template**: `.specsmd/aidlc/templates/construction/bolt-types/ddd-construction-bolt/adr-template.md`
|
|
278
|
+
**Location**: `memory-bank/bolts/{bolt-id}/adr-{number}-{slug}.md`
|
|
279
|
+
|
|
280
|
+
**ADR Analysis Process**:
|
|
281
|
+
|
|
282
|
+
1. Review stories, domain model, and technical design
|
|
283
|
+
2. Compare against loaded project standards
|
|
284
|
+
3. If decision-worthy patterns detected, present opportunities to user
|
|
285
|
+
4. Handle user response and proceed to checkpoint
|
|
286
|
+
|
|
287
|
+
**Step 3 Output Format**:
|
|
288
|
+
|
|
289
|
+
```markdown
|
|
290
|
+
## Potential ADR Opportunities
|
|
291
|
+
|
|
292
|
+
Based on this bolt's scope, I identified decisions that may benefit from an ADR:
|
|
293
|
+
|
|
294
|
+
1 - **{decision description}**: {why this warrants an ADR}
|
|
295
|
+
2 - **{decision description}**: {why this warrants an ADR}
|
|
296
|
+
|
|
297
|
+
Would you like to create ADRs for any of these? (Enter numbers, "all", or "skip")
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**Step 4 Decision Handling**:
|
|
301
|
+
|
|
302
|
+
- **User selects numbers or "all"** → Generate ADRs using template, then proceed to checkpoint
|
|
303
|
+
- **User selects "skip"** → Proceed to checkpoint with "No ADRs created"
|
|
304
|
+
- **No ADR opportunities identified** → Auto-proceed to checkpoint with "No ADR-worthy decisions found"
|
|
305
|
+
|
|
306
|
+
**Example ADR**:
|
|
307
|
+
|
|
308
|
+
```markdown
|
|
309
|
+
# ADR-001: Use CQRS for Task Queries
|
|
310
|
+
|
|
311
|
+
## Context
|
|
312
|
+
Task list requires complex filtering and sorting that doesn't align with write model.
|
|
313
|
+
|
|
314
|
+
## Decision
|
|
315
|
+
Implement CQRS pattern with separate read models for task queries.
|
|
316
|
+
|
|
317
|
+
## Rationale
|
|
318
|
+
- Write model optimized for domain invariants
|
|
319
|
+
- Read model optimized for query performance
|
|
320
|
+
- Allows independent scaling
|
|
321
|
+
|
|
322
|
+
## Consequences
|
|
323
|
+
- Additional complexity in sync
|
|
324
|
+
- Need event-driven updates to read model
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
**Completion Criteria**:
|
|
328
|
+
|
|
329
|
+
- [ ] Domain model and technical design reviewed for decisions
|
|
330
|
+
- [ ] Project standards compared
|
|
331
|
+
- [ ] User presented with ADR opportunities (if any)
|
|
332
|
+
- [ ] Selected ADRs created (or explicitly skipped)
|
|
333
|
+
|
|
334
|
+
**Important**: Do not force ADRs. Only suggest when there's genuine value. Simple bolts with straightforward decisions don't need ADRs.
|
|
335
|
+
|
|
336
|
+
**⛔ HUMAN Checkpoint**: Present ADR summary (created or skipped) and **STOP**. Wait for user to confirm before proceeding to Stage 4.
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
340
|
+
### Stage 4: Implement
|
|
341
|
+
|
|
342
|
+
**Objective**: Generate production-ready code from designs
|
|
343
|
+
|
|
344
|
+
**Duration**: Hours to days (varies by complexity)
|
|
345
|
+
|
|
346
|
+
**⛔ CONSTRAINTS**:
|
|
347
|
+
|
|
348
|
+
- **REQUIRED**: Must have completed `model` and `design` stages first
|
|
349
|
+
- **REQUIRED**: Load all bolt folder artifacts (see Bolt Context Loading section)
|
|
350
|
+
- **OUTPUT**: Source code based on design docs
|
|
351
|
+
|
|
352
|
+
**Activities**:
|
|
353
|
+
|
|
354
|
+
1 - **Setup project structure**: Create scaffolding
|
|
355
|
+
2 - **Implement domain entities/value objects**: Create domain code
|
|
356
|
+
3 - **Implement domain services**: Build service layer
|
|
357
|
+
4 - **Implement application layer**: Create use cases
|
|
358
|
+
5 - **Implement infrastructure**: Build repository implementations
|
|
359
|
+
6 - **Implement presentation layer**: Create API endpoints
|
|
360
|
+
7 - **Add validation and error handling**: Implement guards and handlers
|
|
361
|
+
8 - **Add logging and instrumentation**: Add observability code
|
|
362
|
+
|
|
363
|
+
**Artifact**: Source code in unit directory
|
|
364
|
+
**Location**: `src/{unit}/` or as defined in project structure
|
|
365
|
+
|
|
366
|
+
**Project Structure**:
|
|
367
|
+
|
|
368
|
+
```text
|
|
369
|
+
src/{unit}/
|
|
370
|
+
├── domain/
|
|
371
|
+
│ ├── entities/
|
|
372
|
+
│ ├── value-objects/
|
|
373
|
+
│ ├── services/
|
|
374
|
+
│ └── events/
|
|
375
|
+
├── application/
|
|
376
|
+
│ ├── use-cases/
|
|
377
|
+
│ └── dto/
|
|
378
|
+
├── infrastructure/
|
|
379
|
+
│ ├── repositories/
|
|
380
|
+
│ └── external/
|
|
381
|
+
└── presentation/
|
|
382
|
+
├── controllers/
|
|
383
|
+
└── middleware/
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
**Completion Criteria**:
|
|
387
|
+
|
|
388
|
+
- [ ] All domain models implemented
|
|
389
|
+
- [ ] All use cases implemented
|
|
390
|
+
- [ ] All API endpoints implemented
|
|
391
|
+
- [ ] Database connectivity working
|
|
392
|
+
- [ ] Validation and error handling in place
|
|
393
|
+
- [ ] Code documented
|
|
394
|
+
- [ ] Linting passing
|
|
395
|
+
|
|
396
|
+
**⛔ HUMAN Checkpoint**: Present implementation summary and **STOP**. Wait for user to confirm before proceeding to Stage 5.
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
### Stage 5: Test
|
|
401
|
+
|
|
402
|
+
**Objective**: Ensure quality through comprehensive testing
|
|
403
|
+
|
|
404
|
+
**Duration**: Hours (typically 2-6 hours)
|
|
405
|
+
|
|
406
|
+
**⛔ CONSTRAINTS**:
|
|
407
|
+
|
|
408
|
+
- **REQUIRED**: Must have completed `Implement` stage first
|
|
409
|
+
- **REQUIRED**: Load all bolt folder artifacts (see Bolt Context Loading section)
|
|
410
|
+
- **OUTPUT**: Tests + documentation artifact (`ddd-03-test-report.md`)
|
|
411
|
+
|
|
412
|
+
**Activities**:
|
|
413
|
+
|
|
414
|
+
1 - **Write unit tests**: Test domain logic
|
|
415
|
+
2 - **Write integration tests**: Test API endpoints
|
|
416
|
+
3 - **Write security tests**: Validate security controls
|
|
417
|
+
4 - **Write performance tests**: Load and stress tests
|
|
418
|
+
5 - **Run all tests**: Execute test suite
|
|
419
|
+
6 - **Measure coverage**: Generate coverage report
|
|
420
|
+
7 - **Verify acceptance criteria**: Validate against stories
|
|
421
|
+
|
|
422
|
+
**Artifact**: `ddd-03-test-report.md`
|
|
423
|
+
**Template**: `.specsmd/aidlc/templates/construction/bolt-types/ddd-construction-bolt/ddd-03-test-report-template.md`
|
|
424
|
+
**Location**: Path defined by `schema.bolts` in `.specsmd/aidlc/memory-bank.yaml`
|
|
425
|
+
*(Default: `memory-bank/bolts/{bolt-id}/ddd-03-test-report.md`)*
|
|
426
|
+
|
|
427
|
+
**Test Structure**:
|
|
428
|
+
|
|
429
|
+
```text
|
|
430
|
+
tests/
|
|
431
|
+
├── unit/ # Domain logic tests
|
|
432
|
+
├── integration/ # API tests
|
|
433
|
+
├── security/ # Security tests
|
|
434
|
+
└── performance/ # Load tests
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
**Template Structure**:
|
|
438
|
+
|
|
439
|
+
```markdown
|
|
440
|
+
---
|
|
441
|
+
stage: test
|
|
442
|
+
bolt: {bolt-id}
|
|
443
|
+
created: {timestamp}
|
|
444
|
+
---
|
|
445
|
+
|
|
446
|
+
## Test Report: {unit-name}
|
|
447
|
+
|
|
448
|
+
### Summary
|
|
449
|
+
|
|
450
|
+
- **Unit Tests**: {passed}/{total} passed, {coverage}% coverage
|
|
451
|
+
- **Integration Tests**: {passed}/{total} passed
|
|
452
|
+
- **Security Tests**: {passed}/{total} passed
|
|
453
|
+
- **Performance Tests**: {passed}/{total} passed
|
|
454
|
+
|
|
455
|
+
### Acceptance Criteria Validation
|
|
456
|
+
|
|
457
|
+
- ✅/❌ **{Story}**: {Criteria} - {Status}
|
|
458
|
+
|
|
459
|
+
### Issues Found
|
|
460
|
+
{Any issues discovered during testing}
|
|
461
|
+
|
|
462
|
+
### Recommendations
|
|
463
|
+
{Improvements or follow-ups needed}
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
**Completion Criteria**:
|
|
467
|
+
|
|
468
|
+
- [ ] All unit tests passing
|
|
469
|
+
- [ ] All integration tests passing
|
|
470
|
+
- [ ] Security tests passing
|
|
471
|
+
- [ ] Performance tests meet targets
|
|
472
|
+
- [ ] Code coverage > 80%
|
|
473
|
+
- [ ] All acceptance criteria met
|
|
474
|
+
|
|
475
|
+
**⛔ HUMAN Checkpoint**: Present test report and **STOP**. Wait for user to confirm bolt completion.
|
|
476
|
+
|
|
477
|
+
---
|
|
478
|
+
|
|
479
|
+
## State Tracking
|
|
480
|
+
|
|
481
|
+
Bolt instance tracks progress:
|
|
482
|
+
|
|
483
|
+
```yaml
|
|
484
|
+
---
|
|
485
|
+
current_stage: design
|
|
486
|
+
stages_completed:
|
|
487
|
+
- name: model
|
|
488
|
+
completed: 2024-12-05T10:00:00Z
|
|
489
|
+
artifact: ddd-01-domain-model.md
|
|
490
|
+
status: in-progress
|
|
491
|
+
---
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
---
|
|
495
|
+
|
|
496
|
+
## Bolt Context Loading
|
|
497
|
+
|
|
498
|
+
For stages that build on previous work (Stage 4: Implement, Stage 5: Test), load all artifacts from the bolt folder:
|
|
499
|
+
|
|
500
|
+
**Location**: `memory-bank/bolts/{bolt-id}/`
|
|
501
|
+
|
|
502
|
+
**Load all files in this folder**, which may include:
|
|
503
|
+
|
|
504
|
+
- `bolt.md` - Bolt instance metadata
|
|
505
|
+
- `ddd-01-domain-model.md` - Domain model from Stage 1
|
|
506
|
+
- `ddd-02-technical-design.md` - Technical design from Stage 2
|
|
507
|
+
- `adr-*.md` - Any ADRs from Stage 3
|
|
508
|
+
|
|
509
|
+
This ensures the implementation and test stages have full context from earlier design work.
|
|
510
|
+
|
|
511
|
+
---
|
|
512
|
+
|
|
513
|
+
## Usage by Construction Agent
|
|
514
|
+
|
|
515
|
+
1. **Load bolt instance** from path defined by `schema.bolts`
|
|
516
|
+
2. **Read `bolt_type` field** (e.g., `ddd-construction-bolt`)
|
|
517
|
+
3. **Load this definition** from `.specsmd/aidlc/templates/construction/bolt-types/`
|
|
518
|
+
4. **Check `current_stage`** in bolt instance
|
|
519
|
+
5. **Load bolt folder artifacts** if stage requires previous context (see Bolt Context Loading)
|
|
520
|
+
6. **Execute stage** following activities defined here
|
|
521
|
+
7. **Create artifacts** using templates
|
|
522
|
+
8. **⛔ STOP and present completion summary** - DO NOT continue automatically
|
|
523
|
+
9. **Wait for user confirmation** - user must explicitly approve (e.g., "continue", "proceed", "next")
|
|
524
|
+
10. **Only after approval**: Update bolt state and advance to next stage
|
|
525
|
+
|
|
526
|
+
**⛔ CRITICAL**: Steps 8-9 are MANDATORY. Never skip the human checkpoint. Never auto-advance.
|
|
527
|
+
|
|
528
|
+
The Construction Agent is **bolt-type agnostic** - it reads stages from this file and executes them.
|