moai-lang-sql

Enforce SQL best practices and pgTAP testing in PostgreSQL codebases.

Updated Nov 24, 2025
One-click install
npx skills add https://github.com/jg-chalk-io/Nora-LiveKit --skill moai-lang-sql-jg-chalk-io
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moai-lang-sql
Source: https://github.com/jg-chalk-io/Nora-LiveKit/tree/main/.claude/skills/moai-lang-sql
Command: npx skills add https://github.com/jg-chalk-io/Nora-LiveKit --skill moai-lang-sql-jg-chalk-io

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides SQL language best practices, tooling guidance, and testing patterns for reliable data layers.

Core Features & Use Cases

  • Best practices enforcement: schema design, migrations, and linting.
  • Testing & Quality: pgTAP and sqlfluff integration.
  • Migration management: guidance for evolving databases safely.

Quick Start

Apply sqlfluff rules and write a basic pgTAP test that validates a select query.

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 and linting in my PostgreSQL project?

SQL best practices enforcement uses sqlfluff to lint code against configurable rules, combined with schema design and migration guidance. This catches style violations, security issues, and anti-patterns early in development, reducing technical debt in your data layer.

What's the best way to write and run tests for PostgreSQL migrations?

pgTAP provides a test-driven development framework for PostgreSQL that validates migrations, schema changes, and query logic before deployment. Combined with sqlfluff linting, it ensures migrations are safe, reversible, and comply with your organization's SQL standards.

Can I use pgTAP and sqlfluff together in a code review workflow?

Yes. This Skill integrates pgTAP and sqlfluff to automate quality gates in your review process, executing tests and lint checks on pull requests and enforcing TRUST 5 compliance standards for PostgreSQL codebases.

How do I manage database schema migrations safely?

Migration management guidance covers evolving databases reliably through version-aligned tooling, test execution planning, and quality gates. This prevents breaking changes and ensures schema evolution stays synchronized with application code.

What prerequisites do I need to use SQL testing and linting?

You need a PostgreSQL codebase, pgTAP for test writing, and sqlfluff for linting configured in your project. The Skill provides tool-version alignment and integration patterns to set up these dependencies within moai foundation components.