Agent skill

Refactorability

by meain in meain/dotfiles

Review code for refactorability — surface concrete, prioritized refactoring opportunities grounded in Martin Fowler's smell catalog and SOLID, augmented with static analysis tools (gocyclo…

MITAuto-check passedDevelopment

Install Refactorability

skills CLI
$ npx skills add meain/dotfiles --skill refactorability -a claude-code

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

GitHub CLI
$ gh skill install meain/dotfiles refactorability --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/meain/dotfiles.git skills-src && mkdir -p .claude/skills && cp -r skills-src/agents/.agents/skills/refactorability .claude/skills/refactorability && 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
refactorability
GitHub stars
285
Token cost
~2k tokens
SKILL.md length
831 words
Files
2 (incl. references)
Skills in repo
36
Repo updated
First seen
Licence
MIT

At a glance

Review code for refactorability — surface concrete, prioritized refactoring opportunities grounded in Martin Fowler's smell catalog and SOLID, augmented with static analysis tools (gocyclo…

  • Works in 6 steps: Pick the scope → Detect language and tools → Apply the lens → …
  • Tasks that involve Refactoring
  • SKILL.md covers Process, Output format, Guidelines and When to fail loudly, plus 1 more section
  • Calls git, gh and ruff

What it does

Refactorability is an agent skill from meain/dotfiles. Review code for refactorability — surface concrete, prioritized refactoring opportunities grounded in Martin Fowler's smell catalog and SOLID, augmented with static analysis tools (gocyclo, gocognit, dupl, etc.) when available. Go-first, polyglot-aware. Defaults to the current diff. Produces a High/Med/Low report with specific refactoring moves and a "Do NOT refactor" section to prevent over-eager suggestions. Triggers: /refactorability, "review for refactorability", "what should I refactor", "refactorability…

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/code-smells.md`).

It sits in Development, covering Refactoring, Code review and Static analysis and SAST. The repository describes itself as: If there is a shell, there is a way! The licence is MIT.

When your agent uses it

  • Tasks that involve Refactoring
  • Tasks that involve Code review
  • Tasks that involve Static analysis and SAST

Example prompts

  • “Do NOT refactor”
  • “review for refactorability”
  • “what should I refactor”
  • “/refactorability”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Pick the scope
  2. Detect language and tools
  3. Apply the lens
  4. Score severity
  5. Decide what NOT to refactor
  6. Write the report

What it can do on your machine

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

    • git
    • gh
    • ruff
    • tsc
    • semgrep

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

  • Network

    No URLs in SKILL.md. Its commands use git and gh, 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

Refactorability loads about 2k tokens when it runs, and up to ~4.5k if it reads all its reference files. Until then it costs about 158 tokens; SKILL.md has 831 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~158
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~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

The full file from meain/dotfiles at commit f469fb6, republished under its MIT licence (© meain). 831 words, ~1,994 tokens.

Download SKILL.mdSave it as .claude/skills/refactorability/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
refactorability
description
Review code for refactorability — surface concrete, prioritized refactoring opportunities grounded in Martin Fowler's smell catalog and SOLID, augmented with static analysis tools (gocyclo, gocognit, dupl, etc.) when available. Go-first, polyglot-aware. Defaults to the current diff. Produces a High/Med/Low report with specific refactoring moves and a "Do NOT refactor" section to prevent over-eager suggestions. Triggers: /refactorability, "review for refactorability", "what should I refactor", "refactorability review", "find refactoring opportunities", "is this refactorable", "review this code for refactoring"
metadata.author
meain
metadata.version
1.0.0

/refactorability — Refactorability Review

Surface concrete, prioritized refactoring opportunities in code. The goal is not generic "clean code" feedback — it is to point at specific smells, name the refactoring move that fixes them, and rank by impact so the user knows what to actually touch.

The review is opinionated about restraint: it must call out cases where refactoring would be premature, speculative, or net-negative.

Process

1. Pick the scope

In order of preference:

  1. Explicit target the user named (file, function, package).
  2. Current diff (default when no target given):
    • jj repo: jj diff --name-only -r @ (fallback to jj diff --name-only)
    • git repo: git diff --name-only HEAD (plus --cached if there's nothing unstaged)
    • PR context: gh pr diff if a PR is being reviewed
  3. Whole package/module only if the user explicitly asks for it.

Print the resolved scope before continuing so the user can correct it.

2. Detect language and tools

Look at file extensions in scope. For each language present, check which of the tools below are on PATH and run them only on files in scope (not the whole repo).

Go (primary)
ToolInvocation (per file or dir)What it gives you
gocyclogocyclo -over 15 <files>Cyclomatic complexity > 15
gocognitgocognit -over 15 <files>Cognitive complexity > 15
dupldupl -threshold 50 <dirs>Duplicated token sequences
reviverevive -formatter friendly <files>Style + some smell rules
golangci-lintgolangci-lint run --no-config --disable-all --enable=gocyclo,gocognit,dupl,gocritic,revive <pkg>Aggregated, if standalone tools are missing

Also do a quick grep/AST scan for: functions > ~80 lines, > 5 params, deep nesting (> 3 levels), interface{}/any over-use, and large switch/if ladders on type.

Python

ruff check, radon cc -s -a <files>, radon mi <files>, vulture <files>, pylint --disable=all --enable=R <files> for refactor-class warnings.

JS/TS

eslint with eslint-plugin-sonarjs if configured, jscpd <dirs> for duplication, tsc --noEmit for type smells.

Polyglot fallback

semgrep --config=p/code-smells if installed; otherwise lean on LLM reading.

If no tools are available, proceed with LLM-only reading and say so in the report (so the user knows the quantitative pass was skipped).

3. Apply the lens

Read the code in scope and map findings to the Fowler smell catalog + SOLID. Use references/code-smells.md as the authoritative list. Do not invent smell names — pick from the catalog. For each finding, pick a concrete refactoring move from the same catalog (e.g. "Extract Method", "Replace Conditional with Polymorphism", "Introduce Parameter Object").

4. Score severity

Assign each finding a severity:

  • High — actively blocks change/test/understand. Examples: function with cyclomatic > 20 in a hot path, duplicated business logic across files, god-object that everything imports, shotgun-surgery pattern around a single concept.
  • Medium — measurable maintenance tax but localized. Examples: long parameter list on a helper, feature envy across two files, modest duplication.
  • Low — taste / future-proofing. Examples: primitive obsession on one type, slightly long method, comments hiding an obvious extract.

If a finding could be either, prefer the lower severity. The bar for High is "the next person changing this will get hurt."

Show full SKILL.md (346 more words)Show less
5. Decide what NOT to refactor

Before writing the report, explicitly identify code that could look refactorable but should be left alone for this review. Put these in a dedicated section (see below). Common cases:

  • Working, stable code with no upcoming change — refactoring is pure risk.
  • Code that's verbose because of a clear API contract (e.g. protobuf gen, handler boilerplate).
  • A single duplication (rule of three not met).
  • Abstraction that would only have one caller.
  • Tests — they're allowed to be repetitive and explicit.
  • Generated code.
6. Write the report

Use the output format below. Keep it terse and scannable — bullets, tables, file:line references. No motivational filler.

Output format

markdown
# Refactorability Review

**Scope:** <files / diff / package being reviewed>
**Tools run:** gocyclo, gocognit, dupl  (or: "none — LLM-only pass")
**Overall:** <one sentence. e.g. "Two High-severity hotspots in user-management/handlers,
the rest is healthy.">

## High

### 1. <Smell name from catalog> — `path/to/file.go:123`
- **What:** <1 sentence describing the smell concretely>
- **Signal:** <metric or quote, e.g. "gocyclo=24, 142 LOC, 6 params">
- **Why it matters:** <1–2 sentences on change/test/understand cost>
- **Move:** <Refactoring name from catalog> — <1–2 sentence sketch>
- **Effort / Risk:** S/M/L — <1 short note on risk>

### 2. ...

## Medium

### 1. ...

## Low

### 1. ...

## Do NOT refactor

- `path/to/file.go:45` — Looks like primitive obsession, but it's a single call site behind
  a stable API. Wait until a second caller appears.
- `path/to/gen_pb.go` — Generated.
- ...

## Notes (optional)
Anything the user should know but isn't a finding (e.g. "gocognit not installed, skipped
cognitive complexity pass").

Guidelines

  • Cite the catalog. Every finding's smell name and refactoring move must come from references/code-smells.md. If you want to flag something not in the catalog, call it a "Note" instead of a finding.
  • Always include file:line. No "in some handler somewhere".
  • Quote a signal. A metric (gocyclo=24), a count (6 parameters), or 2–4 lines of code. Without a signal it's just opinion.
  • One paragraph per finding, max. This is a triage tool, not a design doc.
  • Resist these temptations:
    • Style / naming nits (use a linter for those)
    • "Add tests" — that's a separate review
    • Rewrites — only suggest local refactoring moves
    • "Use design pattern X" without a smell to justify it
    • Speculative generality ("what if we need to swap the DB later?")
    • Performance — separate review unless the smell causes the perf issue
  • High-severity ceiling. Aim for ≤ 3 High findings per review. If everything is High, nothing is.
  • Honor existing project conventions. If the codebase is consistently structured a certain way (e.g. Veeam VDC handlers), don't flag conformance to that style as a smell.

When to fail loudly

  • If the scope is empty (no diff, no target), ask the user what to review.
  • If the user asks to review > ~50 files in one go, push back and propose narrowing.
  • If running a tool errors out (e.g. gocyclo not installed), note it in "Notes" — do not silently skip.

Reference

© meain, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in agents/.agents/skills/refactorability of meain/dotfiles.

  • SKILL.md
  • references/code-smells.md

Open the folder on GitHubat commit f469fb6

Compare with similar skills

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

Refactorability compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Refactorability this skillmeain/dotfiles285—~2kAutomated safety check: PassMIT
ast-grep Structural Searchcode-yeongyu/oh-my-openagent70k—~3.3kAutomated safety check: PassMIT
Dignified Python Standardsdocling-project/docling68k—~1.5kAutomated safety check: PassApache-2.0
Clean Code GuardamElnagdy/guard-skills1.3k2 repos~4.3kAutomated safety check: PassMIT
Maintainable Code for iPolloWorkDevin-AXIS/iPolloWork6.7k—~2.7kAutomated safety check: PassCustom licence
Cyclomatic Complexitysaurabhkumar8112/cyclomatic-complexity-skill405—~761Automated safety check: PassApache-2.0

Similar skills

  • ast-grep Structural Search

    code-yeongyu/oh-my-openagent

    Searches and rewrites code by syntax-tree shape across 25 languages with ast-grep, for codemods, structural queries and YAML lint rules, using a Python wrapper script.

    70k GitHub stars~3.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Dignified Python Standards

    docling-project/docling

    Applies opinionated production Python conventions chosen by the project's Python version: modern type syntax, pathlib, explicit checks and interface guidance.

    68k GitHub stars~1.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Clean Code Guard

    amElnagdy/guard-skills

    Reviews generated or changed production code against Clean Code, SOLID, DRY, KISS, YAGNI and LLM-specific failure modes before it ships, in any language.

    1.3k GitHub starsUsed in 2 repos~4.3k tokens
    DevelopmentAuto-check passed
  • A code-change gate for the iPolloWork repository: search and reuse first, keep one source of truth, justify every new file or dependency, and audit the change.

    6.7k GitHub stars~2.7k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Cyclomatic Complexity

    saurabhkumar8112/cyclomatic-complexity-skill

    Refactor code to reduce cyclomatic complexity so it stays readable, maintainable, and aligned with the long-term vision of the codebase, not just optimized for AI comprehension.

    405 GitHub stars~761 tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Code Review Graph Navigator

    handsontable/handsontable

    Queries a pre-built, Tree-sitter-based code graph of the whole monorepo instead of grepping call chains, for exploring, debugging, refactoring or reviewing code.

    22k GitHub stars~939 tokensUpdated today
    DevelopmentAuto-check passed

More from meain/dotfiles

All 36 skills in this repo
  • Recall

    meain/dotfiles

    Search past Claude Code and Codex sessions. An agent skill from meain/dotfiles.

    285 GitHub starsUsed in 1 repo~684 tokens
    Auto-check passed
  • Grill With Docs

    meain/dotfiles

    Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise.

    285 GitHub starsUsed in 21 repos~875 tokens
    Auto-check passed
  • Backlog

    meain/dotfiles

    Daily backlog management — full planning review OR add a single entry from a URL.

    285 GitHub stars~3k tokensUpdated 1 mo ago
    Auto-check passed
  • Concern Review

    meain/dotfiles

    Generate an interactive local HTML review page for a large PR or diff, grouping the changed files by logical concern (not just by file) so a reviewer can go through one theme at a time instead of a…

    285 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed
  • My Weekly Report

    meain/dotfiles

    Generate a concise weekly status update in team format. An agent skill from meain/dotfiles.

    285 GitHub stars~2.5k tokensUpdated 1 mo ago
    Auto-check passed
  • Web Search

    meain/dotfiles

    Search the web using lynx and DuckDuckGo. An agent skill from meain/dotfiles.

    285 GitHub stars~830 tokensUpdated 1 mo ago
    Auto-check passed

Categories

Questions about Refactorability

What does Refactorability do?

Review code for refactorability — surface concrete, prioritized refactoring opportunities grounded in Martin Fowler's smell catalog and SOLID, augmented with static analysis tools (gocyclo…. Refactorability is an agent skill from meain/dotfiles.) when available.

When should I use Refactorability?

Refactorability fits situations like: tasks that involve Refactoring; tasks that involve Code review; tasks that involve Static analysis and SAST.

How do I install Refactorability in Claude Code?

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

How do I install Refactorability in Codex?

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

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

What does Refactorability need to run?

Going by SKILL.md and its folder, Refactorability needs the command-line tools its instructions call (git, gh, ruff, tsc and semgrep). Our summary lists: Python 3.

Does Refactorability access the network?

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

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

Refactorability is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Refactorability use?

About 2k tokens (SKILL.md is roughly 8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.5k tokens, read only when the agent opens those files.

What are the alternatives to Refactorability?

Skills that share tags, products or a category with Refactorability: ast-grep Structural Search (code-yeongyu/oh-my-openagent, 70k stars), Dignified Python Standards (docling-project/docling, 68k stars), Clean Code Guard (amElnagdy/guard-skills, 1.3k stars) and Maintainable Code for iPolloWork (Devin-AXIS/iPolloWork, 6.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Refactorability?

meain (a GitHub user) maintains it in meain/dotfiles, which has 285 GitHub stars. The repository holds 36 skills in this directory. The repository was last updated on September 5, 2026.

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