Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add AbdulmalekAlshugaa/claude-agents-fullstack --skill postgres-data-modelinggit clone --depth 1 https://github.com/AbdulmalekAlshugaa/claude-agents-fullstackWrote 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/abdulmalekalshugaa/claude-agents-fullstack/postgres-data-modeling)<a href="https://agentmods.dev/skills/abdulmalekalshugaa/claude-agents-fullstack/postgres-data-modeling"><img src="https://agentmods.dev/badge/skills/abdulmalekalshugaa/claude-agents-fullstack/postgres-data-modeling/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/abdulmalekalshugaa/claude-agents-fullstack/postgres-data-modeling"><img src="https://agentmods.dev/badge/skills/abdulmalekalshugaa/claude-agents-fullstack/postgres-data-modeling.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.00062 | $0.01155 |
| Opus 5 | $0.00031 | $0.00577 |
| Sonnet 5 | $0.00012 | $0.00231 |
| Haiku 4.5 | $0.00006 | $0.00115 |
Grade A, and why
postgres-data-modeling 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 4d 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 — 111 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PostgreSQL + Drizzle conventions
Schema definition pattern
One file per domain area in src/lib/db/schema/<name>.ts, all re-exported from
src/lib/db/schema/index.ts (drizzle-kit points at the barrel):
import { pgTable, varchar, timestamp, uuid, index, uniqueIndex } from 'drizzle-orm/pg-core'
export const users = pgTable(
'users',
{
id: uuid().primaryKey().defaultRandom(),
email: varchar({ length: 255 }).notNull(),
name: varchar({ length: 120 }).notNull(),
role: varchar({ length: 20, enum: ['user', 'admin'] }).notNull().default('user'),
createdAt: timestamp({ withTimezone: true }).notNull().defaultNow(),
updatedAt: timestamp({ withTimezone: true }).notNull().defaultNow(),
},
(t) => [
uniqueIndex('users_email_idx').on(t.email),
],
)
export type UserRow = typeof users.$inferSelect
export type NewUser = typeof users.$inferInsert
Connection in src/lib/db/index.ts, cached on globalThis (Next.js hot reload):
import { drizzle } from 'drizzle-orm/node-postgres'
import { env } from '@/lib/env'
import * as schema from './schema'
const cached = (globalThis as { __db?: ReturnType<typeof create> })
function create() {
return drizzle(env.DATABASE_URL, { schema })
}
export const db = (cached.__db ??= create())
Rules
- Types come from the schema:
$inferSelect/$inferInsert— never hand-write a row type. API DTOs still derive from Zod (z.infer); map row → DTO in the service and never return raw rows to the client. - Every table gets
createdAt/updatedAt(withTimezone: true); bumpupdatedAtin the service on update. - Foreign keys are real:
.references(() => users.id, { onDelete: 'cascade' | 'restrict' })chosen deliberately — say which and why. Add arelations()definition when you wantdb.query.*nested reads. - Index every real query pattern in the table's third argument; composite indexes ordered by selectivity, matching the WHERE + ORDER BY they serve. Flag indexes nothing uses.
- Queries are built with the query builder or
db.query— never string concatenation. If you must drop to SQL, use thesqltemplate tag (it parameterises);sql.raw()with user input is an injection, full stop. - Ownership in the WHERE clause:
db.select().from(items).where(and(eq(items.id, id), eq(items.userId, userId)))— not a post-fetchif. Return 404 for both missing and unowned. - No N+1: batch with
inArray, join, or adb.queryrelation — neverawaita query inside a loop. - Always paginate list queries:
.limit(n)+ keyset cursor (where(lt(t.createdAt, cursor))with a matching index) for real datasets; offset only for small admin lists. - Unique violations: catch Postgres error code
23505in the service and return a 409-shaped result — don't let it bubble as a 500.
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.
- 4d ago First seen · 111 lines · 62 tokens per session scan A 40ec71303c05
postgres-data-modeling is a skill published in the GitHub repository AbdulmalekAlshugaa/claude-agents-fullstack (3 stars, last pushed 3d ago), licensed MIT. It adds 62 tokens to every session and 1,155 once invoked, about $0.0003 per session on Opus 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-09-05.
Other skills, from other repositories
kysely
Guidelines for developing with Kysely, a type-safe TypeScript SQL query builder with autocompletion support.
golem-add-postgres-ts
Using golem:rdbms/postgres from a TypeScript Golem agent. Use when the user asks to connect to PostgreSQL, run SQL, or use PostgreSQL from TypeScript agent code.
drizzle-orm
Expert knowledge for Drizzle ORM - the lightweight, type-safe SQL ORM for edge and serverlessUse when "drizzle, drizzle orm, drizzle-kit, drizzle schema, drizzle migration, drizzle relations, sql orm typescript, edge database, d1 database, orm, database, typescript, sql, edge, serverless, d1, postgres, mysql, sqlite"…
drizzle-pg
Drizzle ORM reference for PostgreSQL — schema definition, typesafe queries, relations, and migrations with drizzle-kit. Use when: (1) defining pgTable schemas with column types, indexes, constraints, or enums, (2) writing select/insert/update/delete queries or joins, (3) defining relations and using the relational…
azure-postgres-ts
Connect to Azure Database for PostgreSQL Flexible Server using the pg (node-postgres) package with support for password and Microsoft Entra ID (passwordless) authentication.
prisma
Prisma TypeScript ORM with migrations. Use for database access.