extract-pattern
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMANDATORY PREPARATION
强制准备工作
Invoke {{command_prefix}}agent-workflow — it contains workflow principles, anti-patterns, and the Context Gathering Protocol. Follow the protocol before proceeding — if no workflow context exists yet, you MUST run {{command_prefix}}teach-maestro first.
Turn working solutions into reusable patterns. Every successful workflow contains patterns that are applicable beyond their original context.
调用 {{command_prefix}}agent-workflow —— 它包含工作流原则、反模式以及上下文收集协议。在继续操作前请遵循该协议——如果当前还没有任何工作流上下文,你必须先运行 {{command_prefix}}teach-maestro。
将可行的解决方案转化为可复用模式。每个成功的工作流都包含可在其原始场景之外应用的模式。
Step 1: Identify What Worked
步骤1:识别有效内容
Review the workflow and identify components that:
- Solved a common problem in a particularly effective way
- Would be useful in other workflows or projects
- Required significant iteration to get right
- Represent a non-obvious solution
回顾工作流,识别满足以下条件的组件:
- 以极高的效率解决了某类常见问题
- 可在其他工作流或项目中复用
- 经过大量迭代才最终完善
- 代表了非显而易见的解决方案
Step 2: Generalize the Pattern
步骤2:泛化模式
Transform the specific solution into a reusable template:
From specific → To general pattern:
markdown
undefined将特定解决方案转化为可复用模板:
从特定方案 → 到通用模式:
markdown
undefinedPattern: [Name]
Pattern: [Name]
Problem: What recurring problem does this solve?
When to use: When is this pattern appropriate?
When NOT to use: When is this pattern inappropriate?
Template: Copy-pastable starting point with customization markers.
Variants: Common variations for different contexts.
Pitfalls: What went wrong during development and how it was fixed.
Examples: 1-2 concrete examples.
undefinedProblem: What recurring problem does this solve?
When to use: When is this pattern appropriate?
When NOT to use: When is this pattern inappropriate?
Template: Copy-pastable starting point with customization markers.
Variants: Common variations for different contexts.
Pitfalls: What went wrong during development and how it was fixed.
Examples: 1-2 concrete examples.
undefinedStep 3: Test Reusability
步骤3:测试可复用性
- Apply the template to a different but analogous problem
- Confirm the customization points are sufficient
- Verify the documentation is clear enough for someone unfamiliar with the original
| Workflow Element | Extract As |
|---|---|
| Effective prompt structure | Prompt template with customization points |
| Tool chain that works well | Pipeline pattern with data flow diagram |
| Error handling strategy | Resilience pattern with implementation guide |
| Evaluation approach | Quality assurance pattern with scoring rubric |
| Context management technique | Context pattern with budget guidance |
| Agent coordination protocol | Orchestration pattern with handoff templates |
- 将模板应用到另一个不同但类似的问题上
- 确认自定义点位足够完善
- 验证文档对于不熟悉原始场景的用户来说足够清晰易懂
| 工作流元素 | 提取为 |
|---|---|
| 高效的提示词结构 | 带有自定义点位的提示词模板 |
| 运行良好的工具链 | 带有数据流图的流水线模式 |
| 错误处理策略 | 带有实现指南的容错模式 |
| 评估方法 | 带有评分规则的质量保障模式 |
| 上下文管理技巧 | 带有预算指导的上下文模式 |
| Agent协调协议 | 带有交接模板的编排模式 |
Recommended Next Step
推荐后续步骤
After extracting patterns, run to ensure the new patterns are consistent with existing project conventions.
{{command_prefix}}calibrateNEVER:
- Extract patterns from workflows that don't work reliably
- Over-generalize (if it only applies to one case, document it as a solution, not a pattern)
- Skip the "when NOT to use" section
- Extract without testing reusability
提取模式后,运行 以确保新模式与现有项目规范保持一致。
{{command_prefix}}calibrate绝对禁止:
- 从运行不可靠的工作流中提取模式
- 过度泛化(如果仅适用于单个场景,将其记录为解决方案即可,不要归类为模式)
- 省略「不适用场景」部分
- 未测试可复用性就进行提取