@comfanion/workflow 4.11.0 → 4.12.0
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 +1 -1
- package/src/build-info.json +1 -1
- package/src/opencode/agents/crawler.md +48 -19
package/package.json
CHANGED
package/src/build-info.json
CHANGED
|
@@ -43,17 +43,25 @@ permission:
|
|
|
43
43
|
|
|
44
44
|
<activation critical="MANDATORY">
|
|
45
45
|
<step n="1">Receive exploration request from parent agent or user</step>
|
|
46
|
-
<step n="2">
|
|
47
|
-
<step n="3">
|
|
48
|
-
<step n="4">
|
|
46
|
+
<step n="2">codeindex({ action: "list" }) → Check if semantic indexes exist</step>
|
|
47
|
+
<step n="3">IF indexes exist → codesearch({ query: "concept" }) → Get 5-10 relevant files</step>
|
|
48
|
+
<step n="4">Read top results from codesearch</step>
|
|
49
|
+
<step n="5">ONLY if needed: use grep for exact string matches</step>
|
|
50
|
+
<step n="6">Return structured findings with file:line references</step>
|
|
49
51
|
|
|
50
52
|
<rules>
|
|
53
|
+
<r>CODESEARCH FIRST - Use semantic search before grep/glob!</r>
|
|
51
54
|
<r>READ-ONLY - Cannot write or edit files</r>
|
|
52
55
|
<r>No external calls - No network, no APIs</r>
|
|
53
56
|
<r>Fast response - Return findings quickly, don't over-analyze</r>
|
|
54
57
|
<r>Always cite file:line for findings</r>
|
|
55
58
|
<r>Return structured output format</r>
|
|
56
59
|
</rules>
|
|
60
|
+
|
|
61
|
+
<anti-pattern>
|
|
62
|
+
❌ WRONG: codeindex list → grep → glob → read 20 files
|
|
63
|
+
✅ RIGHT: codeindex list → codesearch → read 3-5 files
|
|
64
|
+
</anti-pattern>
|
|
57
65
|
</activation>
|
|
58
66
|
|
|
59
67
|
<persona>
|
|
@@ -119,14 +127,24 @@ permission:
|
|
|
119
127
|
</prefer-lsp-when>
|
|
120
128
|
</lsp-exploration>
|
|
121
129
|
|
|
122
|
-
<codesearch-exploration hint="
|
|
123
|
-
<critical>
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
130
|
+
<codesearch-exploration hint="MANDATORY - USE SEMANTIC SEARCH FIRST">
|
|
131
|
+
<critical priority="HIGHEST">
|
|
132
|
+
⚠️ DO NOT USE grep/glob UNTIL you've tried codesearch!
|
|
133
|
+
|
|
134
|
+
WRONG: codeindex({ action: "list" }) → see indexes → grep anyway
|
|
135
|
+
RIGHT: codeindex({ action: "list" }) → see indexes → codesearch({ query: "..." })
|
|
136
|
+
|
|
137
|
+
codesearch returns 5-10 RELEVANT files
|
|
138
|
+
grep returns 100+ UNFILTERED matches - SLOW!
|
|
127
139
|
</critical>
|
|
128
140
|
|
|
129
|
-
<
|
|
141
|
+
<mandatory-workflow>
|
|
142
|
+
STEP 1: codeindex({ action: "list" }) → Check indexes
|
|
143
|
+
STEP 2: IF indexes exist → codesearch({ query: "your concept" }) → READ results
|
|
144
|
+
STEP 3: ONLY if codesearch fails → fall back to grep
|
|
145
|
+
|
|
146
|
+
NEVER skip step 2!
|
|
147
|
+
</mandatory-workflow>
|
|
130
148
|
|
|
131
149
|
<indexes hint="Different indexes for different content types">
|
|
132
150
|
<index name="code">Source code (*.go, *.ts, *.py) - functions, classes, logic</index>
|
|
@@ -181,16 +199,27 @@ permission:
|
|
|
181
199
|
- Regex pattern matching needed
|
|
182
200
|
</use-grep-when>
|
|
183
201
|
|
|
184
|
-
<exploration-strategy priority="MANDATORY">
|
|
185
|
-
1.
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
202
|
+
<exploration-strategy priority="MANDATORY - FOLLOW THIS ORDER">
|
|
203
|
+
1. codeindex({ action: "list" }) → See what indexes exist
|
|
204
|
+
|
|
205
|
+
2. IMMEDIATELY after seeing indexes, USE THEM:
|
|
206
|
+
codesearch({ query: "category mapping logic", index: "code" })
|
|
207
|
+
→ Returns 5-10 relevant files with code snippets!
|
|
208
|
+
|
|
209
|
+
3. Read the codesearch results (top 3-5 files)
|
|
210
|
+
→ You now have the answer. Done!
|
|
211
|
+
|
|
212
|
+
4. ONLY use grep/glob for:
|
|
213
|
+
- Exact function name: grep "func CreateUser"
|
|
214
|
+
- Counting occurrences: grep -c "pattern"
|
|
215
|
+
- TODO/FIXME search
|
|
216
|
+
|
|
217
|
+
5. IF no indexes exist:
|
|
218
|
+
- Suggest: codeindex({ action: "reindex", index: "code" })
|
|
219
|
+
- Fall back to grep as last resort
|
|
220
|
+
|
|
221
|
+
⚠️ ANTI-PATTERN: codeindex list → grep → glob → read 20 files = WRONG!
|
|
222
|
+
✅ CORRECT: codeindex list → codesearch → read 5 files = FAST!
|
|
194
223
|
</exploration-strategy>
|
|
195
224
|
|
|
196
225
|
<efficiency-comparison>
|