<< All versions

Skill v1.0.0

currentLLM-judged scan90/100
rmyz/dotfiles/refactor-planner
──Details
PublishedOctober 24, 2026 at 02:30 AM
Content Hashsha256:9b582be78e1d6c97...
Git SHA984079eccca9
──Files
Files (1 file, 3.5 KB)
SKILL.md3.5 KBactive
SKILL.md · 75 lines · 3.5 KB

version: "1.0.0" name: refactor-planner description: Critically review all code changes on the current branch against the base branch, identify improvement opportunities across naming, structure, DRY/KISS/YAGNI, declarative style, self-documenting code, edge cases, testing, and general best practices, then produce a categorized refactoring plan with prioritized action items. Use when the user asks to review, clean up, or refactor branch changes, or mentions "refactor plan", "code quality review", or "clean up this branch".


Branch Refactor Planner

Systematically review every file changed on the current branch, apply the quality checklist below, and produce a prioritized refactoring plan.

Investigation workflow

  1. Determine base branch
  • git merge-base HEAD upstream/main (fall back to main when there is no upstream remote, or use the branch the user specifies).
  1. Gather the changeset
  • git diff --name-only <base>...HEAD for the file list.
  • git diff <base>...HEAD for the full diff.
  1. Read changed files in full -- not just diff hunks. Surrounding context

reveals duplication, naming drift, and missing edge-case handling that hunks alone hide.

  1. Cross-reference related files -- look for shared patterns, duplicated

logic across the changeset, and opportunities to extract helpers or reuse existing project utilities.

  1. Consult project rules -- if the repo contains AGENTS.md,

.cursor/rules/, or equivalent conventions, incorporate them into the review.

  1. Produce the plan using the output format below.

Quality dimensions

Walk through every dimension for each changed file:

DimensionWhat to look for
NamingVariables, functions, types, and files convey intent and follow project conventions
Helper utilsHand-rolled logic replaceable by standard library, lodash, or project-shared code
Declarative styleImperative loops/mutation replaceable by map/filter/reduce, config objects, or declarative patterns
Self-documenting codeCode reads clearly without comments; flag redundant comments and missing non-obvious ones
Edge casesNull/undefined, empty collections, boundary values, error paths
TestingTests are meaningful and non-redundant; flag no-op assertions, duplicate coverage, and missing coverage
DRYDuplicated logic across or within files
KISSOver-engineered abstractions, unnecessary indirection
YAGNICode, config, or types added speculatively without current need
Control flowEarly returns, positive conditions, flat nesting
Type safetyany/unknown usage, non-null assertions, missing return types
Error handlingExplicit and typed; no swallowed errors
ConsistencyPatterns within the changeset are internally consistent

Output format

markdown
## Summary
<1-2 sentences on overall quality and recurring themes>
## Action items
### Critical (correctness / bugs)
-[ ] `file:line` [dimension] -- concrete suggestion
### High (maintainability / readability)
-[ ] `file:line` [dimension] -- concrete suggestion
### Low (style / polish)
-[ ] `file:line` [dimension] -- concrete suggestion
## Files reviewed
-`path/to/file.ts` -- one-line verdict

Rules for action items:

  • Cite file path and line range.
  • Tag with the quality dimension in brackets.
  • Give a concrete suggestion, not a vague observation

(e.g. "rename proc to processDocument", not "improve naming").

  • If a test should be removed or rewritten, explain why it provides no value.
All versions