File Cleaner

Improve readability of a single source file without changing behavior. Use when the user wants to clean up, refactor for readability, or improve code style.

devclarityai 58c499e 1.2 KB Updated

File contents

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

  1. Keep behavior identical. Avoid semantic changes.
  2. Rename unclear variables and functions to intent-revealing names.
  3. Remove redundant or noisy comments. Keep value-adding docs.
  4. Add comments where logic is non-obvious (why > what).
  5. Reformat for consistency per PROJECT_CONTEXT standards.
  6. Ensure lints and static analysis pass.
  7. Surface any low-risk micro-optimizations as suggestions, not changes.
  8. Keep lines ≤80 chars.

OUTPUT FORMAT

Summary

  • What improved:
  • Risks:

Cleaned file

// full revised file

Diff (for review)

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

devclarityai/environment-setup/tree/main/cursor/.cursor/skills/file-cleaner commit 58c499efcd

Frequently asked questions

npx skillmds@latest add devclarityai/file-cleaner-2