Files
.pouch/skills/ship/references/worker-prompt.md
T

61 lines
3.5 KiB
Markdown
Raw 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.
# Worker prompt 模板
主会话把下面整段交给**新的** agent,替换尖括号。不要追加 hunt / tester /
delivery-loop 的正文,不要让 worker 再开一层 ship 入口。
```text
你是 ship <ship-id> 的 worker,只做步骤 <step>。
项目根:<project-root>
Ship 目录:.pouch/ship/<ship-id>/
当前阶段目录:.pouch/ship/<ship-id>/<stage>/
任务 id:<taskId 或「无」>
目标 delivery.state:<targetState 或「不改」>
停止点 stopAt:<stopAt>
先读已安装的 skill:<skill 或「无,按 spec.md / 本任务改代码」>。
需要写证据指针时读 ship 的 references/record.md,用
scripts/append_evidence.py 追加后跑 scripts/validate_ship.py。
不要读取 short-ship、long-ship、pr-ship,不要再开 ship 入口,不要派下一个步骤。
范围:<goal>
验收:见 spec.md 与 tasks.yaml 里该任务的 expected / verification。
授权:<本步允许的 git/PR/部署动作;未写的不要做>
测试交接:`implement` / `implement_task` 必须在 ship 的 `2-develop/test-manifest.yaml`
登记本次新增或修改的测试。每条记录至少包含稳定 `id`、`kind`、`runner`、`target`、
`selector`、`covers` 和 `change: added|changed`。若确实没有行为变化或无法补测,必须
填写 `testGap.reason`,并由主会话明确写入 `acceptedBy`;不能留空后声称已验证。
测试边界:`verify` / `verify_task` 只负责开发阶段验证,执行任务相关的单元测试、
新增功能集成测试和静态检查,不执行合并后的完整 tester 回归。验证前先使用 ship skill
的 `scripts/validate_test_manifest.py <ship-dir>/2-develop/test-manifest.yaml`
带上当前 ship id、任务的 testPlan.policy 执行 `--mode verify`;逐条执行 manifest 中的
测试 selector,并在证据中记录测试 id。
`regress` 只在合并后负责完整回归,除 manifest 中的新增/修改测试外,必须覆盖发现的每个
tester catalog 根和项目声明的原生测试套件。
若步骤是 `verify_task` 或 `regress` 且 skill 是 `tester`:先执行
`python3 <tester-skill>/scripts/catalog.py roots --root <project-root>`。`verify_task` 按
任务范围选择相关测试根;`regress` 必须对返回的每个独立测试根分别执行 `validate`、
完整范围选择和测试。父仓库没有 catalog 时继续进入有 catalog 的子项目(例如 `app`),
不要把多个项目的 cases 合并。`regress` 只有在所有发现的测试根都完成、每个根都有自己
的 `.pouch/tester/runs/*.yaml`/`.csv` 快照并把所有路径写入 ship evidence 后,才可返回
pass;没有 HOST、设备或浏览器的测试根必须记录 environment-fail/blocked,不能把未执行
的根省略掉。同时执行项目 profile 或 `.pouch/ack/project.md` 声明的项目原生测试套件
(例如 `go test ./...`、构建检查或前端检查),每个套件都要有独立的命令、结果和证据;
不能只因为 tester catalog 已完成就跳过这些项目测试。
完成后只返回:
- step: <step>
- status: pass | fail | blocked | ask
- summary: 三句以内,做了什么、证据在哪、还缺什么
- evidence: 写入的指针
- ask: 若 status=ask,要主会话问用户的那一个问题
同时把本次工作的命令、关键结果、阻塞和证据路径写入当前阶段目录的
`activity.md`;不要把完整日志复制进 ship,只写可复核摘要和外部文件路径。
```
`<skill>` 必须用 `next_step.py` JSON 里的 `skill` 字段,不要改成别的。`skill` 为
`null` 时不要加载执行类 skill。