triad-drizzle

triad-drizzle is a skill for Claude Code from justhamade/triadjs. It costs 61 tokens per session (1,675 once invoked), scanned A, original, MIT.

A bridge between TriadJS models and Drizzle ORM, a TypeScript tool for describing and querying database tables. It reads storage hints from models and generates a Drizzle schema file.

In plain words
What is it for?
Generating SQLite, PostgreSQL, or MySQL schemas, marking primary keys and indexes, adding storage defaults, designing repositories, and detecting unique-constraint conflicts.
Why use it?
It connects application data definitions to database table definitions while making clear that generation is not the same as running database migrations.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is triad db generate # default: sqlite → ./src/db/schema.generated.ts.

Part of the triadjs plugin — 10 skills, 8 commands shipped together

Good fit Generating SQLite, PostgreSQL, or MySQL schemas, marking primary keys and indexes, adding storage defaults, designing repositories, and detecting unique-constraint conflicts.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/justhamade/triadjs
agentmods
npx agentmods add skills/justhamade/triadjs/triad-drizzle

Made for: Claude Code.

Or install triadjs, the plugin that ships this one along with the rest of its 10 skills, 8 commands.

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 triad-drizzle

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/justhamade/triadjs/triad-drizzle"><img src="https://agentmods.dev/badge/skills/justhamade/triadjs/triad-drizzle.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,675 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 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.00061 $0.01675
Opus 5.5 $0.00024 $0.00670
Sonnet 5.5 $0.00012 $0.00335
Haiku 4.5 $0.00006 $0.00168

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

Security

Grade A, and why

triad-drizzle 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 2mo 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.

plugin/skills/triad-drizzle/SKILL.md · 151 lines

How it starts

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

Drizzle bridge

The Drizzle bridge is not a migration tool. It reads .storage() hints on your models and emits a Drizzle schema file that you then check in. triad db generate regenerates the file when schemas change. You can hand-edit the generated file if you need features Triad doesn't model — but beware that running the generator again will overwrite it.

Marking a model as a table

Every field that should become a column must be on a t.model that has at least one field marked .storage({ primaryKey: true }). Models without a PK hint are not treated as tables and are skipped silently.

export const Pet = t.model('Pet', {
  id:        t.string().format('uuid').identity().storage({ primaryKey: true }),
  name:      t.string().minLength(1).maxLength(100).storage({ indexed: true }),
  species:   t.enum('dog', 'cat', 'bird', 'fish').storage({ indexed: true }),
  age:       t.int32().min(0).max(100),
  status:    t.enum('available', 'adopted', 'pending').default('available'),
  createdAt: t.datetime().storage({ defaultNow: true }),
});

.identity() is the DDD identity marker; .storage({ primaryKey: true }) is the persistence hint. They are different and most ID fields need both.

.storage() options

Option Effect
primaryKey: true Marks the field as the table's PK (required to become a table)
unique: true Unique constraint
indexed: true Secondary index
columnName: 'user_id' Override the SQL column name
defaultNow: true Default to CURRENT_TIMESTAMP
defaultRandom: true Default to a random UUID
references: 'projects.id' Foreign key reference
custom: { ... } Dialect-specific hints

.storage() accumulates across calls — you can chain multiple to layer hints.

Dialects

sqlite, postgres, mysql. All three emit valid Drizzle sqliteTable/pgTable/mysqlTable definitions. Type mapping is logical:

Triad type Drizzle (SQLite) Drizzle (Postgres) Drizzle (MySQL)
t.string() text text text
t.string().format('uuid') text uuid varchar(36)
t.datetime() text (ISO) text (ISO) text (ISO)
t.int32() integer integer int
t.int64() integer bigint bigint
t.float64() real doublePrecision double
t.boolean() integer (0/1) boolean tinyint
t.enum(...) text + CHECK text (or pgEnum if configured) text
t.array / t.record / ... text JSON jsonb json

Read the full file on GitHub · 151 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. 2mo ago First seen · 151 lines · 61 tokens per session scan A ef35dea95fa6

Subscribe to this mod's changes

triad-drizzle is a skill published in the GitHub repository justhamade/triadjs (24 stars, last pushed 6mo ago), licensed MIT. It adds 61 tokens to every session and 1,675 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

triad-drizzle compared with skills from other repositories

triad-drizzle next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
triad-drizzlejusthamade/triadjsSkill246mo agoMITA61Claude Code
create-prprisma/ormSkill48kyesterdayApache-2.0A48Claude Code, Codex
schema-explorationlangchain-ai/deepagentsSkill31ktodayMITA57Claude Code, Codex
atlas-mssqlariga/atlasSkill8.8k2d agoApache-2.0A163Claude Code
ha-data-storesshiwenwen/hope-agentSkill1.9kyesterdayMITA115Claude Code, Codex
nornicdb-cypher-queriesorneryd/NornicDBSkill924todayMITA79Claude Code, Codex
volcengine-rds-postgresqlbytedance/agentkit-samplesSkill484yesterdayApache-2.0A63Claude Code, Codex