AgentSkillsCN

file-cleaner

在不改变原有行为的前提下,提升单个源文件的可读性。当用户希望清理代码、进行可读性重构,或优化代码风格时,可使用此功能。

SKILL.md
--- frontmatter
name: file-cleaner
description: 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.

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

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: