gm-copilot-cli 2.0.185 → 2.0.188

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,84 +1,101 @@
1
1
  ---
2
2
  name: gm-emit
3
- description: EMIT phase gate validation, pre/post-emit testing, code quality enforcement. Invoke when all EXECUTE mutables resolved and ready to write files.
3
+ description: EMIT phase. Pre-emit debug, write files, post-emit verify from disk. Any new unknown triggers immediate snake back to planning — restart chain.
4
4
  ---
5
5
 
6
- # GM EMIT — Gate Validation and File Writing
6
+ # GM EMIT — Writing and Verifying Files
7
7
 
8
- You are in the **EMIT** phase. All mutables were resolved in EXECUTE. Now validate, write, and verify files.
8
+ You are in the **EMIT** phase. Every mutable is KNOWN. Prove the write is correct, write, confirm from disk. Any new unknown = snake to `planning`, restart chain.
9
9
 
10
10
  **GRAPH POSITION**: `PLAN → EXECUTE → [EMIT] → VERIFY → COMPLETE`
11
- - **Session entry chain**: prompt-submit hook `gm` skill `planning` → `gm-execute` `gm-emit` skill (here). The `gm` skill contract is active: state machine, mutable discipline, ground truth only, all transitions invoke named skills.
12
- - **Entry**: All EXECUTE mutables resolved to KNOWN via witnessed execution. .prd items are scoped and proven.
13
- - **Exit**: Files written, post-emit validation passes, all gate conditions true simultaneously → invoke `gm-complete` skill.
14
- - **Rollback**: If post-emit validation fails → fix immediately in this phase, do not advance.
11
+ - **Entry**: All .prd mutables resolved. Entered from `gm-execute` or via snake from VERIFY.
12
+
13
+ ## TRANSITIONS
14
+
15
+ **FORWARD**: All gate conditions true simultaneously → invoke `gm-complete` skill
16
+
17
+ **SELF-LOOP**: Post-emit variance with known cause → fix immediately, re-verify, do not advance until zero variance
18
+
19
+ **BACKWARD**:
20
+ - Pre-emit reveals logic error (known mutable) → invoke `gm-execute` skill, re-resolve, return here
21
+ - Pre-emit reveals new unknown → invoke `planning` skill, restart chain
22
+ - Post-emit variance with unknown cause → invoke `planning` skill, restart chain
23
+ - Scope changed → invoke `planning` skill, restart chain
24
+ - From VERIFY: end-to-end reveals broken file → re-enter here, fix, re-verify, re-advance
15
25
 
16
26
  ## MUTABLE DISCIPLINE
17
27
 
18
- Each gate condition is a mutable that must resolve to `true` before files are written. Pre-emit test results = expected values. Post-emit test results = current values. Zero variance required. Unresolved gate mutable = absolute barrier to VERIFY phase. State-tracking mutables live in conversation only. Never written to files.
28
+ Each gate condition is a mutable. Pre-emit run witnesses expected value. Post-emit run witnesses current value. Zero variance = resolved. Variance with unknown cause = new unknown = snake to `planning`.
19
29
 
20
- ## PRE-EMIT-TEST (before writing any file)
30
+ ## CODE EXECUTION
21
31
 
22
- 1. Import the actual module from disk via `exec:nodejs`, witness current on-disk behavior
23
- 2. Execute proposed logic in isolation — WITHOUT writing to any file
24
- 3. Witness correct output with real inputs. Test failure paths with real error inputs.
25
- 4. For browser code: inject `__gm` globals, run interactions, dump captures, verify
32
+ **exec:<lang> is the only way to run code.** Bash tool body: `exec:<lang>\n<code>`
26
33
 
27
- Always: `exec:nodejs\nconst { fn } = await import('/abs/path')` never rewrite logic inline.
34
+ `exec:nodejs` (default) | `exec:bash` | `exec:python` | `exec:typescript` | `exec:go` | `exec:rust` | `exec:java` | `exec:deno` | `exec:cmd`
28
35
 
29
- ## WRITING FILES
36
+ Only git in bash directly. `Bash(node/npm/npx/bun)` = violations. File writes via exec:nodejs + require('fs').
30
37
 
31
- Use `exec:nodejs` with `require('fs')` for all file operations. Write all files only when every gate mutable is `resolved=true` simultaneously.
38
+ ## PRE-EMIT DEBUGGING (before writing any file)
32
39
 
33
- ## POST-EMIT-VALIDATION (immediately after writing)
40
+ 1. Import actual module from disk via `exec:nodejs` — witness current on-disk behavior
41
+ 2. Run proposed logic in isolation WITHOUT writing — witness output with real inputs
42
+ 3. Debug failure paths with real error inputs — record expected values
34
43
 
35
- 1. Load actual modified file from disk via real import — not in-memory version
36
- 2. Output must match PRE-EMIT-TEST witnessed output exactly
37
- 3. For browser: reload from disk, re-inject `__gm` globals, re-run interactions, compare captures
38
- 4. Any variance = regression, fix immediately before proceeding
44
+ ```
45
+ exec:nodejs
46
+ const { fn } = await import('/abs/path/to/module.js');
47
+ console.log(await fn(realInput));
48
+ ```
39
49
 
40
- ## GATE CONDITIONS (all must be true simultaneously)
50
+ Pre-emit revealing unexpected behavior new unknown → snake to `planning`.
41
51
 
42
- - Executed via `exec:<lang>` or `agent-browser` — witnessed real output
43
- - Every scenario tested: success, failure, edge, corner, error, recovery
44
- - Real witnessed output proves goal achieved
45
- - Hot reloadable: state outside reloadable modules, handlers swap atomically
46
- - Crash-proof: catch at every boundary, recovery hierarchy, every component supervised
47
- - No mocks/fakes/stubs anywhere in codebase
48
- - Files ≤200 lines each
49
- - No duplicate code
50
- - No comments in code
51
- - No hardcoded values
52
- - Docs-code sync: CLAUDE.md reflects actual code behavior
52
+ ## WRITING FILES
53
53
 
54
- ## TOOL REFERENCE
54
+ `exec:nodejs` with `require('fs')`. Write only when every gate mutable is `resolved=true` simultaneously.
55
55
 
56
- **`exec:<lang>`** Bash tool: `exec:<lang>\n<code>`. Languages: `exec:nodejs` (default) | `exec:python` | `exec:bash` | `exec:typescript` | `exec:go` | `exec:rust` | `exec:java` | `exec:deno` | `exec:cmd`. Lang auto-detected. `cwd` sets directory. File I/O via exec:nodejs with require('fs'). Bash: only git directly.
56
+ ## POST-EMIT VERIFICATION (immediately after writing)
57
57
 
58
- **`agent-browser`** — Invoke `agent-browser` skill. Escalation: (1) `exec:agent-browser\n<js>` first (2) skill + `__gm` globals (3) navigate/click → (4) screenshot last resort.
58
+ 1. Re-import the actual file from disk not in-memory version
59
+ 2. Run same inputs as pre-emit — output must match exactly
60
+ 3. For browser: reload from disk, re-inject `__gm` globals, re-run, compare captures
61
+ 4. Known variance → fix and re-verify | Unknown variance → snake to `planning`
59
62
 
60
- **`code-search`** Invoke `code-search` skill. MANDATORY for all exploration. Glob/Grep/Explore blocked.
63
+ ## GATE CONDITIONS (all true simultaneously before advancing)
61
64
 
62
- ## DUAL-SIDE VALIDATION
65
+ - Pre-emit debug passed with real inputs and error inputs
66
+ - Post-emit verification matches pre-emit exactly
67
+ - Hot reloadable: state outside reloadable modules, handlers swap atomically
68
+ - Crash-proof: catch at every boundary, recovery hierarchy
69
+ - No mocks/fakes/stubs anywhere
70
+ - Files ≤200 lines, no duplicate code, no comments, no hardcoded values
71
+ - CLAUDE.md reflects actual behavior
63
72
 
64
- Backend proven with `exec:nodejs`, frontend with `agent-browser` + `__gm`. Neither substitutes. Single-side = UNKNOWN mutable = blocked gate.
73
+ ## CODEBASE EXPLORATION
65
74
 
66
- ## SELF-CHECK (before and after each file)
75
+ ```
76
+ exec:codesearch
77
+ <natural language description>
78
+ ```
67
79
 
68
- 1. File ≤200 lines | 2. No duplicate code | 3. Pre-emit test passed | 4. No mocks | 5. No comments | 6. Docs match code | 7. All spotted issues fixed
80
+ Alias: `exec:search`. Glob, Grep, Explore = blocked.
69
81
 
70
- Score = 100 - (T0_violations×50) - (T1_violations×20) - (T2_violations×5). Target ≥95.
82
+ ## BROWSER DEBUGGING
71
83
 
72
- ## GROUND TRUTH
84
+ Invoke `agent-browser` skill. Escalation: (1) `exec:agent-browser\n<js>` → (2) skill + `__gm` globals → (3) navigate/click → (4) screenshot last resort.
85
+
86
+ ## SELF-CHECK (before and after each file)
73
87
 
74
- Real services only. On discovering mocks/fakes/stubs: delete immediately, implement real paths.
88
+ File ≤200 lines | No duplication | Pre-emit passed | No mocks | No comments | Docs match | All spotted issues fixed
75
89
 
76
- ## CONSTRAINTS (EMIT-PHASE)
90
+ ## CONSTRAINTS
77
91
 
78
- **Never**: skip pre-emit testing | skip post-emit validation | leave docs-code desync | defer spotted issues | advance with failing gate | comments in code | hardcoded values
92
+ **Never**: write before pre-emit passes | advance with post-emit variance | absorb surprises silently | comments | hardcoded values | defer spotted issues
79
93
 
80
- **Always**: pre-emit test before writing | post-emit validate after writing | dual-side for full-stack | self-check every file | reconcile docs | fix immediately
94
+ **Always**: pre-emit debug before writing | post-emit verify from disk | snake to planning on any new unknown | fix immediately
81
95
 
82
96
  ---
83
97
 
84
- **→ NEXT**: When all gate conditions pass → invoke `gm-complete` skill for end-to-end verification and git enforcement.
98
+ **→ FORWARD**: All gates pass → invoke `gm-complete` skill.
99
+ **↺ SELF-LOOP**: Known post-emit variance → fix, re-verify.
100
+ **↩ SNAKE to EXECUTE**: Known logic error → invoke `gm-execute` skill.
101
+ **↩ SNAKE to PLAN**: Any new unknown → invoke `planning` skill, restart chain.
@@ -1,42 +1,68 @@
1
1
  ---
2
2
  name: gm-execute
3
- description: EXECUTE phase methodology. Hypothesis testing, chain decomposition, import-based verification, browser protocols, ground truth enforcement.
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
- # GM EXECUTE — Proving Every Hypothesis
6
+ # GM EXECUTE — Resolving Every Unknown
7
7
 
8
- You are in the **EXECUTE** phase. All mutables must resolve to KNOWN via witnessed execution before transitioning to EMIT.
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
- - **Session entry chain**: prompt-submit hook `gm` skill `planning` skill `gm-execute` skill (here). The `gm` skill contract is active: state machine, mutable discipline, ground truth only, all transitions invoke named skills.
12
- - **Entry**: .prd exists with all unknowns named. This skill owns the EXECUTE phase entirely.
13
- - **Exit**: Zero unresolved mutables → invoke `gm-emit` skill for gate validation and file writing.
14
- - **Sub-skills**: code discovery → invoke `code-search` skill | browser work → invoke `agent-browser` skill | servers/workers/daemons → invoke `process-management` skill
15
- - **Re-entry**: If mutables remain unresolved, re-invoke `gm-execute` skill with broader scope. Never add stages.
11
+ - **Entry**: .prd exists with all unknowns named. Entered from `planning` or via snake from EMIT/VERIFY.
12
+
13
+ ## TRANSITIONS
14
+
15
+ **FORWARD**: All mutables KNOWN invoke `gm-emit` skill
16
+
17
+ **SELF-LOOP**: Mutable still UNKNOWN after one pass → re-run with different angle (max 2 passes then snake)
18
+
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
16
23
 
17
24
  ## MUTABLE DISCIPLINE
18
25
 
19
- Enumerate all unknowns as named mutables. Each mutable: name, expected value, current value, resolution method. Execute → witness → assign → compare zero variance = resolved. Unresolved = absolute barrier. Never narrate. Assign, execute, resolve, transition. State-tracking mutables live in conversation only. Never written to files.
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.
20
27
 
21
- ## HYPOTHESIS TESTING
28
+ ## CODE EXECUTION
22
29
 
23
- Every hypothesis proven by execution before changing files. Know nothing until execution proves it.
30
+ **exec:<lang> is the only way to run code.** Bash tool body: `exec:<lang>\n<code>`
24
31
 
25
- **DENSITY**: Each execution ≤15s, packed with every related hypothesis. Group every related unknown into one run. Never one idea per run.
32
+ `exec:nodejs` (default) | `exec:bash` | `exec:python` | `exec:typescript` | `exec:go` | `exec:rust` | `exec:c` | `exec:cpp` | `exec:java` | `exec:deno` | `exec:cmd`
26
33
 
27
- **PARALLEL WAVES**: Launch ≤3 gm:gm subagents per wave via Task tool. Independent items run simultaneously. Sequential execution = violation. Waves of ≤3; batches >3 split.
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.
28
35
 
29
- ## CHAIN DECOMPOSITION
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
+
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
+ ```
30
62
 
31
- Every multi-step chain broken into individually-verified steps BEFORE any end-to-end run:
32
- 1. List every distinct operation as numbered steps
33
- 2. Per step: define input shape, output shape, success condition, failure condition
34
- 3. Execute step 1 in isolation → witness → assign mutable → proceed only when KNOWN
35
- 4. Execute step 2 with step 1's witnessed output as input. Repeat for every step.
36
- 5. After all steps pass individually, test adjacent pairs for handoff correctness
37
- 6. Only after all pairs pass: run full chain end-to-end
63
+ Alias: `exec:search`. Glob, Grep, Read-for-discovery, Explore, WebSearch = blocked.
38
64
 
39
- ## IMPORT-BASED EXECUTION
65
+ ## IMPORT-BASED DEBUGGING
40
66
 
41
67
  Always import actual codebase modules. Never rewrite logic inline.
42
68
 
@@ -48,44 +74,48 @@ console.log(await fn(realInput));
48
74
 
49
75
  Witnessed import output = resolved mutable. Reimplemented output = UNKNOWN.
50
76
 
51
- ## TOOL REFERENCE
77
+ ## EXECUTION DENSITY
52
78
 
53
- **`exec:<lang>`** Bash tool: `exec:<lang>\n<code>`. Languages: `exec:nodejs` (default) | `exec:python` | `exec:bash` | `exec:typescript` | `exec:go` | `exec:rust` | `exec:c` | `exec:cpp` | `exec:java` | `exec:deno` | `exec:cmd`. Lang auto-detected if omitted. `cwd` field sets working directory. File I/O: exec:nodejs with require('fs'). Bash scope: only git directly. All else via exec interception.
79
+ Pack every related hypothesis into one run. Each run ≤15s. Witnessed output = ground truth. Narrated assumption = nothing.
54
80
 
55
- **`code-search`** Semantic code discovery. Invoke `code-search` skill. MANDATORY for all exploration. Glob/Grep/Read-for-discovery/Explore/WebSearch blocked. Fallback: `bun x codebasesearch <query>`. Try 5+ queries before alternatives.
81
+ Parallel waves: ≤3 `gm:gm` subagents via Task tool independent items simultaneously, never sequentially.
56
82
 
57
- **`agent-browser`** Invoke `agent-browser` skill. Replaces puppeteer/playwright entirely. Escalation order:
58
- 1. `exec:agent-browser\n<js>` — query DOM/state via JS. Always first.
59
- 2. `agent-browser` skill + `__gm` globals + evaluate — instrument, intercept, capture.
60
- 3. navigate/click/type only when state requires real events.
61
- 4. screenshot LAST RESORT. Screenshot before exhausting 1–3 = blocked gate.
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
91
+
92
+ Step failure revealing new unknown → snake to `planning`.
62
93
 
63
- **`process-management`** Invoke `process-management` skill. MANDATORY for all servers/workers/daemons. Pre-check before start. Delete on completion. Orphaned processes = gate violation. Direct node/bun/python for servers = violation.
94
+ ## BROWSER DEBUGGING
64
95
 
65
- ## BROWSER GLOBALS SCAFFOLD
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
66
101
 
67
- Inject before any browser state assertion:
102
+ `__gm` scaffold:
68
103
  ```js
69
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) };
70
105
  ```
71
106
 
72
- ## DUAL-SIDE VALIDATION
73
-
74
- Backend via `exec:nodejs`, frontend via `agent-browser` + `__gm`. Neither substitutes. Single-side = UNKNOWN mutable = blocked gate.
75
-
76
107
  ## GROUND TRUTH
77
108
 
78
- Real services, real API responses, real timing only. On discovering mocks/fakes/stubs: delete immediately, implement real paths. Unit testing forbidden: no .test.js/.spec.js, no mock files. Delete on discovery.
79
-
80
- ## CONSTRAINTS (EXECUTE-PHASE)
109
+ Real services, real data, real timing. Mocks/fakes/stubs = delete immediately. No .test.js/.spec.js. Delete on discovery.
81
110
 
82
- **Tier 0 (ABSOLUTE)**: immortality, no_crash, no_exit, ground_truth_only, real_execution
83
- **Tier 1 (CRITICAL)**: max_file_lines=200, hot_reloadable, checkpoint_state
111
+ ## CONSTRAINTS
84
112
 
85
- **Never**: fake data | write test files | use Glob/Grep/Explore for discovery | direct bash non-git | puppeteer/playwright | screenshot before JS | independent items sequentially
113
+ **Never**: `Bash(node/npm/npx/bun)` | fake data | mock files | Glob/Grep/Explore | sequential independent items | absorb surprises silently
86
114
 
87
- **Always**: import real modules | delete mocks on discovery | witness every hypothesis | fix issues immediately
115
+ **Always**: witness every hypothesis | import real modules | snake to planning on any new unknown | fix immediately on discovery
88
116
 
89
117
  ---
90
118
 
91
- **→ NEXT**: When all mutables resolved → invoke `gm-emit` skill for gate validation and file writing.
119
+ **→ FORWARD**: All mutables KNOWN → invoke `gm-emit` skill.
120
+ **↺ SELF-LOOP**: Still UNKNOWN → re-run (max 2 passes).
121
+ **↩ SNAKE to PLAN**: Any new unknown → invoke `planning` skill, restart chain.
@@ -1,78 +1,84 @@
1
1
  ---
2
2
  name: planning
3
- description: PRD construction for work planning. Compulsory in PLAN phase. Builds .prd file as frozen dependency graph of every possible work item before execution begins. Triggers on any new task, multi-step work, or when gm enters PLAN state.
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. Build the .prd before any execution begins.
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
- - **Session entry chain**: prompt-submit hook → `gm` skill → `planning` skill (here). The `gm` skill contract is active: state machine, mutable discipline, all transitions invoke named skills, no fake data.
13
- - **Entry**: No work begins until .prd exists on disk. This is the first tool-calling phase.
14
- - **Exit**: .prd written to disk → invoke `gm-execute` skill to begin EXECUTE phase.
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.
15
14
 
16
- ## Purpose
15
+ ## TRANSITIONS
17
16
 
18
- The `.prd` is the single source of truth for remaining work. A frozen dependency graph capturing every possible item — steps, substeps, edge cases, corner cases, dependencies, transitive dependencies, unknowns, assumptions, decisions, trade-offs, acceptance criteria, scenarios, failure paths, recovery paths, integration points, state transitions, race conditions, concurrency concerns, error conditions, boundary conditions, configuration variants, environment differences, platform concerns, backwards compatibility, rollback paths, verification steps.
17
+ **FORWARD**:
18
+ - No new mutables discovered in latest pass → .prd is complete → invoke `gm-execute` skill
19
19
 
20
- Longer is better. Missing items means missing work.
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
21
24
 
22
- ## File Rules
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
23
29
 
24
- Path: exactly `./.prd` in current working directory. No variants. Valid JSON.
30
+ ## WHAT PLANNING MEANS
25
31
 
26
- ## Item Schema
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
37
+
38
+ **Iterate until**: a full reasoning pass adds zero new items to .prd.
39
+
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
41
+
42
+ ## .PRD SCHEMA
43
+
44
+ Path: exactly `./.prd` in current working directory. Valid JSON array.
27
45
 
28
46
  ```json
29
47
  {
30
48
  "id": "descriptive-kebab-id",
31
- "subject": "Imperative verb describing outcome",
49
+ "subject": "Imperative verb phrase — what must be true when done",
32
50
  "status": "pending",
33
- "description": "What must be true when this is done",
34
- "blocking": ["ids-this-prevents"],
35
- "blockedBy": ["ids-that-must-finish-first"],
51
+ "description": "Precise completion criterion",
52
+ "blocking": ["ids this prevents from starting"],
53
+ "blockedBy": ["ids that must complete first"],
36
54
  "effort": "small|medium|large",
37
- "category": "feature|bug|refactor|docs|infra",
38
- "acceptance": ["measurable criteria"],
39
- "edge_cases": ["known complications"]
55
+ "category": "feature|bug|refactor|infra",
56
+ "acceptance": ["measurable, binary criteria"],
57
+ "edge_cases": ["known failure modes and boundary conditions"]
40
58
  }
41
59
  ```
42
60
 
43
- **Subject**: imperative form "Fix auth bug", "Add webhook support". Never "Bug: auth".
44
- **Status**: `pending` `in_progress` `completed`. No other values.
45
- **Effort**: `small` (<15min) | `medium` (<45min) | `large` (1h+).
46
- **Blocking/blockedBy**: bidirectional. Every dependency explicit.
47
-
48
- ## Construction
49
-
50
- 1. Enumerate every possible unknown as a work item.
51
- 2. Map every possible dependency (blocking/blockedBy).
52
- 3. Group independent items into parallel waves (max 3 per wave).
53
- 4. Capture every edge case as either a separate item or edge_case field.
54
- 5. Write `./.prd` to disk.
55
- 6. **FREEZE** — no additions after creation. Only mutation: removing finished items.
56
-
57
- ## Execution
58
-
59
- 1. Find all `pending` items with empty `blockedBy`.
60
- 2. Launch ≤3 parallel subagents (`subagent_type: gm:gm`) per wave.
61
- 3. Each subagent completes one item, verifies via witnessed execution.
62
- 4. On completion: remove item from `.prd`, write updated file.
63
- 5. Check for newly unblocked items. Launch next wave.
64
- 6. Continue until `.prd` is empty.
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.
65
64
 
66
- Never execute independent items sequentially. Never launch more than 3 at once.
65
+ ## EXECUTION WAVES
67
66
 
68
- ## Completion
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.
69
73
 
70
- `.prd` must be empty at COMPLETE. The stop hook blocks session end when items remain.
74
+ ## COMPLETION CRITERION
71
75
 
72
- ## Do Not Use
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.
73
77
 
74
- Skip this skill if the 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.
75
79
 
76
80
  ---
77
81
 
78
- **→ NEXT**: .prd written → invoke `gm-execute` skill to begin EXECUTE phase.
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.
package/tools.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.185",
3
+ "version": "2.0.188",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "tools": [
6
6
  {