gm-codex 2.0.25 → 2.0.27
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/.editorconfig +12 -0
- package/.gitignore +13 -0
- package/CONTRIBUTING.md +26 -0
- package/cli.js +0 -8
- package/package.json +9 -2
- package/plugin.json +1 -1
- package/scripts/postinstall.js +138 -0
- package/skills/agent-browser/SKILL.md +512 -0
- package/skills/code-search/SKILL.md +32 -0
- package/skills/dev/SKILL.md +48 -0
- package/skills/gm/SKILL.md +377 -0
- package/skills/planning/SKILL.md +335 -0
package/.editorconfig
ADDED
package/.gitignore
ADDED
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Please ensure all code follows the conventions established in this project.
|
|
4
|
+
|
|
5
|
+
## Before Committing
|
|
6
|
+
|
|
7
|
+
Run the build to verify everything is working:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm run build plugforge-starter [output-dir]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Platform Conventions
|
|
14
|
+
|
|
15
|
+
- Each platform adapter in `platforms/` extends PlatformAdapter or CLIAdapter
|
|
16
|
+
- File generation logic goes in `createFileStructure()`
|
|
17
|
+
- Use TemplateBuilder methods for shared generation logic
|
|
18
|
+
- Skills are auto-discovered from plugforge-starter/skills/
|
|
19
|
+
|
|
20
|
+
## Testing
|
|
21
|
+
|
|
22
|
+
Build all 9 platform outputs:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
node cli.js plugforge-starter /tmp/test-build
|
|
26
|
+
```
|
package/cli.js
CHANGED
|
@@ -36,14 +36,6 @@ try {
|
|
|
36
36
|
|
|
37
37
|
filesToCopy.forEach(([src, dst]) => copyRecursive(path.join(srcDir, src), path.join(destDir, dst)));
|
|
38
38
|
|
|
39
|
-
// Install skills globally via the skills package (supports all agents)
|
|
40
|
-
const { execSync } = require('child_process');
|
|
41
|
-
try {
|
|
42
|
-
execSync('bunx skills add AnEntrypoint/plugforge --full-depth --all --global --yes', { stdio: 'inherit' });
|
|
43
|
-
} catch (e) {
|
|
44
|
-
console.warn('Warning: skills install failed (non-fatal):', e.message);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
39
|
const destPath = process.platform === 'win32'
|
|
48
40
|
? destDir.replace(/\\/g, '/')
|
|
49
41
|
: destDir;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-codex",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.27",
|
|
4
4
|
"description": "State machine agent with hooks, skills, and automated git enforcement",
|
|
5
5
|
"author": "AnEntrypoint",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,17 +26,24 @@
|
|
|
26
26
|
"files": [
|
|
27
27
|
"hooks/",
|
|
28
28
|
"agents/",
|
|
29
|
+
"skills/",
|
|
30
|
+
"scripts/",
|
|
29
31
|
".github/",
|
|
30
32
|
"README.md",
|
|
31
33
|
"CLAUDE.md",
|
|
32
34
|
".mcp.json",
|
|
33
35
|
"plugin.json",
|
|
34
36
|
"cli.js",
|
|
37
|
+
"install.js",
|
|
35
38
|
"pre-tool-use-hook.js",
|
|
36
39
|
"session-start-hook.js",
|
|
37
40
|
"prompt-submit-hook.js",
|
|
38
41
|
"stop-hook.js",
|
|
39
|
-
"stop-hook-git.js"
|
|
42
|
+
"stop-hook-git.js",
|
|
43
|
+
"LICENSE",
|
|
44
|
+
".gitignore",
|
|
45
|
+
".editorconfig",
|
|
46
|
+
"CONTRIBUTING.md"
|
|
40
47
|
],
|
|
41
48
|
"keywords": [
|
|
42
49
|
"codex",
|
package/plugin.json
CHANGED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Postinstall script for gm-cc
|
|
8
|
+
* Implements Mode 1: Standalone .claude/ directory installation
|
|
9
|
+
*
|
|
10
|
+
* When installed via npm in a project:
|
|
11
|
+
* - Copies agents/, hooks/, .mcp.json to project's .claude/
|
|
12
|
+
* - Updates .gitignore with .gm-stop-verified
|
|
13
|
+
* - Runs silently, never breaks npm install
|
|
14
|
+
* - Safe to run multiple times (idempotent)
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
function isInsideNodeModules() {
|
|
18
|
+
// Check if __dirname contains /node_modules/ in its path
|
|
19
|
+
// Example: /project/node_modules/gm-cc/scripts
|
|
20
|
+
return __dirname.includes(path.sep + 'node_modules' + path.sep);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function getProjectRoot() {
|
|
24
|
+
// From /project/node_modules/gm-cc/scripts
|
|
25
|
+
// Navigate to /project
|
|
26
|
+
if (!isInsideNodeModules()) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Find the node_modules parent (project root)
|
|
31
|
+
let current = __dirname;
|
|
32
|
+
while (current !== path.dirname(current)) { // While not at root
|
|
33
|
+
current = path.dirname(current);
|
|
34
|
+
const parent = path.dirname(current);
|
|
35
|
+
if (path.basename(current) === 'node_modules') {
|
|
36
|
+
return parent;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function safeCopyFile(src, dst) {
|
|
43
|
+
try {
|
|
44
|
+
const content = fs.readFileSync(src, 'utf-8');
|
|
45
|
+
const dstDir = path.dirname(dst);
|
|
46
|
+
if (!fs.existsSync(dstDir)) {
|
|
47
|
+
fs.mkdirSync(dstDir, { recursive: true });
|
|
48
|
+
}
|
|
49
|
+
fs.writeFileSync(dst, content, 'utf-8');
|
|
50
|
+
return true;
|
|
51
|
+
} catch (err) {
|
|
52
|
+
// Silently skip errors
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function safeCopyDirectory(src, dst) {
|
|
58
|
+
try {
|
|
59
|
+
if (!fs.existsSync(src)) {
|
|
60
|
+
return false; // Source doesn't exist, skip
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
fs.mkdirSync(dst, { recursive: true });
|
|
64
|
+
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
65
|
+
|
|
66
|
+
entries.forEach(entry => {
|
|
67
|
+
const srcPath = path.join(src, entry.name);
|
|
68
|
+
const dstPath = path.join(dst, entry.name);
|
|
69
|
+
|
|
70
|
+
if (entry.isDirectory()) {
|
|
71
|
+
safeCopyDirectory(srcPath, dstPath);
|
|
72
|
+
} else if (entry.isFile()) {
|
|
73
|
+
safeCopyFile(srcPath, dstPath);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
return true;
|
|
77
|
+
} catch (err) {
|
|
78
|
+
// Silently skip errors
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function updateGitignore(projectRoot) {
|
|
84
|
+
try {
|
|
85
|
+
const gitignorePath = path.join(projectRoot, '.gitignore');
|
|
86
|
+
const entry = '.gm-stop-verified';
|
|
87
|
+
|
|
88
|
+
// Read existing content
|
|
89
|
+
let content = '';
|
|
90
|
+
if (fs.existsSync(gitignorePath)) {
|
|
91
|
+
content = fs.readFileSync(gitignorePath, 'utf-8');
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Check if entry already exists
|
|
95
|
+
if (content.includes(entry)) {
|
|
96
|
+
return true; // Already there
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Append entry
|
|
100
|
+
if (content && !content.endsWith('\n')) {
|
|
101
|
+
content += '\n';
|
|
102
|
+
}
|
|
103
|
+
content += entry + '\n';
|
|
104
|
+
|
|
105
|
+
fs.writeFileSync(gitignorePath, content, 'utf-8');
|
|
106
|
+
return true;
|
|
107
|
+
} catch (err) {
|
|
108
|
+
// Silently skip errors
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function install() {
|
|
114
|
+
// Only run if inside node_modules
|
|
115
|
+
if (!isInsideNodeModules()) {
|
|
116
|
+
return; // Silent exit
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const projectRoot = getProjectRoot();
|
|
120
|
+
if (!projectRoot) {
|
|
121
|
+
return; // Silent exit
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const claudeDir = path.join(projectRoot, '.claude');
|
|
125
|
+
const sourceDir = __dirname.replace(/[\/]scripts$/, ''); // Remove /scripts
|
|
126
|
+
|
|
127
|
+
// Copy files
|
|
128
|
+
safeCopyDirectory(path.join(sourceDir, 'agents'), path.join(claudeDir, 'agents'));
|
|
129
|
+
safeCopyDirectory(path.join(sourceDir, 'hooks'), path.join(claudeDir, 'hooks'));
|
|
130
|
+
safeCopyFile(path.join(sourceDir, '.mcp.json'), path.join(claudeDir, '.mcp.json'));
|
|
131
|
+
|
|
132
|
+
// Update .gitignore
|
|
133
|
+
updateGitignore(projectRoot);
|
|
134
|
+
|
|
135
|
+
// Silent success
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
install();
|