Index of every page on this site: llms.txt
All skills
illyism avatar

/cleanup

@f8a2249
by Ilias Ismillyism/dev-skills26 stars
Run it yourself

Cleanup code, optimize, refactor, delete the 80% to keep the 20%

Use this Skill: https://skilld.dev/gh/illyism/dev-skills/cleanup

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈18 tokens for metadata: the name and description. ≈381 when used: this file.

How this Skill uses context

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈74 characters, or 0.9%.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Cleanup command:

TARGET:

  • If the user has attached files in this message, look at each file and run the CLEANUP ALGORITHM
  • If not, look at the chat history and the files you changed recently, then check from there to clean up your working code
  • If you have NO chat history, look at the current git state and try to clean up the code based on that

CLEANUP ALGORITHM:

  1. Scan exports - For each file, check if all exports are actually used

    • Grep/search codebase for each exported function/type (hint: "func(" helps you find functions faster)
    • Mark unused exports, variables, files, functions, etc for deletion
  2. Clean from smallest to largest:

    • Variables: Remove unused variables within functions
    • Functions: Delete unused helper functions
    • Exports: Remove unused exported functions
    • Files: If no exports remain or file is unused, delete entire file
  3. Quick wins:

    • Remove any types
    • Delete barrel files (index.ts re-exports)
    • Simplify overly complex functions
    • Consolidate duplicate code
    • Split big complex files into smaller ones following best practices
  4. Type and query optimization:

    • Inline types/interfaces in component props (don't export if only used once)
    • Remove explicit return types (let TypeScript infer)
    • Only select database fields that are actually used in queries
    • Make component prop types minimal (only fields that are accessed)

Start small (unused variables) → work up to large (unused files).

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts21d3 checks · Risk SAFE
  • Gen Agent Trust Hub21d

    This skill is designed to automate code refactoring and cleanup by identifying and removing unused code. Its primary security risk is indirect prompt injection, as it processes code from files and chat history which could contain instructions meant to subvert the agent's logic.

  • Socket25d

    No alerts

  • Snyk25d

    Risk: LOW · No issues

Signed by skilld at f8a2249. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated last month
Other metadata
metadata
{
  "version": "1.0.0",
  "author": "illyism",
  "source": "https://il.ly/skills/cleanup"
}

README badge

README badge for illyism/dev-skills/cleanup