gm-skill 0.1.2 → 2.0.1081
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 +1 -0
- package/LICENSE +21 -0
- package/README.md +20 -84
- package/agents/gm.md +22 -0
- package/agents/memorize.md +100 -0
- package/agents/research-worker.md +36 -0
- package/agents/textprocessing.md +47 -0
- package/bin/bootstrap.js +702 -0
- package/bin/plugkit.js +136 -0
- package/bin/plugkit.sha256 +7 -0
- package/bin/plugkit.version +1 -0
- package/bin/plugkit.wasm +0 -0
- package/bin/plugkit.wasm.sha256 +1 -0
- package/bin/rtk.sha256 +6 -0
- package/bin/rtk.version +1 -0
- package/gm-plugkit/bootstrap.js +694 -0
- package/gm-plugkit/cli.js +48 -0
- package/gm-plugkit/index.js +12 -0
- package/gm-plugkit/package.json +26 -0
- package/gm-plugkit/plugkit-wasm-wrapper.js +190 -0
- package/gm-plugkit/plugkit.sha256 +6 -0
- package/gm-plugkit/plugkit.version +1 -0
- package/gm.json +27 -0
- package/lang/browser.js +45 -0
- package/lang/ssh.js +166 -0
- package/lib/browser-spool-handler.js +130 -0
- package/lib/browser.js +131 -0
- package/lib/codeinsight.js +109 -0
- package/lib/daemon-bootstrap.js +253 -132
- package/lib/git.js +0 -1
- package/lib/learning.js +169 -0
- package/lib/skill-bootstrap.js +406 -0
- package/lib/spool-dispatch.js +100 -0
- package/lib/spool.js +87 -49
- package/lib/wasm-host.js +241 -0
- package/package.json +38 -20
- package/prompts/bash-deny.txt +22 -0
- package/prompts/pre-compact.txt +21 -0
- package/prompts/prompt-submit.txt +83 -0
- package/prompts/session-start.txt +15 -0
- package/scripts/run-hook.sh +7 -0
- package/scripts/watch-cascade.js +166 -0
- package/skills/browser/SKILL.md +80 -0
- package/skills/code-search/SKILL.md +48 -0
- package/skills/create-lang-plugin/SKILL.md +121 -0
- package/skills/gm/SKILL.md +10 -49
- package/skills/gm-complete/SKILL.md +16 -87
- package/skills/gm-emit/SKILL.md +17 -50
- package/skills/gm-execute/SKILL.md +18 -69
- package/skills/gm-skill/SKILL.md +43 -0
- package/skills/gm-skill/index.js +21 -0
- package/skills/governance/SKILL.md +97 -0
- package/skills/pages/SKILL.md +208 -0
- package/skills/planning/SKILL.md +21 -97
- package/skills/research/SKILL.md +43 -0
- package/skills/ssh/SKILL.md +71 -0
- package/skills/textprocessing/SKILL.md +40 -0
- package/skills/update-docs/SKILL.md +24 -43
- package/gm-complete.SKILL.md +0 -106
- package/gm-emit.SKILL.md +0 -70
- package/gm-execute.SKILL.md +0 -88
- package/gm.SKILL.md +0 -63
- package/index.js +0 -1
- package/lib/index.js +0 -37
- package/lib/loader.js +0 -66
- package/lib/manifest.js +0 -99
- package/lib/prepare.js +0 -14
- package/planning.SKILL.md +0 -118
- package/skills/gm/index.js +0 -113
- package/skills/gm-complete/index.js +0 -118
- package/skills/gm-complete.SKILL.md +0 -106
- package/skills/gm-emit/index.js +0 -90
- package/skills/gm-emit.SKILL.md +0 -70
- package/skills/gm-execute/index.js +0 -91
- package/skills/gm-execute.SKILL.md +0 -88
- package/skills/gm.SKILL.md +0 -63
- package/skills/planning/index.js +0 -107
- package/skills/planning.SKILL.md +0 -118
- package/skills/update-docs/index.js +0 -108
- package/skills/update-docs.SKILL.md +0 -66
- package/test-build.js +0 -29
- package/test-e2e.js +0 -117
- package/test-unified.js +0 -24
- package/test.js +0 -89
- package/update-docs.SKILL.md +0 -66
package/bin/plugkit.js
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
// Hot path: spawnSync to ~/.claude/gm-tools/plugkit.exe with inherited stdio.
|
|
4
|
+
// Cold path (session-start / prompt-submit OR missing binary): synchronously
|
|
5
|
+
// ensure gm-tools/plugkit{.exe} matches the pinned version, then run hook.
|
|
6
|
+
// Cache-aware: when local matches the pin (sha-checked), zero network calls.
|
|
7
|
+
|
|
8
|
+
const { spawnSync } = require('child_process');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
const os = require('os');
|
|
12
|
+
|
|
13
|
+
const wrapperDir = __dirname;
|
|
14
|
+
|
|
15
|
+
function toolsBin() {
|
|
16
|
+
const home = process.env.USERPROFILE || process.env.HOME || os.homedir();
|
|
17
|
+
const exe = process.platform === 'win32' ? 'plugkit.exe' : 'plugkit';
|
|
18
|
+
return path.join(home, '.claude', 'gm-tools', exe);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function sha256OfFileSync(filePath) {
|
|
22
|
+
try {
|
|
23
|
+
const crypto = require('crypto');
|
|
24
|
+
const h = crypto.createHash('sha256');
|
|
25
|
+
const fd = fs.openSync(filePath, 'r');
|
|
26
|
+
try {
|
|
27
|
+
const buf = Buffer.alloc(1 << 20);
|
|
28
|
+
let n;
|
|
29
|
+
while ((n = fs.readSync(fd, buf, 0, buf.length, null)) > 0) h.update(buf.subarray(0, n));
|
|
30
|
+
} finally { fs.closeSync(fd); }
|
|
31
|
+
return h.digest('hex');
|
|
32
|
+
} catch (_) { return null; }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function platformAsset() {
|
|
36
|
+
const p = process.platform;
|
|
37
|
+
const a = process.arch;
|
|
38
|
+
if (p === 'win32') return a === 'arm64' ? 'plugkit-win32-arm64.exe' : 'plugkit-win32-x64.exe';
|
|
39
|
+
if (p === 'darwin') return a === 'arm64' ? 'plugkit-darwin-arm64' : 'plugkit-darwin-x64';
|
|
40
|
+
return (a === 'arm64' || a === 'aarch64') ? 'plugkit-linux-arm64' : 'plugkit-linux-x64';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function readPinnedVersion() {
|
|
44
|
+
try { return fs.readFileSync(path.join(wrapperDir, 'plugkit.version'), 'utf8').trim(); } catch (_) { return null; }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function readExpectedSha() {
|
|
48
|
+
try {
|
|
49
|
+
const manifest = fs.readFileSync(path.join(wrapperDir, 'plugkit.sha256'), 'utf8');
|
|
50
|
+
for (const line of manifest.split(/\r?\n/)) {
|
|
51
|
+
const parts = line.trim().split(/\s+/);
|
|
52
|
+
if (parts.length >= 2 && parts[parts.length - 1].replace(/^\*/, '') === 'plugkit.wasm') {
|
|
53
|
+
return parts[0].toLowerCase();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
} catch (_) {}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Returns true if gm-tools WASM matches pinned version by sha. Fast: no network.
|
|
61
|
+
function isReady() {
|
|
62
|
+
const wasmBin = path.join(process.env.USERPROFILE || process.env.HOME || os.homedir(), '.claude', 'gm-tools', 'plugkit.wasm');
|
|
63
|
+
if (!fs.existsSync(wasmBin)) return false;
|
|
64
|
+
const expected = readExpectedSha();
|
|
65
|
+
if (!expected) return true;
|
|
66
|
+
const actual = sha256OfFileSync(wasmBin);
|
|
67
|
+
return actual && actual.toLowerCase() === expected;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Synchronously run bootstrap.js in a child node. Blocks until install finishes
|
|
71
|
+
// (or fails). Bootstrap itself is cache-aware: re-download only when sha differs
|
|
72
|
+
// from manifest. Wraps stdio:inherit so the user sees progress.
|
|
73
|
+
function ensureReady(silent) {
|
|
74
|
+
if (isReady()) return true;
|
|
75
|
+
const bootstrap = path.join(wrapperDir, 'bootstrap.js');
|
|
76
|
+
const r = spawnSync(process.execPath, [bootstrap], {
|
|
77
|
+
stdio: silent ? ['ignore', 'pipe', 'pipe'] : ['ignore', 'inherit', 'inherit'],
|
|
78
|
+
windowsHide: true,
|
|
79
|
+
});
|
|
80
|
+
return r.status === 0 && isReady();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function wasmPath() {
|
|
84
|
+
return path.join(wrapperDir, 'plugkit.wasm');
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function shouldUseWasm() {
|
|
88
|
+
if (process.env.GM_USE_WASM === '1') return true;
|
|
89
|
+
if (fs.existsSync(wasmPath())) return true;
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
async function runWasm(args) {
|
|
94
|
+
try {
|
|
95
|
+
const WasmHost = require('../lib/wasm-host');
|
|
96
|
+
const host = new WasmHost(wasmPath());
|
|
97
|
+
const verb = args[0] || 'health';
|
|
98
|
+
const body = args.slice(1).join(' ') || '{}';
|
|
99
|
+
const result = await host.dispatch(verb, body);
|
|
100
|
+
console.log(JSON.stringify(result, null, 2));
|
|
101
|
+
process.exit(result.ok ? 0 : 1);
|
|
102
|
+
} catch (err) {
|
|
103
|
+
console.error('[plugkit wasm]', err.message);
|
|
104
|
+
process.exit(1);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function main() {
|
|
109
|
+
const args = process.argv.slice(2);
|
|
110
|
+
const isHook = args[0] === 'hook';
|
|
111
|
+
const hookSubcmd = isHook ? (args[1] || '') : '';
|
|
112
|
+
|
|
113
|
+
if (shouldUseWasm()) {
|
|
114
|
+
return runWasm(args);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const blocksUntilReady = hookSubcmd === 'session-start' || hookSubcmd === 'prompt-submit';
|
|
118
|
+
|
|
119
|
+
if (blocksUntilReady) {
|
|
120
|
+
if (!ensureReady(false)) {
|
|
121
|
+
process.stderr.write('[plugkit] bootstrap failed; aborting hook\n');
|
|
122
|
+
process.exit(1);
|
|
123
|
+
}
|
|
124
|
+
return runWasm(args);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const wasmBin = path.join(process.env.USERPROFILE || process.env.HOME || os.homedir(), '.claude', 'gm-tools', 'plugkit.wasm');
|
|
128
|
+
if (!fs.existsSync(wasmBin)) {
|
|
129
|
+
if (isHook) process.exit(0);
|
|
130
|
+
process.exit(1);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
runWasm(args);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
main();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
4d744898fef1f053e8bd3deb25aa20f6dd0ccda639c835ba4132762c8bfb9ec2 plugkit.wasm
|
|
2
|
+
e5569efe81e4ef06c8349678253ca2845571495e619babb0a79be9268ea83c2a plugkit-win32-x64.exe
|
|
3
|
+
ce2f09f8ea0dd522345a9d9c3e5b04ba44bc37b2046d311d7ff1737f1b3fbf1a plugkit-win32-arm64.exe
|
|
4
|
+
a1a1d376986551828e5a39e4ae931accf66f00663aceac1439b2778cb4fffd27 plugkit-darwin-x64
|
|
5
|
+
7c36d730edab5cddf678211146ca670c9ce1def17d8b454234ce4bc04a4d7e85 plugkit-darwin-arm64
|
|
6
|
+
c9db60a399caf53c490dc08705713c7d83a1f62db057585a3950d64ab8fa449a plugkit-linux-x64
|
|
7
|
+
b9ebabaace995b1768d1d96ae13ca18a6dc5e2ca65b774fcdd457f069a7d115c plugkit-linux-arm64
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.1.366
|
package/bin/plugkit.wasm
ADDED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
99f4c28aa4fd06093dda231677569df8b60c801545dab2942acfd73459da88de plugkit.wasm
|
package/bin/rtk.sha256
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
53224d66572e937507a8d2877c768e4e6cc3da66aa6f8d0f132afaab2edc2a10 rtk-win32-x64.exe
|
|
2
|
+
dedabc1d89641c60c91f09570353b6270dba4f5d53f8597018a708e515265d53 rtk-win32-arm64.exe
|
|
3
|
+
cf3190554b82c7395948b7a478c78bbe2241549b00777e660deff4cbb9e0c4b6 rtk-darwin-x64
|
|
4
|
+
c815bad459b4eaccc8be4a5d74dba397fdfe7d3716e0b6023b188d2351128b82 rtk-darwin-arm64
|
|
5
|
+
7d60dd5abc15f6d46ffd89b5de7253a067e2a3ef6f1cd8ae5a236eda05a504f4 rtk-linux-x64
|
|
6
|
+
cd5dd78035845eef4b362927c61f61e23925af3c12779131024d8334bad87a6b rtk-linux-arm64
|
package/bin/rtk.version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.40.0
|