gm-skill 2.0.1285 → 2.0.1287

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/README.md CHANGED
@@ -35,7 +35,7 @@ An earlier generation fanned out fifteen per-platform downstream repos (gm-cc, g
35
35
 
36
36
  ## Version
37
37
 
38
- `2.0.1285` — auto-bumped from the canonical `gm` repo. Every push to `AnEntrypoint/gm` (or any cascading sibling crate) republishes this package.
38
+ `2.0.1287` — auto-bumped from the canonical `gm` repo. Every push to `AnEntrypoint/gm` (or any cascading sibling crate) republishes this package.
39
39
 
40
40
  ## Source of truth
41
41
 
package/bin/bootstrap.js CHANGED
@@ -17,6 +17,102 @@ function log(msg) {
17
17
  try { process.stderr.write(`[plugkit-bootstrap] ${msg}\n`); } catch (_) {}
18
18
  }
19
19
 
20
+ function ensureSkillMdCurrent(wrapperDir) {
21
+ try {
22
+ const candidates = [
23
+ path.join(wrapperDir, '..', 'skills', 'gm-skill', 'SKILL.md'),
24
+ path.join(wrapperDir, '..', '..', 'skills', 'gm-skill', 'SKILL.md'),
25
+ path.join(wrapperDir, '..', 'SKILL.md'),
26
+ ];
27
+ const bundledPath = candidates.find(p => { try { return fs.existsSync(p); } catch (_) { return false; } });
28
+ if (!bundledPath) return { skipped: 'bundled-not-found' };
29
+ const bundled = fs.readFileSync(bundledPath, 'utf8');
30
+ const bundledHash = crypto.createHash('sha256').update(bundled).digest('hex');
31
+ const home = os.homedir();
32
+ const targets = [
33
+ path.join(home, '.agents', 'skills', 'gm-skill', 'SKILL.md'),
34
+ path.join(home, '.claude', 'skills', 'gm-skill', 'SKILL.md'),
35
+ ];
36
+ const refreshed = [];
37
+ for (const target of targets) {
38
+ try {
39
+ let needsWrite = true;
40
+ if (fs.existsSync(target)) {
41
+ const existing = fs.readFileSync(target, 'utf8');
42
+ const existingHash = crypto.createHash('sha256').update(existing).digest('hex');
43
+ if (existingHash === bundledHash) needsWrite = false;
44
+ }
45
+ if (needsWrite) {
46
+ fs.mkdirSync(path.dirname(target), { recursive: true });
47
+ const tmp = target + '.tmp';
48
+ fs.writeFileSync(tmp, bundled);
49
+ fs.renameSync(tmp, target);
50
+ refreshed.push(target);
51
+ }
52
+ } catch (e) {
53
+ obsEvent('bootstrap', 'skill-md.refresh.target-failed', { target, error: e.message });
54
+ }
55
+ }
56
+ if (refreshed.length > 0) {
57
+ log(`SKILL.md refreshed (sha=${bundledHash.slice(0, 12)}): ${refreshed.join(', ')}`);
58
+ obsEvent('bootstrap', 'skill-md.refreshed', { hash: bundledHash.slice(0, 12), targets: refreshed });
59
+ }
60
+ return { refreshed, bundledHash };
61
+ } catch (e) {
62
+ obsEvent('bootstrap', 'skill-md.refresh.failed', { error: e.message });
63
+ return { error: e.message };
64
+ }
65
+ }
66
+
67
+ function ensureNextStepWiring(cwd) {
68
+ const changes = [];
69
+ const gmDir = path.join(cwd, '.gm');
70
+ try { fs.mkdirSync(gmDir, { recursive: true }); }
71
+ catch (e) { obsEvent('bootstrap', 'next-step.wiring.target-failed', { target: gmDir, error: e.message }); }
72
+
73
+ const nextStepPath = path.join(gmDir, 'next-step.md');
74
+ const nextStepBody = '# Next step\n\nDispatch the `instruction` verb to plugkit by writing `.gm/exec-spool/in/instruction/<N>.txt` (any unique N) with body `{}` (or `{"prompt":"<user request>"}` on the first dispatch of the turn). Read the response from `.gm/exec-spool/out/<N>.json` and follow the imperative in the `instruction` field.\n\nThis file is auto-rewritten by plugkit on every instruction dispatch.\n';
75
+ try {
76
+ if (!fs.existsSync(nextStepPath)) {
77
+ fs.writeFileSync(nextStepPath, nextStepBody);
78
+ changes.push('seeded .gm/next-step.md');
79
+ }
80
+ } catch (e) { obsEvent('bootstrap', 'next-step.wiring.target-failed', { target: nextStepPath, error: e.message }); }
81
+
82
+ const claudeMdPath = path.join(cwd, 'CLAUDE.md');
83
+ try {
84
+ if (!fs.existsSync(claudeMdPath)) {
85
+ fs.writeFileSync(claudeMdPath, '@AGENTS.md\n');
86
+ changes.push('created CLAUDE.md');
87
+ } else {
88
+ const cur = fs.readFileSync(claudeMdPath, 'utf8');
89
+ const hasLine = cur.split(/\r?\n/).some(l => l.trim() === '@AGENTS.md');
90
+ if (!hasLine) {
91
+ fs.writeFileSync(claudeMdPath, '@AGENTS.md\n' + cur);
92
+ changes.push('prepended @AGENTS.md to CLAUDE.md');
93
+ }
94
+ }
95
+ } catch (e) { obsEvent('bootstrap', 'next-step.wiring.target-failed', { target: claudeMdPath, error: e.message }); }
96
+
97
+ const agentsMdPath = path.join(cwd, 'AGENTS.md');
98
+ try {
99
+ if (fs.existsSync(agentsMdPath)) {
100
+ const cur = fs.readFileSync(agentsMdPath, 'utf8');
101
+ const hasLine = cur.split(/\r?\n/).some(l => l.trim() === '@.gm/next-step.md');
102
+ if (!hasLine) {
103
+ const sep = cur.endsWith('\n') ? '' : '\n';
104
+ fs.writeFileSync(agentsMdPath, cur + sep + '\n@.gm/next-step.md\n');
105
+ changes.push('appended @.gm/next-step.md to AGENTS.md');
106
+ }
107
+ }
108
+ } catch (e) { obsEvent('bootstrap', 'next-step.wiring.target-failed', { target: agentsMdPath, error: e.message }); }
109
+
110
+ if (changes.length > 0) {
111
+ log(`next-step wiring: ${changes.join(', ')}`);
112
+ obsEvent('bootstrap', 'next-step.wiring.applied', { changes });
113
+ }
114
+ }
115
+
20
116
  // Resolve a bare command name to its actual .exe on Windows. cmd.exe + .cmd
21
117
  // shim chains re-enter conhost (visible window flash) even with
22
118
  // windowsHide:true on the parent. Spawning the real .exe directly lets
@@ -355,6 +451,8 @@ function pruneOldVersions(root, keepVersion, keepRtkVersion) {
355
451
  async function bootstrap(opts) {
356
452
  opts = opts || {};
357
453
  const wrapperDir = opts.wrapperDir || __dirname;
454
+ try { ensureSkillMdCurrent(wrapperDir); } catch (_) {}
455
+ try { ensureNextStepWiring(process.cwd()); } catch (_) {}
358
456
  const version = opts.version || readVersionFile(wrapperDir);
359
457
  const shaManifest = readShaManifest(wrapperDir);
360
458
  const wasmName = 'plugkit.wasm';
@@ -1 +1 @@
1
- 0.1.476
1
+ 0.1.477
package/bin/plugkit.wasm CHANGED
Binary file
@@ -1 +1 @@
1
- 627006998cb293c98a69e06affaeace13a996e69c08cb63b44362b7a630ffc5e plugkit.wasm
1
+ 250e13e0c1b802f74a3130d14d7d71634d5043f902f617c9e977f30fee5bc157 plugkit.wasm
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1285",
3
+ "version": "2.0.1287",
4
4
  "description": "Spool-dispatch orchestration engine with unified state machine, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
@@ -17,5 +17,5 @@
17
17
  "publishConfig": {
18
18
  "access": "public"
19
19
  },
20
- "plugkitVersion": "0.1.476"
20
+ "plugkitVersion": "0.1.477"
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-skill",
3
- "version": "2.0.1285",
3
+ "version": "2.0.1287",
4
4
  "description": "Canonical universal harness — AI-native software engineering via skill-driven orchestration; bootstraps plugkit for task execution and session isolation. Install in any AI coding agent host.",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
@@ -39,7 +39,7 @@
39
39
  "gm.json"
40
40
  ],
41
41
  "dependencies": {
42
- "gm-plugkit": "^2.0.1285"
42
+ "gm-plugkit": "^2.0.1287"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=16.0.0"