@comfanion/workflow 4.1.2 → 4.3.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.
Files changed (46) hide show
  1. package/README.md +1 -2
  2. package/bin/cli.js +2 -4
  3. package/package.json +1 -1
  4. package/src/build-info.json +1 -1
  5. package/src/opencode/ARCHITECTURE.md +7 -6
  6. package/src/opencode/FLOW.yaml +10 -10
  7. package/src/opencode/agents/coder.md +82 -0
  8. package/src/opencode/agents/dev.md +10 -0
  9. package/src/opencode/commands/architecture.md +1 -1
  10. package/src/opencode/commands/prd.md +1 -1
  11. package/src/opencode/config.yaml +1 -1
  12. package/src/opencode/skills/adr-writing/SKILL.md +122 -159
  13. package/src/opencode/skills/adr-writing/template.md +130 -0
  14. package/src/opencode/skills/architecture-design/SKILL.md +113 -107
  15. package/src/opencode/skills/architecture-design/template.md +212 -0
  16. package/src/opencode/skills/architecture-validation/SKILL.md +1 -1
  17. package/src/opencode/skills/changelog/template.md +23 -0
  18. package/src/opencode/skills/epic-writing/SKILL.md +116 -264
  19. package/src/opencode/skills/epic-writing/template.md +119 -0
  20. package/src/opencode/skills/prd-validation/SKILL.md +1 -1
  21. package/src/opencode/skills/prd-writing/SKILL.md +79 -43
  22. package/src/opencode/skills/prd-writing/template.md +147 -0
  23. package/src/opencode/skills/requirements-gathering/SKILL.md +128 -78
  24. package/src/opencode/skills/requirements-gathering/template.md +156 -0
  25. package/src/opencode/skills/story-writing/SKILL.md +106 -464
  26. package/src/opencode/skills/story-writing/template.md +214 -0
  27. package/src/opencode/skills/unit-writing/SKILL.md +185 -0
  28. package/src/opencode/skills/unit-writing/template.md +136 -0
  29. package/src/repo-structure/docs/README.md +5 -5
  30. package/src/repo-structure/docs/requirements/README.md +1 -1
  31. package/src/opencode/templates/CHANGELOG.md +0 -82
  32. package/src/opencode/templates/adr-template.md +0 -115
  33. package/src/opencode/templates/architecture-template.md +0 -362
  34. package/src/opencode/templates/epic-template.md +0 -166
  35. package/src/opencode/templates/prd-template.md +0 -479
  36. package/src/opencode/templates/requirements-template.md +0 -132
  37. package/src/opencode/templates/story-template.md +0 -182
  38. /package/src/opencode/{templates/prd-acceptance-criteria-template.md → skills/acceptance-criteria/template.md} +0 -0
  39. /package/src/opencode/{templates/change-proposal-template.md → skills/archiving/template-change-proposal.md} +0 -0
  40. /package/src/opencode/{templates/git-workflow-template.md → skills/coding-standards/template-git.md} +0 -0
  41. /package/src/opencode/{templates/testing-standards-template.md → skills/coding-standards/template-testing.md} +0 -0
  42. /package/src/opencode/{templates/jira-cache-template.yaml → skills/jira-integration/template-cache.yaml} +0 -0
  43. /package/src/opencode/{templates/module-index-template.md → skills/module-documentation/template.md} +0 -0
  44. /package/src/opencode/{templates/sprint-status-template.yaml → skills/sprint-planning/template.yaml} +0 -0
  45. /package/src/opencode/{templates/integration-tests-template.md → skills/test-design/template-integration.md} +0 -0
  46. /package/src/opencode/{templates/module-test-cases-template.md → skills/test-design/template-module.md} +0 -0
@@ -18,528 +18,169 @@ Use this skill when you need to:
18
18
  - Define technical implementation tasks
19
19
  - Specify test scenarios
20
20
 
21
- ## MANDATORY: Read Before Writing Tasks
22
-
23
- **⚠️ STOP! Before writing ANY task, execute these steps:**
24
-
25
- ### Step 1: Find and Read Coding Standards
26
-
27
- ```bash
28
- # Execute these Glob searches:
29
- Glob "**/AGENTS.md" OR "**/CLAUDE.md" # → Read the file found
30
- Glob "**/coding-standards/**/*.md" # → Read ALL files found
31
- Glob "**/testing-standards*.md" # → Read if exists
32
- ```
33
-
34
- **You MUST read these files before writing tasks!**
35
-
36
- ### Step 2: Find and Read Module Architecture
37
-
38
- ```bash
39
- # For the module this story covers (e.g., "catalog"):
40
- Glob "**/docs/**/catalog/**/*.md" # → Read architecture docs
41
- Glob "**/catalog-data-model*.md" # → Read data model
42
- ```
43
-
44
- ### Step 3: Find and Read Existing Code Patterns
45
-
46
- ```bash
47
- # Find existing code to use as patterns:
48
- Glob "**/src/services/[module]/modules/*/domain/entity/*.go" # → Example entities
49
- Glob "**/src/services/[module]/modules/*/domain/valueobject/*.go" # → Example VOs
50
- Glob "**/src/services/[module]/modules/*/application/usecase/*" # → Example use cases
51
- ```
52
-
53
- **Pick 1-2 existing files as patterns for Documentation links in tasks.**
54
-
55
- ### Step 4: Read Parent Epic
56
-
57
- ```bash
58
- Glob "**/epic-[NN]*.md" # → Find and read the epic
59
- ```
60
-
61
- ### Pre-Story Checklist
62
-
63
- Before writing tasks, confirm you executed:
64
- - [ ] **Glob + Read** AGENTS.md/CLAUDE.md
65
- - [ ] **Glob + Read** coding-standards/*.md (ALL files)
66
- - [ ] **Glob + Read** module architecture and data-model
67
- - [ ] **Glob + Read** existing code patterns (at least 2 files)
68
- - [ ] **Read** parent epic
69
-
70
- **⛔ DO NOT WRITE TASKS WITHOUT COMPLETING ALL STEPS ABOVE!**
71
- **Tasks without proper Documentation links = REJECTED.**
72
-
73
- ### Task File Paths
74
-
75
- When defining tasks, use EXACT paths following project structure:
76
- ```
77
- src/services/[module]/
78
- ├── cmd/api/main.go
79
- ├── modules/[submodule]/
80
- │ ├── domain/
81
- │ │ ├── aggregate/[entity].go ← Domain entities
82
- │ │ ├── valueobject/[vo].go ← Value objects
83
- │ │ └── repository/[repo].go ← Repository interfaces
84
- │ ├── application/
85
- │ │ └── usecase/[UseCase]/ ← Use case (4 files)
86
- │ │ ├── inport.go
87
- │ │ ├── dto.go
88
- │ │ ├── handler.go
89
- │ │ └── mappers.go
90
- │ └── infrastructure/
91
- │ ├── repo/[entity]_postgres.go ← Repository impl
92
- │ └── http/[handler].go ← HTTP handlers
93
- ```
94
-
95
- ---
96
-
97
21
  ## Template
98
22
 
99
- Use template at: `@.opencode/templates/story-template.md`
100
-
101
- ## Story Structure
102
-
103
- **Philosophy:** Story = execution plan. Tasks are the main content, not ceremony.
23
+ Use template at: `@.opencode/skills/story-writing/template.md`
104
24
 
105
- ### Header (Minimal)
25
+ ## MANDATORY: Read Before Writing
106
26
 
107
- ```markdown
108
- # Story N.M: [Title]
27
+ **Before writing ANY story, read these documents:**
109
28
 
110
- **Story ID:** [MODULE]-S[EPIC]-[NN]
111
- **Epic:** [MODULE]-E[EPIC] - [Epic Title]
112
- **Status:** draft | ready-for-dev | in-progress | review | done
113
- **Size:** XS | S | M | L | XL
114
- ```
29
+ | Document | Why |
30
+ |----------|-----|
31
+ | `CLAUDE.md` | Project patterns, conventions |
32
+ | `docs/coding-standards/` | **MANDATORY** code style |
33
+ | → Unit docs for affected units | Data models, operations |
34
+ | → Parent epic | Context, decisions |
115
35
 
116
- ### Goal (1-2 sentences)
36
+ ## Story Structure (v2)
117
37
 
118
- ```markdown
119
- ## Goal
38
+ ### 1. Header
120
39
 
121
- Implement CRUD use cases for merchant products with validation and event publishing.
40
+ ```yaml
41
+ id: {{PREFIX}}-S{{E}}-{{N}}
42
+ epic: {{PREFIX}}-E{{E}}
43
+ status: draft | ready | in_progress | review | done
44
+ size: S | M | L
122
45
  ```
123
46
 
124
- **NOT** the verbose "As a... I want... So that..." format. Just state what the story achieves.
47
+ ### 2. Goal
125
48
 
126
- ### Acceptance Criteria (Brief List)
49
+ One sentence + context + out of scope:
127
50
 
128
51
  ```markdown
129
- ## Acceptance Criteria
130
-
131
- - [ ] Products can be created with EAN validation
132
- - [ ] Products can be retrieved by ID
133
- - [ ] Products can be updated with optimistic locking
134
- - [ ] Products can be listed with filters and pagination
135
- - [ ] All operations publish domain events
136
- ```
137
-
138
- **NOT** detailed Given/When/Then for each. Just a checklist of what "done" looks like.
139
-
140
- ### Tasks (MAIN CONTENT - 80% of file)
141
-
142
- Self-contained tasks with documentation links. See Task Structure below.
143
-
144
- ### Sections (Simplified)
145
-
146
- 1. **Header** - Minimal metadata
147
- 2. **Goal** - 1-2 sentences
148
- 3. **Acceptance Criteria** - Brief checklist
149
- 4. **Tasks** - MAIN CONTENT (80% of file)
150
- 5. **Notes** - Optional additional context
151
-
152
- ## Naming Conventions
153
-
154
- ### File Naming
155
-
156
- ```
157
- story-[EPIC]-[NN]-[description].md
158
-
159
- Examples:
160
- - story-05-01-product-aggregate.md
161
- - story-05-02-product-repository.md
162
- - story-05-03-product-http-endpoints.md
163
- ```
52
+ ## Goal
164
53
 
165
- ### Story ID Format
54
+ Implement CRUD operations for Task entity.
166
55
 
167
- ```
168
- [MODULE]-S[EPIC]-[NN]
56
+ **Context:** Part of Epic 1 (Task Management). Focuses on domain layer.
169
57
 
170
- Examples:
171
- - CATALOG-S05-01
172
- - CATALOG-S05-02
173
- - INVENTORY-S10-01
58
+ **Out of Scope:**
59
+ - HTTP handlers (separate story)
174
60
  ```
175
61
 
176
- ## Self-Contained Tasks (NO ESTIMATES)
62
+ ### 3. Units Affected
177
63
 
178
- ### Task Philosophy
64
+ | Unit | Action | Description |
65
+ |------|--------|-------------|
66
+ | → Unit: `Task` | Create | New entity |
179
67
 
180
- **CRITICAL:** Tasks must be **SELF-CONTAINED** - an AI agent or developer can take ANY task and execute it independently without asking questions.
68
+ ### 4. Required Reading
181
69
 
182
- **NO ESTIMATES** - Don't estimate time. Focus on clear scope and outcomes.
70
+ **CRITICAL SECTION** - List all docs developer must read:
183
71
 
184
- ### Task Decomposition Rules
72
+ | Document | Section | Why |
73
+ |----------|---------|-----|
74
+ | → `CLAUDE.md` | All | Project patterns |
75
+ | → `docs/coding-standards/` | All | **MANDATORY** |
76
+ | → Unit: `Task` | Data Model | Field definitions |
77
+ | → `docs/architecture.md` | Task Module | Structure |
185
78
 
186
- | Rule | Description |
187
- |------|-------------|
188
- | **Self-contained** | Task has ALL information needed to execute |
189
- | **Documentation links** | Every task links to relevant docs, schemas, examples |
190
- | **Clear input/output** | What exists before, what must exist after |
191
- | **Testable outcome** | How to verify task is complete |
192
- | **Independent execution** | Can be picked up without context from other tasks |
79
+ ### 5. Acceptance Criteria
193
80
 
194
- ## Development Methodologies
81
+ Checklist format:
82
+ - [ ] User can create task
83
+ - [ ] Validation errors return proper codes
84
+ - [ ] Tests pass
85
+ - [ ] Follows coding-standards
195
86
 
196
- **Set in config.yaml:** `development.methodology: tdd | stub`
87
+ ### 6. Tasks
197
88
 
198
- ### TDD (Test-Driven Development)
89
+ Summary table + detailed tasks.
199
90
 
200
- ```
201
- Interface → Test (RED) → Implementation (GREEN) → Refactor
202
- ```
91
+ ### 7. Definition of Done
203
92
 
204
- | Step | Action | Validation |
205
- |------|--------|------------|
206
- | 1 | Define interface/contract | Compiles |
207
- | 2 | Write failing test | Test FAILS (RED) |
208
- | 3 | Implement minimal code | Test PASSES (GREEN) |
209
- | 4 | Refactor | Tests still PASS |
93
+ - [ ] All AC met
94
+ - [ ] Code follows `docs/coding-standards/`
95
+ - [ ] Tests pass
96
+ - [ ] Code reviewed
210
97
 
211
- **Best for:** New features, complex logic, when requirements are clear
98
+ ## Task Structure (MANDATORY)
212
99
 
213
- ### STUB (Stub-First Development)
214
-
215
- ```
216
- Interface → Stub Implementation → Tests → Real Implementation
217
- ```
218
-
219
- | Step | Action | Validation |
220
- |------|--------|------------|
221
- | 1 | Define interface/contract | Compiles |
222
- | 2 | Write stub (mock data) | Returns expected shape |
223
- | 3 | Write tests against stub | Tests PASS |
224
- | 4 | Replace stub with real impl | Tests still PASS |
225
-
226
- **Best for:** Exploratory work, unclear requirements, rapid prototyping
227
-
228
- ### Task Structure (MANDATORY FORMAT)
229
-
230
- Each task MUST have this structure to be self-contained:
100
+ Each task MUST be self-contained:
231
101
 
232
102
  ```markdown
233
- ### T{N}: {Clear Task Name}
234
-
235
- **Goal:** One sentence describing what this task achieves.
236
-
237
- **Documentation:**
238
- - [AGENTS.md#section](../../../AGENTS.md#section) - Relevant coding patterns
239
- - [data-model.md#table](../docs/data-model.md#table) - Database schema
240
- - [example.go](../src/path/example.go) - Pattern to follow
241
-
242
- **Input (Prerequisites):**
243
- - T{N-1} completed (if dependent)
244
- - Existing file: `path/to/existing.go` - what it provides
245
- - Repository interface defined in: `path/to/interface.go`
246
-
247
- **Output (Deliverables):**
248
- - `path/to/new_file.go` - Description of what this file does
249
- - `path/to/new_file_test.go` - Tests covering X, Y, Z
250
-
251
- **Implementation Steps:**
252
- 1. Read documentation links above
253
- 2. Create file structure following pattern from [example.go]
254
- 3. Implement X following AGENTS.md conventions
255
- 4. Write tests covering: happy path, validation errors, edge cases
256
- 5. Run tests, ensure all pass
257
-
258
- **Acceptance Criteria:**
259
- - [ ] File created at correct path
260
- - [ ] Follows naming conventions from AGENTS.md
261
- - [ ] All tests pass: `go test ./path/to/...`
262
- - [ ] No linting errors: `golangci-lint run`
263
-
264
- **Notes:** Additional hints, gotchas, or context
265
- ```
266
-
267
- ### Why This Structure?
103
+ ### T1: {{task_name}}
268
104
 
269
- | Section | Purpose |
270
- |---------|---------|
271
- | **Goal** | Agent knows the "why" |
272
- | **Documentation** | Agent can read all needed context |
273
- | **Input** | Agent knows what must exist before starting |
274
- | **Output** | Agent knows exactly what to create |
275
- | **Implementation Steps** | Agent has step-by-step guidance |
276
- | **Acceptance Criteria** | Agent can verify completion |
105
+ **Goal:** {{what_this_achieves}}
277
106
 
278
- ### Tasks Summary Table
279
-
280
- ```markdown
281
- | ID | Task | Deps | Status |
282
- |----|------|------|--------|
283
- | T1 | MerchantProduct Aggregate + Value Objects | - | |
284
- | T2 | Repository Interface | T1 | ⬜ |
285
- | T3 | CreateProduct Use Case | T2 | ⬜ |
286
- | T4 | PostgreSQL Repository Implementation | T2 | ⬜ |
287
- | T5 | HTTP Handler + Routes | T3, T4 | ⬜ |
288
- ```
107
+ **Read First:**
108
+ | Document | Section | What to Look For |
109
+ |----------|---------|------------------|
110
+ | `docs/coding-standards/` | Domain Layer | Entity patterns |
111
+ | → Unit: `Task` | Data Model | All fields |
112
+ | `path/to/example.go` | Example | Similar code |
289
113
 
290
- **Status:** ⬜ TODO | 🔄 IN_PROGRESS | ✅ DONE | ⏸️ BLOCKED
114
+ **Output Files:**
115
+ - `path/to/file.go`
116
+ - `path/to/file_test.go`
291
117
 
292
- ### Dependency Graph (Optional)
118
+ **Approach:**
119
+ 1. Read documentation above
120
+ 2. Create file following pattern
121
+ 3. Write tests
293
122
 
294
- ```
295
- T1 ──► T2 ──┬──► T3 ──┬──► T5
296
- │ │
297
- └──► T4 ──┘
123
+ **Done when:**
124
+ - [ ] Files created
125
+ - [ ] Follows coding-standards
126
+ - [ ] Tests pass
298
127
  ```
299
128
 
300
- ---
301
-
302
- ## Full Task Example
129
+ ## Reference Format
303
130
 
304
- Here's a complete example of a self-contained task:
131
+ Always use `→` prefix:
305
132
 
306
133
  ```markdown
307
- ### T1: MerchantProduct Aggregate + Value Objects
308
-
309
- **Goal:** Create the MerchantProduct aggregate with all value objects and domain validation.
310
-
311
- **Documentation:**
312
- - [AGENTS.md#type-safety](../../../AGENTS.md#type-safety) - Value object patterns
313
- - [AGENTS.md#naming-conventions](../../../AGENTS.md#naming-conventions) - File/package naming
314
- - [catalog-data-model.md#merchant_products](../docs/catalog-data-model.md#31-merchant-products) - Database schema
315
- - [modules/catalog/domain/entity/marketplace_category.go](../src/services/catalog/modules/catalog/domain/entity/marketplace_category.go) - Example entity pattern
316
-
317
- **Input (Prerequisites):**
318
- - None (first task in story)
319
- - Existing patterns in `modules/catalog/domain/` to follow
320
-
321
- **Output (Deliverables):**
322
- - `modules/catalog/domain/valueobject/merchant_id.go` - UUID wrapper with validation
323
- - `modules/catalog/domain/valueobject/product_id.go` - UUID wrapper
324
- - `modules/catalog/domain/valueobject/merchant_sku.go` - String with max length validation
325
- - `modules/catalog/domain/valueobject/ean.go` - GTIN-13 checksum validation
326
- - `modules/catalog/domain/valueobject/product_status.go` - Enum (pending, active, etc.)
327
- - `modules/catalog/domain/entity/merchant_product.go` - Aggregate with private fields + getters
328
- - `modules/catalog/domain/entity/merchant_product_test.go` - All tests
329
-
330
- **Implementation Steps:**
331
- 1. Read AGENTS.md sections on value objects and naming
332
- 2. Look at existing `marketplace_category.go` for entity pattern
333
- 3. Create value objects with `New*()` factory functions that validate
334
- 4. Create aggregate with private fields, public getters, factory method
335
- 5. Write tests: creation happy path, validation errors, status transitions
336
- 6. Run `go test ./modules/catalog/domain/...`
337
-
338
- **Acceptance Criteria:**
339
- - [ ] All files created at correct paths
340
- - [ ] Value objects validate on construction (not setters)
341
- - [ ] EAN validates GTIN-13 checksum
342
- - [ ] Aggregate uses private fields with getters
343
- - [ ] Tests cover: valid creation, invalid data rejection, status transitions
344
- - [ ] `go test ./modules/catalog/domain/...` passes
345
- - [ ] `golangci-lint run ./modules/catalog/domain/...` passes
346
-
347
- **Notes:**
348
- - EAN checksum algorithm: sum odd positions × 1, even × 3, check digit makes sum divisible by 10
349
- - Status enum values from PRD: pending, pending_category, pending_dedup, pending_pim, active, declined
134
+ Unit: `Task`
135
+ → `docs/coding-standards/`
136
+ `internal/user/domain/user.go`
350
137
  ```
351
138
 
352
- ### What Makes This Task Self-Contained?
353
-
354
- 1. **Agent can start immediately** - all documentation links provided
355
- 2. **No guessing** - exact file paths specified
356
- 3. **Pattern to follow** - links to existing code examples
357
- 4. **Clear verification** - specific test commands and criteria
358
- 5. **Context included** - notes explain non-obvious details (EAN algorithm)
359
-
360
- ## Definition of Done
361
-
362
- Standard DoD checklist:
363
-
139
+ **In Required Reading table:**
364
140
  ```markdown
365
- ## Definition of Done
366
-
367
- - [ ] All acceptance criteria implemented and verified
368
- - [ ] Unit tests written and passing (>80% coverage)
369
- - [ ] Integration tests written and passing
370
- - [ ] Code follows CLAUDE.md patterns
371
- - [ ] Code reviewed and approved
372
- - [ ] No linting errors
373
- - [ ] Documentation updated
374
- - [ ] PR merged to epic branch
141
+ | `docs/coding-standards/` | Validation | How to validate |
142
+ | → Unit: `Task` | Data Model | All fields |
375
143
  ```
376
144
 
377
- ## Story Sizing
378
-
379
- ### Size Guide
380
-
381
- | Size | Duration | Complexity |
382
- |------|----------|------------|
383
- | XS | 2-4 hours | Trivial change |
384
- | S | 0.5-1 day | Simple feature |
385
- | M | 1-2 days | Standard feature |
386
- | L | 2-3 days | Complex feature |
387
- | XL | 3-5 days | Very complex, consider splitting |
388
-
389
- ### Too Big? Split!
390
-
391
- If story is XL or larger:
392
- 1. Split by layer (domain, application, infrastructure)
393
- 2. Split by operation (create, read, update, delete)
394
- 3. Split by scenario (happy path, error handling)
395
-
396
- ## Story Order Within Epic
397
-
398
- Recommended order:
399
- 1. Domain layer (aggregates, value objects)
400
- 2. Repository interfaces
401
- 3. Use cases
402
- 4. Repository implementations
403
- 5. HTTP handlers
404
- 6. Event publishers
405
- 7. Integration tests
406
-
407
- ## Test Scenarios
408
-
145
+ **In task Read First:**
409
146
  ```markdown
410
- ## Test Scenarios
411
-
412
- ### Unit Tests
413
- 1. Product aggregate creation with valid data
414
- 2. Product aggregate validation rules
415
- 3. Price value object constraints
416
- 4. Use case handler happy path
417
- 5. Use case handler validation errors
418
-
419
- ### Integration Tests
420
- 1. Create product via HTTP API
421
- 2. Retrieve product via HTTP API
422
- 3. Product persisted in PostgreSQL
423
- 4. Event published to Kafka
147
+ | `docs/coding-standards/` | Domain Layer | Entity patterns |
424
148
  ```
425
149
 
426
- ---
427
-
428
- ## TODO Comments for Future Work
150
+ ## Why Required Reading?
429
151
 
430
- ### When to Add TODO
152
+ | Problem | Solution |
153
+ |---------|----------|
154
+ | Developer doesn't know patterns | → `docs/coding-standards/` |
155
+ | Developer doesn't know data model | → Unit: `Entity` |
156
+ | Developer doesn't know project conventions | → `CLAUDE.md` |
157
+ | AI agent needs context | All docs linked explicitly |
431
158
 
432
- | Situation | TODO Type | Example |
433
- |-----------|-----------|---------|
434
- | Interface for next task | `TASK` | `TODO(TASK:T3): Implement this method` |
435
- | Basic impl, enhanced later | `STORY` | `TODO(STORY:S05-04): Add pagination` |
436
- | Sync now, async later | `EPIC` | `TODO(EPIC:E06): Make event-driven` |
437
- | Performance fix planned | `SPRINT` | `TODO(SPRINT:SP3): Optimize to O(n)` |
438
- | Nice to have, not planned | `BACKLOG` | `TODO(BACKLOG): Add retry logic` |
439
- | Known shortcut/hack | `TECH_DEBT` | `TODO(TECH_DEBT): Extract common logic` |
159
+ ## Task Dependencies
440
160
 
441
- ### TODO Format (IDE-compatible)
161
+ Show in summary table and diagram:
442
162
 
443
- ```go
444
- // TODO({TYPE}:{ID}): {Short description}
445
- // Context: {Why this TODO exists}
446
- // Blocked by: {What must happen first}
447
- // See: {Link to story/epic if applicable}
163
+ ```markdown
164
+ | ID | Task | Deps | Status |
165
+ |----|------|------|--------|
166
+ | T1 | Domain Model | - | ⬜ |
167
+ | T2 | Repository | T1 | ⬜ |
168
+ | T3 | Use Cases | T1, T2 | ⬜ |
448
169
  ```
449
170
 
450
- **IDE Detection:**
451
- - GoLand: Settings → Editor → TODO → Pattern: `\bTODO\b.*`
452
- - VS Code: Highlight extension or built-in
453
- - Pattern matches: `TODO`, `FIXME`, `HACK`
454
-
455
- ### Examples
456
-
457
171
  ```
458
- // Interface for next task
459
- interface ProductRepository {
460
- save(product: Product): void
461
-
462
- // TODO(TASK:T4): Add findById method
463
- // Implemented in task T4
464
- }
465
-
466
- // Use case - pagination in next story
467
- function list(): Product[] {
468
- // TODO(STORY:CATALOG-S05-04): Add pagination support
469
- // Current: returns all products (OK for MVP)
470
- // Next story adds: limit, offset, cursor-based pagination
471
- return repo.findAll()
472
- }
473
-
474
- // Repository - batch operations in future epic
475
- function save(product: Product): void {
476
- // TODO(EPIC:CATALOG-E08): Add batch save for bulk imports
477
- // Current: single insert
478
- // Epic 8 adds bulk operations
479
- }
480
-
481
- // API handler - rate limiting not planned yet
482
- function createProduct(request): Response {
483
- // TODO(BACKLOG): Add rate limiting per merchant
484
- // Not planned, but would prevent abuse
485
- }
486
-
487
- // Known tech debt
488
- function calculateDiscount(items: Item[]): number {
489
- // TODO(TECH_DEBT): Extract discount rules to domain service
490
- // Currently hardcoded, should be configurable
491
- }
492
-
493
- // Bug to fix
494
- function findById(id: string): Product {
495
- // FIXME(BUG:GH-234): Race condition when concurrent updates
496
- // Needs optimistic locking with version field
497
- // Ticket: https://github.com/org/repo/issues/234
498
- }
499
-
500
- // Temporary workaround
501
- function authenticate(request): void {
502
- // HACK: Bypass auth for internal services
503
- // Temporary until service mesh is implemented
504
- // Remove in: EPIC:INFRA-E02
505
- }
172
+ T1 ──► T2 ──► T3
506
173
  ```
507
- ```
508
-
509
- ### Story Template Section
510
-
511
- Add to each story:
512
-
513
- ```markdown
514
- ## TODO Placeholders
515
-
516
- | Location | TODO | Type | Reference |
517
- |----------|------|------|-----------|
518
- | `src/domain/repository/` | Add Update method | TASK | T5 |
519
- | `src/application/usecase/` | Add caching | STORY | S05-06 |
520
- | `src/api/` | Add rate limiting | BACKLOG | - |
521
-
522
- ## Related Future Work
523
-
524
- | ID | Type | Description | When |
525
- |----|------|-------------|------|
526
- | T5 | Task | Update method | This story |
527
- | S05-06 | Story | Caching layer | Sprint 2 |
528
- | E08 | Epic | Bulk operations | Sprint 4 |
529
- ```
530
-
531
- ---
532
174
 
533
175
  ## Validation Checklist
534
176
 
535
- Before completing story:
536
- - [ ] Story ID is unique
537
- - [ ] Goal is clear (1-2 sentences)
538
- - [ ] Acceptance criteria as checklist (what "done" looks like)
539
- - [ ] Tasks are self-contained with documentation links
540
- - [ ] Each task has: Goal, Documentation, Input, Output, Steps, AC
541
- - [ ] Definition of Done is complete
542
- - [ ] Links to epic are correct
177
+ - [ ] Goal is 1-2 sentences
178
+ - [ ] Units affected listed with `→ Unit:` format
179
+ - [ ] Required Reading includes coding-standards
180
+ - [ ] Each task has "Read First" section
181
+ - [ ] Each task references coding-standards
182
+ - [ ] Tasks are self-contained
183
+ - [ ] Definition of Done includes coding-standards check
543
184
 
544
185
  ## Output
545
186
 
@@ -547,6 +188,7 @@ Save to: `docs/sprint-artifacts/sprint-[N]/stories/story-[EPIC]-[NN]-[descriptio
547
188
 
548
189
  ## Related Skills
549
190
 
550
- - `acceptance-criteria` - For detailed AC writing
551
- - `epic-writing` - For parent epic structure
552
- - `jira-integration` - For syncing to Jira
191
+ - `acceptance-criteria` - For detailed AC
192
+ - `epic-writing` - For parent epic
193
+ - `unit-writing` - For unit documentation
194
+ - `coding-standards` - Referenced in every story