Mysql Index Auditのロゴ

Mysql Index Audit

コミュニティ
Integralist
mysql-index-audit

Statically audit a codebase's MySQL indexes against the queries that use them. Use when checking for leftmost-prefix violations, partially used composite indexes, index killers such as leading wildcards or function-wrapped columns, or redundant and missing indexes.

概要

公開者Integralist
リポジトリagent-skills
スキル名mysql-index-audit
スター
26
フォーク
1
同梱ファイル
3
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 3個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    IntegralistがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Mysql Index Audit」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/Integralist/agent-skills/tree/main/.agents/skills/mysql-index-audit
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Integralist/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/.agents/skills/mysql-index-audit .claude/skills/mysql-index-audit
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでMysql Index Auditを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にMysql Index Auditを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Mysql Index Auditは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

This audit reads code only; it never connects to a database. Static matches are signals, not proof: every finding must say verify with EXPLAIN, and the report must end with the commands to run against the database.

Scope. Audit the given path or glob, or the whole repository when no argument is given. --diff means files changed on the branch: git diff --name-only "$(git merge-base HEAD main)"...HEAD, or use master when that is the default branch. --uncommitted means git diff --name-only HEAD plus untracked files from git status --porcelain.

Audit sequence. Before inventorying, read INVENTORY-GUIDE.md. Before classifying, read CLASSIFICATIONS.md. If interpreting gathered EXPLAIN output, read EXPLAIN-REFERENCE.md.

  1. Inventory indexes and queries. Build one record for each definition and query site. Run the two mechanical inventories concurrently as independent subagents when supported, on the cheapest adequate tier; use SUBAGENT-STEERABILITY.md for their completion and retry protocol. Otherwise inventory them in turn.
  2. Classify each query against indexes on its table. Give every query a classification or mark it clean. Dynamic or materialized cases that can't be resolved statically belong under Needs manual EXPLAIN, not guesses.
  3. Report findings by severity. Each finding includes the ordered index columns and source line, query and source line, classification, why it matters, and a concrete fix. Add any cases needing manual EXPLAIN and end with the follow-up commands in the report shape below.

[!IMPORTANT] Before recommending a query rewrite, check that it preserves filtering, row sets, ordering, limits, and deduplication. Flag equivalence that is not proven. Behaviour changes need approval; don't label them as optimization.

Report

Group findings under these headings. Include counts and source locations. For any finding, use the format shown under High.

markdown
## MySQL Index Audit

- **Scope:** <path | branch-diff | uncommitted>
- **Indexes found:** <n>
- **Query sites found:** <n>

### High: index unused or partially used

- **UNUSED** `users.idx_name_country_state (last_name, country, state)`
  (`db/schema.sql:42`)
  - Query `WHERE country = 'UK'` (`internal/users/repo.go:88`) skips the
    leftmost column `last_name`, so the table is scanned.
  - **Fix:** add an index leading with `country`.

### Medium: killers, range ordering, missing indexes

### Low: redundant indexes, covering opportunities

### Needs manual EXPLAIN

- `internal/search/builder.go:120`: WHERE clause built conditionally.

### Verify with EXPLAIN

```sql
EXPLAIN SELECT ...;          -- key vs possible_keys, type, Extra
EXPLAIN ANALYZE SELECT ...;  -- real rows and timing (MySQL 8.0.18+)

-- Find the slow queries to fix first
SHOW VARIABLES LIKE 'slow_query_log';
SHOW VARIABLES LIKE 'long_query_time';
SET GLOBAL long_query_time = 0.5;
SET GLOBAL slow_query_log = 'ON';
```

Sources: source notes, EXPLAIN output, Index Merge, generated columns, and Use The Index, Luke.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Mysql Index Audit」では何ができますか?

Statically audit a codebase's MySQL indexes against the queries that use them. Use when checking for leftmost-prefix violations, partially used composite indexes, index killers such as leading wildcards or function-wrapped columns, or redundant and missing indexes.

TypingMindでMysql Index Auditを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Mysql Index Auditはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにMysql Index Auditをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/Integralist/agent-skills/tree/main/.agents/skills/mysql-index-auditを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Mysql Index Auditを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Mysql Index Auditで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもMysql Index Auditを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Mysql Index Audit」は無料ですか?

IntegralistがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇