/personal:find-refactorsfrom personal
Find refactors worth doing in a codebase area, ranked by the future change each one makes cheaper, and verify each candidate adversarially before recommending it. Use when asked to find refactor opportunities, improve the design of a set of modules or engines, pick refactors for a batch of PRs, or audit an area for dependency, duplication or boundary problems. Produces evidence-backed refactor cards and a discard list; it does not edit code or open PRs.
Ships in personal. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A refactor is worth doing when it makes a change the team will actually make cheaper. Every candidate you report names that change. Discard a candidate when you cannot name it.
This skill finds and verifies candidates. It changes no code. The caller decides which cards become PRs.
If the repository has a reference for this skill in references/, read it before starting. It lists that repository's boundary tool, conventions and known traps. Resolve that path relative to this skill.
A good refactor does at least one of these, and you can show it in code:
Propose a design pattern only when the code already has a second real case for it. A pattern for one imagined case goes to discards.
These do not count toward the limit: deleting comments, renaming for style, test-helper swaps, splitting assertions, formatting. Mention them in one line at the end, grouped by module, as candidates for a single chore PR.
Run each source below over the scope. Each gives its own evidence. Exclude tests, generated files and migrations from the counts.
Hotspots (churn × size). Large files that change often are where a refactor pays back.
git log --since="<window>" --no-merges --name-only --format= -- <scope paths> \
| grep -v -e '<exclusion pattern>' | sort | uniq -c \
| while read n f; do [ -f "$f" ] && l=$(wc -l < "$f") && echo "$((n * l)) $n $l $f"; done \
| sort -rn | head -20
Change coupling. Pairs of files in different modules that change in the same commit three or more times. They show knowledge split across a boundary.
git log --since="<window>" --no-merges --name-only --format='format:@@' -- <scope paths> \
| grep -v -e '<exclusion pattern>' \
| awk '/^@@$/{n=0; split("",f); next} NF{f[++n]=$0; for(i=1;i<n;i++){a=f[i]; b=$0; if(a>b){t=a; a=b; b=t} c[a" "b]++}} END{for(k in c) if(c[k]>=3) print c[k], k}' \
| sort -rn | head -30
Keep the pairs whose two files belong to different modules.
Boundary violations. The repository's dependency checker and its recorded exceptions (the reference names them). Each exception is a candidate for rule 1. The checker proves the fix.
Repeated decisions. Search the scope for the same branch written in several files: case or if over country, provider, status or mode, and duplicated code-to-value maps. Count the files per decision.
Shallow modules and untyped data. In the hotspot files, look for public classes that only forward to another class, and for hashes passed between commands or modules.
Take the top 15 hotspots, every coupled pair, and every repeated decision found in three or more files. Read each one fully, with its callers and tests. Drop what turns out to be intentional or already covered by an existing abstraction.
If the scope's history links commits to pull requests or issues, read the description and discussion of the ones that touched the candidate. A design that a reviewer already discussed and accepted is not a defect unless the cost has since become visible.
### <short title>
- Problem: `<file:line>`. <What is wrong, in one sentence.> Rule: <number and name from "What counts">.
- Evidence: <hotspot numbers, coupling count, violation count, or files repeating the decision>.
- Interface before: <real signatures>.
- Interface after: <proposed signatures>.
- Callers: <count>, listed with `file:line` (from a repository-wide search, not only the scope).
- Change it makes cheaper: <link to a recent PR that had to touch N places for this reason, or an open issue>.
- Coverage: <specs that exercise the touched code, and what they miss>.
- PR plan: <ordered list. The first PR adds characterization tests when coverage is missing. Each later PR preserves behaviour and passes the existing tests unchanged.>
- Risk: low | medium | high (see below).
- Effort: S | M | L.
Every field holds something you read or ran. Write "unknown" instead of guessing.
Give each card, with the code it cites, to a fresh agent that has not seen your reasoning. Its job is to refute the card. It checks:
If parallel agents are unavailable, do the same pass yourself sequentially, after finishing all cards, rereading the code from scratch. Keep a card only if the refutation fails. Record the refutation's outcome on the card in one line.
Risk depends on the technique, not on how small the change looks:
Rank eligible cards by value (hotspot weight plus the change it makes cheaper), then risk, then effort. Prefer three cards with a solid PR plan over five small ones.
Do not edit files, create branches or open PRs.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub adolfovillalobos/agents --plugin personal10 skills in this plugin
/code-reviewReview a PR, branch, or working diff adversarially against its intent and repository conventions. Look for concrete failure cases, challenge each candidate finding against the surrounding code, and report supported defects separately from design suggestions. Use for PR reviews, second opinions, or requests to challenge an implementation./create-prOpen a pull request with a concise review format — draft, self-assigned, English title and Spanish body by default, an issue ID prefix, the issue tracker's suggested branch when available, and a body under 120 words that signposts the diff instead of summarizing it. Use when the user asks to create/open/raise a PR, says "PR this", "abre un PR", "subamos el PR", or runs `/create-pr`./