Smoke Test Skillpack

SkillDev tools

Runs eight quick health checks on your inbrain setup after a restart and automatically repairs common problems.

Available today. Use it from your connected AI after setup.

Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

Then ask your AI: use the Smoke Test Skillpack skill

About this skill

Post-restart smoke tests + auto-fix for inbrain and OpenClaw environments. Tests critical services, auto-fixes known issues, extensible via user-defined test scripts in ~/.inbrain/smoke-tests.d/*.sh.

What this skill tells your AI

The instructions your AI receives, as published by inbrainfun/inbrain in skills/smoke-test/SKILL.md and read by ahel’s review.

Run inbrain smoke-test or bash scripts/smoke-test.sh after any container restart.

Contract

This skill guarantees:

  • 8 core tests verify inbrain + OpenClaw health after restart
  • Known failures are auto-fixed before reporting
  • User-extensible via ~/.inbrain/smoke-tests.d/*.sh drop-in scripts
  • Results logged to /tmp/inbrain-smoke-test.log
  • Exit code = number of unfixed failures (0 = all pass)

Built-in Tests

#TestAuto-Fix
1Bun runtimeInstall from bun.sh
2Inbrain CLI loadsReinstall deps
3Inbrain database (doctor)—
4Inbrain worker processStart worker
5OpenClaw Codex plugin (Zod CJS)npm install zod@4 --force
6OpenClaw gateway— (may not be started yet)
7Embedding API key— (check .env)
8Brain repo exists—

Usage

CLI

inbrain smoke-test

Direct

bash scripts/smoke-test.sh

From OpenClaw bootstrap

Add to your ensure-services.sh or equivalent:

bash /path/to/inbrain/scripts/smoke-test.sh >> /tmp/bootstrap.log 2>&1

From an agent

exec: bash /data/inbrain/scripts/smoke-test.sh

Adding Custom Tests

Create executable scripts in ~/.inbrain/smoke-tests.d/:

# ~/.inbrain/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-redis from check-redis.sh)
  • Keep tests fast (< 10s each)
  • Tests run in alphabetical order

Adding Built-in Tests

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:

  1. Test first — never fix without confirming broken
  2. Re-test after fix — verify the fix worked
  3. Timeout everything — timeout N on any command that could hang
  4. Use helpers — pass(), fail(), fixed(), skip()
  5. Idempotent fixes — safe to run repeatedly
  6. Skip gracefully — skip() when a prerequisite is missing, don't fail

Environment Variables

VarDefaultDescription
INBRAIN_SMOKE_LOG/tmp/inbrain-smoke-test.logLog file path
INBRAIN_DIR_OVERRIDE(auto-detect)Force inbrain install path
INBRAIN_DATABASE_URL(from .env)Database connection URL
OPENCLAW_GATEWAY_PORT18789Gateway port to test
INBRAIN_BRAIN_PATH/data/brainBrain repo path

Known Issues & Their Auto-Fixes

Codex Zod core.cjs Missing (discovered 2026-04-23)

  • Symptom: Cannot find module './core.cjs' → all Codex ACP sessions fail
  • Cause: Zod v4 npm package ships without core.cjs in some installs
  • Auto-fix: npm install zod@4 --force in the codex extension's zod dir
  • Persistence: Does NOT survive container restart (gateway reinstalls deps)
  • This is why smoke tests must run on every restart

Inbrain Worker Auth Failure

  • Symptom: Worker can't connect to DB
  • Cause: INBRAIN_DATABASE_URL not propagated to worker subprocess
  • Auto-fix: Script explicitly passes both DATABASE_URL and INBRAIN_DATABASE_URL

Anti-Patterns

  • ❌ Running smoke tests on every chat turn. Once per container restart (or on user request) is plenty. The script is cheap but it's not free.
  • ❌ Writing a user drop-in without timeout N around any command that could hang. A single hung drop-in stalls every subsequent run.
  • ❌ Auto-fixing without confirming the check is actually broken first. The pass → fail-detected → fix → re-test loop is the contract; fixes that skip the re-test can report success on a still-broken state.
  • ❌ Treating skip as fail. Missing prerequisites (no OpenClaw installed, no brain repo configured) are skips, not failures. Exit code = count of real failures, not skipped checks.
  • ❌ Hardcoding paths in a user drop-in. Read env vars (INBRAIN_DATABASE_URL, HOME, etc.) so the script travels across container rebuilds.

Output Format

The script writes a one-line status per check to stdout (✅/❌/🔧/⏭️) plus a final summary line: Results: N/M passed, F auto-fixed, S skipped. A structured timestamped log appends to $INBRAIN_SMOKE_LOG (default /tmp/inbrain-smoke-test.log) for post-run forensics. Exit code equals the count of unfixed failures (0 = all pass, positive integer = count of remaining failures).

Signals

GitHub stars
143
Forks
126
Last commit
Jul 2026

ahel review

  • K1binfo
    installs-packages

Automated review, not a security audit. Ruleset v1+k2.

Advanced
Item type
skill
Key
smoke-test-inbrainfun
Source
github.com/inbrainfun/inbrain