gm-cc 2.0.616 → 2.0.618
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/.claude-plugin/marketplace.json +1 -1
- package/hooks/hooks.json +12 -2
- package/hooks/pre-tool-use-hook.js +30 -0
- package/hooks/prompt-submit-hook.js +12 -0
- package/package.json +1 -1
- package/plugin.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "AnEntrypoint"
|
|
5
5
|
},
|
|
6
6
|
"description": "State machine agent with hooks, skills, and automated git enforcement",
|
|
7
|
-
"version": "2.0.
|
|
7
|
+
"version": "2.0.618",
|
|
8
8
|
"metadata": {
|
|
9
9
|
"description": "State machine agent with hooks, skills, and automated git enforcement"
|
|
10
10
|
},
|
package/hooks/hooks.json
CHANGED
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
"type": "command",
|
|
10
10
|
"command": "node ${CLAUDE_PLUGIN_ROOT}/bin/plugkit.js hook pre-tool-use",
|
|
11
11
|
"timeout": 3600
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"type": "command",
|
|
15
|
+
"command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/pre-tool-use-hook.js",
|
|
16
|
+
"timeout": 2000
|
|
12
17
|
}
|
|
13
18
|
]
|
|
14
19
|
}
|
|
@@ -33,6 +38,11 @@
|
|
|
33
38
|
"type": "command",
|
|
34
39
|
"command": "node ${CLAUDE_PLUGIN_ROOT}/bin/plugkit.js hook prompt-submit",
|
|
35
40
|
"timeout": 60000
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"type": "command",
|
|
44
|
+
"command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/prompt-submit-hook.js",
|
|
45
|
+
"timeout": 3000
|
|
36
46
|
}
|
|
37
47
|
]
|
|
38
48
|
}
|
|
@@ -56,12 +66,12 @@
|
|
|
56
66
|
{
|
|
57
67
|
"type": "command",
|
|
58
68
|
"command": "node ${CLAUDE_PLUGIN_ROOT}/bin/plugkit.js hook stop",
|
|
59
|
-
"timeout":
|
|
69
|
+
"timeout": 15000
|
|
60
70
|
},
|
|
61
71
|
{
|
|
62
72
|
"type": "command",
|
|
63
73
|
"command": "node ${CLAUDE_PLUGIN_ROOT}/bin/plugkit.js hook stop-git",
|
|
64
|
-
"timeout":
|
|
74
|
+
"timeout": 180000
|
|
65
75
|
}
|
|
66
76
|
]
|
|
67
77
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const input = JSON.parse(process.env.CLAUDE_HOOK_INPUT || '{}');
|
|
5
|
+
const toolName = input.tool_name || input.tool_use?.name || '';
|
|
6
|
+
const toolInput = input.tool_input || input.tool_use?.input || {};
|
|
7
|
+
const gmDir = path.join(process.cwd(), '.gm');
|
|
8
|
+
const needsGmPath = path.join(gmDir, 'needs-gm');
|
|
9
|
+
const lastskillPath = path.join(gmDir, 'lastskill');
|
|
10
|
+
if (toolName === 'Skill' && toolInput.skill) {
|
|
11
|
+
try {
|
|
12
|
+
if (!fs.existsSync(gmDir)) fs.mkdirSync(gmDir, { recursive: true });
|
|
13
|
+
fs.writeFileSync(lastskillPath, toolInput.skill, 'utf8');
|
|
14
|
+
if (toolInput.skill === 'gm') {
|
|
15
|
+
try { fs.unlinkSync(needsGmPath); } catch (_) {}
|
|
16
|
+
}
|
|
17
|
+
} catch (_) {}
|
|
18
|
+
process.exit(0);
|
|
19
|
+
}
|
|
20
|
+
if (fs.existsSync(needsGmPath)) {
|
|
21
|
+
process.stdout.write(JSON.stringify({ decision: 'block', reason: 'HARD CONSTRAINT: invoke the Skill tool with skill: "gm" before any other tool. The gm skill must be the first action after every user message.' }));
|
|
22
|
+
process.exit(0);
|
|
23
|
+
}
|
|
24
|
+
const lastSkill = (() => { try { return fs.readFileSync(lastskillPath, 'utf8').trim(); } catch (_) { return ''; } })();
|
|
25
|
+
const isFileEdit = ['Write', 'Edit', 'NotebookEdit'].includes(toolName);
|
|
26
|
+
const WRITE_BLOCKED_PHASES = new Set(['gm-complete', 'update-docs']);
|
|
27
|
+
if (isFileEdit && WRITE_BLOCKED_PHASES.has(lastSkill)) {
|
|
28
|
+
process.stdout.write(JSON.stringify({ decision: 'block', reason: 'File edits are not permitted in ' + lastSkill + ' phase. Regress to gm-execute if changes are needed, or invoke gm-emit to re-emit.' }));
|
|
29
|
+
process.exit(0);
|
|
30
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const gmDir = path.join(process.cwd(), '.gm');
|
|
5
|
+
try {
|
|
6
|
+
if (!fs.existsSync(gmDir)) fs.mkdirSync(gmDir, { recursive: true });
|
|
7
|
+
fs.writeFileSync(path.join(gmDir, 'needs-gm'), '1', 'utf8');
|
|
8
|
+
} catch (_) {}
|
|
9
|
+
const response = {
|
|
10
|
+
systemMessage: 'BLOCKING REQUIREMENT — READ THIS FIRST: Your VERY FIRST action on EVERY user message MUST be to invoke the Skill tool with skill: "gm". Do NOT read files, do NOT search, do NOT answer, do NOT plan, do NOT use any other tool before invoking skill: "gm". This is non-negotiable. If you respond without invoking gm first, you are violating a hard constraint.\n\nUse gm for ALL work. Spawn subagents (Agent tool) for every independent unit of work — parallel subagents are always preferred over sequential execution. Never do work yourself that a subagent could do in parallel.'
|
|
11
|
+
};
|
|
12
|
+
process.stdout.write(JSON.stringify(response));
|
package/package.json
CHANGED