Install
openclaw skills install @extraskittles/code-unit-testopenclaw skills install @extraskittles/code-unit-testUse this skill to review branch changes like a lightweight unit-test designer: read the diff, understand the changed logic, choose representative inputs, mentally execute the code, and report the expected result table. Do not create unit test files unless the user explicitly asks for code generation.
Determine the comparison base.
master if it exists locally or as origin/master.main or origin/main only when master is unavailable.git diff <base>...HEAD.Inspect the changed files and hunks.
git status --short, git branch --show-current, and git diff --stat <base>...HEAD.Decide the service scope before simulating cases.
Identify units and executable paths.
Generate simulated cases.
Mentally execute and verify.
Report in Chinese unless the user requests another language.
Use compact Markdown tables. Include these columns when applicable:
序号变更点/方法模拟输入依赖/前置条件执行路径预期结果结果类型覆盖的新增代码备注For 结果类型, use one of:
计算结果返回 true返回 false抛出异常实体类结果集合/Map 结果状态变更无返回值Prefer fewer high-signal cases over exhaustive tables. A good default is 3-8 cases per changed unit, expanding only when the logic has many branches.
Always include:
Do not claim the table is a replacement for automated unit tests. State clearly that the output is a static/simulated unit-test analysis unless commands were actually run.
If compiling or running tests is useful, follow the Java service validation strategy from the user's instructions: choose the smallest meaningful compile/test command for low-risk single-service changes, and explain why broader validation was or was not run.
用代码单元测试检查当前分支相对 master 的新增代码比较当前分支和 master,给新增逻辑模拟参数并输出结果表不要写单测代码,只帮我列出这些改动的输入和预期输出对这个分支新增方法做 true/false、异常、实体返回结果模拟