Ai ad prompt structurer

From diegosouzapw/awesome-omni-skill · View interactive version

Ai ad prompt structurer is an AI agent skill from the GitHub repository diegosouzapw/awesome-omni-skill. ══════════════════════════════════════════════════════════════════════

How to use this skill

Skill file

<skill>

══════════════════════════════════════════════════════════════════════

AI 提示词结构化器 v4.0 - Prompt Structurer

核心理念:约束优于指令 (Constraints Over Instructions)

MCP 工具:sequential-thinking + context7

══════════════════════════════════════════════════════════════════════

<name>ai-ad-prompt-structurer</name>

<version>4.0</version>

<domain>AI_AD_SYSTEM / 代码工厂 / 提示词工程</domain>

<!-- ======================================================

1. v4.0 核心创新

====================================================== -->

<whats_new version="4.0">

## v4.0 核心创新 (整合 SuperClaude Framework)

| 特性 | v3.0 | v4.0 |

|------|------|------|

| MCP 工具 | 无 | ✅ sequential-thinking + context7 |

| 行为模式 | 无 | ✅ 7 种 Behavioral Modes |

| 深度研究 | 无 | ✅ Deep Research 策略 |

| 工作流 | 静态 | ✅ Sequential Thinking 动态工作流 |

### MCP 工具集成

### 行为模式 (来自 SuperClaude)

</whats_new>

<!-- ======================================================

2. MCP 工具定义

====================================================== -->

<mcp_tools>

## Sequential Thinking

```

use mcpsequential-thinkingsequentialthinking

```

### 何时使用

### 参数


## Context7

```

use mcpcontext7resolve-library-id

use mcpcontext7get-library-docs

```

### 使用步骤

1. 调用 resolve-library-id 获取库 ID

2. 调用 get-library-docs 获取文档

### 参数

</mcp_tools>

<!-- ======================================================

3. 约束三层模型

====================================================== -->

<constraint_model>

## Layer 1: 安全约束 (Security) - 绝对红线

## Layer 2: 行为约束 (Behavior) - 工作方式

### 极简主义原则

### 先读后改原则

## Layer 3: 任务约束 (Task) - 具体边界

按任务类型定义,如:

</constraint_model>

<!-- ======================================================

4. Sequential Thinking 工作流

====================================================== -->

<workflow>

## Sequential Thinking 工作流

```

Step 1: 理解任务

Step 2: 探索上下文 (Explore)

Step 3: 制定计划 (Plan)

Step 4: 执行变更 (Execute)

Step 5: 验证结果 (Verify)

Step 6: 总结输出

```

</workflow>

<!-- ======================================================

5. 子代理定义

====================================================== -->

<sub_agents>

<agent id="EXPLORE">

<name>Explore Agent</name>

<mission>探索代码库,理解上下文</mission>

<constraints>只读不写, 输出包含路径和行号</constraints>

</agent>

<agent id="PLAN">

<name>Plan Agent</name>

<mission>制定执行计划</mission>

<constraints>计划可分步验证, 每步有回滚方案</constraints>

</agent>

<agent id="EXECUTE">

<name>Execute Agent</name>

<mission>按计划执行变更</mission>

<constraints>严格按计划, 每 patch ≤5 文件</constraints>

</agent>

<agent id="VERIFY">

<name>Verify Agent</name>

<mission>验证变更结果</mission>

<constraints>运行验证命令, 失败回到 Execute</constraints>

</agent>

<agent id="RESEARCH">

<name>Research Agent</name>

<mission>深度研究,使用 context7 获取文档</mission>

<constraints>只读不写, 使用 context7</constraints>

</agent>

</sub_agents>

<!-- ======================================================

6. 任务类型 → 行为模式映射

====================================================== -->

<behavioral_modes>

| 任务类型 | 行为模式 | MCP 工具 | 子代理链 |

|----------|----------|----------|----------|

| REFACTOR | implementation | sequential-thinking, context7 | Explore→Plan→Execute→Verify |

| FEATURE | implementation | sequential-thinking, context7 | Explore→Plan→Execute→Verify |

| BUGFIX | implementation | - | Explore→Execute→Verify |

| MIGRATION | orchestration | sequential-thinking | Explore→Plan→Execute→Verify |

| RESEARCH | deep-research | sequential-thinking, context7 | Research |

| REVIEW | introspection | - | Explore→Verify |

</behavioral_modes>

<!-- ======================================================

7. 输出模板

====================================================== -->

<output_template>

```xml

<task>

{任务描述}

原始需求:{用户原始输入}

行为模式:{behavioral_mode}

</task>

<mcp_tools>

# MCP 工具集成

## Sequential Thinking

use mcpsequential-thinkingsequentialthinking

用于:分解复杂问题、多步推理

## Context7

use mcpcontext7resolve-library-id

use mcpcontext7get-library-docs

用于:查询最新库文档

</mcp_tools>

<context>

# 项目上下文

## SoT 裁判链

1. STATE_MACHINE.md v2.8

2. DATA_SCHEMA.md v5.6

...

## 项目路径

</context>

<constraints>

# 约束系统

### 🔴 Layer 1: 安全约束

{安全约束}

### 🟡 Layer 2: 行为约束

{行为约束}

### 🟢 Layer 3: 任务约束

{任务约束}

</constraints>

<workflow>

## Sequential Thinking 工作流

Step 1-6...

</workflow>

<delegation>

执行链:{Agent 链}

...

</delegation>

<execution>

1. 使用 sequential-thinking 进行顺序化思考

2. 按 Agent 链顺序执行

3. 需要查文档时使用 context7

4. Verify 失败则回到 Execute 修复

记住:做得越少,错得越少。

</execution>

<acceptance_criteria>

</acceptance_criteria>

```

</output_template>

<!-- ======================================================

8. 使用示例

====================================================== -->

<examples>

<example>

<input>重构后端代码</input>

<output>

任务类型: refactor

行为模式: implementation

MCP 工具: [sequential-thinking, context7]

子代理链: explore → plan → execute → verify

</output>

</example>

<example>

<input>研究 FastAPI 最佳实践</input>

<output>

任务类型: research

行为模式: deep-research

MCP 工具: [sequential-thinking, context7]

子代理链: research

</output>

</example>

<example>

<input>修复充值状态转换的 bug</input>

<output>

任务类型: bugfix

行为模式: implementation

MCP 工具: []

子代理链: explore → execute → verify

</output>

</example>

</examples>

<!-- ======================================================

9. 版本历史

====================================================== -->

<version_history>

### v4.0 (2025-12-18) - MCP 工具集成

整合 SuperClaude Framework:

### v3.0 (2025-12-18) - 约束驱动重构

### v2.1 (2025-12-18)

### v1.0 (2025-12-18)

</version_history>

<!-- ======================================================

10. 实现代码

====================================================== -->

<implementation>

Python 实现: agents/skills/prompt_structurer.py

核心类: PromptStructurer

主入口: structure_prompt(user_request) -> Dict

使用方式:

```python

from agents.skills.prompt_structurer import structure_prompt

result = structure_prompt("重构后端代码")

print(result["rendered_prompt"])

```

</implementation>

</skill>

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.