gm-copilot-cli 2.0.187 → 2.0.189

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.
@@ -1,376 +0,0 @@
1
- ---
2
- name: code-search
3
- description: Semantic code search across the codebase. Returns structured results with file paths, line numbers, and relevance scores. Use for all code exploration, finding implementations, locating files, and answering codebase questions.
4
- category: exploration
5
- allowed-tools: Bash(bun x codebasesearch*)
6
- input-schema:
7
- type: object
8
- required: [prompt]
9
- properties:
10
- prompt:
11
- type: string
12
- minLength: 3
13
- maxLength: 200
14
- description: Natural language search query describing what you're looking for
15
- context:
16
- type: object
17
- description: Optional context about search scope and restrictions
18
- properties:
19
- path:
20
- type: string
21
- description: Restrict search to this directory path (relative or absolute)
22
- file-types:
23
- type: array
24
- items: { type: string }
25
- description: Filter results by file extensions (e.g., ["js", "ts", "py"])
26
- exclude-patterns:
27
- type: array
28
- items: { type: string }
29
- description: Exclude paths matching glob patterns (e.g., ["node_modules", "*.test.js"])
30
- filter:
31
- type: object
32
- description: Output filtering and formatting options
33
- properties:
34
- max-results:
35
- type: integer
36
- minimum: 1
37
- maximum: 500
38
- default: 50
39
- description: Maximum number of results to return
40
- min-score:
41
- type: number
42
- minimum: 0
43
- maximum: 1
44
- default: 0.5
45
- description: Minimum relevance score (0-1) to include in results
46
- sort-by:
47
- type: string
48
- enum: [relevance, path, line-number]
49
- default: relevance
50
- description: Result sort order
51
- timeout:
52
- type: integer
53
- minimum: 1000
54
- maximum: 30000
55
- default: 10000
56
- description: Search timeout in milliseconds (query returns partial results if exceeded)
57
- output-schema:
58
- type: object
59
- required: [status, results, meta]
60
- properties:
61
- status:
62
- type: string
63
- enum: [success, partial, empty, timeout, error]
64
- description: Overall operation status
65
- results:
66
- type: array
67
- description: Array of matching code locations
68
- items:
69
- type: object
70
- required: [file, line, content, score]
71
- properties:
72
- file:
73
- type: string
74
- description: Absolute or relative file path to matched file
75
- line:
76
- type: integer
77
- description: Line number where match occurs (1-indexed)
78
- content:
79
- type: string
80
- description: The matched line or context snippet
81
- score:
82
- type: number
83
- minimum: 0
84
- maximum: 1
85
- description: Relevance score where 1.0 is perfect match
86
- context:
87
- type: object
88
- description: Surrounding context lines (optional)
89
- properties:
90
- before:
91
- type: array
92
- items: { type: string }
93
- description: Lines before the match
94
- after:
95
- type: array
96
- items: { type: string }
97
- description: Lines after the match
98
- metadata:
99
- type: object
100
- description: File and match metadata (optional)
101
- properties:
102
- language:
103
- type: string
104
- description: Programming language detected (js, ts, py, rs, go, etc.)
105
- size:
106
- type: integer
107
- description: File size in bytes
108
- modified:
109
- type: string
110
- format: date-time
111
- description: Last modification timestamp
112
- meta:
113
- type: object
114
- required: [query, count, duration_ms]
115
- description: Query execution metadata
116
- properties:
117
- query:
118
- type: string
119
- description: Normalized query that was executed
120
- count:
121
- type: integer
122
- description: Total matches found (before filtering)
123
- filtered:
124
- type: integer
125
- description: Results returned (after filtering and limiting)
126
- duration_ms:
127
- type: integer
128
- description: Execution time in milliseconds
129
- scanned_files:
130
- type: integer
131
- description: Total files examined during search
132
- timestamp:
133
- type: string
134
- format: date-time
135
- description: When execution completed
136
- errors:
137
- type: array
138
- description: Non-fatal errors that occurred (may appear alongside partial results)
139
- items:
140
- type: object
141
- properties:
142
- code:
143
- type: string
144
- enum: [TIMEOUT, INVALID_PATH, SCHEMA_VIOLATION, EXECUTION_FAILED]
145
- description: Error classification
146
- message:
147
- type: string
148
- description: Human-readable error description
149
- output-format: json
150
- error-handling:
151
- timeout:
152
- behavior: return-partial
153
- description: Returns results collected before timeout with status=partial
154
- invalid-input:
155
- behavior: reject
156
- description: Returns status=error with validation errors in errors array
157
- empty-results:
158
- behavior: return-empty
159
- description: Returns status=empty with count=0, filtered=0, results=[]
160
- execution-error:
161
- behavior: return-error
162
- description: Returns status=error with error details in errors array
163
- ---
164
-
165
- # Semantic Code Search
166
-
167
- Only use bun x codebasesearch for searching code, or execute some custom code if you need more than that, never use other cli tools to search the codebase. Search the codebase using natural language. Do multiple searches when looking for files, starting with fewer words and adding more if you need to refine the search. 102 file types are covered, returns results with file paths and line numbers.
168
-
169
- ## Usage
170
-
171
- ```bash
172
- bun x codebasesearch "your natural language query"
173
- ```
174
-
175
- ## Invocation Examples
176
-
177
- ### Via Skill Tool (Recommended - Structured JSON Input)
178
-
179
- **Basic search**:
180
- ```json
181
- {
182
- "prompt": "where is authentication handled"
183
- }
184
- ```
185
-
186
- **With filtering and limits**:
187
- ```json
188
- {
189
- "prompt": "database connection setup",
190
- "filter": {
191
- "max-results": 20,
192
- "min-score": 0.7,
193
- "sort-by": "path"
194
- }
195
- }
196
- ```
197
-
198
- **Scoped to directory with file type filter**:
199
- ```json
200
- {
201
- "prompt": "error logging middleware",
202
- "context": {
203
- "path": "src/middleware/",
204
- "file-types": ["js", "ts"]
205
- },
206
- "timeout": 5000
207
- }
208
- ```
209
-
210
- **Exclude patterns and narrow results**:
211
- ```json
212
- {
213
- "prompt": "rate limiter implementation",
214
- "context": {
215
- "exclude-patterns": ["*.test.js", "node_modules/*"]
216
- },
217
- "filter": {
218
- "max-results": 10,
219
- "min-score": 0.8
220
- }
221
- }
222
- ```
223
-
224
- ### Legacy CLI Invocation (Still Supported)
225
-
226
- ```bash
227
- bun x codebasesearch "where is authentication handled"
228
- bun x codebasesearch "database connection setup"
229
- bun x codebasesearch "how are errors logged"
230
- bun x codebasesearch "function that parses config files"
231
- bun x codebasesearch "where is the rate limiter"
232
- ```
233
-
234
- ## Output Examples
235
-
236
- ### Success Response (Multiple Results)
237
-
238
- ```json
239
- {
240
- "status": "success",
241
- "results": [
242
- {
243
- "file": "src/auth/handler.js",
244
- "line": 42,
245
- "content": "async function authenticateUser(credentials) {",
246
- "score": 0.95,
247
- "context": {
248
- "before": [
249
- "// Main authentication entry point",
250
- ""
251
- ],
252
- "after": [
253
- " const { username, password } = credentials;",
254
- " const user = await db.users.findOne({ username });"
255
- ]
256
- },
257
- "metadata": {
258
- "language": "javascript",
259
- "size": 2048,
260
- "modified": "2025-03-10T14:23:00Z"
261
- }
262
- },
263
- {
264
- "file": "src/middleware/auth-middleware.js",
265
- "line": 18,
266
- "content": "export const requireAuth = (req, res, next) => {",
267
- "score": 0.78,
268
- "metadata": {
269
- "language": "javascript",
270
- "size": 1024,
271
- "modified": "2025-03-10T14:20:00Z"
272
- }
273
- }
274
- ],
275
- "meta": {
276
- "query": "authentication handled",
277
- "count": 2,
278
- "filtered": 2,
279
- "duration_ms": 245,
280
- "scanned_files": 87,
281
- "timestamp": "2025-03-15T10:30:00Z"
282
- }
283
- }
284
- ```
285
-
286
- ### Empty Results Response
287
-
288
- ```json
289
- {
290
- "status": "empty",
291
- "results": [],
292
- "meta": {
293
- "query": "nonexistent pattern xyz123",
294
- "count": 0,
295
- "filtered": 0,
296
- "duration_ms": 123,
297
- "scanned_files": 87,
298
- "timestamp": "2025-03-15T10:30:00Z"
299
- }
300
- }
301
- ```
302
-
303
- ### Timeout Response (Partial Results)
304
-
305
- ```json
306
- {
307
- "status": "partial",
308
- "results": [
309
- {
310
- "file": "src/a.js",
311
- "line": 5,
312
- "content": "function init() {",
313
- "score": 0.92,
314
- "metadata": { "language": "javascript", "size": 512 }
315
- },
316
- {
317
- "file": "src/b.js",
318
- "line": 12,
319
- "content": "const setup = () => {",
320
- "score": 0.85,
321
- "metadata": { "language": "javascript", "size": 768 }
322
- }
323
- ],
324
- "meta": {
325
- "query": "expensive search pattern",
326
- "count": 1847,
327
- "filtered": 2,
328
- "duration_ms": 10000,
329
- "scanned_files": 45,
330
- "timestamp": "2025-03-15T10:30:00Z"
331
- },
332
- "errors": [
333
- {
334
- "code": "TIMEOUT",
335
- "message": "Search exceeded 10000ms limit. Returning partial results (2 of 1847 matches)."
336
- }
337
- ]
338
- }
339
- ```
340
-
341
- ### Error Response (Invalid Input)
342
-
343
- ```json
344
- {
345
- "status": "error",
346
- "results": [],
347
- "meta": {
348
- "query": null,
349
- "count": 0,
350
- "filtered": 0,
351
- "duration_ms": 50,
352
- "scanned_files": 0,
353
- "timestamp": "2025-03-15T10:30:00Z"
354
- },
355
- "errors": [
356
- {
357
- "code": "INVALID_PATH",
358
- "message": "context.path='/nonexistent' does not exist"
359
- },
360
- {
361
- "code": "SCHEMA_VIOLATION",
362
- "message": "filter.max-results must be between 1 and 500, got 1000"
363
- }
364
- ]
365
- }
366
- ```
367
-
368
- ## Rules
369
-
370
- - Always use this first before reading files — it returns file paths and line numbers
371
- - Natural language queries work best; be descriptive about what you're looking for
372
- - Structured JSON output includes relevance scores and file paths for immediate navigation
373
- - Use returned file paths and line numbers to read full file context via Read tool
374
- - Results are pre-sorted by relevance (highest scores first) unless sort-by specifies otherwise
375
- - Timeout queries return partial results with status=partial — use if time-critical
376
- - Schema validation ensures valid input before execution — invalid args return error with details
@@ -1,83 +0,0 @@
1
- ---
2
- name: process-management
3
- description: PM2 process lifecycle. MANDATORY for all servers, workers, daemons. Invoke from gm-execute when any long-running process is needed. Return to gm-execute when done.
4
- ---
5
-
6
- # Process Management — PM2 Lifecycle
7
-
8
- You are managing long-running processes. Invoked from EXECUTE phase.
9
-
10
- **GRAPH POSITION**: Sub-skill of `gm-execute`. Invoked and returns.
11
- - **Entry**: `gm-execute` encounters server/worker/daemon requirement → invoke `process-management` skill
12
- - **Return**: Lifecycle task complete → return to `gm-execute` to continue EXECUTE phase
13
- - **Snake**: Process fails to start or behaves incorrectly → debug here, then return to `gm-execute` with witnessed status
14
-
15
- ## TRANSITIONS
16
-
17
- **RETURN (normal)**:
18
- - Process started and confirmed running → return to `gm-execute`
19
- - Process stopped/cleaned up → return to `gm-execute`
20
-
21
- **SNAKE (failure)**:
22
- - Process crashes on start → debug logs here, surface error to `gm-execute`, let EXECUTE phase decide whether to snake to PLAN
23
- - Port conflict detected → resolve here, then return to `gm-execute`
24
- - Orphans found → clean up here, then return to `gm-execute`
25
-
26
- ## PRE-CHECK (mandatory before any start)
27
-
28
- ```
29
- exec:nodejs
30
- const { execSync } = require('child_process');
31
- console.log(execSync('npx pm2 list', { encoding: 'utf8' }));
32
- ```
33
-
34
- If process already running with same name → stop and delete first.
35
- If different process using same port → stop it first.
36
- Never start a duplicate. Never stack processes.
37
-
38
- ## START
39
-
40
- ```
41
- exec:nodejs
42
- const { execSync } = require('child_process');
43
- execSync('npx pm2 start <file> --name <name> --watch --no-autorestart', { stdio: 'inherit' });
44
- ```
45
-
46
- - `--watch`: hot reload on file changes
47
- - `--no-autorestart`: prevents infinite crash loops
48
- - Always name every process explicitly
49
-
50
- ## STATUS AND LOGS
51
-
52
- ```
53
- exec:nodejs
54
- const { execSync } = require('child_process');
55
- console.log(execSync('npx pm2 list', { encoding: 'utf8' }));
56
- console.log(execSync('npx pm2 logs <name> --lines 50 --nostream', { encoding: 'utf8' }));
57
- ```
58
-
59
- ## STOP AND CLEANUP
60
-
61
- Always clean up when work is done. Orphaned processes = gate violation in COMPLETE.
62
-
63
- ```
64
- exec:nodejs
65
- const { execSync } = require('child_process');
66
- execSync('npx pm2 stop <name>', { stdio: 'inherit' });
67
- execSync('npx pm2 delete <name>', { stdio: 'inherit' });
68
- ```
69
-
70
- ## ORPHAN DETECTION
71
-
72
- Run `npx pm2 list` — any process not started in the current session = orphan. Delete immediately.
73
-
74
- ## CONSTRAINTS
75
-
76
- **Never**: start without pre-check | direct node/bun/python for servers (use PM2) | leave orphans | skip cleanup before COMPLETE | `Bash(pm2 ...)` — use exec:nodejs with execSync
77
-
78
- **Always**: pre-check before start | name every process | watch enabled | autorestart disabled | delete on session end
79
-
80
- ---
81
-
82
- **→ RETURN**: Lifecycle task complete → return to `gm-execute` skill.
83
- **↩ SNAKE**: Process failure → debug logs, surface to `gm-execute`, let EXECUTE decide next step.