ai-ad-prompt-structurer

16 stars

Best use case

ai-ad-prompt-structurer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Teams using ai-ad-prompt-structurer should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/ai-ad-prompt-structurer/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/ai-agents/ai-ad-prompt-structurer/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/ai-ad-prompt-structurer/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How ai-ad-prompt-structurer Compares

Feature / Agentai-ad-prompt-structurerStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

This skill provides specific capabilities for your AI agent. See the About section for full details.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

<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 工具集成
    - **sequential-thinking**: 顺序化思考,分解复杂问题为步骤
    - **context7**: 实时查询最新库文档

    ### 行为模式 (来自 SuperClaude)
    - deep-research: 深度研究模式
    - implementation: 实现模式
    - orchestration: 工具编排模式
    - introspection: 元认知分析模式
  </whats_new>


  <!-- ======================================================
       2. MCP 工具定义
  ====================================================== -->
  <mcp_tools>
    ## Sequential Thinking

    ```
    use mcp__sequential-thinking__sequentialthinking
    ```

    ### 何时使用
    - 分解复杂问题为步骤
    - 规划和设计需要修订
    - 需要多步骤解决方案
    - 需要维护上下文

    ### 参数
    - thought: 当前思考步骤
    - nextThoughtNeeded: 是否需要下一步
    - thoughtNumber: 当前步骤编号 (1-6)
    - totalThoughts: 预估总步骤数
    - isRevision: 是否修订之前的思考
    - needsMoreThoughts: 是否需要更多步骤

    ---

    ## Context7

    ```
    use mcp__context7__resolve-library-id
    use mcp__context7__get-library-docs
    ```

    ### 使用步骤
    1. 调用 resolve-library-id 获取库 ID
    2. 调用 get-library-docs 获取文档

    ### 参数
    - libraryName: 库名称 (如 "fastapi")
    - context7CompatibleLibraryID: 库 ID (如 "/tiangolo/fastapi")
    - topic: 聚焦主题 (可选)
    - mode: "code" (API 参考) 或 "info" (概念指南)
  </mcp_tools>


  <!-- ======================================================
       3. 约束三层模型
  ====================================================== -->
  <constraint_model>
    ## Layer 1: 安全约束 (Security) - 绝对红线

    - ❌ 暴露密钥、凭证、secrets
    - ❌ 提交 .env、credentials.json 到仓库
    - ❌ 编写恶意代码
    - ❌ SQL 注入、XSS、命令注入
    - ❌ 删除用户未指定的文件

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

    ### 极简主义原则
    - 只做被直接要求的更改
    - 三行代码胜过一个抽象
    - 不要"顺便"改进周围代码

    ### 先读后改原则
    - 修改前必须先读取目标文件
    - 查看相邻文件了解项目约定
    - 推断并遵循现有代码风格

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

    按任务类型定义,如:
    - REFACTOR: 保留业务语义,不改 API 合同
    - BUGFIX: 只修复报告的问题
    - FEATURE: 只实现被要求的功能
  </constraint_model>


  <!-- ======================================================
       4. Sequential Thinking 工作流
  ====================================================== -->
  <workflow>
    ## Sequential Thinking 工作流

    ```
    Step 1: 理解任务
    - 分析原始需求
    - 识别关键约束
    - 确定任务类型

    Step 2: 探索上下文 (Explore)
    - 读取目标文件
    - 读取相邻文件
    - 推断项目风格

    Step 3: 制定计划 (Plan)
    - 分解为子任务
    - 确定执行顺序
    - 定义验收标准

    Step 4: 执行变更 (Execute)
    - 按计划逐步执行
    - 每步输出 git diff
    - 遵循 patch 限制

    Step 5: 验证结果 (Verify)
    - 运行测试命令
    - 检查验收标准
    - 失败则回到 Step 4

    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 mcp__sequential-thinking__sequentialthinking
      用于:分解复杂问题、多步推理

      ## Context7
      use mcp__context7__resolve-library-id
      use mcp__context7__get-library-docs
      用于:查询最新库文档
    </mcp_tools>

    <context>
      # 项目上下文

      ## SoT 裁判链
      1. STATE_MACHINE.md v2.8
      2. DATA_SCHEMA.md v5.6
      ...

      ## 项目路径
      - repo_root: ...
      - backend_dir: ...
    </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>
      - [ ] 所有测试通过
      - [ ] API 合同未变更
      - [ ] 每个 patch ≤ 5 文件、≤ 200 行
    </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:
    - ✅ sequential-thinking MCP 工具
    - ✅ context7 MCP 工具
    - ✅ 7 种 Behavioral Modes
    - ✅ Sequential Thinking 6 步工作流
    - ✅ Research Agent (深度研究)

    ### v3.0 (2025-12-18) - 约束驱动重构
    - 约束三层模型: Security → Behavior → Task
    - 先读后改原则
    - 极简主义约束
    - 模块化委托

    ### v2.1 (2025-12-18)
    - 修复 6 个问题

    ### 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>

Related Skills

python-fastapi-scalable-api-cursorrules-prompt-fil-cursorrules

16
from diegosouzapw/awesome-omni-skill

Apply for python-fastapi-scalable-api-cursorrules-prompt-fil. --- description: Applies general coding style and structure rules for Python code in the backend. globs: backend/src/**/*.py

prompting

16
from diegosouzapw/awesome-omni-skill

Meta-prompting system for dynamic prompt generation using templates, standards, and patterns. USE WHEN meta-prompting, template generation, prompt optimization, or programmatic prompt composition.

prompt-optimizer

16
from diegosouzapw/awesome-omni-skill

This skill should be used when users request help optimizing, improving, or refining their prompts or instructions for AI models. Use this skill when users provide vague, unclear, or poorly structured prompts and need assistance transforming them into clear, effective, and well-structured instructions that AI models can better understand and execute. This skill applies comprehensive prompt engineering best practices to enhance prompt quality, clarity, and effectiveness.

prompt-library

16
from diegosouzapw/awesome-omni-skill

Curated collection of high-quality prompts for various use cases. Includes role-based prompts, task-specific templates, and prompt refinement techniques. Use when user needs prompt templates, role-play prompts, or ready-to-use prompt examples for coding, writing, analysis, or creative tasks.

prompt-generation-rules

16
from diegosouzapw/awesome-omni-skill

General rules to generate prompt.

prompt-expander

16
from diegosouzapw/awesome-omni-skill

EXPAND vague prompts into precise, platform-optimized instructions. Detects target platform (Claude, GPT, Gemini, Midjourney, Sora, etc.) and applies appropriate prompting patterns. Use when user says "coggle", "expand", "improve prompt", "make better".

prompt-enhancer

16
from diegosouzapw/awesome-omni-skill

Enhance user prompts by analyzing project context (code structure, dependencies, conventions, existing patterns). Use when users provide brief development requests that would benefit from project-specific context to generate more accurate, contextually-aware prompts.

prompt-engineering-patterns

16
from diegosouzapw/awesome-omni-skill

Master advanced prompt engineering techniques to maximize LLM performance, reliability, and controllability in production. Use when optimizing prompts, improving LLM outputs, or designing production prompt templates.

prompt-architect

16
from diegosouzapw/awesome-omni-skill

Create and enhance prompts, system instructions, and principle files. Capabilities: transform verbose prompts, add patterns/heuristics, optimize token usage, structure CLAUDE.md principles, improve agent/persona definitions, apply prompt engineering techniques (CoT, few-shot, ReAct). Actions: create, enhance, optimize, refactor, compress prompts. Keywords: prompt engineering, system prompt, CLAUDE.md, principle files, instruction optimization, agent prompt, persona prompt, token efficiency, prompt structure, workflow prompts, rules, constraints, few-shot, chain-of-thought, soul, tensions, dialectic. Use when: creating new prompts, enhancing principle files, improving system instructions, optimizing CLAUDE.md, restructuring verbose prompts, adding patterns to workflows, defining agent behaviors.

optimize-prompt

16
from diegosouzapw/awesome-omni-skill

Prompt optimization consultant for AI system prompts and custom instructions. Supports Claude API, OpenAI API, Gemini API, CLAUDE.md, ChatGPT, and n8n. Use when user wants to improve, review, or create prompts, system instructions, or custom instructions for any AI platform.

midjourney-prompt-engineering

16
from diegosouzapw/awesome-omni-skill

Use when generating images with Midjourney, constructing MJ prompts, iterating on MJ output quality, choosing between --sref/--oref/style codes, scoring image results, or building reusable prompt patterns. Also use when exploring MJ style codes, animating images, or debugging why a prompt isn't producing the intended result.

reviewing-agent-prompting

16
from diegosouzapw/awesome-omni-skill

Review and improve prompts for coding agents. Use PROACTIVELY when auditing, checking, or evaluating agent instructions, system prompts, or task delegation text. Applies state-machine thinking to identify structural gaps and improve effectiveness.