gbrain-brain-ops

Executes core gbrain operations including sync, health checks, and PGLite failure recovery.

1|Updated Jun 21, 2026
One-click install
npx skills add https://github.com/tapway/shogun-os --skill gbrain-brain-ops-tapway
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gbrain-brain-ops
Source: https://github.com/tapway/shogun-os/tree/main/skills/gbrain/gbrain-brain-ops
Command: npx skills add https://github.com/tapway/shogun-os --skill gbrain-brain-ops-tapway

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Managing a gbrain knowledge base involves recurring operational tasks — syncing git repos into the brain, running multi-hour imports, monitoring embedding health, and recovering from PGLite WASM crashes — that fail silently or time out without the right procedures. ## Core Features & Use Cases - Read-Enrich-Write Loop: Standardized pattern for searching, updating, and writing brain pages via MCP tools like mcp_gbrain_search and mcp_gbrain_put_page. - Sync & Large Imports: Incremental and full git-to-brain sync, plus background execution patterns for 2+ hour imports of 11,000+ files with progress monitoring. - Health & Diagnostics: Health dashboards, orphan/stale page detection, embed coverage checks, and ingest logging after significant operations. - PGLite Crash Recovery: Step-by-step diagnosis of WASM runtime failures after WSL2 kernel upgrades, with migration guidance to native PostgreSQL. - Use Case: After a WSL2 kernel upgrade breaks all gbrain cron jobs with PGLite WASM abort errors, follow the in-memory vs file-backed diagnostic tests to confirm data directory corruption, then migrate to native PostgreSQL and re-sync from the brain repo. ## Quick Start Ask the agent to run a brain health check and sync the local brain repo using the gbrain MCP tools.

Frequently Asked Questions about gbrain-brain-ops

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sync a git repo into gbrain?

Call mcp_gbrain_sync_brain() for an incremental sync after local edits, or pass full=True for a complete re-sync. Use dry_run=True to preview changes and no_embed=True to skip embedding generation.

How do I run a large gbrain import without it timing out?

Run the import as a background terminal process with notify_on_complete=true and a long timeout. Foreground execution hits a 300-second cap that kills imports of thousands of files, which typically take 2 or more hours.

Why does PGLite fail with a WASM runtime error after a WSL2 kernel upgrade?

Kernel upgrades can change WASM memory mapping behavior, breaking existing file-backed PGLite data directories while in-memory databases still work. The recommended fix is migrating gbrain to native PostgreSQL in WSL and re-syncing from the brain files.

Does gbrain doctor detect PGLite database corruption?

No. gbrain doctor only performs filesystem checks and can report a passing score even when PGLite cannot open the data directory. Test directly with an in-memory versus file-backed PGlite query to diagnose the real failure.

PGLite vs PostgreSQL for gbrain — which should I use on WSL?

PostgreSQL is recommended for WSL because it is immune to kernel-upgrade WASM breakage, offers faster native queries, and has proper crash recovery. PGLite is zero-config but brittle, and migration requires a one-time re-embedding of all pages.

Why does the gbrain autopilot cron job fail with 'Could not resolve the gbrain CLI path'?

Cron runs with a minimal PATH that excludes ~/.local/bin, so autopilot cannot find the gbinary. Fix it by exporting PATH inside the gbrain wrapper and making autopilot-run.sh self-contained without sourcing shell profiles.