agentleFS
orbit-collectiveorbit-collective/orbit-skills/skills/cleanup/SKILL.md

cleanup

Skill1 starsChanged 41 days agoMITView on GitHub

Clean up code in the Orbit repository within a defined scope without changing its behavior. Use for /cleanup and for requests to remove dead code, unused imports, redundant fragments, or outdated comments.

71 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use chips, react-query-best-practices and 10 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.
  • udecodeSkill

    chips

    Run the project's suggested-task ledger, the chips. /chips alone brings this session's open tasks up to date: it applies what the ledger helper says, settles stale and split tasks, cards what can start and reports the board, and /chips all also takes the ship-list tasks and the ones no live session owns, and merges duplicate tasks across the board. Use for /chips, /chips offer, start or drop, \"what chips are open\", \"suggest a task for X\", \"update the chips\", \"clean up the chips\", \"which chips are stale\", \"is this chip still worth doing\", \"merge duplicate chips\", at the last hand-back of a run that offered a task, and whenever pstack would file a tracked issue, a follow-up, a reflect Backlog item or an out-of-band PR.

    Also in 3 projects that use this

  • bibektimilsina00Skill

    react-query-best-practices

    Audit and fix React Query usage in apps/web — enforce query key factories, signal forwarding, staleTime, and proper mutation patterns. Use when reviewing or fixing server-state code.

    Also in 3 projects that use this

  • bibektimilsina00Skill

    you-might-not-need-a-callback

    Analyze and fix useCallback 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

  • Aetheria-Labs1Skill

    plan-page

    Plan one storefront page from strategy through final copy, section order, proof, offers, template direction, responsive layout, and production asset requirements. Stops at an approved execution-ready specification.

    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

  • +3 more from bibektimilsina00

The file

Show its rules and text

We split this skill into the rules it gives an agent

21 rules. 0 are common, 11 are distinctive, and 10 are very specific to this project.

  • 0

    Common

    Most of the 61 edited versions we read keep these.

  • 11

    Distinctive

    This author's own choices. Worth a look.

  • 10

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Remove verified redundant code and simplify local fragments in the Orbit repository (Laravel + Inertia.js + React/TypeScript), preserving …

    line 8
  2. Distinctive:

    Do not add features, fix discovered bugs, or change architecture along the way.

    line 13
  3. Very specific:

    Do not change routes, controller responses, Inertia prop shapes, the database schema or migrations, Policies, permissions …

    line 14
  4. Very specific:

    Do not update dependencies, remove packages, or change tool configuration (eslint.config.js, vite.config.js, tsconfig.json, phpunit.xml, …

    line 15
  5. Very specific:

    Do not mass-format. Do not run npm run lint or vendor/bin/pint over the whole repository.

    line 16
  6. Very specific:

    Do not touch already-run migrations in database/migrations/ — they are history, even if they reference code that no longer exists.

    line 17
  7. Very specific:

    Do not create commits, PRs, or publish anything unless the user explicitly asked for it in this session.

    line 18
  8. Very specific:

    Read CLAUDE.md. Check the Git state, the available scripts (package.json, composer.json, Makefile), and the project conventions.

    line 23
  9. Distinctive:

    Before removing anything, account for Orbit's indirect usage:

    line 26
  10. Distinctive:

    If you cannot confirm the code is unused, keep it and describe the uncertainty.

    line 32
  11. Very specific:

    Do not remove an import just because its symbol is unused: it may perform a needed side effect (e.g.

    line 38
  12. Distinctive:

    Do not remove a TODO just because it is old.

    line 40
  13. Distinctive:

    Do not treat an export, route, controller action, or file as redundant just because it has no local consumer.

    line 41
  14. Distinctive:

    Do not merge similar fragments if they differ in meaning or would require a new abstraction.

    line 42
  15. Very specific:

    Do not delete tests to get a green run.

    line 43
  16. Distinctive:

    If cleaning something up would require a behavior change, skip that fragment and continue with the safe changes in scope.

    line 44
  17. Distinctive:

    Run the existing checks for the changed area, using the repository's commands rather than guessing script names:

    line 48
  18. Very specific:

    When removing modules or components, also run npm run build, which can catch import and bundling errors.

    line 51
  19. Distinctive:

    Do not add tests just for removing an unused import.

    line 52
  20. Distinctive:

    Never claim behavior was verified if the relevant checks were not run.

    line 54
  21. Distinctive:

    If there are no safe changes, say so plainly.

    line 65

“Common” is measured: kept by at least 6 in 10 of the 61 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

Remove verified redundant code and simplify local fragments in the Orbit repository (Laravel + Inertia.js + React/TypeScript), preserving the application's existing behavior and public contracts.

Boundaries

  • Work only within the scope the user specified. Read dependencies outside it when needed to judge whether a change is safe.
  • Do not add features, fix discovered bugs, or change architecture along the way. Report such issues separately.
  • Do not change routes, controller responses, Inertia prop shapes, the database schema or migrations, Policies, permissions (App\Enums\Permissions\Permission), error handling, or visible UI behavior.
  • Do not update dependencies, remove packages, or change tool configuration (eslint.config.js, vite.config.js, tsconfig.json, phpunit.xml, composer.json, package.json) without a separate request.
  • Do not mass-format. Do not run npm run lint or vendor/bin/pint over the whole repository; limit formatting to the files you changed. Never edit vendor/, node_modules/, public/build/, coverage*/, bootstrap/cache/, or the lockfiles (composer.lock, package-lock.json).
  • Do not touch already-run migrations in database/migrations/ — they are history, even if they reference code that no longer exists.
  • Do not create commits, PRs, or publish anything unless the user explicitly asked for it in this session. When they do, use the commit skill, keeping the cleanup in refactor/chore commits separate from behavior changes.
  • Preserve the user's existing changes. Never use git reset, git clean, or git checkout to discard them.

Process

  1. Read CLAUDE.md. Check the Git state, the available scripts (package.json, composer.json, Makefile), and the project conventions.
  2. Establish the scope. If none is given, limit yourself to files changed against HEAD (including staged) plus relevant untracked files. If there are no changes and no target, ask for a file, directory, or module. Never start cleaning the whole repository by default.
  3. Find candidates and check their usage with rg and project tooling (npx tsc --noEmit, ESLint's unused-vars rules). An empty search result alone does not prove code is dead.
  4. Before removing anything, account for Orbit's indirect usage:
    • Inertia pages are resolved by name from Inertia::render('Name', …) — a page file with no import is not dead. Search controllers for the render name.
    • Laravel container and conventions: classes bound or resolved by the container, Service Providers, event → listener mappings and auto-discovery in app/Listeners, Jobs dispatched by class name, Policies resolved by model, Form Requests type-hinted in controllers, Artisan commands in app/Console/Commands, scheduled tasks in routes/console.php.
    • Registries and enums: integration notifiers/importers implementing app/Contracts/*, enum cases used in the database or seeders (permissions, notification types, automation triggers/actions), config keys read via config(), Blade views, and route names used through route() in PHP or the frontend.
    • Model members: accessors, mutators, casts, scopes (scopeX called as ->x()), relationships called as dynamic properties, $fillable/$appends.
    • Frontend: components used through barrel files or dynamic maps, types in resources/js/types/ shared with tests, and code referenced only from documentation/en|pl/ guides (update or keep — don't silently break a guide's snippet). If you cannot confirm the code is unused, keep it and describe the uncertainty.
  5. Make small, local changes. Remove confirmed unused imports, private symbols, unreachable fragments, or comments that describe code that no longer exists. Simplify only when equivalence is clear.
  6. Review the full resulting diff and run appropriate verification.

Evaluation rules

  • Do not remove an import just because its symbol is unused: it may perform a needed side effect (e.g. CSS imports, @testing-library/jest-dom, bootstrap.ts).
  • Preserve execution order, call counts, side effects (activity logs, dispatched events and notifications), null/undefined handling, data ordering, and return types.
  • Do not remove a TODO just because it is old. Remove it only after confirming it was resolved or is obsolete.
  • Do not treat an export, route, controller action, or file as redundant just because it has no local consumer.
  • Do not merge similar fragments if they differ in meaning or would require a new abstraction. Report a larger refactor as a proposal.
  • Do not delete tests to get a green run. Removing a test requires proof that it covers removed, genuinely redundant code. Keep the coverage gates in mind (90% backend via composer test-coverage, thresholds in vite.config.js for the frontend).
  • If cleaning something up would require a behavior change, skip that fragment and continue with the safe changes in scope.

Verification

  • Run the existing checks for the changed area, using the repository's commands rather than guessing script names:
    • Frontend: npx tsc --noEmit, npx eslint <changed files>, npx vitest run <affected tests> (or make type-check, make test-js in Docker).
    • Backend: vendor/bin/pint <changed files>, php artisan test --filter=<TestName> or composer test (or make test in Docker).
  • When removing modules or components, also run npm run build, which can catch import and bundling errors.
  • Do not add tests just for removing an unused import. For a non-obvious simplification, use a behavior test or drop the change if it cannot be verified reliably.
  • Separate pre-existing failures from regressions caused by your change. Do not fix unrelated problems.
  • Never claim behavior was verified if the relevant checks were not run.

Final report

Briefly state:

  • What was removed or simplified, and in which files.
  • How you confirmed the removed elements are not needed.
  • What verification you ran and with what result; what remains unverified.
  • Which candidates you skipped because of uncertainty or because they were out of scope.

If there are no safe changes, say so plainly. Never generate changes just to produce a diff.

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.