Skip to content
Back to skills

Index Optimization

ASecurity

Review and improve indexing strategy for changed data paths.

  • 8 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 2, 2026
ai-agentsdatabaseperformance

Security analysis

A100/100

Pro scans all 7 files and shows the line behind each finding

Scanned September 2, 2026

npx -y skills add Eliyce/paqad-ai --skill index-optimization --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Index Optimization?

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

Security grade badge for Index Optimization
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/eliyce-index-optimization/badge)](https://www.skillsdirectory.com/skills/eliyce-index-optimization)

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: index-optimization
description: Review and improve indexing strategy for changed data paths.
model_tier: reasoning
triggers:
  - database_impact:
      - schema-change
      - query-change
cacheable: true
cache_key_inputs:
  - database/migrations/**
  - docs/modules/*/database/indexes.md
  - docs/modules/*/database/queries.md
output_format: markdown
input_schema:
  query_paths:
    type: path[]
    required: true
    description: Queries or explain plans to analyze.
  schema_paths:
    type: path[]
    required: false
    description: Relevant schema docs or migrations.
---

## What It Does

Evaluates whether changed query paths have the right supporting indexes and explains tradeoffs without drifting into speculative indexing unrelated to the current request.

## Use This When

Use this when a request introduces new filters, sorts, joins, uniqueness rules, or query-heavy flows that depend on index coverage.

## Inputs

- Read the changed query paths, migrations, and existing index docs first.
- Read `runtime/capabilities/coding/checklists/database-review-20pt.md` and `references/index-review-guide.md` before evaluating changes.
- Read any query inventory or performance notes tied to the affected module.

## Procedure

1. Run `scripts/scan-query-shapes.sh <files...>` to surface query patterns implying index requirements.
2. Cross-reference each shape with `assets/index-rules.txt` to know which index shape actually serves it.
3. Audit existing index docs for redundancy and ordering against those shapes.
4. Bucket findings into Correctness / Migration Safety / Performance per `assets/output.template.md`.
5. Validate with `scripts/lint-output.sh`. Recommend only indexes that serve the changed behavior or a directly adjacent hot path — no speculative.

## Output Contract

- Return sections named `Correctness Risks`, `Migration Safety Risks`, and `Performance Risks`.
- For each item, name the query path or index and the reason it is risky or recommended.
- If no changes are needed, state `Performance Risks: none` and keep the other buckets explicit.

## Escalate / Stop Conditions

- Ask when workload shape, row volume, or hot-path expectations are missing and materially change the recommendation.
- Warn when an index recommendation would meaningfully increase write cost or migration risk.
- Do not suggest speculative indexes without a concrete changed access pattern.

## Resources

- `references/index-review-guide.md`
- `scripts/scan-query-shapes.sh`
- `scripts/lint-output.sh`
- `assets/output.template.md`
- `assets/index-rules.txt`
- `runtime/capabilities/coding/checklists/database-review-20pt.md`
- `agents/openai.yaml`

Files in this skill

  • SKILL.md2.6 KB
  • agents/openai.yaml128 B
  • assets/index-rules.txt564 B
  • assets/output.template.md458 B
  • references/index-review-guide.md245 B
  • scripts/lint-output.sh774 B
  • scripts/scan-query-shapes.sh1.4 KB

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.

Comments

Loading comments…

Newsletter

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