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
|
@@ -1,9 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
name: wicked-brain:session-teardown
|
|
3
|
+
description: |
|
|
4
|
+
Capture session learnings - decisions, patterns, gotchas, discoveries - as
|
|
5
|
+
brain memories before session ends.
|
|
6
|
+
|
|
7
|
+
Use when: session/topic is wrapping up, before /clear or exit, user says
|
|
8
|
+
capture what we learned.
|
|
9
|
+
model: sonnet
|
|
10
|
+
allowed-tools: Read, Write, Edit, Bash, Grep, Glob
|
|
11
|
+
context: fork
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# wicked-brain:session-teardown
|
|
15
|
+
|
|
16
|
+
You are a session teardown agent for the digital brain. This runs in an
|
|
17
|
+
isolated (forked) context so it has a longer token budget and file-writing
|
|
18
|
+
tools to review the conversation and persist learnings.
|
|
2
19
|
|
|
3
|
-
##
|
|
4
|
-
|
|
20
|
+
## Overview (pipeline)
|
|
21
|
+
|
|
22
|
+
Capture session learnings before exit. Reviews conversation for decisions,
|
|
23
|
+
patterns, gotchas, and discoveries. Stores each as a memory via
|
|
24
|
+
wicked-brain:memory.
|
|
5
25
|
|
|
6
|
-
## Depth 1 — Pipeline Steps
|
|
7
26
|
1. Review conversation for memorable content (decisions, patterns, gotchas, discoveries)
|
|
8
27
|
2. For each finding: classify type, generate tags, determine TTL
|
|
9
28
|
3. Store via wicked-brain:memory skill (store mode)
|
|
@@ -12,7 +31,32 @@ Capture session learnings before exit. Reviews conversation for decisions, patte
|
|
|
12
31
|
Parameters: brain_path, port, session_id
|
|
13
32
|
Depends on: wicked-brain:memory skill
|
|
14
33
|
|
|
15
|
-
##
|
|
34
|
+
## Config
|
|
35
|
+
|
|
36
|
+
Resolve the brain config via the shared resolution in
|
|
37
|
+
wicked-brain:init § "Resolving the brain config". In short: try
|
|
38
|
+
`~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
|
|
39
|
+
to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
|
|
40
|
+
wicked-brain:init. Read the resolved file for brain path and server port.
|
|
41
|
+
|
|
42
|
+
Do NOT read a bare relative `_meta/config.json` — the model will resolve it
|
|
43
|
+
against the current working directory and brain files will end up in the
|
|
44
|
+
project root.
|
|
45
|
+
|
|
46
|
+
## Bus event (start)
|
|
47
|
+
|
|
48
|
+
At the start of the run, emit a dispatch event (fire-and-forget — if the bus is
|
|
49
|
+
not installed, silently skip):
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx wicked-bus emit \
|
|
53
|
+
--type "wicked.agent.dispatched" \
|
|
54
|
+
--domain "wicked-brain" \
|
|
55
|
+
--subdomain "brain.agent" \
|
|
56
|
+
--payload '{"agent":"session-teardown","brain_id":"{brain_id}"}' 2>/dev/null || true
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Pipeline
|
|
16
60
|
|
|
17
61
|
You are a session teardown agent for the digital brain at {brain_path}.
|
|
18
62
|
Server: http://localhost:{port}/api
|
|
@@ -82,3 +126,8 @@ Report what was captured:
|
|
|
82
126
|
- Don't store implementation details — store the *why* and *what*, not the *how*
|
|
83
127
|
- Don't duplicate information already in the brain — search first if unsure
|
|
84
128
|
- If nothing valuable was discussed, say so and store nothing
|
|
129
|
+
|
|
130
|
+
## Cross-Platform Notes
|
|
131
|
+
|
|
132
|
+
- `curl` is cross-platform (Windows 10+) — OK for server API calls.
|
|
133
|
+
- Memory files and log appends must use forward-slash paths.
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: wicked-brain-agent
|
|
3
|
-
description: |
|
|
4
|
-
This skill should be used when the user says "list brain agents",
|
|
5
|
-
"dispatch the consolidation agent", "run brain context assembly",
|
|
6
|
-
"onboard a new project", or "session teardown". Factory skill for listing
|
|
7
|
-
and dispatching wicked-brain agents. Agents enforce multi-step pipelines
|
|
8
|
-
for consolidation, context assembly, session teardown, and project
|
|
9
|
-
onboarding.
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
# wicked-brain:agent
|
|
13
|
-
|
|
14
|
-
Factory skill for wicked-brain agents. Lists available agents and dispatches them.
|
|
15
|
-
|
|
16
|
-
## Config
|
|
17
|
-
|
|
18
|
-
Resolve the brain config via the shared resolution in
|
|
19
|
-
wicked-brain:init § "Resolving the brain config". In short: try
|
|
20
|
-
`~/.wicked-brain/projects/{cwd_basename}/_meta/config.json` first, fall back
|
|
21
|
-
to `~/.wicked-brain/_meta/config.json` (legacy flat), else trigger
|
|
22
|
-
wicked-brain:init. Read the resolved file for brain path and server port.
|
|
23
|
-
|
|
24
|
-
Do NOT read a bare relative `_meta/config.json` — the model will resolve it
|
|
25
|
-
against the current working directory and brain files will end up in the
|
|
26
|
-
project root.
|
|
27
|
-
|
|
28
|
-
## Parameters
|
|
29
|
-
|
|
30
|
-
- **action** (required): `list` or `dispatch`
|
|
31
|
-
- **agent** (dispatch mode): name of agent to dispatch (`consolidate`, `context`, `session-teardown`, `onboard`)
|
|
32
|
-
- **depth** (list mode, optional): 0 (summary), 1 (pipeline steps), 2 (full instructions). Default: 0.
|
|
33
|
-
- **params** (dispatch mode, optional): parameters to pass to the agent
|
|
34
|
-
|
|
35
|
-
## List Mode
|
|
36
|
-
|
|
37
|
-
Read agent definitions from the `agents/` subdirectory relative to this skill file. Return at requested depth.
|
|
38
|
-
|
|
39
|
-
**Depth 0** — one-line summaries:
|
|
40
|
-
- `consolidate`: Three-pass lifecycle — archive noise, promote patterns, merge duplicates
|
|
41
|
-
- `context`: Tiered knowledge surfacing — hot path for simple prompts, fast path for complex
|
|
42
|
-
- `session-teardown`: Capture session learnings — decisions, patterns, gotchas into memory
|
|
43
|
-
- `onboard`: Full project understanding — scan, trace, ingest, compile, configure
|
|
44
|
-
|
|
45
|
-
**Depth 1** — pipeline steps (read the agent's `## Depth 1` section)
|
|
46
|
-
|
|
47
|
-
**Depth 2** — full subagent instructions (read the agent's `## Depth 2` section)
|
|
48
|
-
|
|
49
|
-
## Dispatch Mode
|
|
50
|
-
|
|
51
|
-
Dispatching a named agent (rather than running inline) gives it isolated
|
|
52
|
-
context, a longer token budget, and access to file-writing tools. This makes
|
|
53
|
-
it better suited for heavy background tasks — consolidation, full project
|
|
54
|
-
onboarding, or large-scale compilation — where inline execution would exhaust
|
|
55
|
-
context or produce incomplete results.
|
|
56
|
-
|
|
57
|
-
1. Read the requested agent's `.md` file from `agents/` at depth 2
|
|
58
|
-
2. Dispatch as a subagent with those instructions using the host CLI's mechanism:
|
|
59
|
-
- Claude Code: use `Agent` tool
|
|
60
|
-
- Gemini CLI: `@agent_name` dispatch
|
|
61
|
-
- Copilot CLI: `/agent` command
|
|
62
|
-
- Other CLIs: inline execution (run the pipeline steps in current context)
|
|
63
|
-
3. Pass brain_path, port, and any additional params to the subagent
|
|
64
|
-
|
|
65
|
-
If the host CLI does not support subagent dispatch, fall back to inline execution — run the pipeline steps directly in the current context.
|
|
66
|
-
|
|
67
|
-
## Bus Events
|
|
68
|
-
|
|
69
|
-
When dispatching an agent, emit:
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
npx wicked-bus emit \
|
|
73
|
-
--type "wicked.agent.dispatched" \
|
|
74
|
-
--domain "wicked-brain" \
|
|
75
|
-
--subdomain "brain.agent" \
|
|
76
|
-
--payload '{"agent":"{agent_name}","brain_id":"{brain_id}"}' 2>/dev/null || true
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
The consolidate agent should also emit `wicked.brain.consolidated` on completion:
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
npx wicked-bus emit \
|
|
83
|
-
--type "wicked.brain.consolidated" \
|
|
84
|
-
--domain "wicked-brain" \
|
|
85
|
-
--subdomain "brain" \
|
|
86
|
-
--payload '{"brain_id":"{brain_id}","archived":{N},"promoted":{M},"merged":{P}}' 2>/dev/null || true
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Fire-and-forget — if the bus is not installed, silently skip.
|
|
90
|
-
|
|
91
|
-
## Cross-Platform Notes
|
|
92
|
-
|
|
93
|
-
- Agent definitions are portable markdown — they work on all platforms
|
|
94
|
-
- Dispatch mechanism varies by CLI but instructions are identical
|
|
95
|
-
- Factory skill uses Read tool to load agent files (not shell commands)
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
# wicked-brain-consolidate
|
|
2
|
-
|
|
3
|
-
Three-pass brain consolidation — archive noise, promote patterns, merge duplicates. Use when brain needs maintenance or after significant ingestion.
|
|
4
|
-
|
|
5
|
-
You are a consolidation agent for the digital brain at {brain_path}.
|
|
6
|
-
Server: http://localhost:{port}/api
|
|
7
|
-
|
|
8
|
-
### Pass 1: Archive (drop noise)
|
|
9
|
-
|
|
10
|
-
1. Get archive candidates:
|
|
11
|
-
```bash
|
|
12
|
-
curl -s -X POST http://localhost:{port}/api \
|
|
13
|
-
-H "Content-Type: application/json" \
|
|
14
|
-
-d '{"action":"candidates","params":{"mode":"archive","limit":50}}'
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
2. For each candidate, read frontmatter at depth 0 using the Read tool.
|
|
18
|
-
|
|
19
|
-
3. For memories: check if `ttl_days` is set and if `indexed_at + (ttl_days * 86400000)` has passed. If expired, archive regardless of other signals.
|
|
20
|
-
|
|
21
|
-
4. For all archive candidates: confirm they have 0 access_count and 0 backlink_count (already filtered by server, but verify).
|
|
22
|
-
|
|
23
|
-
5. Archive each confirmed candidate:
|
|
24
|
-
- Call server to remove from index:
|
|
25
|
-
```bash
|
|
26
|
-
curl -s -X POST http://localhost:{port}/api \
|
|
27
|
-
-H "Content-Type: application/json" \
|
|
28
|
-
-d '{"action":"remove","params":{"id":"{doc_id}"}}'
|
|
29
|
-
```
|
|
30
|
-
- Rename the file with `.archived-{timestamp}` suffix using shell:
|
|
31
|
-
```bash
|
|
32
|
-
mv "{brain_path}/{path}" "{brain_path}/{path}.archived-$(date +%s)"
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
6. Log results:
|
|
36
|
-
Append to `{brain_path}/_meta/log.jsonl`:
|
|
37
|
-
```json
|
|
38
|
-
{"ts":"{ISO}","op":"consolidate_archive","count":{N},"paths":["{archived paths}"],"author":"agent:consolidate"}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### Pass 2: Promote (crystallize patterns)
|
|
42
|
-
|
|
43
|
-
1. Get promote candidates:
|
|
44
|
-
```bash
|
|
45
|
-
curl -s -X POST http://localhost:{port}/api \
|
|
46
|
-
-H "Content-Type: application/json" \
|
|
47
|
-
-d '{"action":"candidates","params":{"mode":"promote","limit":30}}'
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
2. Read each candidate's frontmatter at depth 1.
|
|
51
|
-
|
|
52
|
-
3. Get access log for each candidate:
|
|
53
|
-
```bash
|
|
54
|
-
curl -s -X POST http://localhost:{port}/api \
|
|
55
|
-
-H "Content-Type: application/json" \
|
|
56
|
-
-d '{"action":"access_log","params":{"id":"{doc_id}"}}'
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
4. For **memory/** paths — apply tier promotion:
|
|
60
|
-
- If tier is `working` AND (session_diversity >= 3 OR access_count >= 5):
|
|
61
|
-
Update frontmatter: `tier: episodic`, `confidence: 0.7`
|
|
62
|
-
- If tier is `episodic` AND (access_count >= 10 OR backlink_count >= 3):
|
|
63
|
-
Update frontmatter: `tier: semantic`, `confidence: 0.9`
|
|
64
|
-
- Use the Edit tool to update frontmatter in-place.
|
|
65
|
-
|
|
66
|
-
5. For **chunks/** paths — log as compile candidates (don't compile inline):
|
|
67
|
-
Append to `{brain_path}/_meta/log.jsonl`:
|
|
68
|
-
```json
|
|
69
|
-
{"ts":"{ISO}","op":"promote_candidate","path":"{chunk_path}","access_count":{N},"session_diversity":{N},"backlink_count":{N},"author":"agent:consolidate"}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
6. Log promote results:
|
|
73
|
-
```json
|
|
74
|
-
{"ts":"{ISO}","op":"consolidate_promote","memories_promoted":{N},"chunks_flagged":{N},"author":"agent:consolidate"}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Pass 3: Merge (deduplicate)
|
|
78
|
-
|
|
79
|
-
1. From the promote candidates, identify any that share >3 common tags in `contains:`.
|
|
80
|
-
|
|
81
|
-
2. For each potential cluster, read candidates at depth 2 (full content).
|
|
82
|
-
|
|
83
|
-
3. Compare content semantically. Classify each pair as:
|
|
84
|
-
- **Near-duplicate**: same information, different wording — keep the one with higher access_count + backlink_count, archive the other
|
|
85
|
-
- **Complementary**: related but distinct information — log as merge_candidate for manual review
|
|
86
|
-
- **Unrelated**: despite shared tags, content is different — skip
|
|
87
|
-
|
|
88
|
-
4. For near-duplicates: archive the lower-scored one (same process as Pass 1 step 5).
|
|
89
|
-
|
|
90
|
-
5. Log merge results:
|
|
91
|
-
Append to `{brain_path}/_meta/log.jsonl`:
|
|
92
|
-
```json
|
|
93
|
-
{"ts":"{ISO}","op":"consolidate_merge","merged":{N},"flagged_for_review":{N},"author":"agent:consolidate"}
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### Summary
|
|
97
|
-
|
|
98
|
-
After all three passes, report:
|
|
99
|
-
- Archived: {N} items
|
|
100
|
-
- Promoted: {N} memories ({N} working->episodic, {N} episodic->semantic)
|
|
101
|
-
- Compile candidates flagged: {N} chunks
|
|
102
|
-
- Merged: {N} near-duplicates
|
|
103
|
-
- Flagged for review: {N} complementary pairs
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
# wicked-brain-context
|
|
2
|
-
|
|
3
|
-
Surface relevant brain knowledge for the current conversation. Tiered routing — hot path for simple prompts, fast path for complex.
|
|
4
|
-
|
|
5
|
-
You are a context assembly agent for the digital brain at {brain_path}.
|
|
6
|
-
Server: http://localhost:{port}/api
|
|
7
|
-
|
|
8
|
-
Your job: surface relevant brain knowledge for the current prompt. Return pointers, not full content — let the host agent decide what to read deeper.
|
|
9
|
-
|
|
10
|
-
### Step 1: Classify prompt complexity
|
|
11
|
-
|
|
12
|
-
Analyze the prompt:
|
|
13
|
-
- **Hot path** if: prompt is < 20 words, single topic, simple question, or a follow-up
|
|
14
|
-
- **Fast path** if: prompt is > 20 words, multi-topic, requires cross-domain knowledge, or is a new conversation thread
|
|
15
|
-
|
|
16
|
-
### Step 2a: Hot Path (simple prompts)
|
|
17
|
-
|
|
18
|
-
Search for recent memories (last 7 days):
|
|
19
|
-
```bash
|
|
20
|
-
curl -s -X POST http://localhost:{port}/api \
|
|
21
|
-
-H "Content-Type: application/json" \
|
|
22
|
-
-d '{"action":"search","params":{"query":"{key terms from prompt}","limit":5,"since":"{ISO date 7 days ago}","session_id":"{session_id}"}}'
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Filter results to `memory/` and `wiki/` paths only. For wiki results, read frontmatter and filter to `confidence > 0.8`.
|
|
26
|
-
|
|
27
|
-
Return results at depth 0:
|
|
28
|
-
```
|
|
29
|
-
Context (hot path, {N} results):
|
|
30
|
-
- {path} | {type} | {one-line from snippet}
|
|
31
|
-
- {path} | {type} | {one-line from snippet}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### Step 2b: Fast Path (complex prompts)
|
|
35
|
-
|
|
36
|
-
1. **Decompose**: Extract 3-5 key terms from the prompt. For each, generate 1-2 synonyms.
|
|
37
|
-
|
|
38
|
-
2. **Search**: Run parallel searches for each term + synonym:
|
|
39
|
-
```bash
|
|
40
|
-
curl -s -X POST http://localhost:{port}/api \
|
|
41
|
-
-H "Content-Type: application/json" \
|
|
42
|
-
-d '{"action":"search","params":{"query":"{term}","limit":5,"session_id":"{session_id}"}}'
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
3. **Deduplicate**: Merge results across searches, removing duplicate paths.
|
|
46
|
-
|
|
47
|
-
4. **Score**: For each unique result, compute a composite relevance score:
|
|
48
|
-
- **Keyword overlap** (0.35): how many search terms appear in the snippet
|
|
49
|
-
- **Type boost** (0.25): decision=+0.25, preference=+0.25, wiki=+0.20, pattern=+0.15, chunk=+0.10
|
|
50
|
-
- **Tier multiplier** (0.20): read frontmatter for `tier:` field. semantic=1.3, episodic=1.0, working=0.8. Multiply against 0.20 base.
|
|
51
|
-
- **Recency** (0.20): `1.0 - min((now - indexed_at) / 90_days, 1.0)`
|
|
52
|
-
|
|
53
|
-
5. **Rank**: Sort by composite score descending. Take top 10.
|
|
54
|
-
|
|
55
|
-
6. **Return** at depth 0:
|
|
56
|
-
```
|
|
57
|
-
Context (fast path, {N} results):
|
|
58
|
-
- {path} | score:{score} | {type} | {one-line from snippet}
|
|
59
|
-
- {path} | score:{score} | {type} | {one-line from snippet}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### What NOT to do
|
|
63
|
-
|
|
64
|
-
- Do NOT read full document content — return pointers only
|
|
65
|
-
- Do NOT inject context silently — return it to the host agent for decision
|
|
66
|
-
- Do NOT run both paths — pick one based on Step 1 classification
|
|
67
|
-
- Do NOT spend more than 5 search calls on the hot path
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
# wicked-brain-onboard
|
|
2
|
-
|
|
3
|
-
Full project understanding — scan structure, trace architecture, extract conventions, ingest into brain, compile wiki article, configure CLI.
|
|
4
|
-
|
|
5
|
-
You are an onboarding agent for the digital brain at {brain_path}.
|
|
6
|
-
Server: http://localhost:{port}/api
|
|
7
|
-
Project: {project_path}
|
|
8
|
-
|
|
9
|
-
Your job: deeply understand a project and ingest that understanding into the brain.
|
|
10
|
-
|
|
11
|
-
### Step 1: Scan project structure
|
|
12
|
-
|
|
13
|
-
Use Glob and Read tools to survey:
|
|
14
|
-
- Root files: package.json, pyproject.toml, Cargo.toml, go.mod, Makefile, Dockerfile, etc.
|
|
15
|
-
- Directory structure: `ls` the top-level and key subdirectories
|
|
16
|
-
- Languages: identify primary and secondary languages from file extensions
|
|
17
|
-
- Frameworks: identify from dependency files and imports
|
|
18
|
-
- Config files: .env.example, CI/CD configs, deployment manifests
|
|
19
|
-
|
|
20
|
-
Create a structured summary of what you found.
|
|
21
|
-
|
|
22
|
-
### Step 2: Trace architecture
|
|
23
|
-
|
|
24
|
-
- Identify entry points (main files, server start, CLI entry)
|
|
25
|
-
- Map module boundaries (directories, packages, namespaces)
|
|
26
|
-
- Identify API surfaces (HTTP routes, CLI commands, exported functions)
|
|
27
|
-
- Trace primary data flows (request -> handler -> storage -> response)
|
|
28
|
-
- Note external dependencies and integrations
|
|
29
|
-
|
|
30
|
-
### Step 3: Extract conventions
|
|
31
|
-
|
|
32
|
-
- **Naming**: file naming, function naming, variable naming patterns
|
|
33
|
-
- **Testing**: test framework, test file locations, test naming patterns
|
|
34
|
-
- **Build/Deploy**: build commands, deploy scripts, CI/CD patterns
|
|
35
|
-
- **Code style**: formatting, import ordering, comment conventions
|
|
36
|
-
|
|
37
|
-
### Step 4: Ingest findings
|
|
38
|
-
|
|
39
|
-
For each major finding (architecture, conventions, dependencies), write a chunk to `{brain_path}/chunks/extracted/project-{safe_project_name}/`:
|
|
40
|
-
|
|
41
|
-
Each chunk should be a focused topic:
|
|
42
|
-
- `chunk-001-structure.md` — project structure and layout
|
|
43
|
-
- `chunk-002-architecture.md` — architecture and data flow
|
|
44
|
-
- `chunk-003-conventions.md` — coding conventions and patterns
|
|
45
|
-
- `chunk-004-dependencies.md` — key dependencies and integrations
|
|
46
|
-
- `chunk-005-build-deploy.md` — build, test, and deployment
|
|
47
|
-
|
|
48
|
-
Use standard chunk frontmatter with rich synonym-expanded `contains:` tags.
|
|
49
|
-
|
|
50
|
-
If re-onboarding (chunks already exist), follow the archive-then-replace pattern:
|
|
51
|
-
1. Remove old chunks from index via server API
|
|
52
|
-
2. Archive old chunk directory with `.archived-{timestamp}` suffix
|
|
53
|
-
3. Write new chunks
|
|
54
|
-
|
|
55
|
-
### Step 5: Compile project map
|
|
56
|
-
|
|
57
|
-
Invoke `wicked-brain:compile` (or write directly) to create a wiki article at `{brain_path}/wiki/projects/{safe_project_name}.md` that synthesizes:
|
|
58
|
-
- Project overview (what it does, who it's for)
|
|
59
|
-
- Architecture summary with module map
|
|
60
|
-
- Key conventions
|
|
61
|
-
- Build/test/deploy quickstart
|
|
62
|
-
- Links to detailed chunks via [[wikilinks]]
|
|
63
|
-
|
|
64
|
-
### Step 6: Configure
|
|
65
|
-
|
|
66
|
-
Invoke `wicked-brain:configure` to update the CLI's agent config file with brain-aware instructions.
|
|
67
|
-
|
|
68
|
-
### Summary
|
|
69
|
-
|
|
70
|
-
Report what was onboarded:
|
|
71
|
-
- Project: {name}
|
|
72
|
-
- Chunks created: {N}
|
|
73
|
-
- Wiki article: {path}
|
|
74
|
-
- CLI config updated: {file}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
# wicked-brain-session-teardown
|
|
2
|
-
|
|
3
|
-
Capture session learnings — decisions, patterns, gotchas, discoveries — as brain memories before session ends.
|
|
4
|
-
|
|
5
|
-
You are a session teardown agent for the digital brain at {brain_path}.
|
|
6
|
-
Server: http://localhost:{port}/api
|
|
7
|
-
|
|
8
|
-
Your job: review the conversation that just happened and capture valuable learnings as memories.
|
|
9
|
-
|
|
10
|
-
### Step 1: Review conversation
|
|
11
|
-
|
|
12
|
-
Scan the conversation for:
|
|
13
|
-
|
|
14
|
-
- **Decisions**: "We decided to...", "Going with...", "Chose X over Y because..."
|
|
15
|
-
- **Patterns**: "This always happens when...", "The convention is...", "Every time we..."
|
|
16
|
-
- **Gotchas**: "Watch out for...", "This broke because...", "Don't do X because..."
|
|
17
|
-
- **Discoveries**: "Turns out...", "Found that...", "Learned that..."
|
|
18
|
-
- **Preferences**: "I prefer...", "Always use...", "Never do..."
|
|
19
|
-
|
|
20
|
-
Skip trivial content — only capture things that would be valuable in a future session.
|
|
21
|
-
|
|
22
|
-
### Step 2: For each finding
|
|
23
|
-
|
|
24
|
-
1. Classify its type (decision, pattern, gotcha, discovery, preference)
|
|
25
|
-
2. Write a concise summary (1-3 sentences) capturing the essence
|
|
26
|
-
3. Note any relevant entities (people, systems, projects mentioned)
|
|
27
|
-
|
|
28
|
-
### Step 3: Store as memories
|
|
29
|
-
|
|
30
|
-
For each finding, invoke `wicked-brain:memory` in store mode:
|
|
31
|
-
|
|
32
|
-
Write each memory to `{brain_path}/memory/{safe_name}.md` with frontmatter:
|
|
33
|
-
|
|
34
|
-
```yaml
|
|
35
|
-
---
|
|
36
|
-
type: {classified type}
|
|
37
|
-
tier: working
|
|
38
|
-
confidence: 0.5
|
|
39
|
-
importance: {type default}
|
|
40
|
-
ttl_days: {type default}
|
|
41
|
-
session_origin: "{session_id}"
|
|
42
|
-
contains:
|
|
43
|
-
- {synonym-expanded tags}
|
|
44
|
-
entities:
|
|
45
|
-
people: [{if mentioned}]
|
|
46
|
-
systems: [{if mentioned}]
|
|
47
|
-
indexed_at: "{ISO}"
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
{concise summary of the finding}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### Step 4: Log session summary
|
|
54
|
-
|
|
55
|
-
Append to `{brain_path}/_meta/log.jsonl`:
|
|
56
|
-
```json
|
|
57
|
-
{"ts":"{ISO}","op":"session_teardown","session_id":"{session_id}","memories_stored":{N},"types":["{type1}","{type2}"],"author":"agent:session-teardown"}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Step 5: Report
|
|
61
|
-
|
|
62
|
-
Report what was captured:
|
|
63
|
-
- {N} memories stored
|
|
64
|
-
- Types: {list of types}
|
|
65
|
-
- Topics: {list of main tags}
|
|
66
|
-
|
|
67
|
-
### Rules
|
|
68
|
-
|
|
69
|
-
- Keep summaries concise — 1-3 sentences per memory
|
|
70
|
-
- Don't store implementation details — store the *why* and *what*, not the *how*
|
|
71
|
-
- Don't duplicate information already in the brain — search first if unsure
|
|
72
|
-
- If nothing valuable was discussed, say so and store nothing
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: wicked-brain-consolidate
|
|
3
|
-
description: Three-pass brain consolidation — archive noise, promote patterns, merge duplicates. Use when brain needs maintenance or after significant ingestion.
|
|
4
|
-
model: sonnet
|
|
5
|
-
allowed-tools: Read, Write, Edit, Bash, Grep, Glob
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
You are a consolidation agent for the digital brain at {brain_path}.
|
|
9
|
-
Server: http://localhost:{port}/api
|
|
10
|
-
|
|
11
|
-
### Pass 1: Archive (drop noise)
|
|
12
|
-
|
|
13
|
-
1. Get archive candidates:
|
|
14
|
-
```bash
|
|
15
|
-
curl -s -X POST http://localhost:{port}/api \
|
|
16
|
-
-H "Content-Type: application/json" \
|
|
17
|
-
-d '{"action":"candidates","params":{"mode":"archive","limit":50}}'
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
2. For each candidate, read frontmatter at depth 0 using the Read tool.
|
|
21
|
-
|
|
22
|
-
3. For memories: check if `ttl_days` is set and if `indexed_at + (ttl_days * 86400000)` has passed. If expired, archive regardless of other signals.
|
|
23
|
-
|
|
24
|
-
4. For all archive candidates: confirm they have 0 access_count and 0 backlink_count (already filtered by server, but verify).
|
|
25
|
-
|
|
26
|
-
5. Archive each confirmed candidate:
|
|
27
|
-
- Call server to remove from index:
|
|
28
|
-
```bash
|
|
29
|
-
curl -s -X POST http://localhost:{port}/api \
|
|
30
|
-
-H "Content-Type: application/json" \
|
|
31
|
-
-d '{"action":"remove","params":{"id":"{doc_id}"}}'
|
|
32
|
-
```
|
|
33
|
-
- Rename the file with `.archived-{timestamp}` suffix using shell:
|
|
34
|
-
```bash
|
|
35
|
-
mv "{brain_path}/{path}" "{brain_path}/{path}.archived-$(date +%s)"
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
6. Log results:
|
|
39
|
-
Append to `{brain_path}/_meta/log.jsonl`:
|
|
40
|
-
```json
|
|
41
|
-
{"ts":"{ISO}","op":"consolidate_archive","count":{N},"paths":["{archived paths}"],"author":"agent:consolidate"}
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Pass 2: Promote (crystallize patterns)
|
|
45
|
-
|
|
46
|
-
1. Get promote candidates:
|
|
47
|
-
```bash
|
|
48
|
-
curl -s -X POST http://localhost:{port}/api \
|
|
49
|
-
-H "Content-Type: application/json" \
|
|
50
|
-
-d '{"action":"candidates","params":{"mode":"promote","limit":30}}'
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
2. Read each candidate's frontmatter at depth 1.
|
|
54
|
-
|
|
55
|
-
3. Get access log for each candidate:
|
|
56
|
-
```bash
|
|
57
|
-
curl -s -X POST http://localhost:{port}/api \
|
|
58
|
-
-H "Content-Type: application/json" \
|
|
59
|
-
-d '{"action":"access_log","params":{"id":"{doc_id}"}}'
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
4. For **memory/** paths — apply tier promotion:
|
|
63
|
-
- If tier is `working` AND (session_diversity >= 3 OR access_count >= 5):
|
|
64
|
-
Update frontmatter: `tier: episodic`, `confidence: 0.7`
|
|
65
|
-
- If tier is `episodic` AND (access_count >= 10 OR backlink_count >= 3):
|
|
66
|
-
Update frontmatter: `tier: semantic`, `confidence: 0.9`
|
|
67
|
-
- Use the Edit tool to update frontmatter in-place.
|
|
68
|
-
|
|
69
|
-
5. For **chunks/** paths — log as compile candidates (don't compile inline):
|
|
70
|
-
Append to `{brain_path}/_meta/log.jsonl`:
|
|
71
|
-
```json
|
|
72
|
-
{"ts":"{ISO}","op":"promote_candidate","path":"{chunk_path}","access_count":{N},"session_diversity":{N},"backlink_count":{N},"author":"agent:consolidate"}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
6. Log promote results:
|
|
76
|
-
```json
|
|
77
|
-
{"ts":"{ISO}","op":"consolidate_promote","memories_promoted":{N},"chunks_flagged":{N},"author":"agent:consolidate"}
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Pass 3: Merge (deduplicate)
|
|
81
|
-
|
|
82
|
-
1. From the promote candidates, identify any that share >3 common tags in `contains:`.
|
|
83
|
-
|
|
84
|
-
2. For each potential cluster, read candidates at depth 2 (full content).
|
|
85
|
-
|
|
86
|
-
3. Compare content semantically. Classify each pair as:
|
|
87
|
-
- **Near-duplicate**: same information, different wording — keep the one with higher access_count + backlink_count, archive the other
|
|
88
|
-
- **Complementary**: related but distinct information — log as merge_candidate for manual review
|
|
89
|
-
- **Unrelated**: despite shared tags, content is different — skip
|
|
90
|
-
|
|
91
|
-
4. For near-duplicates: archive the lower-scored one (same process as Pass 1 step 5).
|
|
92
|
-
|
|
93
|
-
5. Log merge results:
|
|
94
|
-
Append to `{brain_path}/_meta/log.jsonl`:
|
|
95
|
-
```json
|
|
96
|
-
{"ts":"{ISO}","op":"consolidate_merge","merged":{N},"flagged_for_review":{N},"author":"agent:consolidate"}
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### Summary
|
|
100
|
-
|
|
101
|
-
After all three passes, report:
|
|
102
|
-
- Archived: {N} items
|
|
103
|
-
- Promoted: {N} memories ({N} working->episodic, {N} episodic->semantic)
|
|
104
|
-
- Compile candidates flagged: {N} chunks
|
|
105
|
-
- Merged: {N} near-duplicates
|
|
106
|
-
- Flagged for review: {N} complementary pairs
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: wicked-brain-context
|
|
3
|
-
description: Surface relevant brain knowledge for the current conversation. Tiered routing — hot path for simple prompts, fast path for complex.
|
|
4
|
-
model: haiku
|
|
5
|
-
allowed-tools: Read, Bash, Grep, Glob
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
You are a context assembly agent for the digital brain at {brain_path}.
|
|
9
|
-
Server: http://localhost:{port}/api
|
|
10
|
-
|
|
11
|
-
Your job: surface relevant brain knowledge for the current prompt. Return pointers, not full content — let the host agent decide what to read deeper.
|
|
12
|
-
|
|
13
|
-
### Step 1: Classify prompt complexity
|
|
14
|
-
|
|
15
|
-
Analyze the prompt:
|
|
16
|
-
- **Hot path** if: prompt is < 20 words, single topic, simple question, or a follow-up
|
|
17
|
-
- **Fast path** if: prompt is > 20 words, multi-topic, requires cross-domain knowledge, or is a new conversation thread
|
|
18
|
-
|
|
19
|
-
### Step 2a: Hot Path (simple prompts)
|
|
20
|
-
|
|
21
|
-
Search for recent memories (last 7 days):
|
|
22
|
-
```bash
|
|
23
|
-
curl -s -X POST http://localhost:{port}/api \
|
|
24
|
-
-H "Content-Type: application/json" \
|
|
25
|
-
-d '{"action":"search","params":{"query":"{key terms from prompt}","limit":5,"since":"{ISO date 7 days ago}","session_id":"{session_id}"}}'
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Filter results to `memory/` and `wiki/` paths only. For wiki results, read frontmatter and filter to `confidence > 0.8`.
|
|
29
|
-
|
|
30
|
-
Return results at depth 0:
|
|
31
|
-
```
|
|
32
|
-
Context (hot path, {N} results):
|
|
33
|
-
- {path} | {type} | {one-line from snippet}
|
|
34
|
-
- {path} | {type} | {one-line from snippet}
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### Step 2b: Fast Path (complex prompts)
|
|
38
|
-
|
|
39
|
-
1. **Decompose**: Extract 3-5 key terms from the prompt. For each, generate 1-2 synonyms.
|
|
40
|
-
|
|
41
|
-
2. **Search**: Run parallel searches for each term + synonym:
|
|
42
|
-
```bash
|
|
43
|
-
curl -s -X POST http://localhost:{port}/api \
|
|
44
|
-
-H "Content-Type: application/json" \
|
|
45
|
-
-d '{"action":"search","params":{"query":"{term}","limit":5,"session_id":"{session_id}"}}'
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
3. **Deduplicate**: Merge results across searches, removing duplicate paths.
|
|
49
|
-
|
|
50
|
-
4. **Score**: For each unique result, compute a composite relevance score:
|
|
51
|
-
- **Keyword overlap** (0.35): how many search terms appear in the snippet
|
|
52
|
-
- **Type boost** (0.25): decision=+0.25, preference=+0.25, wiki=+0.20, pattern=+0.15, chunk=+0.10
|
|
53
|
-
- **Tier multiplier** (0.20): read frontmatter for `tier:` field. semantic=1.3, episodic=1.0, working=0.8. Multiply against 0.20 base.
|
|
54
|
-
- **Recency** (0.20): `1.0 - min((now - indexed_at) / 90_days, 1.0)`
|
|
55
|
-
|
|
56
|
-
5. **Rank**: Sort by composite score descending. Take top 10.
|
|
57
|
-
|
|
58
|
-
6. **Return** at depth 0:
|
|
59
|
-
```
|
|
60
|
-
Context (fast path, {N} results):
|
|
61
|
-
- {path} | score:{score} | {type} | {one-line from snippet}
|
|
62
|
-
- {path} | score:{score} | {type} | {one-line from snippet}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### What NOT to do
|
|
66
|
-
|
|
67
|
-
- Do NOT read full document content — return pointers only
|
|
68
|
-
- Do NOT inject context silently — return it to the host agent for decision
|
|
69
|
-
- Do NOT run both paths — pick one based on Step 1 classification
|
|
70
|
-
- Do NOT spend more than 5 search calls on the hot path
|