This skill should be used when the user asks about "code cleanup", "remove unused", "dead code", "unused imports", "dependency audit", "technical debt", "refactoring", "codebase maintenance", "orphaned files", "unused assets", or wants guidance on identifying and removing unused code, imports, dependencies, or assets.
/plugin marketplace add Linaqruf/cc-plugins/plugin install codebase-cleanup@cc-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
examples/cleanup-examples.mdreferences/asset-patterns.mdreferences/dead-code-patterns.mdreferences/dependency-patterns.mdreferences/import-patterns.mdComprehensive patterns and strategies for cleaning up TypeScript/JavaScript codebases. This skill provides guidance on identifying unused code, assets, and dependencies to reduce technical debt and improve maintainability.
| Task | Command | Agent |
|---|---|---|
| Find unused imports | /cleanup imports | import-analyzer |
| Find dead code | /cleanup deadcode | dead-code-detector |
| Find unused assets | /cleanup assets | asset-tracker |
| Audit dependencies | /cleanup deps | dependency-auditor |
| Clean configs | /cleanup configs | config-cleaner |
| Full analysis | /cleanup all | All agents |
| Tool | Purpose | Install |
|---|---|---|
| TypeScript | Unused locals/params | Built-in with tsc |
| ESLint | Unused vars, unreachable code | npm install eslint |
| depcheck | Unused npm packages | npm install -g depcheck |
| madge | Circular dependencies | npm install -g madge |
| ts-prune | Unused exports | npx ts-prune |
# TypeScript compiler check
npx tsc --noEmit --noUnusedLocals
# ESLint with unused-imports plugin
npx eslint . --rule 'no-unused-vars: error'
# Circular dependency detection
npx madge --circular --extensions ts,tsx src/
// Before: Multiple unused imports
import { useState, useEffect, useCallback, useMemo } from 'react';
import lodash from 'lodash';
// After: Only used imports remain
import { useState, useCallback } from 'react';
See references/import-patterns.md for detailed patterns.
# TypeScript checks
npx tsc --noEmit --noUnusedLocals --noUnusedParameters
# Find unused exports
npx ts-prune
# ESLint rules
npx eslint . --rule 'no-unreachable: error'
| Level | Criteria | Action |
|---|---|---|
| High | Zero references, private scope | Safe to remove |
| Medium | Only test references | Verify with user |
| Low | Dynamic usage patterns | Manual review required |
See references/dead-code-patterns.md for detailed patterns.
| Type | Extensions | Common Locations |
|---|---|---|
| Images | png, jpg, svg, webp, gif | public/, src/assets/ |
| Styles | css, scss, sass, less | src/styles/, public/ |
| Fonts | woff, woff2, ttf, otf | public/fonts/ |
| Data | json, yaml | src/data/, public/ |
// Direct imports
import logo from './logo.png';
// HTML/JSX references
<img src="/images/hero.png" />
// CSS references
background-image: url('/images/bg.jpg');
// Dynamic (flag for review)
const img = require(`./images/${name}.png`);
See references/asset-patterns.md for detailed patterns.
# Find unused packages
npx depcheck
# Security audit
npm audit
# Check outdated
npm outdated
# Package size analysis
npx package-size lodash moment axios
| Category | Packages (pick one) |
|---|---|
| Dates | moment, dayjs, date-fns |
| HTTP | axios, node-fetch, got, ky |
| Utilities | lodash, ramda, underscore |
| UUID | uuid, nanoid, cuid |
| Schema | zod, yup, joi |
See references/dependency-patterns.md for detailed patterns.
| File | Check If |
|---|---|
| .babelrc | Babel in dependencies |
| tslint.json | TSLint deprecated, use ESLint |
| .travis.yml | Still using Travis CI |
| webpack.config.js | Using Vite/Next.js instead |
obj[methodName]() patterns@generated comments// Looks unused but called dynamically
export function helper_a() { }
export function helper_b() { }
const fn = helpers[`helper_${type}`];
// Framework-managed lifecycle
@Component({})
class MyComponent {
ngOnInit() { } // Called by Angular
}
// Re-exports for public API
export { Button } from './Button'; // Used by consumers
The /cleanup command generates reports in this format:
# Codebase Cleanup Report
## Summary
| Category | Issues | Est. Savings |
|----------|--------|--------------|
| Unused Imports | 23 | - |
| Dead Code | 15 | ~500 LOC |
| Unused Assets | 12 | 2.3 MB |
| Unused Dependencies | 5 | 4.1 MB |
## High Priority (Safe to Remove)
[Detailed findings with file paths and line numbers]
## Medium Priority (Review Required)
[Findings that need verification]
## Low Priority (Manual Review)
[Potential issues with dynamic patterns]
references/import-patterns.md - Import analysis patternsreferences/dead-code-patterns.md - Dead code detection strategiesreferences/asset-patterns.md - Asset tracking methodologyreferences/dependency-patterns.md - Dependency audit proceduresexamples/cleanup-examples.md - Before/after cleanup examplesThis skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.