fastapi-refactorlisted
Install: claude install-skill steph-dove/klaussy-agents
Refactor the code the user described. The goal is to change structure while preserving behavior exactly. Do NOT change what the code does — only how it's organized.
---
## Phase 1: Establish the Safety Net
Before changing any code, confirm you have tests that cover the current behavior.
1. **Read CLAUDE.md** for project structure, test commands, and conventions.
2. **Read any `.claude/rules/*.md`** whose `paths:` glob matches the area being refactored — they encode the conventions the moved code must continue to obey.
3. **Run the existing test suite.** Record the results — every test must pass before you start. If tests are failing already, stop and report that. Do not refactor code that doesn't have a passing baseline.
3. **Assess coverage of the code you plan to change.** Read the existing tests for the modules involved. If a function you're restructuring has no tests:
- Write tests for its current behavior first.
- Run them to confirm they pass.
- These are your regression guardrails — they prove the refactor didn't break anything.
---
## Phase 2: Understand the Current Code
Read the code you're refactoring in full. The three checks below are independent — issue them as a single batch of parallel tool calls, not sequentially:
1. **What it does** — the inputs, outputs, side effects, and edge cases. Read the file(s) in full.
2. **Who calls it** — grep for callers across the whole repo. Every caller is a contract you must preserve.
3. **What depends on its i