swift-clean-functions
Installation
SKILL.md
Swift Clean Functions
Audit and refactor functions/methods in Swift code per Clean Code (Robert Martin), adapted to Swift idioms.
Arguments
The user provided: $ARGUMENTS
If a file path is given — read it. If no arguments — ask the user to paste the code or specify a file.
Checklist to Apply
1. Small Functions
- Functions should be 20 lines or fewer; ideal is under 10
- If a function needs a comment to explain a block — that block is a new function
- Each
if/guard/forbody should ideally be a single function call