refine-code
Installation
SKILL.md
Refine Code
Reduce the effort needed to understand and maintain existing code while preserving its observable behavior and supported contracts. Rank improvements by cognitive load removed, not lines deleted.
Scope and authorization
Apply the user's intent to every mode:
- Assess, audit, find, review, or report: inspect and propose; do not edit code, docs, or configuration.
- Refactor, simplify, apply, clean up, or delete: implement the requested changes and verify them. Do not stop at suggestions or ask again merely because a change crosses files.
- Continue within existing authorization. Ask only for an unresolved choice that materially changes scope, safety, supported behavior, or a hard-to-reverse decision. Prepare the concrete alternatives first.
Use the files, revisions, and boundaries the user named. For recent work, inspect Git status and the relevant staged, unstaged, committed, and untracked changes. Preserve unrelated work. Read applicable repository instructions; consult neighboring code and decision records only where they explain the change in question.
Choose the relevant guidance
- Code: local readability, types, and organization. Use the guidance below.
- Architecture: coupling, module responsibilities, or testability. Read references/ARCHITECTURE.md.
- Entropy: dead code, duplicate state, unused configuration, or safe deletions. Read references/ENTROPY.md for consumer and compatibility checks.