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.
- package/agents/gm.md +2 -0
- package/copilot-profile.md +1 -1
- package/hooks/prompt-submit-hook.js +1 -1
- package/hooks/session-start-hook.js +1 -1
- package/index.html +1 -1
- package/manifest.yml +1 -1
- package/package.json +1 -1
- package/skills/gm/SKILL.md +84 -54
- package/skills/gm-complete/SKILL.md +52 -40
- package/skills/gm-emit/SKILL.md +52 -39
- package/skills/gm-execute/SKILL.md +66 -46
- package/skills/planning/SKILL.md +48 -46
- package/tools.json +1 -1
- package/skills/code-search/SKILL.md +0 -376
- package/skills/process-management/SKILL.md +0 -83
|
@@ -1,57 +1,70 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: gm-execute
|
|
3
|
-
description: EXECUTE phase.
|
|
3
|
+
description: EXECUTE phase. Resolve all mutables via witnessed execution. Any new unknown triggers immediate snake back to planning — restart chain from PLAN.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# GM EXECUTE — Resolving Every Unknown
|
|
7
7
|
|
|
8
|
-
You are in the **EXECUTE** phase.
|
|
8
|
+
You are in the **EXECUTE** phase. Resolve every named mutable via witnessed execution. Any new unknown = stop, snake to `planning`, restart chain.
|
|
9
9
|
|
|
10
10
|
**GRAPH POSITION**: `PLAN → [EXECUTE] → EMIT → VERIFY → COMPLETE`
|
|
11
|
-
- **Entry
|
|
11
|
+
- **Entry**: .prd exists with all unknowns named. Entered from `planning` or via snake from EMIT/VERIFY.
|
|
12
12
|
|
|
13
13
|
## TRANSITIONS
|
|
14
14
|
|
|
15
|
-
**FORWARD
|
|
16
|
-
- All mutables resolved to KNOWN → invoke `gm-emit` skill
|
|
15
|
+
**FORWARD**: All mutables KNOWN → invoke `gm-emit` skill
|
|
17
16
|
|
|
18
|
-
**
|
|
19
|
-
- From EMIT: pre-emit debugging reveals logic error, hypothesis was wrong → snake back, re-run execution with corrected approach
|
|
20
|
-
- From VERIFY: end-to-end debugging reveals runtime failure not caught in execution → snake back, re-execute with real system state
|
|
21
|
-
- Self-loop: mutables still UNKNOWN after a pass → re-invoke `gm-execute` with broader debug scope. Never add stages.
|
|
17
|
+
**SELF-LOOP**: Mutable still UNKNOWN after one pass → re-run with different angle (max 2 passes then snake)
|
|
22
18
|
|
|
23
|
-
**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
- Browser/UI debugging → invoke `agent-browser` skill
|
|
28
|
-
- Servers/workers/daemons → invoke `process-management` skill
|
|
19
|
+
**BACKWARD**:
|
|
20
|
+
- New unknown discovered → invoke `planning` skill immediately, restart chain
|
|
21
|
+
- From EMIT: logic error → re-enter here, re-resolve mutable
|
|
22
|
+
- From VERIFY: runtime failure → re-enter here, re-resolve with real system state
|
|
29
23
|
|
|
30
24
|
## MUTABLE DISCIPLINE
|
|
31
25
|
|
|
32
|
-
|
|
26
|
+
Each mutable: name | expected | current | resolution method. Execute → witness → assign → compare. Zero variance = resolved. Unresolved after 2 passes = new unknown = snake to `planning`. Never narrate past an unresolved mutable.
|
|
33
27
|
|
|
34
|
-
## EXECUTION
|
|
28
|
+
## CODE EXECUTION
|
|
35
29
|
|
|
36
|
-
|
|
30
|
+
**exec:<lang> is the only way to run code.** Bash tool body: `exec:<lang>\n<code>`
|
|
37
31
|
|
|
38
|
-
|
|
32
|
+
`exec:nodejs` (default) | `exec:bash` | `exec:python` | `exec:typescript` | `exec:go` | `exec:rust` | `exec:c` | `exec:cpp` | `exec:java` | `exec:deno` | `exec:cmd`
|
|
39
33
|
|
|
40
|
-
|
|
34
|
+
Lang auto-detected if omitted. `cwd` sets directory. File I/O via exec:nodejs + require('fs'). Only git in bash directly. `Bash(node/npm/npx/bun)` = violations.
|
|
41
35
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
**Background tasks** (auto-backgrounded when execution exceeds 15s):
|
|
37
|
+
```
|
|
38
|
+
exec:sleep
|
|
39
|
+
<task_id> [seconds]
|
|
40
|
+
```
|
|
41
|
+
```
|
|
42
|
+
exec:status
|
|
43
|
+
<task_id>
|
|
44
|
+
```
|
|
45
|
+
```
|
|
46
|
+
exec:close
|
|
47
|
+
<task_id>
|
|
48
|
+
```
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
**Runner** (PM2-backed — all activity visible in `pm2 list` and `pm2 monit` in user terminal):
|
|
51
|
+
```
|
|
52
|
+
exec:runner
|
|
53
|
+
start|stop|status
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## CODEBASE EXPLORATION
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
exec:codesearch
|
|
60
|
+
<natural language description of what you need>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Alias: `exec:search`. Glob, Grep, Read-for-discovery, Explore, WebSearch = blocked.
|
|
51
64
|
|
|
52
65
|
## IMPORT-BASED DEBUGGING
|
|
53
66
|
|
|
54
|
-
Always import actual codebase modules. Never rewrite logic inline
|
|
67
|
+
Always import actual codebase modules. Never rewrite logic inline.
|
|
55
68
|
|
|
56
69
|
```
|
|
57
70
|
exec:nodejs
|
|
@@ -61,41 +74,48 @@ console.log(await fn(realInput));
|
|
|
61
74
|
|
|
62
75
|
Witnessed import output = resolved mutable. Reimplemented output = UNKNOWN.
|
|
63
76
|
|
|
64
|
-
##
|
|
77
|
+
## EXECUTION DENSITY
|
|
65
78
|
|
|
66
|
-
|
|
79
|
+
Pack every related hypothesis into one run. Each run ≤15s. Witnessed output = ground truth. Narrated assumption = nothing.
|
|
67
80
|
|
|
68
|
-
|
|
81
|
+
Parallel waves: ≤3 `gm:gm` subagents via Task tool — independent items simultaneously, never sequentially.
|
|
69
82
|
|
|
70
|
-
|
|
83
|
+
## CHAIN DECOMPOSITION
|
|
84
|
+
|
|
85
|
+
Break every multi-step operation before running end-to-end:
|
|
86
|
+
1. Number every distinct step
|
|
87
|
+
2. Per step: input shape, output shape, success condition, failure mode
|
|
88
|
+
3. Run each step in isolation — witness — assign mutable — KNOWN before next
|
|
89
|
+
4. Debug adjacent pairs for handoff correctness
|
|
90
|
+
5. Only when all pairs pass: run full chain end-to-end
|
|
71
91
|
|
|
72
|
-
|
|
92
|
+
Step failure revealing new unknown → snake to `planning`.
|
|
73
93
|
|
|
74
|
-
|
|
94
|
+
## BROWSER DEBUGGING
|
|
75
95
|
|
|
76
|
-
|
|
96
|
+
Invoke `agent-browser` skill. Escalation — exhaust each before advancing:
|
|
97
|
+
1. `exec:agent-browser\n<js>` — query DOM/state. Always first.
|
|
98
|
+
2. `agent-browser` skill + `__gm` globals — instrument and capture
|
|
99
|
+
3. navigate/click/type — only when real events required
|
|
100
|
+
4. screenshot — last resort
|
|
77
101
|
|
|
78
|
-
|
|
102
|
+
`__gm` scaffold:
|
|
79
103
|
```js
|
|
80
104
|
window.__gm = { captures: [], log: (...a) => window.__gm.captures.push({t:Date.now(),a}), assert: (l,c) => { window.__gm.captures.push({l,pass:!!c,val:c}); return !!c; }, dump: () => JSON.stringify(window.__gm.captures,null,2) };
|
|
81
105
|
```
|
|
82
106
|
|
|
83
|
-
## DUAL-SIDE DEBUGGING
|
|
84
|
-
|
|
85
|
-
Backend via `exec:nodejs`, frontend via `agent-browser` + `__gm`. Neither substitutes the other. Single-side = UNKNOWN mutable = blocked gate.
|
|
86
|
-
|
|
87
107
|
## GROUND TRUTH
|
|
88
108
|
|
|
89
|
-
Real services, real
|
|
109
|
+
Real services, real data, real timing. Mocks/fakes/stubs = delete immediately. No .test.js/.spec.js. Delete on discovery.
|
|
90
110
|
|
|
91
111
|
## CONSTRAINTS
|
|
92
112
|
|
|
93
|
-
**Never**: `Bash(node/npm/npx/bun
|
|
113
|
+
**Never**: `Bash(node/npm/npx/bun)` | fake data | mock files | Glob/Grep/Explore | sequential independent items | absorb surprises silently
|
|
94
114
|
|
|
95
|
-
**Always**: import real modules |
|
|
115
|
+
**Always**: witness every hypothesis | import real modules | snake to planning on any new unknown | fix immediately on discovery
|
|
96
116
|
|
|
97
117
|
---
|
|
98
118
|
|
|
99
119
|
**→ FORWARD**: All mutables KNOWN → invoke `gm-emit` skill.
|
|
100
|
-
|
|
101
|
-
**↩ SNAKE to PLAN**:
|
|
120
|
+
**↺ SELF-LOOP**: Still UNKNOWN → re-run (max 2 passes).
|
|
121
|
+
**↩ SNAKE to PLAN**: Any new unknown → invoke `planning` skill, restart chain.
|
package/skills/planning/SKILL.md
CHANGED
|
@@ -1,82 +1,84 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: planning
|
|
3
|
-
description:
|
|
3
|
+
description: Mutable discovery and PRD construction. Invoke at session start and any time new unknowns surface during execution. Loop until no new mutables are discovered.
|
|
4
4
|
allowed-tools: Write
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# PRD Construction
|
|
7
|
+
# PRD Construction — Mutable Discovery Loop
|
|
8
8
|
|
|
9
|
-
You are in the **PLAN** phase.
|
|
9
|
+
You are in the **PLAN** phase. Your job is to discover every unknown before execution begins.
|
|
10
10
|
|
|
11
11
|
**GRAPH POSITION**: `[PLAN] → EXECUTE → EMIT → VERIFY → COMPLETE`
|
|
12
|
-
- **
|
|
12
|
+
- **Entry chain**: prompt-submit hook → `gm` skill → `planning` skill (here).
|
|
13
|
+
- **Also entered**: any time a new unknown surfaces in EXECUTE, EMIT, or VERIFY.
|
|
13
14
|
|
|
14
15
|
## TRANSITIONS
|
|
15
16
|
|
|
16
|
-
**FORWARD
|
|
17
|
-
- .prd
|
|
17
|
+
**FORWARD**:
|
|
18
|
+
- No new mutables discovered in latest pass → .prd is complete → invoke `gm-execute` skill
|
|
18
19
|
|
|
19
|
-
**
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
20
|
+
**SELF-LOOP (stay in PLAN)**:
|
|
21
|
+
- Each planning pass may surface new unknowns → add them to .prd → plan again
|
|
22
|
+
- Loop until a full pass produces zero new items
|
|
23
|
+
- Do not advance to EXECUTE while unknowns remain discoverable through reasoning alone
|
|
23
24
|
|
|
24
|
-
**
|
|
25
|
+
**BACKWARD (snakes back here from later phases)**:
|
|
26
|
+
- From EXECUTE: execution reveals an unknown not in .prd → snake here, add it, re-plan
|
|
27
|
+
- From EMIT: scope shifted mid-write → snake here, revise affected items, re-plan
|
|
28
|
+
- From VERIFY: end-to-end reveals requirement was wrong → snake here, rewrite items, re-plan
|
|
25
29
|
|
|
26
|
-
##
|
|
30
|
+
## WHAT PLANNING MEANS
|
|
27
31
|
|
|
28
|
-
|
|
32
|
+
Planning = exhaustive mutable discovery. For every aspect of the task ask:
|
|
33
|
+
- What do I not know? → name it as a mutable
|
|
34
|
+
- What could go wrong? → name it as an edge case item
|
|
35
|
+
- What depends on what? → map blocking/blockedBy
|
|
36
|
+
- What assumptions am I making? → validate each as a mutable
|
|
29
37
|
|
|
30
|
-
|
|
38
|
+
**Iterate until**: a full reasoning pass adds zero new items to .prd.
|
|
31
39
|
|
|
32
|
-
|
|
40
|
+
Categories of unknowns to enumerate: file existence | API shape | data format | dependency versions | runtime behavior | environment differences | error conditions | concurrency | integration points | backwards compatibility | rollback paths | deployment steps | verification criteria
|
|
33
41
|
|
|
34
|
-
|
|
42
|
+
## .PRD SCHEMA
|
|
35
43
|
|
|
36
|
-
|
|
44
|
+
Path: exactly `./.prd` in current working directory. Valid JSON array.
|
|
37
45
|
|
|
38
46
|
```json
|
|
39
47
|
{
|
|
40
48
|
"id": "descriptive-kebab-id",
|
|
41
|
-
"subject": "Imperative verb
|
|
49
|
+
"subject": "Imperative verb phrase — what must be true when done",
|
|
42
50
|
"status": "pending",
|
|
43
|
-
"description": "
|
|
44
|
-
"blocking": ["ids
|
|
45
|
-
"blockedBy": ["ids
|
|
51
|
+
"description": "Precise completion criterion",
|
|
52
|
+
"blocking": ["ids this prevents from starting"],
|
|
53
|
+
"blockedBy": ["ids that must complete first"],
|
|
46
54
|
"effort": "small|medium|large",
|
|
47
|
-
"category": "feature|bug|refactor|
|
|
48
|
-
"acceptance": ["measurable criteria"],
|
|
49
|
-
"edge_cases": ["known
|
|
55
|
+
"category": "feature|bug|refactor|infra",
|
|
56
|
+
"acceptance": ["measurable, binary criteria"],
|
|
57
|
+
"edge_cases": ["known failure modes and boundary conditions"]
|
|
50
58
|
}
|
|
51
59
|
```
|
|
52
60
|
|
|
53
|
-
**
|
|
61
|
+
**Status flow**: `pending` → `in_progress` → `completed` (completed items are removed from file).
|
|
62
|
+
**Effort**: `small` = single execution, under 15min | `medium` = 2-3 rounds, under 45min | `large` = multiple rounds, over 1h.
|
|
63
|
+
**blocking/blockedBy**: always bidirectional. Every dependency must be explicit in both directions.
|
|
54
64
|
|
|
55
|
-
##
|
|
65
|
+
## EXECUTION WAVES
|
|
56
66
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
67
|
+
Independent items (empty `blockedBy`) run in parallel waves of ≤3 subagents.
|
|
68
|
+
- Find all pending items with empty `blockedBy`
|
|
69
|
+
- Launch ≤3 parallel `gm:gm` subagents via Task tool
|
|
70
|
+
- Each subagent handles one item: resolves it, witnesses output, removes from .prd
|
|
71
|
+
- After each wave: check newly unblocked items, launch next wave
|
|
72
|
+
- Never run independent items sequentially. Never launch more than 3 at once.
|
|
63
73
|
|
|
64
|
-
##
|
|
74
|
+
## COMPLETION CRITERION
|
|
65
75
|
|
|
66
|
-
|
|
67
|
-
2. Launch ≤3 parallel subagents (`subagent_type: gm:gm`) per wave.
|
|
68
|
-
3. Each subagent completes one item, verifies via witnessed execution.
|
|
69
|
-
4. On completion: remove item from `.prd`, write updated file.
|
|
70
|
-
5. Check for newly unblocked items. Launch next wave.
|
|
71
|
-
6. Continue until `.prd` is empty.
|
|
76
|
+
.prd is ready when: one full reasoning pass produces zero new items AND all items have explicit acceptance criteria AND all dependencies are mapped.
|
|
72
77
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
## Completion
|
|
76
|
-
|
|
77
|
-
`.prd` must be empty at COMPLETE. Skip this skill if task is trivially single-step (under 5 minutes, no dependencies, no unknowns).
|
|
78
|
+
**Skip planning entirely** if: task is single-step, trivially bounded, zero unknowns, under 5 minutes.
|
|
78
79
|
|
|
79
80
|
---
|
|
80
81
|
|
|
81
|
-
**→ FORWARD**:
|
|
82
|
-
|
|
82
|
+
**→ FORWARD**: No new mutables → invoke `gm-execute` skill.
|
|
83
|
+
**↺ SELF-LOOP**: New items discovered → add to .prd → plan again.
|
|
84
|
+
**↩ SNAKE here**: New unknown surfaces in any later phase → add it, re-plan, re-advance.
|