← ClaudeAtlas

emitter-buildlisted

从已验证 pytest、Case IR 和 profile 中识别可沉淀模式,评估是否晋升为 assertion_rules、case_flows、fixture helper 或 emitter 规则
tlzmw001/aitest-kit · ★ 12 · Testing & QA · score 80
Install: claude install-skill tlzmw001/aitest-kit
# Emitter 模板构建 `emitter-build` 的职责是把**已经跑通的 AI/人工补写经验**沉淀为确定性模式,减少后续重复写 `case_bodies`、重复 raw assert 或重复 fixture 逻辑。 它不是探索入口,也不是失败修复入口。不要从未验证的 pytest、失败用例、缺环境变量的运行结果,或猜测出的业务语义中提取规则。 默认先分析并输出建议;只有用户明确确认后,才修改 profile、fixture/helper、`aitest.yaml` 或 emitter 代码。`--suggest-promotion-patch` 生成的是 review-only 草案,不自动应用。 ## 参考文档 - `refs/patterns.md` — 断言模式表、晋升分类与条件、case_bodies/case_flow 提取规则、IR 对齐项、CLI 命令参考、分类产出规则 - `aitest_config/refs/config-files.md` — 判断配置字段归属时优先读取 ## 前提条件 必须先确认当前分析对象满足以下条件: 1. `codegen --check` 或对应 selector 的 `--check` 已通过。 2. generated pytest 至少通过 collect。 3. 从真实断言结果沉淀业务规则时,必须有对应真实 run 通过记录。 4. manual / skipped 用例不能作为业务断言模板来源。 5. 缺环境变量、fixture 错误、服务未启动等结果,不得作为可沉淀模式。 未满足前提时,先返回 test-codegen / test-scaffold / test-fix / test-maintain 处理断裂层。 ## 前置:读取输入 ### suite 入口 如果用户给出 `--suite-file <suite.yaml>`: 1. 读取 `suite.yaml` 的 `target/module/suite/case_files`,并合成 effective knowledge refs:`target.yaml.l0` + `module.yaml.l1` + `suite.yaml.l2` 2. 按约定路径读取 module profile 和 suite profile 3. 读取 `case_files` 中声明的 Markdown case 4. 读取对应 generated 文件:`test_workspace/generated/{target}/test_{module}_{suite}_{case_file_stem}.py` 5. 运行或读取 `--dump-ir` / `--explain` 输出,确认每条 case 的 `strategy`、`fixtures`、`assertion resolution` ### module / target 入口 如果用户给出 `--target <target> [--module <module>]`: 1. 从 target/module registry 发现 active registered suites 2. 对每个 suite 按 suite 入口逐一分析 3. 3+ suites 时委托子 Agent 逐 suite 分析,主 Agent 聚合跨 suite 模式 ## Step 1:Case IR 对齐与分流 以 `CaseIR.strateg