dart-drift

dart-drift is a skill for Claude Code, Codex from MADTeacher/mad-agents-skills. It costs 91 tokens per session (1,072 once invoked), scanned A, original, MIT.

A Dart persistence guide for Drift, a library for working with databases such as SQLite and PostgreSQL. It covers database tables, queries, writes, streams, migrations, and generated code for non-Flutter applications.

In plain words
What is it for?
Use it when adding or changing type-safe database schemas, queries, writes, streams, migrations, or build-runner configuration in Dart command-line, server, or native desktop applications.
Why use it?
It helps avoid unsafe database changes by requiring the project and database backend to be checked first. It also separates local SQLite work from server-side PostgreSQL work and flags Flutter projects as a different case.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when adding or changing type-safe database schemas, queries, writes, streams, migrations, or build-runner configuration in Dart command-line, server, or native desktop applications.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/madteacher/mad-agents-skills/dart-drift
Install

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.

Any agent
npx skills add MADTeacher/mad-agents-skills --skill dart-drift
Clone the repo
git clone --depth 1 https://github.com/MADTeacher/mad-agents-skills

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 dart-drift

README.md
[![agentmods](https://agentmods.dev/badge/skills/madteacher/mad-agents-skills/dart-drift/github.svg)](https://agentmods.dev/skills/madteacher/mad-agents-skills/dart-drift)
Your own site
<a href="https://agentmods.dev/skills/madteacher/mad-agents-skills/dart-drift"><img src="https://agentmods.dev/badge/skills/madteacher/mad-agents-skills/dart-drift/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 dart-drift

Your own site · 80×15
<a href="https://agentmods.dev/skills/madteacher/mad-agents-skills/dart-drift"><img src="https://agentmods.dev/badge/skills/madteacher/mad-agents-skills/dart-drift.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,072 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
  • Socket pass 5 May 2026
  • Snyk pass 5 May 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.00091 $0.01072
Opus 5 $0.00046 $0.00536
Sonnet 5 $0.00018 $0.00214
Haiku 4.5 $0.00009 $0.00107

Measured 12d ago against content hash 6738dc623394, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

dart-drift 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 12d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/verify-examples.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

dart-drift/SKILL.md · 90 lines

How it starts

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

Dart Drift

You are a Dart persistence engineer for non-Flutter apps using Drift.

Principle 0

Do not write Drift database code from memory. First identify the runtime backend, read the routed reference for the operation, then verify generated code with the Dart toolchain. Broken persistence code is worse than no persistence code because schema and migration mistakes can silently lose data.

Workflow

  1. Inspect the project before changing code: pubspec.yaml, existing database classes, build.yaml, generated parts, tests, migration files, and whether the app targets SQLite, PostgreSQL, or both.
  2. Choose the backend path:
    • For Dart CLI, server jobs, or native desktop local storage, use SQLite via package:drift/native.dart.
    • For server-side PostgreSQL, use drift_postgres with package:postgres and enable the Postgres SQL dialect in build.yaml.
    • For Flutter UI integration, stop and use the flutter-drift skill instead.
  3. Read only the reference files needed for the requested task.
  4. Implement the smallest safe change using the APIs and caveats from those references.
  5. Run mandatory validation. If validation cannot run, report the blocker and the concrete risk instead of presenting the change as verified.

Resource Routing

Task Read or run Why
Add Drift to a Dart app, choose dependencies, open SQLite/Postgres connections, or fix build setup references/setup.md Current non-Flutter setup and imports
Define tables, constraints, indexes, defaults, or PostgreSQL custom types references/tables.md Schema APIs and backend-specific column caveats
Write SELECT, WHERE, JOIN, aggregate, subquery, or custom-column code references/queries.md Query-builder patterns that compile
Insert, update, delete, upsert, batch, or transaction code references/writes.md Safe write APIs and conflict handling
Add or repair reactive streams, custom SQL streams, update notifications, or table update listeners references/streams.md Drift stream APIs without Flutter UI assumptions
Add or change schema migrations references/migrations.md Guided migrations, generated tests, and migration safety rules
Configure PostgreSQL, pooling, custom types, or Postgres-specific functions references/postgres.md drift_postgres and package:postgres source of truth
Edit this skill or its examples scripts/verify-examples.sh Deterministic smoke check for the documented patterns

Read the full file on GitHub · 90 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago First seen · 90 lines · 91 tokens per session scan A 6738dc623394

Subscribe to this mod's changes

dart-drift is a skill published in the GitHub repository MADTeacher/mad-agents-skills (108 stars, last pushed 4mo ago), licensed MIT. It adds 91 tokens to every session and 1,072 once invoked, about $0.0005 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-08-30.

Related

Other skills, from other repositories

firebase-cloud-firestore

Use when setting up Firestore, designing schemas, doing CRUD, creating listeners, paginating queries, configuring indexes, enabling offline persistence, or writing security rules.

evanca/flutter-ai-rules · 37 tokens

firebase-database

Use when syncing real-time data, structuring JSON trees, reading/writing, creating listeners, enabling offline persistence, managing presence, sharding, or writing security rules.

evanca/flutter-ai-rules · 38 tokens

firebase-data-connect

Use when setting up Data Connect, writing GraphQL queries/mutations, configuring generated SDKs, handling offline, or applying security rules.

evanca/flutter-ai-rules · 31 tokens

persisting-data-with-drift

Implements type-safe reactive SQL persistence in Flutter using Drift v2.32 (formerly Moor) built on SQLite with automatic code generation. Activates when defining table schemas with Drift DSL, writing type-safe join or subquery operations, handling schema migrations with MigrationStrategy, using reactive watch()…

Poorgramer-Zack/dart-expert-skills · 136 tokens

managing-hive-storage

Hive CE (Community Edition v2.19.x) NoSQL object database for Flutter providing blazing-fast key-value and object storage with TypeAdapters. Use this skill when implementing offline-first architecture, high-performance local data caching, NoSQL document-style object stores, custom TypeAdapter serialization for complex…

Poorgramer-Zack/dart-expert-skills · 146 tokens

developing-serverpod-backend

Develops full-stack Dart backends using the Serverpod framework with PostgreSQL, Redis, and Docker. Use when building type-safe API endpoints, defining YAML data models, configuring Serverpod auth, writing server-side tests, running database migrations, deploying to Docker/AWS/GCP, or using Serverpod Mini for…

Poorgramer-Zack/dart-expert-skills · 76 tokens