AGENT SKILL

testing.fix_unit_tests

Apply the conventions usually not followed in the unit test

使用场景测试与质量
License 许可
Apache-2.0
所属仓库
causify-ai/helpers
最近更新
2026-11-02
Stars
★ 155
Forks
170

01 前言 Front Matter

model
haiku
description
Apply the conventions usually not followed in the unit test

03 SKILL.md 正文

Goal

  • The user passes one or more test files <FILE> and you need to apply the corresponding conventions and rules.

Workflow

Read Rules

  • Read the transformations from .claude/skills/testing.rules.md in the following headers
    • ### Dedent Strings to the Code
    • ## Test Method Names
    • ## Use Helper Methods When You Have Repetitive Tests
    • ### Avoid Replicated Assignment
    • ## Consolidate Inputs and Outputs
    • ## Assign Variables and Then Call Functions
    • ## Compare Whole Output with assert_equal, Not Piecewise
    • ## Do Not Use `hdbg.dassert` to Test Assertions

Draft a Plan

  • Given the code passed in <FILE> and the list of all the transformations create a list of transformations and code lines to apply them, since the code violates them

Implement the Plan

  • Apply the transformations one at the time to the parts of the code

Refactor the Code

  • Run the skill /coding.factor_common_code on the file <FILE> to factor out common code

Important

  • Make sure that there is no change in behavior in the code
  • For all the code you must follow the instructions in:
    • .claude/skills/coding.rules.md
    • .claude/skills/testing.rules.md

Verification

  • [ ] Check that no remaining part of the code violates the list of transformations
  • [ ] Run the tests and confirm behavior is unchanged

04 同仓库更多 Skills