moai-lang-sql

Enforce SQL best practices for PostgreSQL and MySQL with pgTAP and sqlfluff.

4|1|Updated Nov 18, 2025
One-click install
npx skills add https://github.com/AJBcoding/claude-skill-eval --skill moai-lang-sql-ajbcoding
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moai-lang-sql
Source: https://github.com/AJBcoding/claude-skill-eval/tree/main/skills/moai-lang-sql
Command: npx skills add https://github.com/AJBcoding/claude-skill-eval --skill moai-lang-sql-ajbcoding

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

SQL best practices, testable queries, and migration management for reliable data access.

Core Features & Use Cases

  • ✅ SQL linting and style guidance
  • ✅ Testable SQL with pgTAP
  • ✅ Migration management guidance
  • ✅ Query optimization patterns

Quick Start

Use sqlfmt/pgTAP patterns to validate a simple SELECT and a migration up script.

Frequently Asked Questions about moai-lang-sql

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

FAQPage Schema
How do I enforce SQL best practices in PostgreSQL and MySQL code reviews?

SQL best practices are enforced using sqlfluff 3.2 for linting and style checks, pgTAP for test coverage, and migration-management workflows. This Skill integrates these tools to catch quality issues in code reviews and CI pipelines, ensuring consistent standards across PostgreSQL and MySQL projects.

Can I use pgTAP to write testable SQL queries and migrations?

Yes. pgTAP enables test-driven development for SQL by validating query logic and migration scripts. This Skill provides pgTAP patterns and guidance to build robust test coverage, ensuring migrations execute correctly and queries behave as expected before deployment.

What's the best way to manage database migrations safely?

Migration management combines version-controlled up/down scripts with automated validation. This Skill guides you through consistent migration workflows, lint checks via sqlfluff, and test coverage via pgTAP to prevent breaking changes and maintain data integrity across environments.

Does sqlfluff support both PostgreSQL and MySQL query linting?

Yes. sqlfluff 3.2 supports both PostgreSQL and MySQL syntax. This Skill applies sqlfluff rules to enforce dialect-specific best practices, catch style violations, and suggest query optimizations in manual audits and automated CI pipelines.

How do I ensure migration consistency across team projects?

Consistent migrations require standardized naming, version enforcement, and automated validation. This Skill enforces tool versions, integrates TDD workflows, and applies quality gates via moai-foundation-trust to guarantee all team migrations meet TRUST 5 compliance and robustness standards.

What limitations should I know about SQL linting for large migrations?

SQL linting focuses on style, syntax, and testability rather than runtime performance at scale. This Skill provides lint results and migration guidance but does not replace load testing or query profiling for high-volume workloads; use it alongside optimization patterns for production queries.