From code-quality
Comprehensive one-shot repo cleanup skill. This skill should be used when the user asks to "clean up the repo", "remove dead code", "de-AI-slop", "unfuck this codebase", "comprehensive cleanup", "remove unused code", "simplify the codebase", "fix code quality", "clean everything up", "audit the codebase", "fix tech debt", "remove duplicates", "unify the architecture", "security review and fix", or wants a thorough, automated cleanup of their entire repository. Launches a full agent swarm to discover issues, plan fixes, and implement changes autonomously. Combines detailed custom analysis with existing skills (file-audit, code-quality:index-repo, code-quality:code-simplifier, code-quality:architect, code-quality:security, code-quality:qa, code-quality:code-reviewer, code-quality:test-runner) into a unified cleanup workflow.
npx claudepluginhub wgordon17/personal-claude-marketplace --plugin code-qualityThis skill is limited to using the following tools:
One-shot command that launches a full agent swarm to discover, plan, and fix everything wrong
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
One-shot command that launches a full agent swarm to discover, plan, and fix everything wrong with a codebase: dead code, duplicates, security issues, AI slop, architectural drift, complexity, and documentation rot.
/unfuck # Full cleanup of entire repo
/unfuck src/ # Scope to a directory
/unfuck --dry-run # Discovery + plan only, no implementation
Runs a 5-phase workflow combining 12+ existing skills/agents with detailed custom analysis logic and optional external CLI tools. Phase 0 indexes the repo. Phase 1 spawns 7 parallel discovery agents that scan every file. Phase 2 synthesizes findings into a prioritized cleanup plan. Phase 3 spawns sequential implementation agents that fix each category and commit. Phase 4 verifies everything passes and generates a report.
code-quality/references/project-memory-reference.md
(Run-ID Naming Convention section)cleanup-{run_id} (using the run ID from step 1)code-quality:index-repo), language detection, tool detectioncleanup/comprehensive-{run-id} (from origin/main){memory_dir}/unfuck/{run-id}/discovery/ directory for agent outputPhase 1 and Phase 2 use /map-reduce for structured discovery and synthesis — each discovery agent is a mapper, and the synthesis agent is the reducer. This provides formal chunk tracking, retry-on-failure for individual discovery agents, and structured ReductionResult output. If /map-reduce skill is unavailable, fall back to direct parallel agents as described below.
All agents run simultaneously in background. Each writes structured JSON findings to
{run_dir}/discovery/. Full prompts in references/discovery-agents.md.
| Agent | Role | Paired Skills | External Tools | Output |
|---|---|---|---|---|
| dead-code-hunter | Unused code, exports, imports, files, deps | file-audit | Knip, Vulture, deadcode | dead-code.json |
| duplicate-detector | Copy-paste code, near-duplicates, redundant wrappers | file-audit | jscpd | duplicates.json |
| security-auditor | OWASP Top 10, secrets, CVEs, auth gaps | code-quality:security | Semgrep, gitleaks, Bandit | security.json |
| architecture-reviewer | Circular deps, divergent patterns, god objects | code-quality:architect | dependency-cruiser, Madge | architecture.json |
| ai-slop-detector | Over-abstraction, unnecessary wrappers, catch-rethrow, comment noise | (novel — see references/ai-slop-checklist.md) | — | ai-slop.json |
| complexity-auditor | Long functions, deep nesting, magic values, parameter bloat | code-quality:qa | radon | complexity.json |
| documentation-auditor | README drift, broken links, stale TODOs, missing docs | file-audit | — | documentation.json |
Model note: ai-slop-detector uses opus (detecting AI patterns requires stronger judgment).
All others use sonnet.
Tool fallback: When external tools are unavailable, agents perform equivalent analysis
manually using LSP, Grep, and file reading. See references/external-tools.md fallback table.
Scan discovery agent findings for references to named third-party libraries or packages
(check finding descriptions and affected file paths for import statements, package names, or
library-specific API calls). If any findings involve third-party library misuse (e.g., deprecated
patterns, non-idiomatic usage, missing security configurations), invoke /deep-research (via the
Skill tool) in Bridged mode to research current best practices before planning fixes. This
prevents replacing one anti-pattern with another based on stale training data.
A dedicated opus synthesis teammate (not the orchestrator) performs synthesis to avoid filling the lead agent's context. When using /map-reduce, this agent acts as the reducer — receiving all 7 ChunkResults and producing a ReductionResult before writing the cleanup plan. When falling back to direct approach, it reads the raw discovery JSON files directly.
{run_dir}/cleanup-plan.md with per-finding detailA single persistent team of 4 specialists works through all categories sequentially together:
| Teammate | Role | Model | Responsibility |
|---|---|---|---|
| impl-writer | Implementer | sonnet | Applies fixes from cleanup plan per category |
| impl-qa | Reviewer | opus | Reviews changes for correctness, verifies with LSP |
| impl-tester | Tester | sonnet | Runs test suite and formatters after each category |
| impl-docs | Documenter | sonnet | Updates documentation affected by code changes |
Workflow per category: writer implements → QA reviews → tester verifies → docs updates → commit or rollback. The orchestrator assigns categories in priority order (security → dead code → duplicates → AI slop → complexity → architecture → docs). The team commits after each category passes.
code-quality:test-runnercode-quality:quality-gate verification patternscode-quality:reflect to verify completeness against the original cleanup plan{run_dir}/cleanup-report.md with:
needs-input findings presented to user via AskUserQuestion with LoE (see code-quality/references/finding-classification.md)cleanup/comprehensive-{run-id} (from origin/main)findReferences before every deletion, move, or rename--dry-run flag for discovery + planning without implementationneeds-input escape hatch for uncertain changes — see code-quality/references/finding-classification.md Fixer Protocol| File | Purpose | Persistent |
|---|---|---|
{run_dir}/cleanup-plan.md | Prioritized findings with fix strategies | Yes |
{run_dir}/cleanup-report.md | Final report with stats and blocked items | Yes |
{run_dir}/discovery/*.json | Raw agent findings (7 files) | Cleaned up |
{run_dir}/available-tools.json | Detected external tools | Cleaned up |
| File | Content |
|---|---|
references/orchestration-playbook.md | Complete phase-by-phase coordination guide with JSON schemas, dedup algorithm, rollback procedures, TeamCreate config, and error handling |
references/discovery-agents.md | Full prompts for all 7 discovery agents — role, methodology, external tool commands, LSP patterns, classification/LoE/risk guides, output format |
references/implementation-agents.md | Full prompts for all 7 implementation agents — fix strategies, paired skills, safety rules, test cadence, commit formats |
references/ai-slop-checklist.md | 32 anti-patterns across 7 categories (structural, error handling, naming, comments, testing, imports, types) with before/after examples and false-positive guidance |
references/external-tools.md | Tool matrix by language, detection commands, JSON output schemas, parsing instructions, Phase 0 detection script, fallback strategies |