idea-analogist
想法群聊室 — 类比者角色。被 idea-team 主编排器调用,或用户单独说"类比一下"、"别的行业有没有"、"yes-and 扩展"、"X 让你想到什么"、"跨界启示"时触发。**专门做跨界类比 + yes-and 扩展——不评判、不挑刺、不要求事实证据**。Do NOT use when 用户要数据(用…
Diagnose excessive Codex local SQLite diagnostic log writes with read-only evidence by default. Use when a user mentions logs_2.sqlite, logs_2.sqlite-wal, block_log_inserts, SSD/TBW wear, or explicitly asks to protect, clean up, verify, or restore Codex diagnostic logging.
$ npx -y skills add majiayu000/spellbook --skill codex-log-guard --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/codex-log-guardContext preview
The summary Claude sees to decide when to auto-load this skill.
Diagnose excessive Codex local SQLite diagnostic log writes with read-only evidence by default. Use when a user mentions logs_2.sqlite, logs_2.sqlite-wal, block_log_inserts, SSD/TBW wear, or explicitly asks to protect, clean up, verify, or restore Codex diagnostic logging.
name: codex-log-guard description: Diagnose excessive Codex local SQLite diagnostic log writes with read-only evidence by default. Use when a user mentions logs_2.sqlite, logs_2.sqlite-wal, block_log_inserts, SSD/TBW wear, or explicitly asks to protect, clean up, verify, or restore Codex diagnostic logging.
Diagnose Codex persistent diagnostic logging from local evidence, then give a concise conclusion and the safest next action. Do not make the user choose from a command menu.
Select one mode from the current user request:
Generic wording such as "处理", "修一下", or "止血" selects `protect`, not `cleanup`. Prior approval does not carry into a later run. If the requested write mode is ambiguous, return the `diagnose_only` report and the exact proposed mutation without applying it.
Direct actions:
Escalate before:
Evidence-backed pushback:
Feedback loop:
`agents/openai.yaml` contains discovery UI metadata only; it is not an operational instruction source.
When the user asks to "check", "看看", "诊断", or asks whether the local machine is affected:
1. Inspect all candidate live database files and schemas:
2. Identify which candidate database is currently held by Codex processes. 3. Check whether `block_log_inserts` already exists on each candidate with a `logs` table. 4. Measure whether `logs` is still being written using `COUNT(*), MIN(id), MAX(id)` samples. Treat `MAX(id)` or `MIN(id)` movement with stable `COUNT(*)` as active churn, not necessarily disk growth. 4. Inspect low-level log volume with `TRACE`/`DEBUG` counts and top noisy targets. 5. Check which Codex processes currently hold each candidate database. 6. Return a diagnosis with:
7. Do not ask the user which command to run. Choose the diagnosis path from the evidence.
In `protect` mode:
1. Install `block_log_inserts` first. 2. Verify that `COUNT(*), MAX(id)` stops growing. 3. Report the protected database path and fresh samples. Do not delete or vacuum rows.
In `cleanup` mode:
1. Complete and verify protection first. 2. Create a timestamped SQLite `.backup` and require a non-empty file plus a successful `PRAGMA quick_check` result. 3. Delete log rows, vacuum, and checkpoint the WAL. 4. Report the backup path and final file sizes.
In `restore` mode:
1. Drop `block_log_inserts`. 2. Sample `COUNT(*), MAX(id)` to confirm logging resumes or stays quiet.
Run direct shell/SQLite commands. Use only the needed subset for the user's request; do not paste a menu back to the user.
Inspect files:
for db in ~/.codex/logs_2.sqlite ~/.codex/sqlite/logs_2.sqlite; do ls -lh "$db"* 2>/dev/null du -h "$db"* 2>/dev/null done
After `lsof` identifies the active candidate, validate the selected path in the same shell command before running any later SQLite snippet:
: "${CODEX_LOG_DB:?set CODEX_LOG_DB to the verified active candidate}"
case "$CODEX_LOG_DB" in
"$HOME/.codex/logs_2.sqlite"|"$HOME/.codex/sqlite/logs_2.sqlite") ;;
*) echo "refusing unexpected Codex log database path" >&2; exit 2 ;;
esac
readonly db="$CODEX_LOG_DB"Do not supply a default. If no active path can be proven, stay in `diagnose_only` and report the ambiguity.
Check schema and trigger:
sqlite3 "$db" ".tables" sqlite3 "$db" "PRAGMA table_info(logs);" sqlite3 "$db" "SELECT name, tbl_name, sql FROM sqlite_master WHERE type='trigger' AND name='block_log_inserts';"
Sample writes and growth:
for i in 1 2 3; do date '+%F %T' sqlite3 "$db" "SELECT COUNT(*) AS rows, MIN(id) AS min_id, MAX(id) AS max_id FROM logs;" stat -f '%N %z bytes mtime=%Sm' "$db" "$db-wal" "$db-shm" 2>/dev/null sleep 10 done
Inspect levels and noisy targets:
sqlite3 "$db" "SELECT level, COUNT(*) AS n, ROUND(SUM(estimated_bytes)/1024.0/1024.0, 1) AS estimated_mib FROM logs GROUP BY level ORDER BY n DESC;" sqlite3 "$db" "SELECT target, level, COUNT(*) AS n, ROUND(SUM(estimated_bytes)/1024.0/1024.0, 1) AS estimated_mib FROM logs GROUP BY target, level ORDER BY n DESC LIMIT 15;"
Check open processes:
lsof ~/.codex/logs_2.sqlite ~/.codex/logs_2.sqlite-wal ~/.codex/logs_2.sqlite-shm \
~/.codex/sqlite/logs_2.sqlite ~/.codex/sqlite/logs_2.sqlitCross-runtime skills for Claude Code, Codex, and multi-agent workflows.
Repo: majiayu000/spellbook
想法群聊室 — 类比者角色。被 idea-team 主编排器调用,或用户单独说"类比一下"、"别的行业有没有"、"yes-and 扩展"、"X 让你想到什么"、"跨界启示"时触发。**专门做跨界类比 + yes-and 扩展——不评判、不挑刺、不要求事实证据**。Do NOT use when 用户要数据(用…
想法群聊室 — 反方角色。被 idea-team 主编排器调用,或用户单独说"反方意见"、"挑这个想法的刺"、"为什么会失败"、"找漏洞 / 反例"、"devil's advocate"时触发。**专门挑漏洞、找隐藏假设、给反例——不安慰、不"也许可以这样"、不全盘否定**。Do NOT use when…
想法群聊室 — 调研员角色。被 idea-team 主编排器调用,或用户单独说"调研一下 X"、"X 的现状/竞品/数据"、"找 2026 数据"、"事实底"时触发。**用 WebSearch 拉真实 2026 数据、列竞品、引来源——只给事实,不评判,不建议**。Do NOT use when…
想法群聊室主持人 — 把一句话想法丢给多角色 AI 团队(调研员/反方/类比者)做查漏补缺。每个角色有自己的 voice,他们互相 @ 接话;你随时插话。**这是创意扩展工具,不打分、不否决、不堵路**。Use when 用户说"组个团队聊一下"、"开会讨论这个想法"、"找几个角度看看"、"群聊一下 X"、"team…
端到端产品教练 — 把一句话想法走到 PRD + 可点击 HTML 原型。会顶嘴、强制砍功能、用 Nielsen + Norman 做友好性硬检。Use when user 说"我有一个想法"、"想做一个产品"、"做 MVP"、"写 PRD"、"做用户友好的产品",或调用插件命令…
Mobile app UI design expert for iOS and Android. Use when designing app interfaces, creating design systems, ensuring accessibility, or following platform…