Agent skill

Refactor Clean

by julianromli in julianromli/ai-skills

Safely identify and remove dead code with test verification at every step.

No licenceAuto-check passedDevelopment

Install Refactor Clean

skills CLI
$ npx skills add julianromli/ai-skills --skill refactor-clean -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install julianromli/ai-skills refactor-clean --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/julianromli/ai-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/refactor-clean .claude/skills/refactor-clean && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
refactor-clean
GitHub stars
191
Token cost
~1.3k tokens
SKILL.md length
639 words
Files
2
Skills in repo
5
Repo updated
First seen
Licence
None found

At a glance

Safely identify and remove dead code with test verification at every step.

  • Works in 8 steps: Establish a baseline. → Detect dead code with… → Categorize findings into SAFE, CAUTION,… → …
  • Codex needs to clean unused exports
  • SKILL.md covers Workflow, Establish A Baseline, Detect Dead Code and Categorize Findings, plus 5 more sections
  • Calls npx and cargo

What it does

Refactor Clean is an agent skill from julianromli/ai-skills. Safely identify and remove dead code with test verification at every step. Use when Codex needs to clean unused exports, files, dependencies, helpers, wrappers, re-exports, or duplicate code without risking regressions. Trigger for dead-code cleanup, unused dependency audits, stale utility removal, cleanup refactors, or requests to reduce code safely before or alongside maintenance work.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/openai.yaml`).

It sits in Development, covering Refactoring and Code simplification. The repository describes itself as: Claude Code, Droid, etc. Skills Ability.

When your agent uses it

  • Codex needs to clean unused exports
  • Duplicate code without risking regressions
  • Dead-code cleanup
  • Unused dependency audits

Example prompts

  • “/refactor-clean”

Requirements

  • Python 3
  • Node.js

Workflow steps

8 steps, taken from the first numbered list in SKILL.md.

  1. Establish a baseline.
  2. Detect dead code with language-appropriate tools.
  3. Categorize findings into SAFE, CAUTION, or DANGER.
  4. Remove one SAFE item at a time.
  5. Re-run verification after every deletion.
  6. Investigate CAUTION items before touching them.
  7. Skip DANGER items unless the user explicitly wants deeper investigation.
  8. Consolidate obvious duplicates only after dead-code cleanup is stable.

What it can do on your machine

Read from SKILL.md and the folder at commit cf41ea2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx
    • cargo

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Refactor Clean loads about 1.3k tokens when it runs. Until then it costs about 101 tokens; SKILL.md has 639 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~101
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

Without a licence we can't republish the file, so here is its outline and opening line. It has 639 words (~1,343 tokens).

“Use a conservative cleanup loop. Prefer keeping uncertain code over deleting something with hidden runtime or external consumers.”

— opening of SKILL.md by julianromli
name
refactor-clean

Read the full SKILL.md on GitHub

Files

SKILL.md and 1 other file in skills/refactor-clean of julianromli/ai-skills.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit cf41ea2

Compare with similar skills

Refactor Clean next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Refactor Clean compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Refactor Clean this skilljulianromli/ai-skills191—~1.3kAutomated safety check: PassNone
PonytailDavidObando/gsharp5658 repos~1.7kAutomated safety check: PassMIT
Ponytail Lazy Developer ModeDietrichGebert/ponytail158k—~871Automated safety check: PassMIT
Code Simplification for ego-litecitrolabs/ego-lite17k—~1.2kAutomated safety check: PassMIT
Refactor Pass for Simplicitystar-history/star-history9.6k1 repos~168Automated safety check: PassMIT
Over-Engineering ReviewDietrichGebert/ponytail158k—~1.3kAutomated safety check: PassMIT

Similar skills

  • Ponytail

    DavidObando/gsharp

    Forces the laziest solution that actually works, simplest, shortest, most minimal.

    565 GitHub starsUsed in 8 repos~1.7k tokens
    DevelopmentAuto-check passed
  • Ponytail Lazy Developer Mode

    DietrichGebert/ponytail

    Makes the agent pick the laziest solution that works: skip unneeded work, reuse what exists, prefer the standard library and platform features, and keep diffs small.

    158k GitHub stars~871 tokensUpdated today
    DevelopmentAuto-check passed
  • Finds and implements evidence-backed simplifications in the ego-lite repository, such as dead code, duplicated state and speculative abstractions, without hiding behavior changes.

    17k GitHub stars~1.2k tokensUpdated 15 days ago
    DevelopmentAuto-check passed
  • Refactor Pass for Simplicity

    star-history/star-history

    Perform a refactor pass focused on simplicity after recent changes. Use when the user asks for a refactor/cleanup pass, simplification, or dead-code removal…

    9.6k GitHub starsUsed in 1 repo~168 tokens
    DevelopmentAuto-check passed
  • Over-Engineering Review

    DietrichGebert/ponytail

    Reviews a diff only for unnecessary complexity and lists what to delete or shrink, one numbered line per finding with the location, the cut and its replacement.

    158k GitHub stars~1.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Reviews RTK's Rust code for over-engineering and verbose patterns, applying idioms like iterator chains and early returns while protecting a specific list of constraints from being simplified away.

    83k GitHub stars~1.1k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from julianromli/ai-skills

  • Landing Page Copywriter

    julianromli/ai-skills

    Write high-converting landing page copy using proven frameworks like PAS (Problem-Agitate-Solution), AIDA, and StoryBrand.

    191 GitHub starsUsed in 2 repos~1.4k tokens
    Auto-check passed
  • Hermes Wag Summarizer

    julianromli/ai-skills

    Plug & play skill untuk membuat cronjob summary grup WhatsApp secara otomatis menggunakan Hermes WhatsApp Bridge.

    191 GitHub stars~826 tokensUpdated 4 mo ago
    Auto-check passed
  • Clone Website

    julianromli/ai-skills

    Reverse-engineer and clone one or more websites in one shot — extracts assets, CSS, and content section-by-section and proactively dispatches parallel builder agents in worktrees as it goes.

    191 GitHub starsUsed in 2 repos~7.6k tokens
    Auto-check passed
  • Convex Best Practices

    julianromli/ai-skills

    Guidelines for building production-ready Convex apps covering function organization, query patterns, validation, TypeScript usage, error handling, and the Zen of Convex design philosophy

    191 GitHub stars~2.4k tokensUpdated 4 mo ago
    Auto-check passed

Categories

Questions about Refactor Clean

What does Refactor Clean do?

Safely identify and remove dead code with test verification at every step. Refactor Clean is an agent skill from julianromli/ai-skills. Safely identify and remove dead code with test verification at every step.

When should I use Refactor Clean?

Refactor Clean fits situations like: Codex needs to clean unused exports; duplicate code without risking regressions; dead-code cleanup; unused dependency audits.

How do I install Refactor Clean in Claude Code?

Run `npx skills add julianromli/ai-skills --skill refactor-clean -a claude-code`. Or copy the skill folder (skills/refactor-clean in julianromli/ai-skills) into .claude/skills/refactor-clean in your project. Claude Code loads it when a task matches its description.

How do I install Refactor Clean in Codex?

Run `npx skills add julianromli/ai-skills --skill refactor-clean -a codex`. Or copy the skill folder (skills/refactor-clean in julianromli/ai-skills) into .agents/skills/refactor-clean in your project. Codex loads it when a task matches its description.

Can I use Refactor Clean in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add julianromli/ai-skills --skill refactor-clean -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/refactor-clean, .gemini/skills/refactor-clean, .github/skills/refactor-clean and .opencode/skills/refactor-clean in your project.

What does Refactor Clean need to run?

Going by SKILL.md and its folder, Refactor Clean needs the command-line tools its instructions call (npx and cargo). Our summary lists: Python 3; Node.js.

Does Refactor Clean access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Refactor Clean safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Refactor Clean use?

No licence was found for Refactor Clean or its repository. Without one, default copyright applies: ask the author before reusing or redistributing it.

How many tokens does Refactor Clean use?

About 1.3k tokens (SKILL.md is roughly 5.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Refactor Clean?

Skills that share tags, products or a category with Refactor Clean: Ponytail (DavidObando/gsharp, 565 stars), Ponytail Lazy Developer Mode (DietrichGebert/ponytail, 158k stars), Code Simplification for ego-lite (citrolabs/ego-lite, 17k stars) and Refactor Pass for Simplicity (star-history/star-history, 9.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Refactor Clean?

julianromli (a GitHub user) maintains it in julianromli/ai-skills, which has 191 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on June 9, 2026.

Source: julianromli/ai-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.