Full post-refactoring codebase cleanup. Use when the user says "simplify the whole codebase", "clean up after refactoring", "find and archive stale code", "what files are dead", "archive unused files", "clean up the whole repo", "simplify everything", "identify stale code", or "post-refactor cleanup". Orchestrates three specialized agents: staleness-analyzer (classifies files as fresh/stale/dead via git history and dependency graphs), code-simplifier (cleans up active code), and stale-archiver (moves dead files to _archive/ with full provenance). Handles resume across sessions.
From codebase-simplifynpx claudepluginhub wilrf/wilrf-marketplace --plugin codebase-simplifyThis skill uses the workspace's default tool permissions.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Details PluginEval's skill quality evaluation: 3 layers (static, LLM judge), 10 dimensions, rubrics, formulas, anti-patterns, badges. Use to interpret scores, improve triggering, calibrate thresholds.
Orchestrate a full post-refactoring cleanup by analyzing what's fresh, what's stale, and what's dead, then simplifying the good code and archiving the rest.
This skill delegates to three specialized agents:
staleness-analyzer — Classifies every file as FRESH, STALE, or DEAD using git history, import/dependency graphs, and framework awareness. Produces a scored inventory with confidence ratings.
code-simplifier — Operates only on FRESH files. Simplifies code for clarity and consistency while preserving functionality. Follows project standards from CLAUDE.md.
stale-archiver — Moves DEAD files to _archive/ preserving directory structure and git history. Maintains ARCHIVE_LOG.md with full provenance.
Run git status --porcelain. If non-empty, abort:
"Working tree has uncommitted changes. Commit or stash before running."
Check for simplify-progress.json at the project root:
Identify the project's language/framework to configure the staleness-analyzer:
| Signal | Type |
|---|---|
| package.json + next.config.* | Next.js/React |
| convex/ directory | Convex backend |
| *.csproj or *.sln | .NET/C# |
| pyproject.toml or setup.py | Python |
| Cargo.toml | Rust |
| go.mod | Go |
Store the detected type. This determines which import patterns and framework entrypoints the staleness-analyzer checks.
Resolve in priority order:
scripts.test[tool.pytest] or [tool.hatch]test targetCreate simplify-progress.json:
{
"started": "2026-03-09",
"projectType": "nextjs-convex",
"testCommand": "npm test",
"stalenessWindow": 30,
"phases": {
"analyze": "pending",
"simplify": "pending",
"archive": "pending",
"verify": "pending"
},
"inventory": null,
"commits": [],
"errors": []
}
Invoke the staleness-analyzer agent scoped to the entire project.
The agent will:
After the inventory is produced:
Present the inventory to the user as a summary:
"Found N fresh files, M stale files, and K dead files (confidence 60+). Here are the dead files I recommend archiving:" [table of DEAD files]
Ask for confirmation before proceeding:
"Should I proceed with simplifying the fresh code and archiving the dead files? You can also exclude specific files."
Save the inventory to simplify-progress.json.
Update phase: "analyze": "done".
For each module containing FRESH files, invoke the code-simplifier agent.
Group fresh files by their top-level directory:
src/dashboard/*.tsx = one modulesrc/api/*.ts = another moduleconvex/*.ts = another moduleIf any module has 20+ files, split into sub-batches of ~10.
For each module:
Invoke the code-simplifier agent scoped to that module
Run the test command
Tests pass: auto-commit with message:
refactor: simplify <module-path>
<bullet summary of changes>
Co-Authored-By: Claude <noreply@anthropic.com>
Tests fail: revert with git checkout -- ., log the failure, skip
Update simplify-progress.json with commit SHA or skip reason
After all modules: update phase "simplify": "done".
Invoke the stale-archiver agent with the DEAD files from the inventory.
The agent will:
_archive/ with mirrored directory structuregit mv each dead file into the archive_archive/ARCHIVE_LOG.mdArchive in batches by directory, running tests between batches:
chore: archive stale files from <dir>After all batches: update phase "archive": "done".
git mv _archive/<path> <path>#### Codebase Simplify Complete
##### Simplified (N modules)
| Module | Changes | Commit |
|--------|---------|--------|
| src/dashboard | 12 fixes | abc1234 |
##### Archived (K files, ~M lines removed)
| File | Confidence | Reason |
|------|-----------|--------|
| src/old-widget.tsx | 92 | No imports, 120 days stale |
##### Skipped (J items)
| Item | Reason |
|------|--------|
| src/utils | Tests failed after simplification |
##### Impact
- Lines removed: ~M
- Files archived: K
- Active code simplified: N modules
- All tests passing: Yes/No
simplify-progress.json.When invoked and simplify-progress.json exists:
pending or in-progress.in-progress, check git status:
Users can customize via simplify-progress.json or command arguments:
_archive/)["docs/**", "scripts/**"])git mv so full file history is preserved. Restoring an archived file is a single command.