agentleFS
SleepyStewSleepyStew/mstack/skills/cleanup/SKILL.md

cleanup

Skill0 starsChanged 10 days agoMITView on GitHub

Survey a repo or folder for slop, propose a clean-up plan, then carry out the approved parts without changing behaviour. Use when the user says "cleanup" or "clean up this repo", or asks to remove dead code, slop or misleading comments and docs.

84 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use you-might-not-need-a-callback, you-might-not-need-a-memo and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • bibektimilsina00Skill

    you-might-not-need-a-callback

    Analyze and fix useCallback anti-patterns in your code

    Also in 3 projects that use this

  • bibektimilsina00Skill

    you-might-not-need-a-memo

    Analyze and fix useMemo/React.memo anti-patterns in your code

    Also in 3 projects that use this

  • Scylla23Skill

    redo

    Re-run the last routed task one model tier up (haiku → sonnet → opus → fable). User-invoked escalation when the previous result missed. Pass --dry-run to preview without running.

    Also in 3 projects that use this

  • SocialKit-APISkill

    video-transcripts

    Extract transcripts from social videos through SocialKit across YouTube, TikTok, Instagram, Facebook, X/Twitter, LinkedIn, and direct video file URLs. Use when the user asks to transcribe, get captions or subtitles, pull the spoken text, or read what a video says, including one video or many at once. Returns full text plus timestamped segments. Not for posting, private accounts, or unrelated website scraping.

    Also in 3 projects that use this

  • SentrySkill

    db-migrate

    Create database migrations using Drizzle Kit. Use when adding/modifying tables, columns, or indexes. Ensures schema.ts and migrations stay in sync.

    Also in 3 projects that use this

  • VercelSkill

    next

    Next.js renderer for json-render that turns JSON specs into full Next.js applications with routes, layouts, SSR, and metadata. Use when working with @json-render/next, building Next.js apps from JSON specs, or creating AI-generated multi-page applications.

    Also in 4 projects that use this

  • +3 more from bibektimilsina00

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 8 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 71 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Leave the repo smaller, clearer and less misleading, and behaving exactly as it did.

    line 8
  2. Distinctive:

    Run git status --short. Leave uncommitted work that is not yours alone, and stop to ask if it overlaps the scope.

    line 23
  3. Distinctive:

    Read the project's AGENTS.md or CLAUDE.md and its docs index, so you know which patterns are deliberate.

    line 25
  4. Distinctive:

    Run the checks CI runs that only read the code (typecheck, lint, unit tests) and record the result.

    line 30
  5. Very specific:

    Read, search and run analysis tools.

    line 38
  6. Distinctive:

    Put the effort where the slop is.

    line 43
  7. Very specific:

    Before you call anything dead, look for uses a search misses: names built from strings, file-based routes, auto-imports, config and CI …

    line 66
  8. Distinctive:

    When the plan is large, split it into batches that can each be reviewed in one sitting, and recommend which to do first.

    line 89
  9. Distinctive:

    After each commit, run the baseline checks again.

    line 99
  10. Distinctive:

    If an item turns out to need a behaviour change, drop it and move it to "Looks wrong".

    line 101

“Common” is measured: kept by at least 6 in 10 of the 71 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Cleanup

Leave the repo smaller, clearer and less misleading, and behaving exactly as it did. You survey on your own, propose a plan, and change nothing until the user approves it.

Cleanup never changes behaviour, meaning anything a user, an API caller or another program can observe: output, responses, screens, stored data and public interfaces. Removing a prop nobody passes is a clean-up. Removing a field from an API response is not, even when nothing here reads it. Anything that would change behaviour, including a likely bug, goes in the "Looks wrong" list for the user. Larger changes that make the project better belong to the improve skill.

1. Set the scope and baseline

  • The scope is what the user names. With none named, it is the whole repo.
  • Run git status --short. Leave uncommitted work that is not yours alone, and stop to ask if it overlaps the scope.
  • Read the project's AGENTS.md or CLAUDE.md and its docs index, so you know which patterns are deliberate.
  • Find what a commit or push sets off: read the CI config for deploys and releases. When a push to the current branch ships to production, say so at the top of the plan and recommend doing the work on a branch.
  • Run the checks CI runs that only read the code (typecheck, lint, unit tests) and record the result. This is the baseline. Note anything that already fails. Do not let a check install dependencies, rebuild generated files or start services: call the installed binary directly when the package script would. List every check you skipped and why.

2. Survey

Read, search and run analysis tools. Do not edit yet. Use the tools already installed in the project (knip, tsc --noEmit, cargo clippy, ruff). Do not download one. When a tool that would have helped is missing, say so in the plan.

Put the effort where the slop is. In a large repo, read the core in full and search the rest, and move on from a category that turns up nothing after a fair look. Look for:

  • Dead weight: unused files, exports, dependencies, flags, scripts, config and assets. Commented-out code.
  • Needless indirection: wrappers with one caller, pass-through layers, options nobody sets, abstractions with one implementation.
  • Duplication: the same logic in several places under the same contract. Code that only looks alike is not duplication.
  • Defensive noise: guards and try/catch for states the types rule out, inside trusted code.
  • Type escapes: any, casts and suppressions with no reason given.
  • Comments: narration, section banners, change history, and comments that no longer match the code. Keep comments that explain why.
  • Docs: pages that are stale, duplicated or wrong, and broken links. When the project has a docs/ folder, run the checker that sits beside this skill, ../documentation/scripts/check_docs.py from this skill's folder. It finds broken links. Wrong content only shows up by reading the docs against the code.
  • Inconsistency: two ways of doing one thing, and names that drifted.
  • Tests: tests that cannot fail, and tests that repeat each other.

Before you call anything dead, look for uses a search misses: names built from strings, file-based routes, auto-imports, config and CI references, package exports, Worker entry points and anything another repo imports.

3. Propose the plan

Reply with the plan and stop.

  • Clean-ups, grouped by class, since each class becomes one commit. Rank the classes by value for the risk. For each class: why it is slop, how you know removing it is safe, the risk and the rough size, then its items as file and line with a few words each.
  • Coverage. What you read in full, what you only searched, and which categories turned up nothing.
  • Looks wrong. Things that seem off but that cleanup must not touch: suspected bugs, swallowed errors, security smells, docs or names that contradict the code, behaviour that looks unintended. Give the file and line and say what you would check.
  • Left alone. What you considered and kept, and why, in a line each.
  • Prevention. For a class that was large, the cheapest check that would stop it coming back, such as a lint rule, a compiler flag or a dead-code check in CI. These are proposals, not part of the clean-up.

When the plan is large, split it into batches that can each be reviewed in one sitting, and recommend which to do first. Say so when the repo is already clean. An empty plan is a valid result.

4. Carry out what was approved

  • One class per commit, deletions first.
  • Touch only what the plan named. Do not reformat, rename public things, edit generated files or migrations, or upgrade dependencies. Remove an unused dependency through the package manager.
  • After each commit, run the baseline checks again. The result must match the baseline. If it does not, find out why before going on.
  • If an item turns out to need a behaviour change, drop it and move it to "Looks wrong".
  • Build approved prevention checks last, each in its own commit, and show that each one fails on the slop it targets.

5. Report

Per commit: what went and the diff size. Then the checks against the baseline, the "Looks wrong" list as it now stands, and anything approved that you did not do, with the reason.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.