What problem does it solve?
This Skill guides developers in refactoring CFWheels code to significantly improve performance, enhance security, and increase maintainability. It provides clear patterns and best practices to address common anti-patterns like N+1 queries and insecure parameter handling.
Core Features & Use Cases
- Performance Optimization: Provides patterns for solving N+1 query problems and implementing eager loading to reduce database calls.
- Security Enhancement: Guides on parameter verification and SQL injection prevention to harden your application.
- Code Quality Improvement: Offers strategies like "Extract Method" to clean up complex functions and improve readability.
- Use Case: Your
posts index page is slow due to N+1 queries. This skill shows you how to refactor your findAll() call to findAll(include="user"), drastically reducing database calls and speeding up your page, allowing users to rest while your AI works.
Quick Start
Before (N+1 query):
<cfloop query="posts">
<p>#posts.user().name#</p>
</cfloop>
After (Eager loading):
posts = model("Post").findAll(include="user");
<cfloop query="posts">
<p>#posts.userName#</p>
</cfloop>