Analyze codebase for cleanup candidates — dead code, duplication, staleness, context budget
Analyzes codebases to identify dead code, duplication, stale files, and context budget issues for cleanup prioritization.
npx claudepluginhub jugrajsingh/skillgardenThis skill is limited to using the following tools:
Read-only analysis of codebase for cleanup candidates. Never modify files during assessment.
$ARGUMENTS = scope (file path, directory path, or "project").
If empty, ask via AskUserQuestion:
| Input | Scope |
|---|---|
| File path | Single file + cross-references |
| Directory path | All files in directory recursively |
| "project" | Repository root, all tracked files |
| "CLAUDE.md files only" | All CLAUDE.md files in repo |
Identify the repository root via git rev-parse --show-toplevel.
For each file in scope:
Unreferenced functions/classes:
Unused imports:
Commented-out code:
Report format per finding: file:line | type | description
Function-level duplication:
Block-level duplication:
Report format: fileA:line <-> fileB:line | description
File staleness:
git log --oneline -50 --format="%H" | tail -1
Use the 50th commit as the cutoff. Find files not modified since:
git log -1 --format="%ai" -- {FILE}
Compare against cutoff commit date.
Outdated documentation:
Old TODOs:
Report format: file | last modified | description
Only if scope includes CLAUDE.md files or scope is "project".
For each CLAUDE.md file found:
wc -l CLAUDE.md
| Lines | Status |
|---|---|
| Under 100 | Lean |
| 100-200 | OK |
| Over 200 | Candidate for splitting |
Check for redundancy:
Rank all candidates by impact:
| Severity | Meaning |
|---|---|
| Severe (two filled diamonds) | Dead code actively confusing or blocking development |
| Major (one filled diamond) | Significant duplication or stale documentation |
| Minor (one empty diamond) | Small unused imports, old TODOs |
Present the full report:
## Assessment: {SCOPE}
### Dead Code ({count} items)
| Severity | File:Line | Type | Description |
|----------|-----------|------|-------------|
| ... | ... | ... | ... |
### Duplication ({count} items)
| Severity | Location A | Location B | Description |
|----------|------------|------------|-------------|
| ... | ... | ... | ... |
### Staleness ({count} items)
| Severity | File | Last Modified | Description |
|----------|------|---------------|-------------|
| ... | ... | ... | ... |
### Context Budget
| File | Lines | Status |
|------|-------|--------|
| ... | ... | ... |
### Summary
- Total candidates: {N}
- Critical: {N} | Major: {N} | Minor: {N}
- Recommended action: /tidyup:cleanup
Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.
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.