一键导入
post-test-cleanup
测试完成后的扫尾清理流程。在向某个工作区发送测试指令(如长篇文章生成、耗时任务)后,用此流程彻底清除测试痕迹,防止测试消息残留在会话上下文中持续消耗 token 额度。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
测试完成后的扫尾清理流程。在向某个工作区发送测试指令(如长篇文章生成、耗时任务)后,用此流程彻底清除测试痕迹,防止测试消息残留在会话上下文中持续消耗 token 额度。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use this skill whenever the user asks to upgrade, bump, pin, refresh, or verify the built-in Codex CLI version in this HappyPaw repository, including requests about pinned Codex releases, app-server protocol regeneration, Codex schema sync, container image refresh, or compatibility checks after a Codex upgrade. Trigger even if the user only says things like "upgrade Codex", "bump the internal codex version", "refresh the bundled codex", or "sync to the latest Codex release", because this repo has a specific pinned-Codex workflow that must be followed carefully.
Use this skill whenever the user asks to simplify, refactor, clean up, reduce complexity, remove duplication, untangle logic, split large modules, clarify naming, improve maintainability, or make code easier for future coding agents to understand and change. Also trigger proactively when a coding task reveals incidental complexity that is blocking safe progress, even if the user did not explicitly ask for refactoring. This skill is for behavior-preserving or behavior-clarifying simplification in the current repository, but it should not treat the existing design as the ideal target: step back, evaluate what the best design for a coding agent would be, and then move the code toward that design with small, verifiable changes.
| name | post-test-cleanup |
| description | 测试完成后的扫尾清理流程。在向某个工作区发送测试指令(如长篇文章生成、耗时任务)后,用此流程彻底清除测试痕迹,防止测试消息残留在会话上下文中持续消耗 token 额度。 |
# 查看当前运行的容器
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.RunningFor}}"
# 确认目标容器的 folder(容器名格式:happypaw-{folder}-{timestamp})
ls data/ipc/
# 发送中断信号(优雅停止)
touch data/ipc/{folder}/input/_interrupt
sleep 5
# 若容器仍在运行,发送关闭信号
touch data/ipc/{folder}/input/_close
sleep 10
# 确认容器已停止
docker ps --format "{{.Names}}" | grep {folder关键字}
python3 -c "
import sqlite3
conn = sqlite3.connect('data/db/messages.db')
cur = conn.cursor()
# 先找到 folder 对应的 JID
cur.execute(\"SELECT jid, folder, name FROM registered_groups WHERE folder = '{folder}'\")
print('Group:', cur.fetchall())
# 查看最近消息,定位测试消息范围
cur.execute(\"\"\"
SELECT id, content, is_from_me, timestamp
FROM messages
WHERE chat_jid = '{jid}'
ORDER BY timestamp DESC LIMIT 20
\"\"\")
for r in cur.fetchall():
print(f'id={r[0]} from_me={r[2]} | {str(r[1])[:80]}')
conn.close()
"
python3 -c "
import sqlite3
conn = sqlite3.connect('data/db/messages.db')
cur = conn.cursor()
# 将需要删除的消息 ID 填入列表
test_ids = [
'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
# ...
]
placeholders = ','.join(['?' for _ in test_ids])
cur.execute(f'DELETE FROM messages WHERE id IN ({placeholders})', test_ids)
print(f'Deleted {cur.rowcount} messages')
conn.commit()
conn.close()
"
python3 -c "
import sqlite3, uuid
conn = sqlite3.connect('data/db/messages.db')
cur = conn.cursor()
# 生成新 session ID,下次启动时以空上下文开始
new_id = str(uuid.uuid4())
cur.execute(\"UPDATE sessions SET session_id = ? WHERE group_folder = '{folder}'\", (new_id,))
print(f'Session reset: {cur.rowcount} rows, new ID: {new_id}')
conn.commit()
conn.close()
"
git status
git diff --stat
# 应显示 "nothing to commit, working tree clean"
happypaw-{folder}-{timestamp},可通过 ls data/ipc/ 查看所有 folderis_from_me 和内容确认,避免误删正常业务消息data/ 下,不纳入版本控制docker ps)git status 显示工作区干净