agentsclimarketplace

Cleanup

Skill nicograef/handbook/.claude/skills/cleanup

Reviews code changes for clean code principles, design patterns, and anti-patterns. Use on recent changes (staged, unstaged, last commit) or a specific area (module, route, component, page). Reports findings with concrete suggestions, applies fixes after confirmation. Integrates AI slop detection, architecture boundary checks, and readability review. Triggers: "cleanup", "clean up", "review code quality", "check principles", "readability review", "code cleanup", "deslop", "remove slop", "clean up AI code", "review for slop", "remove AI writing".From its SKILL.md

Install
npx -y skills add nicograef/handbook --skill cleanup

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

6.7 KB, as published. Nobody here has run it

Cleanup

Workflow

1. Determine scope

Resolve the file set in this order:

OrderSourceCommand
1Files, module, route, component, or page named by the user—
2Staged changesgit diff --cached --name-only
3Unstaged changesgit diff --name-only
4Last commitgit diff HEAD~1 --name-only
5Still emptyAsk the user what to review
  • Ask the user to confirm scope if ambiguous.
  • Incremental default: never scan the entire codebase — stay within the determined scope.
  • Reviewing a diff (staged/unstaged/commit): read both the diff and the full files to understand context.
  • Repo-wide scope mode — triggered by a request for a repo-wide quality audit or a whole-project cross-layer consistency check.
  • Repo-wide mode widens the scope to the codebase and reports findings without applying fixes.
  • It also adds the cross-layer.md trace across 3–5 representative flows per feature area, on top of the per-file passes.

2. Understand conventions

  • Before flagging anything, read surrounding code that is NOT part of the changes.
  • The codebase's existing conventions are the baseline.
  • Flag deviations from clean code principles, not deviations from personal preferences.

3. Multi-pass review

Run these passes on each file in scope; skip the irrelevant ones.

PassReferenceApplies to
Readability & clarityreadability.mdAll files (code, docs, configs)
Readability — German prosereadability-de.mdGerman-language docs, comments, READMEs — use instead of the prose section in readability.md
Principlesprinciples.mdCode files
Code smellscode-smells.mdCode files + config files
Architecture & boundariesarchitecture.mdService, domain, handler, repository layers
Cross-layer consistencycross-layer.mdRepo-wide scope mode only
Test readabilityreadability.md + code-smells.mdTest files only
  • Slop detection is folded into the Readability and Code smells passes — there is no separate slop pass.
  • For a slop-focused trigger ("deslop", "remove slop"), run those two passes with extra attention to their AI-slop sections.
  • Report each issue once, under the most specific pass that catches it.
  • If two passes flag the same lines, keep the more precise one and drop the duplicate.
  • Record every issue with these fields:
FieldContent
WhatThe principle violated or smell detected — reference the specific rule from the reference file
WhereFile path + line range
WhyOne sentence explaining the impact on readability or maintainability
SuggestionA concrete, minimal change — not a rewrite
EffortS (< 5 min) / M (5–30 min) / L (30+ min)

4. Report

Severity order within each file:

RankCategoryCovers
1Boundary & consistency risksLogic at system edges: missing validation on external input (HTTP handlers, CLI, external APIs), broken dependency direction, cross-layer shape/validation mismatches — see architecture.md and cross-layer.md. For general bug-hunting inside a function, use /code-review.
2Readability winsNaming, clarity, nesting, AI slop removal
3Principle violationsSOLID, DRY, KISS, YAGNI
4Structural suggestionsDeeper modules, better boundaries, domain model improvements
  • Verify first — re-read each flagged location before reporting.
  • Drop any finding you cannot anchor to exact lines, or that does not hold on re-read.
  • Mark remaining uncertainty as unverified.
  • Zero findings is a valid outcome — report one line that the code is clean, then stop.
  • Never manufacture findings to fill a report.
  • Counts line first — 7 findings — 2 boundary, 3 readability, 2 structural.
  • Group findings by file, sorted by the severity order above.
  • Prioritized summary last — up to 5 of the most impactful changes across all files.
  • Gate — apply nothing yet. Ask: "Which of these should I apply?"
  • Fields — one entry per finding, in this shape:
**[What]** ([principles.md](principles.md) → rule name)
File: path/to/file.ts:42-58
Why: <one sentence>
Suggestion: <concrete change>
Effort: S

5. Apply

  • Work through confirmed findings one at a time.
  • Make the minimal change described in the suggestion.
  • After finishing all changes to a file, verify that file still compiles or passes lint.
  • Verify no functionality changed — output, return values, side effects, and behavior stay identical.

Constraints

  • Never change functionality. This is a readability and quality pass — the code must do exactly the same thing before and after.
  • Never suggest large refactors. Flag an issue requiring significant restructuring as a large refactor for the user to schedule separately.
  • After flagging a large refactor, move on.
  • Never rewrite. Subtract or simplify. Do not impose a different style.
  • Never impose foreign conventions. The codebase's existing style is the baseline — flag genuine principle violations, not style preferences.
  • Never add comments, abstractions, or error handling as part of cleanup. The goal is less noise, not more.
  • Never apply fixes without user confirmation. Always present the report first.
  • Respect the native voice. If a pattern looks like an AI smell but is genuinely idiomatic for the project, leave it.
  • Test files: readability only. Check naming, structure, and clarity of test code.
  • Do not retag, delete, or restructure tests — that is the test-quality skill's job.
  • Scope discipline. Only touch files in the determined scope. No "while we're here" changes in unrelated files.

Quality

Keep looking

Skills are one crate of 627,559. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.