Certains détails éditoriaux sont encore disponibles en anglais.

Prompt Éditorial uniquement Mis à jour

Prompt de refactorisation de code

Une refactorisation sûre et progressive d’un extrait de code : renommer, découper et simplifier sans changer le comportement, avec la liste des changements et des risques.

refactorisation de coderevue de codeingénierie de prompt
Prompt réutilisable

Personnalisez-le

Langue du prompt : anglais
Fonctionne dans votre navigateur

Workflow

5 étapes
  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.

Prompt négatif

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

Paramètres à noter

goal
readability
constraint
do not change the public API
output
refactored code + change list + risk list
Variables
3 champs personnalisables

Limites

  • 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.

Modèles associés

Tout voir →