Wheels Model Generator

Official

Craft robust ORM models with ease.

Authorwheels-dev
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill simplifies the creation of CFWheels ORM models, ensuring proper validations, associations, and methods while preventing common Wheels-specific errors like mixed argument styles and missing primary key declarations. It provides a production-ready template to build reliable data layers.

Core Features & Use Cases

  • ORM Model Generation: Creates models with hasMany, belongsTo, hasManyThrough associations.
  • Comprehensive Validations: Supports presence, uniqueness, format, length, numericality, confirmation, inclusion/exclusion, and custom validations.
  • Lifecycle Callbacks: Implements before/after callbacks for validation, save, create, update, and delete events.
  • Critical Fixes: Includes mandatory fixes for setPrimaryKey() and structKeyExists() checks in callbacks, preventing common runtime errors.
  • Use Case: Create a User model that hasMany Tweets and Likes, validates email format and password length, and hashes passwords before saving. This skill ensures all these features are implemented correctly and securely, saving you from common pitfalls.

Quick Start

Example Model:

component extends="Model" { function config() { setPrimaryKey("id"); # CRITICAL! hasMany(name="comments", dependent="delete"); validatesPresenceOf(properties="title"); beforeCreate("setDefaults"); } private function setDefaults() { if (!structKeyExists(this, "count")) { this.count = 0; } } }

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: Wheels Model Generator
Download link: https://github.com/wheels-dev/wheels/archive/main.zip#wheels-model-generator

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository