Code quality

From ahonn/dotfiles · View interactive version

Code quality is an AI agent skill from the GitHub repository ahonn/dotfiles. Review maintainability or clean up comments in specified code without expanding the change's scope.

How to use this skill

Skill file

Code Quality and Comment Cleanup

Meet the requested behavior and correctness constraints first. Within those constraints, prefer readability and maintainability over speculative optimization or shorter code.

Maintainability Review

Look for problems with a concrete cost to callers or future changes:

Explain the affected behavior or maintenance cost before recommending a refactor. Preserve useful existing patterns and idiomatic language conventions. Offer alternatives only when their tradeoffs matter; do not treat every code smell as a defect or permission to rewrite adjacent code.

For interface design decisions, the codebase-design skill provides more detailed criteria when available.

Error Handling

Comments

Keep explanations of intent, tradeoffs, contracts, non-obvious behavior, and constraints that the code cannot express clearly. Update comments made stale by the change.

Remove redundant narration where naming and structure already communicate the behavior. Preserve licenses, tooling directives, required documentation, and historical context that still explains a constraint.

When invoked for comment cleanup on a file:

  1. Read enough surrounding code to understand the comments' purpose.
  2. Edit misleading or redundant comments and retain useful rationale.
  3. Keep runtime behavior unchanged. Suggest larger naming or structural improvements separately unless the user also requested them.

Follow the global test policy. Comment-only edits need diff inspection rather than new behavior tests. Report supported findings and actual changes; use the format that best fits their size.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.