refactor

refactor is a skill for Claude Code, Codex from atilladeniz/Kubeli. It costs 48 tokens per session (8,076 once invoked), scanned A, original, MIT.

A structured code-refactoring workflow based on design principles for reducing complexity while preserving behavior. It is tailored to Vite, React, TypeScript, Tauri, Rust, Zustand, Tailwind CSS, and kube-rs projects.

In plain words
What is it for?
Use it to review code design, prioritize refactoring work, and implement changes with safety checks.
Why use it?
It helps identify overly complex code and plan safer changes, including checking for tests before refactoring.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/atilladeniz/kubeli/refactor
Any agent
npx skills add atilladeniz/Kubeli --skill refactor
Clone the repo
git clone --depth 1 https://github.com/atilladeniz/Kubeli

Made for: Claude Code, Codex.

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/atilladeniz/kubeli/refactor.svg)](https://agentmods.dev/skills/atilladeniz/kubeli/refactor)
Your own site
<a href="https://agentmods.dev/skills/atilladeniz/kubeli/refactor"><img src="https://agentmods.dev/badge/skills/atilladeniz/kubeli/refactor.svg" alt="Measured on agentmods" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,076 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00048 $0.08076
Opus 5 $0.00024 $0.04038
Sonnet 5 $0.00010 $0.01615
Haiku 4.5 $0.00005 $0.00808

Measured 6d ago against content hash bcd41a19ae87, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, 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 6d 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.

.claude/skills/refactor/SKILL.md · 1,175 lines

How it starts

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

Strategic Refactoring Skill

You are a senior software architect performing strategic refactoring based on John Ousterhout's "A Philosophy of Software Design" principles.

Your Goal: Transform code to reduce complexity while maintaining functionality. Every change should make the system look like it was designed with this feature in mind from the start.

Kubeli Tech Stack

  • Frontend: Vite 7+, React 19, TypeScript
  • Desktop: Tauri 2.0 (Rust backend)
  • State: Zustand
  • Styling: Tailwind CSS
  • K8s Client: kube-rs (Rust)

Phase 1: Analysis (Use /software-design-review principles)

Before any refactoring, analyze the code against these 15 Ousterhout principles:

  1. Strategic vs. Tactical Programming
  2. Module Depth (Deep vs. Shallow)
  3. Somewhat General-Purpose (Generalization)
  4. Different Layers, Different Abstractions
  5. Information Hiding & Leaks
  6. Pull Complexity Downward
  7. Together or Separate?
  8. Define Errors Out of Existence
  9. Design Twice
  10. Consistency
  11. Code Should Be Obvious
  12. Comments & Documentation
  13. Names
  14. Write Comments First
  15. Modifying Existing Code

Phase 2: Safety Checklist

Before ANY refactoring:

  • Tests exist for the code being refactored
  • All tests pass currently
  • Code is committed (clean git state)
  • You understand what the code does (read it first!)

If tests don't exist:

  1. Write characterization tests first
  2. Test the component as a black box
  3. Validate end results, not implementation details

Phase 3: Clean Code Smells Checklist (Robert Martin)

In addition to Ousterhout's principles, check for these code smells:

Comments (C1-C5)

Code Smell Fix
C1 Ungeeignete Informationen (Change history, author info) Remove, use git
C2 Überholte Kommentare Update or delete
C3 Redundante Kommentare Delete if code is self-explanatory
C4 Schlecht geschriebene Kommentare Rewrite clearly
C5 Auskommentierter Code Delete (git has history)

Read the full file on GitHub · 1,175 lines

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. 6d ago First seen · 1,175 lines · 48 tokens per session scan A bcd41a19ae87

Subscribe to this mod's changes

refactor is a skill published in the GitHub repository atilladeniz/Kubeli (377 stars, last pushed 5d ago), licensed MIT. It adds 48 tokens to every session and 8,076 once invoked, about $0.0002 per session on Opus 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-08-30.