| name | wicked-brain-configure |
| description | This skill should be used when the user says "configure brain CLI",
"update CLAUDE.md from brain", "write brain orientation", or
"regenerate brain config". Reads brain state and writes contextual
instructions into the active CLI's agent config file. Run after
onboarding, major ingests, or consolidation.
|
wicked-brain:configure
Writes a contextual ## wicked-brain section into the active CLI/IDE's agent config file.
Config
Brain discovery + server lifecycle are handled by wicked-brain-call. Pass
--brain <path> to override the auto-detected brain, or set
WICKED_BRAIN_PATH. The CLI starts the server on first call (no manual
init required) and writes an audit record to {brain}/calls/ per call.
Process
Step 1: Gather brain state
- Call server stats:
npx wicked-brain-call stats
- Search for top topics — run a broad search to identify dominant tags:
npx wicked-brain-call search --param query=* --param limit=50
Read frontmatter of top results, count contains: tag frequency. Top 10 tags = brain expertise.
-
Read {brain_path}/brain.json for brain identity and linked brains.
-
Read {brain_path}/_meta/log.jsonl (last 50 lines) for recent search_miss entries — these are knowledge gaps.
-
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).
Step 2: Detect CLI/IDE
Check for these signals in order (first match wins):
| Signal | Platform | Config File |
|---|
CLAUDE_CODE env var or .claude/ exists | Claude Code | CLAUDE.md |
CODEX_CLI env var or .codex/ exists | Codex | .codex/instructions.md |
.kiro/ exists | Kiro | KIRO.md |
GEMINI_CLI env var or .gemini/ exists | Gemini CLI | GEMINI.md |
COPILOT_CLI env var or .github/ exists | Copilot CLI | .github/copilot-instructions.md |
.cursor/ exists | Cursor | .cursor/rules/wicked-brain.md |
.antigravity/ exists | Antigravity | .antigravity/rules/wicked-brain.md |
| None matched | Fallback | ask the user |
If no signal matches, tell the user: "I couldn't detect your CLI automatically.
Which agent config file should I write to?" Accept a user-specified path and
write to that file directly.
Step 3: Write config section
Read the target config file. If a ## wicked-brain section already exists,
update it in place — replace from the ## wicked-brain heading to the next
##-level heading (or end of file) with the new content. Do NOT append a
duplicate section. If no ## wicked-brain section exists, append it at the
end of the file.
Write a section like this (adapt content to actual brain state):
## wicked-brain
Digital brain: {brain_id} | {total} indexed items | {chunks} chunks, {wiki} wiki articles, {memory} memories
**Domain expertise:** {top 10 tags from step 1}
**Knowledge gaps:** {recent search_miss topics, if any}
**Linked brains:** {list from brain.json, or "none"}
### How to use
- **Search/explore**: use `wicked-brain:search` — replaces Grep, Glob, and Agent(Explore) for any open-ended search
- **Answer questions**: use `wicked-brain:query` — replaces Agent(Explore) for conceptual questions
- **Wiki catalog**: use `wicked-brain:read` at depth 0/1 to browse wiki articles progressively
- **Surface context**: call `wicked-brain:context` at the start of any new topic
- **Capture learnings**: call `wicked-brain:session-teardown` at session end
- **Store a decision/pattern/gotcha**: call `wicked-brain:memory` (store mode)
- **Workflow skills**: `wicked-brain:consolidate`, `wicked-brain:context`, `wicked-brain:session-teardown`, `wicked-brain:onboard`
### Search result source types
Brain search/query results include `source_type` and `path` fields:
- **`wiki`** — Synthesized knowledge. Read deeper with `wicked-brain:read {path} depth=2`.
- **`chunk`** — Raw indexed content. The search excerpt is usually sufficient.
- **`memory`** — Experiential learnings. Compact; excerpt is usually enough.
### Rules (follow strictly)
- **ALWAYS check the brain BEFORE using Grep, Glob, Read, or Agent(Explore)** — for any find, search, explore, explain, or "what is/how does" request
- 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
- Use `wicked-brain:search` for finding content ("find X", "where is Y", "look for Z", "show me W")
- Use `wicked-brain:query` for questions ("what does X do", "how does Y work", "explain Z")
- Use `wicked-brain:context` when starting a new topic or unfamiliar area
- Only fall back to Grep/Glob for **exact pattern matching** after the brain returns no results
- Do NOT read brain files directly — always go through skills
- Always pass `session_id` with search/query calls for access tracking
- Capture non-obvious decisions, patterns, and gotchas with `wicked-brain:memory`
- When search results include `source_type: wiki`, follow up with `wicked-brain:read` at depth 1-2
Step 4: Emit bus event
npx wicked-bus emit \
--type "wicked.brain.config.updated" \
--domain "wicked-brain" \
--subdomain "brain.system" \
--payload '{"config_file":"{path}","platform":"{detected_platform}","brain_id":"{brain_id}"}' 2>/dev/null || true
Fire-and-forget — if the bus is not installed, silently skip.
Step 5: Confirm
Report what was written and where:
- Config file: {path}
- Brain stats: {total} items, {expertise summary}
- Gaps noted: {N} search misses
Cross-Platform Notes
- Uses Bash to check for env vars and directories
- Uses Read/Edit tools for config file management
- All paths use forward slashes
- On Windows, check
%USERPROFILE% equivalents for home directory paths