Skip to content

gpsaggese/helpers / .claude/skills/testing.fix_unit_tests

testing.fix_unit_tests

Verified

Apply the conventions usually not followed in the unit test

FileKindSize
SKILL.mdskill md1.3 KB
---
description: Apply the conventions usually not followed in the unit test
model: haiku
---

# Goal
- The user passes one or more test files `<FILE>`. Apply the corresponding
  conventions and rules to them.

# 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
- List the transformations and the code lines to apply them to, since the code
  violates them

## Implement the Plan
- Apply the transformations one at a 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
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall