CtrlK
BlogDocsLog inGet started
Tessl Logo

postgres

PostgreSQL best practices, query optimization, connection troubleshooting, and performance improvement. Load when working with Postgres databases.

Install with Tessl CLI

npx tessl i github:planetscale/database-skills --skill postgres
What are skills?

Overall
score

60%

Does it follow best practices?

Evaluation96%

1.32x

Agent success when using this skill

Validation for skill structure

SKILL.md
Review
Evals

Evaluation results

100%

24%

E-commerce Platform Database Schema

Schema design and data type choices

Criteria
Without context
With context

BIGINT identity PKs

20%

100%

TIMESTAMPTZ not TIMESTAMP

100%

100%

created_at on all tables

100%

100%

CHECK not ENUM for status

0%

100%

JSONB for metadata

100%

100%

FK indexes created

100%

100%

ON DELETE behavior

100%

100%

Singular snake_case tables

100%

100%

Index naming convention

25%

100%

NOT NULL on columns

100%

100%

BIGINT for all FKs

100%

100%

92%

15%

Optimize Slow PostgreSQL Queries

Query optimization and anti-pattern fixes

Criteria
Without context
With context

Q1 no SELECT *

100%

100%

Q1 adds LIMIT

0%

0%

Q2 uses JOIN

100%

100%

Q2 specific columns

100%

100%

Q3 uses EXISTS

0%

100%

Q4 cursor pagination

100%

100%

Q5 range condition

100%

100%

Q5 specific columns

100%

100%

Q6 UNION ALL

50%

100%

Composite index order

100%

100%

Index naming

100%

100%

90%

54%

Design Partitioned Tables for IoT Telemetry Platform

Partitioning strategy and implementation

Criteria
Without context
With context

PK includes partition key (time)

0%

100%

PK includes partition key (region)

0%

100%

BIGINT identity PKs

0%

100%

TIMESTAMPTZ for timestamps

100%

100%

DEFAULT partition for list

0%

0%

Drop partitions for retention

100%

100%

Pre-create future partitions

100%

100%

pg_partman recommendation

0%

100%

DETACH CONCURRENTLY

0%

100%

Human confirmation warning

30%

100%

JSONB for metadata

100%

100%

99%

PostgreSQL Vacuum and Bloat Remediation Plan

MVCC, autovacuum tuning, and bloat remediation

Criteria
Without context
With context

Per-table not global tuning

100%

100%

Scale factor 0.01-0.05

100%

100%

Cost delay 0 for SSD

90%

100%

Cost limit 1000-2000

100%

100%

pg_repack or pg_squeeze

100%

100%

idle_in_transaction timeout

100%

100%

XID age alerting threshold

100%

90%

Never disable autovacuum

100%

100%

Dead tuple diagnostic query

100%

100%

XID age diagnostic query

100%

100%

Long transaction query

100%

100%

100%

24%

Database Index Audit and Application Query Fix

Index audit and optimization with N+1 fix

Criteria
Without context
With context

Unused index query excludes unique

25%

100%

Unused index query excludes constraints

0%

100%

Duplicate index detection

100%

100%

Per-table index count

100%

100%

Index count guidelines

25%

100%

Human confirmation for drops

60%

100%

Batch query with ANY/IN

100%

100%

JOIN replaces N+1 articles

100%

100%

JOIN replaces N+1 counts

100%

100%

No SELECT * in fixed code

100%

100%

Specific columns in queries

100%

100%

Stats age caveat

100%

100%

Evaluated
Agent
Claude Code

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.