You are performing an iterative debug loop on a Roblox project. Follow these 7 steps. The loop has a maximum of 5 iterations before escalating to the user.
Read the relevant script(s) from the synced folder (or via MCP if in MCP-Only Mode). Search for the error message, relevant function names, or the script from the stack trace.
Logic - Wrong calculation, incorrect condition, missing state
Security - Client-side issue that should be server-side, unvalidated remote
Performance - Timeout, memory, script contention
If the
roblox-sharp-edges
skill is available, load it for known gotchas. Otherwise, proceed with general Luau knowledge.
Identify:
The exact line(s) causing the error
Why the error occurs (root cause, not symptom)
Whether this is a standalone bug or a symptom of a deeper issue
针对常见Roblox问题类别分析错误。加载
skills/roblox-sharp-edges/SKILL.md
以了解已知陷阱。
对错误进行分类:
语法错误 - 缺少
end
、拼写错误、语法不正确
运行时错误 - nil值访问、服务缺失、实例已销毁
逻辑错误 - 计算错误、条件不正确、状态缺失
安全错误 - 应在服务器端处理的客户端问题、未验证的远程调用
性能错误 - 超时、内存问题、脚本竞争
如果
roblox-sharp-edges
技能可用,加载它以了解已知陷阱。否则,使用通用Luau知识继续。
确定:
导致错误的确切代码行
错误发生的原因(根本原因,而非症状)
这是独立bug还是更深层次问题的症状
Step 4: Generate Fix
步骤4:生成修复方案
Produce corrected Luau code with an explanation of:
What was wrong (the root cause)
Why the fix works
Any related code that should also be checked
If the fix involves architectural changes (not just a line fix), explain the change clearly and suggest where else the same pattern applies.
生成修正后的Luau代码,并解释:
问题所在(根本原因)
修复方案为何有效
任何也应检查的相关代码
如果修复涉及架构变更(不仅仅是单行修复),清晰解释变更内容,并建议其他适用相同模式的地方。
Step 5: Apply & Test
步骤5:应用与测试
Write the fix to the synced file. If MCP is available, use it to verify the fix applies cleanly. If playtest is running, check for errors after the fix.
If in offline mode, provide the corrected code with clear before/after diff and manual test instructions.