본문으로 건너뛰기
cccskills
무료GitHub에 공개

smoke-test

Check a gbrain installation after a restart or when services seem broken. It tests key components, repairs some local problems, checks OpenClaw when installed, and records results, with support for custom test scripts.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

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.

설치 방법 보기

이럴 때 유용합니다

  • Check services after a machine or container restart
  • Investigate problems with a gbrain installation
  • Check OpenClaw services when installed
  • Add checks for services used in your environment

포함된 파일(1)

  • SKILL.md7.2 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Smoke Test Skillpack

Run gbrain smoke-test after 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/*.sh drop-in scripts
  • Results logged to /tmp/gbrain-smoke-test.log
  • Exit code = number of unfixed failures (0 = all pass)

Built-in Tests

#TestAuto-Fix
1Bun runtimeInstall from bun.sh
2GBrain CLI loadsReinstall deps
3GBrain database (engine identity via gbrain engine status --json, then doctor --json's connection check)gbrain db-repair --yes, re-test
4GBrain worker process— (native supervisor status + duplicate detection)
5OpenClaw Codex plugin (Zod CJS); skips if OpenClaw absentnpm install zod@4 --force
6OpenClaw gateway; skips if OpenClaw absent— (may not be started yet)
7Embedding API key— (check .env)
8Brain 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-redis from check-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:

  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
GBRAIN_SMOKE_LOG/tmp/gbrain-smoke-test.logLog 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.pidLegacy bare-worker PID path
OPENCLAW_GATEWAY_PORT18789Gateway 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.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

GBrain Worker Auth Failure

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

When it fails

Follow the agent operator protocol for any gbrain error code, exit code, [AGENT] block or notice block. Specific to this skill:

  • Exit code = number of unfixed failures: report each by name and the attempted fix; never report all-green when a test was skipped.
  • The database test fails with a GBRAIN_DB_ACCESS marker: run gbrain db-repair and re-test; the rewrite tier needs the user's agreement.
  • The embedding API key check fails: there is no auto-fix. Tell the user which key is missing and that search runs keyword-only until it is set.

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 (GBRAIN_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 $GBRAIN_SMOKE_LOG (default /tmp/gbrain-smoke-test.log) for post-run forensics. Exit code equals the count of unfixed failures (0 = all pass, positive integer = count of remaining failures).

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Check research claims cited in books, articles, or conversations by tracing the original paper, methods, underlying data, and independent replication. Save a sourced assessment explaining whether the claim holds up and what remains uncertain.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Check a study cited in a book
  • Trace a numerical claim in an article to its source data
  • Verify research evidence before using it in writing
garrytan/gbrain3.1만2026년 10월 19일 업데이트

Explore old files and email archives to rediscover personal writing, ideas, and meaningful conversations. Review selected items one at a time, save worthwhile material as organized notes, and track progress within explicitly permitted folders.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Rediscover old journals and creative writing
  • Find meaningful letters and email conversations
  • Recover past product and business ideas
garrytan/gbrain3.1만2026년 10월 19일 업데이트

Restructure raw article text stored in gbrain into summaries, exact quotes, key insights, and links to related pages. Preserve the original text and connect the article's significance to projects and interests already recorded in gbrain.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Organizing saved articles into readable notes
  • Collecting exact quotes for essays
  • Connecting articles to current projects
garrytan/gbrain3.1만2026년 10월 19일 업데이트

ask-user

무료

Present clear choices when a task needs a human decision, then pause execution until the user replies. This reusable interaction pattern supports filing decisions, priority selection, and confirmation before destructive actions, with an option to decline.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Clarifying requests with several possible meanings
  • Confirming before bulk deletion or overwriting
  • Choosing where to file meeting notes
garrytan/gbrain3.1만2026년 10월 19일 업데이트

Collect public posts across a blog, newsletter, or feed archive and save clean Markdown pages for each article. The workflow avoids duplicates, supports resumed runs, repairs empty results, and hands articles to a separate enrichment skill.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Importing a blog's public article archive
  • Organizing public newsletter posts as knowledge pages
  • Rerunning a feed import without duplicates
garrytan/gbrain3.1만2026년 10월 19일 업데이트

Create a detailed chapter-by-chapter reading companion from an EPUB or PDF, connecting the book’s ideas to experiences and words saved in your personal knowledge store. The result highlights parallels without prescribing actions.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Connect a book’s ideas to personal experiences
  • Review detailed chapter summaries alongside personal reflections
  • Create a parent’s guide for reading a children’s book aloud
garrytan/gbrain3.1만2026년 10월 19일 업데이트

garrytan의 스킬 모두 보기

이 스킬의 문제 신고