Part of Brainstack: personal=engineer-brain, crew=team-brain.
| Prefer | Fallback |
|---|---|
MCP start / prepare_research / recall / remember / compliance / peer_notify / correct / history / restore / delete_memory / touch |
bash …/team-brain-api.sh … |
start may attach a Realtime signal listener (bodies still via authenticated pull).
If .team-brain/notify/<KEY>.json updates mid-session, summarize new peer memories before continuing.
If push is unavailable (TEAM_BRAIN_REALTIME=off / no websockets / migration missing), poll/watch/recall still work.
.team-brain/project.json when the user omits a key (start / attach).whoami.role: viewer → recall only; member/admin → remember + delete OK; only admin rotates invites / list_members.| Role | Read (recall, list, breakdown, history, metrics) | Write (remember, correct, restore, attach) | Delete (delete_memory) |
Admin (rotate invite, set-role, list-members) |
|---|---|---|---|---|
viewer |
✅ | ❌ | ❌ | ❌ |
member |
✅ | ✅ | ✅ | ❌ |
admin |
✅ | ✅ | ✅ | ✅ |
Onboard requires --role member|viewer (admin assigns tier explicitly).
stronger_prompts)v1 follow-up chose stronger prompts + soft session gate (not a hard CLI block).
research_ok must be true (start loads context, or prepare_research / recall).sync_status / compliance returns agent_action, follow it before coding.remember with source_ref in the same turn.BRAIN.md.bash "$API" compliance <JIRA-KEY>
bash "$API" sync-status <JIRA-KEY> # embeds compliance
API="${SKILL_DIR}/scripts/team-brain-api.sh"
# or: <engineer-brain-repo>/core/scripts/team-brain-api.sh
remember with source_ref (merge-safe)correct (or re-remember same source_ref) + optional learningrecall (or optional background watch); do not spam every turnwakeUser will often say things like:
I'm starting on YOU_JIRA_TICKET_HERE — start Team Brain sync.
I'm starting on YOU_JIRA_TICKET_HERE — start Team Brain sync, summarize crew memory, then help me.
/team-brain start YOU_JIRA_TICKET_HERE
Wake Team Brain sync for YOU_JIRA_TICKET_HERE and continue.
Stop Team Brain sync for YOU_JIRA_TICKET_HERE.
Run:
bash "$API" start <JIRA-KEY>
bash "$API" sync-status <JIRA-KEY> # confirm compliance.research_ok
Then read .team-brain/cache/<JIRA-KEY>.json, summarize crew memory, then explore.
If already active, touch and read cache (or MCP prepare_research / recall for a topic).
If sleep, tell the user and run wake only after they agree (or if they asked to continue).
Each turn on this key:
bash "$API" touch <JIRA-KEY>
bash "$API" compliance <JIRA-KEY> # if agent_action set → follow it
After durable findings:
bash "$API" remember <JIRA-KEY> research --source-ref "<JIRA-KEY>#<short-slug>" "<finding>"
Merge rules (server):
| Case | Result |
|---|---|
| New finding | insert |
| Same body / hash | deduped no-op |
Same source_ref, new body |
updated (merge — no second row) |
Sync-mode background pull + peer push help, but long spikes can still go stale vs teammates.
When to refresh (pick one trigger; do not do this every turn):
Then run a quiet refresh:
bash "$API" recall <JIRA-KEY> # or MCP prepare_research / recall
# if .team-brain/notify/<KEY>.json updated → summarize new peer memories first
Optional (human / once per spike): suggest background watch so the cache stays warm without relying only on idle sleep / next start:
bash "$API" watch <JIRA-KEY> & # poll
# or: bash "$API" watch <JIRA-KEY> --push &
Do not spam: at most one soft nudge per stretch (“cache may be stale — refresh?”). Prefer silent recall over asking every turn.
Sleep / wake still wins: if sync-status is sleep, prompt wake (do not treat watch as a substitute). If stopped, offer start.
Write natural-language guidance (“prefer X”, “avoid Y”).
Do not dump TODO / NO-TODO lists into remembered bodies.
When the user pastes a correction, contradicts a sync summary, or says research was wrong — treat that as ground truth. Do not argue.
That research is wrong — the schema lives in packages/ansible-language-server, not tox-ansible.
Correct Team Brain memory for YOU_JIRA_TICKET_HERE#cli-schema — prefer …
Then:
# Preferred: update + optional learning in one shot
bash "$API" correct <JIRA-KEY> --source-ref "<JIRA-KEY>#<short-slug>" \
--was "Incorrect claim…" \
--learning "Was wrong: … Prefer: …" \
"Corrected durable finding…"
# Equivalent: re-remember same source_ref (updates, does not fork)
bash "$API" remember <JIRA-KEY> research --source-ref "<JIRA-KEY>#<short-slug>" "Corrected finding…"
bash "$API" remember <JIRA-KEY> learning --source-ref "<JIRA-KEY>#<short-slug>/learning" \
"Was wrong: … Prefer: …"
| Step | Action |
|---|---|
| 1 | Identify the topic source_ref (same slug as the bad research) |
| 2 | correct or re-remember → expect updated: true (not a second row) |
| 3 | Optionally record learning at REF/learning (what was wrong → what to prefer) |
| 4 | Confirm briefly to the user; continue with corrected context |
source_ref updates archive the prior body (when the history migration is applied). To inspect or undo:
bash "$API" history <JIRA-KEY> --source-ref "<JIRA-KEY>#<short-slug>"
bash "$API" restore <JIRA-KEY> --source-ref "<JIRA-KEY>#<short-slug>" --revision 1
restore soft-rollbacks and archives the current body first — audit trail is preserved.
Personal standup corrections follow the same absorb-and-learn pattern in /engineer-brain (update BRAIN.md, close scanner gaps).
bash "$API" stop <JIRA-KEY> # leave sync mode
bash "$API" wake <JIRA-KEY> # resume after sleep
When sync-status shows sleep, prompt the user before continuing deep work.
bash "$API" breakdown <JIRA-KEY>
Never invent stories without recalled memories.
| Command | Purpose |
|---|---|
start |
Enter sync mode — load memory + background pull |
stop / wake / touch |
Leave / resume / keep awake |
sync-status |
active | sleep | stopped (+ compliance) |
compliance |
Soft MCP-first gate (research_ok, agent_action) |
bootstrap |
Admin one-shot setup + share bundle |
admin-setup |
Preferred admin path — fill supabase/admin.setup.env, then run script (no flags) |
onboard / register / join |
Membership |
attach |
Bind Jira key |
recall / remember |
Search / save (learning kind ok); on redundant_candidate recall + same source_ref or --queue; admin may --force |
correct |
Update source_ref + optional learning |
history / restore |
Revision audit trail / soft rollback |
delete |
Tombstone poisoned memory (member/admin) |
list-members |
Admin audit of crew roles |
pending list / approve <pending-id> / reject <pending-id> |
Admin reviews overriding context (#67) |
breakdown / metrics / status |
Plan / stats / config |
MCP also exposes prepare_research (recall + compliance in one call).
Beginner guide: docs/team-brain-onboarding.md
One file — no scattered flags/env:
cp supabase/admin.setup.env.example supabase/admin.setup.env
# edit every TEAM_BRAIN_* value (admin name, crew, Jira epic, Supabase URL + anon)
bash core/scripts/team-brain-admin-setup.sh
Or: bash core/scripts/team-brain-admin-setup.sh --init then edit supabase/admin.setup.env.
After success, DM .team-brain/share-bundle.txt to members. Runtime config lands in supabase/project.public.env (auto-written).
start (or ask you to start)research_ok / follow agent_action)remember with source_ref; never clobber unrelated rowsremember returns redundant_candidate: true → do not fork; recall existing, reuse source_ref, or remember --queue for adminsource_ref (never fork)recall after research blocks / ~8–10 turns — never every turnwatch does not replace wake; never commit credentials.jsonBRAIN.md