Use this template to improve readability of a single source file without changing behavior.
INPUTS
- •PROJECT_CONTEXT
- •SOURCE_FILE // full file text
- •(optional) FILE_PATH
INSTRUCTIONS
- •Keep behavior identical. Avoid semantic changes.
- •Rename unclear variables and functions to intent-revealing names.
- •Remove redundant or noisy comments. Keep value-adding docs.
- •Add comments where logic is non-obvious (why > what).
- •Reformat for consistency per PROJECT_CONTEXT standards.
- •Ensure lints and static analysis pass.
- •Surface any low-risk micro-optimizations as suggestions, not changes.
- •Keep lines ≤80 chars.
OUTPUT FORMAT
Summary
- •What improved:
- •Risks:
Cleaned file
code
// full revised file
Diff (for review)
diff
- old + new
Naming changes
- •old_name → new_name: reason
Lint & style
- •Tools used (e.g., language-specific linters, formatters):
- •Rules touched:
Notes for follow-up (optional)
- •Larger refactors that were out of scope:
- •Test additions recommended: