← スキル一覧に戻る

wheels-refactoring
by wheels-dev
wheels-refactoringは、other分野における実用的なスキルです。複雑な課題への対応力を強化し、業務効率と成果の質を改善します。
⭐ 200🍴 106📅 2026年1月23日
SKILL.md
name: Wheels Refactoring description: Refactor Wheels code for better performance, security, and maintainability. Use when optimizing code, fixing anti-patterns, improving performance, or enhancing security. Provides refactoring patterns and best practices.
Wheels Refactoring
Performance Refactoring
N+1 Query Problem
Before:
<cfloop query="posts">
<p>#posts.user().name#</p> <!--- N+1 queries! --->
</cfloop>
After:
posts = model("Post").findAll(include="user");
<cfloop query="posts">
<p>#posts.userName#</p> <!--- 1 query! --->
</cfloop>
Eager Loading
Before:
posts = model("Post").findAll();
// Associations loaded lazily
After:
posts = model("Post").findAll(include="user,comments,tags");
// All associations loaded upfront
Security Refactoring
Parameter Verification
Before:
function show() {
post = model("Post").findByKey(key=params.key);
}
After:
function config() {
verifies(only="show", params="key", paramsTypes="integer");
}
function show() {
post = model("Post").findByKey(key=params.key);
}
SQL Injection Prevention
Before:
where="userId = #params.userId#" // Vulnerable!
After:
where="userId = #params.userId#" // Wheels escapes automatically
// Or use parameterized queries
Code Quality Refactoring
Extract Method
Before:
function create() {
user = model("User").new(params.user);
user.password = hash(user.password, "SHA-512");
if (user.save()) {
sendMail(to=user.email, subject="Welcome");
redirectTo(action="show", key=user.key());
}
}
After:
function create() {
user = model("User").new(params.user);
if (user.save()) {
redirectTo(action="show", key=user.key());
}
}
// In User model:
private function hashPassword() {
this.password = hash(this.password, "SHA-512");
}
private function sendWelcomeEmail() {
sendMail(to=this.email, subject="Welcome");
}
Generated by: Wheels Refactoring Skill v1.0
スコア
総合スコア
75/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
✓人気
GitHub Stars 100以上
+5
✓最近の活動
1ヶ月以内に更新
+10
✓フォーク
10回以上フォークされている
+5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
レビュー
💬
レビュー機能は近日公開予定です
