regression-suite
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRegression Suite
回归测试套件
This skill ensures that every bug fix is backed by a test that would have
caught the original bug — and that the regression suite stays current as the
game evolves. It also detects when new features have been added without
corresponding regression coverage.
A regression suite is not a new test category — it is a curated list of
tests already in that collectively cover the game's critical paths
and known failure points. This skill maintains that list.
tests/Output:
tests/regression-suite.mdWhen to run:
- After fixing a bug (confirm a regression test was written or identify gap)
- Before a release gate (requires regression suite exists)
/gate-check polish - As part of sprint close to detect coverage drift
本Skill确保每个Bug修复都配有能发现原始Bug的测试,并且随着游戏迭代,回归测试套件始终保持最新状态。它还能检测新增功能未添加对应回归测试的情况。
回归测试套件并非新的测试类别——它是tests/目录中已存在测试的精选列表,共同覆盖游戏的关键路径和已知故障点。本Skill负责维护该列表。
输出:
tests/regression-suite.md运行时机:
- 修复Bug后(确认已编写回归测试或识别测试缺口)
- 发布准入前(要求回归测试套件已存在)
/gate-check polish - 冲刺收尾时运行,以检测覆盖率漂移
1. Parse Arguments
1. 解析参数
Modes:
- — scan new bug fixes this sprint and check for regression test presence; add new tests to the suite manifest
/regression-suite update - — full audit of all GDD critical paths vs. existing test coverage; flag paths with no regression test
/regression-suite audit - — read-only status report (no writes); suitable for sprint reviews
/regression-suite report - No argument — if a sprint is clearly active (sprint plan exists with in-progress stories), run . If ambiguous or no active sprint is detected, use
update:AskUserQuestion- Prompt: "No subcommand specified. Which mode do you want to run?"
- Options:
[A] update — scan new bug fixes this sprint and add missing regression tests[B] audit — full audit of all GDD critical paths vs. existing test coverage[C] report — read-only status report (no writes)
模式:
- —— 扫描当前冲刺阶段的新Bug修复,检查是否存在回归测试;将新测试添加到套件清单中
/regression-suite update - —— 全面审核所有GDD关键路径与现有测试覆盖率的匹配情况;标记无回归测试的路径
/regression-suite audit - —— 只读状态报告(不写入);适用于冲刺评审
/regression-suite report - 无参数 —— 如果明确存在活跃冲刺(包含进行中需求的冲刺计划已存在),则运行。若情况模糊或未检测到活跃冲刺,调用
update:AskUserQuestion- 提示:"未指定子命令。您想要运行哪种模式?"
- 选项:
[A] update —— 扫描当前冲刺的新Bug修复并添加缺失的回归测试[B] audit —— 全面审核所有GDD关键路径与现有测试覆盖率[C] report —— 只读状态报告(不写入)
2. Load Context
2. 加载上下文
Step 2a — Load existing regression suite
步骤2a —— 加载现有回归测试套件
Read if it exists. Extract:
tests/regression-suite.md- Total registered regression tests
- Last updated date
- Any tests flagged as or
STALEQUARANTINED
If it does not exist: note "No regression suite found — will create one."
读取已存在的文件。提取:
tests/regression-suite.md- 已注册的回归测试总数
- 最后更新日期
- 任何标记为(过时)或
STALE(隔离)的测试QUARANTINED
若文件不存在:记录"未找到回归测试套件——将创建一个新套件。"
Step 2b — Load test inventory
步骤2b —— 加载测试清单
Glob all test files:
tests/unit/**/*_test.*
tests/integration/**/*_test.*
tests/regression/**/*For each file, note the system (from directory path) and file name.
Do not read test file contents unless needed for name-to-test mapping.
遍历所有测试文件:
tests/unit/**/*_test.*
tests/integration/**/*_test.*
tests/regression/**/*针对每个文件,记录其所属系统(从目录路径获取)和文件名。除非需要进行名称与测试的映射,否则无需读取测试文件内容。
Step 2c — Load GDD critical paths
步骤2c —— 加载GDD关键路径
For mode: read to get all systems.
For each MVP-tier system, read its GDD and extract:
auditdesign/gdd/systems-index.md- Acceptance Criteria (these define the critical paths)
- Formulas section (formulas must have regression tests)
- Edge Cases section (known edge cases should have regression tests)
For mode: skip full GDD scan. Instead read the current sprint plan
and story files to find stories with Status: Complete this sprint.
update对于模式:读取以获取所有系统。针对每个MVP级系统,读取其GDD并提取:
auditdesign/gdd/systems-index.md- 验收标准(这些定义了关键路径)
- 公式章节(公式必须配有回归测试)
- 边缘案例章节(已知边缘案例应配有回归测试)
对于模式:跳过完整的GDD扫描。改为读取当前冲刺计划和需求文件,查找状态为"Complete(已完成)"的需求。
updateStep 2d — Load closed bugs
步骤2d —— 加载已关闭的Bug
Glob and filter for bugs with a
or field. Note:
production/qa/bugs/*.mdStatus: ClosedStatus: Fixed- Which story or system the bug was in
- Whether a regression test was mentioned in the fix description
遍历文件,筛选带有(状态:已关闭)或(状态:已修复)字段的Bug。记录:
production/qa/bugs/*.mdStatus: ClosedStatus: Fixed- Bug所属的需求或系统
- 修复描述中是否提及回归测试
3. Map Coverage — Critical Paths
3. 覆盖率映射——关键路径
For mode only:
auditFor each GDD acceptance criterion, determine whether a test exists:
- Grep and
tests/unit/[system]/for file names and function names related to the criterion's key noun/verbtests/integration/[system]/ - Assign coverage:
| Status | Meaning |
|---|---|
| COVERED | A test file exists that targets this criterion's logic |
| PARTIAL | A test exists but doesn't cover all cases (e.g. happy path only) |
| MISSING | No test found for this critical path |
| EXEMPT | Visual/Feel or UI criterion — not automatable by design |
- Elevate MISSING items that correspond to formulas or state machines to HIGH PRIORITY gap — these are the most likely regression sources.
仅适用于模式:
audit针对每个GDD验收标准,判断是否存在对应的测试:
- 在和
tests/unit/[system]/中,通过文件名和函数名搜索与验收标准核心名词/动词相关的内容tests/integration/[system]/ - 标记覆盖率状态:
| 状态 | 含义 |
|---|---|
| COVERED(已覆盖) | 存在针对该验收标准逻辑的测试文件 |
| PARTIAL(部分覆盖) | 存在测试但未覆盖所有场景(例如仅覆盖正常路径) |
| MISSING(未覆盖) | 未找到针对该关键路径的测试 |
| EXEMPT(豁免) | 视觉/体验或UI类验收标准——设计上无法自动化测试 |
- 将对应公式或状态机的MISSING(未覆盖)项升级为**HIGH PRIORITY(高优先级)**缺口——这些是最可能出现回归的来源。
4. Map Coverage — Fixed Bugs
4. 覆盖率映射——已修复Bug
For each closed bug:
- Extract the system slug from the bug's metadata
- Grep and
tests/unit/[system]/for a test that references the bug ID or the specific failure scenariotests/integration/[system]/ - Assign:
- HAS REGRESSION TEST — a test was found that would catch this bug
- MISSING REGRESSION TEST — bug was fixed but no test guards against recurrence
For MISSING REGRESSION TEST items:
- Flag them as regression gaps
- Suggest the test file path:
tests/unit/[system]/[bug-slug]_regression_test.[ext] - Note: "Without this test, this bug can silently return in a future sprint."
针对每个已关闭的Bug:
- 从Bug元数据中提取系统标识
- 在和
tests/unit/[system]/中,搜索引用该Bug ID或特定故障场景的测试tests/integration/[system]/ - 标记:
- HAS REGRESSION TEST(已有回归测试) —— 找到可发现该Bug的测试
- MISSING REGRESSION TEST(缺失回归测试) —— Bug已修复但无测试防止复发
对于MISSING REGRESSION TEST(缺失回归测试)项:
- 将其标记为回归缺口
- 建议测试文件路径:
tests/unit/[system]/[bug-slug]_regression_test.[ext] - 提示:"若无此测试,该Bug可能在未来冲刺中悄然重现。"
5. Detect Coverage Drift
5. 检测覆盖率漂移
Coverage drift occurs when the game grows but the regression suite doesn't.
Check for drift indicators:
- Stories completed this sprint with no corresponding test files in
tests/ - New systems added to since the last regression-suite update
systems-index.md - GDD sections added or revised since the regression suite was last updated (use Grep on GDD file modification hints if available, or ask the user)
- last-updated date vs. current date — if gap > 2 sprints, flag as likely stale
tests/regression-suite.md
覆盖率漂移指游戏功能扩展但回归测试套件未同步更新的情况。
检查漂移指标:
- 当前冲刺已完成但tests/目录中无对应测试文件的需求
- 自上次回归测试套件更新以来,systems-index.md中新增的系统
- 自上次回归测试套件更新以来,GDD新增或修订的章节(若有GDD文件修改提示则通过Grep查找,否则询问用户)
- 的最后更新日期与当前日期的间隔——若超过2个冲刺周期,标记为可能过时
tests/regression-suite.md
6. Generate Report and Suite Manifest
6. 生成报告与套件清单
Report format (in conversation)
对话中的报告格式
undefinedundefinedRegression Suite Status
回归测试套件状态
Mode: [update | audit | report]
Existing registered tests: [N]
Test files scanned: [N]
模式: [update | audit | report]
已注册测试总数: [N]
扫描的测试文件数: [N]
Critical Path Coverage (audit mode only)
关键路径覆盖率(仅audit模式)
| System | Total ACs | Covered | Partial | Missing | Exempt |
|---|---|---|---|---|---|
| [name] | [N] | [N] | [N] | [N] | [N] |
Coverage rate (non-exempt): [N]%
| 系统 | 验收标准总数 | 已覆盖 | 部分覆盖 | 未覆盖 | 豁免 |
|---|---|---|---|---|---|
| [名称] | [N] | [N] | [N] | [N] | [N] |
覆盖率(非豁免项): [N]%
Bug Regression Coverage
Bug回归覆盖率
| Bug ID | System | Severity | Has Regression Test? |
|---|---|---|---|
| BUG-NNN | [system] | S[N] | YES / NO ⚠ |
Bugs without regression tests: [N]
| Bug ID | 系统 | 严重程度 | 是否有回归测试? |
|---|---|---|---|
| BUG-NNN | [系统] | S[N] | 是 / 否 ⚠ |
无回归测试的Bug数量: [N]
Coverage Drift Indicators
覆盖率漂移指标
[List new systems or stories with no test coverage, or "None detected."]
[列出无测试覆盖的新系统或需求,或显示"未检测到漂移。"]
Recommended New Regression Tests
推荐新增回归测试
| Priority | System | Suggested Test File | Covers |
|---|---|---|---|
| HIGH | [system] | | BUG-NNN / AC-[N] |
| MEDIUM | [system] | | [criterion] |
undefined| 优先级 | 系统 | 建议测试文件 | 覆盖内容 |
|---|---|---|---|
| 高 | [系统] | | BUG-NNN / AC-[N] |
| 中 | [系统] | | [验收标准] |
undefinedSuite manifest format (tests/regression-suite.md
)
tests/regression-suite.md套件清单格式(tests/regression-suite.md
)
tests/regression-suite.mdThe manifest is a curated index — not the tests themselves, but a registry
of which tests should always pass before a release:
markdown
undefined清单是一个精选索引——并非测试文件本身,而是记录发布前必须通过的测试列表:
markdown
undefinedRegression Suite Manifest
回归测试套件清单
Last Updated: [date] Total registered tests: [N] Coverage: [N]% of GDD critical paths
最后更新日期: [日期] 已注册测试总数: [N] 覆盖率: GDD关键路径的[N]%
How to run
运行方式
[Engine-specific command to run all regression tests]
[引擎特定的运行所有回归测试的命令]
Registered Regression Tests
已注册回归测试
[System Name]
[系统名称]
| Test File | Test Function (if known) | Covers | Added |
|---|---|---|---|
| | AC-N / BUG-NNN | [date] |
| 测试文件 | 测试函数(若已知) | 覆盖内容 | 添加日期 |
|---|---|---|---|
| | AC-N / BUG-NNN | [日期] |
Known Gaps
已知缺口
Tests that should exist but don't yet:
| Priority | System | Suggested Path | Covers | Reason Not Yet Written |
|---|---|---|---|---|
| HIGH | [system] | | BUG-NNN | Bug fixed without test |
应存在但尚未编写的测试:
| 优先级 | 系统 | 建议路径 | 覆盖内容 | 未编写原因 |
|---|---|---|---|---|
| 高 | [系统] | | BUG-NNN | Bug已修复但未添加测试 |
Quarantined Tests
隔离测试
Tests that are flaky or disabled (do not run in CI):
| Test File | Function | Reason | Quarantined Since |
|---|---|---|---|
| (none) |
---不稳定或已禁用的测试(CI中不运行):
| 测试文件 | 函数 | 原因 | 隔离起始日期 |
|---|---|---|---|
| (无) |
---7. Write Output
7. 写入输出
Ask: "May I write/update with the current
regression suite manifest?"
tests/regression-suite.mdFor mode: append new entries; never remove existing entries
(use with targeted insertions).
For mode: rewrite the full manifest with updated coverage data.
For mode: do not write anything.
updateEditauditreportAfter writing (if approved):
- For each HIGH priority gap: "Consider creating the missing regression test
before the next sprint. Run to scaffold the test file."
/test-helpers - If bug regression gaps > 0: "These bugs can silently return without regression tests. The next sprint should include a story to write the missing tests."
- If coverage drift detected: "Regression suite may be drifting. Consider
running at the next sprint boundary."
/regression-suite audit
Verdict: COMPLETE — regression suite updated. (If user declined write: Verdict: BLOCKED.)
询问:"是否允许我创建/更新文件,写入当前的回归测试套件清单?"
tests/regression-suite.md对于模式:追加新条目;绝不删除现有条目(使用进行定向插入)。
对于模式:重写完整清单,更新覆盖率数据。
对于模式:不进行任何写入操作。
updateEditauditreport若获得写入许可并完成后:
- 针对每个高优先级缺口:"建议在下一个冲刺前创建缺失的回归测试。运行可快速生成测试文件模板。"
/test-helpers - 若存在Bug回归缺口:"若无回归测试,这些Bug可能悄然重现。下一个冲刺应包含编写缺失测试的需求。"
- 若检测到覆盖率漂移:"回归测试套件可能已出现漂移。建议在下一个冲刺边界运行。"
/regression-suite audit
结论:COMPLETE(完成)——回归测试套件已更新。(若用户拒绝写入:结论:BLOCKED(受阻)。)
Collaborative Protocol
协作协议
- Never remove existing regression tests from the manifest without explicit user approval — removing a test that was deliberately written is a regression risk itself
- Gaps are advisory, not blocking — surface them clearly but do not prevent other work from proceeding (except at release gate where regression suite is required)
- Quarantine is not deletion — tests with intermittent failures should be
quarantined (noted in manifest) but not removed; they should be fixed by
/test-flakiness - Ask before writing — always confirm before creating or updating the manifest
- 绝不擅自删除清单中的现有回归测试——除非获得用户明确许可,删除特意编写的测试本身就存在回归风险
- 缺口仅作为建议,不阻塞流程——清晰展示缺口,但不阻止其他工作推进(除非发布准入要求必须有回归测试套件)
- 隔离不等于删除——存在间歇性故障的测试应被隔离(在清单中标记)而非删除;需通过修复这些测试
/test-flakiness - 写入前需询问——创建或更新清单前始终需确认用户许可