- Home
- Skills
- Code Quality & Review
- cleanup mode
Works with the AI Agents you already use
cleanup mode
Aggressively prune dead code, consolidate duplicates, and optimize React/TS performance without changing logic.
$10
cleanup mode
Example session with this skill installed
Run cleanup-mode on the current repository. Focus on removing dead code and consolidating the duplicate fetch wrappers in /src/api.
- Read your context and instructions
- Compiled the cleanup mode
- Generated the document
I have completed the optimization pass. I removed 14 unused files, consolidated 3 redundant API wrappers into a single utility, and eliminated 42 unused TypeScript interfaces.
Optimization Report
| Category | Items Removed/Modified | Estimated Impact |
|---|---|---|
| Dead Code | 14 files, 22 exports, 8 hooks | -1,240 lines of code |
| Duplication | 3 API fetchers merged into apiClient.ts | Lower maintenance surface |
| React | 5 unnecessary useEffect calls removed | ~15% fewer re-renders in /src/api |
| TypeScript | 42 unused types, 12 duplicate interfaces | Faster type-checking |
| Bundle Size | 2 unused icon libraries removed | -185kb (gzipped) |
Significant Improvements
API Consolidation: Merged getUserData, fetchProfile, and accountService into a unified useApi hook, reducing boilerplate by 60% in the data layer.
2.
State Pruning: Removed redundant state in DashboardLayout.tsx that was being synchronized via an effect; replaced with derived props.
3. Asset Cleanup: Identified and deleted 6 unused SVG assets and their corresponding React wrappers.
Next steps
- Run
npm testto verify the consolidated API client handles all edge cases. - Execute
npm run buildto confirm the final bundle size reduction. - Review the changes in
src/api/apiClient.tsto ensure the new abstraction meets team standards.
DashboardLayout.tsx
PDF · document
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Bloated codebases slow down builds, inflate bundle sizes, and increase cognitive load for every developer on the team. This skill executes an aggressive cleanup to remove dead code, consolidate duplicates, and streamline React and TypeScript architectures without altering user-facing behavior.
What it does
- Dead code elimination deletes unused imports, exports, files, components, and hooks across the entire project.
- Duplicate consolidation identifies repeated logic in API clients, validation, and utilities to extract lean abstractions.
- React optimization removes unnecessary state, effects, and redundant renders to improve component performance.
- TypeScript refinement merges duplicate interfaces and types while removing redundant casts and generics.
- Runtime & memory tuning eliminates nested loops, unnecessary object spreads, and redundant allocations.
How it works
- Discovery scans the project for orphaned files and unreachable code paths.
- Analysis evaluates React components and TypeScript definitions for over-abstraction or redundancy.
- Execution performs safe deletions and refactors following a strict priority list starting with dead code.
- Reporting generates a detailed breakdown of removed lines, consolidated modules, and estimated performance gains.
Frameworks & tools
Works with React, TypeScript, and modern JavaScript environments. Optimized for projects using standard build tools, CSS-in-JS, or Tailwind, and standard state management patterns.
Why this beats prompting it yourself
Generic prompts often miss deeply nested unused exports or over-abstracted React patterns. This skill follows a rigorous multi-stage hierarchy—from dead code to memory optimization—ensuring no stone is left unturned while strictly preserving functional parity.
Use cases
- Pruning a legacy codebase before a major feature migration.
- Reducing bundle sizes for performance-critical web applications.
- Simplifying a TypeScript architecture that has become overly complex.
- Cleaning up after a large-scale refactor to remove leftover artifacts.
Known limitations
Does not modify business logic, API contracts, or database schemas. Performance improvements are estimates and should be verified with local profiling tools.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Code Quality & Review.
Functionality preservation is paramount; it will not touch business logic or API contracts. Performance gains are estimated. Requires an existing test suite to verify no regressions.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 27 days ago
Permissions
No special permissions declared or detected