用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Dong90/oh-my-taiyiforge --skill taiyi-test命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | taiyi-test |
| description | TaiyiForge 第7阶段 — 测试验证,TEST.md。四端通用。 |
| paradigm | Operator |
进入本阶段前请优先读
.taiyi/changes/<slug>/PHASE-CONTEXT.md(~500 tokens),不要全量加载上游工件。
本阶段使用以下框架:
| 框架 | 用途 | 何时加载 |
|---|---|---|
| Harness | 阶段门禁与推进(status → continue;legacy:npx taiyi complete) | 全程 |
| GStack | browse — 用于 E2E 浏览器测试和截图验证 | Round 5(E2E 轮) |
| Superpowers | verification-before-completion — 完成前全量验证 | 完成前 |
OpenSpec / Spec-Kit / OMO 在本阶段不涉及。
.taiyi/changes/<slug>/.dev-complete 存在且 exitCode: 0)| Profile | TEST.md 要求 |
|---|---|
full | 完整覆盖:5 rounds + 6 维回归测试 + 新 file GREP 填空 + Traceability |
api/ui | 同 full |
lite | 简化版:跳过 round 4-5,6 维回归可选 |
spike/micro | 跳过本阶段 |
nano | 跳过 |
| 层 | 路径 | 职责 |
|---|---|---|
| 语义真源 | test.json | Zod(src/schemas/test.ts) |
| 生成视图 | TEST.md | hbs(src/templates/test.hbs) |
| 流程 | 本 Skill | 5 轮 AC 覆盖、6 维回归、Traceability |
工作流:实跑测试 → 更新 json 证据 → scripts/taiyi-forge.sh render <slug> test → status → continue。
详见 docs/taiyi/artifact-contract.md。
| 字段 | 要求 |
|---|---|
title | 测试计划标题 |
test_plan | ≥1 用例;id / description / status(passed/failed/pending) |
unit_framework / unit_coverage_target | 可选 |
edge_cases / performance_tests / security_checks | 可选 |
regression_plan / regression_items | 可选;6 维回归仪表盘内容 |
mocking_boundaries | 可选;哪些层可 mock |
summary / coverage | 可选;执行摘要 |
evidence | 有 passed 时推荐填真跑命令 |
# TEST: <slug 标题>
## Overview
| AC | Round | Type | Status |
|----|-------|------|--------|
每轮一个 table,AC 编号来自 REQUIREMENT.md:
### Round 1: 功能正确性(AC 正向)
| AC | PR | Test | Priority | Key Assertions |
|----|----|------|----------|----------------|
### Round 2: 边界条件(AC 负面 + 边值)
| AC | PR | Test | Priority | 边界值 |
|----|----|------|----------|--------|
### Round 3: 错误处理(AC 异常路径)
| AC | PR | Test | Priority | Error Handling |
|----|----|------|----------|---------------|
### Round 4: 集成(跨组件)
| AC | PR | Test | Priority | Endpoint / Interaction |
|----|----|------|----------|-----------------------|
### Round 5: 端到端(关键路径 / 用户流程)
| AC | PR | Test | Priority | Flow |
|----|----|------|----------|------|
每个维度用 3 态表示:✅ 通过 / ❌ 未通过 / ⬜ 不适用
### Regression Dashboard (pre-landing)
| Dimension | Status | Notes |
|-----------|--------|-------|
| D1 完整功能 | ✅ | 21/21 AC passed |
| D2 边界值 | ✅ | null/empty/long/edge |
| D3 性能 | ⬜ | 无性能要求 |
| D4 并发 | ✅ | 新建不冲突 |
| D5 安全 | ⬜ | 无认证逻辑 |
| D6 回滚 | ✅ | 向下兼容 |
项目中没有测试文件的新文件 → agent 自动 // src/*.ts → 创建一个 skeleton test file:
// tests/__snapshots__/placeholder.md
## GREP 发现的未覆盖文件
### <file path>
- 行号:<range>
- 状态:❌ 未覆盖
- 建议:增加 <N> 个用例覆盖 <功能>
所有测试命令必须进入 TEST.md:
## 测试执行命令
# 全部测试
$ npm test
# 单元测试
$ npx vitest run tests/unit/
# 集成测试
$ npx vitest run tests/integration/
# 特定测试
$ npx vitest run tests/unit/validation.test.ts
# 覆盖率(可选)
$ npm run test:coverage
## Traceability (←REQUIREMENT.md)
### AC → Test Coverage
| AC | 覆盖 Round | 测试文件 |
|----|-----------|---------|
| AC-1.1 | R1, R2 | tests/unit/validation.test.ts |
| AC-2.1 | R1, R3, R4 | tests/integration/translate.test.ts |
## 质量自检;有未通过项则不要过关。scripts/taiyi-forge.sh status <slug> --json --compact — 解析 engineTruth(qualityReady / blockers)。scripts/taiyi-forge.sh continue <slug>。status --json --compact,读 engineTruth;若 currentPhase 已变为 review,切换到 taiyi-review Skill 并通知用户。Legacy:npx taiyi complete <slug> test 仍可用;聊天优先 /taiyi:continue。
.taiyi/changes/<slug>/TEST.md.taiyi/changes/<slug>/test.json| 下游 | 需要 |
|---|---|
taiyi-review | Regression Dashboard → review 质量入口;测试通过证据 → review 的 QA 评估;Traceability → 审查收尾证据 |
taiyi-integration | 测试通过 → 归档前提;Traceability → 集成过程中 AC 的 Final Status |
| 场景 | 处理 |
|---|---|
| 测试未全部通过 | 读失败测试输出 → 归类测试 bug vs 实现 bug。实现 bug → DIAGNOSE FIX(最小修复)→ 重跑。测试 bug → 修复测试。最多 3 轮,超限上报用户 |
| AC 未完全覆盖 | 补充第 2/3 轮测试覆盖缺失 AC,直到所有 AC 至少有一条测试 |
| 项目无测试框架 | 在 TEST.md 中说明,跳过运行但保留 Round table 作为覆盖文档 |
| 回归仪表盘有 ❌ | 不能过关 test 阶段,必须全 ✅ 或 ⬜ 才可通过 |
continue 被拒 | 检查 Traceability 是否完整、是否有 ❌ 回归。修复后 status 再 continue |
| 误过关本阶段或后续 | scripts/taiyi-forge.sh undo <slug> test |
<fatal_constraints>
基于 SOC 职业分类