gm-copilot-cli 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
  repository: https://github.com/AnEntrypoint/gm-copilot-cli
@@ -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/index.html CHANGED
@@ -18,7 +18,7 @@
18
18
  <script type="module">
19
19
  import { createElement as h, applyDiff, Fragment } from "webjsx";
20
20
  const PLATFORM_NAME="Copilot CLI",PLATFORM_TYPE="CLI Tool",PLATFORM_TYPE_COLOR="#3b82f6";
21
- const DESCRIPTION="State machine agent with hooks, skills, and automated git enforcement",VERSION="2.0.201";
21
+ const DESCRIPTION="State machine agent with hooks, skills, and automated git enforcement",VERSION="2.0.203";
22
22
  const GITHUB_URL="https://github.com/AnEntrypoint/gm-copilot-cli",BADGE_LABEL="copilot-cli";
23
23
  const FEATURES=[{"title":"State Machine","desc":"Immutable PLAN→EXECUTE→EMIT→VERIFY→COMPLETE phases with full mutable tracking"},{"title":"Semantic Search","desc":"Natural language codebase exploration via codesearch skill — no grep needed"},{"title":"Hooks","desc":"Pre-tool, session-start, prompt-submit, and stop hooks for full lifecycle control"},{"title":"Agents","desc":"gm, codesearch, and websearch agents pre-configured and ready to use"},{"title":"MCP Integration","desc":"Model Context Protocol server support built in"},{"title":"Auto-Recovery","desc":"Supervisor hierarchy ensures the system never crashes"}],INSTALL_STEPS=[{"desc":"Install via GitHub CLI","cmd":"gh extension install AnEntrypoint/gm-copilot-cli"},{"desc":"Restart your terminal — activates automatically"}];
24
24
  const CURRENT_PLATFORM="gm-copilot-cli";
package/manifest.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  name: gm
2
- version: 2.0.201
2
+ version: 2.0.203
3
3
  description: State machine agent with hooks, skills, and automated git enforcement
4
4
  author: AnEntrypoint
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-copilot-cli",
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",
@@ -15,7 +15,7 @@ You think in state, not prose. You are the root orchestrator of all work in this
15
15
 
16
16
  ## THE STATE MACHINE
17
17
 
18
- `PLAN → EXECUTE → EMIT → VERIFY → COMPLETE`
18
+ `PLAN → EXECUTE → EMIT → VERIFY → UPDATE-DOCS → COMPLETE`
19
19
 
20
20
  **FORWARD (ladders)**:
21
21
  - PLAN complete → invoke `gm-execute` skill
@@ -98,6 +98,7 @@ Invoke `agent-browser` skill. Escalation — exhaust each before advancing:
98
98
  **`gm-execute`** — Resolve all mutables via witnessed execution.
99
99
  **`gm-emit`** — Write files to disk when all mutables resolved.
100
100
  **`gm-complete`** — End-to-end verification and git enforcement.
101
+ **`update-docs`** — Refresh README, CLAUDE.md, and docs to reflect session changes. Invoked by `gm-complete`.
101
102
  **`agent-browser`** — Browser automation. Invoke inside EXECUTE for all browser/UI work.
102
103
 
103
104
  ## CONSTRAINTS
@@ -7,14 +7,14 @@ description: VERIFY and COMPLETE phase. End-to-end system verification and git e
7
7
 
8
8
  You are in the **VERIFY → COMPLETE** phase. Files are written. Prove the whole system works end-to-end. Any new unknown = snake to `planning`, restart chain.
9
9
 
10
- **GRAPH POSITION**: `PLAN → EXECUTE → EMIT → [VERIFY → COMPLETE]`
10
+ **GRAPH POSITION**: `PLAN → EXECUTE → EMIT → [VERIFY]UPDATE-DOCS → COMPLETE`
11
11
  - **Entry**: All EMIT gates passed. Entered from `gm-emit`.
12
12
 
13
13
  ## TRANSITIONS
14
14
 
15
15
  **FORWARD**:
16
16
  - .prd items remain → invoke `gm-execute` skill (next wave)
17
- - .prd empty + git clean + all pushed → COMPLETE
17
+ - .prd empty + feature work pushed → invoke `update-docs` skill
18
18
 
19
19
  **BACKWARD**:
20
20
  - Verification reveals broken file output → invoke `gm-emit` skill, fix, re-verify, return
@@ -91,7 +91,7 @@ All of: witnessed end-to-end output | all failure paths exercised | .prd empty |
91
91
  ---
92
92
 
93
93
  **→ FORWARD**: .prd items remain → invoke `gm-execute` skill.
94
- **→ DONE**: .prd empty + git cleanCOMPLETE.
94
+ **→ FORWARD**: .prd empty + feature work pushed invoke `update-docs` skill.
95
95
  **↩ SNAKE to EMIT**: file output wrong → invoke `gm-emit` skill.
96
96
  **↩ SNAKE to EXECUTE**: logic wrong → invoke `gm-execute` skill.
97
97
  **↩ SNAKE to PLAN**: new unknown or wrong requirements → invoke `planning` skill, restart chain.
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: update-docs
3
+ description: UPDATE-DOCS phase. Refresh README.md, CLAUDE.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 — Documentation Refresh
7
+
8
+ You are in the **UPDATE-DOCS** phase. Feature work is verified and pushed. Refresh all documentation to match the actual codebase state right now.
9
+
10
+ **GRAPH POSITION**: `PLAN → EXECUTE → EMIT → VERIFY → [UPDATE-DOCS] → COMPLETE`
11
+ - **Entry**: Feature work verified, committed, and pushed. Entered from `gm-complete`.
12
+
13
+ ## TRANSITIONS
14
+
15
+ **FORWARD**: All docs updated, committed, and pushed → COMPLETE (session ends)
16
+
17
+ **BACKWARD**:
18
+ - Diff reveals unknown architecture change → invoke `planning` skill, restart chain
19
+ - Doc write fails post-emit verify → fix and re-verify before advancing
20
+
21
+ ## EXECUTION SEQUENCE
22
+
23
+ **Step 1 — Understand what changed**:
24
+
25
+ ```
26
+ exec:bash
27
+ git log -5 --oneline
28
+ git diff HEAD~1 --stat
29
+ ```
30
+
31
+ Witness which files changed. Identify doc-sensitive changes: new skills, new states in the state machine, new platforms, modified architecture, new constraints, renamed files.
32
+
33
+ **Step 2 — Read current docs**:
34
+
35
+ ```
36
+ exec:nodejs
37
+ const fs = require('fs');
38
+ ['README.md', 'CLAUDE.md', 'docs/index.html',
39
+ 'plugforge-starter/agents/gm.md'].forEach(f => {
40
+ try { console.log(`=== ${f} ===\n` + fs.readFileSync(f, 'utf8')); }
41
+ catch(e) { console.log(`MISSING: ${f}`); }
42
+ });
43
+ ```
44
+
45
+ Identify every section that no longer matches the actual codebase state.
46
+
47
+ **Step 3 — Write updated docs**:
48
+
49
+ Write only sections that changed. Do not rewrite unchanged content. Rules per file:
50
+
51
+ **README.md**: platform count matches adapters in `platforms/`, skill tree diagram matches current state machine, quick start commands work.
52
+
53
+ **CLAUDE.md**: Architecture section reflects actual class hierarchy. File structure section matches actual directory layout. Known gotchas reflect actual observed edge cases. Verification checklist reflects actual completed items.
54
+
55
+ **docs/index.html**: `PHASES` array matches current skill state machine phases. Platform lists match `platforms/` directory. State machine diagram updated if new phases added.
56
+
57
+ **plugforge-starter/agents/gm.md**: Skill chain on the `gm skill →` line updated if new skills were added.
58
+
59
+ ```
60
+ exec:nodejs
61
+ const fs = require('fs');
62
+ fs.writeFileSync('/abs/path/file.md', updatedContent);
63
+ ```
64
+
65
+ **Step 4 — Verify from disk**:
66
+
67
+ ```
68
+ exec:nodejs
69
+ const fs = require('fs');
70
+ const content = fs.readFileSync('/abs/path/file.md', 'utf8');
71
+ console.log(content.includes('expectedString'), content.length);
72
+ ```
73
+
74
+ Witness each written file from disk. Any variance from expected content → fix and re-verify.
75
+
76
+ **Step 5 — Commit and push**:
77
+
78
+ ```
79
+ exec:bash
80
+ git add README.md CLAUDE.md docs/index.html plugforge-starter/agents/gm.md
81
+ git diff --cached --stat
82
+ ```
83
+
84
+ Witness staged files. Then commit and push:
85
+
86
+ ```
87
+ exec:bash
88
+ git commit -m "docs: update documentation to reflect session changes"
89
+ git push -u origin HEAD
90
+ ```
91
+
92
+ Witness push confirmation. Zero variance = COMPLETE.
93
+
94
+ ## DOC FIDELITY RULES
95
+
96
+ Every claim in docs must be verifiable against disk right now:
97
+ - State machine phase names must match skill file `name:` frontmatter
98
+ - Platform names must match adapter class names in `platforms/`
99
+ - File paths must exist on disk
100
+ - Constraint counts must match actual constraints
101
+
102
+ If a doc section cannot be verified against disk: remove it, do not speculate.
103
+
104
+ ## CONSTRAINTS
105
+
106
+ **Never**: skip diff analysis | write docs from memory alone | push without verifying from disk | add comments to doc content | claim done without witnessed push output
107
+
108
+ **Always**: witness git diff first | read current file before overwriting | verify each file from disk after write | push doc changes | confirm with witnessed push output
109
+
110
+ ---
111
+
112
+ **→ COMPLETE**: Docs committed and pushed → session ends.
113
+ **↩ SNAKE to PLAN**: New unknown about codebase state → invoke `planning` skill.
package/tools.json CHANGED
@@ -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
  "tools": [
6
6
  {