cleanup-web
Skill9 starsChanged 4 months agoMITView on GitHub
End-of-session cleanup pass for TypeScript, React, and web code. Use this skill whenever the user asks to "clean up", "polish", "tidy", "refactor", or "review" web/frontend work at the end of a coding session, or when they invoke this skill by name. Performs a holistic review of files modified during the session — simplification, type safety, React patterns, CSS modernization, and comment hygiene. Make sure to use this skill anytime the user signals they want to wrap up or finalize TypeScript/React/web work, even if they don't explicitly say "cleanup". Do NOT use for one-off edits, bug fixes, or active feature work.
In this repository25 other files it gives its agents.
- adversarial-reviewSkill
- agent-first-repoSkill
- agents-mdSkill
- architecture-mdSkill
- behavioral-testingSkill
- cleanup-swiftSkill
- clear-communicationSkill
- code-commentsSkill
- design-patterns-gofSkill
- design-systemSkill
- distill-to-skillSkill
- git-safe-pr-workflowSkill
- git-worktreeSkill
- karpathy-guidelinesSkill
- lean-ts-patternsSkill
- macos-swift-desktopSkill
- modern-cssSkill
- no-use-effectSkill
- parse-dont-validateSkill
- pr-review-triageSkill
- simplifySkill
- technical-writingSkill
- typescript-refactoringSkill
- typescriptSkill
- update-readmeSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
No changes is a valid outcome: If the code is already clean, say so and stop.
- Distinctive: line 17
If you can't identify the session's modified files with confidence, stop and ask.
- Distinctive: line 55
After all sub-agents return, aggregate their findings:
- Distinctive: line 64
If no sub-agent found anything worth changing, say so plainly and stop
- Distinctive: line 66
Wait for the user to approve before applying any edits.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Evaluate the work done in this session and refactor it to a pristine state.
Disposition
- Propose, don't apply. Surface proposed changes with clear reasoning and evidence — show before/after, name the principle that motivates the change, and wait for approval before any edits land.
- No changes is a valid outcome. If the code is already clean, say so and stop. Do not invent work to justify the pass.
Scope
Operate only on files modified during this session. Use git status, git diff, your task log, or recent tool calls to identify them. Do not touch unrelated code.
If you can't identify the session's modified files with confidence, stop and ask.
Review skills
Each skill below represents a review lens. Every lens gets its own sub-agent.
| Lens | Skill | Focus |
| Simplification | simplify | Dead code, needless abstractions, unused params, over-engineered utilities, and helpers whose names do not add meaning. Do not inline single-use helpers that clarify call sites or hide non-trivial conditions. |
| TypeScript | typescript | Type soundness, pragmatic generics, discriminated unions over type assertions, unknown over any |
| Type-driven design | parse-dont-validate | Push checks into types; make invalid states unrepresentable; branded types where warranted |
| React effects | no-use-effect | Derived state over effects, event handlers over sync effects, key-resets over effect-driven resets, useSyncExternalStore over manual subscriptions |
| React performance | vercel-react-best-practices | Component boundaries, use client / use server placement, data fetching patterns, bundle impact, memoization |
| CSS | modern-css | Native CSS over JS workarounds, logical properties, container queries, modern selectors, no legacy hacks |
| Comment hygiene | code-comments | Strip "what" comments and AI narration; keep "why" comments only |
| Correctness | adversarial-review | Behavior changes, dropped guards or edge cases, async/effect timing, server/client boundary, stale callers — bugs the session introduced |
Approach
Dispatch one sub-agent per review lens, all in parallel. Each sub-agent:
- Loads its skill via the Skill tool — this is required before any review work
- Reads the diff — use
git diff(andgit diff --cachedif needed) to get the session's changes - Reviews only through its own lens — do not duplicate another lens's concerns
- Returns structured findings — for each finding: file + location, the proposed change with before/after, the principle behind it, and the trade-off if any. If nothing warrants changing for this lens, say so and return empty findings.
Sub-agent prompt template (adapt the lens name and skill name per row):
You are reviewing TypeScript/React/web code changes from this session through the {lens} lens.
First, load the
{skill}skill using the Skill tool — read it fully before reviewing.Then run
git diffto see what changed. Review those changes exclusively through your lens.For each finding, return: file path + line range, proposed change (before/after), the principle motivating it, and any trade-off. If nothing needs changing for your lens, say so plainly.
Do not apply changes. Propose only.
After all sub-agents return, aggregate their findings:
Output
Present the aggregated review as a single batch:
- Files reviewed (union of all sub-agent scopes)
- Proposed changes, grouped by file, each tagged with its lens and including before/after and reasoning
- Conflicts between lenses (e.g., one lens wants to add abstraction, another wants to simplify) — flag these for the user to decide
- Anything a sub-agent considered but rejected, with reasoning
- If no sub-agent found anything worth changing, say so plainly and stop
Wait for the user to approve before applying any edits.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

