Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计通过

ai-prompt-engineeringAI 提示工程

Agent Skill

用于辅助提示词、系统指令、Agent 行为约束和工作流模板的整理。它适合让 Agent 规范任务边界、统一输出格式、拆分操作步骤或优化提示词可复用性。使用时需要保留真实业务约束,不要把示例当硬规则;涉及自动执行、外部工具或高风险操作时,应在提示词中明确确认步骤、权限边界和失败处理方式。

总安装

2,875

周安装

121

GitHub Stars

59

下载量

1,007
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ai-prompt-engineering(AI 提示工程)
来源仓库:https://github.com/vasilyu1983/ai-agents-public
仓库路径:skills/ai-prompt-engineering
安装命令:
npx skills add https://github.com/vasilyu1983/ai-agents-public --skill ai-prompt-engineering
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/vasilyu1983/ai-agents-public --skill ai-prompt-engineering

简介

提示工程操作手册提供生产级 prompt 开发最佳实践,涵盖安全威胁建模与回归测试方法。

  • 适用于构建结构化输出、隐藏推理链或多步规划等复杂交互模式的可靠提示词模板。
  • 强调版本控制与输出契约定义,确保不同会话间的一致性与可复现性。
  • 使用前应参照 OWASP LLM Top 10 进行安全评估,防范提示注入与数据泄露风险。
  • 建议建立 prompt 评审 checklist,定期审计历史用例的有效性并及时淘汰过时方案。

SKILL.md

Prompt Engineering — Operational Skill

Modern Best Practices (January 2026): versioned prompts, explicit output contracts, regression tests, and safety threat modeling for tool/RAG prompts (OWASP LLM Top 10: https://owasp.org/www-project-top-10-for-large-language-model-applications/).

This skill provides operational guidance for building production-ready prompts across standard tasks, RAG workflows, agent orchestration, structured outputs, hidden reasoning, and multi-step planning.

All content is operational, not theoretical. Focus on patterns, checklists, and copy-paste templates.

Quick Start (60 seconds)

  1. Pick a pattern from the decision tree (structured output, extractor, RAG, tools/agent, rewrite, classification).
  2. Start from a template in assets/ and fill in TASK, INPUT, RULES, and OUTPUT FORMAT.
  3. Add guardrails: instruction/data separation, “no invented details”, missing → null/explicit missing.
  4. Add validation: JSON parse check, schema check, citations check, post-tool checks.
  5. Add evals: 10–20 cases while iterating, 50–200 before release, plus adversarial injection cases.

Model Notes (2026)

This skill includes Claude Code + Codex CLI optimizations:

  • Action directives: Frame for implementation, not suggestions
  • Parallel tool execution: Independent tool calls can run simultaneously
  • Long-horizon task management: State tracking, incremental progress, context compaction resilience
  • Positive framing: Describe desired behavior rather than prohibitions
  • Style matching: Prompt formatting influences output style
  • Domain-specific patterns: Specialized guidance for frontend, research, and agentic coding
  • Style-adversarial resilience: Stress-test refusals with poetic/role-play rewrites; normalize or decline stylized harmful asks before tool use

Prefer “brief justification” over requesting chain-of-thought. When using private reasoning patterns, instruct: think internally; output only the final answer.

Quick Reference

TaskPattern to UseKey ComponentsWhen to Use
Machine-parseable outputStructured OutputJSON schema, "JSON-only" directive, no proseAPI integrations, data extraction
Field extractionDeterministic ExtractorExact schema, missing->null, no transformationsForm data, invoice parsing
Use retrieved contextRAG WorkflowContext relevance check, chunk citations, explicit missing infoKnowledge bases, documentation search
Internal reasoningHidden Chain-of-ThoughtInternal reasoning, final answer onlyClassification, complex decisions
Tool-using agentTool/Agent PlannerPlan-then-act, one tool per turnMulti-step workflows, API calls
Text transformationRewrite + ConstrainStyle rules, meaning preservation, format specContent adaptation, summarization
ClassificationDecision TreeOrdered branches, mutually exclusive, JSON resultRouting, categorization, triage

Decision Tree: Choosing the Right Pattern

User needs: [Prompt Type]
  |-- Output must be machine-readable?
  |     |-- Extract specific fields only? -> **Deterministic Extractor Pattern**
  |     `-- Generate structured data? -> **Structured Output Pattern (JSON)**
  |
  |-- Use external knowledge?
  |     `-- Retrieved context must be cited? -> **RAG Workflow Pattern**
  |
  |-- Requires reasoning but hide process?
  |     `-- Classification or decision task? -> **Hidden Chain-of-Thought Pattern**
  |
  |-- Needs to call external tools/APIs?
  |     `-- Multi-step workflow? -> **Tool/Agent Planner Pattern**
  |
  |-- Transform existing text?
  |     `-- Style/format constraints? -> **Rewrite + Constrain Pattern**
  |
  `-- Classify or route to categories?
        `-- Mutually exclusive rules? -> **Decision Tree Pattern**

Copy/Paste: Minimal Prompt Skeletons

1) Generic "output contract" skeleton

TASK:
{{one_sentence_task}}

INPUT:
{{input_data}}

RULES:
- Follow TASK exactly.
- Use only INPUT (and tool outputs if tools are allowed).
- No invented details. Missing required info -> say what is missing.
- Keep reasoning hidden.
- Follow OUTPUT FORMAT exactly.

OUTPUT FORMAT:
{{schema_or_format_spec}}

2) Tool/agent skeleton (deterministic)

AVAILABLE TOOLS:
{{tool_signatures_or_names}}

WORKFLOW:
- Make a short plan.
- Call tools only when required to complete the task.
- Validate tool outputs before using them.
- If the environment supports parallel tool calls, run independent calls in parallel.

3) RAG skeleton (grounded)

RETRIEVED CONTEXT:
{{chunks_with_ids}}

RULES:
- Use only retrieved context for factual claims.
- Cite chunk ids for each claim.
- If evidence is missing, say what is missing.

Operational Checklists

Use these references when validating or debugging prompts:

  • frameworks/shared-skills/skills/ai-prompt-engineering/references/quality-checklists.md
  • frameworks/shared-skills/skills/ai-prompt-engineering/references/production-guidelines.md

Context Engineering (2026)

True expertise in prompting extends beyond writing instructions to shaping the entire context in which the model operates. Context engineering encompasses:

  • Conversation history: What prior turns inform the current response
  • Retrieved context (RAG): External knowledge injected into the prompt
  • Structured inputs: JSON schemas, system/user message separation
  • Tool outputs: Results from previous tool calls that shape next steps

Context Engineering vs Prompt Engineering

AspectPrompt EngineeringContext Engineering
FocusInstruction textFull input pipeline
ScopeSingle promptRAG + history + tools
OptimizationWord choice, structureInformation architecture
GoalClear instructionsOptimal context window

Key Context Engineering Patterns

1. Context Prioritization: Place most relevant information first; models attend more strongly to early context.

2. Context Compression: Summarize history, truncate tool outputs, select most relevant RAG chunks.

3. Context Separation: Use clear delimiters (<system>, <user>, <context>) to separate instruction types.

4. Dynamic Context: Adjust context based on task complexity - simple tasks need less context, complex tasks need more.


Core Concepts vs Implementation Practices

Core Concepts (Vendor-Agnostic)

  • Prompt contract: inputs, allowed tools, output schema, max tokens, and refusal rules.
  • Context engineering: conversation history, RAG context, tool outputs, and structured inputs shape model behavior.
  • Determinism controls: temperature/top_p, constrained decoding/structured outputs, and strict formatting.
  • Cost & latency budgets: prompt length and max output drive tokens and tail latency; enforce hard limits and measure p95/p99.
  • Evaluation: golden sets + regression gates + A/B + post-deploy monitoring.
  • Security: prompt injection, data exfiltration, and tool misuse are primary threats (OWASP LLM Top 10: https://owasp.org/www-project-top-10-for-large-language-model-applications/).

Implementation Practices (Model/Platform-Specific)

Do / Avoid

Do

  • Do keep prompts small and modular; centralize shared fragments (policies, schemas, style).
  • Do add a prompt eval harness and block merges on regressions.
  • Do prefer "brief justification" over requesting chain-of-thought; treat hidden reasoning as model-internal.

Avoid

  • Avoid prompt sprawl (many near-duplicates with no owner or tests).
  • Avoid brittle multi-step chains without intermediate validation.
  • Avoid mixing policy and product copy in the same prompt (harder to audit and update).

Navigation: Core Patterns

- Structured Output (JSON), Deterministic Extractor, RAG Workflow - Hidden Chain-of-Thought, Tool/Agent Planner, Rewrite + Constrain, Decision Tree - Each pattern includes structure template and validation checklist

Navigation: Best Practices

- System instruction design, output contract specification, action directives - Context handling, error recovery, positive framing, style matching, style-adversarial red teaming - Anti-patterns, Claude 4+ specific optimizations

- Evaluation & testing (Prompt CI/CD), model parameters, few-shot selection - Safety & guardrails, conversation memory, context compaction resilience - Answer engineering, decomposition, multilingual/multimodal, benchmarking - CI/CD Tools (2026): Promptfoo, DeepEval integration patterns - Security (2026): PromptGuard 4-layer defense, Microsoft Prompt Shields, taint tracking

- Prompt QA, JSON validation, agent workflow checks - RAG workflow, safety & security, performance optimization - Testing coverage, anti-patterns, quality score rubric

- Frontend/visual code: Creativity encouragement, design variations, micro-interactions - Research tasks: Success criteria, verification, hypothesis tracking - Agentic coding: No speculation rule, principled implementation, investigation patterns - Cross-domain best practices and quality modifiers

Navigation: Specialized Patterns

- Context grounding, chunk citation, missing information handling

- Plan-then-act workflows, tool calling, multi-step reasoning, generate-verify-revise chains - Multi-Agent Orchestration (2026): centralized, handoff, federated patterns; plan-and-execute (90% cost reduction)

- Schema-based extraction, null handling, no hallucinations

- Hidden reasoning, final answer only, classification workflows - Extended Thinking API (Claude 4+): budget management, think tool, multishot patterns

- Advanced patterns, edge cases, optimization strategies

- Promptfoo, DeepEval integration, regression detection, A/B testing, quality gates

- Image description, OCR+LLM, bounding box prompts, Whisper conditioning, video frame analysis

- Injection detection (PromptGuard, Prompt Shields), defense-in-depth, taint tracking, red team testing


Navigation: Templates

Templates are copy-paste ready and organized by complexity:

Quick Templates

Standard Templates


External Resources

External references are listed in data/sources.json:

  • Official documentation (OpenAI, Anthropic, Google)
  • LLM frameworks (LangChain, LlamaIndex)
  • Vector databases (Pinecone, Weaviate, FAISS)
  • Evaluation tools (OpenAI Evals, HELM)
  • Safety guides and standards
  • RAG and retrieval resources

Freshness Rule (2026)

When asked for “latest” prompting recommendations, prefer provider docs and standards from data/sources.json. If web search is unavailable, state the constraint and avoid overconfident “current best” claims.


Related Skills

This skill provides foundational prompt engineering patterns. For specialized implementations:

AI/LLM Skills:

Software Development Skills:


Usage Notes

For Claude Code:

  • Reference this skill when building prompts for agents, commands, or integrations
  • Use Quick Reference table for fast pattern lookup
  • Follow Decision Tree to select appropriate pattern
  • Validate outputs with Quality Checklists before deployment
  • Use templates as starting points, customize for specific use cases

For Codex CLI:

  • Use the same patterns and templates; adapt tool-use wording to the local tool interface
  • For long-horizon tasks, track progress explicitly (a step list/plan) and update it as work completes
  • Run independent reads/searches in parallel when the environment supports it; keep writes/edits serialized
  • AGENTS.md Integration: Place project-specific prompt guidance in AGENTS.md files at global (~/.codex/AGENTS.md), project-level (./AGENTS.md), or subdirectory scope for layered instructions
  • Reasoning Effort: Use medium for interactive coding (default), high/xhigh for complex autonomous multi-hour tasks

Fact-Checking

  • Use web search/web fetch to verify current external facts, versions, pricing, deadlines, regulations, or platform behavior before final answers.
  • Prefer primary sources; report source links and dates for volatile information.
  • If web access is unavailable, state the limitation and mark guidance as unverified.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

27.37%
按下载量换算276

Cursor

23.6%
按下载量换算238

OpenCode

16.73%
按下载量换算168

Gemini CLI

12.53%
按下载量换算126

Antigravity

8.19%
按下载量换算82

Codex

3.55%
按下载量换算36

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills