适用场景
- 以结构化、可复用的提示词为起点,而非空白对话框。
- 根据自己的需求调整提示词,同时保持原始意图不变。
- 与Education & Academic相关的工作流。
为选定主题和技能水平生成真实的单一错误代码示例,并附带详细解释和修正方案。
You are an experienced developer and university instructor.
Create {{Example Count:5}} erroneous code examples on the topic {{Topic: e.g. SwiftUI State Management}} in {{Language Stack:[programming_languages]}} for students at the following level: {{Student Level: First-Semester - No Prior Knowledge, *Beginner - First Own Projects, Advanced - Several Semesters of Practice}}.
Requirements for each example:
- Compilable realistic code. No pseudocode and no artificially constructed miniatures.
- Exactly one error per example from the following category: {{Error Category: Layer Separation Violation - Logic in the View, State in the Wrong Place or Duplicated, Missing Abstraction - Direct Dependency Instead of a Protocol, Misleading or Inconsistent Naming, Functions With Multiple Responsibilities, Missing or Swallowed Error Handling, Incorrect Concurrency Handling, *A Different Error Type per Example}}.
- The error must be typical for this level and not exotic.
- No comments no hints and no marking of the error location.
- Variable type and UI element names consistently in English.
Output the examples first as a closed numbered block that can be projected directly.
Then under a clearly separated heading "Solutions" write three to four sentences per example covering what is wrong why it hurts in a real project and the corrected version of the affected snippet.
5
e.g. SwiftUI State Management
[programming_languages]
First-Semester - No Prior Knowledge, Beginner - First Own Projects, Advanced - Several Semesters of Practice
Layer Separation Violation - Logic in the View, State in the Wrong Place or Duplicated, Missing Abstraction - Direct Dependency Instead of a Protocol, Misleading or Inconsistent Naming, Functions With Multiple Responsibilities, Missing or Swallowed Error Handling, Incorrect Concurrency Handling, A Different Error Type per Example
You are an experienced developer and university instructor. Create 5 erroneous code examples on the topic e.g. SwiftUI State Management in [programming_languages] for students at the following level: First-Semester - No Prior Knowledge. Requirements for each example: - Compilable realistic code. No pseudocode and no artificially constructed miniatures. - Exactly one error per example from the following category: Layer Separation Violation - Logic in the View. - The error must be typical for this level and not exotic. - No comments no hints and no marking of the error location. - Variable type and UI element names consistently in English. Output the examples first as a closed numbered block that can be projected directly. Then under a clearly separated heading "Solutions" write three to four sentences per example covering what is wrong why it hurts in a real project and the corrected...
变量被 {{ 和 }} 包裹,遵循以下格式:
选项可以通过方括号引用预定义变量列表。这些选项以[橙色]显示,提供颜色、语气或语言等常用值。
也可以提供以逗号分隔的内联选项列表。
提示:使用这些提示词无需 PUCO 应用!只需复制模板,直接在 ChatGPT、Claude、Gemini 或任何其他 AI 助手中将每个 {{…}} 部分替换为自己的文本。