refactor

refactor is a skill for Claude Code from LucasSantana-Dev/sharekit. It costs 107 tokens per session (1,571 once invoked), scanned A, original, MIT.

A focused code-structure cleanup that aims to make existing code easier to maintain while keeping its behavior unchanged. It first examines the target and nearby files before suggesting edits.

In plain words
What is it for?
It helps split up oversized functions, simplify nested logic, remove duplication, and align code with the project's existing style and tests.
Why use it?
It reduces complexity and code smells without intentionally changing what the software does.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit It helps split up oversized functions, simplify nested logic, remove duplication, and align code with the project's existing style and tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lucassantana-dev/sharekit/refactor
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add LucasSantana-Dev/sharekit --skill refactor
Clone the repo
git clone --depth 1 https://github.com/LucasSantana-Dev/sharekit

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for refactor

README.md
[![agentmods](https://agentmods.dev/badge/skills/lucassantana-dev/sharekit/refactor/github.svg)](https://agentmods.dev/skills/lucassantana-dev/sharekit/refactor)
Your own site
<a href="https://agentmods.dev/skills/lucassantana-dev/sharekit/refactor"><img src="https://agentmods.dev/badge/skills/lucassantana-dev/sharekit/refactor/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for refactor

Your own site · 80×15
<a href="https://agentmods.dev/skills/lucassantana-dev/sharekit/refactor"><img src="https://agentmods.dev/badge/skills/lucassantana-dev/sharekit/refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 107 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,571 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00107 $0.01571
Opus 5.5 $0.00043 $0.00628
Sonnet 5.5 $0.00021 $0.00314
Haiku 4.5 $0.00011 $0.00157

Measured 1mo ago against content hash 2524b4f37888, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

refactor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

sharekit-profile/.claude/skills/refactor/SKILL.md · 147 lines

How it starts

The opening of the file, as written. The whole thing — 147 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Refactor

Improve code structure and readability without changing external behavior. Behavior is sacred; structure is up for negotiation.

Core Principle

Discover before you fix. It's tempting to jump straight into the most obvious problem, but surveying the whole file first gives a better picture of what's worth fixing and in what order. It also surfaces smell dependencies (fixing X may make Y irrelevant). Never start editing until you've cataloged.

Phase 0 — Discover

Read the target file(s). Note language. Scan for every smell present.

Language detection: Adapt patterns and tool suggestions to the actual language:

Language Smell finders Refactor tools
TS / JS ESLint, ts-prune, unimported ts-morph, jscodeshift, ast-grep
Python pylint, ruff, vulture rope, pyupgrade, ruff --fix
Go staticcheck, golangci-lint gorename, gopls
Rust clippy cargo fix

Also read 2–3 similar files in the project before proposing changes. Refactoring should feel native to the codebase — matching its naming conventions, its error-handling style, its test structure. A brilliant refactor that looks foreign is still a bad refactor.

Catalog your findings:

Smells found in auth.ts:
  [HIGH]  Nested conditionals — handleAuth() has 8 levels of nesting; every error path buried inside
  [HIGH]  Long method — 120 lines doing token parse, DB lookup, audit log, and response all in one
  [MED]   Magic numbers — status === 2 and status === 1 appear without named constants
  [LOW]   Feature envy — Order.calculateDiscount() reads deep into User internals

Surface the catalog in this format — include all four parts:

Smells found in <filename>:
  [HIGH] ...
  [MED]  ...
  [LOW]  ...

Tool that catches this automatically: <name> (e.g. ESLint no-unused-vars, pylint, ruff, ts-prune)

Behavior guarantee: All changes will preserve external behavior — same inputs, same outputs, same side effects.

Scope: I'll fix [highest-priority smell / the one you mentioned]. Which smells should I address this session?

Read the full file on GitHub · 147 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 147 lines · 107 tokens per session scan A 2524b4f37888

Subscribe to this mod's changes

refactor is a skill published in the GitHub repository LucasSantana-Dev/sharekit (1 stars, last pushed 3d ago), licensed MIT. It adds 107 tokens to every session and 1,571 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

find-simplifications

Use for a periodic repo-wide sweep of qwen-code for accumulated excess surface — dead components and files, orphaned locale keys, exports nothing consumes, added-then-removed scaffolding — filing candidates on a tracking issue and landing only what a maintainer has said yes to. Repo-wide and evidence-first; every…

QwenLM/qwen-code · 103 tokens

swarm-pr-review

Run a graph-guided, tool-augmented PR review using context packing, parallel exploration, mandatory repository-agnostic risk-family coverage with dispatch scaled to diff size and risk, independent reviewer validation, critic challenge, and metrics writeback. Use for deep pull request review with low false-positive…

ZaxbyHub/opencode-swarm · 91 tokens

code-review

You are a senior code reviewer. You receive diffs via stdin.

jrswab/axe · 0 tokens

include-test-files-that-assert-on-behavior-being-changed-in-decl

When delegating a task affected by this skill, include.

ZaxbyHub/opencode-swarm · 29 tokens

review

Adversarial review of an increment before it ships, by a fresh context or another model family; every finding cites path:line and is re-verified. Use for "review", "qa", "critique this".

anton-abyzov/specweave · 45 tokens

tech-debt-ci-review

Codex adapter for deep technical-debt and CI-stability audits. Use when asked to find test theater, flaky tests, missing or mis-scoped tests, brittle CI/toolchain behavior, structural debt blocking green PRs, or a remediation order for opencode-swarm.

ZaxbyHub/opencode-swarm · 61 tokens