refactorfastapi
Refactor FastAPI/Python code to improve maintainability, readability, and adherence to best practices. This skill transforms working code into exemplary code following FastAPI patterns, Pydantic v2, and SOLID principles. It addresses fat route handlers, blocking I/O in async routes, code duplication, deep nesting, missing type hints, and improper dependency injection. Apply when you notice business logic in routes, Pydantic v1 patterns, or code violating PEP 8 conventions.
Installation and usage
Refactor FastAPI/Python code to improve maintainability, readability, and adherence to best practices. This skill transforms working code into exemplary code following FastAPI patterns, Pydantic v2, and SOLID principles. It addresses fat route handlers, blocking I/O in async routes, code duplication, deep nesting, missing type hints, and improper dependency injection. Apply when you notice business logic in routes, Pydantic v1 patterns, or code violating PEP 8 conventions.
Once installed, you can use this skill by running the following command in your terminal:
skills use refactorfastapi