Refactor for readability without changing behavior
Proposes small, behavior-preserving refactorings for a function and lists the tests that must still pass.
このリソースは英語のみで提供されています。
プロンプトは、ご自身のアシスタントにコピーして使うテキストです。KitLocal はプロンプトを実行しません。
変数を入力
入力した内容はこのブラウザ内にのみ残り、URL への追加、保存、外部への送信は行われません。
プレビュー
未入力: Code to refactor, Language
Refactor this {{language}} code for readability WITHOUT changing behavior.
Give a list of small steps, each independently reviewable, with the resulting code for the
final step only. Call out any step that could change behavior (ordering, errors, side effects)
and the test that would reveal it. If the existing tests are missing or weak, say which
characterization tests to write first.
Code:
{{code}}
Existing tests:
目的
Improve structure while keeping behavior identical and verifiable.
使う場面
- A function is hard to read and you want safe, reviewable steps.
準備するもの
- The code and the tests that cover it, if any.
期待される出力
Steps with risk notes, then the final code.
このカタログについて
同梱スナップショット · 2026/11/15 6:05 に公開 · カタログのリビジョン 5bc079fe355af2214bc0
アプリに同梱されたスナップショットを表示しています(コンテンツソースが設定されていません)。ソース側にはより新しいコンテンツがある可能性があります。