code-hygiene
Installation
SKILL.md
Code Hygiene Review
Review source code against 10 language-agnostic structural quality principles and produce a findings report with concrete refactoring suggestions.
Important: This skill produces a report. Do not modify any reviewed files.
Review Workflow
- Select files — Use the user's specified files. If none specified, run
scripts/scan-source-files.sh <project-directory>to discover source files. The<project-directory>argument is required — it must be the root of the user's project, NOT the skill's own directory. - Load rules — Read
references/principles-quick-ref.mdfor the full checklist with detection signals and thresholds. - Review each file — Read each file and check against all 10 principles. Load detailed reference files on demand as violations are detected (see "When to Load Reference Files").
- Generate findings — For each issue found, produce a finding using the Output Format below.
- Classify severity — Use
references/severity-rubric.mdto assign high/medium/low. - Verify suggestions — For each suggested rewrite, confirm it resolves the flagged violation, does not introduce a new violation of any other principle, and preserves the original behavior. If a suggestion introduces a new violation, revise it before including it.
- Assemble report — Write findings to
code-hygiene-findings-YYYYMMDD.mdin the project root (use today's date). Group findings by file, then by severity (high first). End with the summary block.
Related skills