# Prd Auto Test Loop

> PRD 驱动的自动化测试编排技能。用于把每版 PRD 的测试计划、AI 自测与自修复、测试报告标准化落地；适用于按验收标准拆分 Unit/Integration/E2E、划分自动化与人工边界、生成版本化 TEST_PLAN/TEST_REPORT 的场景。

- **Type:** Skill
- **Install:** `agentstack add skill-yunshu0909-yunshu-skillshub-prd-auto-test-loop`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [yunshu0909](https://agentstack.voostack.com/s/yunshu0909)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [yunshu0909](https://github.com/yunshu0909)
- **Source:** https://github.com/yunshu0909/yunshu_skillshub/tree/master/prd-auto-test-loop

## Install

```sh
agentstack add skill-yunshu0909-yunshu-skillshub-prd-auto-test-loop
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# PRD 自动化测试闭环

## 概览

使用此技能将发布测试固定为：`主回归基线 + PRD 增量测试`。

跨版本维护一套共享主回归测试。
每个 PRD 版本仅增加新增或变更相关用例。
将产物输出到 `自动化测试//`。

## 工作流

1. 从 PRD 锁定范围。
- 提取版本目标、测试范围、非范围、验收标准。
- 若本次是增量变更，拒绝“整套重写测试”。

2. 定义测试分层与边界。
- 将验收标准映射为 `Unit / Integration / E2E`。
- 读取 `references/自动化测试封装指南.md` 的边界章节，标记 `A/H/A+H`。

3. 初始化版本测试目录。
- 读取 `references/自动化测试封装指南.md` 的初始化命令与模板。
- 创建 `自动化测试//`，并生成 `TEST_PLAN.md`、`TEST_REPORT.md`。

4. 实现增量测试。
- 优先复用既有主回归用例。
- 仅新增 PRD 差异用例到 `tests/`。
- 保持断言确定性，避免脆弱 UI 选择器。

5. 执行 AI 自测闭环。
- 固定顺序：`Unit -> Integration -> E2E`。
- 失败时按根因修复并重跑（最多 3 轮）。
- 若被环境阻塞，明确记录阻塞项并停止宣称通过。

6. 产出测试报告。
- 按模板填写命令、通过率、失败项、剩余风险。
- 输出发布门禁结论：`PASS` 或 `FAIL`。

## 规则

- 不要每个 PRD 都从零重建整套测试。
- 必须同时维护“主回归套件 + 版本增量套件”。
- 每个版本必须绑定自己的 `TEST_PLAN` 与 `TEST_REPORT`。
- 必须给出可复现命令和结果摘要，禁止模糊结论。
- 不要声称覆盖全部质量风险，必须列出人工补测项。

## 自动化边界矩阵

### 适合自动化（建议 AI 覆盖）
- 功能正确性（状态流转、接口处理、校验规则）
- 回归路径（历史缺陷防回归）
- 确定性边界场景（空值、非法值、重复操作）
- 稳定冒烟流程（启动、关键导航、保存/提交）
- 可量化非功能指标（超时、错误率、崩溃率）

### 优先人工验证（建议人工兜底）
- 可用性与交互顺滑度
- 视觉质感与品牌一致性
- 业务策略合理性
- 开放式探索路径
- 产品取舍与发布优先级判断

### 验收标准标记法
- `A`：可完全自动化
- `H`：仅人工验证
- `A+H`：自动化 + 人工联合验证

## TEST_PLAN 模板

```md
# TEST_PLAN（）

## 1. 测试范围
- PRD：
- 范围内：
- 非范围：

## 2. 完成门槛
1. 计划内用例：/ 通过
2. P0 用例通过率：100%
3. 连续两轮稳定通过
4. 无阻断/严重缺陷遗留

## 3. 用例清单
### Unit
- UT-xx：

### Integration
- IT-xx：

### E2E
- E2E-xx：

## 4. 执行顺序
1. Unit
2. Integration
3. E2E
4. 自动修复循环（最多 3 轮）

## 5. 输出产物
- TEST_REPORT.md
- 命令执行结果摘要
```

## TEST_REPORT 模板

```md
# TEST_REPORT（）

## 1. 结果摘要
- 日期：
- PRD：
- 结论：PASS | FAIL

## 2. 执行命令与结果
- 
  - result:

## 3. 分层覆盖结果
- Unit：passed/total
- Integration：passed/total
- E2E：passed/total

## 4. 失败用例
- 用例 ID：
- 现象：
- 根因：
- 修复状态：

## 5. 剩余风险（人工补测）
- 风险点：
- 自动化无法完全覆盖原因：

## 6. 发布门禁
- 门禁检查状态：
- 最终决策：
```

## 版本目录初始化命令

在项目根目录执行：

```bash
version="V0.6"
base_dir="自动化测试/$version"
mkdir -p "$base_dir/tests/unit" "$base_dir/tests/integration" "$base_dir/tests/e2e"

cat > "$base_dir/TEST_PLAN.md"  "$base_dir/TEST_REPORT.md" <<'RPT'
# TEST_REPORT（V0.6）

## 1. 结果摘要
- 日期：
- 结论：
RPT
```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [yunshu0909](https://github.com/yunshu0909)
- **Source:** [yunshu0909/yunshu_skillshub](https://github.com/yunshu0909/yunshu_skillshub)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-yunshu0909-yunshu-skillshub-prd-auto-test-loop
- Seller: https://agentstack.voostack.com/s/yunshu0909
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
