Wheels Model Generator
OfficialCraft robust ORM models with ease.
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,hasManyThroughassociations. - Comprehensive Validations: Supports presence, uniqueness, format, length, numericality, confirmation, inclusion/exclusion, and custom validations.
- Lifecycle Callbacks: Implements
before/aftercallbacks for validation, save, create, update, and delete events. - Critical Fixes: Includes mandatory fixes for
setPrimaryKey()andstructKeyExists()checks in callbacks, preventing common runtime errors. - Use Case: Create a
Usermodel thathasManyTweetsandLikes, validatesemailformat andpasswordlength, 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 requiredComponents
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.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.