config/claude/skills/quality-sweep/SKILL.md
Full-codebase quality sweep via 8 parallel concern-focused subagents. Each owns one axis (dedup/DRY, shared types, dead code, circular deps, weak types, defensive programming, legacy/fallbacks, AI slop/comments), researches, produces a critical assessment, and implements high-confidence fixes. Use when the user asks to "clean up the codebase", "quality sweep", "vibecode cleanup", "remove slop", "kill dead code and any types", or wants a comprehensive cross-cutting cleanup rather than a per-package refactor audit.
npx skillsauth add cryptofish7/dotfiles quality-sweepInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive codebase cleanup partitioned by concern, not by package. Each concern gets one parallel subagent that researches, critiques, and fixes.
Use refactor-audit instead when the user wants a per-package/per-section refactor plan with approval gates. Use quality-sweep when they want a full cross-cutting cleanup executed in one pass.
Before dispatching, check what's available so subagents know what to use:
knip (JS/TS dead code) — check package.json devDependencies or npx knip --versionmadge (JS/TS circular deps) — same checkts-unused-exports, depcheck — JS/TS alternativesruff, vulture, pyflakes — Python equivalentscargo-udeps, cargo +nightly udeps — Rusttsc --noEmit, mypy, pyright, cargo check)Report the detected toolset to the user. If key tools are missing, ask whether to install or proceed without.
Spawn all eight in a single message with parallel tool calls. Each is a general-purpose subagent with the concern's instructions below.
Shared preamble (prepend to every subagent prompt):
You own ONE quality concern in a larger cleanup. Other subagents own other concerns — do not touch their territory.
Work in two passes:
- Research + critical assessment — read the code, identify issues, write a findings section with file paths and line numbers. Be specific.
- Implement high-confidence fixes only — make the changes you are confident about. Leave ambiguous cases in the report for the user to review.
Do NOT:
- Make behavior changes unless the concern explicitly allows it
- Fix issues outside your concern (note them, don't touch them)
- Reformat, rename, or restructure beyond what the concern requires
Output format:
## Findings - `path/file.ts:L42` — [issue]. [why it matters]. ## Applied fixes - `path/file.ts:L42` — [what you did]. ## Deferred (needs user decision) - `path/file.ts:L99` — [issue]. [why uncertain].
Each subagent gets the shared preamble plus one of these:
Deduplication / DRY. Find duplicated logic, copy-pasted blocks, and near-identical functions. Consolidate where DRY genuinely reduces complexity. Skip cases where the duplication is incidental or where abstracting would create a worse coupling.
Shared types. Find type definitions that should live in a shared module. Consolidate types that are redefined across files. Do not invent new shared packages — use existing shared locations.
Dead code removal. Use the detected dead-code tool (knip / ts-unused-exports / vulture / cargo-udeps). Cross-check every flagged item against the full codebase — including dynamic references, string-based lookups, and public API surface — before deleting. If unsure, defer.
Circular dependencies. Use madge or the language equivalent. Untangle cycles by moving shared code to a lower layer or inverting a dependency. If a cycle is structural and risky to break, document it in Deferred.
Weak types. Find any, unknown, object, untyped dicts, interface{} (Go), etc. Research the actual runtime shape and replace with strong types. Verify with the typechecker after each change. If the correct type is genuinely dynamic, leave it and document why.
Defensive programming cleanup. Remove try/catch and equivalent guards that do not handle a real external boundary or known failure mode. Keep guards around: untrusted input, I/O, parsing, FFI, known-flaky operations. Remove: empty catches, catch-and-rethrow, catches that swallow errors, fallback values that mask bugs.
Legacy / deprecated / fallback code. Find deprecated APIs, legacy branches, feature flags that are permanently on/off, and fallback paths for removed systems. Remove them. Collapse code paths so each behavior has one implementation.
AI slop and comment hygiene. Remove: comments describing in-progress work ("TODO: refactor this later"), comments narrating obvious code ("// increment i"), changelog-style comments ("// was X, now Y"), stub/placeholder comments, and commented-out code. Keep: comments that explain non-obvious WHY, hidden constraints, workarounds with rationale. Be concise — if an edit is needed, prefer deletion over rewriting.
After all subagents return:
## Quality Sweep Report
### Applied ({N} fixes)
[grouped by concern, with file:line references]
### Deferred ({M} items needing review)
[grouped by concern, with reasoning]
### Build / test status
[pass / fail + details]
testing
Generate and maintain a local deploy script (scripts/deploy.sh). Discovers project services, deploys them locally, and health-checks each one. Use when the user asks to "smoke test", "deploy locally", "test local deploy", "update deploy script", "run deploy", or "run smoke test".
testing
Audit installed skills and agents for bloat, overlap, and improvement opportunities. Use when the user wants to review, audit, list, or improve their skills and agents. Triggers on "review skills", "audit skills", "list skills", "skill review", "improve skills".
development
Set up the autonomous post-task workflow for a project. Injects the standard development pipeline into AGENTS.md and installs all required skills and agents (docs-consolidator, ci-cd-pipeline, smoke-test, bug-bash-update, code-reviewer, debugger). Use at the start of a new project. Triggers on "setup workflow", "init workflow", "add workflow", or "set up project workflow".
tools
Analyze the current conversation for learnings and persist approved insights. Triggers on "reflect", "retrospective", "session review", "what did we learn", "conversation review".