unity-smoke-assertions
Skill0 starsChanged 23 days agoMITView on GitHub
维护 Unity 项目的自动化冒烟断言基线时使用:怎么加一条可回归的断言、怎么判定全绿、改动后如何做归因与最小复现
In this repository12 other files it gives its agents.
- ai-output-verifySkill
- asset-import-pipelineSkill
- bug-diagnosis-chainSkill
- codex-rules-verifySkill
- config-table-pipelineSkill
- gameplay-breakdownSkill
- handoff-docSkill
- spec-card-authoringSkill
- unity-build-matrixSkill
- unity-commandline-playtestSkill
- unity-editor-verifySkill
- visual-evidence-reviewSkill
The file
Files
自动化冒烟断言基线
何时触发
- 修完 bug 或加完功能,需要证明没把别的东西改坏
- 要为新规则补一条断言,让它以后自动兜底
- 报告出现 FAILED,需要定位是哪条规则、哪个模块
一条好断言的标准
| 要求 | 反例 | 正例 |
| 可观察 | 「功能正常」 | 「掷骰后骰点落在 1~6,且动画结束回调只触发一次」 |
| 单一职责 | 一条断言查整局流程 | 一条断言只查一个规则点 |
| 可复现 | 依赖手动摆放场景 | 入口里自建最小场景,跑完即销毁 |
| 带失败信息 | 只断言布尔值 | 失败时打印期望值 / 实际值 / 触发条件 |
步骤
- 先写触发条件:什么操作会走到这条规则(点击 / 自动回合 / 结算),把它写成固定入口。
- 再写期望:期望是数值还是状态?数值给容差(浮点别用等号)。
- 跑基线:新增断言前后各跑一次,确认「新增前全绿、新增后全绿」,避免新增用例本身写错。
- 改动后回归:任何数值/规则改动都要跑全量,不要只跑受影响的那条。
- 失败归因:①断言写错 ②实现改坏了 ③接口约定变了。先看失败信息,再看最近的 diff,最后才怀疑环境。
- 最小复现:把失败场景缩到「一次操作触发」,再贴进问题清单。
验收
- 报告尾部 FAILED count: 0
- 新增用例能在报告里看到名字,失败时能打印定位信息
- 回归跑的是全量,不是子集
- 失败项已归类(断言错 / 实现坏 / 契约变)
坑
- 断言里带随机数而不固定种子——同一条用例时好时坏。
- 用固定等待替代事件回调,机器一卡就假失败。
- 只跑一半就宣布全绿:报告必须看尾部统计行。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

