Một số nội dung biên tập hiện chỉ có bằng tiếng Anh.

Prompt Chỉ biên tập Cập nhật

Prompt tái cấu trúc code

Tái cấu trúc an toàn và từng bước một đoạn code: đổi tên, tách, đơn giản hóa mà không đổi hành vi, kèm danh sách thay đổi và rủi ro.

tái cấu trúc codeđánh giá codekỹ thuật prompt
Prompt tái sử dụng

Tùy chỉnh

Ngôn ngữ prompt: tiếng Anh
Chạy trong trình duyệt

Quy trình

5 bước
  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 tiêu cực

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

Tham số cần ghi

goal
readability
constraint
do not change the public API
output
refactored code + change list + risk list
Biến
3 trường có thể tùy chỉnh

Hạn chế

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

Mẫu liên quan

Xem tất cả →