@comfanion/workflow 3.8.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.8.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:01:07.473Z",
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.8.0"
9
+ version: "4.0.0"
10
10
 
11
11
  # =============================================================================
12
12
  # USER CONFIGURATION
@@ -168,15 +168,15 @@ Track which FRs are covered:
168
168
 
169
169
  ```
170
170
  EPIC (1-2 weeks)
171
- └── STORY (1-3 days)
172
- └── TASK (1-2 hours)
171
+ └── STORY (2-5 days)
172
+ └── TASK (4-6 hours)
173
173
  ```
174
174
 
175
175
  | Level | Duration | Count | Deliverable |
176
176
  |-------|----------|-------|-------------|
177
177
  | **Epic** | 1-2 weeks | 1 | Complete feature |
178
- | **Story** | 1-3 days | 3-8 per epic | User-facing capability |
179
- | **Task** | 1-2 hours | 4-10 per story | Atomic code change |
178
+ | **Story** | 2-5 days | 3-8 per epic | User-facing capability |
179
+ | **Task** | 4-6 hours | 3-6 per story | Atomic code change with tests |
180
180
 
181
181
  ### Story Decomposition Pattern
182
182
 
@@ -206,40 +206,41 @@ 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 | 6 | 8h | 1d |
217
- | S02 | 3 | 4h | 0.5d |
218
- | S03 | 8 | 12h | 1.5d |
219
- | S04 | 6 | 9h | 1d |
220
- | S05 | 5 | 7h | 1d |
221
- | S06 | 4 | 5h | 0.5d |
222
- | S07 | 4 | 6h | 1d |
223
- | **Total** | **36** | **51h** | **6.5d** |
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:** ~5 days
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
232
233
 
233
234
  - **Duration:** 1-2 weeks of work
234
235
  - **Stories:** 3-8 stories per epic
235
- - **Tasks:** 25-60 tasks per epic (total across stories)
236
+ - **Tasks:** 15-35 tasks per epic (total across stories)
236
237
  - **Scope:** One logical feature/capability
237
238
 
238
239
  ### Too Big? Split it!
239
240
 
240
241
  Signs an epic is too big:
241
242
  - More than 10 stories
242
- - More than 80 tasks total
243
+ - More than 40 tasks total
243
244
  - Spans multiple sprints
244
245
  - Multiple unrelated features
245
246
  - Different team members for different parts
@@ -248,8 +249,8 @@ Signs an epic is too big:
248
249
 
249
250
  Signs an epic is too small:
250
251
  - Only 1-2 stories
251
- - Less than 15 tasks
252
- - Can be done in 2-3 days
252
+ - Less than 8 tasks
253
+ - Can be done in 3-4 days
253
254
  - Part of a larger feature
254
255
 
255
256
  ### Parallel Execution Opportunities
@@ -261,11 +262,11 @@ Identify which stories can run in parallel:
261
262
 
262
263
  | Phase | Stories (Parallel) | Duration |
263
264
  |-------|-------------------|----------|
264
- | 1 | S01 | 1d |
265
- | 2 | S02, S03 | 1.5d |
266
- | 3 | S04, S05 | 1d |
267
- | 4 | S06 | 0.5d |
268
- | 5 | S07 | 1d |
265
+ | 1 | S01 | 2.5d |
266
+ | 2 | S02, S03 | 3d |
267
+ | 3 | S04, S05 | 3d |
268
+ | 4 | S06 | 2d |
269
+ | 5 | S07 | 2d |
269
270
  | **Total** | | **5d** |
270
271
 
271
272
  **Sequential would be:** 6.5d
@@ -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 (1-2 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
- | **Max 2 hours** | No task should exceed 2 hours of 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,208 +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
243
- - **Estimate:** 1.5h
244
- - **Depends on:** T1
245
- - **Methodology:** TDD
246
- - **Deliverables:**
247
- - [ ] Aggregate: `domain/aggregate/entity.go`
248
- - **Validation Test:** `domain/aggregate/entity_test.go`
249
- - [ ] Test creation happy path
250
- - [ ] Test validation errors
251
- - [ ] **⚠️ ALL TESTS MUST PASS**
252
- ```
246
+ Each task MUST have this structure to be self-contained:
253
247
 
254
- **STUB Task:**
255
248
  ```markdown
256
- ### T2: Implement Repository (Stub → Real)
257
- - **Estimate:** 1.5h
258
- - **Depends on:** T1
259
- - **Methodology:** STUB
260
- - **Deliverables:**
261
- - [ ] Stub: `infrastructure/repo/entity_memory_repo.go`
262
- - [ ] Real: `infrastructure/repo/entity_postgres_repo.go`
263
- - **Validation Test:** `infrastructure/repo/entity_repo_test.go`
264
- - [ ] Test with stub first
265
- - [ ] Replace stub with real
266
- - [ ] **⚠️ ALL TESTS MUST PASS**
267
- ```
249
+ ### T{N}: {Clear Task Name}
268
250
 
269
- ---
270
-
271
- ### Task Types
251
+ **Goal:** One sentence describing what this task achieves.
272
252
 
273
- | Type | Icon | Description |
274
- |------|------|-------------|
275
- | INTERFACE | 📐 | Define interface/contract |
276
- | RED | 🔴 | Write failing test first (TDD) |
277
- | GREEN | 🟢 | Implement to pass tests |
278
- | STUB | 🧪 | Stub implementation (STUB methodology) |
279
- | REFACTOR | 🔵 | Clean up, no new functionality |
280
- | INTEGRATION | 🔗 | E2E integration test |
281
- | 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
282
257
 
283
- ### 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`
284
262
 
285
- ```markdown
286
- ### T{N}: {Task Name}
287
- - **Estimate:** 1h | 1.5h | 2h
288
- - **Depends on:** T1, T2 | - (none)
289
- - **Blocks:** T5, T6 | - (none)
290
- - **Type:** 🔴 RED | 🟢 GREEN | 🔵 REFACTOR | 📝 DOCS
291
- - **Files:** `path/to/file.go`
292
- - **Definition of Done:**
293
- - [ ] Specific deliverable 1
294
- - [ ] Specific deliverable 2
295
- - **Notes:** Implementation hints
296
- ```
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
297
266
 
298
- ### 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
299
273
 
300
- 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`
301
279
 
280
+ **Notes:** Additional hints, gotchas, or context
302
281
  ```
303
- T1 ──┬──► T2 ──► T4
304
- │ │
305
- └──► T3 ────┴──► T5 ──► T6
306
- ```
307
282
 
308
- - `──►` = depends on (must complete before)
309
- - `┬` = fork (parallel branches)
310
- - `┴` = 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 |
311
293
 
312
- ### Summary Table (MANDATORY)
294
+ ### Tasks Summary Table
313
295
 
314
296
  ```markdown
315
- | ID | Task | Est | Depends On | Status |
316
- |----|------|-----|------------|--------|
317
- | T1 | Write aggregate test | 1h | - | ⬜ |
318
- | T2 | Implement aggregate | 1.5h | T1 | ⬜ |
319
- | T3 | Write repository interface | 0.5h | T1 | ⬜ |
320
- | T4 | Write use case test | 1h | T2 | ⬜ |
321
- | T5 | Implement use case | 1.5h | T3, T4 | ⬜ |
322
- | T6 | Implement repository | 1.5h | T3 | ⬜ |
323
- | T7 | Write HTTP handler test | 1h | T5 | ⬜ |
324
- | T8 | Implement HTTP handler | 1h | T7 | ⬜ |
325
- | T9 | Integration tests | 1.5h | T6, T8 | ⬜ |
326
- | T10 | Refactor & docs | 1h | T9 | ⬜ |
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 | ⬜ |
327
304
  ```
328
305
 
329
306
  **Status:** ⬜ TODO | 🔄 IN_PROGRESS | ✅ DONE | ⏸️ BLOCKED
330
307
 
331
- ### Execution Phases
332
-
333
- Group tasks by parallel execution opportunity:
334
-
335
- ```markdown
336
- ### Execution Order
337
-
338
- Phase 1: T1 (no deps)
339
- Phase 2: T2, T3 (parallel - both depend only on T1)
340
- Phase 3: T4, T6 (parallel - independent branches)
341
- Phase 4: T5 (waits for T3, T4)
342
- Phase 5: T7 (waits for T5)
343
- Phase 6: T8, T6-continued (parallel)
344
- Phase 7: T9 (waits for T6, T8)
345
- Phase 8: T10 (final)
346
-
347
- **Critical Path:** T1 → T2 → T4 → T5 → T7 → T8 → T9 → T10
348
- **Total Estimate:** 12h
349
- **Parallel Savings:** ~3h (25%)
350
- ```
308
+ ### Dependency Graph (Optional)
351
309
 
352
- ### Example: CreateProduct Story Tasks
353
-
354
- ```markdown
355
- | ID | Task | Est | Depends On | Type |
356
- |----|------|-----|------------|------|
357
- | T1 | Write Product aggregate test | 1h | - | 🔴 |
358
- | T2 | Implement Product aggregate | 1.5h | T1 | 🟢 |
359
- | T3 | Write ProductRepository interface | 0.5h | - | 📝 |
360
- | T4 | Write CreateProduct use case test | 1h | T2, T3 | 🔴 |
361
- | T5 | Implement CreateProduct handler | 1.5h | T4 | 🟢 |
362
- | T6 | Implement PostgreSQL repository | 1.5h | T3 | 🟢 |
363
- | T7 | Write HTTP handler test | 1h | T5 | 🔴 |
364
- | T8 | Implement HTTP handler | 1h | T7 | 🟢 |
365
- | T9 | Write integration tests | 1.5h | T6, T8 | 🔴 |
366
- | T10 | Refactor & documentation | 1h | T9 | 🔵 |
367
-
368
- **Graph:**
369
- T1 ──► T2 ──┬──► T4 ──► T5 ──► T7 ──► T8 ──┬──► T9 ──► T10
370
- │ │
371
- T3 ─────────┴───────────► T6 ───────────────┘
372
310
  ```
373
-
374
- ### Splitting Large Tasks
375
-
376
- If a task exceeds 2h, split it. **Each split task MUST have validation test.**
377
-
378
- | Original (4h) | Split Into (with tests) |
379
- |---------------|------------------------|
380
- | "Implement repository" | **T1:** Interface + contract test (0.5h)<br>**T2:** Save method + test (1h)<br>**T3:** FindByID + test (1h)<br>**T4:** List + test (1.5h) |
381
- | "Write aggregate" | **T1:** Value objects + tests (1h)<br>**T2:** Aggregate + creation test (1h)<br>**T3:** Business rules + tests (1h) |
382
-
383
- ### Task Template with Validation
384
-
385
- ```markdown
386
- ### T{N}: {Task Name}
387
- - **Estimate:** 1.5h
388
- - **Depends on:** T{N-1}
389
- - **Methodology:** TDD | STUB
390
- - **Deliverables:**
391
- - [ ] File: `path/to/implementation.go`
392
- - [ ] File: `path/to/implementation2.go`
393
- - **Validation Test:** `path/to/implementation_test.go`
394
- - [ ] Test case 1: happy path
395
- - [ ] Test case 2: error handling
396
- - [ ] Test case 3: edge case
397
- - [ ] **⚠️ ALL TESTS MUST PASS** ← MANDATORY
398
- - **Notes:** Implementation hints
311
+ T1 ──► T2 ──┬──► T3 ──┬──► T5
312
+ │ │
313
+ └──► T4 ──┘
399
314
  ```
400
315
 
401
- ### Validation Test Requirements
402
-
403
- **Every task MUST have:**
404
-
405
- | Test Type | Required | Description |
406
- |-----------|----------|-------------|
407
- | Happy path | ✅ Yes | Normal success case |
408
- | Error handling | ✅ Yes | Expected failures |
409
- | Edge cases | Recommended | Boundary conditions |
410
- | **Pass gate** | ✅ MANDATORY | `⚠️ ALL TESTS MUST PASS` |
316
+ ---
411
317
 
412
- ### TDD vs STUB Task Examples
318
+ ## Full Task Example
413
319
 
414
- **TDD Example:**
415
- ```markdown
416
- ### T2: Implement Product Aggregate
417
- - **Methodology:** TDD
418
- - **Deliverables:**
419
- - [ ] `domain/aggregate/product.go`
420
- - **Validation Test:** `domain/aggregate/product_test.go`
421
- - [ ] 🔴 Write test first (should FAIL)
422
- - [ ] 🟢 Implement until test PASSES
423
- - [ ] 🔵 Refactor, tests still PASS
424
- - [ ] **⚠️ ALL TESTS MUST PASS**
425
- ```
320
+ Here's a complete example of a self-contained task:
426
321
 
427
- **STUB Example:**
428
322
  ```markdown
429
- ### T4: Implement Repository
430
- - **Methodology:** STUB
431
- - **Deliverables:**
432
- - [ ] Stub: `infrastructure/repo/product_memory_repo.go`
433
- - [ ] Real: `infrastructure/repo/product_postgres_repo.go`
434
- - **Validation Test:** `infrastructure/repo/product_repo_test.go`
435
- - [ ] 🧪 Write stub (mock data)
436
- - [ ] Write tests against stub
437
- - [ ] 🟢 Replace with real impl
438
- - [ ] **⚠️ ALL TESTS MUST PASS**
439
- ```
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)
440
375
 
441
376
  ## Definition of Done
442
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 1-3 days
88
- 2. Have 4-10 atomic tasks (1-2h 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 | 6 | 8h |
107
- | Application | 1 | 8 | 12h |
108
- | Infrastructure | 2 | 9 | 14h |
109
- | Testing | 1 | 4 | 6h |
110
- | **Total** | **5** | **27** | **40h** |
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,177 +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 1-2 hours max
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}} | 1h | - | unit | ⬜ |
102
- | T2 | {{task_2}} | 1.5h | T1 | unit | ⬜ |
103
- | T3 | {{task_3}} | 1h | T2 | unit | ⬜ |
104
- | T4 | {{task_4}} | 1.5h | T1 | unit | ⬜ |
105
- | T5 | {{task_5}} | 1h | T4 | unit | ⬜ |
106
- | T6 | {{task_6}} | 1.5h | T3,T5 | integration | ⬜ |
80
+ **Input (Prerequisites):**
81
+ - {{what_must_exist_before_starting}}
82
+ - Existing file: `path/to/dependency.go` - provides {{what}}
107
83
 
108
- **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}}
109
87
 
110
- ---
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`
111
100
 
112
- ### T1: Define {{entity}} Interface
113
- - **Estimate:** 1h
114
- - **Depends on:** -
115
- - **Blocks:** T2, T4
116
- - **Deliverables:**
117
- - [ ] Interface/contract defined
118
- - [ ] Value objects defined (if needed)
119
- - **Validation Test:**
120
- - [ ] Contract test (compile/type check)
121
- - **Notes:** {{implementation_hint}}
101
+ **Notes:** {{additional_context_or_gotchas}}
122
102
 
123
103
  ---
124
104
 
125
- ### T2: Implement {{entity}} Entity/Model
126
- - **Estimate:** 1.5h
127
- - **Depends on:** T1
128
- - **Blocks:** T3
129
- - **Deliverables:**
130
- - [ ] Entity/model with business logic
131
- - [ ] Factory method with validation
132
- - **Validation Test:**
133
- - [ ] Test creation happy path
134
- - [ ] Test validation errors
135
- - [ ] Test business rules
136
- - [ ] **⚠️ ALL TESTS MUST PASS**
137
- - **Notes:** {{implementation_hint}}
105
+ ### T2: {{task_2_name}}
138
106
 
139
- ---
107
+ **Goal:** {{what_this_task_achieves}}
140
108
 
141
- ### T3: Implement Use Case / Service
142
- - **Estimate:** 1h
143
- - **Depends on:** T2
144
- - **Blocks:** T6
145
- - **Deliverables:**
146
- - [ ] Use case handler/service
147
- - [ ] Input/Output DTOs
148
- - [ ] Mappers (entity ↔ DTO)
149
- - **Validation Test:**
150
- - [ ] Test happy path (mock repository)
151
- - [ ] Test validation errors
152
- - [ ] **⚠️ ALL TESTS MUST PASS**
153
- - **Notes:** {{implementation_hint}}
109
+ **Documentation:**
110
+ - [AGENTS.md#section](link) - {{pattern}}
111
+ - [T1 output](../path/from/T1) - Uses types from T1
154
112
 
155
- ---
113
+ **Input (Prerequisites):**
114
+ - T1 completed
115
+ - Files from T1: `path/to/aggregate.go`
156
116
 
157
- ### T4: Implement Repository / Data Access
158
- - **Estimate:** 1.5h
159
- - **Depends on:** T1
160
- - **Blocks:** T5
161
- - **Deliverables (TDD):**
162
- - [ ] Write test first
163
- - [ ] Implement repository
164
- - **Deliverables (STUB):**
165
- - [ ] In-memory stub first
166
- - [ ] Real implementation
167
- - **Validation Test:**
168
- - [ ] Test Save
169
- - [ ] Test FindByID
170
- - [ ] Test FindByID not found
171
- - [ ] **⚠️ ALL TESTS MUST PASS**
172
- - **Notes:** {{implementation_hint}}
117
+ **Output (Deliverables):**
118
+ - `path/to/file.go` - {{description}}
119
+ - `path/to/file_test.go` - Tests
173
120
 
174
- ---
121
+ **Implementation Steps:**
122
+ 1. {{step}}
123
+ 2. {{step}}
124
+
125
+ **Acceptance Criteria:**
126
+ - [ ] {{criterion}}
127
+ - [ ] Tests pass
175
128
 
176
- ### T5: Implement API Handler
177
- - **Estimate:** 1h
178
- - **Depends on:** T4
179
- - **Blocks:** T6
180
- - **Deliverables:**
181
- - [ ] API handler/controller
182
- - [ ] Routes registered
183
- - **Validation Test:**
184
- - [ ] Test 201 Created
185
- - [ ] Test 400 Bad Request
186
- - [ ] Test 403 Forbidden
187
- - [ ] **⚠️ ALL TESTS MUST PASS**
188
- - **Notes:** {{implementation_hint}}
129
+ **Notes:** {{notes}}
189
130
 
190
131
  ---
191
132
 
192
- ### T6: Integration Test & Refactor
193
- - **Estimate:** 1.5h
194
- - **Depends on:** T3, T5
195
- - **Blocks:** -
196
- - **Deliverables:**
197
- - [ ] Integration test
198
- - [ ] Code refactored, no smells
199
- - [ ] Documentation updated
200
- - **Validation Test:**
201
- - [ ] E2E: API → Service → Repo → DB
202
- - [ ] Event published (if applicable)
203
- - [ ] **⚠️ ALL TESTS MUST PASS**
204
- - [ ] **⚠️ NO REGRESSIONS**
205
- - **Notes:** {{implementation_hint}}
133
+ ### T3: {{task_3_name}}
206
134
 
207
- ---
135
+ **Goal:** {{goal}}
136
+
137
+ **Documentation:**
138
+ - {{links}}
139
+
140
+ **Input (Prerequisites):**
141
+ - T2 completed
142
+ - {{dependencies}}
143
+
144
+ **Output (Deliverables):**
145
+ - {{files}}
208
146
 
209
- ### Execution Phases
147
+ **Implementation Steps:**
148
+ 1. {{steps}}
210
149
 
211
- | Phase | Tasks (Parallel) | Duration | Tests Required |
212
- |-------|-----------------|----------|----------------|
213
- | 1 | T1 | 1h | Interface contract |
214
- | 2 | T2, T4 | 1.5h | Unit tests |
215
- | 3 | T3, T5 | 1h | Unit tests |
216
- | 4 | T6 | 1.5h | Integration tests |
217
- | **Total** | | **5h** | **All green** |
150
+ **Acceptance Criteria:**
151
+ - [ ] {{criteria}}
152
+ - [ ] All tests pass
153
+ - [ ] **⚠️ NO REGRESSIONS** (run full test suite)
218
154
 
219
- **Critical Path:** T1 → T2 → T3 → T6 = 5h
220
- **With Parallelism:** ~4h
155
+ **Notes:** {{notes}}
221
156
 
222
157
  ---
223
158
 
@@ -363,9 +363,9 @@ Read from `config.yaml → development.methodology`:
363
363
  <output>
364
364
  | ID | Task | Est | Depends On | Status |
365
365
  |----|------|-----|------------|--------|
366
- | T1 | ... | 1h | - | ✅ |
367
- | T2 | ... | 1.5h | T1 | 🔄 | ← Current
368
- | T3 | ... | 1h | T1 | ⬜ | ← Can run parallel with T2
366
+ | T1 | ... | 5h | - | ✅ |
367
+ | T2 | ... | 6h | T1 | 🔄 | ← Current
368
+ | T3 | ... | 5h | T1 | ⬜ | ← Can run parallel with T2
369
369
  </output>
370
370
  </step>
371
371
  ```