gm-gc 2.0.201 → 2.0.203

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 CHANGED
@@ -9,10 +9,10 @@ enforce: critical
9
9
 
10
10
  **Invoke the `gm` skill immediately.** Use the Skill tool with `skill: "gm"`.
11
11
 
12
- **CRITICAL: Skills are invoked via the Skill tool ONLY. Do NOT use the Agent tool to load skills. Skills are not agents. Use: `Skill tool` with `skill: "gm"` (or `"planning"`, `"gm-execute"`, `"gm-emit"`, `"gm-complete"`). Using the Agent tool for skills is a violation.**
12
+ **CRITICAL: Skills are invoked via the Skill tool ONLY. Do NOT use the Agent tool to load skills. Skills are not agents. Use: `Skill tool` with `skill: "gm"` (or `"planning"`, `"gm-execute"`, `"gm-emit"`, `"gm-complete"`, `"update-docs"`). Using the Agent tool for skills is a violation.**
13
13
 
14
14
  All work coordination, planning, execution, and verification happens through the skill tree:
15
- - `gm` skill → `planning` skill → `gm-execute` skill → `gm-emit` skill → `gm-complete` skill
15
+ - `gm` skill → `planning` skill → `gm-execute` skill → `gm-emit` skill → `gm-complete` skill → `update-docs` skill
16
16
 
17
17
  All code execution uses `exec:<lang>` via the Bash tool — never direct `Bash(node ...)` or `Bash(npm ...)`.
18
18
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.201",
3
+ "version": "2.0.203",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "homepage": "https://github.com/AnEntrypoint/gm",
@@ -2,7 +2,44 @@
2
2
 
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
- const { execSync } = require('child_process');
5
+ const os = require('os');
6
+ const { spawnSync } = require('child_process');
7
+
8
+ const IS_WIN = process.platform === 'win32';
9
+ const TOOLS_DIR = path.join(os.homedir(), '.claude', 'gm-tools');
10
+
11
+ function localBin(name) {
12
+ const ext = IS_WIN ? '.exe' : '';
13
+ return path.join(TOOLS_DIR, 'node_modules', '.bin', name + ext);
14
+ }
15
+
16
+ function runLocal(name, args, opts = {}) {
17
+ const bin = localBin(name);
18
+ if (fs.existsSync(bin)) {
19
+ return spawnSync(bin, args, { encoding: 'utf8', windowsHide: true, timeout: 30000, ...opts });
20
+ }
21
+ return spawnSync('bun', ['x', name, ...args], { encoding: 'utf8', windowsHide: true, timeout: 30000, ...opts });
22
+ }
23
+
24
+ const MANAGED_PKGS = ['gm-exec', 'codebasesearch', 'mcp-thorns', 'agent-browser'];
25
+ const PKG_JSON = path.join(TOOLS_DIR, 'package.json');
26
+
27
+ function ensureTools() {
28
+ try { fs.mkdirSync(TOOLS_DIR, { recursive: true }); } catch {}
29
+ if (!fs.existsSync(PKG_JSON)) {
30
+ try { fs.writeFileSync(PKG_JSON, JSON.stringify({ name: 'gm-tools', version: '1.0.0', private: true })); } catch {}
31
+ }
32
+ const missing = MANAGED_PKGS.filter(p => !fs.existsSync(localBin(p)));
33
+ if (missing.length > 0) {
34
+ try {
35
+ spawnSync('bun', ['add', ...missing.map(p => p + '@latest')], {
36
+ cwd: TOOLS_DIR, encoding: 'utf8', timeout: 180000, windowsHide: true
37
+ });
38
+ } catch {}
39
+ }
40
+ }
41
+
42
+ ensureTools();
6
43
 
7
44
  const projectDir = process.env.CLAUDE_PROJECT_DIR || process.env.GEMINI_PROJECT_DIR || process.env.OC_PROJECT_DIR || process.env.KILO_PROJECT_DIR;
8
45
 
@@ -33,28 +70,12 @@ try {
33
70
 
34
71
  if (projectDir && fs.existsSync(projectDir)) {
35
72
  try {
36
- let thornOutput;
37
- try {
38
- thornOutput = execSync(`bun x mcp-thorns@latest`, {
39
- encoding: 'utf-8',
40
- stdio: ['pipe', 'pipe', 'pipe'],
41
- cwd: projectDir,
42
- timeout: 15000,
43
- killSignal: 'SIGTERM'
44
- });
45
- } catch (bunErr) {
46
- thornOutput = bunErr.killed
47
- ? '=== mcp-thorns ===\nSkipped (timeout)'
48
- : `=== mcp-thorns ===\nSkipped (error: ${bunErr.message.split('\n')[0]})`;
49
- }
50
- outputs.push(`=== This is your initial insight of the repository, look at every possible aspect of this for initial opinionation and to offset the need for code exploration ===\n${thornOutput}`);
51
- } catch (e) {
52
- if (e.killed && e.signal === 'SIGTERM') {
53
- outputs.push(`=== mcp-thorns ===\nSkipped (3min timeout)`);
54
- } else {
55
- outputs.push(`=== mcp-thorns ===\nSkipped (error: ${e.message.split('\n')[0]})`);
73
+ const r = runLocal('mcp-thorns', [projectDir], { timeout: 15000 });
74
+ const thornOutput = ((r.stdout || '') + (r.stderr || '')).trim();
75
+ if (thornOutput) {
76
+ outputs.push(`=== This is your initial insight of the repository, look at every possible aspect of this for initial opinionation and to offset the need for code exploration ===\n${thornOutput}`);
56
77
  }
57
- }
78
+ } catch (e) {}
58
79
  }
59
80
  const additionalContext = outputs.join('\n\n');
60
81
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-gc",
3
- "version": "2.0.201",
3
+ "version": "2.0.203",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",