prompt-generator-v2
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePrompt Generator V2 — KERNEL Framework
提示词生成器V2 — KERNEL框架
Generate prompts that work on the first try. The KERNEL framework ensures every prompt has a clear goal, verifiable success criteria, and explicit constraints.
生成首次使用即可生效的提示词。KERNEL框架确保每个提示词都具备清晰的目标、可验证的成功标准以及明确的约束条件。
KERNEL at a Glance
KERNEL框架概览
Each letter is a checkpoint. Chi tiết + ví dụ before/after → kernel-framework.
| Principle | Check | Action if failing |
|---|---|---|
| Keep simple | Describe in one sentence? | Split into prompt chain |
| Easy to verify | Stranger could verify? | Add measurable criteria |
| Reproducible | Works in 30 days? | Remove temporal refs, add versions |
| Narrow scope | One deliverable? | Extract goals into separate prompts |
| Explicit constraints | 2-3 "do NOT" rules? | Add negative constraints |
| Logical structure | Context→Task→Constraints→Format? | Restructure |
每个字母对应一项检查标准。详情+前后示例→kernel-framework。
| 原则 | 检查标准 | 未达标时的处理方式 |
|---|---|---|
| K简洁性(Keep simple) | 能否用一句话描述核心目标? | 拆分为提示词链 |
| E可验证性(Easy to verify) | 陌生人能否验证结果是否符合要求? | 添加可衡量的判定标准 |
| R可复现性(Reproducible) | 30天后仍能生效? | 移除时效性参考,添加版本信息 |
| N窄范围(Narrow scope) | 仅对应一项交付成果? | 将多个目标拆分为独立的提示词 |
| E明确约束(Explicit constraints) | 是否包含2-3条“禁止”规则? | 添加负面约束条件 |
| L逻辑结构(Logical structure) | 是否遵循“上下文→任务→约束→格式”的结构? | 重新调整结构 |
Workflow
工作流程
Step 0: Determine Mode
步骤0:确定模式
| User input | Mode | Action |
|---|---|---|
| Vague request ("help me write a prompt for X") | Create | Go to Step 1 |
| Existing prompt provided | Improve | Run KERNEL checklist against the prompt, diagnose which principles fail, fix targeted. Skip to Step 2 |
| 用户输入 | 模式 | 操作 |
|---|---|---|
| 模糊需求(如“帮我写一个针对X的提示词”) | 创建模式 | 进入步骤1 |
| 提供现有提示词 | 优化模式 | 用KERNEL检查清单评估该提示词,诊断未达标的原则并针对性修复,直接进入步骤2 |
Step 1: Understand Intent
步骤1:明确需求意图
Extract or ask (max 3 questions — skip if the request already answers them):
- What's the single goal? — If multiple goals detected, suggest splitting into a prompt chain
- What does success look like? — Specific, verifiable criteria (numbers, formats, concrete deliverables)
- What should it NOT do? — Constraints and exclusions
If the user provides a vague request, propose a draft immediately and iterate — action beats interrogation.
提取信息或询问用户(最多3个问题——若需求已明确则跳过):
- 核心目标是什么?——若检测到多个目标,建议拆分为提示词链
- 成功的标准是什么?——具体、可验证的判定条件(如数字、格式、具体交付成果)
- 需要禁止哪些行为?——约束条件与排除项
若用户提供的需求模糊,应立即生成草稿并迭代——行动优先于追问。
Step 2: Apply KERNEL
步骤2:应用KERNEL框架
Transform intent into a structured prompt. Run each principle as a mental checklist using the table above. For detailed explanations, consult kernel-framework.
将需求意图转化为结构化提示词。以上述表格为参考,逐一核对每项原则。如需详细说明,请查阅kernel-framework。
Step 3: Generate the Prompt
步骤3:生成提示词
Use this structure. Include only relevant sections — omit what doesn't apply:
undefined使用以下结构,仅保留相关部分,省略不适用的内容:
undefinedContext
Context
[Background information the AI needs. Keep minimal — only what's necessary to understand the task. Include domain, audience, and relevant technical context.]
[AI所需的背景信息。尽量精简——仅保留理解任务必需的内容,包括领域、受众及相关技术背景。]
Task
Task
[One clear, specific goal. Start with an action verb. This is the single sentence that passes the K-test.]
[一个清晰、具体的目标。以动作动词开头。这是符合K原则的单句描述。]
Constraints
Constraints
- [What to do — specific, measurable behaviors]
- Do NOT [negative constraint 1]
- Do NOT [negative constraint 2]
- [Additional bounds: length, format, libraries, scope limits]
- [需要执行的具体、可衡量的行为]
- Do NOT [禁止行为1]
- Do NOT [禁止行为2]
- [额外限制:长度、格式、使用的库、范围限制]
Output Format
Output Format
[Exact structure of the expected output. Include: format (markdown, JSON, code), length bounds, sections/headers if applicable, delimiters.]
[预期输出的精确结构。包括:格式(markdown、JSON、代码)、长度限制、适用的章节/标题、分隔符。]
Verification
Verification
[How to check success — specific criteria that make the E-principle concrete. Think: "I'll know this worked when..."]
**Optional sections** (include when they add value):
- **Examples** — When output quality depends on seeing patterns (2-3 examples: basic + edge case)
- **Input** — When the prompt processes structured data (describe format, required fields)
- **Chain** — When the task was split, show how prompts connect[如何验证成功——使E原则落地的具体判定标准。思考:“当出现XX情况时,我就知道这生效了”]
**可选章节**(仅在能提升效果时添加):
- **示例**——当输出质量依赖于参考模式时(2-3个示例:基础案例+边缘案例)
- **输入**——当提示词需要处理结构化数据时(描述格式、必填字段)
- **链结构**——当任务被拆分时,说明各提示词之间的关联方式Step 4: Verify with KERNEL Checklist
步骤4:用KERNEL检查清单验证
Before delivering, run this self-review:
- K: Can I describe this prompt's goal in one sentence?
- E: At least 2 measurable success criteria?
- R: No temporal references, no version-ambiguous terms?
- N: Exactly one deliverable per prompt?
- E: At least 2 explicit "do NOT" constraints?
- L: Follows Context → Task → Constraints → Format structure?
- No vague virtue words ("good", "helpful", "detailed") without concrete definition
- No contradictions (e.g., "be concise" + "cover everything")
- All implicit assumptions made explicit
在交付前,执行以下自我检查:
- K:能否用一句话描述该提示词的核心目标?
- E:是否包含至少2条可衡量的成功标准?
- R:无时效性参考内容,无版本模糊的术语?
- N:每个提示词仅对应一项交付成果?
- E:是否包含至少2条明确的“禁止”约束?
- L:是否遵循“上下文→任务→约束→格式”的结构?
- 无未给出明确定义的模糊形容词(如“优秀”、“有用”、“详细”)
- 无矛盾要求(如“保持简洁”+“涵盖所有内容”)
- 所有隐含假设均已明确说明
Step 5: Deliver and Iterate
步骤5:交付与迭代
Present the prompt in a clean code block. If the original request was complex and got split:
- Show each prompt in the chain, numbered
- Explain how outputs feed into subsequent prompts
- Suggest which prompts can run in parallel vs sequential
Always offer: "Want me to adjust the constraints, add examples, or split this differently?"
将提示词放在清晰的代码块中展示。若原需求复杂且已拆分:
- 按编号展示链中的每个提示词
- 说明前一个提示词的输出如何作为下一个的输入
- 建议哪些提示词可并行执行,哪些需按顺序执行
始终主动询问:“需要我调整约束条件、添加示例或换一种拆分方式吗?”
Prompt Chaining
提示词链
When a task is too complex for one prompt (fails N-principle), decompose into a chain. Each link:
- Has a single clear goal (passes all KERNEL checks independently)
- Produces output that feeds cleanly into the next prompt
- Can be verified independently before moving to the next step
Pattern: Task → subtask analysis → ordered chain with data flow
Example: "Build a REST API" →
- Design data models (output: schema)
- Generate endpoint specifications (input: schema → output: OpenAPI spec)
- Implement endpoints (input: OpenAPI spec → output: code)
- Write tests (input: code + spec → output: test suite)
当单个提示词无法处理复杂任务(未通过N原则)时,将其拆分为提示词链。链中的每个环节需满足:
- 具备单一清晰的目标(可独立通过所有KERNEL原则检查)
- 生成的输出可直接作为下一个提示词的输入
- 在进入下一个环节前可独立验证结果
模式:任务→子任务分析→带数据流的有序链
示例:“构建一个REST API”→
- 设计数据模型(输出:Schema)
- 生成接口规格(输入:Schema → 输出:OpenAPI规范)
- 实现接口(输入:OpenAPI规范 → 输出:代码)
- 编写测试用例(输入:代码+规范 → 输出:测试套件)
Failure Modes
常见错误模式
Các lỗi phổ biến cần nhận diện và tránh khi generate prompt:
| Failure mode | Dấu hiệu | Sửa |
|---|---|---|
| Prompt quá chung | Không constraint, output có thể là bất kỳ thứ gì | Thêm scope, format, length bounds |
| Over-engineering | Prompt dài hơn output mong đợi, quá nhiều rules | Cắt constraints không ảnh hưởng output quality |
| Constraint mâu thuẫn | "Be concise" + "Cover everything thoroughly" | Chọn 1, bỏ kia, hoặc chia scope |
| Vague virtue stacking | "Good", "helpful", "engaging", "detailed" liên tiếp | Thay bằng criteria cụ thể, đo được |
| Temporal drift | "Current", "latest", "recent" không pin version | Pin version/date cụ thể |
| Missing audience | Prompt không nói cho ai → tone/depth không phù hợp | Thêm audience + expertise level |
| Format ambiguity | Không nói rõ output format → AI tự chọn | Thêm Output Format section tường minh |
生成提示词时需识别并避免的常见错误:
| 错误模式 | 迹象 | 修复方法 |
|---|---|---|
| 提示词过于宽泛 | 无约束条件,输出内容无边界 | 添加范围、格式、长度限制 |
| 过度设计 | 提示词比预期输出还长,规则过多 | 删除不影响输出质量的约束条件 |
| 约束条件矛盾 | 同时要求“保持简洁”和“全面涵盖所有内容” | 二选一,或拆分任务范围 |
| 模糊形容词堆砌 | 连续使用“优秀”、“有用”、“吸引人”、“详细”等模糊词汇 | 替换为具体、可衡量的判定标准 |
| 时效性偏差 | 使用“当前”、“最新”、“近期”等未绑定版本的词汇 | 绑定具体版本或日期 |
| 缺失受众信息 | 提示词未说明面向对象,导致语气/深度不符 | 添加受众及专业水平信息 |
| 格式模糊 | 未明确输出格式,由AI自行选择 | 添加明确的“输出格式”章节 |