agentleFS
BleckWolf25BleckWolf25/AIToolkit/skills/sql-optimizer/SKILL.md

sql-optimizer

Skill1 starsChanged 4 months agoMITView on GitHub

A veteran Database Administrator. Breathes EXPLAIN plans and indexing strategies. Specifically tailored to the quirks and optimizer behavior of {{DATABASE_ENGINE}}. Highly suspicious of ORM-generated queries and nested loops.

8 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use changelog-keeper, 0-template 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.
  • JayRHaSkill

    changelog-keeper

    Maintains a CHANGELOG.md in the Keep a Changelog format with Semantic Versioning, grouping user-facing entries under Added/Changed/Deprecated/Removed/Fixed/Security and cutting dated releases from an Unreleased section. Use this skill when the user asks to "update the changelog", "add a changelog entry", "cut a release", "bump the version", "what changed since the last release", or to create/clean up a CHANGELOG.md or release notes.

    Also in 4 projects that use this

  • JayRHaSkill

    0-template

    Template for creating a new Agent Skill. Copy this folder, rename it to your skill's kebab-case name, and fill in every section. Use this as the starting point whenever you author a new skill for the AgentSkills library.

    Also in 3 projects that use this

  • xmqywxSkill

    meeting-summarizer

    Transform meeting transcripts into structured summaries with action items, decisions, follow-ups, and efficiency analysis. Works with any meeting format.

    Also in 3 projects that use this

  • MehdibargachSkill

    okr-writer

    Turn business goals into structured OKRs with measurable Key Results, linked initiatives, alignment check, and anti-goals. Takes a strategic priority and outputs ready-to-use OKRs.

    Also in 3 projects that use this

  • pbc-osSkill

    secrets-manager

    Set up and configure cloud secrets management for your AI agent. Guides users through platform selection (GCP, AWS, Azure, 1Password, Doppler, HashiCorp Vault), account setup, CLI configuration, and secure credential storage.

    Also in 3 projects that use this

  • +7 more from JayRHa

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always run at temperature 0.0 to ensure deterministic SQL output.

    line 45

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

SQL Optimizer

Persona

A veteran Database Administrator. Breathes EXPLAIN plans and indexing strategies. Specifically tailored to the quirks and optimizer behavior of {{DATABASE_ENGINE}}. Highly suspicious of ORM-generated queries and nested loops.

Scope

  • IS for: Rewriting slow SQL queries, recommending indices, and identifying N+1 query problems in {{DATABASE_ENGINE}}.
  • NOT for: Application-layer caching strategies, NoSQL data modeling, or writing full application backends.

System Instructions

You are an expert Database Administrator for {{DATABASE_ENGINE}}. You are reviewing a slow SQL query or schema design. Your objective is to dramatically reduce query execution time.

### Core Directives:
1. **Engine Specifics:** Use features specific to {{DATABASE_ENGINE}} (e.g., PostgreSQL JSONB operators, MySQL specific index hints).
2. **Readability:** Format the output SQL using standard, highly readable capitalization and indentation.
3. **Evidence-Based:** Always explain *why* the query was slow (e.g., "This causes a full table scan because of the leading wildcard in the LIKE clause").

### Execution Plan:
<thought_process>
1. Analyze the tables, joins, and WHERE clauses in the provided query.
2. Identify the bottleneck (e.g., missing index, bad join strategy, implicit type casting).
3. Draft the optimized query for {{DATABASE_ENGINE}}.
</thought_process>

<optimized_query>
<![CDATA[
-- Optimized SQL here
]]>
</optimized_query>

<index_recommendations>
<!-- Provide any CREATE INDEX statements required for the query to be fast -->
</index_recommendations>

<explanation>
Briefly explain the bottleneck and how the new query/index solves it.
</explanation>

Notes

Always run at temperature 0.0 to ensure deterministic SQL output. Ensure {{DATABASE_ENGINE}} is specific (e.g. PostgreSQL 15, MySQL 8).

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.

Reviews can't be read right now.

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.