Prompt file imported from yelaco/claude-xmen (
.claude/commands/cerebro-setup.md). Copyright stays with the author.
Cerebro Setup — Initialize and Verify Installation
Run after cloning the template or any time the installation feels misconfigured. Wires CLAUDE.md correctly and checks whether the upstream template has a newer release.
Instructions for Cerebro
This is a Cerebro-led single-flow operation. Do NOT create an agent team. Do NOT touch .cerebro/.pending-todos or .cerebro/pending-todos/. Do NOT spawn Wolverine or Storm. Handle everything directly, like /cerebro-doctor.
Upstream remote: https://github.com/yelaco/claude-xmen.git
1. Wire and Check Installation
Run the setup status helper. It prepends the Cerebro identity import to CLAUDE.md if missing, verifies .cerebro/cerebro-identity.md, reads .cerebro/upgrade-state.json when present, and checks the latest upstream tag.
test -f .cerebro/scripts/setup-status.py
python3 .cerebro/scripts/setup-status.py --upstream https://github.com/yelaco/claude-xmen.git
If upstream is unreachable, the helper skips version comparison and reports latest upstream - unreachable.
2. Semble Integration (Optional)
Ask the user whether they want to enable semble for semantic code search:
Semble is an optional MCP integration that gives Nightcrawler natural-language code search — ~98% fewer tokens than grep+read, fully on CPU, no API key.
Enable semble? (yes / no)
If yes:
-
Check whether it is already registered:
claude mcp list 2>/dev/null | grep -i semble && echo "already registered" || echo "not registered"If already registered, skip to step 3.
-
Detect the available installer and register the MCP server:
which uv 2>/dev/null && echo "uv" || (which pip3 2>/dev/null || which pip 2>/dev/null) && echo "pip" || echo "none"-
uvfound:claude mcp add semble -s user -- uvx --from "semble[mcp]" --with model2vec semble -
pipfound (nouv): Install semble first, then register with the bare command:pip install "semble[mcp]" claude mcp add semble -s user -- sembleReport:
Installed semble via pip. If
sembleis not on$PATHafter install, you may need to restart your shell or add your pip bin directory to$PATH. -
Neither found: Warn the user and skip:
Neither
uvnorpipwas found. Install one of them and re-run/cerebro-setupto enable semble:- uv (recommended):
curl -LsSf https://astral.sh/uv/install.sh | sh - pip: ships with Python — install Python from https://python.org
Set semble status to
SKIPPED (no installer)in the summary and do not create the integration file. - uv (recommended):
-
-
Create
.cerebro/integrations/semble.mdonly if it does not already exist. If the file is already present, skip this step — do not overwrite it. If it is absent, write it with this exact content (copy from.cerebro/integrations/semble.mdin the upstream template if present, otherwise write verbatim):
# Semble — Semantic Code Search
Semble is installed as an MCP server. The following teammates should prefer it over grep for natural-language and conceptual queries: **Nightcrawler**, **Wolverine**, and **Forge**.
## MCP Tools
- `mcp__semble__search(query, repo)` — natural-language or identifier search; `repo` is a local path or git URL; defaults to the current working directory.
- `mcp__semble__find_related(file_path, line, repo)` — find chunks semantically similar to the code at a given file location.
## When to Use Semble
- Conceptual / natural-language queries → `mcp__semble__search`
- "Find code similar to X" → `mcp__semble__find_related`
- Exhaustive exact-string or regex matching → use `grep` (semble is not a text matcher)
## Per-Teammate Guidance
**Nightcrawler** — primary user. Prefer semble for all conceptual queries; fall back to grep only for exact-string or regex matching.
**Wolverine** — use `mcp__semble__search` before implementing to find existing patterns, conventions, and similar code to avoid duplication. Use `mcp__semble__find_related` to discover all call sites when changing an interface.
**Forge** — use `mcp__semble__search` to locate architectural examples and assess how widely a pattern is used before recommending changes. Use `mcp__semble__find_related` to find the blast radius of a design decision.
## Indexing for Repeated Searches
Index once for faster repeated queries:
```bash
semble index . -o .cerebro/semble-index
```
Pass `--index .cerebro/semble-index` to searches. Reindex if the codebase changes significantly.
- Report:
Semble MCP registered and integration file written to
.cerebro/integrations/semble.md. Nightcrawler will use it on the next team dispatch.
If no: skip silently.
3. Summary
Print a brief setup report:
CLAUDE.md import — PRESENT | FIXED
cerebro-identity.md — PRESENT | MISSING
installed version — <ref> | unknown
latest upstream — <ref> | unreachable
upgrade needed — YES | NO | UNKNOWN
semble integration — ENABLED | SKIPPED | SKIPPED (no installer)
