wicked-brain 0.17.1 → 0.18.0

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.
Files changed (64) hide show
  1. package/README.md +22 -3
  2. package/install.mjs +29 -38
  3. package/package.json +1 -1
  4. package/server/package.json +1 -1
  5. package/skills/wicked-brain-batch/SKILL.md +1 -1
  6. package/skills/wicked-brain-compile/SKILL.md +1 -1
  7. package/skills/wicked-brain-configure/SKILL.md +7 -7
  8. package/skills/wicked-brain-confirm/SKILL.md +1 -1
  9. package/skills/{wicked-brain-agent/agents/consolidate.md → wicked-brain-consolidate/SKILL.md} +74 -10
  10. package/skills/{wicked-brain-agent/agents/context.md → wicked-brain-context/SKILL.md} +64 -6
  11. package/skills/wicked-brain-dlq/SKILL.md +1 -1
  12. package/skills/wicked-brain-enhance/SKILL.md +1 -1
  13. package/skills/wicked-brain-forget/SKILL.md +2 -2
  14. package/skills/wicked-brain-graph/SKILL.md +1 -1
  15. package/skills/wicked-brain-ingest/SKILL.md +1 -1
  16. package/skills/wicked-brain-init/SKILL.md +1 -1
  17. package/skills/wicked-brain-lint/SKILL.md +1 -1
  18. package/skills/wicked-brain-lsp/SKILL.md +1 -1
  19. package/skills/wicked-brain-memory/SKILL.md +1 -1
  20. package/skills/wicked-brain-migrate/SKILL.md +1 -1
  21. package/skills/{wicked-brain-agent/agents/onboard.md → wicked-brain-onboard/SKILL.md} +87 -9
  22. package/skills/wicked-brain-query/SKILL.md +1 -1
  23. package/skills/wicked-brain-read/SKILL.md +1 -1
  24. package/skills/wicked-brain-retag/SKILL.md +1 -1
  25. package/skills/wicked-brain-review/SKILL.md +3 -3
  26. package/skills/wicked-brain-search/SKILL.md +1 -1
  27. package/skills/wicked-brain-server/SKILL.md +1 -1
  28. package/skills/{wicked-brain-agent/agents/session-teardown.md → wicked-brain-session-teardown/SKILL.md} +54 -5
  29. package/skills/wicked-brain-status/SKILL.md +1 -1
  30. package/skills/wicked-brain-synonyms/SKILL.md +1 -1
  31. package/skills/wicked-brain-ui/SKILL.md +1 -1
  32. package/skills/wicked-brain-update/SKILL.md +1 -1
  33. package/skills/wicked-brain-agent/SKILL.md +0 -95
  34. package/skills/wicked-brain-agent/platform/antigravity/wicked-brain-consolidate.md +0 -103
  35. package/skills/wicked-brain-agent/platform/antigravity/wicked-brain-context.md +0 -67
  36. package/skills/wicked-brain-agent/platform/antigravity/wicked-brain-onboard.md +0 -74
  37. package/skills/wicked-brain-agent/platform/antigravity/wicked-brain-session-teardown.md +0 -72
  38. package/skills/wicked-brain-agent/platform/claude/wicked-brain-consolidate.md +0 -106
  39. package/skills/wicked-brain-agent/platform/claude/wicked-brain-context.md +0 -70
  40. package/skills/wicked-brain-agent/platform/claude/wicked-brain-onboard.md +0 -100
  41. package/skills/wicked-brain-agent/platform/claude/wicked-brain-session-teardown.md +0 -75
  42. package/skills/wicked-brain-agent/platform/codex/wicked-brain-consolidate.toml +0 -104
  43. package/skills/wicked-brain-agent/platform/codex/wicked-brain-context.toml +0 -68
  44. package/skills/wicked-brain-agent/platform/codex/wicked-brain-onboard.toml +0 -75
  45. package/skills/wicked-brain-agent/platform/codex/wicked-brain-session-teardown.toml +0 -73
  46. package/skills/wicked-brain-agent/platform/copilot/wicked-brain-consolidate.agent.md +0 -105
  47. package/skills/wicked-brain-agent/platform/copilot/wicked-brain-context.agent.md +0 -69
  48. package/skills/wicked-brain-agent/platform/copilot/wicked-brain-onboard.agent.md +0 -76
  49. package/skills/wicked-brain-agent/platform/copilot/wicked-brain-session-teardown.agent.md +0 -74
  50. package/skills/wicked-brain-agent/platform/cursor/wicked-brain-consolidate.md +0 -104
  51. package/skills/wicked-brain-agent/platform/cursor/wicked-brain-context.md +0 -68
  52. package/skills/wicked-brain-agent/platform/cursor/wicked-brain-onboard.md +0 -75
  53. package/skills/wicked-brain-agent/platform/cursor/wicked-brain-session-teardown.md +0 -73
  54. package/skills/wicked-brain-agent/platform/gemini/wicked-brain-consolidate.md +0 -107
  55. package/skills/wicked-brain-agent/platform/gemini/wicked-brain-context.md +0 -71
  56. package/skills/wicked-brain-agent/platform/gemini/wicked-brain-onboard.md +0 -78
  57. package/skills/wicked-brain-agent/platform/gemini/wicked-brain-session-teardown.md +0 -76
  58. package/skills/wicked-brain-agent/platform/kiro/wicked-brain-consolidate.json +0 -17
  59. package/skills/wicked-brain-agent/platform/kiro/wicked-brain-context.json +0 -16
  60. package/skills/wicked-brain-agent/platform/kiro/wicked-brain-onboard.json +0 -17
  61. package/skills/wicked-brain-agent/platform/kiro/wicked-brain-session-teardown.json +0 -17
  62. /package/skills/{wicked-brain-agent → wicked-brain-context}/hooks/claude-hooks.json +0 -0
  63. /package/skills/{wicked-brain-agent → wicked-brain-context}/hooks/copilot-hooks.json +0 -0
  64. /package/skills/{wicked-brain-agent → wicked-brain-context}/hooks/gemini-hooks.json +0 -0
package/README.md CHANGED
@@ -10,7 +10,22 @@ __ _(_) ___| | _____ __| | | |__ _ __ __ _(_)_ __
10
10
 
11
11
  wicked-brain gives your AI coding CLI a persistent, searchable knowledge base built on markdown and SQLite. Drop in files, let the agent organize them, and query your accumulated knowledge across sessions — all without leaving your terminal.
12
12
 
13
- Works with **Claude Code**, **Gemini CLI**, **Copilot CLI**, **Cursor**, and **Codex**.
13
+ Works with **Claude Code**, **Gemini CLI**, **Copilot CLI**, **Cursor**, **Codex**, **Kiro**, and **Antigravity**.
14
+
15
+ > **Status:** v0.17.2, published to npm as [`wicked-brain`](https://www.npmjs.com/package/wicked-brain).
16
+ > Actively developed (JS). This is a **bridge-period adapter** — its memory and knowledge role is
17
+ > destined to fold into [wicked-estate](https://github.com/mikeparcewski/wicked-estate).
18
+ >
19
+ > **The differentiator:** a RAG alternative that stores knowledge as human-readable markdown with
20
+ > explicit, confidence-scored `[[backlinks]]` instead of opaque embeddings — every claim traces to a
21
+ > source file, and the agent (not a vector index) does the reasoning.
22
+
23
+ wicked-brain is the **bridge-period memory** of the [wicked-* foundation](https://we.wickedagile.com):
24
+ a local-first stack for AI coding agents anchored by
25
+ [wicked-estate](https://github.com/mikeparcewski/wicked-estate) (the code graph), with
26
+ [wicked-core](https://github.com/mikeparcewski/wicked-core) (the runtime),
27
+ [wicked-bus](https://github.com/mikeparcewski/wicked-bus) (the durable event fabric), and
28
+ [wicked-crew](https://github.com/mikeparcewski/wicked-crew) (the agentic execution harness).
14
29
 
15
30
  ---
16
31
 
@@ -161,6 +176,10 @@ The viewer has no auth. It's localhost-only, same-machine trust.
161
176
  | `wicked-brain:lsp` | Universal code intelligence via LSP — hover, go-to-definition, diagnostics, completions |
162
177
  | `wicked-brain:graph` | Code-relationship graph — blast radius, callers, lineage — backed by a static code graph |
163
178
  | `wicked-brain:ui` | Open the read-only browser viewer — Material-styled Search + Wiki tabs over `http://localhost:<port>/` |
179
+ | `wicked-brain:context` | Surface relevant brain knowledge for the current prompt — runs inline on the hot path to enrich what you're working on |
180
+ | `wicked-brain:onboard` | Full project-understanding pipeline — scans the repo, investigates from multiple perspectives, and builds the support wiki |
181
+ | `wicked-brain:session-teardown` | Capture session learnings — decisions, patterns, gotchas, discoveries — as brain memories before a session ends |
182
+ | `wicked-brain:consolidate` | Multi-pass brain maintenance — archive noise, promote patterns, merge duplicates, and rebuild the synonym map |
164
183
 
165
184
  ## Code Graph (offline / air-gapped)
166
185
 
@@ -279,7 +298,7 @@ Modern LLMs read PDF, DOCX, PPTX, and XLSX natively. When you ingest a binary do
279
298
 
280
299
  ## Architecture
281
300
 
282
- Plain Node.js server (SQLite FTS5 + file watcher + optional LSP client + HTML viewer) plus markdown skill instructions your AI CLI consumes. **One runtime dependency** (`better-sqlite3`); LSP layer is hand-rolled JSON-RPC; the viewer is vanilla JS with no build.
301
+ Plain Node.js server (SQLite FTS5 + file watcher + optional LSP client + HTML viewer) plus markdown skill instructions your AI CLI consumes. **Two runtime dependencies** (`better-sqlite3` and `wicked-bus`); LSP layer is hand-rolled JSON-RPC; the viewer is vanilla JS with no build.
283
302
 
284
303
  Compare that to a typical RAG stack:
285
304
 
@@ -293,7 +312,7 @@ Typical RAG: wicked-brain:
293
312
  - Orchestration layer - Skills (markdown)
294
313
  - Admin UI - GET / (vanilla HTML, read-only)
295
314
  ───────────────── ─────────────────
296
- 10+ deps, opaque vectors 1 runtime dep, plain markdown
315
+ 10+ deps, opaque vectors 2 runtime deps, plain markdown
297
316
  ```
298
317
 
299
318
  See [ARCHITECTURE.md](ARCHITECTURE.md) for component diagrams and the schema layout.
package/install.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
- // wicked-brain installer — detects CLIs and installs skills + agents
2
+ // wicked-brain installer — detects CLIs and installs skills (skills-only;
3
+ // no per-platform agent materialization).
3
4
 
4
5
  import { existsSync, mkdirSync, cpSync, readdirSync } from "node:fs";
5
6
  import { join, resolve, basename } from "node:path";
@@ -21,8 +22,6 @@ function buildClaudeTarget(rootDir, source, { trusted = false } = {}) {
21
22
  name: "claude",
22
23
  rootDir,
23
24
  dir: join(rootDir, "skills"),
24
- agentDir: join(rootDir, "agents"),
25
- agentSubdir: "agents",
26
25
  platform: "claude",
27
26
  identityMarkers: ["settings.json", "plugins", "projects"],
28
27
  source,
@@ -49,12 +48,12 @@ function resolveClaudeCandidates() {
49
48
  // Canonical non-claude targets. Claude is expanded dynamically via
50
49
  // resolveClaudeCandidates() below so CLI_TARGETS stays a flat spec.
51
50
  const CLI_TARGETS = [
52
- { name: "gemini", dir: join(home, ".gemini", "skills"), agentDir: join(home, ".gemini", "agents"), agentSubdir: "agents", platform: "gemini" },
53
- { name: "copilot", dir: join(home, ".github", "skills"), agentDir: join(home, ".github", "agents"), agentSubdir: "agents", platform: "copilot" },
54
- { name: "codex", dir: join(home, ".codex", "skills"), agentDir: join(home, ".codex", "agents"), agentSubdir: "agents", platform: "codex" },
55
- { name: "cursor", dir: join(home, ".cursor", "skills"), agentDir: join(home, ".cursor", "agents"), agentSubdir: "agents", platform: "cursor" },
56
- { name: "kiro", dir: join(home, ".kiro", "skills"), agentDir: join(home, ".kiro", "agents"), agentSubdir: "agents", platform: "kiro" },
57
- { name: "antigravity", dir: join(home, ".antigravity", "skills"), agentDir: join(home, ".antigravity", "rules"), agentSubdir: "rules", platform: "antigravity" },
51
+ { name: "gemini", dir: join(home, ".gemini", "skills"), platform: "gemini" },
52
+ { name: "copilot", dir: join(home, ".github", "skills"), platform: "copilot" },
53
+ { name: "codex", dir: join(home, ".codex", "skills"), platform: "codex" },
54
+ { name: "cursor", dir: join(home, ".cursor", "skills"), platform: "cursor" },
55
+ { name: "kiro", dir: join(home, ".kiro", "skills"), platform: "kiro" },
56
+ { name: "antigravity", dir: join(home, ".antigravity", "skills"), platform: "antigravity" },
58
57
  ];
59
58
 
60
59
  // Identity-marker gate for claude candidates. Without this, probing
@@ -112,14 +111,13 @@ let targets;
112
111
 
113
112
  if (pathArg && typeof pathArg === "string" && pathArg !== "") {
114
113
  const customPath = resolve(pathArg.replace(/^~/, () => home));
115
- // Strip leading dot to match CLI_TARGETS names (e.g. ".claude" → "claude")
114
+ // Strip leading dot to match CLI_TARGETS names (e.g. ".claude" → "claude").
115
+ // The matched platform is still used to select the right hook template.
116
116
  const dirName = basename(customPath).replace(/^\./, "");
117
117
  const knownPlatform = CLI_TARGETS.find((t) => t.name === dirName);
118
- const agentSubdir = knownPlatform?.agentSubdir ?? "agents";
119
118
  targets = [{
120
119
  name: dirName,
121
120
  dir: join(customPath, "skills"),
122
- agentDir: join(customPath, agentSubdir),
123
121
  platform: knownPlatform?.platform ?? dirName,
124
122
  }];
125
123
  console.log(`Custom path: ${customPath}\n`);
@@ -151,6 +149,20 @@ if (pathArg && typeof pathArg === "string" && pathArg !== "") {
151
149
 
152
150
  const cliFilter = (typeof cliArg === "string" && cliArg !== "") ? cliArg.split(",") : null;
153
151
  targets = cliFilter ? detected.filter((d) => cliFilter.includes(d.name)) : detected;
152
+
153
+ // A non-empty --cli filter that matches none of the detected CLIs must be a
154
+ // hard error. Otherwise targets is [], we copy zero skills, and exit 0 — a
155
+ // silent false success that looks like a clean install. Name the unmatched
156
+ // value(s) and what was actually detected so the user can correct the flag.
157
+ if (cliFilter && targets.length === 0) {
158
+ const detectedNames = detected.map((d) => d.name);
159
+ const unmatched = cliFilter.filter((n) => !detectedNames.includes(n));
160
+ console.error(
161
+ `Error: --cli filter matched no detected CLI. Unmatched: ${unmatched.join(", ")}. ` +
162
+ `Detected: ${detectedNames.join(", ")}.`
163
+ );
164
+ process.exit(1);
165
+ }
154
166
  }
155
167
 
156
168
  // Copy skills to each target CLI
@@ -169,31 +181,10 @@ for (const target of targets) {
169
181
  console.log(` ${skillDirs.length} skills installed`);
170
182
  }
171
183
 
172
- // Copy platform-specific agents
173
- const agentsSource = join(__dirname, "skills", "wicked-brain-agent", "platform");
174
-
175
- for (const target of targets) {
176
- const platformDir = join(agentsSource, target.platform);
177
- if (!existsSync(platformDir)) {
178
- console.log(` No agent definitions for ${target.name}, skipping agents`);
179
- continue;
180
- }
181
-
182
- if (!target.agentDir) continue;
183
-
184
- mkdirSync(target.agentDir, { recursive: true });
185
- const agentFiles = readdirSync(platformDir);
186
- let agentCount = 0;
187
-
188
- for (const file of agentFiles) {
189
- const src = join(platformDir, file);
190
- const dest = join(target.agentDir, file);
191
- cpSync(src, dest, { force: true });
192
- agentCount++;
193
- }
194
-
195
- console.log(` Installed ${agentCount} agents to ${target.agentDir}`);
196
- }
184
+ // Skills-only distribution: behavior that used to be materialized into
185
+ // per-platform native agent files now lives entirely in first-class skills
186
+ // (wicked-brain-consolidate / -onboard / -session-teardown / -context),
187
+ // copied above like any other skill. No agent materialization step remains.
197
188
 
198
189
  // Optional hook installation (--hooks flag). Goes through flagValue so
199
190
  // `--hooks=false` correctly disables; bare `--hooks` and `--hooks=true`
@@ -202,7 +193,7 @@ const installHooks = flagValue("hooks") === true;
202
193
 
203
194
  if (installHooks) {
204
195
  console.log("\nInstalling hooks...");
205
- const hooksSource = join(__dirname, "skills", "wicked-brain-agent", "hooks");
196
+ const hooksSource = join(__dirname, "skills", "wicked-brain-context", "hooks");
206
197
 
207
198
  for (const target of targets) {
208
199
  const hookFile = join(hooksSource, `${target.platform}-hooks.json`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wicked-brain",
3
- "version": "0.17.1",
3
+ "version": "0.18.0",
4
4
  "type": "module",
5
5
  "description": "Digital brain as skills for AI coding CLIs — no vector DB, no embeddings, no infrastructure",
6
6
  "keywords": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wicked-brain-server",
3
- "version": "0.17.1",
3
+ "version": "0.18.0",
4
4
  "type": "module",
5
5
  "description": "SQLite FTS5 search server for wicked-brain digital knowledge bases",
6
6
  "keywords": [
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: wicked-brain:batch
2
+ name: wicked-brain-batch
3
3
  description: |
4
4
  Pattern for batch operations that would otherwise fill context with repetitive
5
5
  tool calls. Detects the available runtime (Node, Python, shell), writes a
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: wicked-brain:compile
2
+ name: wicked-brain-compile
3
3
  description: |
4
4
  Synthesize wiki articles from brain chunks. Dispatches a compile subagent
5
5
  that identifies concept clusters in chunks and writes structured wiki
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: wicked-brain:configure
2
+ name: wicked-brain-configure
3
3
  description: |
4
4
  This skill should be used when the user says "configure brain CLI",
5
5
  "update CLAUDE.md from brain", "write brain orientation", or
@@ -38,7 +38,7 @@ Read frontmatter of top results, count `contains:` tag frequency. Top 10 tags =
38
38
 
39
39
  4. Read `{brain_path}/_meta/log.jsonl` (last 50 lines) for recent `search_miss` entries — these are knowledge gaps.
40
40
 
41
- 5. List available agents by reading `skills/wicked-brain-agent/agents/` at depth 0.
41
+ 5. Note the brain workflow skills available: `wicked-brain:context` (surface context), `wicked-brain:session-teardown` (capture learnings), `wicked-brain:consolidate` (maintenance), and `wicked-brain:onboard` (project understanding).
42
42
 
43
43
  ### Step 2: Detect CLI/IDE
44
44
 
@@ -85,10 +85,10 @@ Digital brain: {brain_id} | {total} indexed items | {chunks} chunks, {wiki} wiki
85
85
  - **Search/explore**: use `wicked-brain:search` — replaces Grep, Glob, and Agent(Explore) for any open-ended search
86
86
  - **Answer questions**: use `wicked-brain:query` — replaces Agent(Explore) for conceptual questions
87
87
  - **Wiki catalog**: use `wicked-brain:read` at depth 0/1 to browse wiki articles progressively
88
- - **Surface context**: call `wicked-brain:agent` (context) at the start of any new topic
89
- - **Capture learnings**: call `wicked-brain:agent` (session-teardown) at session end
88
+ - **Surface context**: call `wicked-brain:context` at the start of any new topic
89
+ - **Capture learnings**: call `wicked-brain:session-teardown` at session end
90
90
  - **Store a decision/pattern/gotcha**: call `wicked-brain:memory` (store mode)
91
- - **Available agents**: consolidate, context, session-teardown, onboard (via `wicked-brain:agent`)
91
+ - **Workflow skills**: `wicked-brain:consolidate`, `wicked-brain:context`, `wicked-brain:session-teardown`, `wicked-brain:onboard`
92
92
 
93
93
  ### Search result source types
94
94
 
@@ -104,9 +104,9 @@ Brain search/query results include `source_type` and `path` fields:
104
104
  - The server auto-starts on any `wicked-brain-call` / skill invocation — a "server not running" notice is NEVER a reason to skip the brain; just call the skill
105
105
  - Use `wicked-brain:search` for finding content ("find X", "where is Y", "look for Z", "show me W")
106
106
  - Use `wicked-brain:query` for questions ("what does X do", "how does Y work", "explain Z")
107
- - Use `wicked-brain:agent` (context) when starting a new topic or unfamiliar area
107
+ - Use `wicked-brain:context` when starting a new topic or unfamiliar area
108
108
  - Only fall back to Grep/Glob for **exact pattern matching** after the brain returns no results
109
- - Do NOT read brain files directly — always go through skills and agents
109
+ - Do NOT read brain files directly — always go through skills
110
110
  - Always pass `session_id` with search/query calls for access tracking
111
111
  - Capture non-obvious decisions, patterns, and gotchas with `wicked-brain:memory`
112
112
  - When search results include `source_type: wiki`, follow up with `wicked-brain:read` at depth 1-2
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: wicked-brain:confirm
2
+ name: wicked-brain-confirm
3
3
  description: |
4
4
  Confirm or contradict a brain link, adjusting its confidence score.
5
5
  Increases confidence when a link is confirmed by evidence, decreases it
@@ -1,19 +1,61 @@
1
- # consolidate
1
+ ---
2
+ name: wicked-brain:consolidate
3
+ description: |
4
+ Multi-pass brain consolidation - archive noise, promote patterns, merge
5
+ duplicates, build synonym map.
2
6
 
3
- ## Depth 0 Summary
4
- Four-pass lifecycle: archive noise, promote patterns, merge duplicates, build synonym map.
5
- Triggers: manual invocation via `wicked-brain:agent dispatch consolidate`, or after reviewing consolidation_hint entries in log.jsonl.
7
+ Use when: brain needs maintenance, after significant ingestion, or reviewing
8
+ consolidation_hint entries in log.jsonl.
9
+ model: sonnet
10
+ allowed-tools: Read, Write, Edit, Bash, Grep, Glob
11
+ context: fork
12
+ ---
6
13
 
7
- ## Depth 1 — Pipeline Steps
8
- Pass 1 (Archive): Call server candidates(archive) → review at depth 0 → check TTL expiry for memories → archive stale items + remove from index
9
- Pass 2 (Promote): Call server candidates(promote) → for chunks: log promote_candidate for memories: update tier + bump confidence
10
- Pass 3 (Merge): Read promote candidates at depth 2 LLM similarity comparison → keep highest-scored / archive duplicates / flag complementary for review
11
- Pass 4 (Synonyms): Aggregate synonym_hit/synonym_miss events from log build/update learned synonym map at _meta/synonyms.json
14
+ # wicked-brain:consolidate
15
+
16
+ You are a consolidation agent for the digital brain. This is a heavy,
17
+ multi-pass maintenance pipeline that runs in an isolated (forked) context so it
18
+ has a longer token budget and file-writing tools for large-scale work.
19
+
20
+ ## Overview (pipeline)
21
+
22
+ Four-pass lifecycle: archive noise, promote patterns, merge duplicates, build
23
+ synonym map.
24
+
25
+ - **Pass 1 (Archive)**: Call server candidates(archive) → review at depth 0 → check TTL expiry for memories → archive stale items + remove from index
26
+ - **Pass 2 (Promote)**: Call server candidates(promote) → for chunks: log promote_candidate → for memories: update tier + bump confidence
27
+ - **Pass 3 (Merge)**: Read promote candidates at depth 2 → LLM similarity comparison → keep highest-scored / archive duplicates / flag complementary for review
28
+ - **Pass 4 (Synonyms)**: Aggregate synonym_hit/synonym_miss events from log → build/update learned synonym map at _meta/synonyms.json
12
29
 
13
30
  Parameters: brain_path, port, session_id
14
31
  Depends on: server candidates action, memory frontmatter schema, wicked-brain:memory skill
15
32
 
16
- ## Depth 2 — Full Subagent Instructions
33
+ ## Config
34
+
35
+ Resolve the brain config via the shared resolution in
36
+ wicked-brain:init § "Resolving the brain config". In short: try
37
+ `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
38
+ to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
39
+ wicked-brain:init. Read the resolved file for brain path and server port.
40
+
41
+ Do NOT read a bare relative `_meta/config.json` — the model will resolve it
42
+ against the current working directory and brain files will end up in the
43
+ project root.
44
+
45
+ ## Bus event (start)
46
+
47
+ At the start of the run, emit a dispatch event (fire-and-forget — if the bus is
48
+ not installed, silently skip):
49
+
50
+ ```bash
51
+ npx wicked-bus emit \
52
+ --type "wicked.agent.dispatched" \
53
+ --domain "wicked-brain" \
54
+ --subdomain "brain.agent" \
55
+ --payload '{"agent":"consolidate","brain_id":"{brain_id}"}' 2>/dev/null || true
56
+ ```
57
+
58
+ ## Pipeline
17
59
 
18
60
  You are a consolidation agent for the digital brain at {brain_path}.
19
61
  Server: http://localhost:{port}/api
@@ -136,3 +178,25 @@ After all four passes, report:
136
178
  - Merged: {N} near-duplicates
137
179
  - Flagged for review: {N} complementary pairs
138
180
  - Synonyms: {N} added, {N} removed, {N} total in map
181
+
182
+ ## Bus event (completion)
183
+
184
+ On completion, emit the consolidation-complete event (fire-and-forget — if the
185
+ bus is not installed, silently skip):
186
+
187
+ ```bash
188
+ npx wicked-bus emit \
189
+ --type "wicked.brain.consolidated" \
190
+ --domain "wicked-brain" \
191
+ --subdomain "brain" \
192
+ --payload '{"brain_id":"{brain_id}","archived":{N},"promoted":{M},"merged":{P}}' 2>/dev/null || true
193
+ ```
194
+
195
+ ## Cross-Platform Notes
196
+
197
+ - `curl` is cross-platform (Windows 10+) — OK for server API calls.
198
+ - The `mv ... .archived-$(date +%s)` rename uses shell; on Windows use the
199
+ equivalent (`Move-Item` / `ren`) or the agent-native move with a
200
+ `.archived-{unix_seconds}` suffix. Preserve the `.archived-{timestamp}`
201
+ convention either way.
202
+ - All log/JSON appends should use forward-slash paths.
@@ -1,18 +1,71 @@
1
- # context
1
+ ---
2
+ name: wicked-brain:context
3
+ description: |
4
+ Surface relevant brain knowledge for the current prompt. Tiered routing - hot
5
+ path for simple prompts, fast path for complex.
2
6
 
3
- ## Depth 0 Summary
4
- Tiered knowledge surfacing for ambient context. Hot path for simple prompts (recent memories + high-confidence wiki). Fast path for complex prompts (full search + scoring pipeline).
7
+ Use when: starting a new topic/unfamiliar area, at the start of a work
8
+ session, prompt would benefit from prior decisions/patterns/wiki.
9
+ model: haiku
10
+ allowed-tools: Read, Bash, Grep, Glob
11
+ ---
12
+
13
+ # wicked-brain:context
14
+
15
+ You are a context assembly agent for the digital brain. This is a HOT-PATH
16
+ enrichment skill: it runs INLINE in the current turn (it is what the
17
+ UserPromptSubmit / BeforeAgent hook nudges) and must stay fast. It does NOT run
18
+ in a forked context — return pointers to the host agent in the same turn.
19
+
20
+ It emits a `wicked.agent.dispatched` bus event (see "Bus event" below) —
21
+ fire-and-forget and non-blocking, so the hot path never waits on it. Only reads
22
+ and returns pointers — no Write/Edit.
23
+
24
+ ## Overview (pipeline)
25
+
26
+ Tiered knowledge surfacing for ambient context. Hot path for simple prompts
27
+ (recent memories + high-confidence wiki). Fast path for complex prompts (full
28
+ search + scoring pipeline).
5
29
 
6
- ## Depth 1 — Pipeline Steps
7
30
  1. Classify prompt complexity (short/single-topic → hot, complex/multi-topic → fast)
8
- 2. Hot path: search recent memories (7 days) + wiki (confidence > 0.8), return depth 0
31
+ 2. Hot path: recent memories (7 days) + wiki (confidence > 0.8), return depth 0
9
32
  3. Fast path: decompose query → synonym-expand → search all content → score by keyword overlap + type + tier + recency → return depth 0
10
33
  4. Agent reads deeper (depth 1/2) on promising results as needed
11
34
 
12
35
  Parameters: brain_path, port, session_id, prompt (the user's current prompt text)
13
36
  Depends on: server search action, synonym expansion
14
37
 
15
- ## Depth 2 — Full Subagent Instructions
38
+ ## Config
39
+
40
+ Resolve the brain config via the shared resolution in
41
+ wicked-brain:init § "Resolving the brain config". In short: try
42
+ `~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
43
+ to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
44
+ wicked-brain:init. Read the resolved file for brain path and server port.
45
+
46
+ Do NOT read a bare relative `_meta/config.json` — the model will resolve it
47
+ against the current working directory and brain files will end up in the
48
+ project root.
49
+
50
+ ## Bus event
51
+
52
+ At the start of the run, emit a dispatch event (fire-and-forget — if the bus is
53
+ not installed, silently skip). Same type, domain, and subdomain as the sibling
54
+ skills (`wicked-brain-consolidate`, `wicked-brain-onboard`,
55
+ `wicked-brain-session-teardown`), with an `agent:context` payload.
56
+
57
+ Because this is the inline hot path, run the emit non-blocking (background it)
58
+ so returning pointers to the host agent never waits on it:
59
+
60
+ ```bash
61
+ npx wicked-bus emit \
62
+ --type "wicked.agent.dispatched" \
63
+ --domain "wicked-brain" \
64
+ --subdomain "brain.agent" \
65
+ --payload '{"agent":"context","brain_id":"{brain_id}"}' 2>/dev/null || true
66
+ ```
67
+
68
+ ## Pipeline
16
69
 
17
70
  You are a context assembly agent for the digital brain at {brain_path}.
18
71
  Server: http://localhost:{port}/api
@@ -86,3 +139,8 @@ Context (fast path, {N} results):
86
139
  - Do NOT inject context silently — return it to the host agent for decision
87
140
  - Do NOT run both paths — pick one based on Step 1 classification
88
141
  - Do NOT spend more than 5 search calls on the hot path
142
+
143
+ ## Cross-Platform Notes
144
+
145
+ - `curl` is cross-platform (Windows 10+) — OK for server API calls.
146
+ - This skill only reads (Read, Bash, Grep, Glob) — no file writes.
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: wicked-brain:dlq
2
+ name: wicked-brain-dlq
3
3
  description: |
4
4
  Inspect, replay, or drop dead-lettered events from wicked-brain's bus
5
5
  subscriber. The auto-memorize subscriber consumes `wicked.fact.extracted`
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: wicked-brain:enhance
2
+ name: wicked-brain-enhance
3
3
  description: |
4
4
  Fill gaps in brain knowledge. Dispatches an enhance subagent that identifies
5
5
  thin areas and writes inferred chunks to expand coverage.
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: wicked-brain:forget
2
+ name: wicked-brain-forget
3
3
  description: |
4
4
  Archive or delete a memory (or any indexed document) by id or path.
5
5
  Removes the document from the FTS index and renames the file with an
@@ -12,7 +12,7 @@ description: |
12
12
  # wicked-brain:forget
13
13
 
14
14
  Archive or hard-delete a memory by id or path. Wraps the server `remove` action
15
- and the archive-rename convention used by wicked-brain:agent dispatch consolidate.
15
+ and the archive-rename convention used by wicked-brain:consolidate.
16
16
 
17
17
  ## Cross-Platform Notes
18
18
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: wicked-brain:graph
2
+ name: wicked-brain-graph
3
3
  description: |
4
4
  Code-relationship graph queries — blast radius, callers, and lineage — backed
5
5
  by a codegraph static graph the brain owns. Answers "what breaks if I change X",
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: wicked-brain:ingest
2
+ name: wicked-brain-ingest
3
3
  description: |
4
4
  Ingest source files into the brain as structured chunks. Handles text files
5
5
  (md, txt, csv, html) deterministically and binary files (pdf, docx, pptx,
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: wicked-brain:init
2
+ name: wicked-brain-init
3
3
  description: |
4
4
  Initialize a new digital brain. Creates the directory structure, brain.json,
5
5
  and config. Auto-triggered on first use of any brain skill when no config exists.
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: wicked-brain:lint
2
+ name: wicked-brain-lint
3
3
  description: |
4
4
  Check brain health and fix issues. Dispatches a lint subagent that runs
5
5
  deterministic checks (broken links, orphans, stale entries) and semantic
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: wicked-brain:lsp
2
+ name: wicked-brain-lsp
3
3
  description: |
4
4
  Universal code intelligence via LSP. Queries language servers for definitions,
5
5
  references, symbols, call hierarchies, hover info, and diagnostics. Auto-installs
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: wicked-brain:memory
2
+ name: wicked-brain-memory
3
3
  description: |
4
4
  Store and recall experiential learnings (decisions, patterns, preferences,
5
5
  gotchas, discoveries) in the brain's memory system.
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: wicked-brain:migrate
2
+ name: wicked-brain-migrate
3
3
  description: |
4
4
  Migrate a flat brain at ~/.wicked-brain/ into the per-project layout at
5
5
  ~/.wicked-brain/projects/{name}/. Safe to run on already-migrated brains