agentleFS
a365ngaya365ngay/CogniRouter/skills/senior-mysql/SKILL.md

senior-mysql

Skill2 starsChanged 6 days agoMITView on GitHub

Use when designing, reviewing, tuning, migrating, securing, or troubleshooting MySQL or MariaDB schemas, SQL, indexes, EXPLAIN plans, InnoDB transactions and locking, character sets, online schema changes, replication, backups, or database operations.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never run DDL or data changes against production without explicit authorization and a rollback plan.

    line 16
  2. Very specific:

    Use utf8mb4 with a deliberate collation.

    line 20
  3. Distinctive:

    Keep transactions short; understand gap and next-key locks under REPEATABLE READ.

    line 23
  4. Distinctive:

    Use parameterized queries, least-privilege accounts, and TLS.

    line 25
  5. Distinctive:

    Do the target queries use the intended index?

    line 34

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Senior MySQL

Role

Design and change MySQL databases with correct types and collations, index-backed queries, safe online migrations, and controlled locking.

Before Editing

  1. Inspect server version (MySQL vs MariaDB), storage engine, sql_mode, default charset/collation, isolation level, replication topology, migration tool, ORM, and existing index conventions.
  2. For a slow or changed query, get its EXPLAIN / EXPLAIN ANALYZE, table sizes, and existing indexes before proposing changes.
  3. Never run DDL or data changes against production without explicit authorization and a rollback plan.

Implementation Rules

  • Use utf8mb4 with a deliberate collation; pick exact types (DECIMAL for money, DATETIME/TIMESTAMP with clear time-zone handling, smallest fitting integer). Define primary keys on every InnoDB table.
  • Design composite indexes by leftmost-prefix usage, equality before range columns, and covering needs; remove redundant indexes. Avoid functions on indexed columns in predicates.
  • Paginate with keyset (seek) pagination for large tables rather than deep OFFSET.
  • Keep transactions short; understand gap and next-key locks under REPEATABLE READ; access rows in a consistent order to reduce deadlocks, and retry deadlock errors in application code.
  • Plan schema changes for large tables with ALGORITHM=INSTANT/INPLACE, gh-ost, or pt-online-schema-change; add columns nullable or with defaults; backfill in batches.
  • Use parameterized queries, least-privilege accounts, and TLS; never store plaintext passwords.

Testing and Verification

Compare EXPLAIN before and after, test migrations on a production-like copy, check row counts and constraints after backfills, and confirm replication lag stays acceptable during heavy changes.

Review Checklist

  • Are types, charset, and collation correct for the data?
  • Do the target queries use the intended index?
  • Will the migration lock or rewrite a large table, and is there a rollback?
  • Are transactions short and deadlock-tolerant?

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.