gm-thebird 2.0.1012
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.md +11 -0
- package/LICENSE +21 -0
- package/README.md +32 -0
- package/agents/gm.md +24 -0
- package/agents/memorize.md +95 -0
- package/agents/research-worker.md +36 -0
- package/agents/textprocessing.md +47 -0
- package/bin/bootstrap.js +863 -0
- package/bin/plugkit.js +110 -0
- package/bin/plugkit.sha256 +6 -0
- package/bin/plugkit.version +1 -0
- package/bin/rtk.sha256 +6 -0
- package/bin/rtk.version +1 -0
- package/cli.js +68 -0
- package/gm.json +27 -0
- package/hooks/hooks.json +102 -0
- package/hooks/hooks.spec.json +83 -0
- package/package.json +44 -0
- package/plugin.json +13 -0
- package/skills/browser/SKILL.md +79 -0
- package/skills/code-search/SKILL.md +48 -0
- package/skills/create-lang-plugin/SKILL.md +121 -0
- package/skills/gm/SKILL.md +69 -0
- package/skills/gm-complete/SKILL.md +106 -0
- package/skills/gm-emit/SKILL.md +70 -0
- package/skills/gm-execute/SKILL.md +84 -0
- package/skills/governance/SKILL.md +97 -0
- package/skills/pages/SKILL.md +208 -0
- package/skills/planning/SKILL.md +116 -0
- package/skills/research/SKILL.md +43 -0
- package/skills/ssh/SKILL.md +68 -0
- package/skills/textprocessing/SKILL.md +40 -0
- package/skills/update-docs/SKILL.md +51 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pages
|
|
3
|
+
description: Scaffold and maintain a GitHub Pages site. Buildless in browser (webjsx + rippleui via CDN), flatspace for content aggregation built during GH Actions. Use when user wants to create or update a GH Pages site.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Pages — GitHub Pages site scaffolder
|
|
7
|
+
|
|
8
|
+
Scaffold a complete GH Pages site with no local build step. Content via flatspace flat-file CMS, UI via webjsx + rippleui CDN, GH Actions builds and deploys. Follow the full chain: `planning → gm-execute → gm-emit → gm-complete → update-docs`.
|
|
9
|
+
|
|
10
|
+
## Stack
|
|
11
|
+
|
|
12
|
+
| Layer | Tool | How |
|
|
13
|
+
|---|---|---|
|
|
14
|
+
| UI rendering | [webjsx](https://webjsx.org) | ES module via importmap, `applyDiff` for DOM updates |
|
|
15
|
+
| Styling | [rippleui](https://ripple-ui.com) | CDN `<link>` — Tailwind-based component classes |
|
|
16
|
+
| Content CMS | [flatspace](https://npmjs.com/package/flatspace) | Aggregates `content/` → `docs/data/*.json` at build time |
|
|
17
|
+
| Build | GH Actions | `npx flatspace` runs in CI, commits output to `docs/` |
|
|
18
|
+
| Hosting | GitHub Pages | Source set to "GitHub Actions" |
|
|
19
|
+
|
|
20
|
+
## Layout
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
<project>/
|
|
24
|
+
content/
|
|
25
|
+
pages/
|
|
26
|
+
posts/
|
|
27
|
+
data/
|
|
28
|
+
docs/
|
|
29
|
+
index.html # committed, never regenerated
|
|
30
|
+
app.js # committed
|
|
31
|
+
data/ # flatspace output, gitignored
|
|
32
|
+
.github/workflows/pages.yml
|
|
33
|
+
flatspace.config.js
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## index.html
|
|
37
|
+
|
|
38
|
+
```html
|
|
39
|
+
<!DOCTYPE html>
|
|
40
|
+
<html lang="en">
|
|
41
|
+
<head>
|
|
42
|
+
<meta charset="UTF-8">
|
|
43
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
44
|
+
<title>{{SITE_TITLE}}</title>
|
|
45
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/rippleui@1.12.1/dist/css/styles.css">
|
|
46
|
+
<script type="importmap">
|
|
47
|
+
{
|
|
48
|
+
"imports": {
|
|
49
|
+
"webjsx": "https://cdn.jsdelivr.net/npm/webjsx@0.0.42/dist/index.js",
|
|
50
|
+
"webjsx/jsx-runtime": "https://cdn.jsdelivr.net/npm/webjsx@0.0.42/dist/jsx-runtime.js"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
</script>
|
|
54
|
+
<script type="module" src="./app.js"></script>
|
|
55
|
+
</head>
|
|
56
|
+
<body class="bg-backgroundPrimary text-content1 min-h-screen">
|
|
57
|
+
<div id="root"></div>
|
|
58
|
+
</body>
|
|
59
|
+
</html>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## app.js
|
|
63
|
+
|
|
64
|
+
```js
|
|
65
|
+
import { applyDiff } from 'webjsx';
|
|
66
|
+
|
|
67
|
+
const h = (tag, props, ...children) => ({ tag, props: props || {}, children });
|
|
68
|
+
const state = { page: null, data: {} };
|
|
69
|
+
|
|
70
|
+
async function loadData(path) { return (await fetch(path)).json(); }
|
|
71
|
+
function render() { applyDiff(document.getElementById('root'), App(state)); }
|
|
72
|
+
|
|
73
|
+
function App(s) {
|
|
74
|
+
if (!s.page) return h('div', { class: 'flex justify-center p-8' }, h('span', { class: 'spinner' }));
|
|
75
|
+
return h('div', { class: 'max-w-4xl mx-auto p-4' },
|
|
76
|
+
h('nav', { class: 'navbar bg-backgroundSecondary mb-6' },
|
|
77
|
+
h('span', { class: 'navbar-brand text-xl font-bold' }, s.page.title)
|
|
78
|
+
),
|
|
79
|
+
h('main', {}, ...s.page.sections.map(Section))
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function Section(section) {
|
|
84
|
+
return h('section', { class: 'card mb-4 p-6' },
|
|
85
|
+
h('h2', { class: 'text-2xl font-bold mb-2' }, section.title),
|
|
86
|
+
h('p', { class: 'text-content2' }, section.body)
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
async function main() { state.page = await loadData('./data/index.json'); render(); }
|
|
91
|
+
main();
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## flatspace.config.js
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
module.exports = {
|
|
98
|
+
input: './content',
|
|
99
|
+
output: './docs/data',
|
|
100
|
+
collections: {
|
|
101
|
+
pages: { dir: 'pages', format: 'markdown' },
|
|
102
|
+
posts: { dir: 'posts', format: 'markdown', sortBy: 'date', order: 'desc' },
|
|
103
|
+
data: { dir: 'data', format: 'json' }
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## pages.yml
|
|
109
|
+
|
|
110
|
+
```yaml
|
|
111
|
+
name: Deploy GitHub Pages
|
|
112
|
+
on:
|
|
113
|
+
push:
|
|
114
|
+
branches: [main]
|
|
115
|
+
workflow_dispatch:
|
|
116
|
+
|
|
117
|
+
permissions:
|
|
118
|
+
contents: write
|
|
119
|
+
pages: write
|
|
120
|
+
id-token: write
|
|
121
|
+
|
|
122
|
+
jobs:
|
|
123
|
+
build:
|
|
124
|
+
runs-on: ubuntu-latest
|
|
125
|
+
steps:
|
|
126
|
+
- uses: actions/checkout@v4
|
|
127
|
+
- uses: actions/setup-node@v4
|
|
128
|
+
with: { node-version: '20' }
|
|
129
|
+
- name: Build content with flatspace
|
|
130
|
+
run: npx flatspace
|
|
131
|
+
- name: Commit built data
|
|
132
|
+
run: |
|
|
133
|
+
git config user.name "github-actions[bot]"
|
|
134
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
135
|
+
git add docs/data/
|
|
136
|
+
git diff --staged --quiet || git commit -m "chore: build content [skip ci]"
|
|
137
|
+
git push
|
|
138
|
+
- uses: actions/upload-pages-artifact@v3
|
|
139
|
+
with: { path: docs/ }
|
|
140
|
+
|
|
141
|
+
deploy:
|
|
142
|
+
needs: build
|
|
143
|
+
runs-on: ubuntu-latest
|
|
144
|
+
environment:
|
|
145
|
+
name: github-pages
|
|
146
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
147
|
+
steps:
|
|
148
|
+
- id: deployment
|
|
149
|
+
uses: actions/deploy-pages@v4
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Scaffold sequence
|
|
153
|
+
|
|
154
|
+
Read existing `docs/` and `content/` if present — never clobber existing content. Create the directory structure. Write `docs/index.html`, `docs/app.js`, `flatspace.config.js`, `.github/workflows/pages.yml`, `content/pages/index.md` with minimal frontmatter (`title`, `sections` array). Add `docs/data/` to `.gitignore`. Verify GH Pages setting is "GitHub Actions" in repo Settings — remind the user if you can't verify.
|
|
155
|
+
|
|
156
|
+
## rippleui classes
|
|
157
|
+
|
|
158
|
+
| Component | Class |
|
|
159
|
+
|---|---|
|
|
160
|
+
| Button | `btn btn-primary`, `btn btn-secondary`, `btn btn-ghost` |
|
|
161
|
+
| Card | `card p-4` |
|
|
162
|
+
| Input | `input input-primary` |
|
|
163
|
+
| Navbar | `navbar` + `navbar-brand` |
|
|
164
|
+
| Badge | `badge badge-primary` |
|
|
165
|
+
| Alert | `alert alert-success`, `alert alert-error` |
|
|
166
|
+
| Spinner | `spinner` |
|
|
167
|
+
| Divider | `divider` |
|
|
168
|
+
|
|
169
|
+
Background `bg-backgroundPrimary`, `bg-backgroundSecondary`. Text `text-content1`, `text-content2`. rippleui CSS color vars (e.g. `--gray-2`) are raw space-separated RGB tuples — invalid in `rgb()` directly. Use the component classes instead.
|
|
170
|
+
|
|
171
|
+
## webjsx
|
|
172
|
+
|
|
173
|
+
No JSX transpile needed. Use the `h()` factory in `.js` files served directly. `.jsx` with native importmap requires the server to set the correct MIME type, which GH Pages does not — stay in `.js` + `h()`.
|
|
174
|
+
|
|
175
|
+
`applyDiff(domNode, vnodeOrArray)` — never pass a string. State updates mutate `state` and call `render()`; no reactive system.
|
|
176
|
+
|
|
177
|
+
## Content format
|
|
178
|
+
|
|
179
|
+
Markdown with YAML frontmatter:
|
|
180
|
+
|
|
181
|
+
```markdown
|
|
182
|
+
---
|
|
183
|
+
title: Home
|
|
184
|
+
sections:
|
|
185
|
+
- title: Welcome
|
|
186
|
+
body: Hello world
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
# Home
|
|
190
|
+
|
|
191
|
+
Full markdown body here.
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Output `docs/data/pages/index.json`:
|
|
195
|
+
|
|
196
|
+
```json
|
|
197
|
+
{ "title": "Home", "sections": [...], "body": "<p>Full markdown body here.</p>", "slug": "index" }
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Gotchas
|
|
201
|
+
|
|
202
|
+
GH Pages must be set to "GitHub Actions" in Settings → Pages. "Deploy from branch" ignores the deploy-pages action.
|
|
203
|
+
|
|
204
|
+
`docs/data/` is gitignored; `docs/index.html` and `docs/app.js` are not — they are the committed source files.
|
|
205
|
+
|
|
206
|
+
`npx flatspace` cold-start is ~10s on first CI run; subsequent runs use the `actions/setup-node` cache.
|
|
207
|
+
|
|
208
|
+
Pin the webjsx CDN version in importmap (e.g. `@0.0.42`) — `@latest` breaks silently on upstream updates.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: planning
|
|
3
|
+
description: State machine orchestrator. Mutable discovery, PRD construction, and full PLAN→EXECUTE→EMIT→VERIFY→COMPLETE lifecycle. Invoke at session start and on any new unknown.
|
|
4
|
+
allowed-tools: Skill, Bash, Write, Read, Agent
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Planning — PLAN phase
|
|
8
|
+
|
|
9
|
+
Translate the request into `.gm/prd.yml` and hand to `gm-execute`. Re-enter on any new unknown in any phase.
|
|
10
|
+
|
|
11
|
+
A `@<discipline>` sigil in the request scopes recall, codesearch, and memorize calls during PLAN to that discipline's store. Without one, retrievals fan across default plus enabled disciplines and writes land in default only.
|
|
12
|
+
|
|
13
|
+
Cross-cutting dispositions (autonomy, fix-on-sight, nothing-fake, browser-witness, scope, recall, memorize) live in `gm` SKILL.md; this skill only carries what is unique to PLAN.
|
|
14
|
+
|
|
15
|
+
## Transitions
|
|
16
|
+
|
|
17
|
+
- PLAN done → `gm-execute`
|
|
18
|
+
- New unknown anywhere in chain → re-enter PLAN
|
|
19
|
+
- EXECUTE unresolvable after 2 passes → PLAN
|
|
20
|
+
- VERIFY: `.prd` empty + git clean + pushed → `update-docs`; else → `gm-execute`
|
|
21
|
+
|
|
22
|
+
Cannot stop while `.gm/prd.yml` has items, git is dirty, or commits are unpushed.
|
|
23
|
+
|
|
24
|
+
## Orient
|
|
25
|
+
|
|
26
|
+
Open every plan with one parallel pack of `exec:recall` + `exec:codesearch` against the request's nouns. Hits land as `weak_prior`; misses confirm the unknown is fresh. The pack runs in one message.
|
|
27
|
+
|
|
28
|
+
## Mutable discovery
|
|
29
|
+
|
|
30
|
+
For each aspect of the work, ask: what do I not know, what could go wrong, what depends on what, what am I assuming. Unwitnessed assumptions are mutables.
|
|
31
|
+
|
|
32
|
+
Fault surfaces to scan: file existence, API shape, data format, dep versions, runtime behavior, env differences, error conditions, concurrency, integration seams, backwards compat, rollback paths, CI correctness.
|
|
33
|
+
|
|
34
|
+
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.
|
|
35
|
+
|
|
36
|
+
`existingImpl=UNKNOWN` is the default; resolve via `exec:codesearch` before adding the item. An existing concern routes to consolidation, not addition.
|
|
37
|
+
|
|
38
|
+
Plan exits when zero new unknowns surfaced last pass AND every item has acceptance criteria AND deps are mapped.
|
|
39
|
+
|
|
40
|
+
## .gm/mutables.yml — co-equal with .gm/prd.yml
|
|
41
|
+
|
|
42
|
+
Every unknown surfaced during PLAN lands as an entry in `.gm/mutables.yml` the same pass. Live during work, deleted when empty. Hook-gated: Write/Edit/NotebookEdit and `git commit`/`git push` are hard-blocked while any entry has `status: unknown`; turn-stop is hard-blocked the same way.
|
|
43
|
+
|
|
44
|
+
```yaml
|
|
45
|
+
- id: kebab-id
|
|
46
|
+
claim: One-line statement of what is assumed
|
|
47
|
+
witness_method: exec:codesearch <query> | exec:nodejs import | exec:recall <query> | Read <path>
|
|
48
|
+
witness_evidence: ""
|
|
49
|
+
status: unknown
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`status: unknown` → `witnessed` only when `witness_evidence` is filled with concrete proof (file:line, codesearch hit, dispatched test output). Resolution lives in gm-execute. PRD items reference mutables via optional `mutables: [id1, id2]` field; an item is blocked while any referenced mutable is unresolved.
|
|
53
|
+
|
|
54
|
+
## .prd format
|
|
55
|
+
|
|
56
|
+
Path: `./.gm/prd.yml`. Write via the Write tool or by emitting a nodejs spool file (`in/nodejs/<N>.js`) that calls `fs.writeFileSync`. Delete the file when empty.
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
- id: kebab-id
|
|
60
|
+
subject: Imperative verb phrase
|
|
61
|
+
status: pending
|
|
62
|
+
description: Precise criterion
|
|
63
|
+
effort: small|medium|large
|
|
64
|
+
category: feature|bug|refactor|infra
|
|
65
|
+
route_family: grounding|reasoning|state|execution|observability|boundary|representation
|
|
66
|
+
load: 0.0-1.0
|
|
67
|
+
failure_modes: []
|
|
68
|
+
route_fit: unexamined|examined|dominant
|
|
69
|
+
authorization: none|weak_prior|witnessed
|
|
70
|
+
blocking: []
|
|
71
|
+
blockedBy: []
|
|
72
|
+
acceptance:
|
|
73
|
+
- binary criterion
|
|
74
|
+
edge_cases:
|
|
75
|
+
- failure mode
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
`load` is consequence-if-wrong: 0.9 = headline collapses, 0.7 = sub-argument rebuilt, 0.4 = local patch, 0.1 = nothing breaks. Verification budget = `load × (1 − tier_confidence)`. λ>0.75 must reach witnessed before EMIT.
|
|
79
|
+
|
|
80
|
+
`status`: pending → in_progress → completed (then remove). `effort`: small <15min | medium <45min | large >1h.
|
|
81
|
+
|
|
82
|
+
## Parallel subagent launch
|
|
83
|
+
|
|
84
|
+
After `.prd` is written, up to 3 parallel `gm:gm` subagents for independent items in one message. Browser tasks serialize.
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
Agent(subagent_type="gm:gm", prompt="Work on .prd item: <id>. .prd path: <path>. Item: <full YAML>.")
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Items not parallelizable → invoke `gm-execute` directly.
|
|
91
|
+
|
|
92
|
+
## Observability gates in the plan
|
|
93
|
+
|
|
94
|
+
Server: every subsystem exposes `/debug/<subsystem>`; structured logs `{subsystem, severity, ts}`. Client: `window.__debug` live registry; modules register on mount. `console.log` is not observability. Discovery of a gap during PLAN adds a `.prd` item the same pass — never deferred.
|
|
95
|
+
|
|
96
|
+
`window.__debug` is THE in-page registry; `test.js` at project root is the sole out-of-page test asset. Any new file whose purpose is to exercise, smoke-test, demo, or sandbox in-page behavior outside that registry fights the discipline — extend the registry instead.
|
|
97
|
+
|
|
98
|
+
## Test discipline encoded in the plan
|
|
99
|
+
|
|
100
|
+
One `test.js` at project root, 200-line hard cap, real data, real system. No fixtures, mocks, or scattered tests. A second test runner under any name in any directory is a smuggled parallel surface.
|
|
101
|
+
|
|
102
|
+
The 200 lines are a *budget* for maximum surface coverage, not a target. Subsystems get one combined group each — names joined with `+` (`home+config+skin`, `mcp+swe+distributions+account+credpool`). When a new subsystem's failure mode overlaps an existing group's side-effects, fold the assertion in rather than creating a new group. When `wc -l test.js > 200`, the discipline is *merge groups + drop redundancy*, never split.
|
|
103
|
+
|
|
104
|
+
## Execution norms encoded in the plan
|
|
105
|
+
|
|
106
|
+
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]`.
|
|
107
|
+
|
|
108
|
+
`exec:codesearch` only — Grep/Glob/Find/Explore are hook-blocked. Start two words, change/add one per pass, minimum four attempts before concluding absent.
|
|
109
|
+
|
|
110
|
+
Pack runs use `Promise.allSettled`, each idea its own try/catch, under 12s per call.
|
|
111
|
+
|
|
112
|
+
## Dev workflow encoded in the plan
|
|
113
|
+
|
|
114
|
+
No comments. 200-line per-file cap. Fail loud. No duplication. Scan before edit. AGENTS.md edits route through the memorize sub-agent only. CHANGELOG.md gets one entry per commit.
|
|
115
|
+
|
|
116
|
+
Minimal-code process, stop at the first that resolves: native → library → structure (map / pipeline) → write.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: research
|
|
3
|
+
description: Web research via parallel subagent fan-out. Use when a question needs the live web, spans multiple sources, requires comparison across vendors/papers/repos, or would saturate a single context window. Skip for one-page lookups answerable by a single WebFetch.
|
|
4
|
+
allowed-tools: Skill, Bash, Agent, WebFetch, WebSearch, Read, Write
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Research
|
|
8
|
+
|
|
9
|
+
Declare the discipline before fetching anything. The first line of work names the `@<discipline>` the corpus belongs to — fresh material lives at `.gm/disciplines/<name>/corpus/raw/`, concise rewrites at `.gm/disciplines/<name>/corpus/concise/<chunk-id>.md`, the merged synthesis at `.gm/disciplines/<name>/deep-understanding.md`. A run without a discipline declaration falls back to the default store and the orchestrator says so in one line.
|
|
10
|
+
|
|
11
|
+
Lead orchestrates. Workers fetch. Findings converge on disk. The lead never reads pages — workers do.
|
|
12
|
+
|
|
13
|
+
Treat a thousand-document corpus with the same care as a codebase. Material above roughly ten pages — about eight thousand tokens — splits at paragraph boundaries into chunks each owned by one parallel `gm:research-worker` (haiku model). Each worker emits a fact-preserving concise rewrite to `corpus/concise/<chunk-id>.md` — every claim, number, name, caveat from the source survives, prose density rises, citations stay attached. Once every chunk returns, the lead merges into `deep-understanding.md` enumerating the opportunities the corpus opens and the reasonable opinionations it forces. Concise files and the merged document auto-ingest via `exec:memorize @<name>` so the next pass recalls instead of re-fetching.
|
|
14
|
+
|
|
15
|
+
Effort matches stakes. A single fact is one short fetch. A vendor comparison is a handful of workers, each owning one vendor. A landscape survey is ten or more, each owning one axis. Spending a fan-out on a fact wastes tokens; spending a fact-fetch on a landscape under-delivers.
|
|
16
|
+
|
|
17
|
+
Breadth first, depth on demand. Open with a wide sweep that maps the terrain, then commit deep dives only where the sweep surfaces something load-bearing. A narrow opening misses the alternative the user actually needed.
|
|
18
|
+
|
|
19
|
+
## Worker contract
|
|
20
|
+
|
|
21
|
+
Each worker receives the precise question it owns, the shape of the answer (bullets, table row, prose paragraph), the boundary of what it must not pursue, and the destination path under `.gm/research/<slug>/<worker-id>.md`. Workers write structured findings to disk and return only a path plus a one-line summary. The lead reads the paths it cares about; the rest stay on disk. Returning full prose through the agent boundary burns context that the synthesis pass needs.
|
|
22
|
+
|
|
23
|
+
Workers run in parallel — independent questions launch in one message, never serialized.
|
|
24
|
+
|
|
25
|
+
## Citations
|
|
26
|
+
|
|
27
|
+
A claim without a source URL is a hallucination waiting to be quoted. Workers attach the URL and the quoted span beside every non-trivial assertion. The lead refuses to lift a claim into the final answer if its citation field is empty.
|
|
28
|
+
|
|
29
|
+
## Source quality
|
|
30
|
+
|
|
31
|
+
Vendor docs, RFCs, primary repos, dated blog posts from named authors, and academic preprints beat aggregator pages. When two sources disagree, the older primary usually beats the newer aggregator.
|
|
32
|
+
|
|
33
|
+
## Convergence
|
|
34
|
+
|
|
35
|
+
Synthesis happens once, after all workers return. Mid-flight summarisation truncates findings the next worker would have built on. If a worker's return reveals a new axis the original plan missed, expand the fan-out — do not stretch an existing worker past its brief.
|
|
36
|
+
|
|
37
|
+
## When not to fan out
|
|
38
|
+
|
|
39
|
+
One question, one page, one fetch. A single `WebFetch` answers it. The fan-out machinery has overhead; spending it on a lookup is the same mistake as skipping it on a survey.
|
|
40
|
+
|
|
41
|
+
## Handoff
|
|
42
|
+
|
|
43
|
+
Final answer cites every load-bearing claim, names the workers' output paths for audit, and surfaces disagreements rather than averaging them away.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ssh
|
|
3
|
+
description: Run shell commands on remote SSH hosts via exec:ssh. Reads targets from ~/.claude/ssh-targets.json. Use for deploying, monitoring, or controlling remote machines.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# exec:ssh — Remote SSH execution
|
|
7
|
+
|
|
8
|
+
Runs shell commands on a remote host. No manual connection needed.
|
|
9
|
+
|
|
10
|
+
## Setup
|
|
11
|
+
|
|
12
|
+
`~/.claude/ssh-targets.json`:
|
|
13
|
+
|
|
14
|
+
```json
|
|
15
|
+
{
|
|
16
|
+
"default": { "host": "192.168.1.10", "port": 22, "username": "pi", "password": "pass" },
|
|
17
|
+
"prod": { "host": "10.0.0.1", "username": "ubuntu", "keyPath": "/home/user/.ssh/id_rsa" }
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`host` and `username` required. `port` defaults to 22. Auth: `password` OR `keyPath` + optional `passphrase`.
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
exec:ssh
|
|
27
|
+
<shell command>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Named host with `@name` on the first line:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
exec:ssh
|
|
34
|
+
@prod
|
|
35
|
+
sudo systemctl restart myapp
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Process persistence
|
|
39
|
+
|
|
40
|
+
SSH kills child processes on close. To survive disconnect:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
exec:ssh
|
|
44
|
+
sudo systemctl reset-failed myunit 2>/dev/null; systemd-run --unit=myunit bash -c 'your-command'
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Unique unit name per launch:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
exec:ssh
|
|
51
|
+
systemd-run --unit=job-$(date +%s) bash -c 'nohup myprogram &'
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
No-systemd fallback:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
exec:ssh
|
|
58
|
+
setsid nohup bash -c 'myprogram > /tmp/out.log 2>&1' &
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Dependency
|
|
62
|
+
|
|
63
|
+
Requires `ssh2` in `~/.claude/gm-tools`:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
exec:bash
|
|
67
|
+
cd ~/.claude/gm-tools && npm install ssh2
|
|
68
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: textprocessing
|
|
3
|
+
description: The required surface for any text task whose correctness depends on understanding. Code does mechanics; this skill does meaning. Invoked via Agent(subagent_type='gm:textprocessing', model='haiku', ...).
|
|
4
|
+
allowed-tools: Agent, Read, Write, Edit, Bash, Skill
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Textprocessing — Meaning goes through Haiku
|
|
8
|
+
|
|
9
|
+
## Invocation
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
Agent(subagent_type='gm:textprocessing', model='haiku', prompt='## INPUT\n<body>\n\n## INSTRUCTION\n<task>')
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Background fire-and-forget: add `run_in_background=true`. Batch: N parallel `Agent` calls in one message, one per item.
|
|
16
|
+
|
|
17
|
+
## The split
|
|
18
|
+
|
|
19
|
+
Mechanics stay in code: char/word/token/line counts, byte length, split on delimiter, exact-string find/replace, regex match/extract, sort, group-by-key, dedup-by-equality, lower/uppercase, JSON parse/stringify, base64, URL encode, hash, diff, format/pretty-print.
|
|
20
|
+
|
|
21
|
+
Meaning goes through this skill: summarize, classify, extract entities or intents, rewrite for tone or audience, translate, semantic dedup (same meaning, different words), rank or score by quality, label by topic, decide whether two texts are about the same thing, paraphrase, simplify, expand outline → prose, headline-from-body, body-from-headline, fact-from-passage, sentiment, toxicity, relevance, similarity-by-meaning.
|
|
22
|
+
|
|
23
|
+
The bar: would a human have to *read and understand* the text to do this correctly? Yes → skill. No → code. A keyword-list, a regex on phrases like "important", or a string-similarity ratio loop deciding meaning is a stub of this skill. Replace it with one (or N parallel) Agent calls.
|
|
24
|
+
|
|
25
|
+
## Batch
|
|
26
|
+
|
|
27
|
+
Independent items run in parallel — one Agent call per item, all in one message. The runner Promise-allSettles. Sequential calls are wasteful when items don't depend on each other.
|
|
28
|
+
|
|
29
|
+
For one large body exceeding a single-prompt budget, the *caller* chunks deterministically (paragraph, section, fixed token count), fans out one Agent per chunk, and merges with a final reducer Agent if cross-chunk synthesis is needed. The agent itself never chunks — it processes whatever it receives in one shot.
|
|
30
|
+
|
|
31
|
+
## Output contract
|
|
32
|
+
|
|
33
|
+
Plain-text instruction → plain-text output, no fences, no labels. JSON instruction → exactly that JSON, parseable by `JSON.parse`. Multi-document input requested as a list → one entry per input doc in the same order. Ambiguous shape → defaults to plain text. Empty input → empty output.
|
|
34
|
+
|
|
35
|
+
## Constraints
|
|
36
|
+
|
|
37
|
+
- Model fixed at `haiku`. Escalate to opus only when haiku output fails an acceptance check.
|
|
38
|
+
- One transform per call. Three parallel calls beats one prompt asking for "summarize AND classify AND translate".
|
|
39
|
+
- Idempotent: same input + same instruction → same output, modulo sampling. Strict determinism callers specify `temperature=0` in the prompt.
|
|
40
|
+
- Output is the deliverable. No commentary, no "here is your output".
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: update-docs
|
|
3
|
+
description: UPDATE-DOCS phase. Refresh README.md, AGENTS.md, and docs/index.html to reflect changes made this session. Commits and pushes doc updates. Terminal phase — declares COMPLETE.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GM UPDATE-DOCS
|
|
7
|
+
|
|
8
|
+
Entry: feature verified, committed, pushed. Exit: docs match disk, committed, pushed → COMPLETE. Unknown architecture change → `planning`.
|
|
9
|
+
|
|
10
|
+
Every claim in docs is verifiable against disk. Phase names match frontmatter, platform names match `platforms/`, file paths exist, constraint counts are accurate. An unverifiable section is removed, not speculated.
|
|
11
|
+
|
|
12
|
+
## Sequence
|
|
13
|
+
|
|
14
|
+
What changed — run directly via Bash:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
git log -5 --oneline
|
|
18
|
+
git diff HEAD~1 --stat
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Read current docs via Read tool, or via a nodejs spool file (`in/nodejs/<N>.js`):
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
const fs = require('fs');
|
|
25
|
+
['README.md', 'AGENTS.md', 'docs/index.html', 'gm-starter/agents/gm.md'].forEach(f => {
|
|
26
|
+
try { console.log(`=== ${f} ===\n` + fs.readFileSync(f, 'utf8')); }
|
|
27
|
+
catch(e) { console.log(`MISSING: ${f}`); }
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Write changed sections only:
|
|
32
|
+
|
|
33
|
+
- **README.md** — platform count, skill tree diagram, quick-start commands
|
|
34
|
+
- **AGENTS.md** — via `Agent(subagent_type='gm:memorize', model='haiku', run_in_background=true, prompt='## CONTEXT TO MEMORIZE\n<learnings>')`. Never inline-edit.
|
|
35
|
+
- **docs/index.html** — `PHASES` array, platform lists, state machine diagram
|
|
36
|
+
- **gm-starter/agents/gm.md** — skill chain line if new skills added
|
|
37
|
+
|
|
38
|
+
Verify from disk (Read tool, or a nodejs spool file):
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
const content = require('fs').readFileSync('/abs/path/file.md', 'utf8');
|
|
42
|
+
console.log(content.includes('expectedString'), content.length);
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Commit and push directly via Bash:
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
git add README.md docs/index.html gm-starter/agents/gm.md
|
|
49
|
+
git commit -m "docs: update documentation to reflect session changes"
|
|
50
|
+
git push -u origin HEAD
|
|
51
|
+
```
|