codebase-cleanup-refactor-clean

codebase-cleanup-refactor-clean is a skill for Claude Code from ratnesh-maurya/cursor-claude-personas. It costs 44 tokens per session (372 once invoked), scanned A, a copy of codebase-cleanup-refactor-clean, MIT.

A refactoring workflow for improving code structure, readability, duplication, maintainability, and performance while preserving stable behaviour.

In plain words
What is it for?
Use it to simplify modules, remove duplication, apply clean-code practices, and make small testable improvements.
Why use it?
It helps reduce accumulated code debt and makes future feature work safer and easier to understand.

Skill for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Use it to simplify modules, remove duplication, apply clean-code practices, and make small testable improvements.

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

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/ratnesh-maurya/cursor-claude-personas/codebase-cleanup-refactor-clean/github.svg)](https://agentmods.dev/skills/ratnesh-maurya/cursor-claude-personas/codebase-cleanup-refactor-clean)
Your own site
<a href="https://agentmods.dev/skills/ratnesh-maurya/cursor-claude-personas/codebase-cleanup-refactor-clean"><img src="https://agentmods.dev/badge/skills/ratnesh-maurya/cursor-claude-personas/codebase-cleanup-refactor-clean/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 codebase-cleanup-refactor-clean

Your own site · 80×15
<a href="https://agentmods.dev/skills/ratnesh-maurya/cursor-claude-personas/codebase-cleanup-refactor-clean"><img src="https://agentmods.dev/badge/skills/ratnesh-maurya/cursor-claude-personas/codebase-cleanup-refactor-clean.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 372 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 92% copy Near-identical to another mod 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.00044 $0.00372
Opus 5 $0.00022 $0.00186
Sonnet 5 $0.00009 $0.00074
Haiku 4.5 $0.00004 $0.00037

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

Origin

This is a copy

92% identical to codebase-cleanup-refactor-clean — 5 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/skills/codebase-cleanup-refactor-clean/SKILL.md · 55 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.
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. 10d ago First seen · 55 lines · 44 tokens per session scan A 612ba56b8f33

Subscribe to this mod's changes

codebase-cleanup-refactor-clean is a skill published in the GitHub repository ratnesh-maurya/cursor-claude-personas (8 stars, last pushed 5mo ago), licensed MIT. It adds 44 tokens to every session and 372 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 92% identical to codebase-cleanup-refactor-clean, differing in 5 lines, and is treated as a copy.