Terminal
Terminal/Skill
Writes and reviews SQL that runs on TiDB, flagging MySQL features TiDB lacks and adapting MySQL SQL for migration.
By PingCAP (TiDB)
Works with
npx skills add pingcap/agent-rules --skill tidb-sqlGoal: generate SQL that runs correctly on TiDB by default, and avoid "works on MySQL but breaks on TiDB" constructs.
SELECT VERSION();TiDB, treat it as TiDB and parse the version (needed for feature gates like Vector / Foreign Key).skills/tidb-sql/references/tidb-cloud-ssl.md).EXPLAIN FORMAT = "tidb_json" for structured plans and operator trees.EXPLAIN ANALYZE to compare estRows vs actRows (it executes the query).ANALYZE TABLE ... to refresh statistics.VECTOR / VECTOR(D) types and vector functions/indexes; MySQL does not.GEOMETRY, spatial functions, and SPATIAL indexes.FULLTEXT works everywhere.UPDATE/INSERT/DELETE against views.AUTO_RANDOM over AUTO_INCREMENT for write-hotspot avoidance when appropriate.COMMIT failures in application logic.skills/tidb-sql/references/vector.md - VECTOR types, functions, vector index DDL, and query patterns.skills/tidb-sql/references/full-text-search.md - Full-text search SQL patterns and availability gotchas.skills/tidb-sql/references/auto-random.md - AUTO_RANDOM rules, DDL patterns, and restrictions.skills/tidb-sql/references/transactions.md - pessimistic vs optimistic mode and session/global knobs.skills/tidb-sql/references/mysql-compatibility-notes.md - other "MySQL vs TiDB" differences that commonly break SQL.skills/tidb-sql/references/explain.md - EXPLAIN / EXPLAIN ANALYZE usage, tidb_json and dot formats.skills/tidb-sql/references/flashback.md - FLASHBACK TABLE/DATABASE and FLASHBACK CLUSTER recovery playbooks.skills/tidb-sql/references/tidb-cloud-ssl.md - TiDB Cloud SSL verification requirements and client flags.