Esqlのロゴ

Esql

コミュニティ
sherman
esql

Review Elastic ES|QL queries for Elasticsearch 9.5.4 and later, covering compatibility, correctness, Prometheus and 01.metrics operational-metric semantics, alert reliability, and query performance. Use when Codex is asked to inspect, critique, fix, or rewrite ES|QL pipelines, especially Elastic/Kibana alert queries embedded in .yaml/.yml files or standalone .esql queries.

概要

公開者sherman
リポジトリcodex-skills
スキル名esql
スター
40
フォーク
6
同梱ファイル
5
リンク
  • Markdown形式の指示

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

  • どのLLMでも利用可能

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

  • 5個の同梱ファイル

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

  • オープンソース

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

インストール

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

1

TypingMindにインストール

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

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

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

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

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

TypingMindで使用

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

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

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

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

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

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

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

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

スキルの指示

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

ES|QL Query Review

Workflow

  1. Target Elasticsearch 9.5.4 and later; 9.5.4 is the minimum local version, not an exact version pin. Use the actual deployment version when known, and verify version-sensitive syntax and behavior against applicable official Elastic docs or matching-version material already supplied inside this project.
  2. Detect the input format before extracting queries:
    • For .yaml/.yml, parse the YAML and review each ES|QL block scalar such as query: |. Read the surrounding alert metadata and comments before reviewing the query.
    • For .esql, treat the file as one query unless the user explicitly identifies multiple queries.
  3. Infer the query intent, source grain, time range, whether the alert runner injects the time window, metric format and type, grouping grain, and alert condition before judging the query. Distinguish traditional Prometheus metrics from the 01.metrics operational format before reviewing aggregation semantics. In YAML alerts, use fields such as name, description, severity, interval_sec, and time_window as part of that contract.
  4. Read references/review-checklist.md for any non-trivial review. Read references/01-metrics.md when the query uses operational fields such as metrics.calls, metrics.failures, or metrics.duration_*, or when the metric format is ambiguous. Read good-examples.esql and bad-examples.esql when matching this repository's preferred review style or adding new examples. In bad-examples.esql, text after PROBLEM: or Problem: is annotation, not ES|QL.
  5. Review in passes: syntax/version, source scope, filter placement, aggregation grain, metrics semantics, null and multivalue behavior, arithmetic, alert determinism, result limits, and output shape.
  6. Prefer findings over generic advice. Every finding should name the risky fragment, explain why it matters, and propose a concrete fix or safer rewrite.

Choosing TS or FROM

In our metrics environment, all stored counters are interval deltas, including counters originating from Prometheus. Treat this as the established local data contract. For a direct total over complete intervals, sum the counts; for throughput, divide by the covered duration. Elasticsearch 9.5.4 also supports RATE and INCREASE on delta counters using the metric mapping and configured temporality metadata. Check that field configuration when judging a query; do not reject these functions merely because the samples are deltas. See references/ts-vs-from.md.

Choose from the required calculation, not from the fact that the source is a time series data stream (TSDS). Use FROM when matching samples can be combined directly; use TS when each series needs a separate calculation before combining results. For metric aggregations or a proposed TS/FROM rewrite, read references/ts-vs-from.md for the decision table, equivalence conditions, and examples.

Review Scope

  • Keep filesystem inspection inside the current ES|QL project and files explicitly supplied by the user.
  • Do not search sibling repositories, parent workspaces, application code, deployment code, or metric producers to infer undocumented behavior unless the user explicitly asks for that investigation.
  • Use the query, YAML metadata and comments, bundled references, examples, and official Elastic documentation. If these do not establish a data contract, state the assumption or uncertainty in the review instead of searching external code.

Review Stance

  • Be strict about correctness, false negatives, false positives, arbitrary alert rows, and obviously excessive shard scans.
  • Be careful with inferred data contracts. If a problem depends on undocumented assumptions such as "one document per metric per timestamp", say that explicitly.
  • Do not claim that a final KEEP or DROP improves aggregation cost. It mostly reduces response payload after upstream work has already happened.
  • Do not rewrite the whole query unless the user asks. For review, preserve the original intent and give minimal corrected fragments.
  • Treat good-examples.esql as style calibration: narrow sources where possible, filter early, name intermediate fields, use conditional STATS, use deterministic SORT before top-N LIMIT, and produce alert-friendly details.
  • Apply the local interval-delta contract and the TS/FROM decision rule when reusing examples. Existing SUM(SUM_OVER_TIME(...)) examples do not prove that TS is needed.

Output Format

Start with findings, ordered by severity. Use this shape:

text
[severity] Short title
Fragment: `...`
Why: ...
Fix: ...

Use severities:

  • blocker: invalid ES|QL, wrong version, or query cannot return intended result.
  • high: likely false alert, missed alert, or severe avoidable cluster cost.
  • medium: fragile metric semantics, cardinality risk, nondeterministic output, or maintainability issue that can affect operations.
  • low: readability, naming, comments, magic constants, or minor style.

After findings, include a corrected fragment or full corrected query only when it materially helps. If there are no material issues, say so and list residual assumptions that could not be verified from the query alone.

Version Notes

The local version range is Elasticsearch 9.5.4 and later. Prefer official Elastic documentation applicable to the actual deployment version or a checked-out matching Elastic branch over memory. Useful starting points are in references/elastic-docs.md.

同梱ファイル

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

よくある質問

AIスキル「Esql」では何ができますか?

Review Elastic ES|QL queries for Elasticsearch 9.5.4 and later, covering compatibility, correctness, Prometheus and 01.metrics operational-metric semantics, alert reliability, and query performance. Use when Codex is asked to inspect, critique, fix, or rewrite ES|QL pipelines, especially Elastic/Kibana alert queries embedded in .yaml/.yml files or standalone .esql queries.

TypingMindでEsqlを使うメリットは何ですか?

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

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

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

Esqlを使えるAIモデルはどれですか?

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

Esqlは何個のAIモデルで使えますか?

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

AIスキル「Esql」は無料ですか?

shermanがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

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

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

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

すべて見る

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

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