gm-cc 2.0.5

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.
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "gm",
3
+ "owner": {
4
+ "name": "AnEntrypoint"
5
+ },
6
+ "description": "Advanced Claude Code plugin with WFGY integration, MCP tools, and automated hooks",
7
+ "version": "2.0.5",
8
+ "metadata": {
9
+ "description": "Advanced Claude Code plugin with WFGY integration, MCP tools, and automated hooks"
10
+ },
11
+ "plugins": [
12
+ {
13
+ "name": "gm",
14
+ "source": "./"
15
+ }
16
+ ]
17
+ }
package/.editorconfig ADDED
@@ -0,0 +1,12 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = space
5
+ indent_size = 2
6
+ end_of_line = lf
7
+ charset = utf-8
8
+ trim_trailing_whitespace = true
9
+ insert_final_newline = true
10
+
11
+ [*.md]
12
+ trim_trailing_whitespace = false
@@ -0,0 +1,50 @@
1
+ name: Publish to npm
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ publish:
11
+ runs-on: ubuntu-latest
12
+ permissions:
13
+ contents: write
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - uses: actions/setup-node@v4
18
+ with:
19
+ node-version: '22'
20
+ registry-url: 'https://registry.npmjs.org'
21
+
22
+ - name: Validate package.json
23
+ run: |
24
+ if [ ! -f package.json ]; then
25
+ echo "❌ package.json not found"
26
+ exit 1
27
+ fi
28
+ VERSION=$(jq -r '.version' package.json)
29
+ PACKAGE=$(jq -r '.name' package.json)
30
+ if [ -z "$VERSION" ] || [ -z "$PACKAGE" ]; then
31
+ echo "❌ Invalid package.json: missing version or name"
32
+ exit 1
33
+ fi
34
+ echo "Package: $PACKAGE"
35
+ echo "Version: $VERSION"
36
+
37
+ - name: Auto-bump and publish
38
+ run: |
39
+ PACKAGE=$(jq -r '.name' package.json)
40
+ VERSION=$(jq -r '.version' package.json)
41
+ LATEST=$(npm view "$PACKAGE" version 2>/dev/null || echo "0.0.0")
42
+ if [ "$LATEST" = "$VERSION" ]; then
43
+ IFS='.' read -r MAJOR MINOR PATCH <<< "$LATEST"
44
+ NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))"
45
+ echo "Auto-bumping $PACKAGE from $VERSION to $NEW_VERSION"
46
+ jq --arg newver "$NEW_VERSION" '.version = $newver' package.json > package.tmp.json && mv package.tmp.json package.json
47
+ fi
48
+ npm publish
49
+ env:
50
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ node_modules/
2
+ *.log
3
+ *.swp
4
+ *.swo
5
+ .DS_Store
6
+ dist/
7
+ build/
8
+ *.tmp
9
+ .env
10
+ .env.local
11
+ .vscode/
12
+ .idea/
13
+ *.iml
package/.mcp.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "https://schemas.modelcontextprotocol.io/0.1.0/mcp.json",
3
+ "mcpServers": {
4
+ "dev": {
5
+ "command": "bunx",
6
+ "args": [
7
+ "mcp-gm@latest"
8
+ ],
9
+ "timeout": 360000
10
+ },
11
+ "code-search": {
12
+ "command": "bunx",
13
+ "args": [
14
+ "codebasesearch@latest"
15
+ ],
16
+ "timeout": 360000
17
+ }
18
+ }
19
+ }
package/CLAUDE.md ADDED
@@ -0,0 +1,11 @@
1
+ # CLAUDE
2
+
3
+ ## Technical Notes
4
+
5
+ Hook response format: `{"decision":"allow|block","reason":"text"}` with exit code 0.
6
+
7
+ Tool names for this platform: `bash` → `Bash`, `write` → `Write`, `glob` → `Glob`, `grep` → `Grep`, `search` → `Search`
8
+
9
+ When filtering transcript history by sessionId, use: `if (sessionId && entry.sessionId === sessionId)`
10
+
11
+ Verification file `.gm-stop-verified` is auto-added to .gitignore and tracks session completion state.
@@ -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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,261 @@
1
+ # gm-cc for Claude Code
2
+
3
+ ## Installation
4
+
5
+ ### Plugin Marketplace Installation (Recommended)
6
+
7
+ The easiest way to install gm-cc is through Claude Code's plugin marketplace:
8
+
9
+ ```bash
10
+ claude plugin marketplace add AnEntrypoint/gm-cc
11
+ claude plugin install -s user gm@gm-cc
12
+ ```
13
+
14
+ This installation method is best for:
15
+ - One-time plugin installation across all projects
16
+ - Always having the latest version
17
+ - Minimal setup and configuration
18
+ - Access to marketplace updates
19
+
20
+ ### Repository Installation (Project-Specific)
21
+
22
+ For development or project-specific customization, install gm-cc directly into your project:
23
+
24
+ ```bash
25
+ cd /path/to/your/project
26
+ npm install gm-cc && npx gm install
27
+ ```
28
+
29
+ This installation method is ideal when you need to:
30
+ - Customize hooks or agents for your workflow
31
+ - Integrate with existing Claude Code projects
32
+ - Use the latest development version
33
+ - Configure platform-specific behavior per project
34
+
35
+ #### Installation Command Breakdown
36
+
37
+ The `npm install gm-cc && npx gm install` command performs two steps:
38
+
39
+ 1. **`npm install gm-cc`** - Downloads the gm-cc package and stores it in your project's `node_modules/` directory
40
+ 2. **`npx gm install`** - Runs the gm installer that copies configuration files into your Claude Code plugin directory
41
+
42
+ **Expected output:**
43
+ ```
44
+ $ npm install gm-cc
45
+ added 1 package in 1.2s
46
+
47
+ $ npx gm install
48
+ Installing gm-cc...
49
+ ✓ Created .claude/ directory
50
+ ✓ Copied agents/gm.md
51
+ ✓ Copied hooks to .claude/hooks/
52
+ ✓ Created .mcp.json for MCP integration
53
+ ```
54
+
55
+ #### Installed File Structure (Project-Specific)
56
+
57
+ After running `npx gm install`, your project will have:
58
+
59
+ ```
60
+ .claude/
61
+ ├── agents/
62
+ │ └── gm.md # State machine agent rules
63
+ ├── hooks/
64
+ │ ├── pre-tool-use-hook.js # Tool validation and filtering
65
+ │ ├── session-start-hook.js # Session initialization
66
+ │ ├── prompt-submit-hook.js # Prompt validation
67
+ │ ├── stop-hook.js # Session completion enforcement
68
+ │ └── stop-hook-git.js # Git state verification
69
+ └── .mcp.json # MCP server configuration
70
+ ```
71
+
72
+ Each hook runs automatically at the appropriate session event. No manual trigger needed.
73
+
74
+ ## File Installation (Manual Setup)
75
+
76
+ If you prefer manual file management, clone the repository and copy files directly:
77
+
78
+ ```bash
79
+ # Clone the repository
80
+ git clone https://github.com/AnEntrypoint/gm-cc.git
81
+
82
+ # Copy to your Claude Code plugin directory
83
+ cp -r ./agents ~/.claude/agents
84
+ cp -r ./hooks ~/.claude/hooks
85
+ cp .mcp.json ~/.claude/.mcp.json
86
+ ```
87
+
88
+ ## Environment Setup
89
+
90
+ ```bash
91
+ # Ensure you have Node.js and bunx installed
92
+ # bunx is required for hook execution
93
+ # It's bundled with Node.js 18+
94
+ which bunx
95
+ bunx --version
96
+ ```
97
+
98
+ ## MCP Server Configuration
99
+
100
+ The `.mcp.json` file automatically configures:
101
+ - **dev**: Local code execution environment (uses `bunx`)
102
+ - **code-search**: Semantic code search via mcp-codebasesearch
103
+
104
+ No additional configuration needed.
105
+
106
+ ## Configuration
107
+
108
+ ### Option 1: Marketplace Installation (Default)
109
+
110
+ Marketplace installations use the default configuration. All settings work out-of-box:
111
+ - Hooks auto-detect file locations in .claude/hooks/
112
+ - MCP servers configured via included .mcp.json
113
+ - Agents loaded from .claude/agents/gm.md
114
+
115
+ ### Option 2: Project-Specific Installation
116
+
117
+ For project customization:
118
+
119
+ 1. **Edit agents/gm.md** to adjust behavioral rules
120
+ 2. **Modify hooks** in .claude/hooks/ for custom behavior
121
+ 3. **Update .mcp.json** to add or change MCP servers
122
+
123
+ Customizations are isolated to your project and won't affect other installations.
124
+
125
+ ## Hook Enablement
126
+
127
+ Hooks run automatically once installed. To verify hooks are active:
128
+
129
+ 1. Restart Claude Code
130
+ 2. Start a new session
131
+ 3. You should see hook output in the Claude Code terminal
132
+
133
+ If hooks don't activate:
134
+ - Check that .claude/hooks/ directory exists
135
+ - Verify hook files have executable permissions
136
+ - Ensure .mcp.json references the correct hook paths
137
+
138
+ ## Update Procedures
139
+
140
+ ### Plugin Marketplace Installation
141
+
142
+ ```bash
143
+ # Method 1: Via Claude Code commands
144
+ claude plugin marketplace update gm-cc
145
+ claude plugin update gm@gm-cc
146
+
147
+ # Method 2: Manual update
148
+ npm install -g gm-cc@latest
149
+ ```
150
+
151
+ ### Project-Specific Installation
152
+
153
+ ```bash
154
+ # Update the package
155
+ npm update gm-cc
156
+
157
+ # Re-run the installer to update .claude/ directory
158
+ npx gm install
159
+
160
+ # Or manually copy updated files
161
+ cp -r node_modules/gm-cc/agents/* .claude/agents/
162
+ cp -r node_modules/gm-cc/hooks/* .claude/hooks/
163
+ cp node_modules/gm-cc/.mcp.json .claude/.mcp.json
164
+ ```
165
+
166
+ ## Features
167
+
168
+ - **State machine agent** - Complete behavioral rule system for development
169
+ - **Five enforcement hooks** - Validation, prompts, startup, completion, git enforcement
170
+ - **MCP integration** - Code execution and semantic code search
171
+ - **Automatic thorns analysis** - AST analysis on session start
172
+ - **.prd enforcement** - Completion blocking at session end
173
+ - **Dual-mode installation** - Both user-wide (marketplace) and project-specific (npm)
174
+ - **Automatic setup** - No manual configuration needed
175
+ - **Convention-driven** - Works with existing code structure
176
+
177
+ ## Troubleshooting
178
+
179
+ ### Hooks not running
180
+
181
+ **Symptom:** Hooks don't execute when expected
182
+
183
+ **Solutions:**
184
+ 1. Verify .claude/hooks/ directory exists: `ls -la ~/.claude/hooks/`
185
+ 2. Check hook files are executable: `chmod +x ~/.claude/hooks/*.js`
186
+ 3. Restart Claude Code completely
187
+ 4. Check if hooks are loaded: Look for hook output in Claude Code terminal
188
+
189
+ ### MCP servers not available
190
+
191
+ **Symptom:** Code execution or search tools don't work
192
+
193
+ **Solutions:**
194
+ 1. Verify .mcp.json exists: `cat ~/.claude/.mcp.json`
195
+ 2. Check MCP configuration references correct paths
196
+ 3. Ensure bunx is installed: `which bunx`
197
+ 4. Restart Claude Code and retry
198
+
199
+ ### Plugin not appearing in marketplace
200
+
201
+ **Symptom:** Plugin doesn't show in `claude plugin marketplace list`
202
+
203
+ **Solutions:**
204
+ 1. Check plugin is published: `npm view gm-cc`
205
+ 2. Verify package.json has correct plugin metadata
206
+ 3. Check .claude-plugin/marketplace.json is valid JSON
207
+ 4. Wait 5-10 minutes for marketplace index to refresh
208
+
209
+ ### Permission denied errors
210
+
211
+ **Symptom:** "Permission denied" when running hooks
212
+
213
+ **Solutions:**
214
+ 1. Make hook files executable: `chmod +x ~/.claude/hooks/*.js`
215
+ 2. Check parent directories are readable: `chmod 755 ~/.claude ~/.claude/hooks`
216
+ 3. Verify Claude Code process has file access
217
+
218
+ ### Installation failed with npm
219
+
220
+ **Symptom:** `npm install` fails with network or permission errors
221
+
222
+ **Solutions:**
223
+ 1. Check internet connection
224
+ 2. Clear npm cache: `npm cache clean --force`
225
+ 3. Use `npm install` with `--legacy-peer-deps` if needed
226
+ 4. Check disk space: `df -h`
227
+ 5. Run `npm audit fix` to resolve dependency issues
228
+
229
+ ## Uninstall
230
+
231
+ ### Plugin Marketplace
232
+
233
+ ```bash
234
+ claude plugin remove gm@gm-cc
235
+ ```
236
+
237
+ ### Project-Specific
238
+
239
+ ```bash
240
+ # Remove from project
241
+ npm uninstall gm-cc
242
+
243
+ # Remove configuration
244
+ rm -rf .claude/
245
+ ```
246
+
247
+ ## Installation Comparison
248
+
249
+ | Method | Setup Time | Scope | Updates | Best For |
250
+ |--------|-----------|-------|---------|----------|
251
+ | **Marketplace** | 2 minutes | User-wide | One-click | Most users, all projects |
252
+ | **Project Installation** | 5 minutes | Per-project | `npm update` | Custom configurations |
253
+ | **File Installation** | 10 minutes | Per-project | Manual | Advanced users, offline setup |
254
+
255
+ ## Contributing
256
+
257
+ Issues and pull requests welcome: [GitHub Issues](https://github.com/AnEntrypoint/gm-cc/issues)
258
+
259
+ ## License
260
+
261
+ MIT - See LICENSE file for details