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 +69 -180
- package/commands/bundle.js +0 -1
- package/index.js +1 -3
- package/marketplace.js +4 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PromptGraph
|
|
2
2
|
|
|
3
|
-
**Semantic skill router and marketplace for Claude Code and
|
|
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
|
-
##
|
|
13
|
-
|
|
14
|
-
**Requirements:** Node.js 18+ — [nodejs.org](https://nodejs.org)
|
|
12
|
+
## Install
|
|
15
13
|
|
|
16
14
|
```bash
|
|
17
|
-
npm install -g promptgraph-mcp
|
|
15
|
+
npm install -g promptgraph-mcp
|
|
18
16
|
```
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
pg --version
|
|
23
|
-
```
|
|
18
|
+
## Quick start
|
|
24
19
|
|
|
25
|
-
Update to latest:
|
|
26
20
|
```bash
|
|
27
|
-
pg
|
|
28
|
-
#
|
|
29
|
-
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
32
|
+
Then restart your editor — the `promptgraph` MCP server will be available.
|
|
47
33
|
|
|
48
34
|
---
|
|
49
35
|
|
|
50
|
-
##
|
|
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
|
-
|
|
103
|
-
|
|
104
|
-
|
|
|
105
|
-
|
|
106
|
-
|
|
|
107
|
-
|
|
|
108
|
-
|
|
|
109
|
-
|
|
|
110
|
-
|
|
|
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
|
-
##
|
|
50
|
+
## CLI commands
|
|
115
51
|
|
|
116
52
|
```bash
|
|
117
|
-
pg
|
|
118
|
-
pg
|
|
119
|
-
pg
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
pg
|
|
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
|
-
##
|
|
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
|
-
|
|
69
|
+
After `pg setup opencode`, two slash commands are available inside OpenCode:
|
|
150
70
|
|
|
151
|
-
|
|
152
|
-
|
|
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
|
-
|
|
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
|
|
170
|
-
pg
|
|
83
|
+
pg marketplace # Interactive TUI browser
|
|
84
|
+
pg install pg-xxxxxx # Install by bundle ID
|
|
171
85
|
```
|
|
172
86
|
|
|
173
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
102
|
+
## How it works
|
|
211
103
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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
|
-
##
|
|
111
|
+
## Troubleshooting
|
|
219
112
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
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
|
-
|
|
121
|
+
**EBUSY error on `pg update`:**
|
|
122
|
+
Close any terminals running `pg` commands, then run `pg update` again.
|
|
231
123
|
|
|
232
|
-
|
|
233
|
-
|
|
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
|
-
##
|
|
238
|
-
|
|
239
|
-
- 📋 [promptgraph-registry](https://github.com/NeiP4n/promptgraph-registry) — community skill registry
|
|
240
|
-
|
|
241
|
-
---
|
|
129
|
+
## Requirements
|
|
242
130
|
|
|
243
|
-
|
|
131
|
+
- Node.js ≥ 18
|
|
132
|
+
- ~45 MB disk for the embedding model (downloaded on first use)
|
package/commands/bundle.js
CHANGED
|
@@ -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(['
|
|
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
|
-
|
|
600
|
-
`
|
|
601
|
-
'
|
|
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'),
|