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

/optimize

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

Optimizes code, queries, and features based on actual usage by removing unused fields, aggregations, JOINs, and unused complexity. Use when the user invokes /optimize or asks to slim queries to what the UI actually uses.

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

Nothing lands on disk. Nothing to clean up.

Fork this Skill

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

SKILL.md

≈58 tokens for metadata: the name and description. ≈468 when used: this file.

Description uses 2.9% of example budget

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

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

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

The 1% threshold is a size suggestion. Longer descriptions can still fit.

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.

TARGET:

  • Optimize code/queries/features based on ACTUAL usage, not assumptions
  • Remove everything that's not needed
  • Question every field, query, feature, and piece of complexity

ALGORITHM:

  1. Audit actual usage:

    • Grep/search codebase for each field/query/feature usage
    • Check UI components - what fields are actually rendered?
    • Check queries - what fields are actually selected?
    • Check APIs - what data is actually returned?
  2. Remove aggressively:

    • Delete unused fields from SELECT queries
    • Remove expensive aggregations if not displayed
    • Drop unused exports, functions, components
    • Eliminate unnecessary JOINs, GROUP BYs, subqueries
  3. Optimize for reality:

    • Base SELECT on actual UI needs (not "might need later")
    • Use scalar subqueries instead of JOINs when possible
    • Remove fields only used for filtering (keep in WHERE, remove from SELECT)
    • Cache only what's actually accessed frequently
  4. Simplify ruthlessly:

    • If it's expensive and not used → remove it
    • If it's "nice to have" → remove it
    • If it adds complexity without clear benefit → remove it
    • Question: "Would users notice if this disappeared?" If no → remove
  5. Conclusion:

    • When modifying a file, improve code quality in the surrounding area
    • Apply consistent patterns (e.g., error handling, naming conventions)
    • Extract duplicated logic if it appears 3+ times
    • Fix obvious issues (unused imports, inconsistent formatting)
    • Update related tests/types to match changes
    • Keep refactors small and focused - don't rewrite entire files
    • Verify UI still works as expected
    • Document breaking changes if any

Example: Query optimization - removed unused aggregate fields and dropped SELECT columns that were only needed for WHERE, kept only fields actually displayed in UI.

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 a standard developer tool designed to optimize code and database queries by identifying and removing unused components. It follows normal coding assistant patterns and does not exhibit malicious behavior.

  • Socket21d

    No alerts

  • Snyk21d

    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/optimize"
}

README badge

README badge for illyism/dev-skills/optimize