smoke-test
Skill5 starsChanged 3 months agoApache-2.0View on GitHub
CloseCrab bot 部署/重启后健康检查。当用户说"体检"、"smoke test"、"health check"、"检查 bot"、"bot 还好吗"、"刚部署完确认下"或部署/重启后想验证状态时触发。覆盖进程、Firestore、worker secrets、日志活性、近期错误,并扫描 `~/.closecrab/smoke-tests.d/` 下用户自定义 drop-in 检查。
21 other projects use a version of this.
Adopted by
Most recently taken up by
- AJschoons/robowrighttheir own version, first seen Nov 8, 2026
- blamechris/chroxytheir own version, first seen Nov 8, 2026
- crbnos/carbontheir own version, first seen Nov 7, 2026
- danielvm-git/bigpowerstheir own version, first seen Nov 6, 2026
- dspace-group/SystemDeskMCPtheir own version, first seen Nov 1, 2026
- Draganoider/claude-code-telegramtheir own version, first seen Oct 20, 2026
Used with
Projects with it also use debugging-difficult-bugs, pr-explainer and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
dzevsSkilldebugging-difficult-bugs
Use early when debugging a medium or hard bug, especially when tests alone may not reveal the real runtime failure. Trigger this before extended TDD iteration when a bug involves runtime state, PTY/terminal ordering, persistence, streaming, async/concurrency, the TUI/manual reproduction, the IPC socket layer, or when a red or newly passing test may not model the real issue. Skip only when the root cause is already directly proven by a stack trace or deterministic test that exercises the real runtime path.
Also in 3 projects that use this
Mathews-TomSkillpr-explainer
Use when a developer asks to explain a pushed PR, walk through a PR stack, understand one stack member, or explain what an AI agent just pushed so they can connect code changes to end-to-end functionality and update domain knowledge. Not for defect review, merge approval, PR-body authoring, or full-repository onboarding.
Also in 3 projects that use this
dzevsSkillpr-splitter
Use when breaking a large, complex, messy, or hard-to-review pull request into multiple smaller PRs; planning stacked PRs; extracting independent changes from a branch; splitting mixed refactor and behavior changes; managing drift after review feedback (operator gate, Codex/swarm second opinion); rebasing follow-up PRs as earlier PRs change; or preserving original branch intent while shipping incrementally.
Also in 3 projects that use this
Other versions21 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 21
- garrytan/gbrain★ 32ksame name
- mastra-ai/mastra★ 29ksame name
- JoshuaC215/agent-service-toolkit★ 4.6ksame name
- crbnos/carbon★ 2.8ksame name
- peteonrails/voxtype★ 1.8ksame name
- nginx/nginx-s3-gateway★ 761same name
- danielvm-git/bigpowers★ 288same name
- andrew-yangy/gru-ai★ 153same name
- stacklok/toolhive-registry-server★ 29same name
- sohei56/maul-team★ 17same name
11 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository54 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- agent-teamsSkill
- bilibili-channelSkill
- bot-configSkill
- browser-cliSkill
- bwrap-bypassSkill
- cc-pages-backupSkill
- chat-styleSkill
- chinese-dictationSkill
- code-wiki-reconSkill
- deck-builderSkill
- docx-form-fillerSkill
- evolutionSkill
- explainer-distillSkill
- feishu-bitableSkill
- feishu-docSkill
- feishu-mailSkill
- feishu-sheetSkill
- feishu-user-msgSkill
- fireworks-tech-graphSkill
- frontend-slidesSkill
- gemini-ui-reviewerSkill
- hk-busSkill
- hk-share-award-tax-dipn38Skill
- imagen-generatorSkill
- issue-handlerSkill
- lecture-videoSkill
- lecture-voiceSkill
- lesson-read-aloudSkill
- live-canvasSkill
- lustre-mounterSkill
- manim-teaching-figuresSkill
- math-video-tutorSkill
- memory-gcSkill
- memory-lintSkill
- multimodal-explainerSkill
- music-generatorSkill
- notifySkill
- page-styleSkill
- paper-explainerSkill
- session-handoffSkill
- skill-creatorSkill
- study-materialSkill
- tmux-installerSkill
- tmux-orchestratorSkill
- tpuguruSkill
- tts-generatorSkill
- veo-generatorSkill
- vscode-referenceSkill
- weather-forecastSkill
- wechat-readerSkill
- wikiSkill
- youtube-channelSkill
- zsh-installerSkill
The file
Files
CloseCrab Bot Smoke Test
部署/重启 CloseCrab bot 后的一站式健康检查。基于 GBrain smoke-test 设计模式移植 — 但 v1 是 detect-only(不做 auto-fix,因为 production bot 上自动修复风险太高)。
v2(Round 3 沉淀, 2026-05-20): 加入 evolution loop 学到的两项 anti-pattern 检查:
binary_alignment— 比对 bot 进程 lstart vs git HEAD commit time,落后即 FAIL,并打印 SIGHUP 重启命令。防 Round 3 anti-pattern 1(stale binary 跑 fast-path test 测出假 PASS)。fast_path_callbacks— 静态扫closecrab/channels/*.py,所有_make_input_callback必须有is_inbox参数。防 Round 2/3 anti-pattern(inbox 派活走 user-facing 5min × N timeout)。
这两个 check 由 scripts/check-binary-alignment.py + bash 内嵌 grep 实现,无新依赖。
触发条件
- 用户说:"体检 bunny"、"检查 bot 状态"、"smoke test"、"刚重启完确认下"
- 任何 bot deploy / restart 后的自我验证
- Inbox 收到
/health命令(agent 自动回 JSON) - 调度脚本
dispatch-bot.sh之后
用法
# 检查单个 bot(带颜色,人读)
~/CloseCrab/scripts/closecrab-smoke-test.sh bunny
# 检查本机所有跑着的 bot
~/CloseCrab/scripts/closecrab-smoke-test.sh --all
# 只看总结行(适合脚本调用)
~/CloseCrab/scripts/closecrab-smoke-test.sh bunny --quiet
# JSON 输出(适合 agent 自动消费 / inbox 回复)
~/CloseCrab/scripts/closecrab-smoke-test.sh bunny --json
# JSON + 修复建议(skillpack-check 模式,给 agent 看)
~/CloseCrab/scripts/closecrab-smoke-test.sh bunny --json --actionsExit code = failed check 数(0 = 全过)。任何 caller 都可以拿 exit code 直接决策。
JSON Schema(--json 输出)
{
"status": "ok | warn | fail", // 总状态:fail>0 = fail, skip>0 = warn, all pass = ok
"pass": 8,
"fail": 1,
"skip": 3,
"bots": ["bunny"],
"results": [
{"name": "bot_process", "status": "pass", "detail": "pid=12345 rss=265MB"},
...
],
"actions": [ // 仅 --actions 时填充
{
"check": "bot_process",
"cmd": "cd ~/CloseCrab && nohup ./run.sh bunny > /tmp/bunny.run.log 2>&1 &",
"reason": "Bot process not running; relaunch via run.sh supervisor."
}
]
}Agent 用法(受 GBrain skillpack-check 启发)
当 agent / inbox / 其他 bot 想问 "这个 bot 还好吗",跑:
~/CloseCrab/scripts/closecrab-smoke-test.sh <bot> --json --actions然后根据返回的 status + actions[] 决策:
status: "ok"→ 啥都不做status: "warn"→ 把results[]里skip的项目当 review 候选展示给人status: "fail"→ 把actions[]里的cmdpaste 出来让 oncall 决定执行(不要自动跑)
输出语义
| 符号 | 状态 | 含义 |
✓ | pass | 检查通过 |
✗ | fail | 真问题,需要处理(计入 exit code) |
⊘ | skip | 检查不适用(如 secret 没设但可能用 ADC)— 不算 fail |
内置检查
| Check | 说明 |
bot_process | pgrep 找 python3 -m closecrab --bot {name} 进程 |
run_sh_wrapper | 是否有 run.sh supervisor(手动启动是 skip 不是 fail) |
firestore_sa_key | GOOGLE_APPLICATION_CREDENTIALS 文件可读且 JSON 合法(未设 → skip,假设走 ADC) |
firestore_reachable | bots/{name} doc 存在(用 8s timeout 防卡) |
worker_type | 显示当前 worker(claude/gemini/openclaw/kilo) |
claude_settings | ~/.claude/settings.json 解析 OK |
worker_secret_* | 按 worker_type 检查 — Claude 看 Vertex/API key;Gemini 看 API key;OpenClaw 看 Gateway :18789;Kilo 看 kilo 二进制 |
bot_log_recent | bot.log mtime — <1h pass;<24h skip;>24h fail |
recent_errors | 末尾 200 行的 ERROR/CRITICAL/Traceback 计数 |
drop_ins | 扫描自定义检查 |
Drop-in 自定义检查
放在 ~/.closecrab/smoke-tests.d/ 下(所有 bot 通用)或 ~/.closecrab/smoke-tests.d/{bot}/(单 bot 专属)的 *.sh 文件会自动被发现执行。
合约:脚本第一行 stdout 必须以 OK / FAIL / SKIP 开头。BOT 环境变量已注入。
示例:~/.closecrab/smoke-tests.d/bunny/discord-token.sh:
#!/usr/bin/env bash
set -u
token=$(timeout 5 python3 -c "
from google.cloud import firestore
db = firestore.Client(project='chris-pgp-host', database='closecrab')
d = db.collection('bots').document('$BOT').get().to_dict() or {}
print((d.get('discord') or {}).get('token','')[:10])
" 2>/dev/null)
if [ -n "$token" ]; then echo "OK discord token present (${token}...)"; else echo "FAIL no discord token"; exit 1; fi设计原则(从 GBrain 移植 + CloseCrab 适配)
- Detect-only, no auto-fix — 跑着的 production bot 自动重启会丢用户上下文,先 v1 detect → 让人/agent 决策
- Timeout everything — 所有外部调用都
timeout 5-8s,不卡死 - Skip 不是 fail — 可选能力没配(如 SA key、drop-ins 目录空)只 skip
- JSON-first for agents —
--json输出让 inbox 消息 / cron / 其他 bot 能机器消费 - Drop-in 扩展 — 不改核心脚本就能为某 bot 加专属检查
后续可加(v2 候选)
- 按 worker_type 拉最近一次 firestore log 看
status/error字段 - ✁
--fixflag 启用 careful auto-fix(如重启 cron-daemon、re-mount gcsfuse)— 需要 case-by-case 评估 - Cross-bot
/health聚合面板(Jarvis 一次查所有 teammate)
来源
移植自 gbrain skills/smoke-test/SKILL.md。 GBrain 评估报告:https://cc.higcp.com/assets/gbrain-evaluation-20260519-101510.html
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

