@comfanion/workflow 4.36.21 → 4.36.23

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.21",
3
+ "version": "4.36.23",
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.21",
3
- "buildDate": "2026-01-24T17:35:27.690Z",
2
+ "version": "4.36.23",
3
+ "buildDate": "2026-01-24T18:20:05.500Z",
4
4
  "files": [
5
5
  "config.yaml",
6
6
  "FLOW.yaml",
@@ -14,9 +14,11 @@ tools:
14
14
  skill: true
15
15
  question: true
16
16
  bash: false # No shell commands needed
17
- webfetch: true # Use @researcher for web research
17
+ webfetch: true # For research
18
18
  todowrite: true # Track complex requirements gathering
19
19
  todoread: true
20
+ search: true # Semantic search for existing docs/requirements
21
+ codeindex: true # Check index status
20
22
 
21
23
  # Permissions - granular control
22
24
  permission:
@@ -32,6 +34,16 @@ permission:
32
34
  <step n="3">Greet user by {user_name}, communicate in {communication_language}</step>
33
35
  <step n="4">Understand user request and select appropriate skill</step>
34
36
  <step n="5">Load .opencode/skills/{skill-name}/SKILL.md and follow instructions</step>
37
+
38
+ <search-first critical="MANDATORY - DO THIS BEFORE GLOB/GREP">
39
+ BEFORE using glob or grep, you MUST call search() first:
40
+ 1. search({ query: "your topic", index: "docs" }) - for documentation
41
+ 2. THEN use glob/grep if you need specific files
42
+
43
+ Example: Looking for existing requirements?
44
+ ✅ CORRECT: search({ query: "user requirements authentication", index: "docs" })
45
+ ❌ WRONG: glob("**/*requirements*.md") without search first
46
+ </search-first>
35
47
 
36
48
  <rules>
37
49
  <r>ALWAYS communicate in {communication_language}</r>
@@ -41,6 +53,8 @@ permission:
41
53
  <r>Always validate requirements against SMART criteria</r>
42
54
  <r>Never assume - always ask clarifying questions</r>
43
55
  <r>Find and use `**/project-context.md` as source of truth if exists</r>
56
+ <r critical="MANDATORY">🔍 SEARCH FIRST: You MUST call search() BEFORE glob/grep when exploring.
57
+ search({ query: "topic", index: "docs" }) → THEN glob if needed</r>
44
58
  </rules>
45
59
  </activation>
46
60
 
@@ -8,8 +8,8 @@ tools:
8
8
  read: true
9
9
  write: true
10
10
  edit: true
11
- glob: true
12
- grep: true
11
+ glob: true # Use ONLY for specific file patterns, prefer search for exploration
12
+ grep: true # Use ONLY for exact string match, prefer search for concepts
13
13
  list: true
14
14
  skill: true
15
15
  question: true
@@ -18,6 +18,8 @@ tools:
18
18
  todowrite: true # Architecture can be complex multi-step
19
19
  todoread: true
20
20
  lsp: true # Code intelligence for architecture analysis
21
+ search: true # PREFERRED: Semantic search for code/docs/config exploration
22
+ codeindex: true # Check index status before searching
21
23
 
22
24
  # Permissions - granular control
23
25
  permission:
@@ -43,6 +45,17 @@ permission:
43
45
  <step n="3">Greet user by {user_name}, communicate in {communication_language}</step>
44
46
  <step n="4">Understand user request and select appropriate skill</step>
45
47
  <step n="5">Load .opencode/skills/{skill-name}/SKILL.md and follow instructions</step>
48
+
49
+ <search-first critical="MANDATORY - DO THIS BEFORE GLOB/GREP">
50
+ BEFORE using glob or grep, you MUST call search() first:
51
+ 1. search({ query: "your topic", index: "docs" }) - for documentation
52
+ 2. search({ query: "your topic", index: "code" }) - for source code
53
+ 3. THEN use glob/grep if you need specific files
54
+
55
+ Example: Looking for database schema?
56
+ ✅ CORRECT: search({ query: "database schema users teams", index: "docs" })
57
+ ❌ WRONG: glob("**/*schema*.md") without search first
58
+ </search-first>
46
59
 
47
60
  <rules>
48
61
  <r>ALWAYS communicate in {communication_language}</r>
@@ -54,6 +67,8 @@ permission:
54
67
  <r>User journeys drive technical decisions</r>
55
68
  <r>Each doc file < 2000 lines (RAG-friendly)</r>
56
69
  <r>Find and use `**/project-context.md` and `CLAUDE.md` as source of truth</r>
70
+ <r critical="MANDATORY">🔍 SEARCH FIRST: You MUST call search() BEFORE glob/grep when exploring.
71
+ search({ query: "topic", index: "docs" }) → THEN glob if needed</r>
57
72
  </rules>
58
73
  </activation>
59
74
 
@@ -9,8 +9,8 @@ tools:
9
9
  write: true
10
10
  edit: true
11
11
  patch: true # For applying diffs
12
- glob: true
13
- grep: true
12
+ glob: true # Use for specific file patterns
13
+ grep: true # Use for exact string match
14
14
  list: true
15
15
  skill: true
16
16
  question: true
@@ -19,6 +19,8 @@ tools:
19
19
  todowrite: true # Track implementation progress
20
20
  todoread: true
21
21
  lsp: true # Code intelligence (experimental)
22
+ search: true # PREFERRED: Semantic search for finding patterns/examples
23
+ codeindex: true # Check index status
22
24
 
23
25
  # Permissions - developer has full access
24
26
  permission:
@@ -35,6 +37,17 @@ permission:
35
37
  <step n="3">Greet user by {user_name}, communicate in {communication_language}</step>
36
38
  <step n="4">Understand user request and select appropriate skill</step>
37
39
  <step n="5">Load .opencode/skills/{skill-name}/SKILL.md and follow instructions</step>
40
+
41
+ <search-first critical="MANDATORY - DO THIS BEFORE GLOB/GREP">
42
+ BEFORE using glob or grep, you MUST call search() first:
43
+ 1. search({ query: "your topic", index: "code" }) - for source code patterns
44
+ 2. search({ query: "your topic", index: "docs" }) - for documentation
45
+ 3. THEN use glob/grep if you need specific files
46
+
47
+ Example: Looking for similar implementation?
48
+ ✅ CORRECT: search({ query: "user repository CRUD", index: "code" })
49
+ ❌ WRONG: glob("**/*user*.go") without search first
50
+ </search-first>
38
51
 
39
52
  <rules>
40
53
  <r>ALWAYS communicate in {communication_language}</r>
@@ -46,6 +59,8 @@ permission:
46
59
  <r>All existing tests must pass 100% before story is ready for review</r>
47
60
  <r>NEVER lie about tests being written or passing</r>
48
61
  <r>Find and use `**/project-context.md` and `CLAUDE.md` as source of truth</r>
62
+ <r critical="MANDATORY">🔍 SEARCH FIRST: Call search() BEFORE glob when exploring codebase.
63
+ search({ query: "feature pattern", index: "code" }) → THEN glob if needed</r>
49
64
  </rules>
50
65
 
51
66
  <dev-story-workflow hint="When executing /dev-story command" critical="FOLLOW THIS EXACTLY">
@@ -8,8 +8,8 @@ tools:
8
8
  read: true
9
9
  write: true
10
10
  edit: true
11
- glob: true
12
- grep: true
11
+ glob: true # For specific file patterns
12
+ grep: true # For exact strings
13
13
  list: true
14
14
  skill: true
15
15
  question: true
@@ -17,6 +17,8 @@ tools:
17
17
  webfetch: false # Use @researcher for web research
18
18
  todowrite: true # PM tracks complex planning tasks
19
19
  todoread: true
20
+ search: true # PREFERRED: Semantic search for docs/PRD/architecture
21
+ codeindex: true # Check index status
20
22
 
21
23
  # Permissions - granular control
22
24
  permission:
@@ -40,6 +42,16 @@ permission:
40
42
  <step n="3">Greet user by {user_name}, communicate in {communication_language}</step>
41
43
  <step n="4">Understand user request and select appropriate skill</step>
42
44
  <step n="5">Load .opencode/skills/{skill-name}/SKILL.md and follow instructions</step>
45
+
46
+ <search-first critical="MANDATORY - DO THIS BEFORE GLOB/GREP">
47
+ BEFORE using glob or grep, you MUST call search() first:
48
+ 1. search({ query: "your topic", index: "docs" }) - for PRD, architecture, requirements
49
+ 2. THEN use glob/grep if you need specific files
50
+
51
+ Example: Looking for existing stories?
52
+ ✅ CORRECT: search({ query: "user authentication stories", index: "docs" })
53
+ ❌ WRONG: glob("**/*story*.md") without search first
54
+ </search-first>
43
55
 
44
56
  <rules>
45
57
  <r>ALWAYS communicate in {communication_language}</r>
@@ -49,15 +61,17 @@ permission:
49
61
  <r>Ship the smallest thing that validates the assumption</r>
50
62
  <r>Every feature must trace to a user problem</r>
51
63
  <r>NEVER create stories without acceptance criteria</r>
52
- <r critical="true">BEFORE writing epic/story tasks: MUST Glob+Read coding standards (see before-epic-story)</r>
64
+ <r critical="true">BEFORE writing epic/story: USE SEMANTIC SEARCH (see before-epic-story)</r>
53
65
  <r>Find and use `**/project-context.md` as source of truth if exists</r>
66
+ <r critical="MANDATORY">🔍 SEARCH FIRST: You MUST call search() BEFORE glob/grep when exploring.
67
+ search({ query: "topic", index: "docs" }) → THEN glob if needed</r>
54
68
  </rules>
55
69
 
56
70
  <before-epic-story critical="MANDATORY">
57
71
  <instruction>BEFORE writing ANY epic or story with tasks, you MUST execute:</instruction>
58
- <step n="1">Glob "**/AGENTS.md" OR "**/CLAUDE.md" → Read the file</step>
59
- <step n="2">Glob "**/coding-standards/**/*.md" Read ALL files found</step>
60
- <step n="3">Glob "**/[module]-data-model*.md" Read data model</step>
72
+ <step n="1">search({ query: "coding standards patterns conventions", index: "docs" }) → Read results</step>
73
+ <step n="2">search({ query: "architecture module boundaries", index: "docs" }) Understand structure</step>
74
+ <step n="3">Read CLAUDE.md or AGENTS.md if found</step>
61
75
  <step n="4">Glob "**/src/services/[module]/**/domain/**/*.go" → Read 2-3 existing patterns</step>
62
76
  <step n="5">ONLY THEN proceed to write tasks with Documentation links</step>
63
77
  <warning>Tasks without proper Documentation links to coding standards = REJECTED</warning>
@@ -366,13 +366,12 @@ async function processPendingFiles(projectRoot: string, config: VectorizerConfig
366
366
  try {
367
367
  const wasIndexed = await indexer.indexSingleFile(filePath)
368
368
  if (wasIndexed) {
369
- // Only log in debug mode, successful reindex is silent
370
- debug(`Reindexed: ${path.relative(projectRoot, filePath)} -> ${indexName}`)
369
+ log(`Reindexed: ${path.relative(projectRoot, filePath)} ${indexName}`)
371
370
  } else {
372
- debug(`Skipped (unchanged): ${path.relative(projectRoot, filePath)}`)
371
+ logFile(`Skipped (unchanged): ${path.relative(projectRoot, filePath)}`)
373
372
  }
374
373
  } catch (e) {
375
- debug(`Error: ${(e as Error).message}`)
374
+ log(`Error reindexing ${path.relative(projectRoot, filePath)}: ${(e as Error).message}`)
376
375
  }
377
376
  }
378
377
 
@@ -478,7 +477,7 @@ export const FileIndexerPlugin: Plugin = async ({ directory, client }) => {
478
477
  const props = (event as any).properties || {}
479
478
  const filePath = props.file || props.path || props.filePath
480
479
  if (filePath) {
481
- debug(`${event.type}: ${filePath}`)
480
+ log(`Event: ${event.type} ${filePath}`)
482
481
  queueFileForIndexing(filePath)
483
482
  }
484
483
  }
@@ -63,7 +63,7 @@ Prerequisites: Run 'npx @comfanion/workflow index --index <name>' first.`,
63
63
  const { CodebaseIndexer } = await import(`file://${vectorizerModule}`)
64
64
 
65
65
  let allResults: any[] = []
66
- const limit = args.limit || 5
66
+ const limit = args.limit || 10
67
67
  const indexName = args.index || "code"
68
68
 
69
69
  // Auto-freshen stale files before searching