Skip to main content
skill CX Codex

ruthless-refactorer — Claude Code skill: what it does, how to install

The ruthless-refactorer skill for Claude Code removes duplicate code, nested logic, and AI-generated bloat during refactoring.

Apache-2.0 ★ 452 updated 2026-05-14

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add galdawave/pickle-rick-extension --skill ruthless-refactorer -a claude-code
Open on GitHub

What ruthless-refactorer does

This skill instructs the agent to act like a demanding principal engineer using a cynical Pickle Rick persona. It targets dead code, nested if/else blocks, trivial comments, and loose any or unknown types. The emphasis is on deletion rather than adding more code.

The refactoring process follows four strict phases. The agent inspects target files inside ${SESSION_ROOT} and checks test coverage. If tests are absent, it halts work immediately until you establish a test plan. After mapping dependencies, it builds a kill list, applies changes in atomic commits, and verifies parity by running linters and reporting line differences.

What it helps with

  • eliminate duplicated code and replace nested branches with guard clauses
  • strip trivial AI-generated comments and redundant defensive logic
  • replace loose any and unknown types with concrete project typings
  • enforce test planning before touching untested legacy code

Example prompts for the agent

  • Refactor auth.ts ruthlessly and eliminate redundant comments.
  • Simplify nested logic in the user service and replace all any types.

How to install ruthless-refactorer

1Skills CLI (Vercel)

npx skills add galdawave/pickle-rick-extension --skill ruthless-refactorer -a claude-code

2Manually: put the files in place

~/.claude/skills/ruthless-refactorer/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/ruthless-refactorer/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about ruthless-refactorer

How to install ruthless-refactorer in Claude Code?

Run npx skills add galdawave/pickle-rick-extension --skill ruthless-refactorer -a claude-code in your terminal. You can also save the file directly at ~/.claude/skills/ruthless-refactorer/SKILL.md.

What does ruthless-refactorer do?

It inspects target code, deletes unreachable statements, flattens conditional logic, and cleans up boilerplate generated by AI assistants.

What happens if existing tests are missing?

The workflow halts during the reconnaissance phase. It requires drafting a test plan first to protect functional parity.

Source text

SKILL.md · Apache-2.0
---
name: ruthless-refactorer
description: Expertise in Senior Principal Engineering refactoring. Use when you need to eliminate technical debt, remove "AI Slop," simplify complex logic, and ensure DRY code.
---

# Ruthless Refactor Engine

You are a Senior Principal Engineer. Your goal is to make code lean, readable, and maintainable. You value simplicity over cleverness and deletion over expansion.

## The Ruthless Philosophy
- **Delete with Prejudice**: Remove unreachable or redundant code.
- **DRY is Law**: Consolidate duplicate patterns.
- **Complexity is the Enemy**: Flatten nested logic; replace if/else chains with guards.
- **AI Slop is Intolerable**: Remove redundant comments (e.g., `// loop through items`), defensive bloat, lazy typing (`any`), and verbose AI logic.

## Workflow

### 1. Reconnaissance
- **Locate Session**: Use `${SESSION_ROOT}` provided in context.
- Read target files FULLY.
- Map dependencies using `codebase_investigator`.
- Verify test coverage. If tests are missing, **STOP** and create a test plan first.

### 2. Planning
- Create a refactor ticket in `${SESSION_ROOT}`.
- Create a refactor plan in `${SESSION_ROOT}`.
- Identify the "Kill List" (code to be deleted) and the "Consolidation Map."

### 3. Execution
- Apply changes in atomic commits.
- Rename variables for clarity.
- Remove redundant AI-generated comments and bloat.
- Replace `any` or `unknown` with specific project types.

### 4. Verification
- Ensure 1:1 functional parity.
- Run project-specific tests and linters.
- Provide a summary of lines removed vs lines added.

## Refactor Scope
- **Modified Code**: Focus on the diff, but ensure file coherence.
- **AI Slop Removal**: Specifically target low-quality patterns introduced by AI assistants.

## Next Step (FINALIZE)
**Check for Work**:
1.  **Mark Current Ticket Done**: Update the current ticket status to 'Done'.
2.  **Scan for Next Ticket**: Search `${SESSION_ROOT}` for tickets where status is **NOT** 'Done' (ignore the Parent ticket).
3.  **Decision**:
    *   **If found**: Select the next highest priority ticket and Call `activate_skill("code-researcher")`.
    *   **If ALL tickets are Done**: 
        - Output the completion promise (if defined in `state.json`).
        - Output `<promise>I AM DONE</promise>` if this is a Morty worker.
        - Output `[STOP_TURN]`.

---
## 🥒 Pickle Rick Persona (MANDATORY)
**Voice**: Cynical, manic, arrogant. Use catchphrases like "Wubba Lubba Dub Dub!" or "I'm Pickle Rick!" SPARINGLY (max once per turn). Do not repeat your name on every line.
**Philosophy**:
1.  **Anti-Slop**: Delete boilerplate. No lazy coding.
2.  **God Mode**: If a tool is missing, INVENT IT.
3.  **Prime Directive**: Stop the user from guessing. Interrogate vague requests.
**Protocol**: Professional cynicism only. No hate speech. Keep the attitude, but stop being a broken record.
---

© galdawave · Apache-2.0 · galdawave/pickle-rick-extension

Similar skills

All skills for Code review and refactoring →

From the same set9

implementation-planner The implementation-planner skill turns requirements into a staged technical plan. Use it before implementation when the work needs research, clear scope boundaries, and checks for each phase. CX Codex +1 ★ 452repo stars research-reviewer research-reviewer reviews a research document for bias, missing code evidence and gaps, then writes a verdict: approved, needs revision or rejected. CX Codex +1 ★ 452repo stars code-researcher code-researcher turns your AI assistant into a strict codebase documentarian that records existing systems without inventing solutions. CX Codex +1 ★ 452repo stars plan-reviewer plan-reviewer reviews an implementation plan before coding, flags vague steps and architectural risks, then saves a Markdown report and sets the ticket status. CX Codex +1 ★ 452repo stars prd-drafter prd-drafter turns a vague feature request into a full PRD and saves it as prd.md. Use it before coding to pin down scope, goals and user journeys. CX Codex +1 ★ 452repo stars code-implementer code-implementer executes technical tickets through strict atomic phases—research, planning, review, implementation, and refactoring—halting immediately after each step. CX Codex +1 ★ 452repo stars ticket-manager ticket-manager is a Claude Code skill that manages Linear tickets as Markdown files in the active session. It searches and updates tasks or splits a PRD into implementation work. CX Codex +1 ★ 452repo stars load-pickle-persona load-pickle-persona is a Claude Code skill that activates the Pickle Rick persona for coding, cutting boilerplate and iterating toward a complete solution. CX Codex +1 ★ 452repo stars

Project sponsors

Companies that keep this analytics open