Files
2025-11-30 08:47:07 +08:00

23 lines
1.2 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"hooks": [
{
"event": "PostToolUse",
"matcher": {
"tool_name": "Bash",
"pattern": "make test.*TARGET=frontend|make test TARGET=frontend"
},
"config": {
"type": "prompt",
"prompt": "检查 Bash 工具执行结果。如果测试失败exit code 非 0 或输出包含 FAIL/ERROR建议用户使用 `/swiss-army-knife-plugin:fix` 命令进行标准化 bugfix 流程。\n\n输出格式\n- 如果测试通过:不输出任何内容\n- 如果测试失败:输出 '💡 检测到前端测试失败,建议使用 `/swiss-army-knife-plugin:fix` 启动标准化 bugfix 流程'"
}
},
{
"event": "SessionStart",
"config": {
"type": "prompt",
"prompt": "检查当前工作目录是否有前端相关的变更文件(使用 git diff --name-only HEAD~1。\n\n如果检测到以下类型的变更\n- `**/*.test.{ts,tsx}` - 测试文件\n- `**/components/**/*.tsx` - 组件文件\n- `**/hooks/**/*.ts` - Hook 文件\n\n则输出简短提示'📝 检测到前端代码变更,如需修复测试问题可使用 `/swiss-army-knife-plugin:fix`'\n\n如果没有相关变更不输出任何内容。"
}
}
]
}