create-model

Automate Sequelize model creation with migrations, TypeScript types, and associations.

Updated Apr 28, 2025
One-click install
npx skills add https://github.com/briankeane/node-react-scaffold --skill create-model-briankeane
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-model
Source: https://github.com/briankeane/node-react-scaffold/tree/main/.claude/skills/create-model
Command: npx skills add https://github.com/briankeane/node-react-scaffold --skill create-model-briankeane

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of creating new database models, ensuring consistency and reducing boilerplate code for migrations, types, associations, and tests.

Core Features & Use Cases

  • Automated Model Generation: Creates migration files, model definitions with TypeScript types, and index files.
  • Association Setup: Provides guidance on defining relationships between models.
  • Test Integration: Includes patterns for writing tests for complex models and adding factory functions for test data generation.
  • Use Case: When adding a new feature that requires a new data entity, use this Skill to quickly scaffold the necessary database structure and associated code.

Quick Start

Use the create-model skill to generate a new Sequelize model named 'Product' with a 'name' and 'price' field.

Frequently Asked Questions about create-model

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

FAQPage Schema
How do I generate a Sequelize model and migration together?

Generating Sequelize models and migrations together requires creating migration files, TypeScript type definitions, and model index files simultaneously. This automation ensures schema consistency and reduces manual boilerplate code during backend database development.

What's the best way to set up Sequelize model associations with TypeScript?

Setting up Sequelize model associations with TypeScript involves defining relationship configurations alongside your model definitions. This process provides guidance on linking related data entities and automatically generates the necessary TypeScript type definitions to maintain type safety across associations.

Can I automatically generate test data factories for Sequelize models?

Yes, you can automatically generate test data factories for Sequelize models. This process includes patterns for writing tests for complex models and adds factory functions specifically designed for generating test data, streamlining your backend testing workflow.

How do I scaffold a new database entity for a backend feature?

To scaffold a new database entity for a backend feature, you automate the creation of the necessary database structure, including migration scripts and TypeScript definitions. This quickly generates the required model files and association configurations for the new data entity.

Does this database model generation approach support TypeScript type definitions?

Yes, this database model generation approach fully supports TypeScript type definitions. It automates the creation of TypeScript types alongside Sequelize model definitions and index files, ensuring type safety and reducing manual type declaration boilerplate.