motherduck-model-data

Design analytical database schemas and generate SQL model scaffolds for MotherDuck.

Updated Oct 15, 2019
One-click install
npx skills add https://github.com/kkkaoru/dotfiles --skill motherduck-model-data-kkkaoru
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: motherduck-model-data
Source: https://github.com/kkkaoru/dotfiles/tree/main/.agents/skills-stroage/motherduck-model-data
Command: npx skills add https://github.com/kkkaoru/dotfiles --skill motherduck-model-data-kkkaoru

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Designing analytical data models in MotherDuck often results in ad-hoc SQL executed directly in the warehouse with no versioning, no dependency tracking, and no reproducibility. This Skill produces a file-based project scaffold with organized SQL models and a DAG manifest so transformations can be reviewed, versioned, and rerun. ## Core Features & Use Cases - File-Based Project Scaffold: Generates SQL files organized by lifecycle stage (raw, staging, analytics) plus a model_manifest.yml defining the DAG, dependencies, and materialization strategy. - Analytical Schema Design Guidance: Applies OLAP best practices such as wide denormalized tables, pre-aggregated serving tables, correct data types (DECIMAL for money, VARCHAR for IDs), and NOT NULL constraints. - Use Case: When asked to model raw event data for analytics, the Skill inspects source tables, then creates raw/staging/analytics SQL files with a manifest declaring each model's dependencies and materialization, ready to run against MotherDuck. ## Quick Start Ask the assistant to design a data model for your MotherDuck source tables and generate the SQL project scaffold with a dependency manifest.

Frequently Asked Questions about motherduck-model-data

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

FAQPage Schema
How do I design a data model in MotherDuck?

Inspect the source tables and column types first, then create SQL files organized by lifecycle stage (raw, staging, analytics) with a model_manifest.yml declaring dependencies and materialization. Prefer wide denormalized tables and pre-aggregated serving tables over normalized OLTP schemas.

What data types should I use in DuckDB and MotherDuck schemas?

Use VARCHAR for IDs, DECIMAL(18,2) for money, TIMESTAMP for times, BOOLEAN for flags, and JSON, STRUCT, LIST, or MAP for semi-structured data. Avoid FLOAT for money and VARCHAR for timestamps.

When should I use a view versus a CTAS table in MotherDuck?

Use a view when results must reflect the latest data and the query runs fast. Use a CTAS table when the query is expensive, accessed frequently, or source data changes infrequently and can be rebuilt periodically.

Are primary keys and foreign keys enforced in MotherDuck?

No. Only NOT NULL is enforced in DuckDB and MotherDuck; PRIMARY KEY, UNIQUE, and CHECK constraints are informational only, and FOREIGN KEY is not supported. Use NOT NULL liberally as the main constraint mechanism.

When should I skip the SQL project scaffold?

Skip the scaffold when the request is a single table, a quick DDL statement, or an ad-hoc exploration query. The scaffold is the default only for multi-table, multi-stage modeling work with dependencies.