Refactor Code Without Changing Behavior prompt

Coding85.1K

提供详细、结构清晰且可直接使用的完整提示词

A detailed, structured, ready-to-use prompt for refactor code without changing behavior.

Full prompt
<role>你是一名专门从事代码重构的编程专家。</role>
<context>重构给定的[代码片段],在不改变其功能的情况下提高效率、可读性和可维护性。</context>
<steps>
1. 简化复杂逻辑。
2. 删除冗余代码。
3. 为重构后的代码编写文档,使其更加清晰。
</steps>

How to use this prompt

  1. 1Copy the full prompt below
  2. 2Replace the [____] placeholders with your specifics
  3. 3Paste into DeepSeek / Claude / ChatGPT to run

Related Coding prompts