[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72SY8YQ4BMDS8ATS0MG6FRK":3,"skill-same:01M72SY8YQ4BMDS8ATS0MG6FRK":57},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":36,"commitSha":37,"skillDirectory":38,"forksCount":39,"repositoryHtmlUrl":40,"repositoryHomepageUrl":6,"ownerHtmlUrl":41,"ownerBlogUrl":6,"ownerDescription":42,"updatedAt":43,"install":44,"resources":56},"01M72SY8YQ4BMDS8ATS0MG6FRK","smoke-test",null,"Post-restart smoke tests + auto-fix for gbrain and OpenClaw environments.\nTests critical services, auto-fixes known issues, extensible via user-defined\ntest scripts in ~\u002F.gbrain\u002Fsmoke-tests.d\u002F*.sh.","ltdrew\u002FAgent-brain-2","ltdrew","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F173687628?v=4","01M72SVABERGYY99JQPNV3FTTN","Logan Drew","01M72SVABZHAN29CHRV66Y48B8",1,"MIT","https:\u002F\u002Fgithub.com\u002Fltdrew\u002FAgent-brain-2\u002Fblob\u002Ffeat\u002Fbrain-first-convention\u002Fskills\u002Fsmoke-test\u002FSKILL.md",[],[],"2026-11-10 22:39:42",false,"---\nname: smoke-test\ndescription: |\n  Post-restart smoke tests + auto-fix for gbrain and OpenClaw environments.\n  Tests critical services, auto-fixes known issues, extensible via user-defined\n  test scripts in ~\u002F.gbrain\u002Fsmoke-tests.d\u002F*.sh.\ntriggers:\n  - \"smoke test\"\n  - \"run smoke tests\"\n  - \"container restart check\"\n  - \"health check\"\n  - \"did the restart break anything\"\n  - \"did the container restart break anything\"\ntools:\n  - exec\n  - read\nmutating: true\n---\n\n# Smoke Test Skillpack\n\n> Run `gbrain smoke-test` or `bash scripts\u002Fsmoke-test.sh` after any container restart.\n\n## Contract\n\nThis skill guarantees:\n- 8 core tests verify gbrain + OpenClaw health after restart\n- Known failures are auto-fixed before reporting\n- User-extensible via `~\u002F.gbrain\u002Fsmoke-tests.d\u002F*.sh` drop-in scripts\n- Results logged to `\u002Ftmp\u002Fgbrain-smoke-test.log`\n- Exit code = number of unfixed failures (0 = all pass)\n\n## Built-in Tests\n\n| # | Test | Auto-Fix |\n|---|------|----------|\n| 1 | Bun runtime | Install from bun.sh |\n| 2 | GBrain CLI loads | Reinstall deps |\n| 3 | GBrain database (doctor) | — |\n| 4 | GBrain worker process | Start worker |\n| 5 | OpenClaw Codex plugin (Zod CJS) | `npm install zod@4 --force` |\n| 6 | OpenClaw gateway | — (may not be started yet) |\n| 7 | Embedding API key | — (check .env) |\n| 8 | Brain repo exists | — |\n\n## Usage\n\n### CLI\n```bash\ngbrain smoke-test\n```\n\n### Direct\n```bash\nbash scripts\u002Fsmoke-test.sh\n```\n\n### From OpenClaw bootstrap\nAdd to your `ensure-services.sh` or equivalent:\n```bash\nbash \u002Fpath\u002Fto\u002Fgbrain\u002Fscripts\u002Fsmoke-test.sh >> \u002Ftmp\u002Fbootstrap.log 2>&1\n```\n\n### From an agent\n```\nexec: bash \u002Fdata\u002Fgbrain\u002Fscripts\u002Fsmoke-test.sh\n```\n\n## Adding Custom Tests\n\nCreate executable scripts in `~\u002F.gbrain\u002Fsmoke-tests.d\u002F`:\n\n```bash\n# ~\u002F.gbrain\u002Fsmoke-tests.d\u002Fcheck-redis.sh\n#!\u002Fbin\u002Fbash\nredis-cli ping | grep -q PONG\n```\n\nRules:\n- Exit 0 = pass, non-zero = fail\n- Filename becomes the test name (e.g. `check-redis` from `check-redis.sh`)\n- Keep tests fast (\u003C 10s each)\n- Tests run in alphabetical order\n\n## Adding Built-in Tests\n\nEdit `scripts\u002Fsmoke-test.sh`. Follow this pattern:\n\n```bash\n# ── N. [Service Name] ──────────────────────────────────────\nif [test condition]; then\n  pass \"[Service Name]\"\nelse\n  # Auto-fix attempt\n  [fix command]\n  if [re-test condition]; then\n    fixed \"[What was fixed]\"\n    pass \"[Service Name] (after fix)\"\n  else\n    fail \"[Service Name] — [error detail]\"\n  fi\nfi\n```\n\n### Design rules:\n1. **Test first** — never fix without confirming broken\n2. **Re-test after fix** — verify the fix worked\n3. **Timeout everything** — `timeout N` on any command that could hang\n4. **Use helpers** — `pass()`, `fail()`, `fixed()`, `skip()`\n5. **Idempotent fixes** — safe to run repeatedly\n6. **Skip gracefully** — `skip()` when a prerequisite is missing, don't fail\n\n## Environment Variables\n\n| Var | Default | Description |\n|-----|---------|-------------|\n| `GBRAIN_SMOKE_LOG` | `\u002Ftmp\u002Fgbrain-smoke-test.log` | Log file path |\n| `GBRAIN_DIR_OVERRIDE` | (auto-detect) | Force gbrain install path |\n| `GBRAIN_DATABASE_URL` | (from .env) | Database connection URL |\n| `OPENCLAW_GATEWAY_PORT` | `18789` | Gateway port to test |\n| `GBRAIN_BRAIN_PATH` | `\u002Fdata\u002Fbrain` | Brain repo path |\n\n## Known Issues & Their Auto-Fixes\n\n### Codex Zod core.cjs Missing (discovered 2026-04-23)\n- **Symptom:** `Cannot find module '.\u002Fcore.cjs'` → all Codex ACP sessions fail\n- **Cause:** Zod v4 npm package ships without `core.cjs` in some installs\n- **Auto-fix:** `npm install zod@4 --force` in the codex extension's zod dir\n- **Persistence:** Does NOT survive container restart (gateway reinstalls deps)\n- This is why smoke tests must run on every restart\n\n### GBrain Worker Auth Failure\n- **Symptom:** Worker can't connect to DB\n- **Cause:** `GBRAIN_DATABASE_URL` not propagated to worker subprocess\n- **Auto-fix:** Script explicitly passes both `DATABASE_URL` and `GBRAIN_DATABASE_URL`\n\n## Anti-Patterns\n\n- ❌ Running smoke tests on every chat turn. Once per container restart (or\n  on user request) is plenty. The script is cheap but it's not free.\n- ❌ Writing a user drop-in without `timeout N` around any command that\n  could hang. A single hung drop-in stalls every subsequent run.\n- ❌ Auto-fixing without confirming the check is actually broken first.\n  The `pass → fail-detected → fix → re-test` loop is the contract; fixes\n  that skip the re-test can report success on a still-broken state.\n- ❌ Treating `skip` as `fail`. Missing prerequisites (no OpenClaw installed,\n  no brain repo configured) are skips, not failures. Exit code = count of\n  real failures, not skipped checks.\n- ❌ Hardcoding paths in a user drop-in. Read env vars\n  (`GBRAIN_DATABASE_URL`, `HOME`, etc.) so the script travels across\n  container rebuilds.\n\n## Output Format\n\nThe script writes a one-line status per check to stdout (✅\u002F❌\u002F🔧\u002F⏭️) plus a\nfinal summary line: `Results: N\u002FM passed, F auto-fixed, S skipped`. A\nstructured timestamped log appends to `$GBRAIN_SMOKE_LOG`\n(default `\u002Ftmp\u002Fgbrain-smoke-test.log`) for post-run forensics. Exit code\nequals the count of unfixed failures (0 = all pass, positive integer =\ncount of remaining failures).\n","# Smoke Test Skillpack\n\n> Run `gbrain smoke-test` or `bash scripts\u002Fsmoke-test.sh` after any container restart.\n\n## Contract\n\nThis skill guarantees:\n- 8 core tests verify gbrain + OpenClaw health after restart\n- Known failures are auto-fixed before reporting\n- User-extensible via `~\u002F.gbrain\u002Fsmoke-tests.d\u002F*.sh` drop-in scripts\n- Results logged to `\u002Ftmp\u002Fgbrain-smoke-test.log`\n- Exit code = number of unfixed failures (0 = all pass)\n\n## Built-in Tests\n\n| # | Test | Auto-Fix |\n|---|------|----------|\n| 1 | Bun runtime | Install from bun.sh |\n| 2 | GBrain CLI loads | Reinstall deps |\n| 3 | GBrain database (doctor) | — |\n| 4 | GBrain worker process | Start worker |\n| 5 | OpenClaw Codex plugin (Zod CJS) | `npm install zod@4 --force` |\n| 6 | OpenClaw gateway | — (may not be started yet) |\n| 7 | Embedding API key | — (check .env) |\n| 8 | Brain repo exists | — |\n\n## Usage\n\n### CLI\n```bash\ngbrain smoke-test\n```\n\n### Direct\n```bash\nbash scripts\u002Fsmoke-test.sh\n```\n\n### From OpenClaw bootstrap\nAdd to your `ensure-services.sh` or equivalent:\n```bash\nbash \u002Fpath\u002Fto\u002Fgbrain\u002Fscripts\u002Fsmoke-test.sh >> \u002Ftmp\u002Fbootstrap.log 2>&1\n```\n\n### From an agent\n```\nexec: bash \u002Fdata\u002Fgbrain\u002Fscripts\u002Fsmoke-test.sh\n```\n\n## Adding Custom Tests\n\nCreate executable scripts in `~\u002F.gbrain\u002Fsmoke-tests.d\u002F`:\n\n```bash\n# ~\u002F.gbrain\u002Fsmoke-tests.d\u002Fcheck-redis.sh\n#!\u002Fbin\u002Fbash\nredis-cli ping | grep -q PONG\n```\n\nRules:\n- Exit 0 = pass, non-zero = fail\n- Filename becomes the test name (e.g. `check-redis` from `check-redis.sh`)\n- Keep tests fast (\u003C 10s each)\n- Tests run in alphabetical order\n\n## Adding Built-in Tests\n\nEdit `scripts\u002Fsmoke-test.sh`. Follow this pattern:\n\n```bash\n# ── N. [Service Name] ──────────────────────────────────────\nif [test condition]; then\n  pass \"[Service Name]\"\nelse\n  # Auto-fix attempt\n  [fix command]\n  if [re-test condition]; then\n    fixed \"[What was fixed]\"\n    pass \"[Service Name] (after fix)\"\n  else\n    fail \"[Service Name] — [error detail]\"\n  fi\nfi\n```\n\n### Design rules:\n1. **Test first** — never fix without confirming broken\n2. **Re-test after fix** — verify the fix worked\n3. **Timeout everything** — `timeout N` on any command that could hang\n4. **Use helpers** — `pass()`, `fail()`, `fixed()`, `skip()`\n5. **Idempotent fixes** — safe to run repeatedly\n6. **Skip gracefully** — `skip()` when a prerequisite is missing, don't fail\n\n## Environment Variables\n\n| Var | Default | Description |\n|-----|---------|-------------|\n| `GBRAIN_SMOKE_LOG` | `\u002Ftmp\u002Fgbrain-smoke-test.log` | Log file path |\n| `GBRAIN_DIR_OVERRIDE` | (auto-detect) | Force gbrain install path |\n| `GBRAIN_DATABASE_URL` | (from .env) | Database connection URL |\n| `OPENCLAW_GATEWAY_PORT` | `18789` | Gateway port to test |\n| `GBRAIN_BRAIN_PATH` | `\u002Fdata\u002Fbrain` | Brain repo path |\n\n## Known Issues & Their Auto-Fixes\n\n### Codex Zod core.cjs Missing (discovered 2026-04-23)\n- **Symptom:** `Cannot find module '.\u002Fcore.cjs'` → all Codex ACP sessions fail\n- **Cause:** Zod v4 npm package ships without `core.cjs` in some installs\n- **Auto-fix:** `npm install zod@4 --force` in the codex extension's zod dir\n- **Persistence:** Does NOT survive container restart (gateway reinstalls deps)\n- This is why smoke tests must run on every restart\n\n### GBrain Worker Auth Failure\n- **Symptom:** Worker can't connect to DB\n- **Cause:** `GBRAIN_DATABASE_URL` not propagated to worker subprocess\n- **Auto-fix:** Script explicitly passes both `DATABASE_URL` and `GBRAIN_DATABASE_URL`\n\n## Anti-Patterns\n\n- ❌ Running smoke tests on every chat turn. Once per container restart (or\n  on user request) is plenty. The script is cheap but it's not free.\n- ❌ Writing a user drop-in without `timeout N` around any command that\n  could hang. A single hung drop-in stalls every subsequent run.\n- ❌ Auto-fixing without confirming the check is actually broken first.\n  The `pass → fail-detected → fix → re-test` loop is the contract; fixes\n  that skip the re-test can report success on a still-broken state.\n- ❌ Treating `skip` as `fail`. Missing prerequisites (no OpenClaw installed,\n  no brain repo configured) are skips, not failures. Exit code = count of\n  real failures, not skipped checks.\n- ❌ Hardcoding paths in a user drop-in. Read env vars\n  (`GBRAIN_DATABASE_URL`, `HOME`, etc.) so the script travels across\n  container rebuilds.\n\n## Output Format\n\nThe script writes a one-line status per check to stdout (✅\u002F❌\u002F🔧\u002F⏭️) plus a\nfinal summary line: `Results: N\u002FM passed, F auto-fixed, S skipped`. A\nstructured timestamped log appends to `$GBRAIN_SMOKE_LOG`\n(default `\u002Ftmp\u002Fgbrain-smoke-test.log`) for post-run forensics. Exit code\nequals the count of unfixed failures (0 = all pass, positive integer =\ncount of remaining failures).\n",{"name":5,"tools":24,"mutating":27,"triggers":28,"description":35},[25,26],"exec","read",true,[29,30,31,32,33,34],"smoke test","run smoke tests","container restart check","health check","did the restart break anything","did the container restart break anything","Post-restart smoke tests + auto-fix for gbrain and OpenClaw environments.\nTests critical services, auto-fixes known issues, extensible via user-defined\ntest scripts in ~\u002F.gbrain\u002Fsmoke-tests.d\u002F*.sh.\n","feat\u002Fbrain-first-convention","f3dace916c3845569f26904591b95baf00237bf8","skills\u002Fsmoke-test",0,"https:\u002F\u002Fgithub.com\u002Fltdrew\u002FAgent-brain-2","https:\u002F\u002Fgithub.com\u002Fltdrew","Account 2","2026-05-13 07:52:42",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":27},[46,49,52],{"tool":47,"command":48},"npx","npx skills add ltdrew\u002FAgent-brain-2 --skill smoke-test",{"tool":50,"command":51},"bunx","bunx skills add ltdrew\u002FAgent-brain-2 --skill smoke-test",{"tool":53,"command":54},"pnpm","pnpm dlx skills add ltdrew\u002FAgent-brain-2 --skill smoke-test","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fltdrew\u002FAgent-brain-2\u002Fblob\u002Ffeat\u002Fbrain-first-convention\u002Fskills\u002Fsmoke-test\u002FSKILL.md",[],[58,65,72,79,86,93],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M72SYQK7HQ98AEY8Z8DBT3C0","signal-detector","Always-on ambient signal capture for the OpenClaw reference fixture.","https:\u002F\u002Fgithub.com\u002Fltdrew\u002FAgent-brain-2\u002Fblob\u002Ffeat\u002Fbrain-first-convention\u002Ftest\u002Ffixtures\u002Fopenclaw-reference-minimal\u002Fskills\u002Fsignal-detector\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M72SYPHM4TDK6ZRV4NWAGC3D","query","Look up brain pages in the OpenClaw reference fixture.","https:\u002F\u002Fgithub.com\u002Fltdrew\u002FAgent-brain-2\u002Fblob\u002Ffeat\u002Fbrain-first-convention\u002Ftest\u002Ffixtures\u002Fopenclaw-reference-minimal\u002Fskills\u002Fquery\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M72SYN2J4BGSFS613D80AJQX","context-now","ALWAYS-ON time-sensitivity discipline for the OpenClaw reference fixture.","https:\u002F\u002Fgithub.com\u002Fltdrew\u002FAgent-brain-2\u002Fblob\u002Ffeat\u002Fbrain-first-convention\u002Ftest\u002Ffixtures\u002Fopenclaw-reference-minimal\u002Fskills\u002Fcontext-now\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M72SYKY67RCNH8VH9R2N0ZZV","brain-ops","Core read\u002Fwrite cycle for the OpenClaw reference fixture.","https:\u002F\u002Fgithub.com\u002Fltdrew\u002FAgent-brain-2\u002Fblob\u002Ffeat\u002Fbrain-first-convention\u002Ftest\u002Ffixtures\u002Fopenclaw-reference-minimal\u002Fskills\u002Fbrain-ops\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M72SYHEMGTDRWSERJWZR0XE2","webhook-transforms","Generic framework for converting external events (SMS, meetings, social mentions)\ninto brain-ingestible signals. Define a transform function, register a webhook URL,\nand incoming events get processed through the brain pipeline.","https:\u002F\u002Fgithub.com\u002Fltdrew\u002FAgent-brain-2\u002Fblob\u002Ffeat\u002Fbrain-first-convention\u002Fskills\u002Fwebhook-transforms\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M72SYEE2B8F47TN01CAGQ4JG","testing","Skill validation framework. Validates every skill has SKILL.md with frontmatter,\nevery reference exists, every env var is declared. The testing contract for the\nskill system itself.","https:\u002F\u002Fgithub.com\u002Fltdrew\u002FAgent-brain-2\u002Fblob\u002Ffeat\u002Fbrain-first-convention\u002Fskills\u002Ftesting\u002FSKILL.md",[],[]]