latitude-llm: Skill for Claude Code

.agents/skills/database-postgres/SKILL.md

database-postgres is a skill for Claude Code, Codex from latitude-dev/latitude-llm. It costs 39 tokens per session (3,292 once invoked), scanned A, original, MIT.

Project guidance for using PostgreSQL, a relational database, with Drizzle, repositories, migrations, row-level security, and application database clients.

In plain words
What is it for?
Use it when changing database schemas, repositories, migrations, platform adapters, or organization-aware PostgreSQL access.
Why use it?
It keeps database access consistent and ensures queries are scoped to the correct organization.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is latitude-dev/latitude-llm's own configuration. It tells Claude Code and Codex how to work on latitude-llm 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 latitude-llm configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { getPostgresClient } from "../../server/clients.ts".

About the project

Latitude is an open-source platform for monitoring AI agents by collecting execution traces, grouping failures, dispatching coding agents to make fixes, and replaying failures to verify them. Teams use it to observe agent behavior, investigate errors, and monitor whether fixes prevent regressions. The catalogue entries include skills, instructions, and an MCP server for working with Latitude.

latitude-dev/latitude-llm · 4,734 stars · on GitHub · latitude.so

Reuse

Borrowing it

Nothing to install: this file belongs to latitude-dev/latitude-llm. 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/latitude-dev/latitude-llm/development/.agents/skills/database-postgres/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/latitude-dev/latitude-llm

Made for: Claude Code, Codex.

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 database-postgres

README.md
[![agentmods](https://agentmods.dev/badge/skills/latitude-dev/latitude-llm/database-postgres/github.svg)](https://agentmods.dev/skills/latitude-dev/latitude-llm/database-postgres)
Your own site
<a href="https://agentmods.dev/skills/latitude-dev/latitude-llm/database-postgres"><img src="https://agentmods.dev/badge/skills/latitude-dev/latitude-llm/database-postgres/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 database-postgres

Your own site · 80×15
<a href="https://agentmods.dev/skills/latitude-dev/latitude-llm/database-postgres"><img src="https://agentmods.dev/badge/skills/latitude-dev/latitude-llm/database-postgres.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,292 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found 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.00039 $0.03292
Opus 5.5 $0.00016 $0.01317
Sonnet 5.5 $0.00008 $0.00658
Haiku 4.5 $0.00004 $0.00329

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

Security

Grade A, and why

database-postgres 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 1mo 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.

.agents/skills/database-postgres/SKILL.md · 280 lines

How it starts

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

Postgres, SqlClient, schema, migrations, mappers

When to use: Drizzle schema, repositories, RLS, SqlClient wiring, Postgres migrations, psql / reset, or platform mappers (toDomain* / toInsertRow).

Database patterns (Postgres)

  • Postgres adapter stack uses Drizzle ORM in packages/platform/db-postgres
  • Domain models are independent from table/row shapes
  • Mapping from DB rows to domain objects belongs in platform adapters
  • Apps use SqlClient for all DB access: Boundaries provide SqlClientLive with organization context for RLS enforcement

SqlClient and row-level security (RLS)

All Postgres access flows through SqlClient—a domain-level service that abstracts database operations and enforces organization scoping via RLS.

Architecture:

  • Domain Layer (@domain/shared): SqlClient interface with transaction() and query() methods
  • Platform Layer (@platform/db-postgres): SqlClientLive implementation with automatic RLS context setting
  • App Layer (apps/*): Boundaries provide SqlClientLive with the request's organization context

Key behaviors:

  • Every transaction automatically sets app.current_organization_id session variable
  • RLS policies filter all queries by this organization ID at the database level
  • Nested transactions share the same connection (pass-through proxy—no nested transaction overhead)
  • Domain errors propagate through Effect error channel; database errors become RepositoryError
  • On effect failure, SqlClientLive still awaits the Drizzle transaction promise so the connection returns to the pool; if the driver surfaces a different error than the Effect failure (for example rollback/commit), that secondary error is logged via @repo/observability while the original failure remains the propagated error
  • Never write to an RLS table through postgresClient.pool or .db. app.current_organization_id is set with set_config(..., true), so it is transaction-local and a raw pool query has none: get_current_organization_id() returns NULL, the policy matches nothing, and the statement updates zero rows and raises no error. The runtime role (latitude_app) is not the table owner and no table uses FORCE ROW LEVEL SECURITY, so this passes locally as the owner and silently no-ops in every deployed environment. Add a repository method and go through SqlClient. Raw pool access is for the admin client (getAdminPostgresClient()), scripts, seeds and tables with no RLS (outbox_events)

Read the full file on GitHub · 280 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. 1mo ago Changed · +1 lines 430d87038b54
  2. 1mo ago First seen · 279 lines · 39 tokens per session scan A 3fc6b32ed2c8

Subscribe to this mod's changes

database-postgres is a skill published in the GitHub repository latitude-dev/latitude-llm (4,734 stars, last pushed yesterday), licensed MIT. It adds 39 tokens to every session and 3,292 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

qdrant-clients-sdk

Qdrant provides client SDKs for various programming languages, allowing easy integration with Qdrant deployments.

truera/trulens · 28 tokens

qdrant-search-quality-diagnosis

Diagnoses Qdrant search quality issues. Use when someone reports 'results are bad', 'wrong results', 'not relevant results', 'missing matches', 'recall is low', 'approximate search worse than exact', 'which embedding model', 'quality dropped after quantization', 'how to measure retrieval quality', 'build a golden…

truera/trulens · 104 tokens

qdrant-search-strategies

Guides Qdrant search strategy selection. Use when someone asks 'should I use hybrid search?', 'how to rerank?', 'results are not relevant', 'I don't get needed results from my dataset but they're there', 'retrieval quality is not good enough', 'results too similar', 'need diversity', 'MMR', 'relevance feedback'…

truera/trulens · 96 tokens

qdrant-hybrid-search

Explains hybrid search in Qdrant. Use when someone asks 'how do I setup hybrid search?', 'how to combine keyword and semantic search?', 'sparse plus dense vectors?', 'missing keyword matches', 'how to combine results from multiple searches?' and 'combining multiple representations'. Also use for how a hybrid query is…

truera/trulens · 95 tokens

qdrant-search-quality

Diagnoses and improves Qdrant search relevance. Use when someone reports 'search results are bad', 'wrong results', 'low precision', 'low recall', 'irrelevant matches', 'missing expected results', or asks 'how to improve search quality?', 'which embedding model?', 'should I use hybrid search?', 'how to combine keyword…

truera/trulens · 144 tokens

alloydb-basics

Manages clusters, instances, and backups for AlloyDB for PostgreSQL, and integrates with AlloyDB Model Context Protocol (MCP) tools for automated database operations. Use when creating, configuring, or administering AlloyDB databases. Do NOT use for general PostgreSQL instances (e.g. Cloud SQL) or other GCP databases.

google/skills · 72 tokens