fastapi-refactor

Solid

Use when the user wants to restructure code while preserving behavior exactly. Establishes a passing test baseline first, then makes incremental moves that each leave the suite green. Refuses to change behavior and structure in the same step.

Code & Development 11 stars 0 forks Updated today MIT

Install

View on GitHub

Quality Score: 79/100

Stars 20%
36
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

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...

Details

Author
steph-dove
Repository
steph-dove/klaussy-agents
Created
4 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category