auto-postwrite-refactor

Installation
SKILL.md

Auto Postwrite Refactor

Workflow

  1. Identify just-written code
  • Only inspect files changed in the current session (use git diff or the tracked edit list).
  • Skip untouched files to avoid scope creep.
  1. Scan for refactor targets
  • Dead/unused code: unused variables, functions, branches, imports, or unreachable paths.
  • Duplicated logic: similar blocks that can be merged without changing behavior.
  • High cyclomatic complexity: long conditional chains, nested branching, repeated early-returns.
  • Oversized functions: long functions that can be split into cohesive helpers.
  • Over-fragmentation: tiny helpers that add indirection with no clarity benefit.
  1. Apply safe, behavior-preserving refactors only
  • Keep semantics identical; no functional changes, no signature changes unless strictly internal and behavior-neutral.
  • Prefer local refactors within the same file/module.
  • Do not alter public APIs, interfaces, or externally-visible behavior.
Related skills

More from ruiwarn/skills

Installs
3
Repository
ruiwarn/skills
First Seen
Jan 29, 2026