gm-copilot-cli 2.0.727 → 2.0.1064
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 +1 -3
- package/agents/memorize.md +22 -2
- package/copilot-profile.md +1 -1
- package/hooks/hooks.json +10 -8
- package/hooks/hooks.spec.json +65 -0
- package/index.html +5 -3
- package/manifest.yml +1 -1
- package/package.json +2 -2
- package/skills/browser/SKILL.md +18 -16
- package/skills/code-search/SKILL.md +15 -15
- package/skills/create-lang-plugin/SKILL.md +22 -26
- package/skills/gm/SKILL.md +31 -66
- package/skills/gm-cc/SKILL.md +19 -0
- package/skills/gm-codex/SKILL.md +19 -0
- package/skills/gm-complete/SKILL.md +52 -69
- package/skills/gm-copilot-cli/SKILL.md +19 -0
- package/skills/gm-cursor/SKILL.md +19 -0
- package/skills/gm-emit/SKILL.md +44 -61
- package/skills/gm-execute/SKILL.md +42 -84
- package/skills/gm-gc/SKILL.md +19 -0
- package/skills/gm-jetbrains/SKILL.md +19 -0
- package/skills/gm-kilo/SKILL.md +19 -0
- package/skills/gm-oc/SKILL.md +19 -0
- package/skills/gm-vscode/SKILL.md +19 -0
- package/skills/gm-zed/SKILL.md +19 -0
- package/skills/governance/SKILL.md +24 -23
- package/skills/pages/SKILL.md +42 -92
- package/skills/planning/SKILL.md +83 -80
- package/skills/research/SKILL.md +43 -0
- package/skills/ssh/SKILL.md +15 -9
- package/skills/textprocessing/SKILL.md +40 -0
- package/skills/update-docs/SKILL.md +27 -21
- package/tools.json +1 -1
- package/.github/workflows/publish-npm.yml +0 -44
- package/hooks/post-tool-use-hook.js +0 -34
- package/hooks/pre-tool-use-hook.js +0 -45
- package/hooks/prompt-submit-hook.js +0 -19
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gm-cc
|
|
3
|
+
description: AI-native software engineering via skill-driven orchestration on cc; bootstraps plugkit for task execution and session isolation
|
|
4
|
+
allowed-tools: Skill
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# GM — cc Platform
|
|
8
|
+
|
|
9
|
+
AI-native software engineering orchestrated via skill chain: PLAN → EXECUTE → EMIT → VERIFY → UPDATE-DOCS.
|
|
10
|
+
|
|
11
|
+
**Bootstrap pattern**: `bun x gm-plugkit@latest --daemon` downloads the correct platform binary, verifies SHA256, and starts the spool watcher daemon. Call once at session start; idempotent on subsequent calls. All execution routes through the file-spool: write to `.gm/exec-spool/in/<lang>/<N>.<ext>` or `in/<verb>/<N>.txt`, poll `out/<N>.json` for results.
|
|
12
|
+
|
|
13
|
+
**Session-ID threading (no session-start hook)**: At skill invoke time, generate or detect SESSION_ID (env var `SESSION_ID` or `uuid()`). Pass `sessionId: "<id>"` in every rs-exec RPC body (spawn, tail, watch, etc.) and every spool-written task body. All task-scoped cleanup (deleteTask, getTask, appendOutput, killSessionTasks) requires matching sessionId. Absence is forbidden — hard reject by rs-exec handler.
|
|
14
|
+
|
|
15
|
+
**Spool dispatch surface**: Write to `.gm/exec-spool/in/<lang>/<N>.<ext>` (languages: nodejs, python, bash, typescript, go, rust, c, cpp, java, deno) or `in/<verb>/<N>.txt` (verbs: codesearch, recall, memorize, wait, sleep, status, close, browser, runner, etc.). Watcher executes and streams `out/<N>.out` (stdout) + `out/<N>.err` (stderr) line-by-line, then `out/<N>.json` metadata (exitCode, durationMs, timedOut, startedAt, endedAt) at completion.
|
|
16
|
+
|
|
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
|
+
|
|
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).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gm-codex
|
|
3
|
+
description: AI-native software engineering via skill-driven orchestration on codex; bootstraps plugkit for task execution and session isolation
|
|
4
|
+
allowed-tools: Skill
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# GM — codex Platform
|
|
8
|
+
|
|
9
|
+
AI-native software engineering orchestrated via skill chain: PLAN → EXECUTE → EMIT → VERIFY → UPDATE-DOCS.
|
|
10
|
+
|
|
11
|
+
**Bootstrap pattern**: `bun x gm-plugkit@latest --daemon` downloads the correct platform binary, verifies SHA256, and starts the spool watcher daemon. Call once at session start; idempotent on subsequent calls. All execution routes through the file-spool: write to `.gm/exec-spool/in/<lang>/<N>.<ext>` or `in/<verb>/<N>.txt`, poll `out/<N>.json` for results.
|
|
12
|
+
|
|
13
|
+
**Session-ID threading (no session-start hook)**: At skill invoke time, generate or detect SESSION_ID (env var `SESSION_ID` or `uuid()`). Pass `sessionId: "<id>"` in every rs-exec RPC body (spawn, tail, watch, etc.) and every spool-written task body. All task-scoped cleanup (deleteTask, getTask, appendOutput, killSessionTasks) requires matching sessionId. Absence is forbidden — hard reject by rs-exec handler.
|
|
14
|
+
|
|
15
|
+
**Spool dispatch surface**: Write to `.gm/exec-spool/in/<lang>/<N>.<ext>` (languages: nodejs, python, bash, typescript, go, rust, c, cpp, java, deno) or `in/<verb>/<N>.txt` (verbs: codesearch, recall, memorize, wait, sleep, status, close, browser, runner, etc.). Watcher executes and streams `out/<N>.out` (stdout) + `out/<N>.err` (stderr) line-by-line, then `out/<N>.json` metadata (exitCode, durationMs, timedOut, startedAt, endedAt) at completion.
|
|
16
|
+
|
|
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
|
+
|
|
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).
|
|
@@ -3,121 +3,104 @@ name: gm-complete
|
|
|
3
3
|
description: VERIFY and COMPLETE phase. End-to-end system verification and git enforcement. Any new unknown triggers immediate snake back to planning — restart chain.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# GM COMPLETE — Verify
|
|
6
|
+
# GM COMPLETE — Verify, then close
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
Entry: all EMIT gates passed. From `gm-emit`.
|
|
8
|
+
Entry: EMIT gates clear, from `gm-emit`. Exit: `.prd` deleted + test.js green + pushed + CI green → `update-docs`.
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
Cross-cutting dispositions live in `gm` SKILL.md.
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
**EXIT → COMPLETE**: .prd deleted + test.js passes + pushed + CI green → invoke `update-docs`.
|
|
15
|
-
**REGRESS → EMIT**: broken file output.
|
|
16
|
-
**REGRESS → EXECUTE**: logic wrong.
|
|
17
|
-
**REGRESS → PLAN**: new unknown or wrong requirements.
|
|
12
|
+
## Transitions
|
|
18
13
|
|
|
19
|
-
|
|
14
|
+
- `.prd` items remain → `gm-execute`
|
|
15
|
+
- `.prd` empty AND test.js green AND pushed AND CI green → `update-docs`
|
|
16
|
+
- Broken file output → `gm-emit`
|
|
17
|
+
- Wrong logic → `gm-execute`
|
|
18
|
+
- New unknown or wrong requirements → `planning`
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
Failure triage: broken output to EMIT, wrong logic to EXECUTE, new unknown to PLAN. Never patch around surprises.
|
|
21
|
+
|
|
22
|
+
## Mutables that must resolve before COMPLETE
|
|
22
23
|
|
|
23
24
|
- `witnessed_e2e` — real end-to-end run with witnessed output
|
|
24
|
-
- `browser_validated` —
|
|
25
|
+
- `browser_validated` — for any change touching client / UI / browser-facing code, see gate below. test.js + node-side imports DO NOT satisfy this gate.
|
|
25
26
|
- `git_clean` — `git status --porcelain` returns empty
|
|
26
27
|
- `git_pushed` — `git log origin/main..HEAD --oneline` returns empty
|
|
27
|
-
- `ci_passed` —
|
|
28
|
-
- `
|
|
29
|
-
- `
|
|
30
|
-
- `
|
|
28
|
+
- `ci_passed` — every GitHub Actions run reaches `conclusion: success`
|
|
29
|
+
- `mutables_resolved` — `.gm/mutables.yml` deleted OR every entry `status: witnessed`. Stop hook hard-blocks turn-stop while any entry is `status: unknown`.
|
|
30
|
+
- `prd_empty` — `.gm/prd.yml` deleted AFTER residual scan: enumerate every in-spirit reachable residual surfaced this session; any hit re-enters `planning`, appends PRD items, executes. Empty PRD is necessary, not sufficient — done = empty PRD AND zero reachable in-spirit residuals. Out-of-spirit-or-unreachable residuals are named in the response and skipped; everything else is this turn's work.
|
|
31
|
+
- `stress_suite_clear` — change walked through M1–D1 (governance), none flunked
|
|
32
|
+
- `hidden_decision_posture` — open → down_weighted → closed only when CI is green AND stress suite is clear
|
|
31
33
|
|
|
32
|
-
##
|
|
34
|
+
## End-to-end verification
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
Real system, real data, witness actual output. Doc updates, "saying done", and screenshots alone are not verification. Write the e2e probe to the spool (`.gm/exec-spool/in/nodejs/<N>.js`):
|
|
35
37
|
|
|
36
38
|
```
|
|
37
|
-
exec:nodejs
|
|
38
39
|
const { fn } = await import('/abs/path/to/module.js');
|
|
39
40
|
console.log(await fn(realInput));
|
|
40
41
|
```
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
After every success, enumerate what remains — never stop at first green.
|
|
44
|
+
|
|
45
|
+
## Browser validation gate
|
|
46
|
+
|
|
47
|
+
Required when this session changed any code that runs in a browser: anything under `client/`, UI components, shaders, page-loaded JS, served HTML, gh-pages assets, dev-server endpoints, or any module imported into the page bundle.
|
|
43
48
|
|
|
44
|
-
|
|
49
|
+
Trigger detection (any one): `git diff --name-only origin/main..HEAD` includes paths under `client/`, `apps/*/index.js` with client export, `docs/`, `*.html`, shader files, or any file imported by a browser entry; new/changed export consumed by `window.*` or rendered in DOM/canvas/WebGL; visual, layout, animation, input, network-on-page, or shader behavior altered.
|
|
45
50
|
|
|
46
|
-
|
|
51
|
+
Protocol: boot the real server (or open the static page) on a known URL — witness HTTP 200. `exec:browser` → `page.goto(url)` → wait for app init by polling for the global the change affects (`window.__app.<system>`). Probe via `page.evaluate(() => …)` asserting the specific invariant the change was supposed to establish — instance counts, scene meshes, DOM nodes, render stats, network frames. Capture witnessed numbers in the response — "looks fine" is not a witness. Failures route to `gm-execute` (logic) or `gm-emit` (output) — never paper over.
|
|
47
52
|
|
|
48
|
-
|
|
49
|
-
- `git diff --name-only origin/main..HEAD` includes paths under `client/`, `apps/*/index.js` with client export, `docs/`, `*.html`, shader files, or any file imported by a browser entry.
|
|
50
|
-
- New/changed export consumed by `window.*` or rendered in DOM/canvas/WebGL.
|
|
51
|
-
- Visual, layout, animation, input, network-on-page, or shader behavior altered.
|
|
53
|
+
Long-running probes split into navigate-call → `exec:wait N` → probe-call to stay under the per-call budget. Do not stack multi-second `setTimeout` inside one `exec:browser` invocation.
|
|
52
54
|
|
|
53
|
-
|
|
54
|
-
1. Boot the real server (or open the static page) on a known URL — witness HTTP 200.
|
|
55
|
-
2. `exec:browser` → `page.goto(url)` → wait for app init (poll for the global the change affects, e.g. `window.__app.<system>`).
|
|
56
|
-
3. Probe via `page.evaluate(() => …)` — assert the specific invariant the change was supposed to establish (instance counts, scene meshes, DOM nodes, render stats, network frames, etc.).
|
|
57
|
-
4. Capture the witnessed numbers in the response. "Looks fine" is not a witness.
|
|
58
|
-
5. Failures → regress to `gm-execute` (logic) or `gm-emit` (output) — never paper over.
|
|
55
|
+
Exempt only when: change is server-only with zero browser-facing surface, OR the repository has no browser surface at all (pure CLI / library). Exemption requires explicit tag in the response: `BROWSER EXEMPT: <reason — must reference diff paths showing zero browser-facing surface>`. Default posture is NOT exempt — burden is on the agent to prove exemption with diff evidence.
|
|
59
56
|
|
|
60
|
-
|
|
57
|
+
Pre-flight: run `git diff --name-only origin/main..HEAD` directly via Bash, then dispatch a nodejs spool file that reads the diff list and filters lines matching `client/|docs/|\.html$|\.glsl$|\.frag$|\.vert$`. Any hit AND no `exec:browser` block in this session → mandatory regression to `gm-execute`.
|
|
61
58
|
|
|
62
|
-
|
|
59
|
+
## Integration test gate
|
|
63
60
|
|
|
64
|
-
|
|
61
|
+
Write to `.gm/exec-spool/in/nodejs/<N>.js`:
|
|
65
62
|
|
|
66
63
|
```
|
|
67
|
-
exec:nodejs
|
|
68
64
|
const { execSync } = require('child_process');
|
|
69
65
|
try { execSync('node test.js', { stdio: 'inherit', timeout: 30000 }); console.log('PASS'); }
|
|
70
66
|
catch (e) { console.error('FAIL'); process.exit(1); }
|
|
71
67
|
```
|
|
72
68
|
|
|
73
|
-
Failure →
|
|
69
|
+
Failure → `gm-execute`. No test.js in a repo with testable surface → `gm-execute` to create it.
|
|
74
70
|
|
|
75
|
-
##
|
|
71
|
+
## Git enforcement
|
|
72
|
+
|
|
73
|
+
Run directly via Bash:
|
|
76
74
|
|
|
77
75
|
```
|
|
78
|
-
exec:bash
|
|
79
76
|
git status --porcelain
|
|
80
77
|
git log origin/main..HEAD --oneline
|
|
81
78
|
```
|
|
82
79
|
|
|
83
|
-
Both must return empty. Local commit without push
|
|
80
|
+
Both must return empty. Local commit without push is not complete.
|
|
84
81
|
|
|
85
|
-
## CI
|
|
82
|
+
## CI is automated
|
|
86
83
|
|
|
87
|
-
Stop hook watches
|
|
88
|
-
- All-green → Stop approves with CI summary in next turn context
|
|
89
|
-
- Failure → Stop blocks with run names+IDs → investigate with `gh run view <id> --log-failed`, fix, push, hook re-watches
|
|
90
|
-
- Deadline 180s (override `GM_CI_WATCH_SECS`) → slow jobs get "still in progress" approve
|
|
84
|
+
The Stop hook watches Actions for the pushed HEAD. Do not call `gh run list` manually. All-green → Stop approves with CI summary in next-turn context. Failure → Stop blocks with run names + IDs; investigate via `gh run view <id> --log-failed`, fix, push, hook re-watches. Deadline 180s (override `GM_CI_WATCH_SECS`); slow jobs get a "still in progress" approve.
|
|
91
85
|
|
|
92
|
-
##
|
|
86
|
+
## Hygiene sweep
|
|
93
87
|
|
|
94
|
-
Before declaring complete:
|
|
95
88
|
1. Files >200 lines → split
|
|
96
89
|
2. Comments in code → remove
|
|
97
|
-
3. Scattered test files (
|
|
98
|
-
4. Mock/stub/simulation files → delete
|
|
99
|
-
5. Unnecessary doc files (not CHANGELOG
|
|
100
|
-
6. Duplicate concern →
|
|
90
|
+
3. Scattered test files (`.test.js`, `.spec.js`, `__tests__/`, `fixtures/`, `mocks/`) → delete, consolidate into root `test.js`
|
|
91
|
+
4. Mock / stub / simulation files → delete
|
|
92
|
+
5. Unnecessary doc files (not CHANGELOG, CLAUDE, README, TODO.md) → delete
|
|
93
|
+
6. Duplicate concern → regress to `planning` with restructuring instructions
|
|
101
94
|
7. Hardcoded values → derive from ground truth
|
|
102
|
-
8. Fallback/demo modes → remove, fail loud
|
|
103
|
-
9. TODO.md → empty
|
|
104
|
-
10. CHANGELOG.md →
|
|
95
|
+
8. Fallback / demo modes → remove, fail loud
|
|
96
|
+
9. TODO.md → empty or deleted
|
|
97
|
+
10. CHANGELOG.md → entries for this session
|
|
105
98
|
11. Observability gaps → server subsystems expose `/debug/<subsystem>`; client modules register in `window.__debug`
|
|
106
|
-
12. Memorize → every fact from verification handed off via background Agent(memorize) at moment of resolution
|
|
107
|
-
13. Deploy/publish → if deployable, deploy; if npm package, publish
|
|
99
|
+
12. Memorize → every fact from verification handed off via background `Agent(memorize)` at moment of resolution
|
|
100
|
+
13. Deploy / publish → if deployable, deploy; if npm package, publish
|
|
108
101
|
14. GitHub Pages → check `.github/workflows/pages.yml` + `docs/index.html` exist; invoke `pages` skill if absent
|
|
109
|
-
15. Governance stress-suite → walk change through M1,F1,C1,H1,S1,B1,A1,D1; any flunk
|
|
110
|
-
|
|
111
|
-
## MEMORIZE
|
|
112
|
-
|
|
113
|
-
```
|
|
114
|
-
Agent(subagent_type='gm:memorize', model='haiku', run_in_background=true, prompt='## CONTEXT TO MEMORIZE\n<fact>')
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
One per fact, parallel, same turn resolved. End-of-turn self-check mandatory.
|
|
118
|
-
|
|
119
|
-
## COMPLETION DEFINITION
|
|
102
|
+
15. Governance stress-suite → walk change through M1, F1, C1, H1, S1, B1, A1, D1; any flunk regresses to the owning phase
|
|
120
103
|
|
|
121
|
-
|
|
104
|
+
## Completion
|
|
122
105
|
|
|
123
|
-
|
|
106
|
+
All true at once: witnessed e2e | browser_validated when client work touched | failure paths exercised | test.js passes | `.prd` deleted | git clean and pushed | CI green | hygiene sweep clean | TODO.md gone | CHANGELOG.md updated.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gm-copilot-cli
|
|
3
|
+
description: AI-native software engineering via skill-driven orchestration on copilot-cli; bootstraps plugkit for task execution and session isolation
|
|
4
|
+
allowed-tools: Skill
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# GM — copilot-cli Platform
|
|
8
|
+
|
|
9
|
+
AI-native software engineering orchestrated via skill chain: PLAN → EXECUTE → EMIT → VERIFY → UPDATE-DOCS.
|
|
10
|
+
|
|
11
|
+
**Bootstrap pattern**: `bun x gm-plugkit@latest --daemon` downloads the correct platform binary, verifies SHA256, and starts the spool watcher daemon. Call once at session start; idempotent on subsequent calls. All execution routes through the file-spool: write to `.gm/exec-spool/in/<lang>/<N>.<ext>` or `in/<verb>/<N>.txt`, poll `out/<N>.json` for results.
|
|
12
|
+
|
|
13
|
+
**Session-ID threading (no session-start hook)**: At skill invoke time, generate or detect SESSION_ID (env var `SESSION_ID` or `uuid()`). Pass `sessionId: "<id>"` in every rs-exec RPC body (spawn, tail, watch, etc.) and every spool-written task body. All task-scoped cleanup (deleteTask, getTask, appendOutput, killSessionTasks) requires matching sessionId. Absence is forbidden — hard reject by rs-exec handler.
|
|
14
|
+
|
|
15
|
+
**Spool dispatch surface**: Write to `.gm/exec-spool/in/<lang>/<N>.<ext>` (languages: nodejs, python, bash, typescript, go, rust, c, cpp, java, deno) or `in/<verb>/<N>.txt` (verbs: codesearch, recall, memorize, wait, sleep, status, close, browser, runner, etc.). Watcher executes and streams `out/<N>.out` (stdout) + `out/<N>.err` (stderr) line-by-line, then `out/<N>.json` metadata (exitCode, durationMs, timedOut, startedAt, endedAt) at completion.
|
|
16
|
+
|
|
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
|
+
|
|
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).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gm-cursor
|
|
3
|
+
description: AI-native software engineering via skill-driven orchestration on cursor; bootstraps plugkit for task execution and session isolation
|
|
4
|
+
allowed-tools: Skill
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# GM — cursor Platform
|
|
8
|
+
|
|
9
|
+
AI-native software engineering orchestrated via skill chain: PLAN → EXECUTE → EMIT → VERIFY → UPDATE-DOCS.
|
|
10
|
+
|
|
11
|
+
**Bootstrap pattern**: `bun x gm-plugkit@latest --daemon` downloads the correct platform binary, verifies SHA256, and starts the spool watcher daemon. Call once at session start; idempotent on subsequent calls. All execution routes through the file-spool: write to `.gm/exec-spool/in/<lang>/<N>.<ext>` or `in/<verb>/<N>.txt`, poll `out/<N>.json` for results.
|
|
12
|
+
|
|
13
|
+
**Session-ID threading (no session-start hook)**: At skill invoke time, generate or detect SESSION_ID (env var `SESSION_ID` or `uuid()`). Pass `sessionId: "<id>"` in every rs-exec RPC body (spawn, tail, watch, etc.) and every spool-written task body. All task-scoped cleanup (deleteTask, getTask, appendOutput, killSessionTasks) requires matching sessionId. Absence is forbidden — hard reject by rs-exec handler.
|
|
14
|
+
|
|
15
|
+
**Spool dispatch surface**: Write to `.gm/exec-spool/in/<lang>/<N>.<ext>` (languages: nodejs, python, bash, typescript, go, rust, c, cpp, java, deno) or `in/<verb>/<N>.txt` (verbs: codesearch, recall, memorize, wait, sleep, status, close, browser, runner, etc.). Watcher executes and streams `out/<N>.out` (stdout) + `out/<N>.err` (stderr) line-by-line, then `out/<N>.json` metadata (exitCode, durationMs, timedOut, startedAt, endedAt) at completion.
|
|
16
|
+
|
|
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
|
+
|
|
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-emit/SKILL.md
CHANGED
|
@@ -3,85 +3,68 @@ name: gm-emit
|
|
|
3
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 — Write and
|
|
6
|
+
# GM EMIT — Write and verify from disk
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
Entry: all mutables KNOWN. From `gm-execute` or re-entered from VERIFY.
|
|
8
|
+
Entry: every mutable KNOWN, from `gm-execute` or re-entered from VERIFY. Exit: gates clear → `gm-complete`.
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
Cross-cutting dispositions live in `gm` SKILL.md.
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
**SELF-LOOP**: post-emit variance with known cause → fix, re-verify, stay in EMIT.
|
|
15
|
-
**REGRESS → EXECUTE**: pre-emit reveals known logic error.
|
|
16
|
-
**REGRESS → PLAN**: pre-emit reveals new unknown | post-emit variance with unknown cause | scope changed.
|
|
12
|
+
## Transitions
|
|
17
13
|
|
|
18
|
-
|
|
14
|
+
- All gates clear → `gm-complete`
|
|
15
|
+
- Post-emit variance with known cause → fix in-band, re-verify, stay in EMIT
|
|
16
|
+
- Pre-emit reveals known logic error → `gm-execute`
|
|
17
|
+
- Pre-emit reveals new unknown OR post-emit variance with unknown cause OR scope changed → `planning`
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
1. **Earned specificity** — traces to `authorization=witnessed`, not inflated from weak prior?
|
|
22
|
-
2. **Repair legality** — local patch dressed as structural repair? Downgrade scope or snake to PLAN.
|
|
23
|
-
3. **Lawful downgrade** — can a weaker, true statement replace it? PREFER the downgrade.
|
|
24
|
-
4. **Alternative-route suppression** — live competing route being silenced? Preserve it.
|
|
25
|
-
5. **Strongest objection** — if a reviewer pushed back on this change, what would the sharpest argument be? Articulate it. Cannot articulate = have not understood the alternatives = regress to `gm-execute`.
|
|
19
|
+
## Legitimacy gate (before pre-emit run)
|
|
26
20
|
|
|
27
|
-
|
|
21
|
+
For every claim landing in a file, answer five questions:
|
|
28
22
|
|
|
29
|
-
|
|
23
|
+
1. Earned specificity — does it trace to `authorization=witnessed`, or is it inflated from a weak prior?
|
|
24
|
+
2. Repair legality — is a local patch dressed as structural repair? Downgrade scope or regress to PLAN.
|
|
25
|
+
3. Lawful downgrade — can a weaker, true statement replace it? Prefer the downgrade.
|
|
26
|
+
4. Alternative-route suppression — is a live competing route being silenced? Preserve it.
|
|
27
|
+
5. Strongest objection — what would the sharpest reviewer pushback be? Articulate it. Cannot articulate = have not understood the alternatives → `gm-execute`.
|
|
28
|
+
|
|
29
|
+
Any failure regresses to `gm-execute` to witness what was missing, or `planning` if the gap is structural.
|
|
30
|
+
|
|
31
|
+
## Pre-emit run
|
|
32
|
+
|
|
33
|
+
Mandatory before writing any file. Write the probe to the spool (`.gm/exec-spool/in/nodejs/<N>.js`):
|
|
30
34
|
|
|
31
35
|
```
|
|
32
|
-
exec:nodejs
|
|
33
36
|
const { fn } = await import('/abs/path/to/module.js');
|
|
34
37
|
console.log(await fn(realInput));
|
|
35
38
|
```
|
|
36
39
|
|
|
37
|
-
|
|
38
|
-
2. Run proposed logic in isolation WITHOUT writing — witness with real inputs
|
|
39
|
-
3. Probe failure paths with real error inputs
|
|
40
|
-
4. Compare: matches expected → write. Unexpected → new unknown → `planning`.
|
|
41
|
-
|
|
42
|
-
## WRITING FILES
|
|
40
|
+
Import the actual module from disk to witness current behavior as the baseline. Run the proposed logic in isolation without writing — witness with real inputs and with real error inputs. Match expected → write. Unexpected → new unknown → `planning`.
|
|
43
41
|
|
|
44
|
-
|
|
42
|
+
## Writing
|
|
45
43
|
|
|
46
|
-
|
|
44
|
+
Use the Write tool, or a nodejs spool file with `require('fs')`. Write only when every gate mutable resolves simultaneously.
|
|
47
45
|
|
|
48
|
-
|
|
49
|
-
2. Run identical inputs as pre-emit — must match pre-emit baseline exactly
|
|
50
|
-
3. Known variance → fix immediately, re-verify (EMIT self-loop)
|
|
51
|
-
4. Unknown variance → new unknown → invoke `planning`
|
|
52
|
-
|
|
53
|
-
## GATE CONDITIONS (all true simultaneously)
|
|
54
|
-
|
|
55
|
-
- Legitimacy gate passed; none of five refused collapses
|
|
56
|
-
- Pre-emit passed with real inputs + error inputs
|
|
57
|
-
- Post-emit matches pre-emit exactly
|
|
58
|
-
- Hot reloadable; errors throw with context (no fallbacks, `|| default`, `catch { return null }`)
|
|
59
|
-
- No mocks/fakes/stubs/scattered test files (delete on discovery)
|
|
60
|
-
- Behavior change in this emit = a corresponding assertion in test.js (a change no test would catch is a change you cannot prove)
|
|
61
|
-
- If this emit changes any browser-facing code (client/, served HTML/JS, shaders, page-bundle imports, gh-pages assets), the post-emit verify MUST include a live browser witness via `exec:browser` (boot server → page.goto → page.evaluate asserting the invariant the change established). Node-side import + test.js does NOT satisfy this — see `gm-complete` BROWSER VALIDATION GATE.
|
|
62
|
-
- Files ≤200 lines
|
|
63
|
-
- No duplicate concern (run exec:codesearch for primary concern after writing; any overlap → `planning`)
|
|
64
|
-
- No comments; no hardcoded values; no adjectives in identifiers; no unnecessary files
|
|
65
|
-
- Observability: new server subsystems expose `/debug/<subsystem>`; new client modules in `window.__debug`
|
|
66
|
-
- Structure: no if/else where dispatch table suffices; no one-liners that require decoding; no reinvented APIs
|
|
67
|
-
- All facts resolved this phase memorized via background Agent(memorize)
|
|
68
|
-
- CHANGELOG.md updated; TODO.md cleared/deleted
|
|
46
|
+
## Post-emit verification
|
|
69
47
|
|
|
70
|
-
|
|
48
|
+
Re-import from disk — in-memory state is stale and inadmissible. Run identical inputs as pre-emit; output must match the baseline exactly. Known variance → fix and re-verify (self-loop). Unknown variance → `planning`.
|
|
71
49
|
|
|
72
|
-
|
|
73
|
-
Pack runs: Promise.allSettled, each idea own try/catch, under 12s per call.
|
|
50
|
+
## Mutables gate
|
|
74
51
|
|
|
75
|
-
|
|
52
|
+
Before pre-emit run, read `.gm/mutables.yml`. Any entry with `status: unknown` → regress to `gm-execute`. The pre-tool-use hook hard-blocks Write/Edit/NotebookEdit while unresolved entries exist; trying to emit anyway returns deny. Zero unresolved is the precondition for every legitimacy question below.
|
|
76
53
|
|
|
77
|
-
|
|
54
|
+
## Gate (all true at once)
|
|
78
55
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
56
|
+
- `.gm/mutables.yml` empty/absent OR every entry `status: witnessed` with filled `witness_evidence`
|
|
57
|
+
- Legitimacy gate passed; no refused collapse
|
|
58
|
+
- Pre-emit passed with real inputs and real error inputs
|
|
59
|
+
- Post-emit matches pre-emit exactly
|
|
60
|
+
- Hot-reloadable; errors throw with context (no `|| default`, no `catch { return null }`, no fallbacks)
|
|
61
|
+
- No mocks, fakes, stubs, or scattered test files (delete on discovery)
|
|
62
|
+
- Any behavior change has a corresponding assertion in `test.js` — a change no test catches is a change you cannot prove
|
|
63
|
+
- Browser-facing change → post-emit verify includes a live `exec:browser` witness (boot server → `page.goto` → `page.evaluate` asserting the invariant the change established). Node-side import + test.js does not satisfy this — the final gate runs again in `gm-complete`.
|
|
64
|
+
- Files ≤ 200 lines
|
|
65
|
+
- No duplicate concern (run `exec:codesearch` for the primary concern after writing; overlap → `planning`)
|
|
66
|
+
- No comments, no hardcoded values, no adjectives in identifiers, no unnecessary files
|
|
67
|
+
- Observability: new server subsystems expose `/debug/<subsystem>`; new client modules register in `window.__debug`
|
|
68
|
+
- Structure: no if/else where dispatch suffices; no one-liners that obscure; no reinvented APIs
|
|
69
|
+
- Every fact resolved this phase memorized via background `Agent(memorize)`
|
|
70
|
+
- CHANGELOG.md updated; TODO.md cleared or deleted
|
|
@@ -1,125 +1,83 @@
|
|
|
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
|
-
# GM EXECUTE — Resolve
|
|
6
|
+
# GM EXECUTE — Resolve every unknown by witness
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Entry: `.prd` with named unknowns. Exit: every mutable KNOWN → invoke `gm-emit`.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
A `@<discipline>` sigil propagates from PLAN through every recall, codesearch, and memorize call; reads without one fan across default plus enabled disciplines, writes without one go to default only.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
This skill is the execution contract for ALL phases — pre-emit witnesses, post-emit verifies, e2e checks all run on this discipline. Cross-cutting dispositions live in `gm` SKILL.md.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
- **SELF-LOOP**: still UNKNOWN → re-run different angle (max 2 passes).
|
|
16
|
-
- **REGRESS → PLAN**: new unknown | unresolvable after 2 passes.
|
|
14
|
+
## Transitions
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
- All mutables KNOWN → `gm-emit`
|
|
17
|
+
- Still UNKNOWN → re-run from a different angle (max 2 passes)
|
|
18
|
+
- New unknown OR unresolvable after 2 passes → `planning`
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
## Mutable discipline
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
- **ΔS=0** — witnessed output equals expected
|
|
24
|
-
- **λ≥2** — two independent paths agree
|
|
25
|
-
- **ε intact** — adjacent invariants hold
|
|
26
|
-
- **Coverage≥0.70** — enough corpus inspected
|
|
22
|
+
Each mutable carries: name, expected, current, resolution method.
|
|
27
23
|
|
|
28
|
-
|
|
24
|
+
Resolves to KNOWN only when all four pass:
|
|
29
25
|
|
|
30
|
-
|
|
26
|
+
- **ΔS = 0** — witnessed output equals expected
|
|
27
|
+
- **λ ≥ 2** — two independent paths agree
|
|
28
|
+
- **ε intact** — adjacent invariants hold
|
|
29
|
+
- **Coverage ≥ 0.70** — enough corpus inspected to rule out contradiction
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
weak_prior → witnessed probe → witnessed → feed to EMIT. "The plan says" / "obviously X" = prior, not fact.
|
|
31
|
+
Unresolved after 2 passes regresses to `planning`. Never narrate past an unresolved mutable.
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
Every witness that resolves a mutable writes back to `.gm/mutables.yml` the same step: set `status: witnessed` and fill `witness_evidence` with concrete proof (file:line, codesearch hit, exec output snippet). No write-back = the mutable stays unknown and the EMIT-gate stays closed. The hook reads this file; the agent's memory of "I resolved it" does not unblock anything.
|
|
36
34
|
|
|
37
|
-
|
|
35
|
+
Route candidates from PLAN are `weak_prior` only. Plausibility is the right to test, not the right to believe. A claim with no witness in the current session is a hypothesis — say so when stating it, and say what would settle it. The next reader (you, next turn) needs to know which lines were earned and which were carried forward.
|
|
38
36
|
|
|
39
|
-
|
|
37
|
+
## Verification budget
|
|
40
38
|
|
|
41
|
-
|
|
39
|
+
Spend on `.prd` items in descending order of consequence-if-wrong × distance-from-witnessed. Items whose failure would collapse the headline finding must reach witnessed status before EMIT; sub-argument-level items need at minimum a stated fallback path.
|
|
42
40
|
|
|
43
|
-
|
|
41
|
+
## Code execution
|
|
44
42
|
|
|
45
|
-
|
|
43
|
+
Code AND utility verbs both run through the file-spool. Write a file to `.gm/exec-spool/in/<lang-or-verb>/<N>.<ext>` — language stems (`in/nodejs/42.js`, `in/python/43.py`, `in/bash/44.sh`, plus typescript, go, rust, c, cpp, java, deno) or verb stems (`in/codesearch/45.txt`, `in/recall/46.txt`, `in/memorize/47.md`, plus wait, sleep, status, close, browser, runner, type, kill-port, forget, feedback, learn-status, learn-debug, learn-build, discipline, pause, health). The spool watcher executes and streams stdout to `out/<N>.out`, stderr to `out/<N>.err`, then writes `out/<N>.json` metadata sidecar at completion (taskId, lang, ok, exitCode, durationMs, timedOut, startedAt, endedAt). Both streams return as systemMessage with `--- stdout ---` / `--- stderr ---` separators. File I/O via a nodejs spool file + `require('fs')`. Only `git` and `gh` run directly in Bash. Never `Bash(node/npm/npx/bun)`, never `Bash(exec:<anything>)`.
|
|
46
44
|
|
|
47
|
-
|
|
45
|
+
Pack runs: `Promise.allSettled`, each idea own try/catch, under 12s per call. Runner: write `in/runner/<N>.txt` with body `start` | `stop` | `status`.
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
Runner: `exec:runner\nstart|stop|status`
|
|
47
|
+
Every exec daemonizes. The hook tails the task logfile up to 30s wall-clock and returns whatever is there — short tasks complete inside the window and look synchronous; long tasks return a task_id with partial output. Continue with `exec:tail` (drain, bounded), `exec:watch` (resume blocking until match or timeout), or `exec:close` (terminate). Never re-spawn a long task to check on it — that orphans the first one. `exec:wait` is a pure timer; `exec:sleep` blocks on a specific task's output; `exec:watch` is the match-or-timeout primitive. Every execution-platform RPC returns the live list of running tasks for this session — close stragglers via `exec:close\n<id>` so the list stays scannable. Session-end (clear/logout/prompt_input_exit) kills the session's tasks; compaction/handoff preserves them.
|
|
51
48
|
|
|
52
|
-
|
|
49
|
+
Every utility verb dispatches via `in/<verb>/<N>.txt`; the body of the file is the verb's argument. There is no inline form and no Bash-prefix form — both are denied by the hook.
|
|
53
50
|
|
|
54
|
-
|
|
51
|
+
## Codebase search
|
|
55
52
|
|
|
56
|
-
|
|
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`.
|
|
57
54
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
```
|
|
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`.
|
|
56
|
+
|
|
57
|
+
## Utility verb failure handling
|
|
62
58
|
|
|
63
|
-
|
|
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.
|
|
64
60
|
|
|
65
|
-
##
|
|
61
|
+
## Import-based execution
|
|
66
62
|
|
|
67
|
-
|
|
63
|
+
Hypotheses become real by importing actual modules from disk. Reimplemented behavior is UNKNOWN. Write the import probe to the spool:
|
|
68
64
|
|
|
69
65
|
```
|
|
70
|
-
exec
|
|
66
|
+
# write .gm/exec-spool/in/nodejs/42.js
|
|
71
67
|
const { fn } = await import('/abs/path/to/module.js');
|
|
72
68
|
console.log(await fn(realInput));
|
|
73
69
|
```
|
|
74
70
|
|
|
75
|
-
Differential diagnosis: smallest reproduction → compare actual vs expected → name the delta
|
|
76
|
-
|
|
77
|
-
## CI — AUTOMATED
|
|
78
|
-
|
|
79
|
-
`git push` → Stop hook auto-watches Actions for pushed HEAD. Same-repo only — downstream cascades not auto-watched.
|
|
80
|
-
- Green → Stop approves with summary
|
|
81
|
-
- Failure → run names+IDs → `gh run view <id> --log-failed`
|
|
82
|
-
- Deadline 180s (override `GM_CI_WATCH_SECS`)
|
|
83
|
-
|
|
84
|
-
## GROUND TRUTH
|
|
85
|
-
|
|
86
|
-
Real services, real data, real timing. Mocks/stubs/scattered tests/fallbacks = delete.
|
|
87
|
-
|
|
88
|
-
**Scan before edit**: exec:codesearch before creating/modifying. Duplicate concern = regress to `planning`.
|
|
89
|
-
**Hypothesize via execution**: hypothesis → run → witness → edit. Never edit on unwitnessed assumption.
|
|
90
|
-
**Code quality**: native → library → structure (map/pipeline) → write.
|
|
91
|
-
|
|
92
|
-
## PARALLEL SUBAGENTS
|
|
93
|
-
|
|
94
|
-
≤3 `gm:gm` subagents for independent items in ONE message. Browser escalation: exec:browser → browser skill → screenshot last resort.
|
|
71
|
+
Differential diagnosis: smallest reproduction → compare actual vs expected → name the delta — that delta is the mutable.
|
|
95
72
|
|
|
96
|
-
##
|
|
97
|
-
|
|
98
|
-
Before resolving any new unknown via fresh execution, recall first.
|
|
99
|
-
|
|
100
|
-
```
|
|
101
|
-
exec:recall
|
|
102
|
-
<2-6 word query>
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Triggers: "did we hit this" | feels familiar | new sub-task in known project | about to comment a non-obvious choice | about to ask user something likely discussed.
|
|
106
|
-
|
|
107
|
-
Hits = weak_prior; still witness. Empty = proceed. Capped 6s, ~5ms when serve running. ~200 tokens / 5 hits.
|
|
108
|
-
|
|
109
|
-
## MEMORIZE — HARD RULE
|
|
110
|
-
|
|
111
|
-
Unknown→known = same-turn memorize.
|
|
112
|
-
|
|
113
|
-
```
|
|
114
|
-
Agent(subagent_type='gm:memorize', model='haiku', run_in_background=true, prompt='## CONTEXT TO MEMORIZE\n<fact>')
|
|
115
|
-
```
|
|
73
|
+
## Edits depend on witnesses
|
|
116
74
|
|
|
117
|
-
|
|
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.
|
|
118
76
|
|
|
119
|
-
|
|
77
|
+
## Parallel subagents
|
|
120
78
|
|
|
121
|
-
|
|
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.
|
|
122
80
|
|
|
123
|
-
|
|
81
|
+
## CI is automated
|
|
124
82
|
|
|
125
|
-
|
|
83
|
+
`git push` triggers the Stop hook to watch Actions for the pushed HEAD on the same repo (downstream cascades are not auto-watched). Green → Stop approves with summary; failure → run names + IDs surfaced, investigate via `gh run view <id> --log-failed`. Deadline 180s (override `GM_CI_WATCH_SECS`).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gm-gc
|
|
3
|
+
description: AI-native software engineering via skill-driven orchestration on gc; bootstraps plugkit for task execution and session isolation
|
|
4
|
+
allowed-tools: Skill
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# GM — gc Platform
|
|
8
|
+
|
|
9
|
+
AI-native software engineering orchestrated via skill chain: PLAN → EXECUTE → EMIT → VERIFY → UPDATE-DOCS.
|
|
10
|
+
|
|
11
|
+
**Bootstrap pattern**: `bun x gm-plugkit@latest --daemon` downloads the correct platform binary, verifies SHA256, and starts the spool watcher daemon. Call once at session start; idempotent on subsequent calls. All execution routes through the file-spool: write to `.gm/exec-spool/in/<lang>/<N>.<ext>` or `in/<verb>/<N>.txt`, poll `out/<N>.json` for results.
|
|
12
|
+
|
|
13
|
+
**Session-ID threading (no session-start hook)**: At skill invoke time, generate or detect SESSION_ID (env var `SESSION_ID` or `uuid()`). Pass `sessionId: "<id>"` in every rs-exec RPC body (spawn, tail, watch, etc.) and every spool-written task body. All task-scoped cleanup (deleteTask, getTask, appendOutput, killSessionTasks) requires matching sessionId. Absence is forbidden — hard reject by rs-exec handler.
|
|
14
|
+
|
|
15
|
+
**Spool dispatch surface**: Write to `.gm/exec-spool/in/<lang>/<N>.<ext>` (languages: nodejs, python, bash, typescript, go, rust, c, cpp, java, deno) or `in/<verb>/<N>.txt` (verbs: codesearch, recall, memorize, wait, sleep, status, close, browser, runner, etc.). Watcher executes and streams `out/<N>.out` (stdout) + `out/<N>.err` (stderr) line-by-line, then `out/<N>.json` metadata (exitCode, durationMs, timedOut, startedAt, endedAt) at completion.
|
|
16
|
+
|
|
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
|
+
|
|
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).
|