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.
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.
curl -O https://raw.githubusercontent.com/latitude-dev/latitude-llm/development/.agents/skills/database-postgres/SKILL.mdgit clone --depth 1 https://github.com/latitude-dev/latitude-llmWrote 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.
[](https://agentmods.dev/skills/latitude-dev/latitude-llm/database-postgres)<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.
<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>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once 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 |
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.
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
SqlClientLivewith 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):SqlClientinterface withtransaction()andquery()methods - Platform Layer (
@platform/db-postgres):SqlClientLiveimplementation with automatic RLS context setting - App Layer (
apps/*): Boundaries provideSqlClientLivewith the request's organization context
Key behaviors:
- Every transaction automatically sets
app.current_organization_idsession 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,
SqlClientLivestill 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/observabilitywhile the original failure remains the propagated error - Never write to an RLS table through
postgresClient.poolor.db.app.current_organization_idis set withset_config(..., true), so it is transaction-local and a raw pool query has none:get_current_organization_id()returnsNULL, 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 usesFORCE ROW LEVEL SECURITY, so this passes locally as the owner and silently no-ops in every deployed environment. Add a repository method and go throughSqlClient. Rawpoolaccess is for the admin client (getAdminPostgresClient()), scripts, seeds and tables with no RLS (outbox_events)
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.
- 1mo ago Changed · +1 lines 430d87038b54
- 1mo ago First seen · 279 lines · 39 tokens per session scan A 3fc6b32ed2c8
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.
Other skills, from other repositories
qdrant-clients-sdk
Qdrant provides client SDKs for various programming languages, allowing easy integration with Qdrant deployments.
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…
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'…
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…
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…
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.