mysql-expert

A guide to MySQL and MariaDB, databases that store application data in tables and can be queried with SQL.

In plain words
What is it for?
Writing SQL queries, configuring MySQL, choosing storage engines, adding indexes, analysing query plans, tuning performance, and setting up replication.
Why use it?
It helps prevent common setup, security, encoding, and performance problems when designing or running these databases.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/iwritec0de/app-dev/mysql-expert
Any agent
npx skills add iwritec0de/app-dev --skill mysql-expert
Clone the repo
git clone --depth 1 https://github.com/iwritec0de/app-dev

Made for: Claude Code, Codex.

Per session 116 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,220 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00116 $0.01220
Opus 5 $0.00058 $0.00610
Sonnet 5 $0.00023 $0.00244
Haiku 4.5 $0.00012 $0.00122

Measured 2d ago against content hash d695898e4f03, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mysql-expert 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 2d 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.

skills/mysql-expert/SKILL.md · 109 lines

How it starts

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

MySQL Expert Skill

You are a MySQL/MariaDB expert specializing in InnoDB, query optimization, and database administration.

Critical Rules

  • Always use InnoDB — the only engine with ACID transactions, row-level locking, and crash recovery
  • Use utf8mb4, not utf8 — MySQL's utf8 is broken (3-byte, no emoji); utf8mb4 is true UTF-8
  • Define explicit PRIMARY KEYs — InnoDB clusters data on PK; implicit keys waste space
  • Use EXPLAIN — verify query plans before and after optimization
  • Use prepared statements — for security (SQL injection) and performance (plan caching)
  • Don't use query cache — removed in MySQL 8.0; use application-level caching instead
  • Collation matters — use utf8mb4_unicode_ci for case-insensitive, utf8mb4_bin for exact

Storage Engines

Engine Use Case Notes
InnoDB Everything (default) ACID, row locks, crash recovery, FK support
MEMORY Temporary lookup tables Lost on restart, table-level locks
MyISAM Legacy only No transactions, no FK, table locks — avoid

MySQL-Specific Types

Type Use Case Example
JSON Flexible data (MySQL 5.7+) data->>'$.name', JSON_EXTRACT()
ENUM Fixed small sets ENUM('active','inactive','deleted')
SET Multiple choice from fixed set SET('read','write','admin')
Generated columns Derived/computed data GENERATED ALWAYS AS (price * qty) STORED
BINARY(16) UUID storage (compact) UUID_TO_BIN(UUID(), 1) for ordered UUIDs

Advanced SQL (MySQL 8.0+)

-- Common Table Expression
WITH monthly AS (
  SELECT DATE_FORMAT(created_at, '%Y-%m') AS month, SUM(total) AS revenue
  FROM orders GROUP BY month
) SELECT * FROM monthly WHERE revenue > 10000;

-- Window function
SELECT name, salary, RANK() OVER (PARTITION BY department ORDER BY salary DESC) AS dept_rank
FROM employees;

-- JSON query
SELECT * FROM products WHERE data->>'$.category' = 'electronics';

-- Full-text search
SELECT *, MATCH(title, body) AGAINST('database optimization' IN BOOLEAN MODE) AS relevance
FROM articles WHERE MATCH(title, body) AGAINST('database optimization' IN BOOLEAN MODE);

Read the full file on GitHub · 109 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago First seen · 109 lines · 116 tokens per session scan A d695898e4f03

Subscribe to this mod's changes

mysql-expert is a skill published in the GitHub repository iwritec0de/app-dev (3 stars, last pushed 4mo ago), licensed MIT. It adds 116 tokens to every session and 1,220 once invoked, about $0.0006 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-31.

Related

Other skills, from other repositories

dummy-dataset

Generate realistic dummy datasets for testing with customizable columns, constraints, and output formats (CSV, JSON, SQL, Python script). Use when creating test data, building mock datasets, or generating sample data for development and demos.

phuryn/pm-skills · 48 tokens

strategy-red-team

Red-team a PRD, roadmap, or strategy by attacking its load-bearing assumptions before reality does. Steelmans then attacks each claim, ranks failure modes by impact × likelihood × cheapness-to-test, and returns the cheapest test and kill criteria for each. Use when stress-testing a plan, pressure-testing a strategy…

phuryn/pm-skills · 78 tokens

retro

Facilitate a structured sprint retrospective — what went well, what didn't, and prioritized action items with owners and deadlines. Use when running a retrospective, reflecting on a sprint, creating action items from team feedback, or learning how to run effective retros.

phuryn/pm-skills · 52 tokens

release-notes

Generate user-facing release notes from tickets, PRDs, or changelogs. Creates clear, engaging summaries organized by category (new features, improvements, fixes). Use when writing release notes, creating changelogs, announcing product updates, or summarizing what shipped.

phuryn/pm-skills · 57 tokens

competitive-battlecard

Create sales-ready competitive battlecards comparing your product against a specific competitor — positioning, feature comparison, objection handling, and win/loss patterns. Use when preparing sales teams, creating competitive materials, or responding to 'why not competitor X?'.

phuryn/pm-skills · 52 tokens

stakeholder-map

Build a stakeholder map using a power/interest grid, identify communication strategies per quadrant, and generate a communication plan. Use when managing stakeholders, preparing for a launch, aligning cross-functional teams, or planning stakeholder engagement.

phuryn/pm-skills · 47 tokens