Dart Drift logo

Dart Drift

Community
MADTeacher
dart-drift

Build, fix, audit, and migrate Drift persistence in Dart CLI, server-side, and non-Flutter desktop apps. Use when adding SQLite with package:drift/native.dart, configuring PostgreSQL with drift_postgres and package:postgres, writing type-safe tables, queries, writes, streams, and migrations, resolving build_runner or drift_dev failures, or validating Dart database code with code generation, analysis, tests, and migration checks.

Overview

PublisherMADTeacher
Repositorymad-agents-skills
Skill namedart-drift
Stars
109
Forks
20
Bundled files
8
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 8 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by MADTeacher on GitHub. Read the source before you install it.

Installation

Install the Dart Drift AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/MADTeacher/mad-agents-skills.git /tmp/mad-agents-skills
mkdir -p .claude/skills
cp -r /tmp/mad-agents-skills/dart-drift .claude/skills/dart-drift
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Dart Drift in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Dart Drift on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Dart Drift is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

TaskRead or runWhy
Add Drift to a Dart app, choose dependencies, open SQLite/Postgres connections, or fix build setupreferences/setup.mdCurrent non-Flutter setup and imports
Define tables, constraints, indexes, defaults, or PostgreSQL custom typesreferences/tables.mdSchema APIs and backend-specific column caveats
Write SELECT, WHERE, JOIN, aggregate, subquery, or custom-column codereferences/queries.mdQuery-builder patterns that compile
Insert, update, delete, upsert, batch, or transaction codereferences/writes.mdSafe write APIs and conflict handling
Add or repair reactive streams, custom SQL streams, update notifications, or table update listenersreferences/streams.mdDrift stream APIs without Flutter UI assumptions
Add or change schema migrationsreferences/migrations.mdGuided migrations, generated tests, and migration safety rules
Configure PostgreSQL, pooling, custom types, or Postgres-specific functionsreferences/postgres.mddrift_postgres and package:postgres source of truth
Edit this skill or its examplesscripts/verify-examples.shDeterministic smoke check for the documented patterns

Mandatory Validation

  • After dependency changes, run dart pub get.
  • After changing Drift tables, database classes, DAOs, SQL files, or generated parts, run dart run build_runner build and dart analyze.
  • After changing behavior, run the narrowest relevant dart test target. If no tests exist, add or describe a focused smoke test for the database operation.
  • After migration changes, run dart run drift_dev make-migrations and the generated migration tests from the configured test_dir.
  • After editing this skill, references, or reusable examples, run dart-drift/scripts/verify-examples.sh.

Constraints

  • Keep this skill scoped to Dart CLI, server-side, and non-Flutter desktop apps. Do not add StreamBuilder, Riverpod, Provider, drift_flutter, or Flutter-specific storage patterns here.
  • Prefer dart pub add ... for new dependencies. Only hardcode versions when matching an existing repository policy.
  • Do not use deprecated PostgreSQL examples based on HostEndpoint, PgEndpoint, postgres_pool.dart, postgresUuid(), postgresJson(), PostgresTypes, or gen_random_uuid.
  • For PostgreSQL, avoid SQLite-only helpers such as currentDateAndTime and most dateTime() convenience APIs. Use PgTypes.date, PgTypes.timestampWithTimezone, PgTypes.timestampNoTimezone, and now().
  • Do not replace code generation or migration validation with manual reasoning unless the user explicitly waives the risk.

Fallback

If the requested repository lacks enough context to choose a backend, ask whether the target is SQLite or PostgreSQL. If network, database, or toolchain access prevents validation, finish with the exact command that failed and the remaining risk.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Dart Drift AI skill do?

Build, fix, audit, and migrate Drift persistence in Dart CLI, server-side, and non-Flutter desktop apps. Use when adding SQLite with package:drift/native.dart, configuring PostgreSQL with drift_postgres and package:postgres, writing type-safe tables, queries, writes, streams, and migrations, resolving build_runner or drift_dev failures, or validating Dart database code with code generation, analysis, tests, and migration checks.

Why use Dart Drift on TypingMind?

Because you install it once and use it with any model. Dart Drift is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Dart Drift in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/MADTeacher/mad-agents-skills/tree/main/dart-drift. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Dart Drift?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Dart Drift?

As many as you like. As long as a model supports skills, you can use Dart Drift with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Dart Drift AI skill free?

Yes. It is published on GitHub by MADTeacher under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇