Refactoring suggestions. Use when the user requests refactoring, code structure improvement, or code cleanup. Provides concrete refactoring proposals with actual code changes.
If code quality review (jcr-review) is about "finding and reporting problems," this skill is about "suggesting how to actually fix them with code."
If no arguments are given, git diff (unstaged changes) is the default target.
If arguments are provided, determine the target as follows:
--staged → git diff --staged--branch → diff against the base branch (git diff <base-branch>...HEAD). The base branch is auto-detected via git symbolic-ref refs/remotes/origin/HEAD. If base-branch is specified in .jcr.md, that takes precedence.Shares references with jcr-review. Used as criteria for refactoring decisions:
../jcr-review/references/dead-code.md — identifying code to remove../jcr-review/references/duplication.md — identifying extraction/consolidation targets../jcr-review/references/complexity.md — identifying separation/simplification targets../jcr-review/references/naming.md — suggesting name improvements../jcr-review/references/error-handling.md — improving error handling../jcr-review/references/magic-values.md — suggesting constant extraction../jcr-review/references/comments.md — cleaning up comments../jcr-review/references/style.md — unifying style../jcr-review/references/flutter-dart.md — Flutter/Dart specific refactoring (widget decomposition, state management, async patterns).jcr.md exists, read it first to check project conventions and exclusion patterns.Must follow this format:
## Refactoring Summary
- Total N refactoring suggestions
- Main types: type(count), ...
## Refactoring Suggestions
### 1. [Title] — `file_path:line_range`
**Reason**: Why this refactoring is needed
**Before**:
(current code)
**After**:
(improved code)
**Effect**: Benefits gained from this refactoring
Output language follows the user's language.
.jcr.md).