postgres-setup

Automate PostgreSQL database provisioning and schema initialization with Python scripts.

1|Updated Oct 23, 2025
One-click install
npx skills add https://github.com/jmazzahacks/byteforge-claude-skills --skill postgres-setup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-setup
Source: https://github.com/jmazzahacks/byteforge-claude-skills/tree/main/skills/postgres-setup
Command: npx skills add https://github.com/jmazzahacks/byteforge-claude-skills --skill postgres-setup

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires psycopg2.

What problem does it solve?

Manually configuring PostgreSQL databases, users, permissions, and schema can be a repetitive and error-prone task. This Skill automates the entire setup process, applying standardized best practices for schema definition and providing robust Python scripts for idempotent database provisioning.

Core Features & Use Cases

  • Automated Provisioning: Creates databases and users with appropriate permissions, handling both production and test environments.
  • Schema-Logic Separation: Clearly separates SQL schema definitions (schema.sql) from Python-based setup logic (setup_database.py).
  • Best Practices: Enforces UUID primary keys, Unix timestamps for dates, and idempotent operations (CREATE IF NOT EXISTS).
  • Use Case: Rapidly provision a new PostgreSQL instance for a microservice or application, ensuring consistent setup, idempotent operations, and immediate readiness for development and testing.

Quick Start

User: "Set up postgres database for my project"

Frequently Asked Questions about postgres-setup

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

FAQPage Schema
How do I automate PostgreSQL database and schema setup for a new project?

Automate PostgreSQL database provisioning and schema initialization using standardized Python scripts and SQL templates. This Skill creates databases, users, and schema with idempotent operations (CREATE TABLE IF NOT EXISTS), UUID primary keys, and enforced best practices, eliminating manual configuration errors.

What are best practices for PostgreSQL schema design and initialization?

PostgreSQL schema best practices include UUID primary keys with gen_random_uuid(), BIGINT-based Unix timestamps, foreign keys with ON DELETE CASCADE or SET NULL, and idempotent CREATE statements. This Skill enforces these patterns through standardized templates with inline documentation.

Can I use PostgreSQL setup automation for both production and test databases?

Yes. This Skill supports provisioning separate production and test databases with standardized environment variable patterns, permissions, and idempotent schema creation, enabling consistent setup across development and testing environments.

How do I separate SQL schema definitions from Python database setup logic?

Separate schema from setup logic by maintaining schema.sql for DDL statements and setup_database.py for provisioning logic. This Skill enforces this separation pattern, improving maintainability and allowing schema version control independent of deployment scripts.

What's the advantage of idempotent PostgreSQL provisioning?

Idempotent provisioning ensures database setup scripts can run multiple times without errors or side effects. This Skill uses CREATE TABLE IF NOT EXISTS and similar constructs, enabling safe re-runs during development, CI/CD pipelines, and infrastructure recovery.