Loading...
Loading...
Compare original and translation side by side
assets/TASKINPUTRULESOUTPUT FORMATnullassets/TASKINPUTRULESOUTPUT FORMATnull| Task | Pattern to Use | Key Components | When to Use |
|---|---|---|---|
| Machine-parseable output | Structured Output | JSON schema, "JSON-only" directive, no prose | API integrations, data extraction |
| Field extraction | Deterministic Extractor | Exact schema, missing->null, no transformations | Form data, invoice parsing |
| Use retrieved context | RAG Workflow | Context relevance check, chunk citations, explicit missing info | Knowledge bases, documentation search |
| Internal reasoning | Hidden Chain-of-Thought | Internal reasoning, final answer only | Classification, complex decisions |
| Tool-using agent | Tool/Agent Planner | Plan-then-act, one tool per turn | Multi-step workflows, API calls |
| Text transformation | Rewrite + Constrain | Style rules, meaning preservation, format spec | Content adaptation, summarization |
| Classification | Decision Tree | Ordered branches, mutually exclusive, JSON result | Routing, categorization, triage |
| 任务 | 适用模式 | 核心组件 | 使用场景 |
|---|---|---|---|
| 机器可解析输出 | 结构化输出 | JSON Schema、“仅输出JSON”指令、无散文式内容 | API集成、数据提取 |
| 字段提取 | 确定性提取器 | 精确Schema、缺失值返回null、无转换操作 | 表单数据、发票解析 |
| 使用检索到的上下文 | RAG工作流 | 上下文相关性检查、块引用、明确标注缺失信息 | 知识库、文档搜索 |
| 内部推理 | 隐藏思维链 | 内部推理、仅输出最终答案 | 分类、复杂决策 |
| 使用工具的Agent | 工具/Agent规划器 | 先规划后执行、每轮调用一个工具 | 多步骤工作流、API调用 |
| 文本转换 | 重写与约束 | 风格规则、语义保留、格式规范 | 内容适配、摘要生成 |
| 分类 | 决策树 | 有序分支、互斥规则、JSON结果 | 路由、分类、分流 |
User needs: [Prompt Type]
|-- Output must be machine-readable?
| |-- Extract specific fields only? -> **Deterministic Extractor Pattern**
| `-- Generate structured data? -> **Structured Output Pattern (JSON)**
|
|-- Use external knowledge?
| `-- Retrieved context must be cited? -> **RAG Workflow Pattern**
|
|-- Requires reasoning but hide process?
| `-- Classification or decision task? -> **Hidden Chain-of-Thought Pattern**
|
|-- Needs to call external tools/APIs?
| `-- Multi-step workflow? -> **Tool/Agent Planner Pattern**
|
|-- Transform existing text?
| `-- Style/format constraints? -> **Rewrite + Constrain Pattern**
|
`-- Classify or route to categories?
`-- Mutually exclusive rules? -> **Decision Tree Pattern**用户需求: [提示词类型]
|-- 输出必须是机器可读的?
| |-- 仅提取特定字段? -> **确定性提取器模式**
| `-- 生成结构化数据? -> **结构化输出模式(JSON)**
|
|-- 需要使用外部知识?
| `-- 检索到的上下文必须被引用? -> **RAG工作流模式**
|
|-- 需要推理但隐藏过程?
| `-- 分类或决策任务? -> **隐藏思维链模式**
|
|-- 需要调用外部工具/API?
| `-- 多步骤工作流? -> **工具/Agent规划器模式**
|
|-- 转换现有文本?
| `-- 有风格/格式约束? -> **重写与约束模式**
|
`-- 分类或路由到不同类别?
`-- 规则互斥? -> **决策树模式**TASK:
{{one_sentence_task}}
INPUT:
{{input_data}}
RULES:
- Follow TASK exactly.
- Use only INPUT (and tool outputs if tools are allowed).
- No invented details. Missing required info -> say what is missing.
- Keep reasoning hidden.
- Follow OUTPUT FORMAT exactly.
OUTPUT FORMAT:
{{schema_or_format_spec}}TASK:
{{one_sentence_task}}
INPUT:
{{input_data}}
RULES:
- 严格遵循TASK要求。
- 仅使用INPUT(若允许使用工具则包含工具输出)。
- 不得编造细节。缺失必要信息时,说明缺失内容。
- 隐藏推理过程。
- 严格遵循OUTPUT FORMAT要求。
OUTPUT FORMAT:
{{schema_or_format_spec}}AVAILABLE TOOLS:
{{tool_signatures_or_names}}
WORKFLOW:
- Make a short plan.
- Call tools only when required to complete the task.
- Validate tool outputs before using them.
- If the environment supports parallel tool calls, run independent calls in parallel.可用工具:
{{tool_signatures_or_names}}
工作流:
- 制定简短计划。
- 仅在完成任务必需时调用工具。
- 使用工具输出前先进行验证。
- 若环境支持并行工具调用,可同时运行独立的调用请求。RETRIEVED CONTEXT:
{{chunks_with_ids}}
RULES:
- Use only retrieved context for factual claims.
- Cite chunk ids for each claim.
- If evidence is missing, say what is missing.检索到的上下文:
{{chunks_with_ids}}
规则:
- 事实性声明仅使用检索到的上下文。
- 每个声明需引用块ID。
- 若缺少证据,说明缺失内容。frameworks/shared-skills/skills/ai-prompt-engineering/references/quality-checklists.mdframeworks/shared-skills/skills/ai-prompt-engineering/references/production-guidelines.mdframeworks/shared-skills/skills/ai-prompt-engineering/references/quality-checklists.mdframeworks/shared-skills/skills/ai-prompt-engineering/references/production-guidelines.md| Aspect | Prompt Engineering | Context Engineering |
|---|---|---|
| Focus | Instruction text | Full input pipeline |
| Scope | Single prompt | RAG + history + tools |
| Optimization | Word choice, structure | Information architecture |
| Goal | Clear instructions | Optimal context window |
| 维度 | 提示词工程 | 上下文工程 |
|---|---|---|
| 关注点 | 指令文本 | 完整输入管道 |
| 范围 | 单个提示词 | RAG + 历史 + 工具 |
| 优化方向 | 措辞、结构 | 信息架构 |
| 目标 | 清晰的指令 | 最优上下文窗口 |
<system><user><context><system><user><context>data/sources.jsondata/sources.jsonmediumhighxhighmediumhighxhigh