@comfanion/workflow 3.9.0 → 4.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comfanion/workflow",
3
- "version": "3.9.0",
3
+ "version": "4.0.0",
4
4
  "description": "Initialize OpenCode Workflow system for AI-assisted development",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "3.0.0",
3
- "buildDate": "2026-01-23T17:06:57.357Z",
3
+ "buildDate": "2026-01-23T17:21:08.417Z",
4
4
  "files": [
5
5
  "config.yaml",
6
6
  "FLOW.yaml",
@@ -6,7 +6,7 @@
6
6
  # PROJECT CONFIGURATION
7
7
  # =============================================================================
8
8
  project_name: "ai-wf"
9
- version: "3.9.0"
9
+ version: "4.0.0"
10
10
 
11
11
  # =============================================================================
12
12
  # USER CONFIGURATION
@@ -206,26 +206,27 @@ S01 (Domain) ──┬──► S02 (Repo Interface) ──► S04 (Repo Impl)
206
206
  └──► S03 (Use Cases) ──► S05 (HTTP) ─┴──► S06 (Events) ──► S07 (Tests)
207
207
  ```
208
208
 
209
- ### Total Effort Calculation
209
+ ### Story Breakdown
210
210
 
211
211
  ```markdown
212
- ### Effort Summary
213
-
214
- | Story | Tasks | Hours | Days |
215
- |-------|-------|-------|------|
216
- | S01 | 4 | 20h | 2.5d |
217
- | S02 | 3 | 15h | 2d |
218
- | S03 | 5 | 26h | 3d |
219
- | S04 | 4 | 22h | 3d |
220
- | S05 | 3 | 16h | 2d |
221
- | S06 | 3 | 15h | 2d |
222
- | S07 | 3 | 15h | 2d |
223
- | **Total** | **25** | **129h** | **~16d** |
212
+ ### Stories Summary
213
+
214
+ | Story | Tasks | Size | Deps |
215
+ |-------|-------|------|------|
216
+ | S01 | 4 | M | - |
217
+ | S02 | 3 | S | S01 |
218
+ | S03 | 5 | L | S01 |
219
+ | S04 | 4 | M | S02 |
220
+ | S05 | 3 | S | S03 |
221
+ | S06 | 3 | S | S04 |
222
+ | S07 | 3 | S | S05,S06 |
223
+ | **Total** | **25** | | |
224
224
 
225
225
  **Parallel Opportunities:** S02+S03, S04+S05
226
- **With Parallelism:** ~10 days (2 weeks)
227
226
  ```
228
227
 
228
+ **Note:** No hour estimates. Use T-shirt sizes (XS/S/M/L/XL) for relative complexity.
229
+
229
230
  ## Epic Sizing
230
231
 
231
232
  ### Guidelines
@@ -92,11 +92,13 @@ Use template at: `@.opencode/templates/story-template.md`
92
92
 
93
93
  **Story ID:** [MODULE]-S[EPIC]-[NN]
94
94
  **Epic:** [MODULE]-E[EPIC] - [Epic Title]
95
- **Status:** TODO | IN_PROGRESS | REVIEW | DONE
95
+ **Status:** draft | ready-for-dev | in-progress | review | done
96
96
  **Priority:** P0 | P1 | P2
97
- **Estimate:** XS | S | M | L | XL
97
+ **Size:** XS | S | M | L | XL
98
98
  ```
99
99
 
100
+ **Note:** Size is relative complexity (T-shirt sizing). NO hour estimates for tasks.
101
+
100
102
  ### User Story Format (MANDATORY)
101
103
 
102
104
  ```markdown
@@ -187,19 +189,23 @@ Each story should have:
187
189
  - **Authorization** - Permission checks
188
190
  - **Edge cases** - Boundary conditions
189
191
 
190
- ## Atomic Tasks (4-6 hours each)
192
+ ## Self-Contained Tasks (NO ESTIMATES)
191
193
 
192
- ### Task Decomposition Rules
194
+ ### Task Philosophy
195
+
196
+ **CRITICAL:** Tasks must be **SELF-CONTAINED** - an AI agent or developer can take ANY task and execute it independently without asking questions.
197
+
198
+ **NO ESTIMATES** - Don't estimate time. Focus on clear scope and outcomes.
193
199
 
194
- **MANDATORY**: Every story MUST be broken into atomic tasks:
200
+ ### Task Decomposition Rules
195
201
 
196
202
  | Rule | Description |
197
203
  |------|-------------|
198
- | **4-6 hours** | Each task should be 4-6 hours of focused work |
199
- | **Single responsibility** | One clear deliverable per task |
200
- | **Explicit dependencies** | Every task declares what it depends on |
201
- | **Parallel opportunities** | Independent tasks can run in parallel |
202
- | **Red-Green-Refactor** | Follow TDD cycle in task types |
204
+ | **Self-contained** | Task has ALL information needed to execute |
205
+ | **Documentation links** | Every task links to relevant docs, schemas, examples |
206
+ | **Clear input/output** | What exists before, what must exist after |
207
+ | **Testable outcome** | How to verify task is complete |
208
+ | **Independent execution** | Can be picked up without context from other tasks |
203
209
 
204
210
  ## Development Methodologies
205
211
 
@@ -235,203 +241,137 @@ Interface → Stub Implementation → Tests → Real Implementation
235
241
 
236
242
  **Best for:** Exploratory work, unclear requirements, rapid prototyping
237
243
 
238
- ### Task Structure by Methodology
244
+ ### Task Structure (MANDATORY FORMAT)
239
245
 
240
- **TDD Task:**
241
- ```markdown
242
- ### T2: Implement {{Entity}} Aggregate + Tests
243
- - **Estimate:** 5h
244
- - **Depends on:** T1
245
- - **Methodology:** TDD
246
- - **Deliverables:**
247
- - [ ] Aggregate: `domain/aggregate/entity.go`
248
- - [ ] Value objects: `domain/valueobject/*.go`
249
- - **Validation Test:** `domain/aggregate/entity_test.go`
250
- - [ ] Test creation happy path
251
- - [ ] Test validation errors
252
- - [ ] Test business rules
253
- - [ ] **⚠️ ALL TESTS MUST PASS**
254
- ```
246
+ Each task MUST have this structure to be self-contained:
255
247
 
256
- **STUB Task:**
257
248
  ```markdown
258
- ### T2: Implement Repository (Stub → Real) + Tests
259
- - **Estimate:** 6h
260
- - **Depends on:** T1
261
- - **Methodology:** STUB
262
- - **Deliverables:**
263
- - [ ] Stub: `infrastructure/repo/entity_memory_repo.go`
264
- - [ ] Real: `infrastructure/repo/entity_postgres_repo.go`
265
- - **Validation Test:** `infrastructure/repo/entity_repo_test.go`
266
- - [ ] Test Save, FindByID, List
267
- - [ ] Test with stub first
268
- - [ ] Replace stub with real
269
- - [ ] **⚠️ ALL TESTS MUST PASS**
270
- ```
249
+ ### T{N}: {Clear Task Name}
271
250
 
272
- ---
273
-
274
- ### Task Types
251
+ **Goal:** One sentence describing what this task achieves.
275
252
 
276
- | Type | Icon | Description |
277
- |------|------|-------------|
278
- | INTERFACE | 📐 | Define interface/contract |
279
- | RED | 🔴 | Write failing test first (TDD) |
280
- | GREEN | 🟢 | Implement to pass tests |
281
- | STUB | 🧪 | Stub implementation (STUB methodology) |
282
- | REFACTOR | 🔵 | Clean up, no new functionality |
283
- | INTEGRATION | 🔗 | E2E integration test |
284
- | DOCS | 📝 | Documentation only |
253
+ **Documentation:**
254
+ - [AGENTS.md#section](../../../AGENTS.md#section) - Relevant coding patterns
255
+ - [data-model.md#table](../docs/data-model.md#table) - Database schema
256
+ - [example.go](../src/path/example.go) - Pattern to follow
285
257
 
286
- ### Task Structure
258
+ **Input (Prerequisites):**
259
+ - T{N-1} completed (if dependent)
260
+ - Existing file: `path/to/existing.go` - what it provides
261
+ - Repository interface defined in: `path/to/interface.go`
287
262
 
288
- ```markdown
289
- ### T{N}: {Task Name}
290
- - **Estimate:** 4h | 5h | 6h
291
- - **Depends on:** T1, T2 | - (none)
292
- - **Blocks:** T5, T6 | - (none)
293
- - **Type:** 🔴 RED | 🟢 GREEN | 🔵 REFACTOR | 📝 DOCS
294
- - **Files:** `path/to/file.go`
295
- - **Definition of Done:**
296
- - [ ] Specific deliverable 1
297
- - [ ] Specific deliverable 2
298
- - **Notes:** Implementation hints
299
- ```
263
+ **Output (Deliverables):**
264
+ - `path/to/new_file.go` - Description of what this file does
265
+ - `path/to/new_file_test.go` - Tests covering X, Y, Z
300
266
 
301
- ### Dependency Graph (ASCII)
267
+ **Implementation Steps:**
268
+ 1. Read documentation links above
269
+ 2. Create file structure following pattern from [example.go]
270
+ 3. Implement X following AGENTS.md conventions
271
+ 4. Write tests covering: happy path, validation errors, edge cases
272
+ 5. Run tests, ensure all pass
302
273
 
303
- Visualize task dependencies:
274
+ **Acceptance Criteria:**
275
+ - [ ] File created at correct path
276
+ - [ ] Follows naming conventions from AGENTS.md
277
+ - [ ] All tests pass: `go test ./path/to/...`
278
+ - [ ] No linting errors: `golangci-lint run`
304
279
 
280
+ **Notes:** Additional hints, gotchas, or context
305
281
  ```
306
- T1 ──┬──► T2 ──► T4
307
- │ │
308
- └──► T3 ────┴──► T5 ──► T6
309
- ```
310
282
 
311
- - `──►` = depends on (must complete before)
312
- - `┬` = fork (parallel branches)
313
- - `┴` = join (waits for all)
283
+ ### Why This Structure?
284
+
285
+ | Section | Purpose |
286
+ |---------|---------|
287
+ | **Goal** | Agent knows the "why" |
288
+ | **Documentation** | Agent can read all needed context |
289
+ | **Input** | Agent knows what must exist before starting |
290
+ | **Output** | Agent knows exactly what to create |
291
+ | **Implementation Steps** | Agent has step-by-step guidance |
292
+ | **Acceptance Criteria** | Agent can verify completion |
314
293
 
315
- ### Summary Table (MANDATORY)
294
+ ### Tasks Summary Table
316
295
 
317
296
  ```markdown
318
- | ID | Task | Est | Depends On | Status |
319
- |----|------|-----|------------|--------|
320
- | T1 | Domain layer (aggregates, value objects, tests) | 6h | - | ⬜ |
321
- | T2 | Repository interface + use case tests | 5h | T1 | ⬜ |
322
- | T3 | Use case implementation | 5h | T2 | ⬜ |
323
- | T4 | Repository implementation (PostgreSQL) | 6h | T2 | ⬜ |
324
- | T5 | HTTP handlers + tests | 5h | T3 | ⬜ |
325
- | T6 | Integration tests + refactor | 5h | T4, T5 | ⬜ |
297
+ | ID | Task | Deps | Status |
298
+ |----|------|------|--------|
299
+ | T1 | MerchantProduct Aggregate + Value Objects | - | ⬜ |
300
+ | T2 | Repository Interface | T1 | ⬜ |
301
+ | T3 | CreateProduct Use Case | T2 | ⬜ |
302
+ | T4 | PostgreSQL Repository Implementation | T2 | ⬜ |
303
+ | T5 | HTTP Handler + Routes | T3, T4 | ⬜ |
326
304
  ```
327
305
 
328
306
  **Status:** ⬜ TODO | 🔄 IN_PROGRESS | ✅ DONE | ⏸️ BLOCKED
329
307
 
330
- ### Execution Phases
331
-
332
- Group tasks by parallel execution opportunity:
333
-
334
- ```markdown
335
- ### Execution Order
336
-
337
- Phase 1: T1 (no deps)
338
- Phase 2: T2, T3 (parallel - both depend only on T1)
339
- Phase 3: T4, T6 (parallel - independent branches)
340
- Phase 4: T5 (waits for T3, T4)
341
- Phase 5: T7 (waits for T5)
342
- Phase 6: T8, T6-continued (parallel)
343
- Phase 7: T9 (waits for T6, T8)
344
- Phase 8: T10 (final)
345
-
346
- **Critical Path:** T1 → T2 → T4 → T5 → T7 → T8 → T9 → T10
347
- **Total Estimate:** 32h (4 days)
348
- **Parallel Savings:** ~3h (25%)
349
- ```
308
+ ### Dependency Graph (Optional)
350
309
 
351
- ### Example: CreateProduct Story Tasks
352
-
353
- ```markdown
354
- | ID | Task | Est | Depends On | Type |
355
- |----|------|-----|------------|------|
356
- | T1 | Domain layer: Product aggregate + value objects + tests | 6h | - | 🔴🟢 |
357
- | T2 | Repository interface + CreateProduct use case tests | 5h | T1 | 🔴 |
358
- | T3 | CreateProduct use case implementation | 5h | T2 | 🟢 |
359
- | T4 | PostgreSQL repository implementation + tests | 6h | T2 | 🟢 |
360
- | T5 | HTTP handler + tests | 5h | T3 | 🔴🟢 |
361
- | T6 | Integration tests + refactor + documentation | 5h | T4, T5 | 🔵 |
362
-
363
- **Graph:**
364
- T1 ──► T2 ──┬──► T4 ──► T5 ──► T7 ──► T8 ──┬──► T9 ──► T10
365
- │ │
366
- T3 ─────────┴───────────► T6 ───────────────┘
367
310
  ```
368
-
369
- ### Splitting Large Tasks
370
-
371
- If a task exceeds 6h, consider splitting it. **Each task MUST have validation test.**
372
-
373
- | Original (8h+) | Split Into (with tests) |
374
- |----------------|------------------------|
375
- | "Full domain layer" (10h) | **T1:** Value objects + tests (4h)<br>**T2:** Aggregate + business rules + tests (6h) |
376
- | "Full repository" (10h) | **T1:** Interface + Save/FindByID + tests (5h)<br>**T2:** List/Search + advanced queries + tests (5h) |
377
-
378
- ### Task Template with Validation
379
-
380
- ```markdown
381
- ### T{N}: {Task Name}
382
- - **Estimate:** 5h
383
- - **Depends on:** T{N-1}
384
- - **Methodology:** TDD | STUB
385
- - **Deliverables:**
386
- - [ ] File: `path/to/implementation.go`
387
- - [ ] File: `path/to/implementation2.go`
388
- - **Validation Test:** `path/to/implementation_test.go`
389
- - [ ] Test case 1: happy path
390
- - [ ] Test case 2: error handling
391
- - [ ] Test case 3: edge case
392
- - [ ] **⚠️ ALL TESTS MUST PASS** ← MANDATORY
393
- - **Notes:** Implementation hints
311
+ T1 ──► T2 ──┬──► T3 ──┬──► T5
312
+ │ │
313
+ └──► T4 ──┘
394
314
  ```
395
315
 
396
- ### Validation Test Requirements
397
-
398
- **Every task MUST have:**
399
-
400
- | Test Type | Required | Description |
401
- |-----------|----------|-------------|
402
- | Happy path | ✅ Yes | Normal success case |
403
- | Error handling | ✅ Yes | Expected failures |
404
- | Edge cases | Recommended | Boundary conditions |
405
- | **Pass gate** | ✅ MANDATORY | `⚠️ ALL TESTS MUST PASS` |
316
+ ---
406
317
 
407
- ### TDD vs STUB Task Examples
318
+ ## Full Task Example
408
319
 
409
- **TDD Example:**
410
- ```markdown
411
- ### T2: Implement Product Aggregate
412
- - **Methodology:** TDD
413
- - **Deliverables:**
414
- - [ ] `domain/aggregate/product.go`
415
- - **Validation Test:** `domain/aggregate/product_test.go`
416
- - [ ] 🔴 Write test first (should FAIL)
417
- - [ ] 🟢 Implement until test PASSES
418
- - [ ] 🔵 Refactor, tests still PASS
419
- - [ ] **⚠️ ALL TESTS MUST PASS**
420
- ```
320
+ Here's a complete example of a self-contained task:
421
321
 
422
- **STUB Example:**
423
322
  ```markdown
424
- ### T4: Implement Repository
425
- - **Methodology:** STUB
426
- - **Deliverables:**
427
- - [ ] Stub: `infrastructure/repo/product_memory_repo.go`
428
- - [ ] Real: `infrastructure/repo/product_postgres_repo.go`
429
- - **Validation Test:** `infrastructure/repo/product_repo_test.go`
430
- - [ ] 🧪 Write stub (mock data)
431
- - [ ] Write tests against stub
432
- - [ ] 🟢 Replace with real impl
433
- - [ ] **⚠️ ALL TESTS MUST PASS**
434
- ```
323
+ ### T1: MerchantProduct Aggregate + Value Objects
324
+
325
+ **Goal:** Create the MerchantProduct aggregate with all value objects and domain validation.
326
+
327
+ **Documentation:**
328
+ - [AGENTS.md#type-safety](../../../AGENTS.md#type-safety) - Value object patterns
329
+ - [AGENTS.md#naming-conventions](../../../AGENTS.md#naming-conventions) - File/package naming
330
+ - [catalog-data-model.md#merchant_products](../docs/catalog-data-model.md#31-merchant-products) - Database schema
331
+ - [modules/catalog/domain/entity/marketplace_category.go](../src/services/catalog/modules/catalog/domain/entity/marketplace_category.go) - Example entity pattern
332
+
333
+ **Input (Prerequisites):**
334
+ - None (first task in story)
335
+ - Existing patterns in `modules/catalog/domain/` to follow
336
+
337
+ **Output (Deliverables):**
338
+ - `modules/catalog/domain/valueobject/merchant_id.go` - UUID wrapper with validation
339
+ - `modules/catalog/domain/valueobject/product_id.go` - UUID wrapper
340
+ - `modules/catalog/domain/valueobject/merchant_sku.go` - String with max length validation
341
+ - `modules/catalog/domain/valueobject/ean.go` - GTIN-13 checksum validation
342
+ - `modules/catalog/domain/valueobject/product_status.go` - Enum (pending, active, etc.)
343
+ - `modules/catalog/domain/entity/merchant_product.go` - Aggregate with private fields + getters
344
+ - `modules/catalog/domain/entity/merchant_product_test.go` - All tests
345
+
346
+ **Implementation Steps:**
347
+ 1. Read AGENTS.md sections on value objects and naming
348
+ 2. Look at existing `marketplace_category.go` for entity pattern
349
+ 3. Create value objects with `New*()` factory functions that validate
350
+ 4. Create aggregate with private fields, public getters, factory method
351
+ 5. Write tests: creation happy path, validation errors, status transitions
352
+ 6. Run `go test ./modules/catalog/domain/...`
353
+
354
+ **Acceptance Criteria:**
355
+ - [ ] All files created at correct paths
356
+ - [ ] Value objects validate on construction (not setters)
357
+ - [ ] EAN validates GTIN-13 checksum
358
+ - [ ] Aggregate uses private fields with getters
359
+ - [ ] Tests cover: valid creation, invalid data rejection, status transitions
360
+ - [ ] `go test ./modules/catalog/domain/...` passes
361
+ - [ ] `golangci-lint run ./modules/catalog/domain/...` passes
362
+
363
+ **Notes:**
364
+ - EAN checksum algorithm: sum odd positions × 1, even × 3, check digit makes sum divisible by 10
365
+ - Status enum values from PRD: pending, pending_category, pending_dedup, pending_pim, active, declined
366
+ ```
367
+
368
+ ### What Makes This Task Self-Contained?
369
+
370
+ 1. **Agent can start immediately** - all documentation links provided
371
+ 2. **No guessing** - exact file paths specified
372
+ 3. **Pattern to follow** - links to existing code examples
373
+ 4. **Clear verification** - specific test commands and criteria
374
+ 5. **Context included** - notes explain non-obvious details (EAN algorithm)
435
375
 
436
376
  ## Definition of Done
437
377
 
@@ -84,8 +84,8 @@ S01 ──► S02 ──► S03 ──► S04
84
84
  ### Story Decomposition Rules
85
85
 
86
86
  Each story MUST:
87
- 1. Be completable in 2-5 days
88
- 2. Have 3-6 atomic tasks (4-6h each)
87
+ 1. Be completable (not too big, not too small)
88
+ 2. Have self-contained tasks with documentation links
89
89
  3. Have clear dependencies on other stories
90
90
  4. Map to specific Acceptance Criteria
91
91
 
@@ -99,15 +99,17 @@ Each story MUST:
99
99
  6. **Events** - Domain events, Kafka publishers
100
100
  7. **Integration Tests** - End-to-end verification
101
101
 
102
- ### Total Effort Breakdown
102
+ ### Stories by Layer
103
103
 
104
- | Layer | Stories | Tasks | Hours |
105
- |-------|---------|-------|-------|
106
- | Domain | 1 | 4 | 20h |
107
- | Application | 1 | 4 | 22h |
108
- | Infrastructure | 2 | 5 | 28h |
109
- | Testing | 1 | 3 | 15h |
110
- | **Total** | **5** | **16** | **85h** |
104
+ | Layer | Stories | Tasks | Size |
105
+ |-------|---------|-------|------|
106
+ | Domain | 1 | 4 | M |
107
+ | Application | 2 | 6 | M |
108
+ | Infrastructure | 2 | 5 | L |
109
+ | Testing | 1 | 3 | S |
110
+ | **Total** | **6** | **18** | |
111
+
112
+ **Note:** No hour estimates. Size = relative complexity (XS/S/M/L/XL).
111
113
 
112
114
  ---
113
115
 
@@ -10,7 +10,7 @@ workflowType: 'story'
10
10
  **Epic:** {{module}}-E{{epic_number}} - {{epic_title}}
11
11
  **Status:** draft | ready-for-dev | in-progress | review | done | blocked
12
12
  **Priority:** P0 | P1 | P2
13
- **Estimate:** XS | S | M | L | XL
13
+ **Size:** XS | S | M | L | XL
14
14
  **Created:** {{date}}
15
15
  **Last Updated:** {{date}}
16
16
 
@@ -47,170 +47,112 @@ workflowType: 'story'
47
47
 
48
48
  ---
49
49
 
50
- ## Atomic Tasks
50
+ ## Self-Contained Tasks
51
51
 
52
52
  <!--
53
- METHODOLOGY: {{methodology}} (tdd | stub)
54
- - TDD: Interface Test (failing) Implementation → Refactor
55
- - STUB: Interface Stub → Test → Full Implementation
56
-
57
- RULES:
58
- - Each task is 4-6 hours of focused work
59
- - Each task includes TEST as validation gate
60
- - Tasks have explicit dependencies
61
- - Dev agent respects dependency order
53
+ Each task MUST be self-contained:
54
+ - Agent can execute WITHOUT asking questions
55
+ - All documentation links provided
56
+ - Clear input/output/acceptance criteria
62
57
  -->
63
58
 
64
- ### Development Methodology: **{{methodology}}**
59
+ ### Tasks Summary
65
60
 
66
- ```
67
- {{#if methodology == "tdd"}}
68
- TDD Flow per Task:
69
- 1. Define Interface/Contract
70
- 2. Write Failing Test (RED)
71
- 3. Implement Minimal Code (GREEN)
72
- 4. Refactor
73
- 5. Validate: Test MUST pass
74
- {{/if}}
75
- {{#if methodology == "stub"}}
76
- STUB Flow per Task:
77
- 1. Define Interface/Contract
78
- 2. Write Stub Implementation (returns mock data)
79
- 3. Write Tests against Stub
80
- 4. Replace Stub with Real Implementation
81
- 5. Validate: Test MUST pass
82
- {{/if}}
83
- ```
61
+ | ID | Task | Deps | Status |
62
+ |----|------|------|--------|
63
+ | T1 | {{task_1_name}} | - | ⬜ |
64
+ | T2 | {{task_2_name}} | T1 | ⬜ |
65
+ | T3 | {{task_3_name}} | T2 | ⬜ |
66
+
67
+ **Status:** ⬜ TODO | 🔄 IN_PROGRESS | ✅ DONE | ⏸️ BLOCKED
84
68
 
85
69
  ---
86
70
 
87
- ### Task Dependency Graph
71
+ ### T1: {{task_1_name}}
88
72
 
89
- ```
90
- T1 ──┬──► T2 ──► T3
91
-
92
- └──► T4 ──► T5
93
-
94
- T3 ───────────────┴──► T6
95
- ```
73
+ **Goal:** {{what_this_task_achieves}}
96
74
 
97
- ### Tasks Summary
75
+ **Documentation:**
76
+ - [AGENTS.md#section](../../../AGENTS.md#section) - {{what_pattern}}
77
+ - [data-model.md#table](../../../docs/data-model.md#section) - {{schema_info}}
78
+ - [existing_example.go](../path/to/example.go) - Pattern to follow
98
79
 
99
- | ID | Task | Est | Deps | Test | Status |
100
- |----|------|-----|------|------|--------|
101
- | T1 | {{task_1}} | 5h | - | unit | ⬜ |
102
- | T2 | {{task_2}} | 6h | T1 | unit | ⬜ |
103
- | T3 | {{task_3}} | 5h | T2 | unit | ⬜ |
104
- | T4 | {{task_4}} | 5h | T1 | unit | ⬜ |
105
- | T5 | {{task_5}} | 5h | T3,T4 | integration | ⬜ |
80
+ **Input (Prerequisites):**
81
+ - {{what_must_exist_before_starting}}
82
+ - Existing file: `path/to/dependency.go` - provides {{what}}
106
83
 
107
- **Status:** ⬜ TODO | 🔄 IN_PROGRESS | ✅ DONE | ⏸️ BLOCKED | ❌ FAILED
84
+ **Output (Deliverables):**
85
+ - `path/to/new_file.go` - {{description}}
86
+ - `path/to/new_file_test.go` - Tests for {{what}}
108
87
 
109
- ---
88
+ **Implementation Steps:**
89
+ 1. Read documentation links above
90
+ 2. {{step_2}}
91
+ 3. {{step_3}}
92
+ 4. Write tests covering: happy path, errors, edge cases
93
+ 5. Run: `go test ./path/to/...`
94
+
95
+ **Acceptance Criteria:**
96
+ - [ ] Files created at specified paths
97
+ - [ ] Follows patterns from AGENTS.md
98
+ - [ ] Tests pass: `go test ./path/to/...`
99
+ - [ ] Lint passes: `golangci-lint run`
110
100
 
111
- ### T1: Domain Layer (Aggregates, Value Objects)
112
- - **Estimate:** 6h
113
- - **Depends on:** -
114
- - **Blocks:** T2
115
- - **Deliverables:**
116
- - [ ] Interface/contract defined
117
- - [ ] Value objects with validation
118
- - [ ] Aggregate with business rules
119
- - [ ] Factory methods
120
- - **Validation Test:**
121
- - [ ] Value object tests (validation, equality)
122
- - [ ] Aggregate creation tests
123
- - [ ] Business rules tests
124
- - [ ] **⚠️ ALL TESTS MUST PASS**
125
- - **Notes:** {{implementation_hint}}
101
+ **Notes:** {{additional_context_or_gotchas}}
126
102
 
127
103
  ---
128
104
 
129
- ### T2: Repository Interface + Use Case Tests
130
- - **Estimate:** 5h
131
- - **Depends on:** T1
132
- - **Blocks:** T3, T4
133
- - **Deliverables:**
134
- - [ ] Repository interface (ports)
135
- - [ ] Use case interface
136
- - [ ] Use case DTOs (input/output)
137
- - [ ] Use case tests (with mock repository)
138
- - **Validation Test:**
139
- - [ ] Use case happy path test
140
- - [ ] Use case error handling tests
141
- - [ ] **⚠️ ALL TESTS MUST PASS**
142
- - **Notes:** {{implementation_hint}}
105
+ ### T2: {{task_2_name}}
143
106
 
144
- ---
107
+ **Goal:** {{what_this_task_achieves}}
145
108
 
146
- ### T3: Use Case Implementation
147
- - **Estimate:** 5h
148
- - **Depends on:** T2
149
- - **Blocks:** T5
150
- - **Deliverables:**
151
- - [ ] Use case handler implementation
152
- - [ ] Mappers (entity ↔ DTO)
153
- - [ ] Error handling
154
- - **Validation Test:**
155
- - [ ] All use case tests pass
156
- - [ ] Edge cases covered
157
- - [ ] **⚠️ ALL TESTS MUST PASS**
158
- - **Notes:** {{implementation_hint}}
109
+ **Documentation:**
110
+ - [AGENTS.md#section](link) - {{pattern}}
111
+ - [T1 output](../path/from/T1) - Uses types from T1
159
112
 
160
- ---
113
+ **Input (Prerequisites):**
114
+ - T1 completed
115
+ - Files from T1: `path/to/aggregate.go`
161
116
 
162
- ### T4: Repository Implementation
163
- - **Estimate:** 6h
164
- - **Depends on:** T2
165
- - **Blocks:** T5
166
- - **Deliverables (TDD):**
167
- - [ ] Write repository tests first
168
- - [ ] PostgreSQL repository implementation
169
- - **Deliverables (STUB):**
170
- - [ ] In-memory stub first
171
- - [ ] PostgreSQL implementation
172
- - **Validation Test:**
173
- - [ ] Test Save
174
- - [ ] Test FindByID (found/not found)
175
- - [ ] Test List with filters
176
- - [ ] **⚠️ ALL TESTS MUST PASS**
177
- - **Notes:** {{implementation_hint}}
117
+ **Output (Deliverables):**
118
+ - `path/to/file.go` - {{description}}
119
+ - `path/to/file_test.go` - Tests
178
120
 
179
- ---
121
+ **Implementation Steps:**
122
+ 1. {{step}}
123
+ 2. {{step}}
180
124
 
181
- ### T5: HTTP Handlers + Integration Tests
182
- - **Estimate:** 5h
183
- - **Depends on:** T3, T4
184
- - **Blocks:** -
185
- - **Deliverables:**
186
- - [ ] HTTP handler/controller
187
- - [ ] Routes registered
188
- - [ ] Request/response validation
189
- - [ ] Integration tests
190
- - [ ] Documentation updated
191
- - **Validation Test:**
192
- - [ ] Test 201 Created
193
- - [ ] Test 400 Bad Request (validation)
194
- - [ ] Test 404 Not Found
195
- - [ ] E2E: API → Service → Repo → DB
196
- - [ ] **⚠️ ALL TESTS MUST PASS**
197
- - [ ] **⚠️ NO REGRESSIONS**
198
- - **Notes:** {{implementation_hint}}
125
+ **Acceptance Criteria:**
126
+ - [ ] {{criterion}}
127
+ - [ ] Tests pass
128
+
129
+ **Notes:** {{notes}}
199
130
 
200
131
  ---
201
132
 
202
- ### Execution Phases
133
+ ### T3: {{task_3_name}}
134
+
135
+ **Goal:** {{goal}}
136
+
137
+ **Documentation:**
138
+ - {{links}}
139
+
140
+ **Input (Prerequisites):**
141
+ - T2 completed
142
+ - {{dependencies}}
143
+
144
+ **Output (Deliverables):**
145
+ - {{files}}
146
+
147
+ **Implementation Steps:**
148
+ 1. {{steps}}
203
149
 
204
- | Phase | Tasks (Parallel) | Duration | Tests Required |
205
- |-------|-----------------|----------|----------------|
206
- | 1 | T1 | 6h | Domain layer tests |
207
- | 2 | T2 | 5h | Use case tests |
208
- | 3 | T3, T4 | 6h | Implementation tests |
209
- | 4 | T5 | 5h | Integration tests |
210
- | **Total** | | **22h** | **All green** |
150
+ **Acceptance Criteria:**
151
+ - [ ] {{criteria}}
152
+ - [ ] All tests pass
153
+ - [ ] **⚠️ NO REGRESSIONS** (run full test suite)
211
154
 
212
- **Critical Path:** T1 → T2 → T3 → T5 = 21h (~3 days)
213
- **With Parallelism (T3 || T4):** ~2.5 days
155
+ **Notes:** {{notes}}
214
156
 
215
157
  ---
216
158