提示词模式目录 — 索引
从 500+ 生产级 AI Agent 插件(2,293 个 SKILL.md 文件)、2 个开源技能仓库和 Claude Code 系统提示词架构中提取的 142 个提示词工程模式目录。原始 30 个模式(1-30)包含正面/反面示例。高级 61 个模式(31-91)通过对完整插件集合的深度研究发现。8 个补充模式(92-99)来自针对覆盖不足类别的定向扫描。最后 21 个模式(100-120)提取自 Anthropic 官方技能仓库和 ComposioHQ 的 awesome-claude-skills 仓库。模式 121-142 涵盖 Claude Code 可组合系统提示词的平台级关注点。
数据来源: 提取自对 500+ 生产级 AI Agent 插件的分析,覆盖 DevOps、安全、迁移和事件响应领域。
提取日期: 2026-04-13(原始 30 个),2026-04-14(高级 31-91),2026-04-15(开源 100-120)
如何使用本目录
- 构建新技能? 扫描下方快速参考表,找到与你的场景相关的模式。
- 评审现有技能? 检查它使用了哪些模式,遗漏了哪些。
- 学习提示词工程? 按顺序阅读分类文件 — 从结构到编排到质量,层层递进。
配套文件
| 文件 | 涵盖内容 |
|---|---|
| prompt-engineering-for-skills.md | 理论 — 基于条件熵/注意力分布的 9 个基础技术 |
| template.md | 深度分析 — 一个 BAD vs GOOD 对比,含逐行分析 |
| 本目录(模式 1-30) | 基础模式 — 30 个模式,含正面/反面示例 |
| patterns-advanced-orchestration.md | 高级 — 14 个 Agent 编排与多 Agent 模式(31-44) |
| patterns-advanced-quality.md | 高级 — 11 个质量、评审与评估模式(45-55) |
| patterns-advanced-safety.md | 高级 — 14 个安全、信任与合规模式(56-69) |
| patterns-advanced-workflow.md | 高级 — 11 个工作流、执行与自主性模式(70-80) |
| patterns-advanced-io-domain.md | 高级 — 11 个输入/输出、领域与通信模式(81-91) |
| patterns-gap-fills.md | 补充 — 8 个入职、生产力、迁移与创意模式(92-99) |
| patterns-open-source-skills.md | 开源 — 来自 Anthropic 官方 + 社区技能仓库的 21 个模式(100-120) |
| patterns-karpathy-behavioral.md | 行为 — 5 个 Karpathy 衍生模式:暴露假设、最小可行代码、精准修改、逐步验证、叙述错误路径 |
| patterns-claude-code-platform.md | 平台 — 12 个 Claude Code 平台模式:记忆、权限、调度、工具路由、Agent 调度(121-132) |
| patterns-claude-code-platform-extended.md | 平台扩展 — 10 个模式:组合装配、工具约束、安全监视器、团队协调、梦境记忆(133-142) |
| skill-architecture-patterns.md | 架构 — 技能打包、组合、子 Agent、市场、参考组织 |
| skill-reference-laziness-analysis.md | 深度分析 — 防止 Agent 在 Tier 3 参考读取中偷懒的 8 种策略,含风险分级决策框架 |
| reference-skip-playbook.md | 深度分析 — 参考跳过问题的 11 种解决模式:3 种失败模式(裸跳转、预满足、可选框架)、决策矩阵、反模式 |
快速参考表
| # | 模式 | 分类 | 普及率 | 核心价值 |
|---|---|---|---|---|
| 1 | YAML Frontmatter Metadata | 结构 | ~100% | 平台级身份标识和工具权限 |
| 2 | Phased/Stepped Execution | 结构 | ~54% | 确定性排序,带阶段目标 |
| 3 | Workflow Mode Branching | 结构 | ~5% | 同一技能服务不同受众 |
| 4 | $ARGUMENTS Variable | 结构 | ~7% | 解析带标志和选项的用户输入 |
| 5 | Persona/Role Assignment | 执行 | ~9% | 设定专业水平和推理风格 |
| 6 | Negative Constraints | 执行 | ~18% | 防止已知的特定错误 |
| 7 | Interactive Flow Control | 执行 | ~2% | 每次一个问题,STOP and WAIT |
| 8 | Confirmation Gates | 执行 | ~4% | 高风险操作前需人工审批 |
| 9 | Progress Feedback | 执行 | ~2% | Step N/M 状态 + 退出码 |
| 10 | Prompt Injection Defense | 安全 | <1% | 外部内容视为不可信数据 |
| 11 | Sensitive Data Redaction | 安全 | ~2% | 命名数据类型 + 替换模式 |
| 12 | Read-Only Boundary | 安全 | ~4% | 声明操作范围限制 |
| 13 | Activation Scope | 安全 | ~7% | When to Use / When NOT to Use + 重定向 |
| 14 | Structured Output Templates | 输入/输出 | ~26% | 精确输出格式 + 填充示例 |
| 15 | Error Handling / Degradation | 输入/输出 | ~10% | 阶段特定的失败响应 |
| 16 | Configuration Persistence | 输入/输出 | ~4% | 检查-加载-设置-保存用户配置 |
| 17 | Cross-Platform Handling | 输入/输出 | ~3% | 平台特定的工具和路径 |
| 18 | Multi-Agent Orchestration | 编排 | ~2% | Agent 拓扑 + 共识评分 |
| 19 | Skill Composition | 编排 | ~4% | 委托给已有技能(DRY) |
| 20 | Intent Classification | 编排 | ~6% | 将输入路由到正确的子工作流 |
| 21 | Tool Routing Tables | 编排 | ~16% | 任务→工具映射 + “不用这些” |
| 22 | Deduplication / Consensus | 编排 | ~1% | 加权相似度 + 定义阈值 |
| 23 | Reference File Injection | 知识 | ~17% | 指向外部知识文件 |
| 24 | Domain Knowledge Embedding | 知识 | ~22% | 内联 Schema、字段表、查询模板 |
| 25 | Few-Shot Examples | 知识 | ~21% | 完整的输入/输出对 |
| 26 | Evidence Chain / Proof-of-Work | 知识 | ~5% | 可追溯结论 + 强制清单 |
| 27 | Scoring Rubrics | 质量 | ~4% | 评分维度、分数范围、类别阈值 |
| 28 | Self-Critique | 质量 | ~2% | 对抗性弱点识别 |
| 29 | Feedback Solicitation | 质量 | <1% | 按优先级分层的调查 + 会话去重 |
| 30 | Version Check | 质量 | <1% | 非阻塞更新通知 |
高级模式快速参考表(31-80)
通过对 500+ 插件的深度研究发现,按类别分组。
第 8 类:高级 Agent 编排 (/prompt-context-patterns/catalog/categories/patterns-advanced-orchestration-zh)
| # | 模式 | 核心价值 |
|---|---|---|
| 31 | Adversarial Persona Framing | 攻击者思维发现真正的 Bug,而非表面问题 |
| 32 | Hub-and-Spoke SDLC State Machine | 确定性推进开发生命周期 |
| 33 | M x N Cross-Model Consensus Grid | 跨模型多样性捕捉幻觉 |
| 34 | Dual-Model Adversarial Planning | 独立计划减少单模型偏差 |
| 35 | Cost-Optimized Model Routing | 按任务选择模型,节省 60%+ 成本 |
| 36 | Handoff Context Protocol | Agent 间统一上下文传递 |
| 37 | Context Efficiency Rule | 编排器上下文保持清洁 |
| 38 | Complexity-Tiered Dispatch | 按任务复杂度匹配 Agent 管道 |
| 39 | Persistent Team with Message Board | 状态文件实现跨 Agent 讨论 |
| 40 | Delegation to Cloud Agent | 工作项作为 Agent 分配机制 |
| 41 | Loop Prevention with Max Iterations | 硬性停止防止无限 Agent 循环 |
| 42 | Agent Memory Isolation | 防止跨 Agent 影响和注入 |
| 43 | Sparse Git Worktree for Review | Monorepo 安全的隔离文件访问 |
| 44 | Severity Promotion/Demotion by Area | 将组织风险偏好编入提示词 |
第 9 类:高级质量与评估 (/prompt-context-patterns/catalog/categories/patterns-advanced-quality-zh)
| # | 模式 | 核心价值 |
|---|---|---|
| 45 | Directive-Based Review with on_fail | 每个维度三向分类:Pass/Review/Fail |
| 46 | Multi-Stage Repo Discovery Before Review | 评审校准到仓库惯例 |
| 47 | Evidence-First Review | “展示,而非引用规则” — 可操作的 Bug |
| 48 | Rule-Catalog Review (YAML) | 版本化、可审计、独立可更新的规则 |
| 49 | Blast Radius & Impact Formulas | 量化运维影响评分 |
| 50 | Adversarial Triad + Counterarguments | 两轮评审消除群体思维 |
| 51 | Schema Validation Gate | 机器强制的输出格式合规 |
| 52 | LLM-as-Judge (8 Scenarios) | 完整评估工具箱,含元评判 |
| 53 | Retrospective Quality Rubric | 事后复盘的反模式/模式对 |
| 54 | Test Scaffolding + Convention Enforcement | 完整测试生成 + 反模式表 |
| 55 | Smart Triage-Skip with Model Tracking | 防止重复分诊,支持模型升级 |
第 10 类:高级安全与合规 (/prompt-context-patterns/catalog/categories/patterns-advanced-safety-zh)
| # | 模式 | 核心价值 |
|---|---|---|
| 56 | MCP-Response-as-Data Guardrail | 防止基础设施细节泄露 |
| 57 | Prompt-Injection-as-Security-Finding | 将攻击转化为可操作的评审发现 |
| 58 | Prosecutor-Defender-Judge Architecture | 对抗性审计 + 准确性指标 |
| 59 | Rescue-Tag-Before-Destructive-Operation | 所有破坏性操作自动创建撤销点 |
| 60 | Tiered Permission Model (RED/DEFER/GREEN) | 三级风险分类 + 预检分析 |
| 61 | Data Classification Matrix (4-Level) | 明确的敏感度分类 + 工具特定规则 |
| 62 | XPIA Defense Model | 跨插件注入攻击的四层防御 |
| 63 | Severity Rubric with Litmus Tests | “凌晨 3 点你会叫人起来吗?” — 校准锚点 |
| 64 | Security Posture Delta Analysis | 代码 + 基础设施关联分析真实风险 |
| 65 | Confidence-Gated Reporting | 非对称阈值:安全发现门槛更低 |
| 66 | System-Prompt Non-Disclosure | 禁止泄露 Agent 配置 |
| 67 | 40-Point Skill Security Checklist | 插件市场的供应链防御 |
| 68 | Orchestrator-Only (No Direct Data) | LLM 永不接触原始 PII;由工具处理数据 |
| 69 | Policy-as-Data (Declarative YAML) | 合规规则与 Agent 代码解耦 |
第 11 类:高级工作流与自主性 (/prompt-context-patterns/catalog/categories/patterns-advanced-workflow-zh)
| # | 模式 | 核心价值 |
|---|---|---|
| 70 | State File as Sole Continuity | 桥接隔离的 Agent 上下文窗口 |
| 71 | Zero-Questions Triage | 95 秒内完全自主分析 |
| 72 | Pull-Based Kanban Orchestration | Agent 按亲和力拉取任务,范围蔓延时分叉 |
| 73 | Deployment State Machine (Idempotent) | 崩溃可恢复的无状态部署处理器 |
| 74 | Autonomous PR Feedback Resolution | Agent 实现或驳回评审意见 |
| 75 | 11-Phase Autonomous Dev Flow | 从任务到部署的端到端流程,带防护栏 |
| 76 | Staggered Burst Query + Rate Limits | 跨服务器反并行防止级联故障 |
| 77 | Time-Boxed Investigation | 硬性时间预算 + 部分结果报告 |
| 78 | Deployment Override Knowledge Encoding | 完整 override 分类用于精准查询 |
| 79 | Incident Escalation Decision Matrix | 严重级别和升级的量化阈值 |
| 80 | Scope Estimation Checkpoints | 在 25/50/75% 时重新估算,捕捉范围蔓延 |
第 12 类:高级输入/输出与领域特化 (/prompt-context-patterns/catalog/categories/patterns-advanced-io-domain-zh)
| # | 模式 | 核心价值 |
|---|---|---|
| 81 | NL to Relational Schema Decomposition | 教模型推导 Schema,而非仅嵌入 |
| 82 | Chart Decision Tree + Anti-Pattern Guards | 数据形状到可视化 + 基数防护 |
| 83 | Audience-Purpose Content Calibration | 输出格式/详细度由受众和目的驱动 |
| 84 | Socratic Investigation Loop | 主动研究 + 苏格拉底式提问引导发现 |
| 85 | Knowledge Base Index + Intent Routing | 两级检索:轻量索引 → 选择性深读 |
| 86 | Heuristic Scoring with Signal Detection | 机器可检测信号替代主观标签 |
| 87 | Eager Incremental Materialization | 对话过程中就创建产出物,而非结束后 |
| 88 | Data Shape to Query Pattern Detection | 从数据列 + 查询文本推断可视化 |
| 89 | Writability Rules + Substitution Tables | 完整的风格转换 + 检测启发式 |
| 90 | Cross-Platform Compatibility Matrix | 来源/目标降级路径 + 有限重试 |
| 91 | Hub-Spoke Router with Overlap Resolution | 多级特异性级联用于消歧 |
第 13 类:补充 — 入职、生产力、迁移与创意 (/prompt-context-patterns/catalog/categories/patterns-gap-fills-zh)
| # | 模式 | 核心价值 |
|---|---|---|
| 92 | DAG Journey with Typed Gates | 非线性入职 + 手动门控和回填 |
| 93 | Multi-Source Evidence Harvest + Goal Synthesis | 6+ 源并行采集 + 受众分层输出 |
| 94 | Promise Detection and KB Sync | 从对话中提取隐含承诺 |
| 95 | Mandatory Self-Learning After Failure | 每次错误解决后知识库都会增长 |
| 96 | Risk-Ordered Batch Migration + Build-Verify | 批量迁移 + 相同错误签名回滚 |
| 97 | PII-Motivated Delivery Restriction | 绝对的交付渠道限制,不可覆盖 |
| 98 | Audience-Register Translation Review | 工程师到高管的评审 + 匹配框架 |
| 99 | Automated Accessibility Post-Processing | 无障碍管道 + 25 项断言评估 |
第 14 类:开源技能模式 (/prompt-context-patterns/catalog/categories/patterns-open-source-skills-zh)
第 15-16 类:Claude Code 平台模式 (patterns-claude-code-platform*.md)
分类文件
第 1 类:结构脚手架
技能提示词的组织方式 — 承载一切的骨架。
模式: YAML Frontmatter (1), Phased Execution (2), Workflow Mode Branching (3), $ARGUMENTS Variable (4)
第 2 类:执行控制
如何引导 Agent 行为 — 人设、约束、交互模式和检查点。
模式: Persona/Role Assignment (5), Negative Constraints (6), Interactive Flow Control (7), Confirmation Gates (8), Progress Feedback (9)
第 3 类:安全与信任
防止 Agent 造成伤害的防护栏 — 注入防御、数据脱敏、边界和范围。
模式: Prompt Injection Defense (10), Sensitive Data Redaction (11), Read-Only Boundary (12), Activation Scope (13)
第 4 类:输入/输出契约
数据如何流入流出 — 输出模板、错误处理、配置和平台适配。
模式: Structured Output Templates (14), Error Handling (15), Configuration Persistence (16), Cross-Platform (17)
第 5 类:Agent 编排
多个 Agent 如何协调 — 拓扑、技能组合、路由、工具映射和共识。
模式: Multi-Agent Orchestration (18), Skill Composition (19), Intent Classification (20), Tool Routing Tables (21), Dedup/Consensus (22)
第 6 类:知识与上下文
信息如何管理 — 参考文件、领域知识、示例和证据要求。
模式: Reference File Injection (23), Domain Knowledge Embedding (24), Few-Shot Examples (25), Evidence Chain (26)
第 7 类:质量与反馈
如何确保输出质量 — 评分标准、自我批评、反馈循环和版本管理。
模式: Scoring Rubrics (27), Self-Critique (28), Feedback Solicitation (29), Version Check (30)
第 8 类:高级 Agent 编排
生产级多 Agent 架构 — 状态机、共识网格、对抗性规划、成本优化路由、记忆隔离。
模式: Adversarial Persona (31), Hub-and-Spoke State Machine (32), Cross-Model Consensus (33), Adversarial Planning (34), Model Routing (35), Handoff Context (36), Context Efficiency (37), Complexity Tiers (38), Message Board (39), Cloud Delegation (40), Loop Prevention (41), Memory Isolation (42), Sparse Worktree (43), Severity Promotion (44)
第 9 类:高级质量与评估
深度评审架构 — 指令式评审、证据优先分析、对抗性三人组、LLM-as-judge、测试脚手架。
模式: Directive Review (45), Repo Discovery (46), Evidence-First (47), Rule Catalog (48), Impact Formulas (49), Adversarial Triad (50), Schema Gate (51), LLM-as-Judge (52), Retro Rubric (53), Test Scaffolding (54), Triage Skip (55)
第 10 类:高级安全与合规
生产级安全 — MCP 数据防护栏、XPIA 防御、控诉-辩护-裁判、数据分类、策略即数据。
模式: MCP-Data Guardrail (56), Injection-as-Finding (57), Prosecutor-Defender-Judge (58), Rescue Tags (59), Tiered Permissions (60), Data Classification (61), XPIA Defense (62), Litmus Tests (63), Posture Delta (64), Confidence Gates (65), Non-Disclosure (66), Skill Security Checklist (67), Orchestrator-Only (68), Policy-as-Data (69)
第 11 类:高级工作流与自主性
规模化执行控制 — 状态文件、零提问分诊、看板编排、自主开发、事件响应。
模式: State File Continuity (70), Zero-Questions (71), Kanban Pull (72), Deployment State Machine (73), PR Feedback Resolution (74), Autonomous Dev Flow (75), Burst Query (76), Time-Boxed Investigation (77), Override Knowledge (78), Escalation Matrix (79), Scope Checkpoints (80)
第 12 类:高级输入/输出与领域特化
输入/输出转换、领域推理脚手架、可视化指令、交互式推理、风格转换和受众适配。
模式: Schema Decomposition (81), Chart Decision Tree (82), Audience Calibration (83), Socratic Loop (84), KB Index Routing (85), Heuristic Scoring (86), Eager Materialization (87), Data Shape Detection (88), Writability Rules (89), Compatibility Matrix (90), Overlap Resolution Router (91)
第 13 类:补充 — 入职、生产力、迁移与创意
来自覆盖不足领域的模式:基于 DAG 的入职旅程、个人生产力、自学习迁移和创意输出无障碍。
模式: DAG Journey (92), Evidence Harvest (93), Promise Detection (94), Self-Learning (95), Batch Migration (96), Delivery Restriction (97), Register Translation Review (98), A11y Post-Processing (99)
第 14 类:开源技能模式
提取自 Anthropic 官方 Agent Skills 仓库(17 个技能)和 ComposioHQ 社区精选 awesome-claude-skills 仓库(32 个独立 + 832 个 Composio 模板技能)。涵盖渐进式披露、创意脚手架、视觉 QA、评估驱动改进、SaaS 集成模板和多语言 SDK 路由。
模式: Progressive Disclosure (100), Creative Philosophy (101), Refinement Pass (102), Reconnaissance-Then-Action (103), Helper Script Black Box (104), Anti-Slop (105), Collaborative Drafting (106), Reader Testing (107), Blind A/B (108), SaaS Integration (109), Algorithm-as-Knowledge (110), Clarifying Questions (111), Populated Examples (112), Input-Type Routing (113), Asset Bundling (114), Visual QA (115), Never-Hardcode (116), Language Routing (117), Architecture Selection (118), Eval-Driven Loop (119), Provider Guard (120)
架构配套文件: skill-architecture-patterns.md — 技能打包、市场分组、参考文件组织、子 Agent 设计、脚本集成和跨仓库对比。
第 15 类:Claude Code 平台模式
提取自 Claude Code 系统提示词的模式 — 平台级关注点:记忆分类、权限模型、调度、工具路由、Agent 调度和上下文存活。
模式: Typed Memory Taxonomy (121), Bidirectional Feedback Capture (122), Reversibility x Blast-Radius (123), Tool Preference with Hard Routing (124), Cache-Aware Scheduling (125), Agent Briefing Protocol (126), Parallel-Safe Step Identification (127), Context Compaction Survival (128), Non-Sticky Authorization (129), Investigate Before Destroying (130), Output Visibility Awareness (131), Hook-Driven Automation (132)
第 16 类:Claude Code 平台模式 — 扩展
来自 Claude Code 可组合提示词系统的更深层架构模式:Agent 派生、安全分类、团队协调和记忆整合。
模式: Compositional Prompt Assembly (133), Tool-Constraint Agent Boundaries (134), Fork vs Fresh Spawning (135), Security Monitor Agent (136), Analysis-First Compaction (137), Team Task Board Coordination (138), Background Job Narration (139), Autonomous Trust Calibration (140), REPL as Tool Composition Layer (141), Immutable Memory with Dream Consolidation (142)
与基础技术的映射关系
30 个模式如何对应 prompt-engineering-for-skills.md 中的 9 个基础技术:
| 基础技术 | 应用该技术的模式 |
|---|---|
| 决策树 | Workflow Mode Branching (3), Intent Classification (20), Error Handling (15), Input-Type Routing (113), Language Routing (117), Architecture Selection (118) |
| 锚定 | Domain Knowledge Embedding (24), Few-Shot Examples (25), Structured Output Templates (14), Populated Examples (112), Algorithm-as-Knowledge (110), Reconnaissance-Then-Action (103) |
| 认知卸载 | Phased Execution (2), Evidence Chain (26), Scoring Rubrics (27), Helper Script Black Box (104), Collaborative Drafting (106), Eval-Driven Loop (119) |
| 注意力局部性 | Negative Constraints (6), Reference File Injection (23), Tool Routing Tables (21), Progressive Disclosure (100) |
| 指令-动作绑定 | Confirmation Gates (8), Interactive Flow Control (7), Progress Feedback (9), Clarifying Questions (111) |
| Schema 预设 | YAML Frontmatter (1), Structured Output Templates (14), Scoring Rubrics (27), Populated Examples (112) |
| 负空间 | Negative Constraints (6), Activation Scope (13), Read-Only Boundary (12), Anti-Slop (105), Provider Guard (120), Never-Hardcode (116) |
| XML 语义边界 | Structured Output Templates (14), Few-Shot Examples (25), Domain Knowledge (24), Creative Philosophy (101) |
| 带推理的示例 | Few-Shot Examples (25), Evidence Chain (26), Self-Critique (28), Blind A/B (108), Refinement Pass (102) |
数据来源
提取自对 500+ 生产级 AI Agent 插件的分析,覆盖 DevOps、安全、迁移和事件响应领域,以及 Anthropic 官方 Agent Skills 仓库(17 个技能)和 ComposioHQ 社区精选 awesome-claude-skills 仓库(32 个独立 + 832 个 Composio 模板技能)。