Clean Codebase
Remove dead code, unused imports, fix lint warnings, and normalize formatting across a codebase without changing business logic or architecture. Use when lint warnings have piled up during rapid development, unused imports and variables clutter files, dead code paths were never removed, formatting is inconsistent, or static analysis tools report fixable hygiene issues.
Install
npx skills add pjt222/agent-almanac --skill clean-codebasegit clone --depth 1 https://github.com/pjt222/agent-almanac.git /tmp/agent-almanac
mkdir -p ~/.claude/skills
cp -r /tmp/agent-almanac/i18n/caveman-lite/skills/clean-codebase ~/.claude/skills/clean-codebasePersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# clean-codebase ## When to Use Use this skill when a codebase has accumulated hygiene debt: - Lint warnings have piled up during rapid development - Unused imports and variables clutter files - Dead code paths exist but were never removed - Formatting is inconsistent across files - Static analysis tools report fixable issues **Do NOT use** for architectural refactoring, bug fixes, or business logic changes. This skill focuses purely on hygiene and automated cleanup. ## Inputs | Parameter | Type | Required | Description | |---|---|---|---| | `codebase_path` | string | Yes | Absolute path to codebase root | | `language` | string | Yes | Primary language (js, python, r, rust, etc.) | | `cleanup_mode` | enum | No | `safe` (default) or `aggressive` | | `run_tests` | boolean | No | Run test suite after cleanup (default: true) | | `backup` | boolean | No | Create backup before deletion (default: true) | ## Procedure ### Step 1: Pre-Cleanup Assessment Measure the current state to quantify improvements later. ```bash # Count lint warnings by severity lint_tool --format json > lint_before.json # Count lines of code cloc . --json > cloc_before.json # List unused symbols (language-dependent) # JavaScript/TypeScript: ts-prune or depcheck # Python: vulture # R: lintr unused function checks ``` **Got:** Baseline metrics saved to `lint_before.json` and `cloc_before.json` **If fail:** If lint tool not found, skip automated fixes and focus on manual review
Details
- Skill name
clean-codebase- Repository
- pjt222/agent-almanac
- Path
i18n/caveman-lite/skills/clean-codebase/SKILL.md- License
- MIT
- Repo updated
- 18 November 2026
- Listed in
- BehiSecc/awesome-claude-skills
FAQ
What does the Clean Codebase skill do?
Remove dead code, unused imports, fix lint warnings, and normalize formatting across a codebase without changing business logic or architecture. Use when lint warnings have piled up during rapid development, unused imports and variables clutter files, dead code paths were never removed, formatting is inconsistent, or static analysis tools report fixable hygiene issues.
How do I install the Clean Codebase skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add pjt222/agent-almanac --skill clean-codebase. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Clean Codebase popular?
It lives in pjt222/agent-almanac, which has 45 GitHub stars and 4 forks, and is included in 1 curated skill list.
Related skills
Adapt Architecture
45pjt222/agent-almanac
Execute structural metamorphosis using strangler fig migration, chrysalis phases, and interface preservation. Covers transformation planning, parallel running, progressive cutover, rollback design, and post-metamorphosis stabilization for system architecture evolution. Use when assess-form has classified the system as READY for transformation, when migrating from monolith to microservices, when replacing a core subsystem while dependents continue operating, or when any architectural change must be gradual rather than big-bang.
Adaptic
45pjt222/agent-almanac
Master skill composing the 5-step synoptic cycle for panoramic synthesis across multiple domains. Orchestrates meditate, expand-awareness, observe, awareness, integrate-gestalt, and express-insight into a coherent process that produces unified understanding rather than sequential compromise. Use when a problem genuinely spans 3+ domains and the interactions between domains matter more than depth in any one, when sequential analysis feels like compromise rather than integration, or before major architectural decisions affecting multiple stakeholders.
Add Puzzle Type
45pjt222/agent-almanac
Scaffold a new puzzle type across all 10+ pipeline integration points in jigsawR. Creates the core puzzle module, wires it into the unified pipeline (generation, positioning, rendering, adjacency), adds ggpuzzle geom/stat layers, updates DESCRIPTION and config.yml, extends the Shiny app, and creates a comprehensive test suite. Use when adding a completely new puzzle type to the package or following the 10-point integration checklist to ensure nothing is missed end-to-end.
Configure API Gateway
45pjt222/agent-almanac
Deploy and configure an API gateway (Kong or Traefik) to handle API traffic management, authentication, rate limiting, request/response transformation, and routing. Covers plugin configuration, upstream services, consumer management, and integration with existing infrastructure. Use when multiple backend services need a unified API endpoint, when centralized authentication or rate limiting is required, when implementing API versioning, or when needing detailed analytics and load balancing for microservices.
Chrysopoeia
45pjt222/agent-almanac
Extract maximum value from existing code — performance optimization, API surface refinement, and dead weight elimination. The art of turning base code into gold through systematic identification and amplification of value-bearing patterns. Use when optimizing a working but sluggish codebase, refining an API surface that has accumulated cruft, reducing bundle size or memory footprint, or preparing code for open-source release — when code works correctly but doesn't shine and needs polish rather than a full rewrite.
Create 2d Composition
45pjt222/agent-almanac
Compose 2D graphics programmatically using SVG generation, diagram layout algorithms, image compositing, and batch processing workflows. Use when generating diagrams, flowcharts, or infographics programmatically, creating reproducible scientific figures, automating production of badges or visual assets, building custom chart types not in standard libraries, or batch generating graphics with parameter variations.
Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.