shellbrain
Use when an agent should remember to ask Shellbrain for targeted recall at task start, subproblem changes, repeated failures, hypothesis changes, or closeout.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when an agent should remember to ask Shellbrain for targeted recall at task start, subproblem changes, repeated failures, hypothesis changes, or closeout.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Use when an agent should remember to ask Shellbrain for targeted recall at task start, subproblem changes, repeated failures, hypothesis changes, or closeout.
Define and enforce the owner's language-agnostic clean-core architecture for new software projects and refactors. Use when deciding responsibility placement, dependency direction, structural stage, safe refactor moves, semantic types, pure policies, entrypoints, startup wiring, adapters, and dependency boundaries.
Clean existing code by enforcing semantic integrity, reader clarity, and local efficiency without changing architecture. Use when auditing or improving code that has fake optionality, silent fallbacks, stale compatibility, permissive parsing, unclear names, dead wrappers, redundant work, or over-abstraction. Prefer required typed state, explicit errors, fail-fast validation, deletion of obsolete branches, clear names, simple functions, and focused tests.
Use when a reviewer agent needs one fast cross-repo picture of how agents are using Shellbrain, where the product is working, where it is failing, and which expected capabilities are being skipped.
Use when a reviewer agent needs one fast cross-repo picture of how agents are using Shellbrain, where the product is working, where it is failing, and which expected capabilities are being skipped.
| name | shellbrain |
| description | Use when an agent should remember to ask Shellbrain for targeted recall at task start, subproblem changes, repeated failures, hypothesis changes, or closeout. |
Shellbrain is a persistent memory system for agent work.
As the working agent, your interface is:
shellbrain recall "<targeted natural-language question>"
Recall returns a compact brief synthesized from prior memories, concepts, scenarios, and recent episode context. It is meant to reduce wasted exploration and help you decide where to look next.
When the user explicitly asks you to store or teach Shellbrain something, use:
shellbrain teach
Teach stores the user-provided statement as evidence and immediately asks Shellbrain's teach agent to turn it into durable memories or concept graph updates.
If you changed any files since your last user-facing response, run this exactly once after validation and immediately before your next user-facing response:
shellbrain snapshot
Snapshot stores exact repo code state in repo-local shadow Git so the knowledge builder can later attach exact solution deltas to solved problem runs.
Do not call Shellbrain internal commands directly. read, events, memory, concept, and scenario are for Shellbrain's internal agents.
Do not run shellbrain init at the start of every session.
Use this order:
shellbrain admin doctor.shellbrain init.shellbrain recall with one targeted natural-language query.If shellbrain is not found, do a one-time PATH check:
zsh -lc 'source ~/.zprofile >/dev/null 2>&1; command -v shellbrain'
If the host shell is bash instead of zsh, use:
bash -lc 'source ~/.bash_profile >/dev/null 2>&1; command -v shellbrain'
Once found, use plain shellbrain .... Do not keep sourcing the login profile on every Shellbrain command.
If the one-time login-shell retry still cannot find shellbrain, inspect Python's user script directory:
python3 -c "import sysconfig; print(sysconfig.get_path('scripts', 'posix_user'))"
If that directory contains shellbrain, call it directly or add that directory to the login profile PATH and retry. If it does not, reinstall the Shellbrain CLI.
--repo-root /absolute/path/to/repo when your shell is elsewhere.Maintain this tuple while you work:
goal | surface | obstacle | hypothesis
Pause and emit an SB: line when the tuple changes or a boundary state occurs.
Boundary states:
If recall might help:
SB: recall | <goal> | <surface> | <obstacle> | <hypothesis-or-trigger>
Then call recall.
If recall would not add information:
SB: skip | same signature | <one-line reason>
Then continue.
Pass one self-contained question as a quoted positional argument. Recall receives only this query, so include relevant task context naturally.
shellbrain recall "Have we seen this architecture guardrail failure or subsystem boundary before?"
Use teach only for explicit user teaching, not for ordinary closeout.
shellbrain teach --json '{"text":"In this repo, startup wires dependencies but should not own workflow behavior.","current_problem":{"goal":"record architecture preference","surface":"startup and clean architecture","obstacle":"agents may put behavior in startup","hypothesis":"teach should become a durable preference or concept claim"}}'
If you changed any files since your last user-facing response, run shellbrain snapshot exactly once after validation and immediately before your next user-facing response. Do this on every response cycle where files changed; skip only when no files changed. It does not need --json.
Use standard repo targeting only when your shell is outside the repo:
shellbrain snapshot --repo-root /absolute/path/to/repo
Good recall queries are concrete. Name the failure mode, subsystem, decision, file area, or constraint.
Good examples:
shellbrain recall "I'm debugging a migration lock timeout. What prior context matters?"
shellbrain recall "What architectural constraints matter before moving this CLI handler?"
shellbrain recall "What user preferences matter while simplifying Shellbrain onboarding assets?"
Avoid vague queries:
what should I know about this repo?what should I do?anything relevant?Treat recall as advisory memory, not ground truth.
Use the brief to identify:
Current repo state remains the source of truth.
Do not use teach as a substitute for recall or as a generic session summary. Use it when the user explicitly says to store, remember, or teach Shellbrain a specific point.
Do not call:
shellbrain read
shellbrain events
shellbrain memory add
shellbrain memory update
shellbrain concept add
shellbrain concept update
shellbrain scenario record
Those are internal-agent commands.
Do not manually write memories at closeout. Shellbrain's knowledge-builder agent consolidates episodes after the session lifecycle.