Setup GBrain
Use this skill when the user asks to set up, connect, install, or verify GBrain for this Codex port.
This is a Codex-native adaptation of upstream GStack's setup-gbrain. Upstream can install the real gbrain CLI and MCP stack; this port first preserves the local file-backed brain/ substrate already used in this repo, then reports where true upstream GBrain integration is still needed.
Workflow
- Inspect the repo-local substrate:
- confirm
brain/README.mdexists - confirm
scripts/brain_init.py,scripts/brain_search.py,scripts/brain_put.py,scripts/brain_link.py, andscripts/brain_doctor.pyexist - run
python3 scripts/brain_doctor.pywhen available
- confirm
- Check for upstream GBrain availability:
- run
command -v gbrain - if present, report
gbrain --versionor equivalent status - if absent, do not fake CLI support; state that the local file-backed substrate is active
- if configuration identifies a remote MCP thin client, treat the missing local engine as intentional; verify configuration without claiming the remote service is reachable until a real query succeeds
- run
- Check the current Codex install surface:
- verify repo-owned skills are visible under the documented user surface at
~/.agents/skills - preserve shared symlinks and user-owned directories; install only missing skills or update copies with this package's ownership receipt
- verify repo-owned skills are visible under the documented user surface at
- Check worktree/local-environment expectations when Codex app worktrees or automations are in scope:
- note that ignored private brain folders are not copied into worktrees unless intentionally included
- do not add private brain corpus paths to
.worktreeinclude - use tracked setup docs or local environment actions for reproducible setup steps
- Initialize missing local folders only when they are expected by the repo and safe to create.
- Summarize:
- local substrate status
- upstream CLI/MCP status
- Codex skill install status
- local-vs-worktree caveats when relevant
- recommended next step, usually
sync-gbrainorcapture
Guardrails
- Do not overwrite existing
brain/pages. - Do not install global tools unless the user explicitly asked for installation.
- Do not claim full upstream GBrain parity when only the local substrate is active.
- Do not diagnose a configured remote thin client as a broken local database.
- Treat untracked
brain/content as user data. - Use
gbrain-advisorfor read-only setup advice andgbrain-upgradefor upstream CLI upgrades.