gm-gc 2.0.1063 → 2.0.1065
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/gemini-extension.json +1 -1
- package/package.json +1 -1
- package/skills/browser/SKILL.md +10 -9
- package/skills/create-lang-plugin/SKILL.md +4 -4
- package/skills/gm/SKILL.md +8 -2
- package/skills/gm-cc/SKILL.md +1 -1
- package/skills/gm-codex/SKILL.md +1 -1
- package/skills/gm-copilot-cli/SKILL.md +1 -1
- package/skills/gm-cursor/SKILL.md +1 -1
- package/skills/gm-execute/SKILL.md +6 -11
- package/skills/gm-gc/SKILL.md +1 -1
- package/skills/gm-jetbrains/SKILL.md +1 -1
- package/skills/gm-kilo/SKILL.md +1 -1
- package/skills/gm-oc/SKILL.md +1 -1
- package/skills/gm-vscode/SKILL.md +1 -1
- package/skills/gm-zed/SKILL.md +1 -1
- package/skills/planning/SKILL.md +41 -5
- package/skills/ssh/SKILL.md +8 -5
package/gemini-extension.json
CHANGED
package/package.json
CHANGED
package/skills/browser/SKILL.md
CHANGED
|
@@ -6,7 +6,7 @@ allowed-tools: Skill
|
|
|
6
6
|
|
|
7
7
|
# Browser automation
|
|
8
8
|
|
|
9
|
-
Two pathways — never mix in the same
|
|
9
|
+
Two pathways — never mix in the same spool dispatch.
|
|
10
10
|
|
|
11
11
|
`exec:browser` runs JS against `page`. Globals available: `page`, `snapshot`, `screenshotWithAccessibilityLabels`, `state`. 15s live window, then backgrounds; output drains automatically on every subsequent plugkit call.
|
|
12
12
|
|
|
@@ -14,8 +14,9 @@ Two pathways — never mix in the same Bash call.
|
|
|
14
14
|
|
|
15
15
|
## Core
|
|
16
16
|
|
|
17
|
+
Write to `.gm/exec-spool/in/browser/<N>.txt`:
|
|
18
|
+
|
|
17
19
|
```
|
|
18
|
-
exec:browser
|
|
19
20
|
await page.goto('https://example.com')
|
|
20
21
|
await snapshot({ page })
|
|
21
22
|
```
|
|
@@ -36,8 +37,9 @@ Session state persists across `browser:` calls. `-e` arg uses single quotes outs
|
|
|
36
37
|
|
|
37
38
|
Never `await setTimeout(N)` with N > 10000. Poll instead.
|
|
38
39
|
|
|
40
|
+
Write to `.gm/exec-spool/in/browser/<N>.txt`:
|
|
41
|
+
|
|
39
42
|
```
|
|
40
|
-
exec:browser
|
|
41
43
|
const start = Date.now()
|
|
42
44
|
while (!state.done && Date.now() - start < 12000) {
|
|
43
45
|
await new Promise(r => setTimeout(r, 500))
|
|
@@ -49,31 +51,30 @@ console.log(state.result)
|
|
|
49
51
|
|
|
50
52
|
## Patterns
|
|
51
53
|
|
|
52
|
-
Data extraction
|
|
54
|
+
Data extraction — write to `.gm/exec-spool/in/browser/<N>.txt`:
|
|
53
55
|
|
|
54
56
|
```
|
|
55
|
-
exec:browser
|
|
56
57
|
const items = await page.$$eval('.title', els => els.map(e => e.textContent))
|
|
57
58
|
console.log(JSON.stringify(items))
|
|
58
59
|
```
|
|
59
60
|
|
|
60
|
-
Console monitoring — set listeners first, then poll
|
|
61
|
+
Console monitoring — set listeners first, then poll. Write to `.gm/exec-spool/in/browser/<N>.txt`:
|
|
61
62
|
|
|
62
63
|
```
|
|
63
|
-
exec:browser
|
|
64
64
|
state.logs = []
|
|
65
65
|
page.on('console', msg => state.logs.push({ type: msg.type(), text: msg.text() }))
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
+
Then write to `.gm/exec-spool/in/browser/<N+1>.txt`:
|
|
69
|
+
|
|
68
70
|
```
|
|
69
|
-
exec:browser
|
|
70
71
|
console.log(JSON.stringify(state.logs.slice(-20)))
|
|
71
72
|
```
|
|
72
73
|
|
|
73
74
|
## Constraints
|
|
74
75
|
|
|
75
76
|
- One playwriter command per `browser:` block
|
|
76
|
-
- `exec:browser` is plain JS, no shell quoting
|
|
77
|
+
- `exec:browser` body is plain JS, no shell quoting
|
|
77
78
|
- Browser tasks drain automatically on every plugkit interaction
|
|
78
79
|
- Sessions reap after 5–15 min idle; cleaned up on session end
|
|
79
80
|
- Never write standalone `.mjs`/`.js` Playwright scripts as a fallback — `exec:browser` errors must be debugged through `exec:browser` retries, not by creating test files on disk
|
|
@@ -98,16 +98,16 @@ context: `=== mytool ===\nexec:mytool\n<expression>\n\nRuns via <how>. Use for <
|
|
|
98
98
|
|
|
99
99
|
## Verify
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
Write to `.gm/exec-spool/in/nodejs/<N>.js`:
|
|
102
|
+
|
|
103
|
+
```js
|
|
103
104
|
const p = require('/abs/path/lang/mytool.js');
|
|
104
105
|
console.log(p.id, typeof p.exec.run, p.exec.match.toString());
|
|
105
106
|
```
|
|
106
107
|
|
|
107
|
-
Then test dispatch
|
|
108
|
+
Then test dispatch by writing to `.gm/exec-spool/in/mytool/<N>.txt`:
|
|
108
109
|
|
|
109
110
|
```
|
|
110
|
-
exec:mytool
|
|
111
111
|
<simple test expression>
|
|
112
112
|
```
|
|
113
113
|
|
package/skills/gm/SKILL.md
CHANGED
|
@@ -17,12 +17,18 @@ The user's request is authorization. When scope is unclear, pick the maximum rea
|
|
|
17
17
|
|
|
18
18
|
**Every issue surfaces this turn**: pre-existing breaks, lint failures, drift, broken deps, stale generated files — all become PRD items and finish before COMPLETE.
|
|
19
19
|
|
|
20
|
-
**LLM provider**: acptoapi (127.0.0.1:4800)
|
|
20
|
+
**LLM provider**: rs-learn uses a 3-tier fallback chain: acptoapi HTTP (127.0.0.1:4800) → ACP subprocess (opencode/kilo-code/codex/gemini-cli/qwen-code) → AGENTS.md content. All errors reported explicitly — never silently absorbed. SWE-bench scores rank model fallback ordering (highest first). Downstream platforms read OPENAI_BASE_URL defaulting to 127.0.0.1:4800. Anthropic SDK only when acptoapi socket unavailable. acptoapi strips internal tools (fs_*, bash, python, ssh, recall, memorize, codesearch, etc.) before forwarding to providers.
|
|
21
21
|
|
|
22
|
-
**rs-learn failure contract**:
|
|
22
|
+
**rs-learn failure contract**: memorize, recall, and codesearch spool dispatch failures must be reported explicitly with error details to the user. Fallback to AGENTS.md for memory preservation when socket/network unavailable. Never silently absorb errors because memory preservation requires explicit fallback. This rule applies across all phases (PLAN through UPDATE-DOCS).
|
|
23
|
+
|
|
24
|
+
**Spool watcher restart**: at session start, check `.gm/exec-spool/.watcher.heartbeat`. If older than 30s, the watcher is dead. Write a nodejs spool file to `.gm/exec-spool/in/nodejs/restart-watcher.js` that kills stale plugkit processes and spawns `plugkit runner --watch .gm/exec-spool/in --out .gm/exec-spool/out` detached. Wait 2s for initialization before dispatching any exec commands.
|
|
23
25
|
|
|
24
26
|
**Spool dispatch chain**: write to `.gm/exec-spool/in/<lang>/<N>.<ext>` or `in/<verb>/<N>.txt`. Watcher executes and streams `out/<N>.out` + `out/<N>.err` + `out/<N>.json` metadata. Languages: nodejs, python, bash, typescript, go, rust, c, cpp, java, deno. Verbs: codesearch, recall, memorize, wait, sleep, status, close, browser, runner, type, kill-port, forget, feedback, learn-status, learn-debug, learn-build, discipline, pause, health.
|
|
25
27
|
|
|
28
|
+
**Data layout**: `.gm/` for ephemeral state (excluded from git), `gm-data/` for persistent DBs (rs-learn.db, code-search/ — tracked in git). Legacy `.gm/rs-learn.db` auto-migrates to `gm-data/rs-learn.db` on first access.
|
|
29
|
+
|
|
30
|
+
**WASM parity**: All CLI verbs available in browser/WASM via thebird host emulation. Python/bash/ssh/powershell map to exec_js; status/wait/sleep/close/kill-port/forget/feedback/learn-status/learn-debug/learn-build/discipline/pause/runner/type/browser all have WASM handlers. rs-search WASM uses fusion search (vector + BM25 + git via RRF scoring).
|
|
31
|
+
|
|
26
32
|
**Session isolation**: SESSION_ID environment variable (or uuid fallback) threads through task dispatch for cleanup scope. rs-exec RPC handlers verify session_id match on all task-scoped operations.
|
|
27
33
|
|
|
28
34
|
**Code does mechanics; meaning routes through textprocessing skill**: summarize, classify, extract intent, rewrite, translate, semantic dedup, rank, label — all via `Agent(subagent_type='gm:textprocessing', ...)`.
|
package/skills/gm-cc/SKILL.md
CHANGED
|
@@ -16,4 +16,4 @@ AI-native software engineering orchestrated via skill chain: PLAN → EXECUTE
|
|
|
16
16
|
|
|
17
17
|
**End-to-end skill chaining (skills-based platforms)**: When gm SKILL.md includes `end-to-end: true`, adapter detects signal and parses stdout for trailing JSON: `{"nextSkill": "...", "context": {...}, "phase": "..."}`. If nextSkill is non-null, invoke `Skill(skill="gm:<nextSkill>")` with context dict, repeat until null. This auto-chains 5 invocations into 1 user invocation.
|
|
18
18
|
|
|
19
|
-
Every task returns complete: taskId, exitCode, durationMs, timedOut, stdout, stderr. Background tasks return immediately with task_id; continue with
|
|
19
|
+
Every task returns complete: taskId, exitCode, durationMs, timedOut, stdout, stderr. Background tasks return immediately with task_id; continue with `in/status/<N>.txt` (tail), `in/watch/<N>.txt` (watch), or `in/close/<N>.txt` (close).
|
package/skills/gm-codex/SKILL.md
CHANGED
|
@@ -16,4 +16,4 @@ AI-native software engineering orchestrated via skill chain: PLAN → EXECUTE
|
|
|
16
16
|
|
|
17
17
|
**End-to-end skill chaining (skills-based platforms)**: When gm SKILL.md includes `end-to-end: true`, adapter detects signal and parses stdout for trailing JSON: `{"nextSkill": "...", "context": {...}, "phase": "..."}`. If nextSkill is non-null, invoke `Skill(skill="gm:<nextSkill>")` with context dict, repeat until null. This auto-chains 5 invocations into 1 user invocation.
|
|
18
18
|
|
|
19
|
-
Every task returns complete: taskId, exitCode, durationMs, timedOut, stdout, stderr. Background tasks return immediately with task_id; continue with
|
|
19
|
+
Every task returns complete: taskId, exitCode, durationMs, timedOut, stdout, stderr. Background tasks return immediately with task_id; continue with `in/status/<N>.txt` (tail), `in/watch/<N>.txt` (watch), or `in/close/<N>.txt` (close).
|
|
@@ -16,4 +16,4 @@ AI-native software engineering orchestrated via skill chain: PLAN → EXECUTE
|
|
|
16
16
|
|
|
17
17
|
**End-to-end skill chaining (skills-based platforms)**: When gm SKILL.md includes `end-to-end: true`, adapter detects signal and parses stdout for trailing JSON: `{"nextSkill": "...", "context": {...}, "phase": "..."}`. If nextSkill is non-null, invoke `Skill(skill="gm:<nextSkill>")` with context dict, repeat until null. This auto-chains 5 invocations into 1 user invocation.
|
|
18
18
|
|
|
19
|
-
Every task returns complete: taskId, exitCode, durationMs, timedOut, stdout, stderr. Background tasks return immediately with task_id; continue with
|
|
19
|
+
Every task returns complete: taskId, exitCode, durationMs, timedOut, stdout, stderr. Background tasks return immediately with task_id; continue with `in/status/<N>.txt` (tail), `in/watch/<N>.txt` (watch), or `in/close/<N>.txt` (close).
|
|
@@ -16,4 +16,4 @@ AI-native software engineering orchestrated via skill chain: PLAN → EXECUTE
|
|
|
16
16
|
|
|
17
17
|
**End-to-end skill chaining (skills-based platforms)**: When gm SKILL.md includes `end-to-end: true`, adapter detects signal and parses stdout for trailing JSON: `{"nextSkill": "...", "context": {...}, "phase": "..."}`. If nextSkill is non-null, invoke `Skill(skill="gm:<nextSkill>")` with context dict, repeat until null. This auto-chains 5 invocations into 1 user invocation.
|
|
18
18
|
|
|
19
|
-
Every task returns complete: taskId, exitCode, durationMs, timedOut, stdout, stderr. Background tasks return immediately with task_id; continue with
|
|
19
|
+
Every task returns complete: taskId, exitCode, durationMs, timedOut, stdout, stderr. Background tasks return immediately with task_id; continue with `in/status/<N>.txt` (tail), `in/watch/<N>.txt` (watch), or `in/close/<N>.txt` (close).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: gm-execute
|
|
3
|
-
description: EXECUTE phase AND the foundational execution contract for every skill. Every
|
|
3
|
+
description: EXECUTE phase AND the foundational execution contract for every skill. Every spool dispatch run, every witnessed check, every code search, in every phase, follows this skill's discipline. 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 — Resolve every unknown by witness
|
|
@@ -50,18 +50,13 @@ Every utility verb dispatches via `in/<verb>/<N>.txt`; the body of the file is t
|
|
|
50
50
|
|
|
51
51
|
## Codebase search
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
Codesearch only. Grep, Glob, Find, Explore, raw grep/rg/find inside Bash are all hook-blocked. Write query to `.gm/exec-spool/in/codesearch/<N>.txt`. Read result from `.gm/exec-spool/out/<N>.out`.
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
exec:codesearch
|
|
57
|
-
<two-word query>
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Start two words, change/add one per pass, minimum four attempts before concluding absent. Known absolute path → `Read`. Known directory → `exec:nodejs` + `fs.readdirSync`.
|
|
55
|
+
Start two words, change/add one per pass, minimum four attempts before concluding absent. Known absolute path → `Read`. Known directory → nodejs spool file + `fs.readdirSync`.
|
|
61
56
|
|
|
62
57
|
## Utility verb failure handling
|
|
63
58
|
|
|
64
|
-
**Utility verb failures must surface**:
|
|
59
|
+
**Utility verb failures must surface**: memorize, recall, codesearch, and other utility verbs may fail (socket unavailable, timeout, network error). Failures do not block witness completion but must be reported to the user with error context. Fallback mechanisms (AGENTS.md for memorize) ensure memory preservation even when rs-learn is temporarily unavailable.
|
|
65
60
|
|
|
66
61
|
## Import-based execution
|
|
67
62
|
|
|
@@ -77,11 +72,11 @@ Differential diagnosis: smallest reproduction → compare actual vs expected →
|
|
|
77
72
|
|
|
78
73
|
## Edits depend on witnesses
|
|
79
74
|
|
|
80
|
-
Hypothesis → run → witness → edit. An edit before a witness is a guess. Scan via
|
|
75
|
+
Hypothesis → run → witness → edit. An edit before a witness is a guess. Scan via codesearch (write to `.gm/exec-spool/in/codesearch/<N>.txt`) before creating or modifying — duplicate concern regresses to `planning`. Code-quality preference: native → library → structure → write.
|
|
81
76
|
|
|
82
77
|
## Parallel subagents
|
|
83
78
|
|
|
84
|
-
Up to 3 `gm:gm` subagents for independent items in one message. Browser escalation:
|
|
79
|
+
Up to 3 `gm:gm` subagents for independent items in one message. Browser escalation: write to `.gm/exec-spool/in/browser/<N>.txt` → `browser` skill → screenshot only as last resort.
|
|
85
80
|
|
|
86
81
|
## CI is automated
|
|
87
82
|
|
package/skills/gm-gc/SKILL.md
CHANGED
|
@@ -16,4 +16,4 @@ AI-native software engineering orchestrated via skill chain: PLAN → EXECUTE
|
|
|
16
16
|
|
|
17
17
|
**End-to-end skill chaining (skills-based platforms)**: When gm SKILL.md includes `end-to-end: true`, adapter detects signal and parses stdout for trailing JSON: `{"nextSkill": "...", "context": {...}, "phase": "..."}`. If nextSkill is non-null, invoke `Skill(skill="gm:<nextSkill>")` with context dict, repeat until null. This auto-chains 5 invocations into 1 user invocation.
|
|
18
18
|
|
|
19
|
-
Every task returns complete: taskId, exitCode, durationMs, timedOut, stdout, stderr. Background tasks return immediately with task_id; continue with
|
|
19
|
+
Every task returns complete: taskId, exitCode, durationMs, timedOut, stdout, stderr. Background tasks return immediately with task_id; continue with `in/status/<N>.txt` (tail), `in/watch/<N>.txt` (watch), or `in/close/<N>.txt` (close).
|
|
@@ -16,4 +16,4 @@ AI-native software engineering orchestrated via skill chain: PLAN → EXECUTE
|
|
|
16
16
|
|
|
17
17
|
**End-to-end skill chaining (skills-based platforms)**: When gm SKILL.md includes `end-to-end: true`, adapter detects signal and parses stdout for trailing JSON: `{"nextSkill": "...", "context": {...}, "phase": "..."}`. If nextSkill is non-null, invoke `Skill(skill="gm:<nextSkill>")` with context dict, repeat until null. This auto-chains 5 invocations into 1 user invocation.
|
|
18
18
|
|
|
19
|
-
Every task returns complete: taskId, exitCode, durationMs, timedOut, stdout, stderr. Background tasks return immediately with task_id; continue with
|
|
19
|
+
Every task returns complete: taskId, exitCode, durationMs, timedOut, stdout, stderr. Background tasks return immediately with task_id; continue with `in/status/<N>.txt` (tail), `in/watch/<N>.txt` (watch), or `in/close/<N>.txt` (close).
|
package/skills/gm-kilo/SKILL.md
CHANGED
|
@@ -16,4 +16,4 @@ AI-native software engineering orchestrated via skill chain: PLAN → EXECUTE
|
|
|
16
16
|
|
|
17
17
|
**End-to-end skill chaining (skills-based platforms)**: When gm SKILL.md includes `end-to-end: true`, adapter detects signal and parses stdout for trailing JSON: `{"nextSkill": "...", "context": {...}, "phase": "..."}`. If nextSkill is non-null, invoke `Skill(skill="gm:<nextSkill>")` with context dict, repeat until null. This auto-chains 5 invocations into 1 user invocation.
|
|
18
18
|
|
|
19
|
-
Every task returns complete: taskId, exitCode, durationMs, timedOut, stdout, stderr. Background tasks return immediately with task_id; continue with
|
|
19
|
+
Every task returns complete: taskId, exitCode, durationMs, timedOut, stdout, stderr. Background tasks return immediately with task_id; continue with `in/status/<N>.txt` (tail), `in/watch/<N>.txt` (watch), or `in/close/<N>.txt` (close).
|
package/skills/gm-oc/SKILL.md
CHANGED
|
@@ -16,4 +16,4 @@ AI-native software engineering orchestrated via skill chain: PLAN → EXECUTE
|
|
|
16
16
|
|
|
17
17
|
**End-to-end skill chaining (skills-based platforms)**: When gm SKILL.md includes `end-to-end: true`, adapter detects signal and parses stdout for trailing JSON: `{"nextSkill": "...", "context": {...}, "phase": "..."}`. If nextSkill is non-null, invoke `Skill(skill="gm:<nextSkill>")` with context dict, repeat until null. This auto-chains 5 invocations into 1 user invocation.
|
|
18
18
|
|
|
19
|
-
Every task returns complete: taskId, exitCode, durationMs, timedOut, stdout, stderr. Background tasks return immediately with task_id; continue with
|
|
19
|
+
Every task returns complete: taskId, exitCode, durationMs, timedOut, stdout, stderr. Background tasks return immediately with task_id; continue with `in/status/<N>.txt` (tail), `in/watch/<N>.txt` (watch), or `in/close/<N>.txt` (close).
|
|
@@ -16,4 +16,4 @@ AI-native software engineering orchestrated via skill chain: PLAN → EXECUTE
|
|
|
16
16
|
|
|
17
17
|
**End-to-end skill chaining (skills-based platforms)**: When gm SKILL.md includes `end-to-end: true`, adapter detects signal and parses stdout for trailing JSON: `{"nextSkill": "...", "context": {...}, "phase": "..."}`. If nextSkill is non-null, invoke `Skill(skill="gm:<nextSkill>")` with context dict, repeat until null. This auto-chains 5 invocations into 1 user invocation.
|
|
18
18
|
|
|
19
|
-
Every task returns complete: taskId, exitCode, durationMs, timedOut, stdout, stderr. Background tasks return immediately with task_id; continue with
|
|
19
|
+
Every task returns complete: taskId, exitCode, durationMs, timedOut, stdout, stderr. Background tasks return immediately with task_id; continue with `in/status/<N>.txt` (tail), `in/watch/<N>.txt` (watch), or `in/close/<N>.txt` (close).
|
package/skills/gm-zed/SKILL.md
CHANGED
|
@@ -16,4 +16,4 @@ AI-native software engineering orchestrated via skill chain: PLAN → EXECUTE
|
|
|
16
16
|
|
|
17
17
|
**End-to-end skill chaining (skills-based platforms)**: When gm SKILL.md includes `end-to-end: true`, adapter detects signal and parses stdout for trailing JSON: `{"nextSkill": "...", "context": {...}, "phase": "..."}`. If nextSkill is non-null, invoke `Skill(skill="gm:<nextSkill>")` with context dict, repeat until null. This auto-chains 5 invocations into 1 user invocation.
|
|
18
18
|
|
|
19
|
-
Every task returns complete: taskId, exitCode, durationMs, timedOut, stdout, stderr. Background tasks return immediately with task_id; continue with
|
|
19
|
+
Every task returns complete: taskId, exitCode, durationMs, timedOut, stdout, stderr. Background tasks return immediately with task_id; continue with `in/status/<N>.txt` (tail), `in/watch/<N>.txt` (watch), or `in/close/<N>.txt` (close).
|
package/skills/planning/SKILL.md
CHANGED
|
@@ -21,11 +21,47 @@ Cross-cutting dispositions (autonomy, fix-on-sight, nothing-fake, browser-witnes
|
|
|
21
21
|
|
|
22
22
|
Cannot stop while `.gm/prd.yml` has items, git is dirty, or commits are unpushed.
|
|
23
23
|
|
|
24
|
+
## Session start: restart spool watcher
|
|
25
|
+
|
|
26
|
+
Before any orient or PRD work, ensure the spool watcher is running. Check `.gm/exec-spool/.watcher.heartbeat` — if older than 30s, the watcher is dead. Restart it:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
# write .gm/exec-spool/in/nodejs/restart-watcher.js
|
|
30
|
+
const { spawn, spawnSync } = require('child_process');
|
|
31
|
+
const fs = require('fs');
|
|
32
|
+
const path = require('path');
|
|
33
|
+
const os = require('os');
|
|
34
|
+
const bin = path.join(os.homedir(), '.claude', 'gm-tools', process.platform === 'win32' ? 'plugkit.exe' : 'plugkit');
|
|
35
|
+
const root = process.cwd();
|
|
36
|
+
const spoolIn = path.join(root, '.gm', 'exec-spool', 'in');
|
|
37
|
+
const spoolOut = path.join(root, '.gm', 'exec-spool', 'out');
|
|
38
|
+
const pidFile = path.join(os.tmpdir(), 'gm-plugkit-spool.pid');
|
|
39
|
+
if (fs.existsSync(pidFile)) {
|
|
40
|
+
const pid = parseInt(fs.readFileSync(pidFile, 'utf8').trim(), 10);
|
|
41
|
+
if (Number.isFinite(pid)) { try { process.kill(pid); } catch (_) {} }
|
|
42
|
+
try { fs.unlinkSync(pidFile); } catch (_) {}
|
|
43
|
+
}
|
|
44
|
+
if (process.platform === 'win32') {
|
|
45
|
+
try { spawnSync('taskkill', ['/F', '/IM', 'plugkit.exe'], { windowsHide: true, timeout: 3000, stdio: 'ignore' }); } catch (_) {}
|
|
46
|
+
} else {
|
|
47
|
+
try { spawnSync('pkill', ['-f', 'plugkit'], { timeout: 3000, stdio: 'ignore' }); } catch (_) {}
|
|
48
|
+
}
|
|
49
|
+
fs.mkdirSync(spoolIn, { recursive: true });
|
|
50
|
+
fs.mkdirSync(spoolOut, { recursive: true });
|
|
51
|
+
const proc = spawn(bin, ['runner', '--watch', spoolIn, '--out', spoolOut], {
|
|
52
|
+
detached: true, stdio: 'ignore', windowsHide: true, cwd: root,
|
|
53
|
+
});
|
|
54
|
+
proc.unref();
|
|
55
|
+
fs.writeFileSync(pidFile, String(proc.pid));
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Wait 2s for watcher to initialize, then proceed with orient.
|
|
59
|
+
|
|
24
60
|
## Orient
|
|
25
61
|
|
|
26
|
-
Open every plan with one parallel pack of
|
|
62
|
+
Open every plan with one parallel pack of recall + codesearch against the request's nouns. Write queries to `.gm/exec-spool/in/recall/<N>.txt` and `.gm/exec-spool/in/codesearch/<N>.txt`. Read results from `.gm/exec-spool/out/<N>.out`. Hits land as `weak_prior`; misses confirm the unknown is fresh. The pack runs in one message.
|
|
27
63
|
|
|
28
|
-
**Auto-recall injection (skills-only platforms)**: derive a 2–6 word query from the request's nouns (subject, verb objects, key domain terms).
|
|
64
|
+
**Auto-recall injection (skills-only platforms)**: derive a 2–6 word query from the request's nouns (subject, verb objects, key domain terms). Write recall query to `.gm/exec-spool/in/recall/<N>.txt` at PLAN start before writing `.gm/prd.yml`. Read result from `.gm/exec-spool/out/<N>.out`. This replaces the prompt-submit hook's auto-recall for platforms without hook infrastructure. Recall hits are injected as context into mutable discovery and PRD item acceptance criteria.
|
|
29
65
|
|
|
30
66
|
## Mutable discovery
|
|
31
67
|
|
|
@@ -35,7 +71,7 @@ Fault surfaces to scan: file existence, API shape, data format, dep versions, ru
|
|
|
35
71
|
|
|
36
72
|
Tag every item with a route family (grounding | reasoning | state | execution | observability | boundary | representation) and cross-reference the 16-failure taxonomy. `governance` skill holds the table.
|
|
37
73
|
|
|
38
|
-
`existingImpl=UNKNOWN` is the default; resolve via
|
|
74
|
+
`existingImpl=UNKNOWN` is the default; resolve via codesearch (write to `.gm/exec-spool/in/codesearch/<N>.txt`) before adding the item. An existing concern routes to consolidation, not addition.
|
|
39
75
|
|
|
40
76
|
Plan exits when zero new unknowns surfaced last pass AND every item has acceptance criteria AND deps are mapped.
|
|
41
77
|
|
|
@@ -46,7 +82,7 @@ Every unknown surfaced during PLAN lands as an entry in `.gm/mutables.yml` the s
|
|
|
46
82
|
```yaml
|
|
47
83
|
- id: kebab-id
|
|
48
84
|
claim: One-line statement of what is assumed
|
|
49
|
-
witness_method:
|
|
85
|
+
witness_method: codesearch <query> | nodejs import | recall <query> | Read <path>
|
|
50
86
|
witness_evidence: ""
|
|
51
87
|
status: unknown
|
|
52
88
|
```
|
|
@@ -107,7 +143,7 @@ The 200 lines are a *budget* for maximum surface coverage, not a target. Subsyst
|
|
|
107
143
|
|
|
108
144
|
Code execution AND utility verbs both write to `.gm/exec-spool/in/<lang-or-verb>/<N>.<ext>`. Languages live under `in/<lang>/` (nodejs, python, bash, typescript, go, rust, c, cpp, java, deno); verbs live under `in/<verb>/` (codesearch, recall, memorize, wait, sleep, status, close, browser, runner, type, kill-port, forget, feedback, learn-status, learn-debug, learn-build, discipline, pause, health). The spool watcher runs the file and streams to `out/<N>.out` (stdout) + `out/<N>.err` (stderr) line-by-line, then writes `out/<N>.json` metadata (exitCode, durationMs, timedOut, startedAt, endedAt) at completion. Both streams return as systemMessage with `--- stdout ---` / `--- stderr ---` separators. `in/` and `out/` are wiped at session start and at real-exit session end. Only `git` (and `gh`) run directly via Bash; never `Bash(node/npm/npx/bun)`, never `Bash(exec:<anything>)`. Spool paths in nodejs files are platform-literal — use `os.tmpdir()` and `path.join`. The spool enforces per-task timeouts; on timeout, partial output is preserved and the watcher emits `[exec timed out after Nms; partial output above]`.
|
|
109
145
|
|
|
110
|
-
|
|
146
|
+
Codesearch only — Grep/Glob/Find/Explore are hook-blocked. Write to `.gm/exec-spool/in/codesearch/<N>.txt`. Start two words, change/add one per pass, minimum four attempts before concluding absent.
|
|
111
147
|
|
|
112
148
|
Pack runs use `Promise.allSettled`, each idea its own try/catch, under 12s per call.
|
|
113
149
|
|
package/skills/ssh/SKILL.md
CHANGED
|
@@ -60,9 +60,12 @@ setsid nohup bash -c 'myprogram > /tmp/out.log 2>&1' &
|
|
|
60
60
|
|
|
61
61
|
## Dependency
|
|
62
62
|
|
|
63
|
-
Requires `ssh2` in `~/.claude/gm-tools`:
|
|
64
|
-
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
Requires `ssh2` in `~/.claude/gm-tools`. Write to `.gm/exec-spool/in/nodejs/<N>.js`:
|
|
64
|
+
|
|
65
|
+
```js
|
|
66
|
+
const { execSync } = require('child_process');
|
|
67
|
+
const path = require('path');
|
|
68
|
+
const os = require('os');
|
|
69
|
+
const gmTools = path.join(os.homedir(), '.claude', 'gm-tools');
|
|
70
|
+
execSync('npm install ssh2', { cwd: gmTools, stdio: 'inherit' });
|
|
68
71
|
```
|