db-mysql

Guides MySQL schema design, migrations, indexing, and query review across project phases.

Updated Mar 14, 2026
One-click install
npx skills add https://github.com/jcg-admin/IACT-ui --skill db-mysql-jcg-admin
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: db-mysql
Source: https://github.com/jcg-admin/IACT-ui/tree/main/.claude/skills/db-mysql
Command: npx skills add https://github.com/jcg-admin/IACT-ui --skill db-mysql-jcg-admin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working with MySQL in a growing project often leads to missing foreign key indexes, inconsistent charsets, non-reversible migrations, and unverified slow queries. This Skill provides a phase-by-phase checklist so database work is specified, implemented, and reviewed consistently. ## Core Features & Use Cases - Schema Specification: Defines what to document per table in requirements specs, including columns, constraints, foreign keys with ON DELETE/ON UPDATE behavior, and justified indexes. - Migration Conventions: Enforces an implementation order covering UP migrations, separate index migrations for large tables, structure verification with DESCRIBE or SHOW CREATE TABLE, and functional DOWN migrations. - Performance Review: Provides a closing checklist covering EXPLAIN ANALYZE verification, explicit FK indexes, utf8mb4 charset, no SELECT * in production, and environment-based credentials. - Use Case: When adding a new feature that creates tables and relationships in the thyrox project, use this Skill during design to specify the schema, during implementation to write reversible migrations, and during review to confirm query performance. ## Quick Start Ask the AI to design the MySQL schema and migrations for a new feature following the db-mysql phase guidelines.

Frequently Asked Questions about db-mysql

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design a MySQL schema for a new feature?▼

Document each new or modified table with its name in snake_case plural, columns with types and constraints, foreign keys with ON DELETE and ON UPDATE behavior, and justified indexes. Use utf8mb4 with utf8mb4_unicode_ci as the default charset.

How should I write MySQL migrations for large tables?▼

Create the table structure in the UP migration first, then run index creation in a separate migration to avoid prolonged table locks on large tables. Verify the result with DESCRIBE or SHOW CREATE TABLE, and provide a functional DOWN migration.

Does MySQL create indexes on foreign keys automatically?▼

No, MySQL does not create indexes on foreign keys automatically in all cases you might expect, so this Skill requires an explicit index on every foreign key. The closing checklist verifies that all FKs have an explicit index.

How do I check if a MySQL query is slow before shipping?▼

Run EXPLAIN ANALYZE on every new query and confirm there is no full table scan on large tables. The review checklist also requires avoiding SELECT * in production code.

What charset should MySQL tables use?▼

Use utf8mb4 with the utf8mb4_unicode_ci collation by default for tables and text columns. This is verified both during specification and in the final review checklist.