codebase-cleanup-refactor-clean

codebase-cleanup-refactor-clean is a skill for Claude Code from beel-collab/presets.dev. It costs 43 tokens per session (451 once invoked), scanned A, original, MIT.

A code-cleanup guide for restructuring existing code, reducing duplication, and applying established design practices such as SOLID. It also considers maintainability, performance, and regression risk.

In plain words
What is it for?
Use it to clean up large codebases, simplify modules, prepare for new features, and improve code quality without unnecessary redesign.
Why use it?
It helps address code that has become difficult to understand or safely change. The work is broken into smaller steps and checked with tests.

Skill for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Use it to clean up large codebases, simplify modules, prepare for new features, and improve code quality without unnecessary redesign.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/beel-collab/presets.dev/codebase-cleanup-refactor-clean
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 beel-collab/presets.dev --skill codebase-cleanup-refactor-clean
Clone the repo
git clone --depth 1 https://github.com/beel-collab/presets.dev

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 codebase-cleanup-refactor-clean

README.md
[![agentmods](https://agentmods.dev/badge/skills/beel-collab/presets.dev/codebase-cleanup-refactor-clean.svg)](https://agentmods.dev/skills/beel-collab/presets.dev/codebase-cleanup-refactor-clean)
Your own site
<a href="https://agentmods.dev/skills/beel-collab/presets.dev/codebase-cleanup-refactor-clean"><img src="https://agentmods.dev/badge/skills/beel-collab/presets.dev/codebase-cleanup-refactor-clean.svg" alt="Measured on agentmods" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 451 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.00043 $0.00451
Opus 5 $0.00022 $0.00226
Sonnet 5 $0.00009 $0.00090
Haiku 4.5 $0.00004 $0.00045

Measured 3d ago against content hash 01ffdee944c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

codebase-cleanup-refactor-clean 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 3d 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/development/codebase-cleanup-refactor-clean/SKILL.md · 61 lines

What it actually says

Refactor and Clean Code

You are a code refactoring expert specializing in clean code principles, SOLID design patterns, and modern software engineering best practices. Analyze and refactor the provided code to improve its quality, maintainability, and performance.

Use this skill when

  • Cleaning up large codebases with accumulated debt
  • Removing duplication and simplifying modules
  • Preparing a codebase for new feature work
  • Aligning implementation with clean code standards

Do not use this skill when

  • You only need a tiny targeted fix
  • Refactoring is blocked by policy or deadlines
  • The request is documentation-only

Context

The user needs help refactoring code to make it cleaner, more maintainable, and aligned with best practices. Focus on practical improvements that enhance code quality without over-engineering.

Requirements

$ARGUMENTS

Instructions

  • Identify high-impact refactor candidates and risks.
  • Break work into small, testable steps.
  • Apply changes with a focus on readability and stability.
  • Validate with tests and targeted regression checks.
  • If detailed patterns are required, open resources/implementation-playbook.md.

Safety

  • Avoid large rewrites without agreement on scope.
  • Keep changes reviewable and reversible.

Output Format

  • Cleanup plan with prioritized steps
  • Key refactor targets and rationale
  • Expected impact and risk notes
  • Test/verification plan

Resources

  • resources/implementation-playbook.md for detailed patterns and examples.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
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. 3d ago First seen · 61 lines · 43 tokens per session scan A 01ffdee944c2

Subscribe to this mod's changes

codebase-cleanup-refactor-clean is a skill published in the GitHub repository beel-collab/presets.dev (2 stars, last pushed 4mo ago), licensed MIT. It adds 43 tokens to every session and 451 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-09-03.

Related

Other skills, from other repositories

systematic-debugging

Applies a modified Fagan Inspection methodology to resolve persistent bugs and complex issues. Use when several fix or debugging attempts have already failed and a methodical root-cause analysis warranting a Fagan inspection is needed. For first-pass diagnosis of a reproducible bug or regression use…

sammcj/agentic-coding · 72 tokens

reframe-voice

Write, rewrite, or review content in the evidence-led reframe voice style. Use when the user explicitly asks to write in "reframe voice" or "reframe style". Do NOT use for general writing tasks.

sammcj/agentic-coding · 49 tokens

qa-to-issues

Interactive QA session where user reports bugs or issues conversationally, and the agent files GitHub issues. Use when user wants to report bugs in their own codebase and create Github issues conversationally.

sammcj/agentic-coding · 43 tokens

diagnose-hard-problem

Disciplined diagnosis loop for hard problems, diagnosing bugs and regressions. Reproduce → minimise → hypothesise → instrument → fix → regression-test.

sammcj/agentic-coding · 37 tokens

agents-sdk-typescript-debugging

Use when troubleshooting an agent built with the Microsoft Agents SDK (@microsoft/agents-hosting and related packages). Trigger on any of these symptoms: build or TypeScript errors, crashes on startup, 401 or auth errors on incoming requests, the bot not responding to messages, .env configuration problems, Azure AD…

microsoft/Agents · 125 tokens

agents-sdk-dotnet-debugging

Use when troubleshooting an agent built with the Microsoft Agents SDK (Microsoft.Agents.Hosting.AspNetCore and related packages) in C# / .NET. Trigger on any of these symptoms: build or C# compile errors, crashes on startup, 401 or auth errors on incoming requests, the bot not responding to messages, appsettings.json…

microsoft/Agents · 136 tokens