CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

refactor

Systematic code refactoring based on Martin Fowler's methodology. Use when users ask to refactor code, improve code structure, reduce technical debt, clean up legacy code, eliminate code smells, or improve code maintainability. This skill guides through a phased approach with research, planning, and safe incremental implementation.

Quality

87%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

SKILL.md
Quality
Evals
Security

Quality

Content

81%Weight 40%Scale 1-5

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

A well-engineered workflow skill: the phased process is unambiguous, rich in validation checkpoints and feedback loops, with fully executable commands and a complete worked example. The main costs are token efficiency — duplicated smell/mapping tables and a metadata trailer — and a dangling reference to a missing templates/refactoring-plan.md file.

Suggestions

Trim the 10-row 'Quick Reference' smell table and the smell-to-refactoring mapping table (or collapse them to 3–4 rows) since the full catalogs live in references/code-smells.md and references/refactoring-catalog.md; keep only the link plus a one-line pointer.

Create templates/refactoring-plan.md or remove both references to it — the body cites it in Phase 4 and in the References section, but the file is absent from the bundle.

Delete the closing metadata block ('Version History', 'Last Updated', 'Claude Code Version', 'Compatible Models') and the 'What Are Code Smells?' explainer — neither changes what Claude does and both spend context on concepts Claude already knows.

DimensionReasoningScore

Conciseness

The body is mostly efficient — phases, checklists, and commands earn their tokens — but includes unnecessary material: a full 10-row smell table and a 10-row smell-to-refactoring table that duplicate references/code-smells.md and references/refactoring-catalog.md, a 'What Are Code Smells?' explainer Claude does not need, and a trailing metadata block ('Version History', 'Compatible Models', 'Claude Code Version'). This is 'mostly efficient but includes some unnecessary explanation or could be tightened' (anchor 3); it is not anchor 2 because the padding is localized rather than pervasive, and not anchor 4 because the duplicated tables alone represent a substantial trim opportunity.

3 / 5

Actionability

Fully executable guidance throughout: copy-paste commands ('find . -name "*test*"', 'pytest -v', 'python scripts/detect-smells.py <file>', 'python scripts/analyze-complexity.py <file>'), concrete commit-message examples, a complete before/after worked example, and specific per-phase outputs and user prompts. This matches anchor 5 ('fully executable; copy-paste ready code or commands; specific examples cover the common cases'); score 4 would require minor gaps, and none are evident.

5 / 5

Workflow Clarity

The six-phase workflow is explicitly sequenced (with an ASCII flow diagram) and saturated with validation checkpoints: 'STOP. Fix failing tests before refactoring', the 'Change → Test → Green? → Commit → Next step' rhythm, 'If tests fail (red) - STOP immediately - Undo the change', approval gates per phase, and a post-refactoring checklist with before/after metrics. This matches anchor 5 (explicit validation steps, feedback loops for error recovery, checklists); it exceeds anchor 4, which allows minor validation gaps.

5 / 5

Progressive Disclosure

Good structure: the body is an overview with well-signaled one-level-deep links to references/code-smells.md, references/refactoring-catalog.md, and the two scripts, all of which exist. It is anchor 4 rather than 5 because [templates/refactoring-plan.md](templates/refactoring-plan.md) is referenced twice but the file does not exist in the bundle, and because the inline quick-reference tables restate content that already lives in the reference files. It is above anchor 3 because the references that do exist are clearly signaled and the split is otherwise appropriate.

4 / 5

Total

17

/

20

Passed

Description

88%Weight 40%Scale 1-5

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

A strong description: third-person voice, explicit 'Use when' trigger guidance with multiple natural trigger phrases, and a concrete statement of both capability and methodology. The only weaknesses are a few missing synonym trigger terms and slight overlap risk with general code-improvement requests.

DimensionReasoningScore

Specificity

The description lists multiple concrete actions — 'refactor code, improve code structure, reduce technical debt, clean up legacy code, eliminate code smells, or improve code maintainability' — plus a concrete method ('phased approach with research, planning, and safe incremental implementation'). This matches the anchor 'Lists multiple specific concrete actions; comprehensive coverage'; it is not score 4 because coverage of the refactoring domain leaves no minor gaps, and not below because every action named is concrete rather than generic.

5 / 5

Completeness

It explicitly answers both questions: 'what' via 'Systematic code refactoring based on Martin Fowler's methodology... phased approach with research, planning, and safe incremental implementation' and 'when' via 'Use when users ask to refactor code, improve code structure, reduce technical debt...'. This matches anchor 5 (clear, explicit what AND when with concrete trigger phrases); score 4 would require the 'when' to be less explicit, which it is not.

5 / 5

Trigger Term Quality

Natural user phrasings like 'refactor code', 'reduce technical debt', 'clean up legacy code', and 'eliminate code smells' give good keyword coverage. It falls short of anchor 5 ('comprehensive coverage of natural terms including synonyms') because common variations such as 'improve readability', 'tidy up', or 'simplify code' are absent.

4 / 5

Distinctiveness Conflict Risk

The refactoring niche is clear and triggers like 'technical debt' and 'code smells' are distinct. It sits at anchor 4 rather than 5 because broad phrasings such as 'improve code maintainability' and 'improve code structure' have minor overlap risk with general code-improvement, review, or cleanup skills.

4 / 5

Total

18

/

20

Passed

Validation

93%

Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.

Validation — 15 / 16 Passed

Validation for skill structure

CriteriaDescriptionResult

relative_links

Relative link issues: 2 missing

Warning

Total

15

/

16

Passed

Repository

luongnv89/claude-howto

Path

03-skills/refactor/SKILL.md

Reviewed

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.