/superskills:clean-code <optional: base branch (default auto-detect) and/or --scope <paths>>from Superskills
Audits branch diffs against KISS, DRY, SOLID, and YAGNI, then applies minimal safe refactors with atomic commits under a green test suite. Use when asked to clean up, simplify, or deduplicate code.
Ships in Superskills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Apply the superskills quality standard — KISS, DRY, SOLID, YAGNI — to the
code that changed on this branch, and prove each cleanup with tests. This is the
in-tree counterpart to Claude Code's built-in /simplify: it can be invoked from
inside any session or pipeline (/qa-full Step 3 runs it), and it works the same
in every tool ./setup targets.
The principles are defined once, in ENGINEERING_STANDARDS.md in the
superskills install (a plugin install exposes it at
${CLAUDE_PLUGIN_ROOT}/ENGINEERING_STANDARDS.md). Read its DRY, SOLID,
and YAGNI sections before auditing — this file does not restate them, it
only lists the diff-level signals to look for. Do not expect the file in the
project under review, and do not flag it as missing. KISS is not a separate
section there: it is the standard's "smallest correct change" + YAGNI rules
applied to structure — the simplest design that passes the tests.
/review / /defense and move on.git checkout -- <files>, which discards everything uncommitted in those
files. So no fix is attempted while unrelated uncommitted work exists
(Step 1.4). Never use git stash as the revert mechanism — it stashes the
whole tree, not one change./tdd), then refactor under green.clean-code: DRY — extract parseRange() used by 3 call sites). Never
push./qa-full Step 1 does (gh repo view default branch → origin/HEAD → main/master), unless
$ARGUMENTS names one, then diff against origin/<base> when that ref
exists (fetch it first), else local <base>. When invoked from /qa-full,
use the diff ref and scope it resolved — do not re-detect.git diff --name-only <diff-ref>...HEAD -- <scope paths>
(omit the -- part when no --scope was given) plus any uncommitted
changes to those paths. Keep only source files: skip lockfiles, generated
code, vendored dirs, and pure docs unless docs are the deliverable.CLAUDE.md, package.json scripts,
Makefile, pyproject.toml) and run it once. If the suite is red,
stop — refactoring can't be verified on a red suite. Report and exit.git status --porcelain is non-empty, ask the user (via
AskUserQuestion) whether to commit the in-progress work now
(recommended) or stash it before continuing. Do not audit-and-fix on a
dirty tree; a revert in Step 3 would take the user's work with it. (Inside
/qa-full this was already handled in its Step 1 — the tree is clean.)Read every changed file in full. For each principle, apply the definition from
ENGINEERING_STANDARDS.md and hunt for these diff-level signals. Record
findings as PRINCIPLE — file:line — evidence — smallest fix, with severity
HIGH (duplicated logic, a unit doing two jobs that will diverge, dead code
on a live path), MEDIUM (wrong altitude, needless abstraction, speculative
config), or LOW (naming, ordering, minor simplification).
if type == X branch bolted onto a stable core; an
implementation that throws or no-ops where its interface's contract returns;
a parameter object passed to read one field; an interface where callers use
two of eight methods; a unit reaching straight for $HOME, the network, the
clock, a global singleton, or new Concrete() where a seam would make it
testable in isolation. Name both responsibilities when flagging a unit that
has two reasons to change.Also note (not as findings) any existing helper you found that the diff should reuse — that becomes the DRY fix.
For each HIGH and MEDIUM finding, and any LOW whose fix is a one-liner:
git checkout -- <those files> (safe because
the tree was clean before the fix), and record the finding as UNFIXED
with the failing test name.Do not touch findings outside the diff scope, and do not "improve" the tests themselves beyond what a refactor needs.
suite-stamp.sh ensure). Report that command and its result in the Suite: field. When git config --local superskills.suiteCommand is empty, end with one plain sentence: "No whole-suite gate is set up here. Run the whole suite once before merging, or run suite-stamp.sh init '<command>' so it runs once per tree."# clean-code — <branch> @ <YYYY-MM-DD>
Base: <base> Files audited: N Suite: <command> → green/red
## Fixed (principle — finding — commit)
1. DRY — src/x.ts:40 duplicated parseRange() from src/util/range.ts — <sha>
- (or) None needed.
## Unfixed / deferred (with reason)
- SOLID — src/y.ts:12 mixes validation + persistence — needs interface change beyond the diff
## Warnings (LOW, left as-is)
- …
## Out of scope (hand to /review or /defense)
- …
Every fix lists a commit SHA; every unfixed finding lists why. No claim without the re-audit and the fresh suite run behind it.
git stash./review — correctness / production-readiness review of the same diff; run
it (or /code-review) for bugs, run this for quality./code-review / /simplify — Claude Code built-ins with overlapping scope;
use them when typing commands yourself. Pipelines and other tools use this
skill because it's invocable everywhere./tdd — the characterization-test-first discipline this skill's fixes follow./test-coverage — writes the missing tests for logic this skill leaves
untested./qa-full — runs this skill in Step 3 as the quality half of the correctness
pass, passing it the base and scope it resolved./write-plan — applies the same principles at plan time so there's less to
clean up here.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
code-quality, refactoring, clean-code, solid-principles, dry, yagni
npx claudepluginhub ariadoss/superskills --plugin superskills48 skills in this plugin
/a11yAccessibility audit for frontend changes — WCAG 2.2 AA, screen-reader
compatibility, keyboard navigation, focus management, ARIA correctness, color
contrast, and reduced-motion. Static diff-scoped analysis (safe to auto-run) plus
an optional dynamic axe pass against a running app. Use when asked to "check
accessibility", "a11y audit", "screen reader check", "WCAG", "is this
accessible", "keyboard navigation", "ARIA review", or after heavy frontend work.
/articleExtract clean article content from URLs (blog posts, articles, tutorials) and save as readable text. Use when user wants to download, extract, or save an article/blog post from a URL without ads, navigation, or clutter./basic-reviewRead-only correctness review of pending changes, needing no external
install: correctness, security, reliability/performance and contract risk,
each finding cited as file:line with why it is wrong and a fix. The fallback
when gstack's /review is unavailable (not installed, or its install is
broken); /qa-full and /daily-qa call it automatically then. Applies a
vendored copy of gstack's pre-landing checklist. Use when asked for
a "basic review", a "quick review without gstack", or a review in a tool where
/review is missing. Not for quality cleanups (use /clean-code), and not the
first choice when /review is installed: /review goes deeper and applies fixes.
/cache-strategyImplement a permanent cache-first strategy: check cache before hitting the DB,
write to cache on first read, invalidate only when data changes. No TTL timeouts.
Modeled on Play Framework's cache model. Use when asked to "add caching",
"implement cache strategy", "cache DB results", or "reduce DB load".
/cli-for-agentDesign or review CLIs so coding agents can run them reliably: non-interactive
flags first, layered --help with real copy-pasteable examples, stdin/pipeline
support, fail-fast errors that include a correct invocation, idempotency,
--dry-run/--yes for destructive actions, and machine-useful success output.
Use when building a CLI, adding commands or subcommands, writing --help
text, or when asked for an "agent-friendly CLI". Not for GUIs, TUIs, or
library APIs (no CLI surface to design).
/content-writerContent creation leveraging knowledge bases — blog posts, docs, marketing copy, investor updates.
Other plugins' skills for the same job