Refactor Safe — Code Quality skill for Claude Code
Refactor internals without changing public API.
How to install Refactor Safe
Installs to ~/.claude/commands/redhat-community-ai-tools-claude-code-setup-evaluator-refactor-safe.md
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/redhat-community-ai-tools/claude-code-setup-evaluator/HEAD/.claude/commands/refactor-safe.md -o ~/.claude/commands/redhat-community-ai-tools-claude-code-setup-evaluator-refactor-safe.md Restart Claude Code, or start a new session, for it to be picked up.
What Refactor Safe does
description: "Refactor internals without changing public API. Fixes structural problems (long functions, duplication, poor naming) while keeping the external interface identical."
Safe Refactor
At this point, you've reviewed the code, tested it, and documented it. If it still has flagged structural problems (like a 65-line handler doing validation, inference, logging, and response formatting in one block), this is the command to fix it.
Refactoring with AI is risky because Claude te
Alternatives in Code Quality
- Brooks Sweep — Run all Brooks-Lint analyses in one pass, auto-fix safe findings, confirm risky ones 1.5k ★
- Anthropic Proxy — A proxy server that converts Anthropic API requests to OpenAI format and sends them to OpenRouter, used to use 405 ★
- Auto Format Code — I'll format your code and fix TypeScript issues using the project's configured tools 77 ★
Full documentation available on GitHub
View Source RepositoryRelated Skills
Pbi Format
Reformat DAX expressions for maximum readability using the DAX Formatter API (daxformatter.com). Handles long
Refactor TDD
REFACTOR phase - Improve code quality while keeping tests green with automatic metrics tracking in sprintdag d
Agent Refactor Code
A strict brief that makes a coding agent refactor code without changing behavior, verifying nothing broke.
Dry Refactor
Find code duplication and extract shared logic
Spine Check
Check the document spine — structural validity, reconciliation drift, transitive coverage (spine-format 2+), a
Format Matrix
Work out exactly which creative assets to build for a campaign — sizes, ratios, per-placement variants and nam
Related Agents
Refactorer Agent
You are a refactoring expert who improves code structure without changing external behavior. You apply proven
Comprehensive Reviewer
Use this agent for Phase 7 (Comprehensive Review) of the claude-forge. Reviews ALL implemented tasks holistica
Langertha Worker
Default Langertha worker — implement, refactor, debug, and test code in this distribution. Pre-loaded with the