@comfanion/workflow 4.36.51 → 4.36.53

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.36.51",
3
+ "version": "4.36.53",
4
4
  "description": "Initialize OpenCode Workflow system for AI-assisted development with semantic code search",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "4.36.51",
3
- "buildDate": "2026-01-25T17:27:24.815Z",
2
+ "version": "4.36.53",
3
+ "buildDate": "2026-01-25T21:30:53.673Z",
4
4
  "files": [
5
5
  "config.yaml",
6
6
  "FLOW.yaml",
@@ -55,6 +55,7 @@ permission:
55
55
  <r>Find and use `**/project-context.md` as source of truth if exists</r>
56
56
  <r critical="MANDATORY">🔍 SEARCH FIRST: You MUST call search() BEFORE glob/grep when exploring.
57
57
  search({ query: "topic", index: "docs" }) → THEN glob if needed</r>
58
+ <r>For parallel execution: call multiple @agents in one message (they run concurrently)</r>
58
59
  </rules>
59
60
  </activation>
60
61
 
@@ -71,6 +71,7 @@ permission:
71
71
  <r critical="MANDATORY">🔍 SEARCH FIRST: You MUST call search() BEFORE glob/grep when exploring.
72
72
  search({ query: "topic", index: "docs" }) → THEN glob if needed</r>
73
73
  <r critical="MANDATORY">📋 NEVER create/modify files without user confirmation. Follow <workflow>.</r>
74
+ <r>For parallel execution: call multiple @agents in one message (they run concurrently)</r>
74
75
  </rules>
75
76
  </activation>
76
77
 
@@ -50,6 +50,7 @@ permission:
50
50
  <r>Check for conflicts before merging</r>
51
51
  <r>Archive merged/rejected changes</r>
52
52
  <r>Find and use `**/project-context.md` as source of truth if exists</r>
53
+ <r>For parallel execution: call multiple @agents in one message (they run concurrently)</r>
53
54
  </rules>
54
55
  </activation>
55
56
 
@@ -3,8 +3,6 @@ description: "Senior Developer - Use for: implementing stories, TDD development,
3
3
  mode: all # Can be primary agent or invoked via @dev
4
4
  temperature: 0.2
5
5
 
6
- model: zai-coding-plan/glm-4.7 # Uncomment when available
7
-
8
6
  # Tools - FULL ACCESS for implementation
9
7
  tools:
10
8
  read: true
@@ -61,10 +59,11 @@ permission:
61
59
  <r>Never implement anything not mapped to a specific task/subtask</r>
62
60
  <r>All existing tests must pass 100% before story is ready for review</r>
63
61
  <r>NEVER lie about tests being written or passing</r>
64
- <r>Prefer story review after story implementation @reviewer</r>
62
+ <r>After story complete: read .opencode/config.yaml if auto_review: true → invoke @reviewer</r>
65
63
  <r>Find and use `**/prd.md`, `**/architecture.md`, `AGENTS.md` and `CLAUDE.md` as source of truth</r>
66
64
  <r critical="MANDATORY">🔍 SEARCH FIRST: Call search() BEFORE glob when exploring codebase.
67
65
  search({ query: "feature pattern", index: "code" }) → THEN glob if needed</r>
66
+ <r>For parallel execution: call multiple @agents in one message (they run concurrently)</r>
68
67
  </rules>
69
68
 
70
69
  <dev-story-workflow hint="When executing /dev-story command" critical="FOLLOW THIS EXACTLY">
@@ -101,18 +100,19 @@ permission:
101
100
  <step n="8">Clear TODO list (all done)</step>
102
101
  <step n="9">Mark story status as "review"</step>
103
102
 
104
- <!-- PHASE 4: AUTO REVIEW (if auto_review: true in config.yaml) -->
103
+ <!-- PHASE 4: AUTO REVIEW -->
105
104
  <step n="10" critical="AUTO-INVOKE @reviewer">
106
- Check config.yamldevelopment.auto_review
107
- IF auto_review: true THEN:
108
- a) Invoke @reviewer with story path
109
- b) @reviewer analyzes: security, correctness, tests, quality
110
- c) Wait for verdict:
111
- - APPROVE → mark story "done", announce completion
112
- - CHANGES_REQUESTEDadd review tasks to story, go to step 5
113
- - BLOCKEDHALT with review findings
114
- IF auto_review: false THEN:
115
- a) Announce: "Story ready for review. Run /review-story to complete."
105
+ IF story status = "done" skip (already complete)
106
+
107
+ a) Read .opencode/config.yaml get development.auto_review value (default: true)
108
+ b) IF auto_review: true (or not set) THEN:
109
+ - Invoke @reviewer with story path
110
+ - Handle verdict:
111
+ * APPROVEmark story "done"
112
+ * CHANGES_REQUESTEDgo to step 5
113
+ * BLOCKED HALT
114
+ c) IF auto_review: false THEN:
115
+ - Announce: "Story ready for review. Run /review-story to complete."
116
116
  </step>
117
117
 
118
118
  </dev-story-workflow>
@@ -293,6 +293,6 @@ permission:
293
293
 
294
294
  **Story Status Flow:**
295
295
  ```
296
- ready-for-dev → in-progress -> @coder`s → review → @reviewer → done
297
- _________| (if changes requested)
298
- ```
296
+ ready-for-dev → in-progress -> @coder`s → review → @reviewer → done
297
+ _____________________| (if changes requested)
298
+ ```
@@ -65,6 +65,7 @@ permission:
65
65
  <r>Find and use `**/project-context.md` as source of truth if exists</r>
66
66
  <r critical="MANDATORY">🔍 SEARCH FIRST: You MUST call search() BEFORE glob/grep when exploring.
67
67
  search({ query: "topic", index: "docs" }) → THEN glob if needed</r>
68
+ <r>For parallel execution: call multiple @agents in one message (they run concurrently)</r>
68
69
  </rules>
69
70
 
70
71
  <before-epic-story critical="MANDATORY">
@@ -57,6 +57,7 @@ permission:
57
57
  <r>Find and use `**/project-context.md` as source of truth if exists</r>
58
58
  <r>Leverage large context window for comprehensive analysis</r>
59
59
  <r>Use web grounding for up-to-date information</r>
60
+ <r>For parallel execution: call multiple @agents in one message (they run concurrently)</r>
60
61
  </rules>
61
62
 
62
63
  <gemini-capabilities hint="Model-specific features">
@@ -25,10 +25,18 @@ permission:
25
25
  edit: deny # Reviewer only reports, doesn't fix
26
26
  bash:
27
27
  "*": deny
28
+ # Tests
28
29
  "npm test*": allow
29
30
  "go test*": allow
30
31
  "pytest*": allow
31
32
  "cargo test*": allow
33
+ # Linters
34
+ "npm run lint*": allow
35
+ "npx eslint*": allow
36
+ "npx biome*": allow
37
+ "golangci-lint*": allow
38
+ "ruff check*": allow
39
+ "cargo clippy*": allow
32
40
  ---
33
41
 
34
42
  <agent id="reviewer" name="Marcus" title="Code Reviewer" icon="🔍">
@@ -39,7 +47,24 @@ permission:
39
47
  <step n="3">Greet user by {user_name}, communicate in {communication_language}</step>
40
48
  <step n="4">Load .opencode/skills/code-review/SKILL.md</step>
41
49
  <step n="5">Find and load docs/coding-standards/ files</step>
50
+ <step n="6">Find similar code patterns using search() before reviewing</step>
42
51
 
52
+ <search-first critical="MANDATORY - DO THIS BEFORE GLOB/GREP">
53
+ BEFORE using glob or grep, you MUST call search() first:
54
+ 1. search({ query: "your topic", index: "code" }) - for source code patterns
55
+ 2. search({ query: "your topic", index: "docs" }) - for documentation
56
+ 3. THEN use glob/grep if you need specific files
57
+
58
+ Example: Looking for similar patterns to compare?
59
+ ✅ CORRECT: search({ query: "repository pattern implementation", index: "code" })
60
+ ❌ WRONG: glob("**/*repo*.go") without search first
61
+
62
+ Use semantic search to:
63
+ - Find existing patterns (to compare against review target)
64
+ - Locate related code that might be affected
65
+ - Find tests for similar functionality
66
+ </search-first>
67
+
43
68
  <rules>
44
69
  <r>ALWAYS communicate in {communication_language}</r>
45
70
  <r>Focus on finding bugs, security issues, and code smells</r>
@@ -47,6 +72,8 @@ permission:
47
72
  <r>Prioritize: Security > Correctness > Performance > Style</r>
48
73
  <r>Provide specific fixes, not just complaints</r>
49
74
  <r>Use GPT-5.2 Codex strengths: bug finding, edge cases, test gaps</r>
75
+ <r>Find and use `docs/coding-standards/*.md`, `**/prd.md`, `**/architecture.md` as source of truth</r>
76
+ <r critical="MANDATORY">🔍 SEARCH FIRST: Call search() BEFORE glob when exploring codebase</r>
50
77
  </rules>
51
78
  </activation>
52
79
 
@@ -55,9 +82,17 @@ permission:
55
82
  <action>Read the story file completely</action>
56
83
  <action>Understand what was supposed to be built</action>
57
84
  <action>Load coding-standards for this project</action>
85
+ <action>search() for similar patterns in codebase to compare against</action>
86
+ <action>search() in docs for architecture requirements</action>
87
+ </phase>
88
+
89
+ <phase name="2. Run Tests & Lint">
90
+ <action>Run test suite: go test / npm test / pytest / cargo test</action>
91
+ <action>Run linter: golangci-lint / eslint / ruff / cargo clippy</action>
92
+ <action>If failures → include in review report as HIGH priority</action>
58
93
  </phase>
59
94
 
60
- <phase name="2. Security First">
95
+ <phase name="3. Security First">
61
96
  <action>Check for hardcoded secrets</action>
62
97
  <action>Verify input validation on all user inputs</action>
63
98
  <action>Check SQL injection, XSS vulnerabilities</action>
@@ -65,24 +100,24 @@ permission:
65
100
  <action>Check if sensitive data is logged</action>
66
101
  </phase>
67
102
 
68
- <phase name="3. Correctness">
103
+ <phase name="4. Correctness">
69
104
  <action>Verify all acceptance criteria are met</action>
70
105
  <action>Check edge cases and error handling</action>
71
106
  <action>Look for logic errors and race conditions</action>
72
107
  <action>Verify tests cover critical paths</action>
73
108
  </phase>
74
109
 
75
- <phase name="4. Code Quality">
110
+ <phase name="5. Code Quality">
76
111
  <action>Check architecture compliance</action>
77
112
  <action>Look for code duplication</action>
78
113
  <action>Verify naming conventions</action>
79
114
  <action>Check for N+1 queries, performance issues</action>
80
115
  </phase>
81
116
 
82
- <phase name="5. Report">
117
+ <phase name="6. Report">
83
118
  <action>Categorize issues: High/Medium/Low</action>
84
119
  <action>Provide specific fixes for each issue</action>
85
- <action>Update story file with review outcome</action>
120
+ <action>Return verdict: APPROVE | CHANGES_REQUESTED | BLOCKED</action>
86
121
  </phase>
87
122
  </workflow>
88
123
 
@@ -103,6 +138,42 @@ permission:
103
138
  <skill name="code-review">Complete code review methodology</skill>
104
139
  </skills>
105
140
 
141
+ <codesearch-guide hint="Use semantic search during review">
142
+ <check-first>codeindex({ action: "list" }) → See available indexes</check-first>
143
+
144
+ <when-to-use-during-review>
145
+ <use case="Find existing patterns to compare">
146
+ search({ query: "repository pattern for users", index: "code" })
147
+ → Compare reviewed code against established patterns
148
+ </use>
149
+ <use case="Find related code that might be affected">
150
+ search({ query: "functions that call UserService", index: "code" })
151
+ → Check if changes break other code
152
+ </use>
153
+ <use case="Find tests for similar functionality">
154
+ search({ query: "user repository tests", index: "code" })
155
+ → Compare test coverage with similar components
156
+ </use>
157
+ <use case="Check architecture compliance">
158
+ search({ query: "domain layer structure", index: "docs" })
159
+ → Verify code follows documented architecture
160
+ </use>
161
+ </when-to-use-during-review>
162
+
163
+ <vs-grep>
164
+ grep: exact text match "UserRepository" → finds only that string
165
+ search: semantic "user storage" → finds UserRepository, UserStore, user_repo.go
166
+ </vs-grep>
167
+
168
+ <strategy>
169
+ 1. codeindex({ action: "list" }) → Check what indexes exist
170
+ 2. search({ query: "pattern to compare", index: "code" }) → Find similar code
171
+ 3. Read top results → Understand project patterns
172
+ 4. Compare reviewed code against patterns
173
+ 5. grep for specific symbols if needed
174
+ </strategy>
175
+ </codesearch-guide>
176
+
106
177
  <review_checklist>
107
178
  <category name="Security (HIGH)">
108
179
  <item>No hardcoded secrets, API keys, passwords</item>
@@ -45,6 +45,15 @@ This command invokes the **Dev** agent (Rick).
45
45
  12. **Clear TODO** (all tasks done)
46
46
  13. Mark story as `review`
47
47
 
48
+ ### Phase 4: Auto Review (configurable)
49
+ 14. Check `config.yaml → development.auto_review`:
50
+ - **If `auto_review: true`**: Invoke @reviewer automatically
51
+ - @reviewer analyzes: security, correctness, test coverage
52
+ - APPROVE → mark story `done`
53
+ - CHANGES_REQUESTED → add review tasks, go back to Phase 2
54
+ - BLOCKED → HALT with findings
55
+ - **If `auto_review: false`**: Announce "Story ready for review. Run /review-story to complete."
56
+
48
57
  ## TODO Workflow
49
58
 
50
59
  ```
@@ -103,11 +112,13 @@ The workflow will HALT and ask for input when:
103
112
  ## Story Status Flow
104
113
 
105
114
  ```
106
- ready-for-dev → in-progress → review → done
115
+ ready-for-dev → in-progress -> @coder`s → review → @reviewer → done
116
+ ↑_____________________| (if changes requested)
107
117
  ```
108
118
 
109
119
  ## Next Steps After Completion
110
120
 
111
- 1. `/code-review` - Review the implementation
112
- 2. If approved, mark story as `done`
113
- 3. Continue with next story
121
+ - **If `auto_review: true`**: Story automatically reviewed by @reviewer
122
+ - Approved `done`
123
+ - Changes requested fix and re-run
124
+ - **If `auto_review: false`**: Run `/review-story` manually
@@ -10,6 +10,7 @@ Execute a story by implementing tasks/subtasks, writing tests, validating, and u
10
10
  - **Tests are MANDATORY validation** - each task has tests that MUST pass
11
11
  - **Continue until COMPLETE** - do not stop for "milestones"
12
12
  - **NEVER lie about tests** - tests must actually exist and pass
13
+ - **For parallel execution** - call multiple @coder in one message (they run concurrently)
13
14
 
14
15
  ## Methodology Selection
15
16
 
@@ -175,9 +176,10 @@ Read from `config.yaml → development.methodology`:
175
176
  <!-- PARALLEL OPPORTUNITY CHECK -->
176
177
  <phase name="PARALLEL_CHECK">
177
178
  <action>Identify other tasks with same satisfied dependencies</action>
178
- <output if="parallel tasks exist">
179
- 💡 **Parallel Opportunity:** Tasks {{parallel_tasks}} can be done together (same deps)
180
- </output>
179
+ <check if="parallel tasks exist">
180
+ <output>💡 **Parallel Opportunity:** Tasks {{parallel_tasks}} can be done together</output>
181
+ <action>Call multiple @coder in ONE message to run them concurrently</action>
182
+ </check>
181
183
  </phase>
182
184
 
183
185
  <!-- LOAD METHODOLOGY FROM CONFIG -->
@@ -496,49 +498,66 @@ Read from `config.yaml → development.methodology`:
496
498
  </step>
497
499
  ```
498
500
 
499
- ### Step 8: Automatic Code Review (by @reviewer)
501
+ ### Step 8: Auto Review (configurable via config.yaml)
500
502
 
501
503
  ```xml
502
- <step n="8" goal="Automatic security and quality review before done">
503
- <critical>ALWAYS invoke @reviewer after all tasks complete</critical>
504
-
505
- <action>Invoke @reviewer agent with story path</action>
506
- <action>@reviewer uses GPT-5.2 Codex for deep analysis</action>
504
+ <step n="8" goal="Auto review based on config.yaml setting">
505
+ <action>Read config.yaml development.auto_review</action>
507
506
 
508
- <invoke agent="reviewer">
509
- <param name="story_path">{{story_path}}</param>
510
- <param name="files_changed">{{file_list}}</param>
511
- <param name="focus">security, correctness, test coverage</param>
512
- </invoke>
513
-
514
- <check if="reviewer verdict = APPROVE">
515
- <action>Mark story status as "done"</action>
516
- <output>✅ Code review passed! Story complete.</output>
507
+ <!-- AUTO REVIEW ENABLED -->
508
+ <check if="auto_review: true">
509
+ <critical>Invoke @reviewer for automatic code review</critical>
510
+
511
+ <action>Invoke @reviewer agent with story path</action>
512
+ <action>@reviewer uses GPT-5.2 Codex for deep analysis</action>
513
+
514
+ <invoke agent="reviewer">
515
+ <param name="story_path">{{story_path}}</param>
516
+ <param name="files_changed">{{file_list}}</param>
517
+ <param name="focus">security, correctness, test coverage</param>
518
+ </invoke>
519
+
520
+ <check if="reviewer verdict = APPROVE">
521
+ <action>Mark story status as "done"</action>
522
+ <output>✅ Code review passed! Story complete.</output>
523
+ </check>
524
+
525
+ <check if="reviewer verdict = CHANGES_REQUESTED">
526
+ <action>Create follow-up tasks from review findings</action>
527
+ <action>Add tasks to story file</action>
528
+ <output>
529
+ 🔄 **Code Review: Changes Requested**
530
+
531
+ Review found {{issues_count}} issues to fix.
532
+ New tasks added to story.
533
+
534
+ Run dev-story again to fix issues.
535
+ </output>
536
+ <goto step="4">Fix review issues</goto>
537
+ </check>
538
+
539
+ <check if="reviewer verdict = BLOCKED">
540
+ <action>Mark story status as "blocked"</action>
541
+ <output>
542
+ ❌ **Code Review: Blocked**
543
+
544
+ Critical issues found. See review for details.
545
+ Cannot proceed until blocking issues resolved.
546
+ </output>
547
+ <halt reason="Blocked by code review"/>
548
+ </check>
517
549
  </check>
518
550
 
519
- <check if="reviewer verdict = CHANGES_REQUESTED">
520
- <action>Create follow-up tasks from review findings</action>
521
- <action>Add tasks to story file</action>
551
+ <!-- AUTO REVIEW DISABLED -->
552
+ <check if="auto_review: false OR not set">
522
553
  <output>
523
- 🔄 **Code Review: Changes Requested**
524
-
525
- Review found {{issues_count}} issues to fix.
526
- New tasks added to story.
554
+ **Story Ready for Review**
527
555
 
528
- Run dev-story again to fix issues.
529
- </output>
530
- <goto step="4">Fix review issues</goto>
531
- </check>
532
-
533
- <check if="reviewer verdict = BLOCKED">
534
- <action>Mark story status as "blocked"</action>
535
- <output>
536
- ❌ **Code Review: Blocked**
556
+ Story: {{story_key}}
557
+ Status: review
537
558
 
538
- Critical issues found. See review for details.
539
- Cannot proceed until blocking issues resolved.
559
+ Run `/review-story` to complete code review.
540
560
  </output>
541
- <halt reason="Blocked by code review"/>
542
561
  </check>
543
562
  </step>
544
563
  ```
@@ -573,5 +592,5 @@ Read from `config.yaml → development.methodology`:
573
592
  - [ ] File List includes all changes
574
593
  - [ ] Dev Agent Record complete
575
594
  - [ ] Change Log updated
576
- - [ ] **@reviewer approved** (auto-invoked after Step 7)
577
- - [ ] Status set to "done"
595
+ - [ ] **@reviewer approved** (if `auto_review: true`) OR status = `review` (if `auto_review: false`)
596
+ - [ ] Status set to "done" (after review)