一部の編集内容は現在英語で提供されています。

プロンプト 編集のみ 更新

コードリファクタリングプロンプト

コード片を安全かつ段階的にリファクタリングします。名前変更・分割・簡素化で動作を変えず、変更点とリスクを列挙します。

コードリファクタリングコードレビュープロンプト工学
再利用可能なプロンプト

自分用に変更

プロンプト言語:英語
ブラウザ内で動作

手順

5 ステップ
  1. Paste the code and state the goal and constraints.
  2. Generate the refactor.
  3. Review the change list and risk list.
  4. Run tests to confirm identical behavior.
  5. Commit the refactor separately from feature work.

ネガティブプロンプト

rewrite the whole file, change the API, add dependencies, drop error handling, unrequested features

記録するパラメータ

goal
readability
constraint
do not change the public API
output
refactored code + change list + risk list
変数
3 個のカスタマイズ項目

制限

  • AI refactors can silently change edge-case behavior.
  • It is not a substitute for running your test suite.
  • Long files may need to be refactored in smaller pieces.

関連テンプレート

すべて見る →