everything-claude-code: Skill for Claude Code

.kiro/skills/postgres-patterns/SKILL.md

postgres-patterns is a skill for Claude Code, Kiro from mit-network/everything-claude-code. It costs 45 tokens per session (1,090 once invoked), scanned A, a copy of postgres-patterns, MIT.

A quick reference for designing and tuning PostgreSQL databases, including tables, queries, indexes, data types, and row-level security. PostgreSQL is a database system; row-level security controls which rows each user can access.

In plain words
What is it for?
Use it while writing SQL or migrations, designing schemas, investigating slow queries, configuring row-level security, or setting up connection pooling.
Why use it?
It helps avoid database designs and SQL queries that are slow, insecure, or difficult to maintain. It also points out common mistakes and suggests suitable index and data-type patterns.

Skill for Claude CodeKiro

Written for Claude Code and Kiro: shipped in a Claude Code plugin, but also installed under .kiro/.

This is mit-network/everything-claude-code's own configuration. It tells Claude Code and Kiro how to work on everything-claude-code itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything everything-claude-code configures →

Part of the everything-claude-code plugin — 39 skills, 3 commands, 16 agents shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to mit-network/everything-claude-code. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/mit-network/everything-claude-code/main/.kiro/skills/postgres-patterns/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/mit-network/everything-claude-code

Made for: Claude Code, Kiro.

Or install everything-claude-code, the plugin that ships this one along with the rest of its 39 skills, 3 commands, 16 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for postgres-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/mit-network/everything-claude-code/postgres-patterns/github.svg)](https://agentmods.dev/skills/mit-network/everything-claude-code/postgres-patterns)
Your own site
<a href="https://agentmods.dev/skills/mit-network/everything-claude-code/postgres-patterns"><img src="https://agentmods.dev/badge/skills/mit-network/everything-claude-code/postgres-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for postgres-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/mit-network/everything-claude-code/postgres-patterns"><img src="https://agentmods.dev/badge/skills/mit-network/everything-claude-code/postgres-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,090 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00045 $0.01090
Opus 5.5 $0.00018 $0.00436
Sonnet 5.5 $0.00009 $0.00218
Haiku 4.5 $0.00005 $0.00109

Measured 3mo ago against content hash d8735f587443, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

postgres-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to postgres-patterns — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.kiro/skills/postgres-patterns/SKILL.md · 162 lines

How it starts

The opening of the file, as written. The whole thing — 162 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PostgreSQL Patterns

Quick reference for PostgreSQL best practices. For detailed guidance, use the database-reviewer agent.

When to Activate

  • Writing SQL queries or migrations
  • Designing database schemas
  • Troubleshooting slow queries
  • Implementing Row Level Security
  • Setting up connection pooling

Quick Reference

Index Cheat Sheet

Query Pattern Index Type Example
WHERE col = value B-tree (default) CREATE INDEX idx ON t (col)
WHERE col > value B-tree CREATE INDEX idx ON t (col)
WHERE a = x AND b > y Composite CREATE INDEX idx ON t (a, b)
WHERE jsonb @> '{}' GIN CREATE INDEX idx ON t USING gin (col)
WHERE tsv @@ query GIN CREATE INDEX idx ON t USING gin (col)
Time-series ranges BRIN CREATE INDEX idx ON t USING brin (col)

Data Type Quick Reference

Use Case Correct Type Avoid
IDs bigint int, random UUID
Strings text varchar(255)
Timestamps timestamptz timestamp
Money numeric(10,2) float
Flags boolean varchar, int

Common Patterns

Composite Index Order:

-- Equality columns first, then range columns
CREATE INDEX idx ON orders (status, created_at);
-- Works for: WHERE status = 'pending' AND created_at > '2024-01-01'

Covering Index:

CREATE INDEX idx ON users (email) INCLUDE (name, created_at);
-- Avoids table lookup for SELECT email, name, created_at

Partial Index:

CREATE INDEX idx ON users (email) WHERE deleted_at IS NULL;
-- Smaller index, only includes active users

RLS Policy (Optimized):

CREATE POLICY policy ON orders
  USING ((SELECT auth.uid()) = user_id);  -- Wrap in SELECT!

UPSERT:

INSERT INTO settings (user_id, key, value)
VALUES (123, 'theme', 'dark')
ON CONFLICT (user_id, key)
DO UPDATE SET value = EXCLUDED.value;

Cursor Pagination:

SELECT * FROM products WHERE id > $last_id ORDER BY id LIMIT 20;
-- O(1) vs OFFSET which is O(n)

Read the full file on GitHub · 162 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 162 lines · 45 tokens per session scan A d8735f587443

Subscribe to this mod's changes

postgres-patterns is a skill published in the GitHub repository mit-network/everything-claude-code (92 stars, last pushed 8mo ago), licensed MIT. It adds 45 tokens to every session and 1,090 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to postgres-patterns, differing in 0 lines, and is treated as a copy.

Related

postgres-patterns compared with skills from other repositories

postgres-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
postgres-patternsmit-network/everything-claude-codeSkill928mo agoMITA45Claude Code, Kiro
alloydb-basicsgoogle/skillsSkill25kyesterdayApache-2.0A72Claude Code, Codex
postgresql-table-designwshobson/agentsSkill43k2d agoMITA37Claude Code
db-repairgarrytan/gbrainSkill34ktodayMITA96Claude Code
dsqlawslabs/agent-pluginsSkill956yesterdayApache-2.0A247Claude Code
volcengine-rds-postgresqlbytedance/agentkit-samplesSkill496yesterdayApache-2.0A63Claude Code, Codex
postgresdbericrisco/rsc-harnessSkill695yesterdayMITA91Claude Code, Codex