Communitygithub.com

自动状态化提示词优化器

自动拦截并优化提示词,使用提示学习MCP服务器。通过嵌入索引历史从性能中学习。支持APE、OPRO、DSPy模式。

自动状态化提示词优化器 是什么?

该技能是一个基于MCP服务器的自动状态化提示词优化器,旨在通过智能拦截和优化用户输入,显著提升AI Agent(如Claude Code、Cursor等)的响应质量和任务完成效率。其核心功能包括:根据任务复杂度、Token预算和上下文自动选择最优优化策略(APE、OPRO、DSPy),并通过嵌入索引历史记录实现跨会话的性能学习。它特别适用于复杂推理、多步骤任务、模板生成和系统提示优化,能有效解决“提示词模糊”这一常见痛点;同时,它内置了质量门控和故障模式处理机制(如过度优化、模板迷恋、历史过拟合),确保优化过程可控高效。该技能要求运行提示学习MCP服务器,并明确区分了“使用边界”(如简单问答、直接命令、对话回应等不应使用),是高级开发者和AI Agent用户提升交互效率的强大工具。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/curiositech/windags-skills/tree/HEAD/skills/automatic-stateful-prompt-improver

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

自动状态化提示词优化器 是做什么的?

决策点

提示词评估:
├── 简单问题/命令(是什么、何时、如何)
│   └── 跳过优化 → 直接回答
├── 复杂任务(多步骤、推理、技术性)
│   ├── Token预算 < 1000
│   │   └── APE:3-5次迭代
│   ├── Token预算 1000-5000
│   │   └── OPRO:5-10次迭代
│   └── Token预算 > 5000
│       └── DSPy编译:10-20次迭代
└── 可复用的模板/系统提示
    └── 结合历史检索的完整优化

优化技术选择:
├── 需要指令重写
│   └── 使用APE(自动提示词工程师)
├── 带约束的参数调优
│   └── 使用OPRO(通过提示进行优化)
├── 包含多个模块的复杂流水线
│   └── 使用DSPy编译模式
└── 未知/探索性领域
    └── 混合 APE→OPRO→DSPy 级联

迭代控制:
├── 连续3轮改进 < 1% → 停止
├── 质量评分 > 0.95 → 停止
├── 达到最大迭代次数 → 停止
├── 用户确认满意 → 停止
└── 否则 → 继续下一轮迭代

反馈整合:
├── 任务成功(用户确认/指标良好)
│   └── 记录正面反馈 + 为检索嵌入
├── 任务失败/质量差
│   └── 记录负面反馈 + 分析失败模式
└── 结果不明
    └── 记录前要求用户明确反馈

故障模式

过度优化螺旋

  • 症状:提示词增长到500多个Token,且包含许多嵌套约束
  • 诊断:追逐递减的收益,而不是在“足够好”时停止
  • 修复:应用80/20法则——如果每次迭代的改进低于5%,则停止

模板迷恋

  • 症状:把迭代花在格式化/结构上,而不是任务清晰度上
  • 诊断:混淆了呈现效果与性能
  • 修复:衡量实际的任务成功率,而不是模板的符合度

历史过拟合

  • 症状:优化后的提示词对过去的例子有效,但对新的输入失败
  • 诊断:在检索到的过于狭窄的数据集上进行训练
  • 修复:在优化中包含多样化的例子,并在保留的案例上进行测试

能力误判

  • 症状:为模型本身就能处理的任务添加大量脚手架
  • 诊断:未经验证就假设模型有局限性
  • 修复:在大量提示词之前测试模型的基础能力

衡量盲区

  • 症状:多次迭代而没有明确的成功指标
  • 诊断:在不知道“更好”意味着什么的情况下进行优化
  • 修复:第一步就定义可衡量的成功标准

工作示例

示例1:代码优化请求

原始:“让这段代码更好”

def process_data(data):
    results = []
    for item in data:
        if item > 0:
            results.append(item * 2)
    return results

决策点导航:

  1. 评估:复杂任务(需要代码分析)→ 触发优化
  2. 技术选择:代码审查 + 改进 → APE,5次迭代
  3. 检索到的上下文:历史中类似的代码优化提示词
  4. 优化后的提示词:“分析这个Python函数的性能、可读性和Python风格。识别具体的改进点:算法复杂度、内存使用、边界情况和代码风格。提供重构后的代码并附上解释。”

新手会错过什么:模糊的“变得更好”没有指定标准 专家会捕捉到什么:需要明确的维度(性能、风格、边界情况)

结果:清晰地分析了列表推导式的可能性、边界情况处理和类型提示

示例2:推理任务模板

原始:“帮我思考这个决定”

决策点导航:

  1. 评估:可复用模板 + 推理任务 → 完整优化
  2. 历史检索:找到决策框架提示词(相似度0.87)
  3. 技术选择:DSPy编译(结构化推理流水线)
  4. 迭代策略:10轮,衡量决策质量

优化后模板:

决策分析框架:
1. 情境:清晰陈述决策及其约束
2. 利益相关者:列出受影响方及其利益
3. 选项:生成3-5个不同的替代方案
4. 标准:定义成功指标及其权重
5. 权衡:根据标准分析每个选项
6. 推荐:选择最佳方案并附上置信水平

应用的质量门控:模板完整性、可复用性评分、用户满意度

示例3:模糊的技术请求

原始:“设置监控”

决策点导航:

  1. 评估:未明确 + 技术性 → 触发优化
  2. 澄清策略:OPRO 带约束引导
  3. 领域上下文:检索监控设置模式

优化后提示词: “设计监控设置,明确:(1) 基础设施范围(服务器、容器、应用程序),(2) 关键指标(性能、可用性、业务),(3) 告警阈值和升级策略,(4) 技术栈约束,(5) 预算/复杂度限制。提供带有优先级的实施路线图。”

前后权衡:

  • 之前:无休止的来回澄清
  • 之后:一次交互即完成结构化需求收集
  • 成本:初始提示词更长
  • 收益:一次交互完成完整规格

质量门控

调用 optimize_prompt 前的执行检查清单:

  • 任务复杂度评分 > 3(需要多步骤/推理)
  • 定义了明确的成功标准或可以推导出
  • Token预算已估算且技术已选定
  • 已识别用于检索的领域上下文
  • 基于复杂度设定了迭代限制

优化后验证:

  • 优化后的提示词具体且可执行
  • 成功指标可衡量
  • 约束一致性已验证(无矛盾)
  • Token效率:改进证明增加的篇幅合理
  • 历史上下文已适当整合
  • 重大变更已获得用户确认

质量评分标准(0-100分):

  • 清晰度:新手能理解要求吗?(25分)
  • 具体性:具体的 vs. 抽象的指令?(25分)
  • 完整性:涵盖边界情况和约束吗?(25分)
  • 效率:在无冗长的情况下实现目标吗?(25分)

边界规则

不要将此技能用于:

  • 简单的事实性问题 → 直接用知识回答
  • 无需推理的文件操作 → 使用文件管理技能
  • 直接命令执行 → 立即执行
  • 对话式回复 → 自然回应
  • 已经优化过的提示词 → 首先检查历史以避免重新优化
  • 用户明确说“不要优化” → 尊重用户偏好

代为委派:

  • 数学问题 → 使用计算相关技能
  • 创意写作 → 使用创意写作技能(除非是创建模板)
  • 数据分析 → 使用数据分析技能(除非需要复杂推理)
  • 调试 → 使用调试技能(除非需要进行系统性改进)

灰色地带需要判断:

  • 中等复杂度的任务(评分2-4) → 首先测试基线性能
  • 领域专业知识请求 → 仅在可能形成可复用模板时优化
  • 后续跟进问题 → 如果范围显著扩大则优化

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

curiositech/windags-skills

Expert in 2000s-era music visualization (Milkdrop, AVS, Geiss) and modern WebGL implementations. Specializes in Butterchurn integration, Web Audio API AnalyserNode FFT data, GLSL shaders for audio-reactive visuals, and psychedelic generative art. Activate on "Milkdrop", "music visualization", "WebGL visualizer", "Butterchurn", "audio reactive", "FFT visualization", "spectrum analyzer". NOT for simple bar charts/waveforms (use basic canvas), video editing, or non-audio visuals.

curiositech/windags-skills

Expert legal research agent for finding and scraping expungement data state by state. Knows authoritative sources, URL patterns, Firecrawl configuration, and 2026 legal landscape.

curiositech/windags-skills

Expert in 3D computer vision labeling tools, workflows, and AI-assisted annotation for LiDAR, point clouds, and sensor fusion. Covers SAM4D/Point-SAM, human-in-the-loop architectures, and vertical-specific training strategies. Activate on '3D labeling', 'point cloud annotation', 'LiDAR labeling', 'SAM 3D', 'SAM4D', 'sensor fusion annotation', '3D bounding box', 'semantic segmentation point cloud'. NOT for 2D image labeling (use clip-aware-embeddings), general ML training (use ml-engineer), video annotation without 3D (use computer-vision-pipeline), or VLM prompt engineering (use prompt-engineer).

curiositech/windags-skills

Implement WCAG 2.2 AA/AAA compliance with automated testing, keyboard navigation, screen reader support, and focus management. Activate on: accessibility audit, WCAG compliance, keyboard navigation, screen reader, aria attributes, axe-core, focus trap. NOT for: design-level accessibility review (use design-accessibility-auditor), color contrast only (use css-in-js-architect).

curiositech/windags-skills

Time-blind friendly planning, executive function support, and daily structure for ADHD brains. Specializes in realistic time estimation, dopamine-aware task design, and building systems that actually work for neurodivergent minds.

curiositech/windags-skills

Designs digital experiences for ADHD brains using neuroscience research and UX principles. Expert in reducing cognitive load, time blindness solutions, dopamine-driven engagement, and compassionate design patterns. Activate on 'ADHD design', 'cognitive load', 'accessibility', 'neurodivergent UX', 'time blindness', 'dopamine-driven', 'executive function'. NOT for general accessibility (WCAG only), neurotypical UX design, or simple UI styling without ADHD context.

curiositech/windags-skills

>- Apply crisis decision-making research to agent routing, uncertainty triage, and coordination failure analysis in time-pressured systems. Use when diagnosing handoff failures, analytical paralysis, or expert judgment under incomplete information. NOT for routine coding, simple CRUD design, or static single-agent tasks with complete information.

curiositech/windags-skills

Extend and modify the admin dashboard, developer portal, and operations console. Use when adding new admin tabs, metrics, monitoring features, or internal tools. Activates for dashboard development, analytics, user management, and internal tooling.

curiositech/windags-skills

Conversation patterns and interaction protocols for multi-agent systems. Covers request/response, pub/sub, blackboard, delegation chains, debate, critique, consensus, fan-out/fan-in, supervisor-worker, and peer negotiation. Deep analysis of AutoGen conversation patterns, CrewAI delegation, LangGraph state passing, and FIPA-ACL performatives. Teaches how to design what agents say to each other and in what order. Activate on: "agent conversation", "agent protocol", "multi-agent debate", "agent delegation", "supervisor worker pattern", "agent voting", "consensus protocol", "fan-out fan-in", "agent negotiation", "blackboard pattern", "agent dialogue", "conversation topology", "agent handoff". NOT for: wire format or serialization (use agent-interchange-formats), orchestration infrastructure (use agentic-infrastructure-2026), single agent behavior (use agentic-patterns).

curiositech/windags-skills

Meta-agent for creating new custom agents, skills, and MCP integrations. Expert in agent design, MCP development, skill architecture, and rapid prototyping. Activate on 'create agent', 'new skill', 'MCP server', 'custom tool', 'agent design'. NOT for using existing agents (invoke them directly), general coding (use language-specific skills), or infrastructure setup (use deployment-engineer).

curiositech/windags-skills

AI-powered calendar management and agent-based scheduling coordination. Covers calendar APIs (Google Calendar, CalDAV/iCal), AI scheduling assistants (Reclaim, Clockwise, Motion, Cal.com), building custom calendar agents with MCP, multi-calendar merging, timezone management, focus block protection, meeting fatigue detection, and agent-to-agent meeting negotiation protocols. Activate on: "calendar agent", "AI scheduling", "calendar coordination", "meeting scheduling", "calendar API", "focus time protection", "calendar optimization", "Google Calendar MCP", "Reclaim", "Clockwise", "Motion", "Cal.com", "smart scheduling", "calendar-aware agent", "timezone scheduling", "agent negotiation meetings". NOT for: manual calendar UI component design (use form-validation-architect), project management scheduling or Gantt charts (use project-management-guru-adhd), general time-tracking or pomodoro apps (use adhd-daily-planner for time-awareness), building the agent itself from scratch (use agent-creator).

curiositech/windags-skills

Build and adopt production AI agent infrastructure in 2026. Covers framework selection (LangGraph, CrewAI, AutoGen, MCP), orchestration patterns, evaluation, observability, memory systems, and tool use. Also covers the SOCIAL dimension: how to sell agent infrastructure internally, change management, measuring ROI, building trust in autonomous systems, and scaling adoption across teams. Activate on: "agent infrastructure", "agent framework comparison", "which agent framework", "sell AI tools internally", "agent adoption", "agent observability", "agent evaluation", "MCP architecture", "agentic mesh", "enterprise AI agents", "AI change management", "agent ROI". NOT for: building specific agents (use ai-engineer), designing agent behavior patterns (use agentic-patterns), prompt tuning (use prompt-engineer).

curiositech/windags-skills

Fundamental patterns for effective agentic behavior. Teaches decomposition, tool orchestration, error recovery, context management, quality self-assessment, and knowing when to stop. Model-agnostic principles that make any agent more effective regardless of domain. Activate on: "how should I structure this agent", "agentic workflow", "agent patterns", "multi-step task", "tool orchestration", "/agentic-patterns", "decompose this", "agent best practices", "chain of actions", "when should the agent stop", "agent loop design". NOT for: creating agent infrastructure (use agent-creator), building DAGs (use windags-architect), specific tool implementation.

curiositech/windags-skills

Automated discovery and matching of agent skills for dynamic task routing and capability assessment

curiositech/windags-skills

Cryptographic security for agentic systems — zero-trust agent networking, signed message envelopes (JWS/JWE), capability-based security (ocaps), Merkle tree audit trails, WASM sandboxing, and formal verification. Covers CLI dev tool security, mTLS between agents, permission boundaries (least privilege for AI agents), and supply chain security for skills/plugins. Activate on: "agent security", "zero trust agents", "secure agent communication", "capability-based security", "ocap", "signed messages between agents", "agent audit trail", "sandbox agent execution", "agent permissions", "mTLS agents", "cryptographic verification", "agent supply chain", "OWASP agentic", "prove agent did X", "tamper-proof agent logs". NOT for: application-level SAST scanning (use security-auditor), network firewall rules (use infrastructure), SOC2/HIPAA compliance (organizational), or prompt injection defense (use prompt-engineer).

curiositech/windags-skills

Data structures and serialization formats for agent-to-agent communication. Covers message envelopes, structured output schemas, capability declarations, task handoff payloads, error/retry signaling, and context windows as data structures. Deep comparison of A2A protocol, MCP, OpenAI function calling, and LangChain message types. Teaches when to use rigid schemas vs free-form with validation, typed vs untyped, streaming vs batch. Activate on: "agent message format", "agent communication schema", "agent-to-agent protocol", "A2A protocol", "MCP message format", "structured output for agents", "agent interop", "interchange format", "agent serialization", "task handoff format", "capability declaration". NOT for: what agents say to each other (use agent-conversation-protocols), orchestration topology (use multi-agent-coordination), building agent infrastructure (use agentic-infrastructure-2026).

curiositech/windags-skills

Logic-based agent programming language implementing BDI architecture for practical autonomous agent development

curiositech/windags-skills

>- Design AgentSpeak(L)-style BDI agents with context-guarded plans, selection functions, and intention stacks. Use for interruptible autonomy, agent policy, and multi-agent orchestration in dynamic environments. NOT for simple rule engines, static planners, or centralized workflows.

curiositech/windags-skills

Foundational concurrent computation model where actors communicate exclusively through asynchronous message passing

curiositech/windags-skills

license: Apache-2.0 NOT for unrelated tasks outside this domain.

相关技能