magento-agent-sql

magento-agent-sql is a skill for Claude Code, Codex from furan917/magento-ai-toolkit. It costs 74 tokens per session (5,267 once invoked), scanned A, original, MPL-2.0.

A diagnostic assistant for Magento 2 database problems. Magento 2 is an e-commerce platform; the assistant examines queries, indexes, deadlocks, lock waits, and repeated database access, then produces a SQL report.

In plain words
What is it for?
Use it to review slow queries, EXPLAIN plans, schema changes, and profiler traces; propose indexes or query rewrites; and plan verification and database updates for MySQL 8 or MariaDB.
Why use it?
It helps identify why an online shop is slow or blocked and separates safe database changes from changes that may need downtime. It also connects proposed fixes to Magento's schema files.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code.

Good fit Use it to review slow queries, EXPLAIN plans, schema changes, and profiler traces; propose indexes or query rewrites; and plan verification and database updates for MySQL 8 or MariaDB.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/furan917/magento-ai-toolkit/magento-agent-sql
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add furan917/magento-ai-toolkit --skill magento-agent-sql
Clone the repo
git clone --depth 1 https://github.com/furan917/magento-ai-toolkit

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for magento-agent-sql

README.md
[![agentmods](https://agentmods.dev/badge/skills/furan917/magento-ai-toolkit/magento-agent-sql/github.svg)](https://agentmods.dev/skills/furan917/magento-ai-toolkit/magento-agent-sql)
Your own site
<a href="https://agentmods.dev/skills/furan917/magento-ai-toolkit/magento-agent-sql"><img src="https://agentmods.dev/badge/skills/furan917/magento-ai-toolkit/magento-agent-sql/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for magento-agent-sql

Your own site · 80×15
<a href="https://agentmods.dev/skills/furan917/magento-ai-toolkit/magento-agent-sql"><img src="https://agentmods.dev/badge/skills/furan917/magento-ai-toolkit/magento-agent-sql.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,267 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00074 $0.05267
Opus 5 $0.00037 $0.02634
Sonnet 5 $0.00015 $0.01053
Haiku 4.5 $0.00007 $0.00527

Measured 9d ago against content hash 4dfc59b7fe10, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

magento-agent-sql scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agent-skills/magento-agent-sql/SKILL.md · 392 lines

How it starts

The opening of the file, as written. The whole thing — 392 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent: SQL Expert

Purpose: Autonomously diagnose slow queries, missing or wrong indexes, deadlocks, lock-wait timeouts, and N+1 patterns in Magento 2. Propose db_schema.xml changes with correct referenceId and whitelist regeneration steps. Assess online-DDL feasibility (ALGORITHM=INSTANT / LOCK=NONE) per engine version and warn when a change requires a maintenance window. Compatible with: Any agentic LLM with file read and shell execution tools (Claude Code, GPT-4o with tools, etc.) Usage: Paste a slow query, an EXPLAIN plan, a db_schema.xml diff, a profiler trace, or describe a slow table. The agent will diagnose and produce a SQL Report. Companion skills: Load alongside for deeper reference:

  • magento-sql.md — Select builder, placeholders, batch ops, transactions, composite indexes, db_schema.xml, MySQL 8 / MariaDB feature matrix
  • magento-db-schema.md — Model / ResourceModel / Collection pattern, declarative schema basics

Skill Detection

Before starting, scan your context for companion skill headers:

Look for in context If found If not found
# Skill: magento-sql Use its batch-op patterns, composite-index rules, MySQL/MariaDB feature matrix, and db_schema.xml conventions as the primary implementation reference Use the embedded diagnostic checks and index-design rules in this file
# Skill: magento-db-schema Use its Model/ResourceModel patterns and table-creation templates Use the embedded db_schema.xml examples in Steps 3–4

Skills take priority — they may contain more detail or be more up to date than the embedded fallbacks.

Agent Role

You are an autonomous Magento 2 database specialist. You diagnose slow queries, propose composite indexes by actual WHERE/ORDER BY/GROUP BY usage, and detect when a query needs a rewrite rather than an index. The default path for schema changes is db_schema.xml + regenerated whitelist + setup:upgrade. The documented escape hatch for huge tables (tens of millions of rows, where letting setup:upgrade run an in-place ALTER would stall the store for hours) is a manual ALTER TABLE … ALGORITHM=INSTANT, LOCK=NONE ahead of setup:upgrade, with db_schema.xml and db_schema_whitelist.json updated in the same deploy so setup:upgrade becomes a no-op. You detect the engine (MySQL vs MariaDB) and its version before recommending features that differ across engines.

Read the full file on GitHub · 392 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 392 lines · 74 tokens per session scan A 4dfc59b7fe10

Subscribe to this mod's changes

magento-agent-sql is a skill published in the GitHub repository furan917/magento-ai-toolkit (34 stars, last pushed 4mo ago), licensed MPL-2.0. It adds 74 tokens to every session and 5,267 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

magento-model-developer

Designs and implements data layer architecture for Magento 2. Use when creating data models, designing database schemas, implementing repositories, or working with EAV/flat table structures. Masters entity design, repository patterns, collections, and database optimization.

maxnorm/magento2-agent-skills · 54 tokens

magento-cache-analyst

Optimizes Magento 2 caching strategies for enterprise performance. Use when optimizing cache performance, configuring full-page cache, implementing Redis/Memcached, or designing cache invalidation strategies. Masters FPC, application cache, and distributed caching solutions.

maxnorm/magento2-agent-skills · 54 tokens

magento-index-analyst

Optimizes Magento 2 indexing for search performance and database efficiency. Use when optimizing search performance, configuring Elasticsearch, designing database indexes, or improving reindexing strategies. Masters indexer optimization, Elasticsearch configuration, and database indexing.

maxnorm/magento2-agent-skills · 52 tokens

postgres-commit-history-article

A workflow for comparing PostgreSQL source-code changes between two Git commits and, when useful, writing a Chinese Markdown article about them. PostgreSQL is a database system, and a commit is a saved change in a Git repository.

digoal/blog · 127 tokens

b2c-custom-objects

Store and query custom business data using CustomObjectMgr, OCAPI Data API, and Shopper Custom Objects API. Use this skill whenever the user needs to create, read, update, or search custom object instances, build processing queues with status fields, choose between site-scoped and organization-scoped storage, or query…

SalesforceCommerceCloud/b2c-developer-tooling · 104 tokens

b2c-querying-data

Write efficient data queries in B2C Commerce for products, customers, and orders. Use this skill whenever the user needs to search products on a storefront page, look up customer profiles, query orders, paginate search results, or fix slow category pages. Also use when they ask about performance problems with data…

SalesforceCommerceCloud/b2c-developer-tooling · 108 tokens