CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

refactoring-patterns

Apply named refactoring transformations to improve code structure without changing behavior. Use when the user mentions "refactor this", "code smells", "extract method", "replace conditional", "technical debt", "move method", "inline variable", or "decompose conditional". Also trigger when cleaning up legacy code, preparing code for new features by restructuring, or identifying which transformation to apply to a specific code smell. Covers smell-driven refactoring, safe transformation sequences, and testing guards. For code quality foundations, see clean-code. For managing complexity, see software-design-philosophy.

Quality

92%

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

85%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-structured catalog skill: concrete smell→refactoring mappings, an explicit test-guarded workflow with recovery steps, and exemplary one-level-deep reference bundling. The main weakness is token efficiency — recurring explanations of concepts Claude already knows and an irrelevant author biography consume roughly a quarter of the body without adding capability.

Suggestions

Delete the "About the Author" section entirely — Martin Fowler's biography has no bearing on applying refactorings and is pure token cost.

Cut or compress the six "Why it works" paragraphs; they re-teach standard software-engineering knowledge (short methods read like prose, a Money object beats a raw int) that the "Key insights" lists already cover more efficiently.

Merge "Core Principle" into the opening paragraph (both state the same test→change→test loop) and move the affiliate-tagged Further Reading links into a reference file or drop them.

DimensionReasoningScore

Conciseness

The bulk of the body earns its tokens (dense context→pattern→example tables, Common Mistakes, Quick Diagnostic), but there is systematic padding: six "Why it works" paragraphs re-explain concepts Claude already knows ("An `int` representing a currency amount has no concept of rounding rules, currency codes, or formatting. A `Money` object encapsulates all of that"), "Core Principle" restates the intro's test-small-verify loop, and the entire "About the Author" section is a Martin Fowler biography irrelevant to applying refactorings. This is above anchor 2 because the majority of content is efficient, but below anchor 4 because the unnecessary explanation is recurring rather than minor.

3 / 5

Actionability

For an instruction-only skill the guidance is maximally concrete: every smell has a context→pattern→example row ("Method > 10 lines → Extract Method → Pull the loop body into `calculateLineTotal()`"), the output protocol is explicit ("Always provide the current score and specific refactorings needed to reach 10/10"), and the workflow is mechanically specified ("test -> refactor -> test -> commit (repeat)"). Per the rubric's instruction-skill note this matches the top anchor; the how-to mechanics are properly delegated to six real, substantive reference files rather than missing.

5 / 5

Workflow Clarity

The refactoring loop has explicit validation checkpoints and an error-recovery feedback loop: "verify tests pass, apply one small structural change, verify tests still pass", "If tests go red, revert the last change -- don't debug a broken refactoring", and "commit after every green-to-green transformation". The Quick Diagnostic table supplies a pre-flight checklist. Not 4: both validation steps and the recovery loop are explicit, matching the anchor-5 pattern.

5 / 5

Progressive Disclosure

Each of the six sections ends with a well-signaled "See: [references/...md]" link, and a "## Reference Files" index gives a one-line description of every file; all six bundle files exist and are substantive (347-433 lines) with internal-anchor-only navigation, confirming one-level-deep references. The split is clean — body holds triggers and the decision matrix, references hold motivation, mechanics, and before/after examples — so navigation is easy and content is appropriately placed.

5 / 5

Total

18

/

20

Passed

Description

95%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 that clearly states what the skill does and gives unusually thorough, natural trigger coverage in third-person voice, with explicit disambiguation against sibling skills. The only soft spot is that its capability list reads as facets of one operation rather than a set of distinct actions.

DimensionReasoningScore

Specificity

It names several specific capabilities — "Apply named refactoring transformations to improve code structure without changing behavior" plus "smell-driven refactoring, safe transformation sequences, and testing guards" — going beyond the 1-2 actions of anchor 3. It falls short of anchor 5 because the listed items are facets of one core operation rather than distinct concrete actions comparable to "extract text, fill forms, merge documents, convert pages to images".

4 / 5

Completeness

Both questions are answered explicitly: what — "Apply named refactoring transformations to improve code structure without changing behavior"; when — "Use when the user mentions [eight quoted phrases]. Also trigger when cleaning up legacy code, preparing code for new features by restructuring, or identifying which transformation to apply to a specific code smell." This is a direct match for the anchor-5 example pattern of concrete what + explicit trigger phrases.

5 / 5

Trigger Term Quality

Trigger coverage is comprehensive, mixing natural user phrasings ("refactor this", "technical debt", "cleaning up legacy code") with the specific technique names users actually say ("extract method", "replace conditional", "move method", "inline variable", "decompose conditional") plus situational triggers like "preparing code for new features by restructuring". Nothing common is missing, matching the comprehensive anchor.

5 / 5

Distinctiveness Conflict Risk

The niche (behavior-preserving structural transformation) is distinct, anchored by technique-name triggers unlikely to appear for other skills, and it explicitly disambiguates against the nearest siblings: "For code quality foundations, see clean-code. For managing complexity, see software-design-philosophy." Not 4: even the broadest terms ("technical debt", legacy cleanup) are explicitly routed away from overlapping skills.

5 / 5

Total

19

/

20

Passed

Validation

100%

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

Validation — 16 / 16 Passed

Validation for skill structure

No warnings or errors.

Repository

valeriibeck-star/claude-skills

Path

skills/refactoring-patterns/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.