wicked-brain 0.17.2 → 0.18.1
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 +22 -3
- package/install.mjs +33 -38
- package/package.json +1 -1
- package/server/package.json +1 -1
- package/skills/wicked-brain-configure/SKILL.md +6 -6
- package/skills/{wicked-brain-agent/agents/consolidate.md → wicked-brain-consolidate/SKILL.md} +74 -10
- package/skills/{wicked-brain-agent/agents/context.md → wicked-brain-context/SKILL.md} +64 -6
- package/skills/wicked-brain-forget/SKILL.md +1 -1
- package/skills/{wicked-brain-agent/agents/onboard.md → wicked-brain-onboard/SKILL.md} +87 -9
- package/skills/wicked-brain-review/SKILL.md +2 -2
- package/skills/{wicked-brain-agent/agents/session-teardown.md → wicked-brain-session-teardown/SKILL.md} +54 -5
- package/skills/wicked-brain-agent/SKILL.md +0 -95
- package/skills/wicked-brain-agent/platform/antigravity/wicked-brain-consolidate.md +0 -103
- package/skills/wicked-brain-agent/platform/antigravity/wicked-brain-context.md +0 -67
- package/skills/wicked-brain-agent/platform/antigravity/wicked-brain-onboard.md +0 -74
- package/skills/wicked-brain-agent/platform/antigravity/wicked-brain-session-teardown.md +0 -72
- package/skills/wicked-brain-agent/platform/claude/wicked-brain-consolidate.md +0 -106
- package/skills/wicked-brain-agent/platform/claude/wicked-brain-context.md +0 -70
- package/skills/wicked-brain-agent/platform/claude/wicked-brain-onboard.md +0 -100
- package/skills/wicked-brain-agent/platform/claude/wicked-brain-session-teardown.md +0 -75
- package/skills/wicked-brain-agent/platform/codex/wicked-brain-consolidate.toml +0 -104
- package/skills/wicked-brain-agent/platform/codex/wicked-brain-context.toml +0 -68
- package/skills/wicked-brain-agent/platform/codex/wicked-brain-onboard.toml +0 -75
- package/skills/wicked-brain-agent/platform/codex/wicked-brain-session-teardown.toml +0 -73
- package/skills/wicked-brain-agent/platform/copilot/wicked-brain-consolidate.agent.md +0 -105
- package/skills/wicked-brain-agent/platform/copilot/wicked-brain-context.agent.md +0 -69
- package/skills/wicked-brain-agent/platform/copilot/wicked-brain-onboard.agent.md +0 -76
- package/skills/wicked-brain-agent/platform/copilot/wicked-brain-session-teardown.agent.md +0 -74
- package/skills/wicked-brain-agent/platform/cursor/wicked-brain-consolidate.md +0 -104
- package/skills/wicked-brain-agent/platform/cursor/wicked-brain-context.md +0 -68
- package/skills/wicked-brain-agent/platform/cursor/wicked-brain-onboard.md +0 -75
- package/skills/wicked-brain-agent/platform/cursor/wicked-brain-session-teardown.md +0 -73
- package/skills/wicked-brain-agent/platform/gemini/wicked-brain-consolidate.md +0 -107
- package/skills/wicked-brain-agent/platform/gemini/wicked-brain-context.md +0 -71
- package/skills/wicked-brain-agent/platform/gemini/wicked-brain-onboard.md +0 -78
- package/skills/wicked-brain-agent/platform/gemini/wicked-brain-session-teardown.md +0 -76
- package/skills/wicked-brain-agent/platform/kiro/wicked-brain-consolidate.json +0 -17
- package/skills/wicked-brain-agent/platform/kiro/wicked-brain-context.json +0 -16
- package/skills/wicked-brain-agent/platform/kiro/wicked-brain-onboard.json +0 -17
- package/skills/wicked-brain-agent/platform/kiro/wicked-brain-session-teardown.json +0 -17
- /package/skills/{wicked-brain-agent → wicked-brain-context}/hooks/claude-hooks.json +0 -0
- /package/skills/{wicked-brain-agent → wicked-brain-context}/hooks/copilot-hooks.json +0 -0
- /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 **
|
|
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. **
|
|
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
|
|
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
|
|
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,16 @@ 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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{ name: "
|
|
57
|
-
{ name: "
|
|
51
|
+
// Paths verified against each CLI's own source of truth:
|
|
52
|
+
// - Copilot CLI loads personal custom skills from ~/.copilot/skills/ (not ~/.github/skills).
|
|
53
|
+
// - Antigravity / Gemini CLI load global custom skills from ~/.gemini/config/skills/
|
|
54
|
+
// (confirmed by the Antigravity agent; not ~/.gemini/skills or ~/.antigravity/skills).
|
|
55
|
+
{ name: "gemini", dir: join(home, ".gemini", "config", "skills"), platform: "gemini" },
|
|
56
|
+
{ name: "copilot", dir: join(home, ".copilot", "skills"), platform: "copilot" },
|
|
57
|
+
{ name: "codex", dir: join(home, ".codex", "skills"), platform: "codex" },
|
|
58
|
+
{ name: "cursor", dir: join(home, ".cursor", "skills"), platform: "cursor" },
|
|
59
|
+
{ name: "kiro", dir: join(home, ".kiro", "skills"), platform: "kiro" },
|
|
60
|
+
{ name: "antigravity", dir: join(home, ".gemini", "config", "skills"), platform: "antigravity" },
|
|
58
61
|
];
|
|
59
62
|
|
|
60
63
|
// Identity-marker gate for claude candidates. Without this, probing
|
|
@@ -112,14 +115,13 @@ let targets;
|
|
|
112
115
|
|
|
113
116
|
if (pathArg && typeof pathArg === "string" && pathArg !== "") {
|
|
114
117
|
const customPath = resolve(pathArg.replace(/^~/, () => home));
|
|
115
|
-
// Strip leading dot to match CLI_TARGETS names (e.g. ".claude" → "claude")
|
|
118
|
+
// Strip leading dot to match CLI_TARGETS names (e.g. ".claude" → "claude").
|
|
119
|
+
// The matched platform is still used to select the right hook template.
|
|
116
120
|
const dirName = basename(customPath).replace(/^\./, "");
|
|
117
121
|
const knownPlatform = CLI_TARGETS.find((t) => t.name === dirName);
|
|
118
|
-
const agentSubdir = knownPlatform?.agentSubdir ?? "agents";
|
|
119
122
|
targets = [{
|
|
120
123
|
name: dirName,
|
|
121
124
|
dir: join(customPath, "skills"),
|
|
122
|
-
agentDir: join(customPath, agentSubdir),
|
|
123
125
|
platform: knownPlatform?.platform ?? dirName,
|
|
124
126
|
}];
|
|
125
127
|
console.log(`Custom path: ${customPath}\n`);
|
|
@@ -151,6 +153,20 @@ if (pathArg && typeof pathArg === "string" && pathArg !== "") {
|
|
|
151
153
|
|
|
152
154
|
const cliFilter = (typeof cliArg === "string" && cliArg !== "") ? cliArg.split(",") : null;
|
|
153
155
|
targets = cliFilter ? detected.filter((d) => cliFilter.includes(d.name)) : detected;
|
|
156
|
+
|
|
157
|
+
// A non-empty --cli filter that matches none of the detected CLIs must be a
|
|
158
|
+
// hard error. Otherwise targets is [], we copy zero skills, and exit 0 — a
|
|
159
|
+
// silent false success that looks like a clean install. Name the unmatched
|
|
160
|
+
// value(s) and what was actually detected so the user can correct the flag.
|
|
161
|
+
if (cliFilter && targets.length === 0) {
|
|
162
|
+
const detectedNames = detected.map((d) => d.name);
|
|
163
|
+
const unmatched = cliFilter.filter((n) => !detectedNames.includes(n));
|
|
164
|
+
console.error(
|
|
165
|
+
`Error: --cli filter matched no detected CLI. Unmatched: ${unmatched.join(", ")}. ` +
|
|
166
|
+
`Detected: ${detectedNames.join(", ")}.`
|
|
167
|
+
);
|
|
168
|
+
process.exit(1);
|
|
169
|
+
}
|
|
154
170
|
}
|
|
155
171
|
|
|
156
172
|
// Copy skills to each target CLI
|
|
@@ -169,31 +185,10 @@ for (const target of targets) {
|
|
|
169
185
|
console.log(` ${skillDirs.length} skills installed`);
|
|
170
186
|
}
|
|
171
187
|
|
|
172
|
-
//
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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
|
-
}
|
|
188
|
+
// Skills-only distribution: behavior that used to be materialized into
|
|
189
|
+
// per-platform native agent files now lives entirely in first-class skills
|
|
190
|
+
// (wicked-brain-consolidate / -onboard / -session-teardown / -context),
|
|
191
|
+
// copied above like any other skill. No agent materialization step remains.
|
|
197
192
|
|
|
198
193
|
// Optional hook installation (--hooks flag). Goes through flagValue so
|
|
199
194
|
// `--hooks=false` correctly disables; bare `--hooks` and `--hooks=true`
|
|
@@ -202,7 +197,7 @@ const installHooks = flagValue("hooks") === true;
|
|
|
202
197
|
|
|
203
198
|
if (installHooks) {
|
|
204
199
|
console.log("\nInstalling hooks...");
|
|
205
|
-
const hooksSource = join(__dirname, "skills", "wicked-brain-
|
|
200
|
+
const hooksSource = join(__dirname, "skills", "wicked-brain-context", "hooks");
|
|
206
201
|
|
|
207
202
|
for (const target of targets) {
|
|
208
203
|
const hookFile = join(hooksSource, `${target.platform}-hooks.json`);
|
package/package.json
CHANGED
package/server/package.json
CHANGED
|
@@ -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.
|
|
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:
|
|
89
|
-
- **Capture learnings**: call `wicked-brain:
|
|
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
|
-
- **
|
|
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:
|
|
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
|
|
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
|
package/skills/{wicked-brain-agent/agents/consolidate.md → wicked-brain-consolidate/SKILL.md}
RENAMED
|
@@ -1,19 +1,61 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
-
|
|
4
|
-
|
|
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:
|
|
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
|
-
##
|
|
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.
|
|
@@ -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:
|
|
15
|
+
and the archive-rename convention used by wicked-brain:consolidate.
|
|
16
16
|
|
|
17
17
|
## Cross-Platform Notes
|
|
18
18
|
|
|
@@ -1,9 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
name: wicked-brain:onboard
|
|
3
|
+
description: |
|
|
4
|
+
Full project understanding - detect repo mode, scan, investigate 5
|
|
5
|
+
perspectives, extract symbols, ingest chunks, compile support wiki,
|
|
6
|
+
configure CLI.
|
|
7
|
+
|
|
8
|
+
Use when: onboarding a new project, re-onboarding after big changes, brain
|
|
9
|
+
has no project wiki yet.
|
|
10
|
+
model: sonnet
|
|
11
|
+
allowed-tools: Read, Write, Edit, Bash, Grep, Glob
|
|
12
|
+
context: fork
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# wicked-brain:onboard
|
|
16
|
+
|
|
17
|
+
You are an onboarding agent for the digital brain. This is a heavy
|
|
18
|
+
project-understanding pipeline that runs in an isolated (forked) context so it
|
|
19
|
+
has a longer token budget and file-writing tools for large-scale compilation.
|
|
20
|
+
|
|
21
|
+
## Overview (pipeline)
|
|
2
22
|
|
|
3
|
-
|
|
4
|
-
|
|
23
|
+
Full project understanding pipeline. Scans project, extracts findings from 5
|
|
24
|
+
perspectives (product, engineering, quality, ops, data), ingests as structured
|
|
25
|
+
chunks, compiles a progressive-loading support wiki, and configures the CLI.
|
|
5
26
|
|
|
6
|
-
## Depth 1 — Pipeline Steps
|
|
7
27
|
0. Detect: run `wicked-brain-onboard-wiki` to classify repo mode, write `.wicked-brain/mode.json`, and stamp the contributor-wiki pointer into CLAUDE.md / AGENTS.md if present
|
|
8
28
|
1. Scan: directory structure, key files, languages, frameworks, dependencies
|
|
9
29
|
2. Investigate: gather facts from each of the 5 perspectives
|
|
@@ -15,13 +35,40 @@ Full project understanding pipeline. Scans project, extracts findings from 5 per
|
|
|
15
35
|
Parameters: brain_path, port, project_path (defaults to cwd)
|
|
16
36
|
Depends on: wicked-brain:ingest, wicked-brain:compile, wicked-brain:configure
|
|
17
37
|
|
|
18
|
-
##
|
|
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 (start)
|
|
51
|
+
|
|
52
|
+
At the start of the run, emit a dispatch event (fire-and-forget — if the bus is
|
|
53
|
+
not installed, silently skip):
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npx wicked-bus emit \
|
|
57
|
+
--type "wicked.agent.dispatched" \
|
|
58
|
+
--domain "wicked-brain" \
|
|
59
|
+
--subdomain "brain.agent" \
|
|
60
|
+
--payload '{"agent":"onboard","brain_id":"{brain_id}"}' 2>/dev/null || true
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Pipeline
|
|
19
64
|
|
|
20
65
|
You are an onboarding agent for the digital brain at {brain_path}.
|
|
21
66
|
Server: http://localhost:{port}/api
|
|
22
67
|
Project: {project_path}
|
|
23
68
|
|
|
24
|
-
Your job: deeply understand a project from 5 perspectives and produce a support
|
|
69
|
+
Your job: deeply understand a project from 5 perspectives and produce a support
|
|
70
|
+
wiki that serves engineers, testers, ops, and product owners — all through
|
|
71
|
+
progressive loading so only what's needed gets loaded.
|
|
25
72
|
|
|
26
73
|
### Step 0: Detect repo mode and stamp wiki pointer
|
|
27
74
|
|
|
@@ -80,9 +127,19 @@ Gather facts for each perspective. You'll write these as chunks in Step 4.
|
|
|
80
127
|
- Module map: which file owns what responsibility
|
|
81
128
|
- Data flow: request lifecycle from entry to storage to response
|
|
82
129
|
- Extension points: where to add new functionality (new action, new migration, new skill)
|
|
130
|
+
- Conventions (so new work matches the repo's style):
|
|
131
|
+
- **Naming**: file, function, and variable naming patterns
|
|
132
|
+
- **Code style**: formatting, comment conventions, and import
|
|
133
|
+
ordering/grouping — detect from config files (`.eslintrc*`, `.eslintrc.json`,
|
|
134
|
+
`.prettierrc`, `pyproject.toml` ruff/black config, `rustfmt.toml`) and from
|
|
135
|
+
grouping in existing source
|
|
136
|
+
- **Build/Deploy/CI-CD**: build commands, deploy scripts, and CI/CD patterns
|
|
137
|
+
(`.github/workflows/`, Makefile targets, package.json scripts, etc.)
|
|
83
138
|
|
|
84
139
|
#### Quality perspective
|
|
85
|
-
- Test infrastructure: framework, runner command, test file locations
|
|
140
|
+
- Test infrastructure: framework, runner command, test file locations and
|
|
141
|
+
naming patterns — look for `*.test.*`, `*.spec.*`, `test_*.py`, and files
|
|
142
|
+
under `test/` or `__tests__/`
|
|
86
143
|
- Test coverage: what's tested, what's manual-only
|
|
87
144
|
- Functional capabilities: every feature × how to verify it works
|
|
88
145
|
- Regression requirements: what MUST pass before a release
|
|
@@ -177,7 +234,20 @@ List symbols grouped by module/directory:
|
|
|
177
234
|
|
|
178
235
|
Use standard chunk frontmatter with rich synonym-expanded `contains:` tags.
|
|
179
236
|
|
|
180
|
-
|
|
237
|
+
#### Monorepo guidance
|
|
238
|
+
|
|
239
|
+
If the project has multiple top-level packages or apps (e.g., a `packages/`,
|
|
240
|
+
`apps/`, or `services/` directory with independent `package.json` / `pyproject.toml`
|
|
241
|
+
files), treat each package as a separate chunk group:
|
|
242
|
+
- Write chunks to `{brain_path}/chunks/extracted/project-{safe_project_name}-{package_name}/`
|
|
243
|
+
- Also write a shared overview chunk at `project-{safe_project_name}/chunk-000-overview.md`
|
|
244
|
+
that summarises the monorepo layout, inter-package relationships, and shared tooling.
|
|
245
|
+
|
|
246
|
+
#### Re-onboarding
|
|
247
|
+
|
|
248
|
+
Re-onboarding is triggered **manually** by the user saying "re-onboard this
|
|
249
|
+
project" (or equivalent). It does not run automatically. When re-onboarding
|
|
250
|
+
(chunks already exist), follow the archive-then-replace pattern:
|
|
181
251
|
1. Remove old chunks from index via server API
|
|
182
252
|
2. Archive old chunk directory with `.archived-{timestamp}` suffix
|
|
183
253
|
3. Write new chunks
|
|
@@ -228,7 +298,7 @@ returns at depth 1. Put detail after the first paragraph.
|
|
|
228
298
|
| Article | Depth 0 answers | Depth 1 answers | Depth 2 answers |
|
|
229
299
|
|---------|-----------------|-----------------|-----------------|
|
|
230
300
|
| product.md | "How many features?" | "What are the features?" | "How do I use each one? What are the limits?" |
|
|
231
|
-
| engineering.md | "How many modules/deps?" | "What are the components and how do they connect?" | "What symbols does module X export? How do I extend it?" |
|
|
301
|
+
| engineering.md | "How many modules/deps?" | "What are the components and how do they connect?" | "What symbols does module X export? How do I extend it? What naming/code-style/test/build conventions must I match?" |
|
|
232
302
|
| quality.md | "What's the test coverage?" | "What capabilities need testing?" | "How do I verify capability X works? What are the edge cases?" |
|
|
233
303
|
| operations.md | "How many config files?" | "What can go wrong?" | "How do I fix X? Full troubleshooting playbook." |
|
|
234
304
|
| data.md | "What data sources?" | "What's the schema?" | "What are the constraints? How does the lifecycle work?" |
|
|
@@ -248,3 +318,11 @@ Report what was onboarded:
|
|
|
248
318
|
- Chunks created: {N} (6 perspective-based)
|
|
249
319
|
- Wiki articles: {list of 5 articles}
|
|
250
320
|
- CLI config updated: {file}
|
|
321
|
+
|
|
322
|
+
## Cross-Platform Notes
|
|
323
|
+
|
|
324
|
+
- `curl` is cross-platform (Windows 10+) — OK for server API calls.
|
|
325
|
+
- The `.archived-{timestamp}` rename on re-onboarding uses shell on
|
|
326
|
+
macOS/Linux; on Windows use the equivalent move. Preserve the
|
|
327
|
+
`.archived-{timestamp}` suffix convention either way.
|
|
328
|
+
- All paths must use forward slashes.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: wicked-brain-review
|
|
3
3
|
description: |
|
|
4
4
|
Browse stored memories with filters on type, tier, and recency. Read-only —
|
|
5
|
-
use wicked-brain:forget to archive or wicked-brain:
|
|
5
|
+
use wicked-brain:forget to archive or wicked-brain:consolidate
|
|
6
6
|
to promote.
|
|
7
7
|
|
|
8
8
|
Use when: "review my memories", "browse decisions", "what have I stored",
|
|
@@ -79,7 +79,7 @@ Age is derived from `indexed_at` relative to now (`Xd` / `Xh`).
|
|
|
79
79
|
|
|
80
80
|
After the list, suggest one of:
|
|
81
81
|
- `wicked-brain:forget path=…` to archive a specific entry
|
|
82
|
-
- `wicked-brain:
|
|
82
|
+
- `wicked-brain:consolidate` to promote patterns and drop expired entries
|
|
83
83
|
- `wicked-brain:retag` if many entries have thin `contains:` arrays
|
|
84
84
|
|
|
85
85
|
## Notes
|