@dedesfr/prompter 0.8.18 → 0.8.19

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## [0.8.19] - 2026-05-07
4
+
5
+ ### ✨ Added
6
+ - **cerebro Skill**: Save and resume cross-agent conversational sessions through the Cerebro MCP server
7
+ - Enables session preservation when switching between AI agents (Claude Code, Codex, OpenCode, Cursor, Windsurf)
8
+ - Useful when approaching usage limits and needing to continue elsewhere
9
+ - Supports handoff-save and handoff-resume workflows
10
+ - Includes setup guidance for connecting Cerebro to various AI agents
11
+
3
12
  ## [0.8.18] - 2026-05-06
4
13
 
5
14
  ### 🔄 Changed
package/dist/cli/index.js CHANGED
@@ -16,7 +16,7 @@ const program = new Command();
16
16
  program
17
17
  .name('prompter')
18
18
  .description('Enhance prompts directly in your AI coding workflow')
19
- .version('0.8.18');
19
+ .version('0.8.19');
20
20
  program
21
21
  .command('init')
22
22
  .description('Initialize Prompter in your project')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dedesfr/prompter",
3
- "version": "0.8.18",
3
+ "version": "0.8.19",
4
4
  "description": "Enhance prompts directly in your AI coding workflow",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,184 @@
1
+ ---
2
+ name: cerebro
3
+ description: Save and resume cross-agent conversational sessions through the Cerebro MCP server. Use this skill whenever the user wants to preserve session context before switching AI agents (Claude Code → Codex → OpenCode → Cursor → Windsurf, or any combination), is approaching a usage limit and needs to continue elsewhere, says things like "save this for the next agent", "summarize this session", "I'm switching to Codex", "continuing in OpenCode", "pick up where the last agent left off", "resume from yesterday's session", or invokes `/handoff-save` / `/handoff-resume`. Also trigger for first-time setup when the user asks to connect Cerebro to their agents. Trigger this skill even if the user does not name Cerebro explicitly — any cross-agent handoff or session-summary intent qualifies.
4
+ ---
5
+
6
+ # Session Handoff via Cerebro MCP
7
+
8
+ ## What this skill is for
9
+
10
+ Long coding sessions often outlive a single agent's usage budget. The user might start in Claude Code, hit a limit, and switch to Codex or OpenCode — but the new agent has zero context. This skill bridges that gap by writing a structured session summary to Cerebro and pulling it back when a new agent starts.
11
+
12
+ ---
13
+
14
+ ## Step 0 — First-time setup
15
+
16
+ Before save/recall will work, Cerebro MCP must be installed in the agents the user wants to use. Check whether the cerebro tools are already available (look for `mcp__cerebro__memory_create` in Claude Code, or `cerebro.*` tools in other agents).
17
+
18
+ **If not yet set up**, ask the user which agents they want to install Cerebro into, then show only the relevant instructions from the list below. Don't dump all six agents at once — pick the ones they asked for.
19
+
20
+ ### Claude Code
21
+ ```bash
22
+ claude mcp add --transport http --scope user cerebro http://localhost:3000/api/mcp \
23
+ --header "Authorization: Bearer YOUR_TOKEN"
24
+ ```
25
+ Verify: `claude mcp list` — should show `cerebro connected`.
26
+ No restart needed.
27
+
28
+ ### OpenCode
29
+ Add to `~/.config/opencode/opencode.json`:
30
+ ```json
31
+ {
32
+ "mcp": {
33
+ "cerebro": {
34
+ "type": "remote",
35
+ "url": "http://localhost:3000/api/mcp",
36
+ "headers": { "Authorization": "Bearer YOUR_TOKEN" },
37
+ "enabled": true
38
+ }
39
+ }
40
+ }
41
+ ```
42
+ No restart needed — picked up on next `opencode` invocation.
43
+
44
+ ### Codex (OpenAI Codex CLI)
45
+ Add to `~/.codex/config.json`:
46
+ ```json
47
+ {
48
+ "mcpServers": {
49
+ "cerebro": {
50
+ "command": "node",
51
+ "args": ["/path/to/cerebro-mcp-server/dist/index.js"],
52
+ "env": {
53
+ "CEREBRO_URL": "http://localhost:3000",
54
+ "CEREBRO_TOKEN": "YOUR_TOKEN"
55
+ }
56
+ }
57
+ }
58
+ }
59
+ ```
60
+ The `cerebro-mcp-server` binary lives in the Cerebro repo under `cerebro-mcp-server/`. Build it once with `npm install && npm run build` if `dist/index.js` doesn't exist yet.
61
+
62
+ ### Cursor
63
+ Add to `~/.cursor/mcp.json`:
64
+ ```json
65
+ {
66
+ "mcpServers": {
67
+ "cerebro": {
68
+ "command": "node",
69
+ "args": ["/path/to/cerebro-mcp-server/dist/index.js"],
70
+ "env": {
71
+ "CEREBRO_URL": "http://localhost:3000",
72
+ "CEREBRO_TOKEN": "YOUR_TOKEN"
73
+ }
74
+ }
75
+ }
76
+ }
77
+ ```
78
+ **Restart Cursor** to pick up the change.
79
+
80
+ ### Windsurf
81
+ Add to `~/.codeium/windsurf/mcp_config.json`:
82
+ ```json
83
+ {
84
+ "mcpServers": {
85
+ "cerebro": {
86
+ "command": "node",
87
+ "args": ["/path/to/cerebro-mcp-server/dist/index.js"],
88
+ "env": {
89
+ "CEREBRO_URL": "http://localhost:3000",
90
+ "CEREBRO_TOKEN": "YOUR_TOKEN"
91
+ }
92
+ }
93
+ }
94
+ }
95
+ ```
96
+ **Restart Windsurf** to pick up the change.
97
+
98
+ ### Claude Desktop
99
+ - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
100
+ - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
101
+ ```json
102
+ {
103
+ "mcpServers": {
104
+ "cerebro": {
105
+ "command": "node",
106
+ "args": ["/path/to/cerebro-mcp-server/dist/index.js"],
107
+ "env": {
108
+ "CEREBRO_URL": "http://localhost:3000",
109
+ "CEREBRO_TOKEN": "YOUR_TOKEN"
110
+ }
111
+ }
112
+ }
113
+ }
114
+ ```
115
+ **Restart Claude Desktop** to pick up the change.
116
+
117
+ ### Getting a token
118
+ Generate one at `http://localhost:3000` → **Settings → Agent Tokens**. One token can be reused across all agents.
119
+
120
+ ---
121
+
122
+ ## Two operations
123
+
124
+ | Trigger | Action |
125
+ |---|---|
126
+ | `/handoff-save`, "save this session", "I'm switching to Codex", "summarize this for the next agent" | **Save**: write a structured summary to Cerebro |
127
+ | `/handoff-resume`, "resume the last session", "pick up where I left off", "what was Claude working on" | **Recall**: fetch the most recent handoff and load it into context |
128
+
129
+ ---
130
+
131
+ ## Saving a handoff
132
+
133
+ 1. **Build the structured summary** from the conversation so far:
134
+
135
+ ```yaml
136
+ goal: <one or two sentences — what is the user ultimately trying to achieve?>
137
+ status: <where things stand right now>
138
+ decisions:
139
+ - <each non-obvious choice, with the reason>
140
+ files_touched:
141
+ - path: <relative path>
142
+ change: <what was modified, added, or deleted>
143
+ open_questions:
144
+ - <anything unresolved or uncertain>
145
+ next_steps:
146
+ - <concrete items the next agent should pick up first>
147
+ gotchas: <optional — subtle constraints the next agent must not miss>
148
+ ```
149
+
150
+ Be honest: if a change wasn't applied, don't list it. If a decision was tentative, say so.
151
+
152
+ 2. **Pick a project slug** — use the current working directory's folder name. Confirm only if the cwd looks generic (home dir, `/tmp`).
153
+
154
+ 3. **Resolve the project ID** via `mcp__cerebro__project_list`. If no project matches the slug, **ask the user** — show them the existing projects and let them choose: pick an existing one, or create a new one at `http://localhost:3000` (Projects → New) and tell you when it's ready. Never silently fall back to a different project.
155
+
156
+ 4. **Call `memory_create`**:
157
+ - `project`: the slug or ID
158
+ - `summary`: the YAML from step 1
159
+ - `sourceAgent`: current agent name (`claude-code`, `codex`, `opencode`, `cursor`, `windsurf`)
160
+ - `tags`: `["session-handoff", "<source-agent-name>"]`
161
+ - `metadata`: `{"cwd": "<current working directory>"}`
162
+
163
+ 5. **Confirm** the memory ID to the user so they can verify in the Cerebro dashboard.
164
+
165
+ ---
166
+
167
+ ## Resuming a handoff
168
+
169
+ 1. Determine the project slug (cwd folder name, or ask).
170
+ 2. Resolve to a project ID via `project_list` if needed.
171
+ 3. Call `memory_search` with query `"session-handoff"`. Filter results to those with `session-handoff` in their tags, sort by `createdAt` descending, take the newest.
172
+ 4. Re-state goal and status in one or two sentences and ask if the user wants to start with the first next-step. Don't dump the whole YAML — they want continuity, not a recap wall.
173
+ 5. If multiple handoffs match, list them briefly (date + agent + one-line goal) and ask which to resume.
174
+ 6. If nothing matches, say so and offer to search by keyword.
175
+
176
+ ---
177
+
178
+ ## Why structured YAML
179
+
180
+ Named fields let any agent parse the handoff reliably without re-reading a wall of prose. The next agent has no shared memory of the prior conversation — only this summary. If a field doesn't apply, write `none` or omit it.
181
+
182
+ ## Reference
183
+
184
+ `references/agents.md` — per-agent config file paths, transport types, and restart requirements.
@@ -0,0 +1,94 @@
1
+ # Per-Agent MCP Configuration Reference
2
+
3
+ The installer at `scripts/install_cerebro_mcp.py` writes the cerebro MCP server entry into each detected agent's config file. This document describes what gets written and where, so the user (or you) can verify or hand-edit.
4
+
5
+ ## Common token storage
6
+
7
+ The installer stores credentials at `~/.cerebro/config.json` (mode 0600):
8
+
9
+ ```json
10
+ { "url": "http://localhost:3000", "token": "<bearer token>" }
11
+ ```
12
+
13
+ This file is the single source of truth the installer reads on subsequent runs. Override per-agent with the `--token` / `--url` flags if needed.
14
+
15
+ ## Per-agent details
16
+
17
+ ### Claude Code
18
+
19
+ - **Path**: managed via `claude mcp add` CLI (preferred), falls back to `~/.claude/settings.json`.
20
+ - **Transport**: HTTP (`http://localhost:3000/api/mcp` with bearer auth).
21
+ - **Restart needed?** No — picked up on next session.
22
+
23
+ ### OpenCode
24
+
25
+ - **Path**: `~/.config/opencode/opencode.json`, `mcp.cerebro` entry.
26
+ - **Transport**: remote HTTP (`type: "remote"`).
27
+ - **Restart needed?** No — picked up on next `opencode` invocation.
28
+
29
+ ### Codex (OpenAI Codex CLI)
30
+
31
+ - **Path**: `~/.codex/config.json`, `mcpServers.cerebro` entry.
32
+ - **Transport**: stdio (Codex doesn't currently support remote MCP).
33
+ - **Requires**: `cerebro-mcp-server/dist/index.js` built. The installer builds it automatically if `~/Programming/learn/ai/cerebro/cerebro-mcp-server/` exists; override with `CEREBRO_MCP_SERVER=/path/to/cerebro-mcp-server`.
34
+
35
+ ### Cursor
36
+
37
+ - **Path**: `~/.cursor/mcp.json`, `mcpServers.cerebro` entry.
38
+ - **Transport**: stdio.
39
+ - **Restart needed?** **Yes** — full Cursor restart, not just window reload.
40
+
41
+ ### Windsurf
42
+
43
+ - **Path**: `~/.codeium/windsurf/mcp_config.json`, `mcpServers.cerebro` entry.
44
+ - **Transport**: stdio.
45
+ - **Restart needed?** **Yes** — full Windsurf restart.
46
+
47
+ ### Claude Desktop
48
+
49
+ - **macOS path**: `~/Library/Application Support/Claude/claude_desktop_config.json`.
50
+ - **Windows path**: `%APPDATA%\Claude\claude_desktop_config.json`.
51
+ - **Linux path**: `~/.config/Claude/claude_desktop_config.json`.
52
+ - **Transport**: stdio.
53
+ - **Restart needed?** **Yes**.
54
+
55
+ ## Detection rules
56
+
57
+ The installer considers an agent "installed" if any of these are true:
58
+
59
+ | Agent | Detection signal |
60
+ |---|---|
61
+ | `claude` | `claude` CLI on PATH **or** `~/.claude/` exists |
62
+ | `opencode` | `opencode` CLI on PATH **or** `~/.config/opencode/` exists |
63
+ | `codex` | `codex` CLI on PATH **or** `~/.codex/` exists |
64
+ | `cursor` | `~/.cursor/` exists **or** `/Applications/Cursor.app` |
65
+ | `windsurf` | `~/.codeium/` exists **or** `/Applications/Windsurf.app` |
66
+ | `claude-desktop` | `/Applications/Claude.app` **or** OS-specific config dir exists |
67
+
68
+ Force a subset with `--agents claude,opencode,codex`. Force-include an undetected agent the same way.
69
+
70
+ ## Verifying after install
71
+
72
+ In Claude Code:
73
+
74
+ ```bash
75
+ claude mcp list
76
+ ```
77
+
78
+ Expect `cerebro` with status `connected`.
79
+
80
+ In OpenCode:
81
+
82
+ ```bash
83
+ opencode mcp list
84
+ ```
85
+
86
+ In a freshly-started Cursor / Windsurf / Claude Desktop, check the tool list (hammer icon or equivalent) for cerebro tools: `project_list`, `memory_create`, `memory_get`, `memory_list`, `memory_search`, `memory_update`, `memory_delete`.
87
+
88
+ ## Uninstall
89
+
90
+ ```bash
91
+ node ~/.claude/skills/session-handoff/scripts/install_cerebro_mcp.js uninstall
92
+ ```
93
+
94
+ Removes the cerebro entry from every detected agent. Pass `--agents` to limit scope. Does **not** delete `~/.cerebro/config.json` — remove that manually if you want to fully reset.
package/src/cli/index.ts CHANGED
@@ -18,7 +18,7 @@ const program = new Command();
18
18
  program
19
19
  .name('prompter')
20
20
  .description('Enhance prompts directly in your AI coding workflow')
21
- .version('0.8.18');
21
+ .version('0.8.19');
22
22
 
23
23
  program
24
24
  .command('init')