微信小程序页面迁移校验之前 P5任务处理之前
This commit is contained in:
16
.kiro/hooks/cwd-guard-shell.kiro.hook
Normal file
16
.kiro/hooks/cwd-guard-shell.kiro.hook
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"enabled": true,
|
||||
"name": "CWD Guard for Shell",
|
||||
"description": "在 AI 执行 shell 命令前,检查是否在运行 Python 脚本。如果是,提醒 AI 确认 cwd 是否正确(仓库根 C:\\NeoZQYY),避免相对路径解析到错误位置。",
|
||||
"version": "1",
|
||||
"when": {
|
||||
"type": "preToolUse",
|
||||
"toolTypes": [
|
||||
"shell"
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"type": "askAgent",
|
||||
"prompt": "如果即将执行的命令包含 `python` 且涉及 scripts/ops/、.kiro/scripts/、apps/etl/connectors/feiqiu/scripts/ 下的脚本,请确认:1) cwd 参数是否设置为仓库根目录 C:\\NeoZQYY;2) 脚本是否已有 ensure_repo_root() 校验。如果 cwd 不对且脚本无校验,请修正 cwd 后再执行。对于非 Python 命令或不涉及上述目录的命令,直接放行。"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user