eng-add-persisted-model

Add Drift tables, DAOs, and repository transactions for new domain records in Flutter.

Updated Jun 17, 2026
One-click install
npx skills add https://github.com/zakariaf/Hifz-Companion --skill eng-add-persisted-model
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: eng-add-persisted-model
Source: https://github.com/zakariaf/Hifz-Companion/tree/main/.claude/skills/eng-add-persisted-model
Command: npx skills add https://github.com/zakariaf/Hifz-Companion --skill eng-add-persisted-model

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires drift, dart, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the process of adding new persisted record types and their corresponding DAO/repository surfaces to the Hifz Companion Flutter app, ensuring consistency and efficiency in data management.

Core Features & Use Cases

  • Automated Record Addition: Automatically adds new persisted record types, including their respective Drift table classes, DAOs, and repository transaction bodies.
  • Schema Management: Ensures schema integrity with STRICT, CHECK, foreign keys, and indices.
  • Use Case: When adding a new domain record, such as a Card or ReviewLog, this Skill guides the creation of the necessary components, including Drift migrations and DAO methods.

Quick Start

Use the eng-add-persisted-model skill to add a new persisted record type 'Card' to the Hifz Companion app.

Frequently Asked Questions about eng-add-persisted-model

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new persisted record type and DAO in Flutter using Drift?

To add a persisted record type in Flutter, you define the Drift table class, implement the DAO, and write repository transaction bodies. This Skill automates that entire workflow, ensuring schema integrity and transactional consistency for new domain records like Cards or ReviewLogs.

How does Drift schema management handle foreign keys and indices for new tables?

Drift schema management enforces data integrity by applying STRICT tables, CHECK constraints, foreign keys, and indices. This Skill automates these constraints when generating new domain records, ensuring the database schema remains robust and consistent during migrations.

Do I need Dart and Drift to automate database repository transactions?

Yes, you need both Dart and Drift to automate database repository transactions. Drift provides the SQLite abstraction and schema management, while Dart handles the repository transaction bodies and DAO methods required for persistent data operations.

What is the best way to create Drift migrations for new domain records in Flutter?

The best way to create Drift migrations for new domain records is to automate the generation of table classes, DAOs, and repository transactions together. This ensures schema integrity and transactional consistency, preventing manual migration errors when adding records like Cards.

Can I use this to generate DAO methods for a Flutter app's existing data persistence layer?

Yes, this Skill generates DAO methods and repository transaction bodies for existing Flutter data persistence layers. It integrates new domain records into the current Drift database schema while maintaining strict constraints and transactional consistency.

Why does adding a new Drift table require updating the repository transaction layer?

Adding a new Drift table requires updating the repository layer to maintain transactional consistency. Without corresponding DAO methods and transaction bodies, the new persisted record type cannot safely interact with the database schema, risking data integrity.