readability-method
Installation
SKILL.md
Clean Code
Load the project-protocol:project-protocol skill for execution preflight, baseline,
candidate gate and recovery. Capture the owned files' exact pre-edit contents,
including preexisting edits and untracked files. Use path-scoped restoration on
failure; hard reset needs an exclusively owned clean isolated workspace and
captured pre_phase_sha. Required remote checks match the candidate snapshot and
command/configuration/job identity. Do not overwrite another writer's later edit.
Use the clean-code-agent to rewrite source code for readability without changing behavior.
Rules
- Validate before and after. Establish a baseline with type checker + tests + linter, then verify no regressions.
- If
--dry-run, preview only. Show proposed changes without modifying files. - Revert on failure. If any validation fails after a change, restore the exact saved pre-edit content through the common protocol; preserve preexisting edits and stop on a foreign-writer conflict.
- Reuse explicit scope authorization. Show the reviewable preview; ask only for choices not already covered by the caller's accepted plan or
--yes. - Block without validation tools. If no tests AND no type checker exist, require
--forceto proceed.