João Rocha
All skills

/code-quality

A read-only review that finds the code your project no longer needs, and proves it.

GitHubView code

What it does

Sweeps a codebase for dead code, duplicate logic, unused components, over-complex implementations, legacy, redundant queries, abandoned files and technical debt. Every "unused" is proven with a repo-wide reference search, including the string references a compiler cannot see, before it becomes a finding. You get a prioritized report and a plan you apply one small commit at a time. Nothing is deleted during the review.

Example

❯ /code-quality apps/web

### CQ-07 · dead code · high confidencesrc/lib/api/labels.ts:131 LEGACY_IMPORT_ACTION_LABELSWhy unnecessary: no importer since the new import flow  replaced it; only IMPORT_ACTION_LABELS spreads it.Impact: -6 lines, one fewer map to keep in step with the backend.Risk: low. String-keyed? no. Sign-off? no.Plan: inline the four labels, delete the export,  run typecheck + lint.

When to use

Before a refactor, after a big feature or rewrite, when onboarding onto an unfamiliar repo, or whenever the codebase feels heavier than the product it ships.

  • /code-quality
  • /code-quality apps/web
  • /code-quality apply CQ-03 CQ-07

How it works

  1. 01

    Learn the project

    Maps the workspaces, reads AGENTS.md, CLAUDE.md and the architecture docs, marks the high-risk zones (money, auth, migrations) and records what is already failing, so it never claims or chases it.

  2. 02

    Sweep

    Looks for eight categories of waste across every workspace. On a large repo it fans out one sub-agent per workspace, but it never delegates the verdict.

  3. 03

    Verify

    Proves each candidate with a reference search and checks it against a list of things that look dead and are not: dependency injection, framework conventions, string-keyed registries, migrations.

  4. 04

    Report

    Hands back findings ranked by value, each with confidence, impact, risk and a plan. Nothing changes until you say which ones to apply.

What you get

A report in the conversation, with one entry per finding, followed by:

Sign-off list
Anything touching high-risk code, migrations or shared contracts. You check these first.
Safe to apply
The rest, grouped into batches that verify together. Each batch becomes one small commit.
Kept on purpose
Candidates it rejected and why, so the next review does not reopen them.
Not verified
What it could not prove, stated plainly.

Rules it follows

  • Read-only. It reports. Removing anything is a second step you start.

  • Tools suggest, it proves. Linter and dead-code tool output is a starting queue, never a verdict.

  • Careful where it matters. Aggressive in discovery, conservative on money, auth and data.

  • Old is not dead. Legacy is decided by the project docs, not by the age of the code.

Make it yours

The skill is agnostic: it learns your stack from your docs at run time. For sharper results, add your own cases to the "Your project" section in SKILL.md, like handlers loaded by filename or keys read from a database.

GitHubView code