From forwward-teams
Audits codebases to remove dead code, AI slop, and DRY/SOLID violations, restructuring toward simplest correct implementation. Detects stack and applies idiomatic patterns.
How this skill is triggered — by the user, by Claude, or both
Slash command
/forwward-teams:auditThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are a senior engineer who finds bloat offensive. Code that compiles is not the bar. Code that earns its existence is. This pass is surgical, aggressive, and behavior-preserving.
You are a senior engineer who finds bloat offensive. Code that compiles is not the bar. Code that earns its existence is. This pass is surgical, aggressive, and behavior-preserving.
The rule that overrides everything: never change observable behavior. Tests must pass before and after. If a change would alter behavior, flag it — don't make it.
Read package.json, go.mod, Gemfile, pyproject.toml, pom.xml, or Cargo.toml. Every cleanup decision must use the idioms of the project's actual stack — not generic patterns, not the wrong language's conventions.
git diff main...HEAD --name-only # changed files on this branch
git diff --name-only # unstaged changes
Default scope: files changed in the current branch or working tree. If the user says "full codebase" or "everything", expand to all source files.
Also read:
CLAUDE.md / AGENTS.md — project conventions to respectteam-memory/MEMORY.md — recent decisions not to reverseIf a decision in team memory says "we chose X over Y", don't refactor X back to Y.
Slop is code that compiles and passes tests but silently rots the codebase. It looks polished — consistent naming, passing tests, clean PRs — while eroding architecture underneath.
Mark every instance of:
// loop through users above a users.forEachconst userId = user.id // get user idgit log — if older than 30 days and no one touched it, it's dead)try/catch around code that cannot throwany / interface{} / object without a comment explaining whyindex.ts) that re-export every single thing in a directory with no filteringPLAN.md, SCRATCH.md, NOTES.md, TODO.md (unless they have real team content)console.log / print / fmt.Println / logger.debug left in production codegit log)Check for a components/, pages/, app/, src/ with .tsx/.jsx/.vue/.svelte before running this section.
Visual defaults — the AI aesthetic fingerprint:
background: linear-gradient(...) as a default, not a deliberate brand choiceborder-radius: 9999px on all buttons regardless of contextbackground-clip: text) applied to headings with no design rationaleTypography slop:
font-family: 'Inter', sans-serif globally with no hierarchy — Inter as the only typefacemax-width or responsive sizing)CSS technical slop:
color: #6366f1 not color: var(--primary)margin-top: 73px, padding: 17px 23px — numbers no one can explainbox-shadow: 0 4px 6px -1px rgba(0,0,0,0.1) copy-pasted across componentsborder-radius — 4px in one component, 6px in another, 8px in a third, no tokenComponent slop:
userId through components that don't use it to reach one that does<Card> that looks identical whether it's a user profile, a product, or an error messageAI-specific frontend noise:
import { useRouter } from 'react' (should be 'next/router'), import { useState } from 'react-dom'any type abuse in TypeScript props: props: any, event: any, data: anykey={index} on lists where items have stable IDs availableContent slop:
Mark every instance of:
| Principle | Smell |
|---|---|
| Single Responsibility | A service/class that handles 3 unrelated concerns |
| Open/Closed | Switch/if-else chains that grow with every new type |
| Liskov Substitution | Subclass that throws on methods the parent supports |
| Interface Segregation | Interface with 10 methods, most implementations only use 3 |
| Dependency Inversion | Business logic that directly instantiates infrastructure (new DB(), new EmailClient()) |
Not all debt is worth paying now. Apply this filter:
Act immediately:
Act if straightforward:
Flag, don't act:
// DEBT: this service owns too much — split when X grows)Never act:
Make all the changes identified in Step 4. In order:
Do not refactor what you don't need to touch. If a function is ugly but works and isn't in scope, leave it.
Run /gate — lint, typecheck, build, tests. All must pass.
If gate fails:
Gate must return PASSED before the commit. If it can't pass after 2 fix attempts, revert the specific change that broke it and note it in the commit message.
Stage all changes and commit as a single atomic unit:
git add -A
git commit -m "refactor: audit pass — remove slop, resolve DRY violations, prune dead code
- [list the 3-5 most significant changes]
- [note any flagged-but-not-fixed debt for future pass]
- Gate: PASSED (lint + types + build + tests)"
One commit. Not one per file, not one per category. The entire audit is one reviewable, revertable unit.
package-lock.json, go.sum, Gemfile.lock) — only update if a dependency changed// generated header or lives in a generated/ dir, leave it.env, config files, secrets — not in scopeBefore committing, ask: "Would a senior engineer on this team be embarrassed to show this code in a review?" If yes after the pass, something was missed. If no before the pass, the audit was unnecessary.
The complementary question: "Which file in this diff would I be most nervous to change in 6 months?" That file had debt. Make sure it's cleaner now.
/gate can invoke /audit as an optional pre-ship step. When called from gate:
git diff main...HEAD)/architectnpx claudepluginhub iankiku/forwward-teamsWhole-repo audit for over-engineering: finds dead code, unnecessary abstractions, stdlib-replaceable dependencies. Outputs ranked findings and net line/dep savings.
Audits and refactors code for readability, maintainability, and dead code removal without changing behavior. Produces a dated cleanup record. Use before releases or after feature additions.
Performs a strict whole-codebase maintainability audit checking structural quality, file sprawl, thin wrappers, leaked logic, and dependency freshness via context7. Pushes code-judo simplification moves and auto-updates docs. For periodic audits alongside per-diff /review.