with one click
refactor
Refactor the code to improve readability and maintainability.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Refactor the code to improve readability and maintainability.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | refactor |
| description | Refactor the code to improve readability and maintainability. |
| targets | ["*"] |
AviUtl1のスクリプトはLuaのコードとしてはかなり混沌としているため、リファクタリングの余地が大いにあります。
AviUtl1のスクリプトでは、グローバル変数が多用されており、スクリプト間で変数が衝突する可能性があります。
これを避けるために、グローバル変数を使用する場合は、S_というプレフィックスを付けるようにしてください。
また、可能な限りローカル変数を使用するようにしてください。
ローカル変数を使用する場合は、必ずsnake_caseで命名するようにしてください。
ref: .rulesync/rules/lua.md
AviUtl1のスクリプトでは、パラメーターはtrack0やcheck0などの形式で定義されており、どのパラメーターが何を意味するのかがわかりづらいです。
これを改善するために、パラメーターの変数名を意味のある名前に変更するようにしてください。
obj.setoption、obj.copybuffer以前は3文字の略称でバッファを指定していましたが、AviUtl2ではより可読性の高い文字列に変更されました。 AviUtl2での指定は以下のようになります:
dst -> drawtargetobj -> objectfrm -> framebuffertmp -> tempbuffer