database

Standardize PostgreSQL query patterns, JSONB modeling, indexing, and migration practices.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Pyl-Tech/stream-coding --skill database-pyl-tech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database
Source: https://github.com/Pyl-Tech/stream-coding/tree/main/.agents/skills/database
Command: npx skills add https://github.com/Pyl-Tech/stream-coding --skill database-pyl-tech

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents slow, brittle, and error-prone database implementations by standardizing query patterns, indexing, migrations, and timezone handling to match what a precise spec expects.

Core Features & Use Cases

  • Reliable query and modeling rules: Prefer CTEs, use PostgreSQL JSONB correctly, and separate relational data from JSON storage.
  • Performance-first guidance: Use an EXPLAIN ANALYZE workflow and choose appropriate index types for equality, ranges, full-text, JSONB, and arrays.
  • Migration safety standards: Enforce one-change-per-migration, reversibility, pre-testing, and never editing deployed migrations.
  • Use Case: When an AI spec includes database operations (models, queries, migrations, analytics), load these rules to produce implementations that are safer and easier to verify.

Quick Start

Load the database skill when your spec includes PostgreSQL queries, migrations, or data modeling so your AI implementation follows consistent patterns and includes EXPLAIN-based performance checks.

Frequently Asked Questions about database

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

FAQPage Schema
How do I write safe PostgreSQL migrations that won't break production?

Safe PostgreSQL migrations require a one-change-per-migration rule, strict reversibility, pre-testing, and never editing deployed migrations. Following these standards ensures immutability and prevents production-breaking changes.

What is the best way to model JSONB data in PostgreSQL?

Modeling JSONB data in PostgreSQL correctly involves separating relational data from JSON storage and adhering to specific JSONB conventions. This standardization ensures your AI-assisted data implementations remain reliable and structurally sound.

How do I use EXPLAIN ANALYZE to optimize PostgreSQL query performance?

Using EXPLAIN ANALYZE to optimize PostgreSQL queries involves a specific workflow that evaluates execution plans and guides index selection for equality, ranges, full-text, JSONB, and arrays to ensure performance-first database patterns.

Do I need to store timestamps in UTC for PostgreSQL timezone handling?

Timezone-correct timestamp storage in PostgreSQL requires explicit UTC timestamp handling. This enforces timezone-correct data practices and prevents inconsistencies when AI implementations interact with temporal data.

When should I use CTEs in PostgreSQL queries?

CTEs in PostgreSQL queries should be preferred to ensure reliable query and modeling rules. Standardizing on CTE conventions helps produce safer, easier-to-verify database implementations for AI-assisted spec execution.