test-fix
修正测试用例错误,记录陷阱到 TEST_SPEC,并判断是否为 skill 级系统性问题——若是则定位并更新对应 skill
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
修正测试用例错误,记录陷阱到 TEST_SPEC,并判断是否为 skill 级系统性问题——若是则定位并更新对应 skill
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
从 target-aware case suite、task manifest 或 target/module/all selector 生成 pytest,执行 profile gate、Case IR、freshness check,并处理少量 UNPARSED 补写
构建模块级 fixture/module profile 或用例级 suite profile,把 Markdown 用例接入 test-codegen 管线
从已验证 pytest、Case IR 和 profile 中识别可沉淀模式,评估是否晋升为 assertion_rules、case_flows、fixture helper 或 emitter 规则
基于测试知识库和测试规范,为指定模块或需求 suite 生成 Markdown 用例和 mismatch 记录
测试资产维护分诊台:诊断项目当前状态,定位管线断裂层,路由到正确的 skill 或 CLI 命令
将外部/历史/公司测试平台用例迁移为 AITest Markdown suite 用例,并保留语义追溯、阻塞分类和人工 review 清单
| name | test-fix |
| description | 修正测试用例错误,记录陷阱到 TEST_SPEC,并判断是否为 skill 级系统性问题——若是则定位并更新对应 skill |
| when_to_use | 当用户发现测试用例有错误(评审发现或执行失败),需要修正用例并记录经验时 |
| argument-hint | <case_id> <error_description> [suite_file] |
| arguments | ["case_id","error_description","suite_file"] |
| user-invocable | true |
| allowed-tools | Read Glob Grep Write Edit |
| effort | high |
修正用例 $case_id,错误描述:$error_description。如果提供 $suite_file,优先只在该 suite 中定位;如果未提供且同一 case_id 匹配多处,停止并要求用户指定 suite。
读 aitest_config/aitest.yaml,获取 workspace.paths.*、target/module registry 和 codegen 配置。
$case_id 中提取模块缩写(如 TC-ROUTE-013 → ROUTE){paths.test_spec} 的模块缩写对照表,确定模块名$suite_file 指定的 suite 及其 case_filessuite.yaml 声明的 case_filestest_workspace/suites/ 中绑定该 module 的 suite$case_id 匹配多个 suite,停止并要求用户指定 $suite_file在 {paths.test_spec} 的"已知陷阱"章节追加一条记录:
### 陷阱-{序号}:{一句话描述错误模式}
- **错误写法**:原来怎么写的(具体到可对照)
- **正确做法**:应该怎么写
- **原因**:为什么原来的写法是错的
- **适用范围**:哪类用例需要注意这个问题
陷阱序号从已有最大序号 +1 开始。
修完用例后,判断这个错误是用例本身的问题还是skill 指令导致的系统性问题:
用例本身的问题(到此为止,不需要额外动作):
Skill 级系统性问题(需要更新 skill):
定位并更新对应 skill:
{paths.refs_dir}/ 下对应文件向用户输出:
## 用例修正摘要
修正用例:$case_id
错误类型:(预期结果错误 / 前置条件不可行 / ...)
修正内容:(改了什么)
新增陷阱:陷阱-{序号}(一句话描述)
Skill 更新:(无 / 更新了 {skill名} — 具体改动描述)
Refs 更新:(无 / 更新了 {refs文件名} — 具体改动描述)