Skip to content
Back to skills

Testing.Reorder

ASecurity

Reorganize test classes and functions to match the order of the tested code

  • 158 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 7, 2026
testingpythongotestingapi

Works with

  • api

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add gpsaggese/helpers --skill testing.reorder --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Testing.Reorder?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Testing.Reorder
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gpsaggese-testing-reorder/badge)](https://www.skillsdirectory.com/skills/gpsaggese-testing-reorder)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Reorganize test classes and functions to match the order of the tested code
model: haiku
---

# Goal
- Reorganize the Python test classes and functions in a testing file
  `*/test/test_*.py` to match the order of the functions they test in the
  corresponding source file

# Conventions
- For all the code, follow `.claude/skills/coding.rules.md` and
  `.claude/skills/testing.rules.md`

# Workflow

## Find Test Code
- Find the functions in `<FILENAME>.py` that are tested in
  `test/test_<FILENAME>.py`

## Prepare a Plan
- Prepare a plan that maps:
  - Test classes
  - The functions each class tests
  - The file that contains those functions

### Order the Testing Classes in the Same Order as the Python File
- Reorganize `test/test_<FILENAME>.py` to match the order of the functions declared
  in `<FILENAME>.py`

- E.g., if in a Python `.../file.py`
  ```python
  def test1(...)

  def test2(...)
  ```
  the corresponding `.../test/test_file.py`
  ```python
  class Test_test1(...)

  class Test_test2(...)
  ```

### Preserve Behavior Exactly
- Do not modify functionality, logic, signatures, control flow, side effects, or
  semantics
- The resulting code must behave identically to the original

### Move Code Only
- The refactor must be structural only
- Allowed changes:
  - Reordering functions
  - Adding section headers
  - Renaming internal/private functions consistently
- Disallowed changes:
  - Rewriting logic
  - Simplifying implementations
  - Changing APIs
  - Changing imports unnecessarily
  - Modifying formatting beyond what is required for reorganization

## Implement the Plan
- Implement the plan by moving the code without changing it
- Run the related unit tests to make sure everything works

# Verification
- [ ] Confirm test classes appear in the same order as the functions they test
- [ ] Run the related unit tests and confirm they pass
- [ ] Confirm no logic, signatures, or behavior changed

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in testing →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.