
codebase-cleanup-refactor-clean
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.
- Installs
- 944
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/sickn33/agentic-awesome-skills --skill codebase-cleanup-refactor-clean- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads codebase-cleanup-refactor-clean automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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.mdfor 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.
Behavior preservation and evidence
The numeric smell/coverage/ROI thresholds are heuristics, not universal quality gates or measured benefits. Preserve public behavior, duplicate ordering, transactions, side-effect timing, errors and compatibility unless a change is explicitly intended. Characterize meaningful invariants before a risky refactor; do not mechanically split functions to meet line/parameter limits.
Examples are incomplete independent fragments, not a compiled project: repository find_by_id, framework helpers, discount implementation, EmailService and Logger are missing. Persistence plus email needs an idempotent/outbox strategy because a failed notification after commit must not repeat the order. Validate authorization and server-trusted prices before processing money. Email regex checks shape, not deliverability/ownership; caches need tenant keys, invalidation and sensitive-data policy.
Static-analysis snippets are leads: generic execute($QUERY) is not proof of SQL injection, and CodeQL analyze alone is not a full initialized/extracted workflow. Inspect actual tool versions/configuration before running; preserve existing gates and do not replace tests with an AI pass. Report only measured before/after metrics and actual dashboard URLs; no coverage, security absence or performance improvement is certified by these sketches. No code from the playbook was executed.
FAQ
What does the codebase-cleanup-refactor-clean skill do?
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.
How do I install codebase-cleanup-refactor-clean?
Run npx skills add https://github.com/sickn33/agentic-awesome-skills --skill codebase-cleanup-refactor-clean in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/codebase-cleanup-refactor-clean/ (personal) or .claude/skills/codebase-cleanup-refactor-clean/ (project).
Which AI agents can use codebase-cleanup-refactor-clean?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is codebase-cleanup-refactor-clean safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains codebase-cleanup-refactor-clean?
It is published by sickn33 in sickn33/agentic-awesome-skills. It has 944 recorded installs.
More from sickn33/agentic-awesome-skills
docker-expert
sickn33/agentic-awesome-skills
You are an advanced Docker containerization expert with comprehensive, practical knowledge of container optimization, security hardening, multi-stage builds, orchestration patterns, and production deployment strategies based on current industry best practices.
nodejs-best-practices
sickn33/agentic-awesome-skills
Node.js development principles and decision-making. Framework selection, async patterns, security, and architecture. Teaches thinking, not copying.
typescript-expert
sickn33/agentic-awesome-skills
TypeScript and JavaScript expert with deep knowledge of type-level programming, performance optimization, monorepo management, migration strategies, and modern tooling.
clean-code
sickn33/agentic-awesome-skills
This skill embodies the principles of "Clean Code" by Robert C. Martin (Uncle Bob). Use it to transform "code that works" into "code that is clean."
api-security-best-practices
sickn33/agentic-awesome-skills
Implement secure API design patterns including authentication, authorization, input validation, rate limiting, and protection against common API vulnerabilities
nextjs-best-practices
sickn33/agentic-awesome-skills
Next.js App Router principles. Server Components, data fetching, routing patterns.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.