From 06a4e68d305a23be9f34c8ce8447992677ce7889 Mon Sep 17 00:00:00 2001 From: Pedro Rodrigues Date: Mon, 19 Jan 2026 19:31:34 +0000 Subject: [PATCH] Rename postgresql to postgres (keeping only existing files) --- .github/workflows/ci.yml | 20 ++-- AGENTS.md | 8 +- README.md | 6 +- .../package-lock.json | 0 .../package.json | 2 +- .../src/build.ts | 4 +- .../src/config.ts | 2 +- .../src/extract-tests.ts | 0 .../src/parser.ts | 0 .../src/types.ts | 0 .../src/validate.ts | 4 +- .../tsconfig.json | 0 skills/postgres-best-practices/AGENTS.md | 107 ++++++++++++++++++ .../README.md | 12 +- .../SKILL.md | 10 +- .../metadata.json | 0 .../rules/_contributing.md | 0 .../rules/_sections.md | 0 .../rules/_template.md | 0 19 files changed, 141 insertions(+), 34 deletions(-) rename packages/{postgresql-best-practices-build => postgres-best-practices-build}/package-lock.json (100%) rename packages/{postgresql-best-practices-build => postgres-best-practices-build}/package.json (90%) rename packages/{postgresql-best-practices-build => postgres-best-practices-build}/src/build.ts (98%) rename packages/{postgresql-best-practices-build => postgres-best-practices-build}/src/config.ts (91%) rename packages/{postgresql-best-practices-build => postgres-best-practices-build}/src/extract-tests.ts (100%) rename packages/{postgresql-best-practices-build => postgres-best-practices-build}/src/parser.ts (100%) rename packages/{postgresql-best-practices-build => postgres-best-practices-build}/src/types.ts (100%) rename packages/{postgresql-best-practices-build => postgres-best-practices-build}/src/validate.ts (97%) rename packages/{postgresql-best-practices-build => postgres-best-practices-build}/tsconfig.json (100%) create mode 100644 skills/postgres-best-practices/AGENTS.md rename skills/{postgresql-best-practices => postgres-best-practices}/README.md (90%) rename skills/{postgresql-best-practices => postgres-best-practices}/SKILL.md (72%) rename skills/{postgresql-best-practices => postgres-best-practices}/metadata.json (100%) rename skills/{postgresql-best-practices => postgres-best-practices}/rules/_contributing.md (100%) rename skills/{postgresql-best-practices => postgres-best-practices}/rules/_sections.md (100%) rename skills/{postgresql-best-practices => postgres-best-practices}/rules/_template.md (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9cf5e2f..23885f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,15 +1,15 @@ -name: PostgreSQL Best Practices CI +name: Postgres Best Practices CI on: push: branches: [main] paths: - - 'skills/postgresql-best-practices/**' - - 'packages/postgresql-best-practices-build/**' + - 'skills/postgres-best-practices/**' + - 'packages/postgres-best-practices-build/**' pull_request: paths: - - 'skills/postgresql-best-practices/**' - - 'packages/postgresql-best-practices-build/**' + - 'skills/postgres-best-practices/**' + - 'packages/postgres-best-practices-build/**' jobs: validate-and-build: @@ -22,22 +22,22 @@ jobs: node-version: '20' - name: Install dependencies - working-directory: packages/postgresql-best-practices-build + working-directory: packages/postgres-best-practices-build run: npm install - name: Validate rule files - working-directory: packages/postgresql-best-practices-build + working-directory: packages/postgres-best-practices-build run: npm run validate - name: Build AGENTS.md - working-directory: packages/postgresql-best-practices-build + working-directory: packages/postgres-best-practices-build run: npm run build - name: Check for uncommitted changes run: | - if [[ -n $(git status --porcelain skills/postgresql-best-practices/AGENTS.md) ]]; then + if [[ -n $(git status --porcelain skills/postgres-best-practices/AGENTS.md) ]]; then echo "Error: AGENTS.md is not up to date" echo "Run 'npm run build' and commit the changes" - git diff skills/postgresql-best-practices/AGENTS.md + git diff skills/postgres-best-practices/AGENTS.md exit 1 fi diff --git a/AGENTS.md b/AGENTS.md index 8780346..fa16c07 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -5,7 +5,7 @@ etc.) when working with code in this repository. ## Repository Overview -A collection of PostgreSQL best practices skills for Claude.ai and Claude Code, +A collection of Postgres best practices skills for Claude.ai and Claude Code, maintained by Supabase. Skills are packaged instructions that extend agent capabilities for database optimization. @@ -15,7 +15,7 @@ capabilities for database optimization. ``` skills/ - postgresql-best-practices/ + postgres-best-practices/ SKILL.md # Required: skill definition AGENTS.md # Generated: compiled rules metadata.json # Required: version and metadata @@ -26,7 +26,7 @@ skills/ {prefix}-{name}.md # Individual rule files packages/ - postgresql-best-practices-build/ + postgres-best-practices-build/ src/ # Build system source package.json # NPM scripts ``` @@ -88,7 +88,7 @@ Skills are loaded on-demand. To minimize context usage: After creating or updating rules: ```bash -cd packages/postgresql-best-practices-build +cd packages/postgres-best-practices-build npm install npm run validate # Check rule format npm run build # Generate AGENTS.md diff --git a/README.md b/README.md index 9872b84..269fe02 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ Skills follow the [Agent Skills](https://agentskills.io/) format. ## Available Skills -### postgresql-best-practices +### postgres-best-practices -PostgreSQL performance optimization guidelines from Supabase. Contains rules +Postgres performance optimization guidelines from Supabase. Contains rules across 8 categories, prioritized by impact. **Use when:** @@ -39,7 +39,7 @@ relevant tasks are detected. **Examples:** ``` -Optimize this PostgreSQL query +Optimize this Postgres query ``` ``` diff --git a/packages/postgresql-best-practices-build/package-lock.json b/packages/postgres-best-practices-build/package-lock.json similarity index 100% rename from packages/postgresql-best-practices-build/package-lock.json rename to packages/postgres-best-practices-build/package-lock.json diff --git a/packages/postgresql-best-practices-build/package.json b/packages/postgres-best-practices-build/package.json similarity index 90% rename from packages/postgresql-best-practices-build/package.json rename to packages/postgres-best-practices-build/package.json index 53ae210..9e0527d 100644 --- a/packages/postgresql-best-practices-build/package.json +++ b/packages/postgres-best-practices-build/package.json @@ -1,5 +1,5 @@ { - "name": "postgresql-best-practices-build", + "name": "postgres-best-practices-build", "version": "0.1.0", "private": true, "type": "module", diff --git a/packages/postgresql-best-practices-build/src/build.ts b/packages/postgres-best-practices-build/src/build.ts similarity index 98% rename from packages/postgresql-best-practices-build/src/build.ts rename to packages/postgres-best-practices-build/src/build.ts index a019d73..72b3e4b 100644 --- a/packages/postgresql-best-practices-build/src/build.ts +++ b/packages/postgres-best-practices-build/src/build.ts @@ -60,7 +60,7 @@ function loadMetadata(): Metadata { version: "0.1.0", organization: "Supabase", date: new Date().toLocaleDateString("en-US", { month: "long", year: "numeric" }), - abstract: "PostgreSQL performance optimization guide for developers.", + abstract: "Postgres performance optimization guide for developers.", references: [], }; } @@ -135,7 +135,7 @@ function buildAgents(): void { const output: string[] = []; // Header - output.push("# PostgreSQL Best Practices\n"); + output.push("# Postgres Best Practices\n"); output.push(`**Version ${metadata.version}**`); output.push(`${metadata.organization}`); output.push(`${metadata.date}\n`); diff --git a/packages/postgresql-best-practices-build/src/config.ts b/packages/postgres-best-practices-build/src/config.ts similarity index 91% rename from packages/postgresql-best-practices-build/src/config.ts rename to packages/postgres-best-practices-build/src/config.ts index 0576f95..c54de56 100644 --- a/packages/postgresql-best-practices-build/src/config.ts +++ b/packages/postgres-best-practices-build/src/config.ts @@ -8,7 +8,7 @@ const __dirname = dirname(__filename); export const BUILD_DIR = join(__dirname, ".."); // Skill directory (relative to build package) -export const SKILL_DIR = join(BUILD_DIR, "../../skills/postgresql-best-practices"); +export const SKILL_DIR = join(BUILD_DIR, "../../skills/postgres-best-practices"); // Rules directory export const RULES_DIR = join(SKILL_DIR, "rules"); diff --git a/packages/postgresql-best-practices-build/src/extract-tests.ts b/packages/postgres-best-practices-build/src/extract-tests.ts similarity index 100% rename from packages/postgresql-best-practices-build/src/extract-tests.ts rename to packages/postgres-best-practices-build/src/extract-tests.ts diff --git a/packages/postgresql-best-practices-build/src/parser.ts b/packages/postgres-best-practices-build/src/parser.ts similarity index 100% rename from packages/postgresql-best-practices-build/src/parser.ts rename to packages/postgres-best-practices-build/src/parser.ts diff --git a/packages/postgresql-best-practices-build/src/types.ts b/packages/postgres-best-practices-build/src/types.ts similarity index 100% rename from packages/postgresql-best-practices-build/src/types.ts rename to packages/postgres-best-practices-build/src/types.ts diff --git a/packages/postgresql-best-practices-build/src/validate.ts b/packages/postgres-best-practices-build/src/validate.ts similarity index 97% rename from packages/postgresql-best-practices-build/src/validate.ts rename to packages/postgres-best-practices-build/src/validate.ts index 6f34011..3ab91fa 100644 --- a/packages/postgresql-best-practices-build/src/validate.ts +++ b/packages/postgres-best-practices-build/src/validate.ts @@ -145,13 +145,13 @@ export function validateAllRules(): { const isMainModule = process.argv[1]?.endsWith("validate.ts") || process.argv[1]?.endsWith("validate.js"); if (isMainModule) { - console.log("Validating PostgreSQL best practices rules...\n"); + console.log("Validating Postgres best practices rules...\n"); const { totalFiles, validFiles, invalidFiles, results } = validateAllRules(); if (totalFiles === 0) { console.log("No rule files found (this is expected for initial setup)."); - console.log("Create rule files in: skills/postgresql-best-practices/rules/"); + console.log("Create rule files in: skills/postgres-best-practices/rules/"); console.log("Use the _template.md as a starting point.\n"); process.exit(0); } diff --git a/packages/postgresql-best-practices-build/tsconfig.json b/packages/postgres-best-practices-build/tsconfig.json similarity index 100% rename from packages/postgresql-best-practices-build/tsconfig.json rename to packages/postgres-best-practices-build/tsconfig.json diff --git a/skills/postgres-best-practices/AGENTS.md b/skills/postgres-best-practices/AGENTS.md new file mode 100644 index 0000000..eeb9259 --- /dev/null +++ b/skills/postgres-best-practices/AGENTS.md @@ -0,0 +1,107 @@ +# PostgreSQL Best Practices + +**Version 0.1.0** +Supabase +January 2026 + +> This document is optimized for AI agents and LLMs. Rules are prioritized by performance impact. + +--- + +## Abstract + +Comprehensive PostgreSQL performance optimization guide for developers using Supabase and PostgreSQL. Contains performance rules across 8 categories, prioritized by impact from critical (query performance, connection management) to incremental (advanced features). Each rule includes detailed explanations, incorrect vs. correct SQL examples, query plan analysis, and specific performance metrics to guide automated optimization and code generation. + +--- + +## Table of Contents + +1. [Query Performance](#query-performance) - **CRITICAL** + +2. [Connection Management](#connection-management) - **CRITICAL** + +3. [Schema Design](#schema-design) - **HIGH** + +4. [Concurrency & Locking](#concurrency-locking) - **MEDIUM-HIGH** + +5. [Security & RLS](#security-rls) - **MEDIUM-HIGH** + +6. [Data Access Patterns](#data-access-patterns) - **MEDIUM** + +7. [Monitoring & Diagnostics](#monitoring-diagnostics) - **LOW-MEDIUM** + +8. [Advanced Features](#advanced-features) - **LOW** + +--- + +## 1. Query Performance + +**Impact: CRITICAL** + +Slow queries, missing indexes, inefficient query plans. The most common source of PostgreSQL performance issues. + +*No rules defined yet. See rules/_template.md for creating new rules.* + +## 2. Connection Management + +**Impact: CRITICAL** + +Connection pooling, limits, and serverless strategies. Critical for applications with high concurrency or serverless deployments. + +*No rules defined yet. See rules/_template.md for creating new rules.* + +## 3. Schema Design + +**Impact: HIGH** + +Table design, index strategies, partitioning, and data type selection. Foundation for long-term performance. + +*No rules defined yet. See rules/_template.md for creating new rules.* + +## 4. Concurrency & Locking + +**Impact: MEDIUM-HIGH** + +Transaction management, isolation levels, deadlock prevention, and lock contention patterns. + +*No rules defined yet. See rules/_template.md for creating new rules.* + +## 5. Security & RLS + +**Impact: MEDIUM-HIGH** + +Row-Level Security policies, privilege management, and authentication patterns. + +*No rules defined yet. See rules/_template.md for creating new rules.* + +## 6. Data Access Patterns + +**Impact: MEDIUM** + +N+1 query elimination, batch operations, cursor-based pagination, and efficient data fetching. + +*No rules defined yet. See rules/_template.md for creating new rules.* + +## 7. Monitoring & Diagnostics + +**Impact: LOW-MEDIUM** + +Using pg_stat_statements, EXPLAIN ANALYZE, metrics collection, and performance diagnostics. + +*No rules defined yet. See rules/_template.md for creating new rules.* + +## 8. Advanced Features + +**Impact: LOW** + +Full-text search, JSONB optimization, PostGIS, extensions, and advanced PostgreSQL features. + +*No rules defined yet. See rules/_template.md for creating new rules.* + +## References + +- https://www.postgresql.org/docs/current/ +- https://supabase.com/docs +- https://wiki.postgresql.org/wiki/Performance_Optimization +- https://supabase.com/docs/guides/database/overview +- https://supabase.com/docs/guides/auth/row-level-security diff --git a/skills/postgresql-best-practices/README.md b/skills/postgres-best-practices/README.md similarity index 90% rename from skills/postgresql-best-practices/README.md rename to skills/postgres-best-practices/README.md index faa9064..78bb454 100644 --- a/skills/postgresql-best-practices/README.md +++ b/skills/postgres-best-practices/README.md @@ -1,12 +1,12 @@ -# PostgreSQL Best Practices - Contributor Guide +# Postgres Best Practices - Contributor Guide -This repository contains PostgreSQL performance optimization rules optimized for AI agents and LLMs. +This repository contains Postgres performance optimization rules optimized for AI agents and LLMs. ## Quick Start ```bash # Install dependencies -cd packages/postgresql-best-practices-build +cd packages/postgres-best-practices-build npm install # Validate existing rules @@ -46,7 +46,7 @@ npm run build ## Repository Structure ``` -skills/postgresql-best-practices/ +skills/postgres-best-practices/ ├── SKILL.md # Agent-facing skill manifest ├── AGENTS.md # [GENERATED] Compiled rules document ├── README.md # This file @@ -57,7 +57,7 @@ skills/postgresql-best-practices/ ├── _contributing.md # Writing guidelines └── *.md # Individual rules -packages/postgresql-best-practices-build/ +packages/postgres-best-practices-build/ ├── src/ # Build system source ├── package.json # NPM scripts └── test-cases.json # [GENERATED] Test artifacts @@ -121,7 +121,7 @@ See `rules/_contributing.md` for detailed guidelines. Key principles: ## Supabase-Specific Content -Keep ~90% of content as universal PostgreSQL patterns. Add Supabase notes for: +Keep ~90% of content as universal Postgres patterns. Add Supabase notes for: - Supavisor connection pooling - Dashboard features (index monitoring, query stats) - RLS best practices with Supabase auth diff --git a/skills/postgresql-best-practices/SKILL.md b/skills/postgres-best-practices/SKILL.md similarity index 72% rename from skills/postgresql-best-practices/SKILL.md rename to skills/postgres-best-practices/SKILL.md index 598bad1..1f91a7c 100644 --- a/skills/postgresql-best-practices/SKILL.md +++ b/skills/postgres-best-practices/SKILL.md @@ -1,15 +1,15 @@ --- -name: supabase-postgresql-best-practices -description: PostgreSQL performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing PostgreSQL queries, schema designs, or database configurations. +name: supabase-postgres-best-practices +description: Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations. license: MIT metadata: author: supabase version: "0.1.0" --- -# Supabase PostgreSQL Best Practices +# Supabase Postgres Best Practices -Comprehensive performance optimization guide for PostgreSQL, maintained by Supabase. Contains rules across 8 categories, prioritized by impact to guide automated query optimization and schema design. +Comprehensive performance optimization guide for Postgres, maintained by Supabase. Contains rules across 8 categories, prioritized by impact to guide automated query optimization and schema design. ## When to Apply @@ -18,7 +18,7 @@ Reference these guidelines when: - Implementing indexes or query optimization - Reviewing database performance issues - Configuring connection pooling or scaling -- Optimizing for PostgreSQL-specific features +- Optimizing for Postgres-specific features - Working with Row-Level Security (RLS) ## Rule Categories by Priority diff --git a/skills/postgresql-best-practices/metadata.json b/skills/postgres-best-practices/metadata.json similarity index 100% rename from skills/postgresql-best-practices/metadata.json rename to skills/postgres-best-practices/metadata.json diff --git a/skills/postgresql-best-practices/rules/_contributing.md b/skills/postgres-best-practices/rules/_contributing.md similarity index 100% rename from skills/postgresql-best-practices/rules/_contributing.md rename to skills/postgres-best-practices/rules/_contributing.md diff --git a/skills/postgresql-best-practices/rules/_sections.md b/skills/postgres-best-practices/rules/_sections.md similarity index 100% rename from skills/postgresql-best-practices/rules/_sections.md rename to skills/postgres-best-practices/rules/_sections.md diff --git a/skills/postgresql-best-practices/rules/_template.md b/skills/postgres-best-practices/rules/_template.md similarity index 100% rename from skills/postgresql-best-practices/rules/_template.md rename to skills/postgres-best-practices/rules/_template.md