skill-refactor
Reviews and refactors an existing skill against quality standards. Use when asked to review, audit, improve, or refactor a skill. Triggers on phrases like "refactor this skill", "review my skill", "improve skill quality", "audit skill-name", "clean up my skill". Do NOT use to create a new skill from scratch.
Best use case
skill-refactor is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Reviews and refactors an existing skill against quality standards. Use when asked to review, audit, improve, or refactor a skill. Triggers on phrases like "refactor this skill", "review my skill", "improve skill quality", "audit skill-name", "clean up my skill". Do NOT use to create a new skill from scratch.
Teams using skill-refactor should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/skill-refactor/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How skill-refactor Compares
| Feature / Agent | skill-refactor | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Reviews and refactors an existing skill against quality standards. Use when asked to review, audit, improve, or refactor a skill. Triggers on phrases like "refactor this skill", "review my skill", "improve skill quality", "audit skill-name", "clean up my skill". Do NOT use to create a new skill from scratch.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# Skill Refactor Standalone refactor review for existing skills. Runs critique and red-team agents in parallel, compiles a review summary, and gates all changes behind explicit user approval. ## Input Accept one of: - Project-bound path: `.claude/skills/<skill-name>/` - Template path: `skills/<skill-name>/` (or any other project-relative path) If the user does not provide a path, ask which skill to refactor before proceeding. Confirm the directory exists and contains `SKILL.md` before launching sub-agents. ## Workflow See `references/refactor-protocol.md` for full sub-agent prompt templates, output formats, and AskUserQuestion schemas. ### 1. Locate skill Resolve the skill path. Read all files in the directory. If `SKILL.md` is missing, stop and report. ### 2. Launch parallel sub-agents Launch both simultaneously: - **Critique agent** — evaluates against internal quality standards (conciseness, degrees of freedom, progressive disclosure, structure, forbidden files). Read `references/refactor-protocol.md` for the prompt template. - **Red-team agent** — evaluates against `references/anthropic-best-practices.md` (naming, frontmatter, trigger quality, instruction quality, error handling, file conventions). Read `references/refactor-protocol.md` for the prompt template. Write outputs to: - `temp/<skill-name>/critique/feedback.md` - `temp/<skill-name>/red-team/feedback.md` ### 3. Compile review summary Merge both feedback files into `temp/<skill-name>/refactor/review-summary.md`. Present the path to the user and ask them to review it before proceeding. ### 4. Approval gate Use AskUserQuestion. Options: proceed with refactor, keep as-is, defer. If declined or deferred, log to `decisions.md` and stop. ### 5. Requirements gathering Use AskUserQuestion (up to 3 questions): which change categories to apply, any new requirements, refactor depth (targeted vs full rewrite). Log all answers to `temp/<skill-name>/refactor/decisions.md`. ### 6. Refactor agent Apply approved changes in-place to the skill files. Preserve sections not flagged for change in targeted refactors. Log implementation notes to `decisions.md`. Read `references/refactor-protocol.md` for the prompt template. ## Constraints - Never modify skill files without explicit user approval - Write all intermediate artifacts to `temp/<skill-name>/` before any approval gate - Log all user decisions and implementation choices to `decisions.md`
Related Skills
tdd-workflows-tdd-refactor
Use when working with tdd workflows tdd refactor
refactorer-view
A front end staff engineer and UX designer, who refactors and simplifies the user interfaces with the best of user experience patterns.
refactor
Plan vault restructuring from config changes. Compares config.yaml against derivation.md, identifies dimension shifts, shows restructuring plan, executes on approval. Triggers on "/refactor", "restructure vault".
refactor-skill
Assess and refactor oversized or multi-domain skills. First determines whether splitting or references/ extraction is appropriate — then executes the correct action. Use when a skill exceeds token thresholds (SK006/SK007) or covers multiple independent domains. Performs candidate assessment before any structural changes; cohesive single-intent skills are redirected to references/ extraction instead of splitting. When splitting is warranted — domain analysis gate, split plan, new SKILL.md generation, validation, and backwards-compatible facade conversion.
refactor-html
Refactor HTML/TSX files to use existing UI components, DaisyUI classes, and semantic colors. Use when (1) refactoring React/TSX page components to use reusable UI components, (2) replacing raw HTML elements with component library equivalents, (3) converting primitive Tailwind colors to semantic DaisyUI colors, (4) extracting repeated styling patterns into components.
moonbit-refactoring
Refactor MoonBit code to be idiomatic: shrink public APIs, convert functions to methods, use pattern matching with views, add loop invariants, and ensure test coverage without regressions.
dotnet-to-react-python-refactor
Agent skill for refactoring .NET applications into a React frontend + Python backend. Use for migrating/modernizing .NET apps (ASP.NET MVC, Web API, Blazor, Web Forms) to React + Python, or analyzing .NET codebases for migration planning.
code-refactoring-tech-debt
You are a technical debt expert specializing in identifying, quantifying, and prioritizing technical debt in software projects. Analyze the codebase to uncover debt, assess its impact, and create acti
code-refactoring-context-restore
Use when working with code refactoring context restore
ast-refactor
This skill should be used when transforming, refactoring, or replacing code patterns across multiple files. Use for renaming functions/classes/variables, migrating API usage patterns, modernizing syntax, or performing bulk code transformations. Prefer ast-grep over sed/awk for syntax-aware replacements that understand language structure.
52-execute-refactor-150
[52] EXECUTE. Three-stage refactoring workflow: (1) iterative research of refactor/modularization options, (2) plan + risk/edge-case analysis + Scope150 validation, then implement with tests after user confirmation, and (3) apply Scout105 cleanup protocol. Use when asked to refactor, modularize, or restructure code safely.
refactoring-ui
Practical UI design system based on Adam Wathan & Steve Schoger's "Refactoring UI". Use when you need to: (1) fix visual hierarchy problems, (2) choose consistent spacing and typography scales, (3) build color palettes with proper contrast, (4) add depth with shadows and layering, (5) design in grayscale first and add color last, (6) style components in Tailwind CSS, (7) make UI look professional without a designer.