@comfanion/workflow 4.0.0 → 4.1.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": "4.0.0",
3
+ "version": "4.1.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:21:08.417Z",
3
+ "buildDate": "2026-01-23T17:40:44.228Z",
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: "4.0.0"
9
+ version: "4.1.0"
10
10
 
11
11
  # =============================================================================
12
12
  # USER CONFIGURATION
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: story-writing
3
- description: How to write user stories with proper format, acceptance criteria in Given/When/Then, and technical tasks
3
+ description: How to write stories as execution plans with self-contained tasks
4
4
  license: MIT
5
5
  compatibility: opencode
6
6
  metadata:
@@ -85,7 +85,9 @@ Use template at: `@.opencode/templates/story-template.md`
85
85
 
86
86
  ## Story Structure
87
87
 
88
- ### Header
88
+ **Philosophy:** Story = execution plan. Tasks are the main content, not ceremony.
89
+
90
+ ### Header (Minimal)
89
91
 
90
92
  ```markdown
91
93
  # Story N.M: [Title]
@@ -93,31 +95,44 @@ Use template at: `@.opencode/templates/story-template.md`
93
95
  **Story ID:** [MODULE]-S[EPIC]-[NN]
94
96
  **Epic:** [MODULE]-E[EPIC] - [Epic Title]
95
97
  **Status:** draft | ready-for-dev | in-progress | review | done
96
- **Priority:** P0 | P1 | P2
97
98
  **Size:** XS | S | M | L | XL
98
99
  ```
99
100
 
100
- **Note:** Size is relative complexity (T-shirt sizing). NO hour estimates for tasks.
101
+ ### Goal (1-2 sentences)
102
+
103
+ ```markdown
104
+ ## Goal
105
+
106
+ Implement CRUD use cases for merchant products with validation and event publishing.
107
+ ```
108
+
109
+ **NOT** the verbose "As a... I want... So that..." format. Just state what the story achieves.
101
110
 
102
- ### User Story Format (MANDATORY)
111
+ ### Acceptance Criteria (Brief List)
103
112
 
104
113
  ```markdown
105
- ## User Story
114
+ ## Acceptance Criteria
106
115
 
107
- **As a** [user type],
108
- **I want** [capability/action],
109
- **So that** [benefit/value].
116
+ - [ ] Products can be created with EAN validation
117
+ - [ ] Products can be retrieved by ID
118
+ - [ ] Products can be updated with optimistic locking
119
+ - [ ] Products can be listed with filters and pagination
120
+ - [ ] All operations publish domain events
110
121
  ```
111
122
 
112
- ### Sections
123
+ **NOT** detailed Given/When/Then for each. Just a checklist of what "done" looks like.
124
+
125
+ ### Tasks (MAIN CONTENT - 80% of file)
126
+
127
+ Self-contained tasks with documentation links. See Task Structure below.
128
+
129
+ ### Sections (Simplified)
113
130
 
114
- 1. **User Story** - As a... I want... So that...
115
- 2. **Acceptance Criteria** - Given/When/Then (MANDATORY)
116
- 3. **Technical Tasks** - Implementation checklist
117
- 4. **Definition of Done** - Quality gates
118
- 5. **Technical Context** - Related files, patterns
119
- 6. **Test Scenarios** - Unit and integration tests
120
- 7. **Notes** - Additional context
131
+ 1. **Header** - Minimal metadata
132
+ 2. **Goal** - 1-2 sentences
133
+ 3. **Acceptance Criteria** - Brief checklist
134
+ 4. **Tasks** - MAIN CONTENT (80% of file)
135
+ 5. **Notes** - Optional additional context
121
136
 
122
137
  ## Naming Conventions
123
138
 
@@ -143,52 +158,6 @@ Examples:
143
158
  - INVENTORY-S10-01
144
159
  ```
145
160
 
146
- ## Acceptance Criteria (MANDATORY)
147
-
148
- Use skill: `acceptance-criteria`
149
-
150
- ### Format: Given/When/Then
151
-
152
- ```markdown
153
- ## Acceptance Criteria
154
-
155
- ### AC1: Create product with valid data
156
-
157
- **Given** authenticated merchant with "product:create" permission
158
- **When** POST /api/v1/products with:
159
- - name: "Test Product"
160
- - price: 100.00
161
- - currency: "UAH"
162
- **Then** 201 Created returned
163
- **And** response contains product with generated UUID
164
- **And** product status is "pending"
165
- **And** "product.created" event published to Kafka
166
-
167
- ### AC2: Reject invalid product data
168
-
169
- **Given** authenticated merchant
170
- **When** POST /api/v1/products with missing required field "name"
171
- **Then** 400 Bad Request returned
172
- **And** error response contains:
173
- - field: "name"
174
- - message: "name is required"
175
- **And** no product is created in database
176
-
177
- ### AC3: Unauthorized access rejected
178
-
179
- **Given** user without "product:create" permission
180
- **When** POST /api/v1/products
181
- **Then** 403 Forbidden returned
182
- ```
183
-
184
- ### AC Coverage
185
-
186
- Each story should have:
187
- - **Happy path** - At least 1 success scenario
188
- - **Validation errors** - Invalid input handling
189
- - **Authorization** - Permission checks
190
- - **Edge cases** - Boundary conditions
191
-
192
161
  ## Self-Contained Tasks (NO ESTIMATES)
193
162
 
194
163
  ### Task Philosophy
@@ -550,13 +519,11 @@ Add to each story:
550
519
 
551
520
  Before completing story:
552
521
  - [ ] Story ID is unique
553
- - [ ] User story follows format
554
- - [ ] **Acceptance criteria in Given/When/Then** (MANDATORY!)
555
- - [ ] At least 3 AC (happy path, error, edge case)
556
- - [ ] Technical tasks are specific
557
- - [ ] **TODO placeholders defined for future work**
522
+ - [ ] Goal is clear (1-2 sentences)
523
+ - [ ] Acceptance criteria as checklist (what "done" looks like)
524
+ - [ ] Tasks are self-contained with documentation links
525
+ - [ ] Each task has: Goal, Documentation, Input, Output, Steps, AC
558
526
  - [ ] Definition of Done is complete
559
- - [ ] Estimate is reasonable
560
527
  - [ ] Links to epic are correct
561
528
 
562
529
  ## Output
@@ -8,55 +8,39 @@ workflowType: 'story'
8
8
 
9
9
  **Story ID:** {{module}}-S{{epic_number}}-{{story_number}}
10
10
  **Epic:** {{module}}-E{{epic_number}} - {{epic_title}}
11
- **Status:** draft | ready-for-dev | in-progress | review | done | blocked
12
- **Priority:** P0 | P1 | P2
11
+ **Status:** draft | ready-for-dev | in-progress | review | done
13
12
  **Size:** XS | S | M | L | XL
14
- **Created:** {{date}}
15
- **Last Updated:** {{date}}
16
13
 
17
14
  ---
18
15
 
19
- ## User Story
16
+ ## Prerequisites (PM reads before writing tasks)
20
17
 
21
- **As a** {{user_type}},
22
- **I want** {{capability}},
23
- **So that** {{benefit}}.
18
+ <!-- ⚠️ MANDATORY: Read these docs before writing tasks! -->
24
19
 
25
- ---
26
-
27
- ## Acceptance Criteria
20
+ - [ ] `AGENTS.md` / `CLAUDE.md` - coding patterns, naming, error handling
21
+ - [ ] `docs/coding-standards/` - detailed coding standards
22
+ - [ ] `docs/architecture/{{module}}/` - module architecture, data model
23
+ - [ ] Existing code in `src/services/{{module}}/` - patterns to follow
28
24
 
29
- ### AC1: {{criterion_name}}
25
+ ---
30
26
 
31
- **Given** {{precondition}}
32
- **When** {{action}}
33
- **Then** {{expected_result}}
34
- **And** {{additional_check}}
27
+ ## Goal
35
28
 
36
- ### AC2: {{criterion_name}}
29
+ {{Short description - 1-2 sentences. What this story achieves. Same as in epic's stories table.}}
37
30
 
38
- **Given** {{precondition}}
39
- **When** {{action}}
40
- **Then** {{expected_result}}
31
+ ---
41
32
 
42
- ### AC3: {{criterion_name}}
33
+ ## Acceptance Criteria
43
34
 
44
- **Given** {{precondition}}
45
- **When** {{action}}
46
- **Then** {{expected_result}}
35
+ - [ ] {{criterion_1}}
36
+ - [ ] {{criterion_2}}
37
+ - [ ] {{criterion_3}}
38
+ - [ ] All tests pass
39
+ - [ ] No linting errors
47
40
 
48
41
  ---
49
42
 
50
- ## Self-Contained Tasks
51
-
52
- <!--
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
57
- -->
58
-
59
- ### Tasks Summary
43
+ ## Tasks
60
44
 
61
45
  | ID | Task | Deps | Status |
62
46
  |----|------|------|--------|
@@ -156,230 +140,38 @@ Each task MUST be self-contained:
156
140
 
157
141
  ---
158
142
 
159
- ## TODO Placeholders
160
-
161
- <!--
162
- When implementing, leave TODO comments for:
163
- - Next tasks in this story
164
- - Future stories/epics
165
- - Technical debt
166
- - Planned improvements
167
-
168
- Format: TODO({TYPE}:{ID}): {description}
169
- -->
170
-
171
- ### TODOs to Create During Implementation
172
-
173
- | Location | TODO | Type | Reference |
174
- |----------|------|------|-----------|
175
- | `src/domain/{{entity}}` | Add validation for X | TASK | T3 |
176
- | `src/application/{{usecase}}` | Add caching | STORY | S{{epic}}-04 |
177
- | `src/infrastructure/repo/` | Add batch operations | EPIC | E{{next_epic}} |
178
- | `src/api/` | Add rate limiting | BACKLOG | - |
179
-
180
- ### TODO Format Reference (IDE-compatible)
181
-
182
- ```go
183
- // TODO(TASK:T3): Implement validation logic here
184
- // Called from: T2 implementation
185
- // Blocked until: T3 starts
186
-
187
- // TODO(STORY:{{module}}-S05-04): Add pagination support
188
- // This story implements basic list, pagination in next story
189
- // See: docs/sprint-artifacts/sprint-1/stories/story-05-04.md
143
+ ## Notes
190
144
 
191
- // TODO(EPIC:{{module}}-E06): Replace with event-driven approach
192
- // Current sync implementation, async in Epic 6
193
- // See: docs/sprint-artifacts/backlog/epic-06.md
194
-
195
- // TODO(SPRINT:SP3): Performance optimization needed
196
- // Current O(n²), optimize in Sprint 3
197
-
198
- // TODO(BACKLOG): Consider adding retry logic
199
- // Not planned yet, but would improve reliability
200
-
201
- // TODO(TECH_DEBT): Refactor this duplication
202
- // Copy-pasted from X, extract common logic
203
-
204
- // FIXME(BUG:GH-123): Fix null pointer exception
205
- // Occurs when input is empty
206
- // Ticket: https://github.com/org/repo/issues/123
207
-
208
- // HACK: Temporary workaround for API limitation
209
- // Remove when: STORY:{{module}}-S05-08 implemented
210
- ```
211
-
212
- **GoLand/IntelliJ Setup:**
213
- ```
214
- Settings → Editor → TODO → Add Pattern:
215
- \bTODO\(.*\):.*
216
- \bFIXME\(.*\):.*
217
- \bHACK:.*
218
- ```
219
-
220
- ### Related Future Work
221
-
222
- | ID | Type | Description | Blocks This? |
223
- |----|------|-------------|--------------|
224
- | T3 | Task | Validation logic | No |
225
- | S{{epic}}-04 | Story | Pagination | No |
226
- | E{{next_epic}} | Epic | Event-driven | No |
145
+ <!-- Optional: additional context, learnings, blockers -->
227
146
 
228
147
  ---
229
148
 
230
- ## Dev Notes
231
-
232
- <!-- Context for the developer implementing this story -->
233
-
234
- ### Coding Standards Applied (MANDATORY)
235
-
236
- **Standards documents used for this story:**
237
- - [ ] `CLAUDE.md` - Project patterns, file structure, conventions
238
- - [ ] `docs/coding-standards/` - Detailed coding standards
239
- - [ ] Naming conventions
240
- - [ ] Error handling patterns
241
- - [ ] Testing patterns
242
- - [ ] `docs/architecture/{{module}}/architecture.md` - Module-specific patterns
243
-
244
- **Key patterns from CLAUDE.md:**
245
- - File naming: `{{file_naming_pattern}}`
246
- - Package structure: `{{package_structure}}`
247
- - Error handling: `{{error_handling_pattern}}`
248
- - Test file naming: `{{test_naming_pattern}}`
249
-
250
- ### Architecture Requirements
251
- - Follow hexagonal architecture patterns
252
- - Domain layer must not import infrastructure
253
- - Use value objects for domain concepts
254
-
255
- ### Technical Specifications
256
- - {{technical_specs}}
257
-
258
- ### Dependencies
259
- - Depends on: {{dependencies}}
260
- - Blocked by: {{blockers}}
261
-
262
- ### Previous Learnings
263
- - {{learnings_from_similar_work}}
264
-
265
- ### Reference Files
266
- - `src/path/to/related/file` - [why relevant]
267
- - `docs/architecture.md#section` - [architecture guidance]
268
- - `CLAUDE.md#section` - [coding patterns]
269
-
270
- ### Patterns to Follow
271
- - **MANDATORY:** Follow patterns from `CLAUDE.md`
272
- - **MANDATORY:** Follow `docs/coding-standards/`
273
- - Match existing code style in module
274
-
275
- ### API/Interface
276
- ```
277
- // Expected interface or function signature
278
- // (language-specific syntax)
279
- ```
280
-
281
- ---
282
-
283
- ## Test Scenarios
284
-
285
- ### Unit Tests
286
- 1. {{test_scenario_1}}
287
- 2. {{test_scenario_2}}
288
- 3. {{edge_case_1}}
289
-
290
- ### Integration Tests
291
- 1. {{integration_scenario_1}}
292
- 2. {{integration_scenario_2}}
293
-
294
- ---
295
-
296
- ## Dev Agent Record
297
-
298
- <!-- Automatically updated by Dev agent during implementation -->
299
-
300
- ### Implementation Plan
301
- <!-- Dev agent documents approach here -->
302
-
303
- ### Debug Log
304
- <!-- Dev agent logs debugging notes here -->
305
-
306
- ### Completion Notes
307
- <!-- Dev agent summarizes what was implemented -->
308
-
309
- ---
310
-
311
- ## File List
312
-
313
- <!-- Dev agent updates with all changed files -->
314
-
315
- ### Created Files
316
- -
317
-
318
- ### Modified Files
319
- -
149
+ ## Definition of Done
320
150
 
321
- ### Deleted Files
322
- -
151
+ - [ ] All acceptance criteria met
152
+ - [ ] All tasks completed
153
+ - [ ] Tests passing (>80% coverage)
154
+ - [ ] Code follows AGENTS.md patterns
155
+ - [ ] No linting errors
156
+ - [ ] PR merged to epic branch
323
157
 
324
158
  ---
325
159
 
326
160
  ## Changelog
327
161
 
328
- <!-- UPDATE AT END OF SESSION -->
329
-
330
162
  | Version | Date | Author | Changes |
331
163
  |---------|------|--------|---------|
332
- | 0.1 | {{date}} | @sm | Story created |
164
+ | 0.1 | {{date}} | @pm | Story created |
333
165
 
334
166
  <!--
335
167
  Changelog Guidelines:
336
168
  - Update at END of work session
337
169
  - Dev: summarize what was implemented
338
170
  - Version: 0.x=draft, 1.0=ready-for-dev, 1.x=in-progress, 2.0=done
339
-
340
- Example session entries:
341
- | 2.0 | 2024-01-25 | @dev | Complete: T1-T7 done; All tests pass; Ready for review |
342
- | 1.1 | 2024-01-23 | @dev | Progress: T1-T4 complete; T5 blocked by API issue |
343
- | 1.0 | 2024-01-20 | @sm | Ready for dev: 7 tasks defined; AC reviewed |
344
171
  -->
345
172
 
346
173
  ---
347
174
 
348
- ## Definition of Done
349
-
350
- - [ ] All acceptance criteria implemented and verified
351
- - [ ] All tasks/subtasks marked complete [x]
352
- - [ ] Unit tests written and passing (>80% coverage)
353
- - [ ] Integration tests written and passing
354
- - [ ] Code follows CLAUDE.md patterns
355
- - [ ] Code reviewed and approved
356
- - [ ] No linting errors
357
- - [ ] No failing tests (full suite)
358
- - [ ] File List complete
359
- - [ ] Change Log updated
360
- - [ ] PR merged to epic branch
361
-
362
- ---
363
-
364
- ## Senior Developer Review (AI)
365
-
366
- <!-- Added after code-review workflow runs -->
367
-
368
- ### Review Date
369
- <!-- Date of review -->
370
-
371
- ### Review Outcome
372
- <!-- Approve | Changes Requested | Blocked -->
373
-
374
- ### Action Items
375
- - [ ] {{action_item_1}}
376
- - [ ] {{action_item_2}}
377
-
378
- ### Review Follow-ups (AI)
379
- <!-- Tasks added based on review findings -->
380
-
381
- ---
382
-
383
175
  ## Jira Metadata
384
176
 
385
177
  ```yaml