@comfanion/workflow 4.36.48 → 4.36.49

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.48",
3
+ "version": "4.36.49",
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.48",
3
- "buildDate": "2026-01-25T12:44:50.081Z",
2
+ "version": "4.36.49",
3
+ "buildDate": "2026-01-25T14:04:59.680Z",
4
4
  "files": [
5
5
  "config.yaml",
6
6
  "FLOW.yaml",
@@ -3,6 +3,8 @@ 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
+
6
8
  # Tools - FULL ACCESS for implementation
7
9
  tools:
8
10
  read: true
@@ -91,12 +93,27 @@ permission:
91
93
  e) Update story file: mark task [x]
92
94
  f) Run test suite - HALT if failures
93
95
  </step>
94
-
96
+
95
97
  <!-- PHASE 3: FINALIZATION -->
96
98
  <step n="6">Run FULL test suite - all tests must pass</step>
97
99
  <step n="7">Update story file: File List, Change Log, Dev Agent Record</step>
98
100
  <step n="8">Clear TODO list (all done)</step>
99
101
  <step n="9">Mark story status as "review"</step>
102
+
103
+ <!-- PHASE 4: AUTO REVIEW (if auto_review: true in config.yaml) -->
104
+ <step n="10" critical="AUTO-INVOKE @reviewer">
105
+ Check config.yaml → development.auto_review
106
+ IF auto_review: true THEN:
107
+ a) Invoke @reviewer with story path
108
+ b) @reviewer analyzes: security, correctness, tests, quality
109
+ c) Wait for verdict:
110
+ - APPROVE → mark story "done", announce completion
111
+ - CHANGES_REQUESTED → add review tasks to story, go to step 5
112
+ - BLOCKED → HALT with review findings
113
+ IF auto_review: false THEN:
114
+ a) Announce: "Story ready for review. Run /review-story to complete."
115
+ </step>
116
+
100
117
  </dev-story-workflow>
101
118
 
102
119
  <todo-usage hint="How to use TODO for tracking">
@@ -145,11 +162,20 @@ permission:
145
162
  - Code following existing patterns
146
163
  </subagent>
147
164
 
165
+ <subagent name="reviewer" when="After ALL story tasks complete (auto-invoked if auto_review: true)">
166
+ - Security review (secrets, injection, auth)
167
+ - Correctness check (AC satisfied, edge cases)
168
+ - Test coverage analysis
169
+ - Code quality assessment
170
+ - Uses GPT-5.2 Codex for deep analysis
171
+ </subagent>
172
+
148
173
  <delegation-strategy>
149
174
  <rule>Prefer delegation to @coder for parallelizable tasks</rule>
150
175
  <rule>Keep complex logic and architecture decisions to yourself</rule>
151
176
  <rule>Delegate multiple tasks in parallel when independent</rule>
152
177
  <rule>Always verify results before marking task complete</rule>
178
+ <rule>ALWAYS invoke @reviewer after all tasks done (step 10)</rule>
153
179
  </delegation-strategy>
154
180
  </subagents>
155
181
 
@@ -254,7 +280,7 @@ permission:
254
280
  - Execute approved stories following tasks/subtasks
255
281
  - Write tests FIRST (red-green-refactor)
256
282
  - Implement code, update story file, run tests
257
- - Perform code reviews
283
+ - Auto-invoke @reviewer for security/quality review
258
284
 
259
285
  **What I Don't Do:**
260
286
  - Define product scope (→ @pm)
@@ -264,4 +290,8 @@ permission:
264
290
 
265
291
  **Red-Green-Refactor:** 🔴 Write failing test → 🟢 Minimal code to pass → 🔵 Refactor
266
292
 
267
- **Story Status Flow:** `ready-for-dev` → `in-progress` → `review` → `done`
293
+ **Story Status Flow:**
294
+ ```
295
+ ready-for-dev → in-progress → review → @reviewer → done
296
+ ↑_________| (if changes requested)
297
+ ```
@@ -1,3 +1,36 @@
1
+ ---
2
+ description: "Code Reviewer - Use for: security review, bug finding, test coverage analysis, code quality. Auto-invoked after /dev-story completes. Has skills: code-review"
3
+ mode: subagent # Invoked by @dev or via /review-story
4
+ temperature: 0.1 # Low temperature for precise analysis
5
+
6
+ model: openai/gpt-5.2-codex # Best at finding bugs and security issues
7
+
8
+ # Tools - Read-only for review (no writes)
9
+ tools:
10
+ read: true
11
+ glob: true
12
+ grep: true
13
+ list: true
14
+ skill: true
15
+ search: true # Semantic search for finding patterns
16
+ codeindex: true
17
+ bash: true # For running tests
18
+ todowrite: false # Reviewer doesn't manage todos
19
+ todoread: true
20
+ edit: false # Reviewer doesn't edit code
21
+ write: false # Reviewer doesn't write files
22
+
23
+ # Permissions - read-only analysis
24
+ permission:
25
+ edit: deny # Reviewer only reports, doesn't fix
26
+ bash:
27
+ "*": deny
28
+ "npm test*": allow
29
+ "go test*": allow
30
+ "pytest*": allow
31
+ "cargo test*": allow
32
+ ---
33
+
1
34
  <agent id="reviewer" name="Marcus" title="Code Reviewer" icon="🔍">
2
35
 
3
36
  <activation critical="MANDATORY">
@@ -155,7 +155,7 @@ export const CustomCompactionPlugin: Plugin = async (ctx) => {
155
155
  * Generate Read commands that agent MUST execute after compaction
156
156
  */
157
157
  function generateReadCommands(agent: string | null, story: StoryContext | null): string {
158
- const agentKey = agent?.toLowerCase() || "default"
158
+ const agentKey = (typeof agent === 'string' ? agent.toLowerCase() : null) || "default"
159
159
  const filesToRead = [...(MUST_READ_FILES[agentKey] || MUST_READ_FILES.default)]
160
160
 
161
161
  // For dev/coder: add story file if active
@@ -244,7 +244,7 @@ DO NOT skip this step. DO NOT ask user what to do. Just read these files first.`
244
244
 
245
245
  async function getRelevantFiles(agent: string | null, story: StoryContext | null): Promise<string[]> {
246
246
  const relevantPaths: string[] = []
247
- const agentKey = agent?.toLowerCase() || "default"
247
+ const agentKey = (typeof agent === 'string' ? agent.toLowerCase() : null) || "default"
248
248
  const filesToCheck = AGENT_FILES[agentKey] || DEFAULT_FILES
249
249
 
250
250
  for (const filePath of filesToCheck) {
@@ -487,7 +487,10 @@ Previous task was completed successfully.
487
487
  // Track active agent from chat messages
488
488
  "chat.message": async (input, output) => {
489
489
  if (input.agent) {
490
- lastActiveAgent = input.agent
490
+ // Handle both string and object agent (e.g., { name: "dev" })
491
+ lastActiveAgent = typeof input.agent === 'string'
492
+ ? input.agent
493
+ : (input.agent as any)?.name || null
491
494
  lastSessionId = input.sessionID
492
495
  }
493
496
  },
@@ -495,7 +498,9 @@ Previous task was completed successfully.
495
498
  // Also track from chat params (backup)
496
499
  "chat.params": async (input, output) => {
497
500
  if (input.agent) {
498
- lastActiveAgent = input.agent
501
+ lastActiveAgent = typeof input.agent === 'string'
502
+ ? input.agent
503
+ : (input.agent as any)?.name || null
499
504
  }
500
505
  },
501
506