Skip to content
Back to skills

Optimize

ASecurity

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.

  • 22 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 16, 2026
ai-agentsgoapi

Works with

  • api

Security analysis

A100/100

Scanned October 16, 2026

npx -y skills add Illyism/dev-skills --skill optimize --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Optimize?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Optimize
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/illyism-optimize/badge)](https://www.skillsdirectory.com/skills/illyism-optimize)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: optimize
description: 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.
metadata:
  version: 1.0.0
  author: illyism
  source: https://il.ly/skills/optimize
---

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.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.