ok
This commit is contained in:
26
rules/agent-completion-gate.mdc
Normal file
26
rules/agent-completion-gate.mdc
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
description: Agent 完成前门禁:校验脚本 + Hooks 兜底
|
||||
alwaysApply: true
|
||||
---
|
||||
|
||||
# Agent 完成前门禁
|
||||
|
||||
## 禁止
|
||||
|
||||
- 未跑校验脚本前,不得写「已完成」「可以合并」「验收通过」等收尾表述。
|
||||
|
||||
## 必须
|
||||
|
||||
1. 任务收尾前执行:`~/.cursor/hooks/verify-slot-backend.sh`
|
||||
2. 在最终回复粘贴完整输出(以 `=== verify-slot-backend ===` 开头)。
|
||||
3. 修改 PHP 后,最终回复含 `PHPDoc: checked`(见 `php-code` 规则 PHPDoc 章节)。
|
||||
4. 改动 `app/**/*.php` 须遵守 `php-code` 用例写法章节(BusinessException、按层写法)。
|
||||
|
||||
## Hooks(用户级 `~/.cursor/hooks.json`)
|
||||
|
||||
- **宿主机 `php` / `composer`**:被 `block-host-php.sh` 拦截;须 `docker exec ... php`。
|
||||
- **Agent 结束 `stop`**:自动跑 `verify-slot-backend.sh`;`FAIL` 时注入 `followup_message` 要求继续修复。
|
||||
|
||||
## 扫描范围
|
||||
|
||||
**仅** `git diff` / `git diff --cached` 里、且磁盘上仍存在的改动文件;干净仓库跳过。不做全仓库 grep。无改动 → `PASS (no changed files)`。
|
||||
Reference in New Issue
Block a user