smoke-test
What it does
This skill runs a set of health tests on your GBrain setup, such as the database, the command line tool, and the background worker. It is for people who want to confirm everything works after a restart.
When to use it
- βWhen you restart your computer or container and want to confirm your brain works.
- βWhen something in your brain seems broken and you want a quick check.
- βWhen you want to add your own custom health checks to the standard tests.
Skill link
https://github.com/garrytan/gbrain/blob/master/plugin/skills/smoke-test/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βI just restarted my computer. Run the health tests on my brain and fix anything small that is broken.β
5 new skills a week. 1 minute to read.
How it works
The agent runs eight core checks, fixes bounded local issues such as a damaged database index, and reports anything it could not fix. The worker is reported but not started automatically.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Smoke Test Skillpack
Run
gbrain smoke-testafter any machine or container restart, or whenever something seems broken.
Contract
This skill guarantees:
- 8 core tests verify gbrain health after restart (plus OpenClaw services when present; skipped otherwise)
- Bounded local failures are auto-fixed before reporting; worker repair is explicit because process topology and shell-job policy are operator choices
- User-extensible via
~/.gbrain/smoke-tests.d/*.shdrop-in scripts - Results logged to
/tmp/gbrain-smoke-test.log - Exit code = number of unfixed failures (0 = all pass)
Built-in Tests
| # | Test | Auto-Fix |
|---|---|---|
| 1 | Bun runtime | Install from bun.sh |
| 2 | GBrain CLI loads | Reinstall deps |
| 3 | GBrain database (engine identity via gbrain engine status --json, then doctor --json's connection check) |
gbrain db-repair --yes, re-test |
| 4 | GBrain worker process | β (native supervisor status + duplicate detection) |
| 5 | OpenClaw Codex plugin (Zod CJS); skips if OpenClaw absent | npm install zod@4 --force |
| 6 | OpenClaw gateway; skips if OpenClaw absent | β (may not be started yet) |
| 7 | Embedding API key | β (check .env) |
| 8 | Brain repo exists | β |
Usage
CLI
gbrain smoke-test
This is the invocation for all installs; it resolves the test script from the installed package.
From any startup script or login hook
gbrain smoke-test >> /tmp/bootstrap.log 2>&1
From OpenClaw bootstrap (OpenClaw deployments only)
Add to your ensure-services.sh or equivalent:
bash /path/to/gbrain/scripts/smoke-test.sh >> /tmp/bootstrap.log 2>&1
From an agent
exec: gbrain smoke-test
Contributor note: inside a gbrain repo checkout you can also run the script
directly with bash scripts/smoke-test.sh.
Adding Custom Tests
Create executable scripts in ~/.gbrain/smoke-tests.d/:
# ~/.gbrain/smoke-tests.d/check-redis.sh
#!/bin/bash
redis-cli ping | grep -q PONG
Rules:
- Exit 0 = pass, non-zero = fail
- Filename becomes the test name (e.g.
check-redisfromcheck-redis.sh) - Keep tests fast (< 10s each)
- Tests run in alphabetical order
Adding Built-in Tests (gbrain contributors)
This section is for contributors working in the gbrain source repo. Plugin
installs ship the script read-only and upgrades overwrite it; if you just want
extra checks, use the ~/.gbrain/smoke-tests.d/ drop-in scripts above.
Edit scripts/smoke-test.sh. Follow this pattern:
# ββ N. [Service Name] ββββββββββββββββββββββββββββββββββββββ
if [test condition]; then
pass "[Service Name]"
else
# Auto-fix attempt
[fix command]
if [re-test condition]; then
fixed "[What was fixed]"
pass "[Service Name] (after fix)"
else
fail "[Service Name] β [error detail]"
fi
fi
Design rules:
- Test first β never fix without confirming broken
- Re-test after fix β verify the fix worked
- Timeout everything β
timeout Non any command that could hang - Use helpers β
pass(),fail(),fixed(),skip() - Idempotent fixes β safe to run repeatedly
- Skip gracefully β
skip()when a prerequisite is missing, don't fail
Environment Variables
| Var | Default | Description |
|---|---|---|
GBRAIN_SMOKE_LOG |
/tmp/gbrain-smoke-test.log |
Log file path |
GBRAIN_DIR_OVERRIDE |
(auto-detect) | Force gbrain install path |
GBRAIN_BUN_PATH |
(auto-detect) | Force Bun binary path |
GBRAIN_DATABASE_URL |
(from .env) | Database connection URL |
GBRAIN_SMOKE_WORKER_PID_FILE |
/tmp/gbrain-worker.pid |
Legacy bare-worker PID path |
OPENCLAW_GATEWAY_PORT |
18789 |
Gateway port to test |
GBRAIN_BRAIN_PATH |
(deployment-specific) | Brain repo path. Container deployments default to /data/brain; set it to your brain repo path otherwise. Test 8 skips (not fails) when unset. |
Known Issues & Their Auto-Fixes
Codex Zod core.cjs Missing (discovered 2026-04-23)
(OpenClaw gateway deployments only: this concerns OpenClaw's Codex ACP plugin, not the OpenAI Codex CLI.)
- Symptom:
Cannot find module './core.cjs'β all Codex ACP sessions fail - Cause: Zod v4 npm package ships without
core.cjsin some installs - Auto-fix:
npm install zod@4 --forcein the codex extension's zod dir - Persistence: Does NOT survive container restart (gateway reinstalls deps)
- This is why smoke tests must run on every rest
FAQ
Does it start background services?
No. It reports the worker status but does not start daemons on its own.
Can I add my own checks?
Yes. Extra test scripts can be placed in a folder and run along with the standard tests.
Where are results logged?
Results are written to a log file, and the exit code shows how many problems remain unfixed.
Details
Original description by the author
Health smoke tests + auto-fix for gbrain installs (and OpenClaw services when present). Run after machine/container restarts or whenever something seems broken. Tests critical services, auto-fixes bounded local issues, and reports worker topology without starting daemons. Extensible via user-defined test scripts in ~/.gbrain/smoke-tests.d/*.sh.
repo: garrytan/gbrain
Popularity
- GitHub stars
- 31k
- Ranking position
- #9315
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
gbrain
31kLets your agent search a shared company knowledge brain for facts about people, projects and decisions, and save durable notes to it.
brain-ingest-gate
31kChecks new content against an existing knowledge brain before it is added, to avoid duplicates and resolve named entities first.
brain-link-discipline
31kMakes sure your agent includes a working link to each brain page it reports, in the same message, so you can open it right away.
brain-ops
31kGives your agent the core routine for a knowledge brain: check existing context first, save explicit notes with their source, and link related pages.
Similar skills
knowledge-automation
394kHelps your agent set up a recurring job that brings new content into your Knowledge vault on a schedule, then checks that the job runs.
knowledge-source-ingest
394kHelps your agent keep a Knowledge vault current with new items from chat channels, feeds, or mailboxes, without re-adding what it already has.
benchmark
280kHelps your agent measure code speed and performance. It's useful for ensuring things are fast and finding slowness issues.