stacks-models

Manage data model definitions and ORM operations within the Stacks framework.

2|Updated Jul 8, 2026
One-click install
npx skills add https://github.com/bughq/bughq --skill stacks-models-bughq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stacks-models
Source: https://github.com/bughq/bughq/tree/main/.claude/skills/stacks-models
Command: npx skills add https://github.com/bughq/bughq --skill stacks-models-bughq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill simplifies the complexity of managing data models, relationships, and schema definitions within the Stacks framework, ensuring consistent and type-safe database interactions.

Core Features & Use Cases

  • Model Management: Provides comprehensive guidance on defining models, attributes, and relationships like hasMany or belongsTo.
  • Framework Integration: Offers deep insights into the 50+ built-in framework models and their associated traits, such as useAuth or useTimestamps.
  • Use Case: When building a new feature, use this Skill to quickly generate a model with the correct traits and validation rules, or to query existing framework models like User or Product efficiently.

Quick Start

Use the stacks-models skill to generate a new model for a custom entity including its migration and factory files.

Frequently Asked Questions about stacks-models

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

FAQPage Schema
How do I define data models and ORM relationships in the Stacks framework?

To define Stacks data models and ORM relationships, use the defineModel API and specific attribute type definitions to map hasMany or belongsTo associations consistently. This ensures type-safe database schema management.

How does Stacks handle framework model integration and traits?

Stacks handles framework model integration by providing 50+ built-in models with associated traits like useAuth or useTimestamps. You apply these traits to add standard behaviors to your entities automatically.

What is the best way to generate a model with validation rules in a TypeScript backend?

The best way to generate a TypeScript backend model with validation rules is using the Stacks defineModel API. It facilitates creating application-specific models and outputs migration and factory files.

Can I query built-in Stacks models like User or Product directly?

Yes, you can query built-in Stacks models like User or Product directly. The framework provides ORM operations that facilitate efficient querying and interaction with these pre-defined database schemas.

Does the Stacks ORM support type-safe database schema management?

Yes, the Stacks ORM supports type-safe database schema management. It requires adherence to Stacks-specific attribute type definitions during model creation to ensure consistent and validated database interactions.