promptgraph-mcp 2.9.36 → 2.9.38

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # PromptGraph
2
2
 
3
- **Semantic skill router and marketplace for Claude Code and OpenCode.**
3
+ **Semantic skill router and marketplace for Claude Code, OpenCode, and more.**
4
4
 
5
5
  Instead of loading every `.md` skill into context, Claude calls `pg_search` and loads only the skill it needs — saving 20k+ tokens per session.
6
6
 
@@ -9,235 +9,124 @@ Instead of loading every `.md` skill into context, Claude calls `pg_search` and
9
9
 
10
10
  ---
11
11
 
12
- ## Installation
13
-
14
- **Requirements:** Node.js 18+ — [nodejs.org](https://nodejs.org)
12
+ ## Install
15
13
 
16
14
  ```bash
17
- npm install -g promptgraph-mcp@latest
15
+ npm install -g promptgraph-mcp
18
16
  ```
19
17
 
20
- Check version:
21
- ```bash
22
- pg --version
23
- ```
18
+ ## Quick start
24
19
 
25
- Update to latest:
26
20
  ```bash
27
- pg update
28
- # or
29
- npm install -g promptgraph-mcp@latest
21
+ pg setup claude-code # Claude Code
22
+ pg setup opencode # OpenCode (writes opencode.json MCP config)
23
+ pg setup claude-desktop # Claude Desktop
24
+ pg setup cursor # Cursor
30
25
  ```
31
26
 
32
- Uninstall:
33
- ```bash
34
- npm uninstall -g promptgraph-mcp
35
- ```
36
-
37
- ---
38
-
39
- ## Quick Start
40
-
41
- ```bash
42
- npm install -g promptgraph-mcp@latest
43
- pg init
44
- ```
27
+ `pg setup <platform>` does three things:
28
+ 1. Writes the MCP server config for that platform
29
+ 2. Sets the skills directory for that platform (e.g. `~/.config/opencode/skills`)
30
+ 3. Runs a full index of your skills
45
31
 
46
- `pg init` auto-detects your installed editor, downloads the embedding model (~23 MB, once), indexes your skills, and writes the config automatically.
32
+ Then restart your editor the `promptgraph` MCP server will be available.
47
33
 
48
34
  ---
49
35
 
50
- ## Setup
51
-
52
- ### Claude Code
53
-
54
- **Option 1 — auto (recommended):**
55
- ```bash
56
- pg init
57
- # or
58
- pg setup claude-code
59
- ```
60
-
61
- **Option 2 — manual.** Add to `~/.claude/settings.json`:
62
- ```json
63
- {
64
- "mcpServers": {
65
- "promptgraph": {
66
- "command": "npx",
67
- "args": ["promptgraph-mcp"]
68
- }
69
- }
70
- }
71
- ```
72
-
73
- **Option 3 — official plugin:**
74
- ```
75
- /plugin install promptgraph@claude-community
76
- ```
77
-
78
- ### OpenCode
79
-
80
- **Option 1 — auto (recommended):**
81
- ```bash
82
- pg init
83
- # or
84
- pg setup opencode
85
- ```
86
-
87
- **Option 2 — manual.** Add to `~/.config/opencode/opencode.json`:
88
- ```json
89
- {
90
- "mcp": {
91
- "promptgraph": {
92
- "type": "local",
93
- "command": ["cmd", "/c", "npx", "promptgraph-mcp"],
94
- "enabled": true
95
- }
96
- }
97
- }
98
- ```
99
-
100
- > **Linux/macOS:** use `"command": ["npx", "promptgraph-mcp"]` (without `cmd /c`).
36
+ ## Supported platforms
101
37
 
102
- ### Other clients
103
-
104
- | Client | Command |
105
- |---|---|
106
- | Claude Desktop | `pg setup claude-desktop` |
107
- | Cursor | `pg setup cursor` |
108
- | Windsurf | `pg setup windsurf` |
109
- | Cline | `pg setup cline` |
110
- | OpenAI Codex CLI | `pg setup codex` |
38
+ | Platform | Config written | Skills directory |
39
+ |---|---|---|
40
+ | `claude-code` | `~/.claude/settings.json` | `~/.claude/skills-store` |
41
+ | `claude-desktop` | `%APPDATA%/Claude/claude_desktop_config.json` | `~/.claude/skills-store` |
42
+ | `opencode` | `~/.config/opencode/opencode.json` | `~/.config/opencode/skills` |
43
+ | `cursor` | `.cursor/mcp.json` | `~/.cursor/skills` |
44
+ | `windsurf` | `.codeium/windsurf/mcp_config.json` | `~/.codeium/windsurf/skills` |
45
+ | `cline` | `.vscode/mcp.json` | `~/.vscode/skills` |
46
+ | `codex` | `~/.codex/config.yaml` | `~/.codex/skills` |
111
47
 
112
48
  ---
113
49
 
114
- ## Install skill bundles
50
+ ## CLI commands
115
51
 
116
52
  ```bash
117
- pg install engineering-best-practices
118
- pg install pg-000001
119
- pg install "LLM Prompts"
120
- ```
121
-
122
- Or browse interactively:
123
- ```bash
124
- pg marketplace
53
+ pg setup <platform> # Setup MCP config + skills dir for a platform
54
+ pg search <query> # Semantic search across your skills
55
+ pg list # List all indexed skills
56
+ pg add <file> # Add a skill file and index it
57
+ pg reindex # Re-index all skills (with progress bar + ETA)
58
+ pg marketplace # Browse community skill bundles (TUI)
59
+ pg install <id> # Install a skill or bundle by ID
60
+ pg doctor # Check database integrity
61
+ pg doctor --reset-dead # Restore bundles hidden after install errors
62
+ pg update # Update promptgraph-mcp to latest version
125
63
  ```
126
64
 
127
65
  ---
128
66
 
129
- ## CLI
130
-
131
- ```bash
132
- pg init # first-time setup (auto-detects editor)
133
- pg setup <platform> # register MCP in a specific editor
134
- pg install <name> # install a bundle by name, code, or id
135
- pg marketplace # browse + search + install (interactive TUI)
136
- pg status # show indexed sources, repos, installed bundles
137
- pg reindex # full reindex (semantic + keyword)
138
- pg reindex --fast # keyword-only reindex (~30 s)
139
- pg search "deploy" # search from terminal
140
- pg import owner/repo # import any GitHub repo of .md skills
141
- pg bundle update # update all installed bundles
142
- pg validate my-skill.md # validate before publishing
143
- pg doctor # clean orphaned DB rows
144
- pg update # update to latest version
145
- ```
146
-
147
- ---
67
+ ## OpenCode — `/pg` slash commands
148
68
 
149
- ## How it works
69
+ After `pg setup opencode`, two slash commands are available inside OpenCode:
150
70
 
151
- ```
152
- pg_search("refactor without breaking tests")
153
- → embed query (BGE-Small-EN, 384-dim)
154
- → HNSW ANN index — topK×4 candidates
155
- → BM25 FTS5 — topK×4 candidates
156
- → hybrid merge (cosine + BM25, adaptive weights)
157
- → term-overlap reranker (TF + header-position boost)
158
- → return topK skill paths + snippets
159
- → Claude reads only the files it needs
160
- ```
71
+ - `/pg <query>` — semantic search; returns the matching skill content
72
+ - `/pg-list` lists all indexed skills
161
73
 
162
- **Index:** SQLite + Float32 BLOB embeddings + HNSW. No external vector DB, no API key, no cloud.
74
+ These are MCP prompts, not tools they appear in the `/` command palette.
163
75
 
164
76
  ---
165
77
 
166
78
  ## Marketplace
167
79
 
80
+ Browse and install community skill bundles:
81
+
168
82
  ```bash
169
- pg marketplace # 🛠 Engineering 💻 Coding 🤖 AI 🔒 Security 🎨 Creative
170
- pg marketplace bundles # curated GitHub repos as skill bundles
83
+ pg marketplace # Interactive TUI browser
84
+ pg install pg-xxxxxx # Install by bundle ID
171
85
  ```
172
86
 
173
- **Bundles** clone a GitHub repo and index only the skill files auto-detects `skills/`, `commands/`, `prompts/` subdirectory.
174
-
175
- **Publish your skill** — open an issue on [promptgraph-registry](https://github.com/NeiP4n/promptgraph-registry) with label `skill-submission`. The bot validates, commits, and closes automatically.
87
+ Bundles marked with 🔧 include tool scripts (`.py`, `.sh`, `.js`) alongside `.md` skill files. Scripts are installed to the platform's skills directory and made executable automatically.
176
88
 
177
89
  ---
178
90
 
179
- ## MCP Tools
180
-
181
- Claude uses these automatically when the server is running:
182
-
183
- | Tool | Description |
184
- |---|---|
185
- | `pg_search` | Semantic search by task description |
186
- | `pg_list` | List all indexed skills |
187
- | `pg_context` | Full skill details + callers/callees |
188
- | `pg_callers` | Which skills reference this one |
189
- | `pg_callees` | Which skills this one calls |
190
- | `pg_impact` | What breaks if this skill changes |
191
- | `pg_marketplace_browse` | Browse community registry |
192
- | `pg_marketplace_install` | Install a skill by code or name |
193
- | `pg_bundle_browse` | Browse skill bundles |
194
- | `pg_bundle_install` | Install a bundle |
195
- | `pg_top_rated` | Highest-rated skills |
196
- | `pg_rate` | Rate a skill after use |
197
-
198
- ---
91
+ ## Skill bundles with tools
199
92
 
200
- ## Environment Variables
93
+ A bundle can ship both skill files (`.md`) and tool scripts (`.py`, `.sh`, `.js`, etc.). When installed:
94
+ - All `.md` files go to the skills directory
95
+ - Script files are placed alongside them
96
+ - On Linux/macOS scripts are made executable (`chmod +x`)
201
97
 
202
- | Variable | Default | Description |
203
- |---|---|---|
204
- | `PG_VECTOR_STORE` | `hnsw` | `hnsw` (ANN) or `flat` (brute-force cosine) |
205
- | `PG_RERANKER` | `1` | Term-overlap reranker — set `0` to disable |
206
- | `PG_MAX_CHUNKS` | `8` | Max semantic chunks per skill file |
98
+ Bundle authors: set `has_tools: true` and include `tool_files` entries in your bundle manifest.
207
99
 
208
100
  ---
209
101
 
210
- ## Skill filtering
102
+ ## How it works
211
103
 
212
- When importing a GitHub repo, PromptGraph:
213
- 1. Looks for a dedicated subdir (`skills/`, `commands/`, `prompts/`, `agents/`, etc.) — indexes only that if found
214
- 2. Falls back to repo root with a content quality filter: min 150 chars, 2+ headers, code blocks or bullets required, skips readme/changelog/license
104
+ 1. Your `.md` skills are embedded with BGE-Small-EN (fastembed, local, no API key)
105
+ 2. Embeddings are stored in SQLite + HNSW index
106
+ 3. When Claude calls `pg_search("refactor without breaking tests")`, only the matching skill is loaded into context
107
+ 4. Skills are scored — `pg_top_rated` returns the best-performing ones
215
108
 
216
109
  ---
217
110
 
218
- ## Benchmarks
111
+ ## Troubleshooting
219
112
 
220
- | Operation | Result |
221
- |---|---|
222
- | 88 new skills (cold ONNX) | **49.5 s** |
223
- | 88 skills (unchanged, hash match) | **< 1 s** |
224
- | `pg reindex --fast` (3000 files) | **~30 s** |
225
- | Semantic search (HNSW) | **< 50 ms** |
226
- | Model size (BGE-Small-EN-v1.5, one-time) | **23 MB** |
113
+ **Marketplace shows no bundles:**
114
+ ```bash
115
+ pg doctor --reset-dead
116
+ ```
227
117
 
228
- ---
118
+ **Reindex stuck / no progress:**
119
+ Progress bar with ETA appears automatically. First run downloads the embedding model (~45 MB).
229
120
 
230
- ## Requirements
121
+ **EBUSY error on `pg update`:**
122
+ Close any terminals running `pg` commands, then run `pg update` again.
231
123
 
232
- - Node.js 18+
233
- - Claude Code, OpenCode, Cursor, Windsurf, Cline, or any MCP-compatible client
124
+ **OpenCode not seeing MCP:**
125
+ Run `pg setup opencode` — it writes the correct `{ "type": "local", "command": ["cmd", "/c", "npx", "promptgraph-mcp"] }` entry to `~/.config/opencode/opencode.json`.
234
126
 
235
127
  ---
236
128
 
237
- ## Related
238
-
239
- - 📋 [promptgraph-registry](https://github.com/NeiP4n/promptgraph-registry) — community skill registry
240
-
241
- ---
129
+ ## Requirements
242
130
 
243
- *Built with [Claude Code](https://claude.com/claude-code).*
131
+ - Node.js 18
132
+ - ~45 MB disk for the embedding model (downloaded on first use)
@@ -149,7 +149,6 @@ export default async function handler(args, bin) {
149
149
  if (result?.error) { error(result.error); process.exit(1); }
150
150
  if (result.gh_not_installed) {
151
151
  console.log('\n' + result.instructions);
152
- console.log(chalk.gray('\nBundle JSON:\n') + chalk.white(json));
153
152
  } else {
154
153
  success(`Bundle proposed! Submit: ${result.submit_url}`);
155
154
  }
package/index.js CHANGED
@@ -18,7 +18,7 @@ const args = process.argv.slice(2);
18
18
  const rawBin = process.argv[1]?.split(/[\\/]/).pop()?.replace(/\.js$/, '');
19
19
  const bin = (rawBin && rawBin !== 'index') ? rawBin : 'pg';
20
20
 
21
- const KNOWN_COMMANDS = new Set(['init', 'reindex', 'update', 'import', 'install', 'setup', 'validate', 'marketplace', 'doctor', 'search', 'help', '--help', '-h', '--version', '-v', 'version', 'bundle', 'status', 'train']);
21
+ const KNOWN_COMMANDS = new Set(['reindex', 'update', 'import', 'install', 'setup', 'validate', 'marketplace', 'doctor', 'search', 'help', '--help', '-h', '--version', '-v', 'version', 'bundle', 'status', 'train']);
22
22
 
23
23
  function showHelp() {
24
24
  console.log(
@@ -30,7 +30,6 @@ function showHelp() {
30
30
  );
31
31
  console.log(chalk.gray('\nUsage:\n'));
32
32
  const cmds = [
33
- ['init', 'First-time setup + index all skills'],
34
33
  ['reindex', 'Re-index all skills'],
35
34
  ['search <query>', 'Search skills from the terminal'],
36
35
  ['import <owner/repo>', 'Import skills from GitHub'],
@@ -92,7 +91,6 @@ const COMMAND_MAP = {
92
91
  import: './commands/import.js',
93
92
  install: './commands/install.js',
94
93
  setup: './commands/setup.js',
95
- init: './commands/init.js',
96
94
  update: './commands/update.js',
97
95
  reindex: './commands/reindex.js',
98
96
  }
package/marketplace.js CHANGED
@@ -596,9 +596,10 @@ export async function publishBundle(bundleDef) {
596
596
  success: true,
597
597
  gh_not_installed: true,
598
598
  instructions: [
599
- '1. Install gh CLI: https://cli.github.com',
600
- ` OR open this pre-filled issue directly: ${issueUrl}`,
601
- '2. Paste the bundle JSON shown below into the issue body',
599
+ `👉 Open this link and click "Submit new issue" (JSON is already filled in):`,
600
+ ` ${issueUrl}`,
601
+ '',
602
+ ' OR install gh CLI for one-command submit: https://cli.github.com',
602
603
  ...(repoWarnings.length ? ['', '⚠ Repo warnings (CI will re-check):', ...repoWarnings.map(w => ' - ' + w)] : []),
603
604
  ...(def.repo_url ? ['', 'Your repo will be validated by CI when submitted.'] : []),
604
605
  ].join('\n'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "promptgraph-mcp",
3
- "version": "2.9.36",
3
+ "version": "2.9.38",
4
4
  "files": [
5
5
  "*.js",
6
6
  "commands/",