agentleFS
1tomany1tomany/agent-skills/postgresql/SKILL.md

postgresql

Skill0 starsChanged 34 days agoMITView on GitHub

Use when an application uses PostgreSQL

21 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use redis, mongodb and 1 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Sorcha-PlatformSkill

    redis

    Implements Redis caching, session management, and distributed coordination for the Sorcha platform. Use when: Adding caching layers, token revocation, rate limiting, SignalR backplane, or distributed state.

    Also in 3 projects that use this

  • hoodiniSkill

    mongodb

    Work with MongoDB databases using best practices. Use when designing schemas, writing queries, building aggregation pipelines, or optimizing performance. Triggers on MongoDB, Mongoose, NoSQL, aggregation pipeline, document database, MongoDB Atlas.

    Also in 3 projects that use this

  • wrsmith108Skill

    docker

    Container-based development for isolated, reproducible environments. Use when running npm commands, installing packages, executing code, or managing project dependencies. Trigger phrases include "npm install", "run the build", "start the server", "install package", or any code execution request.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 20 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not set default values for any timestamps

    line 20

“Common” is measured: kept by at least 6 in 10 of the 20 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PostgreSQL Skill

Overview

This skill outlines how to use PostgreSQL, table structure, and how to write migrations. It is important that a database is well designed, structured, and maintained. After a certain size, it is much easier to change code than it is to change a database.

Table Structure

Tables should almost always use the following structure unless sufficient reason not to is provided:

  • Identity primary key with type bigint and named id
  • Metadata timestamps with types timestamptz
    • Non-null columns created_at and updated_at are required
    • Do not set default values for any timestamps
    • Any other metadata timestamp columns
  • Foreign keys, roughly ordered by importance
  • Entity date and timestamp columns
  • Non-required entity metadata columns
  • Required entity columns
  • Error and metrics columns

Metadata Timestamps

The columns created_at and updated_at must be placed immediately after the id column. These should be NOT NULL and should not have a default value.

Foreign Keys

Foreign keys must be placed immediately after all metadata timestamp columns. They should be ordered by "importance" where importance is defined by how required the column is for a row in the table to exist. For example, in a multi-tenant application, the column that represents the tenant would come before a column that represents the user that created the record. Knowing what tenant the record belongs to is necessary for the row to exist, but knowing who created it isn't.

The CASCADE operation should be set for all foreign keys. If a foreign key is NOT NULL, the CASCADE operation should be DELETE.

Entity Date and Timestamp Columns

Non-required Entity Metadata Columns

Required Entity Columns

Error and Metrics Columns

Examples

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.