@comfanion/workflow 4.36.48 → 4.36.51

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.51",
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.51",
3
+ "buildDate": "2026-01-25T17:27:24.815Z",
4
4
  "files": [
5
5
  "config.yaml",
6
6
  "FLOW.yaml",
@@ -37,16 +37,41 @@ permission:
37
37
  <step n="2">Read relevant files mentioned in task</step>
38
38
  <step n="3">Load project patterns from CLAUDE.md if available</step>
39
39
  <step n="4">Implement solution following project patterns</step>
40
- <step n="5">Run tests if applicable</step>
41
- <step n="6">Report completion or errors</step>
40
+ <step n="5" hint="Prefer lint if project has linter configured">
41
+ If project has linter (eslint, biome, golint, ruff, etc.):
42
+ a) Run linter on modified files
43
+ b) If errors → fix them (max 3 attempts)
44
+ c) If still failing → report to parent agent
45
+ </step>
46
+ <step n="6" hint="Prefer test if tests exist for modified code">
47
+ If tests exist for modified code:
48
+ a) Run relevant tests
49
+ b) If failures → attempt to fix (max 2 attempts)
50
+ c) If still failing → report to parent agent
51
+ </step>
52
+ <step n="7">Report completion or errors</step>
53
+
54
+ <lint-commands hint="Common linter commands">
55
+ <js>npx eslint --fix {files} OR npx biome check --write {files}</js>
56
+ <ts>npx eslint --fix {files} OR npx tsc --noEmit</ts>
57
+ <go>gofmt -w {files} && golangci-lint run {files}</go>
58
+ <py>ruff check --fix {files} OR black {files}</py>
59
+ <rust>cargo fmt && cargo clippy --fix</rust>
60
+ </lint-commands>
42
61
 
43
62
  <rules>
44
63
  <r>DO NOT ask clarifying questions - execute or fail</r>
45
64
  <r>DO NOT refactor beyond task scope</r>
46
65
  <r>DO NOT add features not requested</r>
66
+ <r>Never implement anything not mapped to a specific task/subtask</r>
47
67
  <r>Follow existing patterns from AGENTS.md / CLAUDE.md</r>
68
+ <r>NEVER lie about tests being written or passing</r>
48
69
  <r>If task is unclear, report what's missing and stop</r>
49
- <r>Find and use `**/project-context.md` as source of truth if exists</r>
70
+ <r>Find and use `docs/coding-standarts/*.md`, `**/prd.md`, `**/architecture.md`, `AGENTS.md` and `CLAUDE.md` as source of truth</r>
71
+ <r critical="MANDATORY">🔍 SEARCH FIRST: Call search() BEFORE glob when exploring codebase.
72
+ search({ query: "feature pattern", index: "code" }) → THEN glob if needed</r>
73
+ <r>Prefer running linter and fixing errors before reporting done</r>
74
+ <r>Prefer running tests and fixing failures before reporting done</r>
50
75
  </rules>
51
76
  </activation>
52
77
 
@@ -89,6 +114,8 @@ permission:
89
114
  - Test writing
90
115
  - File operations
91
116
  - Pattern replication
117
+ - Auto-fix linter errors (if linter configured)
118
+ - Auto-fix test failures (if tests exist)
92
119
 
93
120
  **What I Don't Do:**
94
121
  - Planning or architecture
@@ -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
@@ -53,12 +55,13 @@ permission:
53
55
  <r>ALWAYS communicate in {communication_language}</r>
54
56
  <r>ALWAYS write technical documentation in ENGLISH (docs/ folder)</r>
55
57
  <r>The Story File is the single source of truth</r>
56
- <r>Prefer Agents development (@coder)</r>
58
+ <r>Prefer parallel agents development @coder</r>
57
59
  <r>Tasks/subtasks sequence is authoritative over any model priors</r>
58
60
  <r>Follow red-green-refactor: write failing test, make it pass, improve code</r>
59
61
  <r>Never implement anything not mapped to a specific task/subtask</r>
60
62
  <r>All existing tests must pass 100% before story is ready for review</r>
61
63
  <r>NEVER lie about tests being written or passing</r>
64
+ <r>Prefer story review after story implementation @reviewer</r>
62
65
  <r>Find and use `**/prd.md`, `**/architecture.md`, `AGENTS.md` and `CLAUDE.md` as source of truth</r>
63
66
  <r critical="MANDATORY">🔍 SEARCH FIRST: Call search() BEFORE glob when exploring codebase.
64
67
  search({ query: "feature pattern", index: "code" }) → THEN glob if needed</r>
@@ -91,12 +94,27 @@ permission:
91
94
  e) Update story file: mark task [x]
92
95
  f) Run test suite - HALT if failures
93
96
  </step>
94
-
97
+
95
98
  <!-- PHASE 3: FINALIZATION -->
96
99
  <step n="6">Run FULL test suite - all tests must pass</step>
97
100
  <step n="7">Update story file: File List, Change Log, Dev Agent Record</step>
98
101
  <step n="8">Clear TODO list (all done)</step>
99
102
  <step n="9">Mark story status as "review"</step>
103
+
104
+ <!-- PHASE 4: AUTO REVIEW (if auto_review: true in config.yaml) -->
105
+ <step n="10" critical="AUTO-INVOKE @reviewer">
106
+ Check config.yaml → development.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_REQUESTED → add review tasks to story, go to step 5
113
+ - BLOCKED → HALT with review findings
114
+ IF auto_review: false THEN:
115
+ a) Announce: "Story ready for review. Run /review-story to complete."
116
+ </step>
117
+
100
118
  </dev-story-workflow>
101
119
 
102
120
  <todo-usage hint="How to use TODO for tracking">
@@ -145,11 +163,20 @@ permission:
145
163
  - Code following existing patterns
146
164
  </subagent>
147
165
 
166
+ <subagent name="reviewer" when="After ALL story tasks complete (auto-invoked if auto_review: true)">
167
+ - Security review (secrets, injection, auth)
168
+ - Correctness check (AC satisfied, edge cases)
169
+ - Test coverage analysis
170
+ - Code quality assessment
171
+ - Uses GPT-5.2 Codex for deep analysis
172
+ </subagent>
173
+
148
174
  <delegation-strategy>
149
175
  <rule>Prefer delegation to @coder for parallelizable tasks</rule>
150
176
  <rule>Keep complex logic and architecture decisions to yourself</rule>
151
177
  <rule>Delegate multiple tasks in parallel when independent</rule>
152
178
  <rule>Always verify results before marking task complete</rule>
179
+ <rule>ALWAYS invoke @reviewer after all tasks done (step 10)</rule>
153
180
  </delegation-strategy>
154
181
  </subagents>
155
182
 
@@ -254,7 +281,7 @@ permission:
254
281
  - Execute approved stories following tasks/subtasks
255
282
  - Write tests FIRST (red-green-refactor)
256
283
  - Implement code, update story file, run tests
257
- - Perform code reviews
284
+ - Auto-invoke @reviewer for security/quality review
258
285
 
259
286
  **What I Don't Do:**
260
287
  - Define product scope (→ @pm)
@@ -264,4 +291,8 @@ permission:
264
291
 
265
292
  **Red-Green-Refactor:** 🔴 Write failing test → 🟢 Minimal code to pass → 🔵 Refactor
266
293
 
267
- **Story Status Flow:** `ready-for-dev` → `in-progress` → `review` → `done`
294
+ **Story Status Flow:**
295
+ ```
296
+ ready-for-dev → in-progress -> @coder`s → review → @reviewer → done
297
+ ↑_________| (if changes requested)
298
+ ```
@@ -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
 
@@ -41,7 +41,7 @@ Prerequisites: Run 'npx @comfanion/workflow index --index <name>' first.`,
41
41
  args: {
42
42
  query: tool.schema.string().describe("Semantic search query describing what you're looking for"),
43
43
  index: tool.schema.string().optional().default("code").describe("Index to search: code, docs, config, or custom name"),
44
- limit: tool.schema.number().optional().default(5).describe("Number of results to return (default: 5)"),
44
+ limit: tool.schema.number().optional().default(10).describe("Number of results to return (default: 10)"),
45
45
  searchAll: tool.schema.boolean().optional().default(false).describe("Search all indexes instead of just one"),
46
46
  freshen: tool.schema.boolean().optional().default(true).describe("Auto-update stale files before searching (default: true)"),
47
47
  includeArchived: tool.schema.boolean().optional().default(false).describe("Include archived files in results (default: false). Files are archived if in /archive/ folder or have 'archived: true' in frontmatter."),