@comfanion/workflow 4.39.2 → 4.39.3

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.
@@ -16,58 +16,105 @@ metadata:
16
16
 
17
17
  ```xml
18
18
  <story_rules>
19
- <before_writing critical="MANDATORY">
20
- <action>Read template file first</action>
21
- <path>./template.md</path>
22
- <focus>Lines 103-158 for task Approach examples</focus>
23
- </before_writing>
24
-
25
19
  <definition>Story = Smallest working increment (one layer/feature)</definition>
26
20
 
27
21
  <sizes>
28
- <XS tasks="1-2" use="Rarely (trivial changes)"/>
29
- <S tasks="2-4" use="TOY, SMALL projects"/>
30
- <M tasks="4-8" use="Preferred for all" target="true"/>
31
- <L tasks="8-12" use="Consider splitting"/>
32
- <XL tasks="12+" use="Must split" forbidden="true"/>
22
+ <XS tasks="1-2" use="Trivial additions"/>
23
+ <S tasks="2-3" use="TOY, SMALL projects (PREFERRED)" target="true"/>
24
+ <M tasks="3-5" use="MEDIUM projects (PREFERRED)" target="true"/>
25
+ <L tasks="5-8" use="LARGE - only if feature is complex"/>
26
+ <XL tasks="8+" use="FORBIDDEN - must split into multiple stories" forbidden="true"/>
33
27
  </sizes>
34
28
 
35
- <estimation>
36
- <t_shirt for="TOY,SMALL,MEDIUM,LARGE">XS, S, M, L (no XL!)</t_shirt>
37
- <t_shirt_plus_points for="ENTERPRISE">
38
- <mapping XS="1" S="3" M="5" L="8" XL="13"/>
39
- </t_shirt_plus_points>
40
- </estimation>
29
+ <feature_driven>
30
+ <definition>Story = ONE working feature end-to-end (thin vertical slice)</definition>
31
+ <principle>Each story delivers value users can see/test</principle>
32
+ <approach>
33
+ <step>1. Study existing code (MANDATORY - find patterns)</step>
34
+ <step>2. Write test for core functionality</step>
35
+ <step>3. Implement MINIMAL code (domain + repo + API if needed)</step>
36
+ <step>4. Verify it works end-to-end</step>
37
+ </approach>
38
+ <examples>
39
+ <good>"User can create simple order" → Order entity + CreateOrder API + test</good>
40
+ <good>"Order validates required fields" → Add validation logic + tests</good>
41
+ <good>"Order checks inventory" → Integration with inventory service + tests</good>
42
+ <bad>"Create domain layer" → No working feature, just entities</bad>
43
+ <bad>"Implement repository layer" → Can't test without use case</bad>
44
+ <bad>"All CRUD operations" → Too big, split into Create/Read/Update/Delete stories</bad>
45
+ </examples>
46
+ <result>After story: feature WORKS, is TESTED, can be DEMOED</result>
47
+ </feature_driven>
48
+
49
+ <task_composition>
50
+ <task n="1" type="study">Study existing code, design interfaces (if parallel planned)</task>
51
+ <task n="2" type="test">Write test for core functionality</task>
52
+ <task n="3" type="implement">Minimal implementation (domain + repo + API)</task>
53
+ <task n="4" type="verify">Integration test (if needed)</task>
54
+ <note>Most stories: 2-4 tasks. Prefer smaller stories over larger ones.</note>
55
+ </task_composition>
41
56
 
42
- <vertical_slice>
43
- <principle>Stories build layers, Epic completes full stack</principle>
44
- <story_order>
45
- <step>1. Domain (entities, value objects)</step>
46
- <step>2. Repository interfaces</step>
47
- <step>3. Use cases</step>
48
- <step>4. Repository implementations</step>
49
- <step>5. API (HTTP handlers)</step>
50
- <step>6. UI (forms, views)</step>
51
- <step>7. Integration tests</step>
52
- </story_order>
53
- <result>Each story = increment, Epic = working module</result>
54
- </vertical_slice>
57
+ <task_approach_section critical="MANDATORY">
58
+ <rule>Each task MUST have "Approach" section with HIGH-LEVEL steps</rule>
59
+ <format>Numbered list of WHAT to do, NOT HOW (no code)</format>
60
+ <good_example>
61
+ 1. Create Order struct with fields from Unit doc
62
+ 2. Add NewOrder() constructor with validation
63
+ 3. Add Validate() method
64
+ 4. Write tests: valid order, empty fields, invalid status
65
+ </good_example>
66
+ <bad_example>
67
+ 1. type Order struct { ID string; CustomerID string }
68
+ 2. func NewOrder(id, customerID string) (*Order, error) { ... }
69
+ ❌ This is CODE, not approach!
70
+ </bad_example>
71
+ <remember>Approach = WHAT steps to take. @dev transforms this to HOW (technical details) for @coder.</remember>
72
+ </task_approach_section>
55
73
 
56
- <task_approach critical="MANDATORY">
57
- <rule>Every task MUST have Approach section</rule>
58
- <format>Numbered list of high-level steps (WHAT to do)</format>
59
- <forbidden>
60
- <code_blocks>No code in Approach section</code_blocks>
61
- <implementation>No detailed implementation</implementation>
62
- <ready_solutions>No copy-paste code</ready_solutions>
63
- </forbidden>
64
- <example_good>
65
- 1. Create struct with fields from Unit doc
66
- 2. Add constructor with validation
67
- 3. Write tests: happy path + errors
68
- </example_good>
69
- <example_bad>Define struct: type Foo struct { ... }</example_bad>
70
- </task_approach>
74
+ <test_strategy critical="MANDATORY">
75
+ <principle>Test CORE functionality first, expand coverage incrementally. No tests for sake of tests.</principle>
76
+
77
+ <priority>
78
+ <p1>Business logic (validation, calculations, decisions)</p1>
79
+ <p2>Integration points (API calls, database, external services)</p2>
80
+ <p3>Error handling (edge cases, failures)</p3>
81
+ <p4>Happy path (normal flow)</p4>
82
+ </priority>
83
+
84
+ <do_test>
85
+ <what>Business rules (validation, calculations)</what>
86
+ <what>State changes (create, update, delete)</what>
87
+ <what>Error conditions (invalid input, failures)</what>
88
+ <what>Integration with other services</what>
89
+ </do_test>
90
+
91
+ <dont_test>
92
+ <skip>Simple getters/setters (no logic)</skip>
93
+ <skip>Trivial constructors (just assign fields)</skip>
94
+ <skip>Third-party library internals</skip>
95
+ <skip>Database framework internals</skip>
96
+ </dont_test>
97
+
98
+ <incremental_approach>
99
+ <story n="1">Core functionality only (happy path + critical validation)</story>
100
+ <story n="2">Add edge cases as you discover them</story>
101
+ <story n="3">Integration tests when connecting systems</story>
102
+ <avoid>Writing 100% coverage in first story - wasteful, most tests never catch bugs</avoid>
103
+ </incremental_approach>
104
+
105
+ <examples>
106
+ <good>Story: CreateOrder → Test: valid order, missing customer (2 tests, covers 80% of real issues)</good>
107
+ <good>Story: InventoryCheck → Test: success, out-of-stock, service down (3 tests, critical paths)</good>
108
+ <bad>Story: CreateOrder → 15 tests for all field combinations (overkill, testing framework not logic)</bad>
109
+ <bad>Test OrderID() getter → returns field (trivial, no value)</bad>
110
+ </examples>
111
+
112
+ <metrics>
113
+ <wrong>Coverage % target (80%, 90%) - encourages testing trivial code</wrong>
114
+ <right>Core business paths tested (are critical flows covered?)</right>
115
+ <right>Critical errors handled (can system fail gracefully?)</right>
116
+ </metrics>
117
+ </test_strategy>
71
118
 
72
119
  <status_values>
73
120
  <draft>Being written</draft>
@@ -81,52 +128,69 @@ metadata:
81
128
 
82
129
  ---
83
130
 
84
- ## Template & Format
131
+ ## Example: MEDIUM Project Story
85
132
 
86
- **BEFORE writing any story:** Read the template file:
133
+ ```yaml
134
+ id: ORD-S01-01
135
+ epic: ORD-E01
136
+ status: ready
137
+ size: M
138
+ ```
87
139
 
88
- `./template.md`
140
+ # Story: Order Domain Layer
89
141
 
90
- **Key sections in template:**
91
- - Lines 103-158: Full task example with **Approach** section
92
- - Lines 119-122: Shows correct Approach format (high-level steps)
142
+ ## Goal
93
143
 
94
- ---
144
+ Implement domain entities and value objects for Order Management.
95
145
 
96
- ## Task Structure (MANDATORY)
146
+ **Context:** Part of Epic 01 (Order Management). Focuses on domain layer.
97
147
 
98
- Each task MUST include these sections:
148
+ ## Units Affected
99
149
 
100
- 1. **Goal** - what this task achieves
101
- 2. **Read First** - table with documentation links
102
- 3. **Output Files** - what files to create
103
- 4. **Approach** - high-level steps (MANDATORY)
104
- 5. **Done when** - completion criteria
150
+ | Unit | Action | Description |
151
+ |------|--------|-------------|
152
+ | Unit: `Order` | Create | New entity |
105
153
 
106
- ### Approach Section Rules
154
+ ## Required Reading
107
155
 
108
- **CRITICAL:** Every task MUST have **Approach** section.
156
+ | Document | Section | Why |
157
+ |----------|---------|-----|
158
+ | → `CLAUDE.md` | All | Project patterns |
159
+ | → `docs/coding-standards/` | All | **MANDATORY** |
160
+ | → Unit: `Order` | Data Model | Field definitions |
109
161
 
110
- **Approach = High-level steps (WHAT to do), NOT code (HOW to implement).**
162
+ ## Acceptance Criteria
111
163
 
112
- **CORRECT:**
113
- ```markdown
114
- **Approach:**
115
- 1. Create Order struct with fields from Unit doc
116
- 2. Add NewOrder() constructor with validation
117
- 3. Add Validate() method for business rules
118
- 4. Write tests: valid order, validation errors
119
- ```
164
+ - [ ] Order entity created with all fields
165
+ - [ ] Validation logic implemented
166
+ - [ ] Tests pass (>80% coverage)
167
+ - [ ] Follows coding-standards
120
168
 
121
- **WRONG (has code):**
122
- ```markdown
123
- **Approach:**
124
- 1. Define struct:
125
- ```go
126
- type Order struct { ID string }
127
- ```
128
- ```
169
+ ## Tasks
170
+
171
+ | ID | Task | Deps | Status |
172
+ |----|------|------|--------|
173
+ | T1 | Order entity | - | ⬜ |
174
+ | T2 | Value objects | - | ⬜ |
175
+ | T3 | Unit tests | T1, T2 | ⬜ |
176
+
177
+ ### T1: Order Entity
178
+
179
+ **Goal:** Create Order entity with business rules
180
+
181
+ **Read First:**
182
+ | Document | Section | What to Look For |
183
+ |----------|---------|------------------|
184
+ | → `docs/coding-standards/` | Domain Layer | Entity patterns |
185
+ | → Unit: `Order` | Data Model | All fields |
186
+
187
+ **Output Files:**
188
+ - `internal/order/domain/order.go`
189
+ - `internal/order/domain/order_test.go`
129
190
 
130
- **Golden Rule:** If you see code blocks in Approach → STOP, remove them.
191
+ **Done when:**
192
+ - [ ] Entity created
193
+ - [ ] Follows coding-standards
194
+ - [ ] Tests pass
131
195
 
132
- Point to patterns, don't write implementation.
196
+ See `template.md` for full format.