Agent skill

Refactoring

by EpicenterHQ in EpicenterHQ/epicenter

Apply caller-aware, behavior-preserving code simplifications such as inlining, branch collapse, and typed access boundaries.

Custom licenceAuto-check passedDevelopment

Install Refactoring

skills CLI
$ npx skills add EpicenterHQ/epicenter --skill refactoring -a claude-code

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

GitHub CLI
$ gh skill install EpicenterHQ/epicenter refactoring --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/EpicenterHQ/epicenter.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/refactoring .claude/skills/refactoring && 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
refactoring
GitHub stars
4.8k
Token cost
~4.5k tokens
SKILL.md length
925 words
Files
1
Skills in repo
65
Repo updated
First seen
Licence
Custom licence

At a glance

Apply caller-aware, behavior-preserving code simplifications such as inlining, branch collapse, and typed access boundaries.

  • Works in 4 steps: Inverted pyramid. Lead with the exported… → Related concepts over monoliths. Break a… → Combine overlapping concepts. If two… → …
  • Cleaning up code
  • SKILL.md covers The Audit: Count Callers First, Type Safety Boundaries, Collapsing Duplicate Branches and Prefer Inline for Trivial…, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Refactoring is an agent skill from EpicenterHQ/epicenter. Apply caller-aware, behavior-preserving code simplifications such as inlining, branch collapse, and typed access boundaries. Use when cleaning up code or planning focused refactor commits.

Its SKILL.md is about 4.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Refactoring and Code simplification. The repository describes itself as: Open-source, local-first apps.

When your agent uses it

  • Cleaning up code
  • Planning focused refactor commits

Example prompts

  • “/refactoring”

Workflow steps

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

  1. Inverted pyramid. Lead with the exported or significant functions and push helpers below them. Don't bury the lead.
  2. Related concepts over monoliths. Break a large file into modules that each own one concept.
  3. Combine overlapping concepts. If two types, functions, or constants overlap significantly, merge them. The fewer distinct concepts a…
  4. Use shared code. A common utility (file path parsing, say) may already exist. Check for it before writing the same thing inline.

What it can do on your machine

Read from SKILL.md and the folder at commit 9cc65c3. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript and svelte).

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

  • Network

    No URLs in SKILL.md.

    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

Refactoring loads about 4.5k tokens when it runs. Until then it costs about 50 tokens; SKILL.md has 925 words of instructions outside code blocks.

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

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

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 925 words (~4,514 tokens).

“Systematic approach to auditing and improving code. Every change is evidence-based: count callers, show diffs, commit surgically.”

— opening of SKILL.md by EpicenterHQ, Custom licence
name
refactoring
metadata.author
epicenter
metadata.version
1.0

Read the full SKILL.md on GitHub

Files

Just SKILL.md in .agents/skills/refactoring of EpicenterHQ/epicenter.

Open the folder on GitHubat commit 9cc65c3

Compare with similar skills

Refactoring 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.

Refactoring compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Refactoring this skillEpicenterHQ/epicenter4.8k—~4.5kAutomated safety check: PassCustom licence
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 today
    DevelopmentAuto-check passed

More from EpicenterHQ/epicenter

All 65 skills in this repo
  • Agent Instructions

    EpicenterHQ/epicenter

    Write and maintain repository guidance across AGENTS.md, CLAUDE.md, and .agents/skills.

    4.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Consult Claude

    EpicenterHQ/epicenter

    Assign Claude Code a read-only investigation, recommendation, or finished text draft.

    4.8k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Better Auth security hardening: rate limits, secrets, CSRF, trusted origins, cookies, sessions, OAuth tokens, and audit logging.

    4.8k GitHub stars~896 tokensUpdated today
    Auto-check passed
  • Cohesion Over Testability

    EpicenterHQ/epicenter

    Collapse test-shaped production boundaries while preserving behavior and coverage.

    4.8k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Collapse Pass

    EpicenterHQ/epicenter

    Remove indirection that does not earn its boundary across a diff or package.

    4.8k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Error Handling

    EpicenterHQ/epicenter

    Apply Wellcrafted Result patterns to fallible operations and preserve failures at boundaries.

    4.8k GitHub stars~1.4k tokensUpdated today
    Auto-check passed

Categories

Questions about Refactoring

What does Refactoring do?

Apply caller-aware, behavior-preserving code simplifications such as inlining, branch collapse, and typed access boundaries. Refactoring is an agent skill from EpicenterHQ/epicenter. Apply caller-aware, behavior-preserving code simplifications such as inlining, branch collapse, and typed access boundaries.

When should I use Refactoring?

Refactoring fits situations like: cleaning up code; planning focused refactor commits.

How do I install Refactoring in Claude Code?

Run `npx skills add EpicenterHQ/epicenter --skill refactoring -a claude-code`. Or copy the skill folder (.agents/skills/refactoring in EpicenterHQ/epicenter) into .claude/skills/refactoring in your project. Claude Code loads it when a task matches its description.

How do I install Refactoring in Codex?

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

Can I use Refactoring 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 EpicenterHQ/epicenter --skill refactoring -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/refactoring, .gemini/skills/refactoring, .github/skills/refactoring and .opencode/skills/refactoring in your project.

What does Refactoring need to run?

SKILL.md names no scripts, command-line tools or credentials: Refactoring is instructions for the agent only.

Does Refactoring access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Refactoring 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 Refactoring use?

Refactoring has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does Refactoring use?

About 4.5k tokens (SKILL.md is roughly 18k 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 Refactoring?

Skills that share tags, products or a category with Refactoring: 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 Refactoring?

EpicenterHQ (a GitHub organization) maintains it in EpicenterHQ/epicenter, which has 4,819 GitHub stars. The repository holds 65 skills in this directory. The repository was last updated on October 8, 2026.

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