@comfanion/workflow 4.39.0 → 4.39.2

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.
@@ -38,34 +38,11 @@ metadata:
38
38
  <goal>~70KB context, NOT 200KB+</goal>
39
39
  </phase>
40
40
 
41
- <phase name="2-transform" title="Transform Story Task → Executable Instruction">
42
- <step n="1" name="read-docs">
43
- Story has "Required Reading", task has "Read First".
44
- Open each find sections extract patterns, signatures, constraints.
45
- </step>
46
- <step n="2" name="find-patterns">
47
- From "Read First" paths, find existing similar code.
48
- Note structure, imports, error handling → becomes "Pattern Reference".
49
- </step>
50
- <step n="3" name="build-context">
51
- @coder doesn't see story. Provide:
52
- - Existing files (paths + what they contain)
53
- - Patterns to follow (link to similar code)
54
- - What was done (results of previous tasks)
55
- - Imports (what packages to use)
56
- </step>
57
- <step n="4" name="add-direction">
58
- Story has "Approach". Expand with:
59
- - Interface signatures (method names, params, return types)
60
- - Error handling (what errors to return)
61
- - Validation rules
62
- </step>
63
- <step n="5" name="verification">
64
- Story has "Done when". Add:
65
- - Specific test commands
66
- - Files that must compile
67
- - Test coverage expectations
68
- </step>
41
+ <phase name="2-plan" title="Plan Task Execution">
42
+ <step n="1">Read story tasks, determine execution order based on dependencies</step>
43
+ <step n="2">Identify which tasks are independent (can run in parallel) vs sequential</step>
44
+ <step n="3">For each task, note: what to do + which files/patterns are relevant context</step>
45
+ <step n="4">Do NOT read source files that only @coder needs — save your context for orchestration</step>
69
46
  </phase>
70
47
 
71
48
  <phase name="2b-todo" title="Create TODO with IDs">
@@ -90,28 +67,15 @@ metadata:
90
67
  </example>
91
68
  </phase>
92
69
 
93
- <phase name="3-execute" title="Execute Tasks — One by One or Parallel">
94
- <critical>DO NOT delegate entire story to @coder in one prompt!</critical>
95
- <strategy>
96
- For each task in TODO:
97
- 1. Check task dependencies (from story file)
98
- 2. If independent tasks exist → delegate in parallel (different files only)
99
- 3. If task depends on previous → delegate ONE task, wait for result
100
- 4. After @coder returns → verify, mark done, then next task
101
- </strategy>
70
+ <phase name="3-execute" title="Execute Tasks">
102
71
  <loop>
103
- <step n="1">Pick next task(s) from TODO</step>
104
- <step n="2">Transform task executable instruction (phase 2)</step>
105
- <step n="3">Delegate to @coder using template below</step>
106
- <step n="4">Verify result: tests pass, files compile</step>
107
- <step n="5">Mark task ✅ in story file + TODO</step>
108
- <step n="6">Update .opencode/session-state.yaml</step>
109
- <step n="7">Next task or story complete</step>
72
+ <step n="1">Pick next task(s) from TODO (parallel if independent, otherwise one)</step>
73
+ <step n="2">Delegate to @coder with a brief: what to do + context file paths</step>
74
+ <step n="3">Verify result: tests pass, files compile</step>
75
+ <step n="4">Mark task done in story file + TODO</step>
76
+ <step n="5">Update .opencode/session-state.yaml</step>
77
+ <step n="6">Next task or story complete</step>
110
78
  </loop>
111
- <parallel-rules>
112
- OK to parallel: T01 (domain) + T02 (dto) — different files, no deps
113
- NOT OK: T03 (service) depends on T01 (domain) — wait for T01 first
114
- </parallel-rules>
115
79
  </phase>
116
80
 
117
81
  <phase name="4-review" title="Review BEFORE Done">
@@ -155,86 +119,25 @@ key_decisions:
155
119
 
156
120
  This file survives compaction and tells the agent where to resume.
157
121
 
158
- ## Task Template for @coder
122
+ ## Brief Format for @coder
159
123
 
160
- <template name="coder-task">
161
- ```markdown
162
- ## Task: [Name] (Task IDs)
124
+ Each @coder call = ONE task. Brief contains:
125
+ - **What**: task goal in 1-2 sentences
126
+ - **Context**: file paths (story, source, patterns to follow)
127
+ - **Methodology**: TDD ("write failing test first") or STUB ("create stub first") per config.yaml
163
128
 
164
- [One line goal]
165
-
166
- ### Skills
167
- - Use `doc-todo` for TODO comments
168
-
169
- ### Context
170
- - [Existing file]: [what to use from it]
171
- - Existing pattern: [path to similar code]
172
-
173
- ### Output Files
174
- - [path/to/create.ext]
175
-
176
- ### Requirements
177
- 1. [What to implement with signatures]
178
- 2. [Another requirement]
179
-
180
- ### Pattern Reference
181
- → [path/to/similar/code.ext]
182
-
183
- ### Error Handling
184
- [How to handle errors]
185
-
186
- ### Done When
187
- - [ ] File compiles
188
- - [ ] Tests pass
189
- - [ ] [Specific criterion]
190
- ```
191
- </template>
129
+ @coder reads the files and figures out implementation details.
192
130
 
193
131
  <rules name="delegation">
194
- <rule name="task-by-task" critical="true">
195
- Delegate ONE task at a time (or parallel group if independent).
196
- NEVER delegate entire story as one big prompt.
197
- </rule>
198
- <rule name="parallel">
199
- Each task gets full context. No shared state. Different files only.
132
+ <rule name="one-task" critical="true">
133
+ ONE task per @coder call. Independent tasks can run in parallel (multiple agents in one message).
200
134
  </rule>
201
135
  <rule name="verify-between">
202
- After each task: run tests, verify, mark done, THEN next task.
136
+ After each task: verify result, mark done, THEN next task.
203
137
  </rule>
204
- <rule name="no-code">
205
- Give direction, NOT solution. @coder writes implementation.
206
- </rule>
207
- <rule name="methodology">
208
- TDD: "Write failing test first, then implement"
209
- STUB: "Create stub first, write tests, then implement"
138
+ <rule name="task-scope">
139
+ Good task: logically complete unit (service, handler, entity). Single responsibility. Testable independently.
140
+ Split when: multiple unrelated responsibilities.
141
+ Combine when: too granular, same file, same concern.
210
142
  </rule>
211
143
  </rules>
212
-
213
- <task-boundaries>
214
- <good>Logically complete unit (service, handler, entity). Single responsibility. Testable independently.</good>
215
- <split-when>Multiple unrelated responsibilities. No logical connection.</split-when>
216
- <combine-when>Too granular. Same file, same concern.</combine-when>
217
- </task-boundaries>
218
-
219
- <patterns>
220
- <pattern name="new-service">
221
- Context: domain entities, repository interface, existing service
222
- Requirements: interface, constructor, methods
223
- Pattern: existing service structure
224
- </pattern>
225
- <pattern name="new-handler">
226
- Context: service interface, DTOs, existing handler
227
- Requirements: handler struct, methods, error mapping
228
- Pattern: existing handler structure
229
- </pattern>
230
- <pattern name="new-tests">
231
- Context: code to test, existing test examples
232
- Requirements: test scenarios, mocks
233
- Pattern: existing test structure
234
- </pattern>
235
- </patterns>
236
-
237
- <critical>
238
- ✅ PROVIDE: pattern references, interface signatures, requirements, error approach
239
- ❌ DO NOT: full implementations, ready-to-copy code, complete structs
240
- </critical>
@@ -16,6 +16,12 @@ 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
+
19
25
  <definition>Story = Smallest working increment (one layer/feature)</definition>
20
26
 
21
27
  <sizes>
@@ -47,6 +53,22 @@ metadata:
47
53
  <result>Each story = increment, Epic = working module</result>
48
54
  </vertical_slice>
49
55
 
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>
71
+
50
72
  <status_values>
51
73
  <draft>Being written</draft>
52
74
  <ready>Ready for dev</ready>
@@ -59,69 +81,52 @@ metadata:
59
81
 
60
82
  ---
61
83
 
62
- ## Example: MEDIUM Project Story
63
-
64
- ```yaml
65
- id: ORD-S01-01
66
- epic: ORD-E01
67
- status: ready
68
- size: M
69
- ```
70
-
71
- # Story: Order Domain Layer
72
-
73
- ## Goal
84
+ ## Template & Format
74
85
 
75
- Implement domain entities and value objects for Order Management.
86
+ **BEFORE writing any story:** Read the template file:
76
87
 
77
- **Context:** Part of Epic 01 (Order Management). Focuses on domain layer.
88
+ `./template.md`
78
89
 
79
- ## Units Affected
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)
80
93
 
81
- | Unit | Action | Description |
82
- |------|--------|-------------|
83
- | → Unit: `Order` | Create | New entity |
84
-
85
- ## Required Reading
86
-
87
- | Document | Section | Why |
88
- |----------|---------|-----|
89
- | → `CLAUDE.md` | All | Project patterns |
90
- | → `docs/coding-standards/` | All | **MANDATORY** |
91
- | → Unit: `Order` | Data Model | Field definitions |
94
+ ---
92
95
 
93
- ## Acceptance Criteria
96
+ ## Task Structure (MANDATORY)
94
97
 
95
- - [ ] Order entity created with all fields
96
- - [ ] Validation logic implemented
97
- - [ ] Tests pass (>80% coverage)
98
- - [ ] Follows coding-standards
98
+ Each task MUST include these sections:
99
99
 
100
- ## Tasks
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
101
105
 
102
- | ID | Task | Deps | Status |
103
- |----|------|------|--------|
104
- | T1 | Order entity | - | ⬜ |
105
- | T2 | Value objects | - | ⬜ |
106
- | T3 | Unit tests | T1, T2 | ⬜ |
106
+ ### Approach Section Rules
107
107
 
108
- ### T1: Order Entity
108
+ **CRITICAL:** Every task MUST have **Approach** section.
109
109
 
110
- **Goal:** Create Order entity with business rules
110
+ **Approach = High-level steps (WHAT to do), NOT code (HOW to implement).**
111
111
 
112
- **Read First:**
113
- | Document | Section | What to Look For |
114
- |----------|---------|------------------|
115
- | `docs/coding-standards/` | Domain Layer | Entity patterns |
116
- | Unit: `Order` | Data Model | All fields |
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
+ ```
117
120
 
118
- **Output Files:**
119
- - `internal/order/domain/order.go`
120
- - `internal/order/domain/order_test.go`
121
+ **WRONG (has code):**
122
+ ```markdown
123
+ **Approach:**
124
+ 1. Define struct:
125
+ ```go
126
+ type Order struct { ID string }
127
+ ```
128
+ ```
121
129
 
122
- **Done when:**
123
- - [ ] Entity created
124
- - [ ] Follows coding-standards
125
- - [ ] Tests pass
130
+ **Golden Rule:** If you see code blocks in Approach → STOP, remove them.
126
131
 
127
- See `template.md` for full format.
132
+ Point to patterns, don't write implementation.
@@ -1,45 +0,0 @@
1
- vectorizer:
2
- # Enable/disable vectorizer functionality
3
- enabled: true
4
-
5
- # Auto-index files when they change (requires file-indexer plugin)
6
- auto_index: true
7
-
8
- # Debounce time in ms (wait before indexing after file change)
9
- debounce_ms: 1000
10
-
11
- # Indexes to maintain - each has pattern (what to include) and ignore (what to skip)
12
- indexes:
13
-
14
- # Documentation index - markdown, text files
15
- docs:
16
- enabled: true
17
- pattern: "docs/**/*.{md,mdx,txt,rst,adoc}"
18
- ignore: []
19
-
20
- # Configuration index - yaml, json, toml
21
- config:
22
- enabled: false
23
- pattern: "**/*.{yaml,yml,json,toml,ini}"
24
- ignore:
25
- - "**/node_modules/**"
26
- - "**/.git/**"
27
- - "**/dist/**"
28
- - "**/build/**"
29
- - "**/.opencode/**"
30
- - "**/docs/**"
31
- - "**/vendor/**"
32
- - "**/__pycache__/**"
33
- - "**/*.min.js"
34
- - "**/*.bundle.js"
35
- - "**/package-lock.json"
36
- - "**/yarn.lock"
37
-
38
- # Global exclude patterns (applied to ALL indexes, in addition to per-index ignore)
39
- exclude:
40
- - node_modules
41
- - vendor
42
- - dist
43
- - build
44
- - out
45
- - __pycache__