/code-quality-refactoring:refactorfrom code-quality-refactoring
Improves code structure and readability through surgical, behavior-preserving refactoring. Covers small-step transformations like Extract Function, Rename Variable, and Replace Conditional with Polymorphism, with verification via tests and version control.
Ships in code-quality-refactoring. 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.
Improve code structure, readability, and maintainability without changing external behavior. Treat refactoring as gradual evolution: identify one smell, apply one safe transformation, prove behavior stayed the same, then repeat.
references/smells-patterns-operations.md when selecting a concrete smell, pattern, or operation.git status.| Rule | Apply it by | Failure signal |
|---|---|---|
| Behavior is preserved | Keep public inputs, outputs, side effects, errors, and timing assumptions equivalent unless the user explicitly asks otherwise. | Tests require assertion changes that are not naming-only. |
| Small steps | Change one abstraction boundary, name, or duplicate cluster at a time. | A diff mixes extraction, feature work, dependency upgrades, and formatting. |
| Version control is your friend | Use git status and inspect diffs before and after meaningful steps. | You cannot explain which lines changed for structure only. |
| Tests are essential | Add characterization tests when existing coverage is missing. | You are "editing" critical code without a behavior oracle. |
| One thing at a time | Do not combine refactoring with features, bug fixes, or broad style rewrites. | The output includes new capabilities or altered business rules. |
| Area | Target |
|---|---|
| Functions | Small enough to scan, usually < 50 lines, with one responsibility and a descriptive name. |
| Duplication | Shared behavior extracted only when the duplication is real and stable, not coincidental. |
| Names | Variables, functions, classes, and modules describe domain intent rather than implementation trivia. |
| Constants | Magic numbers and strings become named constants when the value carries business meaning. |
| Structure | Related code is together, module boundaries are clear, and dependencies flow in one direction. |
| Type safety | Public APIs have explicit types; any and nullable values are justified and constrained. |
| Dead code | Remove only when tests, references, and search show it is truly unused. |
references/smells-patterns-operations.md: open when choosing a specific smell, pattern, operation, or example before editing.Legacy checklist labels to preserve when mapping older refactor notes: PREPARE, IDENTIFY, REFACTOR, VERIFY, and CLEAN. Treat Functions/classes or functions/classes complaints as oversized abstractions; treat numbers/strings complaints as magic value smells.
### Refactor result
**Status:** complete | partially complete | blocked
**Goal:** <maintainability problem addressed>
**Behavior guarantee:** <tests or checks that prove behavior was preserved>
| File | Smell addressed | Refactoring operation | Validation |
| --- | --- | --- | --- |
| `<path>` | `<smell>` | `<operation>` | `<test/check>` |
**Notes**
- <remaining risks or follow-up refactors>
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub gbb-acelerators/awesome-harness-primitives --plugin code-quality-refactoring9 skills in this plugin
/dotnet-design-pattern-reviewReview C# and .NET code for design pattern quality, SOLID principles, dependency injection, repository/provider abstractions, ResourceManager usage, async practices, testability, and maintainability. Use this skill when asked for a .NET or C# design pattern review, architecture critique, or pattern-focused code review without modifying code./editorconfigGenerate or update a comprehensive .editorconfig from repository file types and formatting preferences, including indentation, line endings, charset, whitespace, final newline, language globs, and rule-by-rule explanations. Use when asked to create, standardize, or explain EditorConfig./em-dashReview and rewrite code, comments, documentation, and data files to avoid em dashes and en dashes by default. Use this skill when the user asks to remove em dashes, replace Unicode dashes with hyphens, review punctuation in code comments, or enforce ASCII-safe punctuation./quality-playbookRun a complete quality engineering audit on any codebase. Derives behavioral requirements from the code, generates spec-traced functional tests, runs a three-pass code review with regression tests, executes a multi-model spec audit (Council of Three), and produces a consolidated bug report with TDD-verified patches. Finds the 35% of real defects that structural code review alone cannot catch. Works with any language. Trigger on 'quality playbook', 'spec audit', 'Council of Three', 'fitness-to-purpose', or 'coverage theater'./refactor-method-complexity-reduceRefactor a specified method to reduce cognitive complexity to a requested threshold or below by extracting focused helper methods while preserving behavior. Use when the user asks to reduce method complexity, simplify nested conditionals, split large if-else or switch chains, extract validation or type-specific handlers, and verify tests show failed=0./review-and-refactorReview project code against repository instructions, identify maintainability issues, make focused refactorings without splitting existing files, and validate tests when available. Use this skill when the user asks for code cleanup, maintainability review, best-practice refactoring, standards-driven improvements, or a senior engineering pass over existing code.Other plugins' skills for the same job