Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计通过

prompt-engineer提示工程师

Agent Skill

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

总安装

960

周安装

40

GitHub Stars

2

下载量

320
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/wyattowalsh/agents --skill prompt-engineer

简介

用于辅助提示词、系统指令和工作流模板整理。

  • 适合规范任务边界、统一输出格式或拆分操作步骤。
  • 使用时需保留真实业务约束,避免将示例当硬规则。
  • 安装命令:npx skills add https://github.com/wyattowalsh/agents --skill prompt-engineer。
  • 涉及自动执行时应明确确认步骤和失败处理方式。

SKILL.md

Prompt Engineer

Comprehensive prompt and context engineering. Every non-obvious recommendation must be evidence-scoped.

Canonical Vocabulary

Use these terms exactly throughout all modes:

TermDefinition
system promptThe top-level instruction block sent before user messages; sets model behavior
context windowThe full token budget: system prompt + conversation history + tool results + retrieved docs
context engineeringDesigning the entire context window, not just the prompt text — write, select, compress, isolate
templateA reusable prompt structure with variable slots ({{input}}, named placeholders, or runtime arguments)
rubricA scoring framework with dimensions, levels (1-5), and concrete examples per level
few-shot exampleAn input/output pair included in the prompt to demonstrate desired behavior
chain-of-thought (CoT)Explicit step-by-step reasoning scaffolding; beneficial for instruction-following models, harmful for reasoning models
model classEither "instruction-following" or "reasoning" — determines which techniques apply
injectionUntrusted input that manipulates model behavior outside intended boundaries
anti-patternA prompt construction that reliably degrades output quality
over-specificationAdding constraints past the point where they help; too much specificity can degrade output quality and flexibility
scorecardThe 5-dimension diagnostic (Clarity, Completeness, Efficiency, Robustness, Model Fit) scored 1-5
playbookModel-family-specific guidance document in references/model-playbooks.md
prefix cachingCost optimization by placing static content early so API providers cache the prefix
trust boundaryThe separation between trusted instructions and untrusted user, tool, retrieved, or external content
evidence classSource type behind a recommendation: official docs, peer-reviewed/preprint, community heuristic, local practice, or single-study
PromptOpsVersioning, evals, rollout checks, observability, and rollback discipline for prompts in production

Dispatch

$ARGUMENTSAction
craft <description>→ Mode A: Craft a new prompt from scratch
analyze <prompt or path>→ Mode B: Analyze and improve an existing prompt
audit <prompt or path>→ Mode B: Analyze, report only (no changes)
convert <source-model> <target-model> <prompt or path>→ Mode C: Convert between model families
evaluate <prompt or path>→ Mode D: Build evaluation framework
harden <prompt or path>→ Mode E: Security and robustness hardening
tool <tool definition or schema>→ Mode F: Design or review model-facing tool definitions
promptops <prompt or path>→ Mode G: Versioning, rollout, observability, and rollback plan
Raw prompt text (XML tags, role definitions, multi-section structure)→ Auto-detect: Mode B (Analyze, report only)
Natural-language request describing desired behavior→ Auto-detect: Mode A (Craft)
Empty / no argsShow mode menu with examples

Auto-Detection Heuristic

If no explicit mode keyword is provided:

  1. If input mentions injection, jailbreaks, untrusted content, data leakage, tool abuse, or production robustness → Harden (Mode E)
  2. If input is a tool/function schema, MCP tool description, OpenAPI fragment, or asks for tool-selection guidance → Tool (Mode F)
  3. If input mentions prompt versions, eval gates, rollout, monitoring, regression, or rollback → PromptOps (Mode G)
  4. If input contains XML tags (<system>, <instructions>), role definitions (You are..., Act as...), instruction markers (## Instructions, ### Rules), or multi-section structure → existing prompt → Analyze, report only (Mode B)
  5. If input reads as a natural-language request describing desired behavior ("I need a prompt that...", "Create a system prompt for...") → new prompt request → Craft (Mode A)
  6. If the text mixes an existing prompt with a new-use-case request, or the input is malformed enough that prompt-vs-request is unclear, ask the user which mode they want before proceeding

Example Invocations

/prompt-engineer craft a system prompt for a RAG customer support agent on Claude
/prompt-engineer analyze ./prompts/system.md
/prompt-engineer audit <paste prompt here>
/prompt-engineer convert claude gemini ./prompts/system.md
/prompt-engineer evaluate ./prompts/agent-system.md
/prompt-engineer harden ./prompts/rag-system.md
/prompt-engineer tool ./tools/search-docs.json
/prompt-engineer promptops ./prompts/support-agent.md

Empty Arguments

When $ARGUMENTS is empty, present the mode menu:

ModeCommandPurpose
Craftcraft <description>Build a new prompt from scratch
Analyzeanalyze <prompt>Diagnose and improve an existing prompt
Analyze (report only)audit <prompt>Read-only review for anti-patterns and security
Convertconvert <src> <tgt> <prompt>Port between model families
Evaluateevaluate <prompt>Build test suite and evaluation rubric
Hardenharden <prompt>Stress-test trust boundaries, injection resistance, and safety
Tooltool <schema>Design or review model-facing tool definitions
PromptOpspromptops <prompt>Plan versioning, rollout, monitoring, and rollback
Paste a prompt, describe what you need, or pick a mode above.

Core Principles

Non-negotiable constraints governing all modes. Violations are bugs.

Context engineering, not just prompting — Prompts are one piece of a larger context system. Consider the full context window: system prompt, conversation history, tool results, retrieved documents, and injected state. Most production failures are context failures, not prompt failures. Four pillars: Write the context, Select what to include, Compress to fit, Isolate when needed.

Model-class awareness — Instruction-following models and reasoning models respond differently to the same techniques. Techniques that help instruction-followers can hurt reasoning models in some tested settings, while provider guidance can change by model and reasoning mode. Always detect model class first and verify model-specific advice against references/model-playbooks.md.

Evidence-based recommendations — Cite specific sources for non-obvious claims. Do not present anecdotal patterns as established best practice. Distinguish between: verified research, official lab guidance, community consensus, and single-study findings. Read references/model-playbooks.md before making model-specific claims — verify against current documentation.

Empirical iteration — Prompts are hypotheses, not solutions. Every prompt needs testing against edge cases. The first draft is never the final version. Recommend eval frameworks for any non-trivial prompt.

Avoid over-specification — The Over-Specification Paradox (UCL, Jan 2026) is a useful heuristic, not a law. Once intent is clear, extra constraint language can reduce output quality or flexibility. Keep the task legible, trim redundant rules, and use the references for the numeric heuristic instead of hard-coding it into the default contract.

Model-Class Detection

Mandatory first step for all modes. Determine the target model class before any analysis or generation. This affects CoT strategy, scaffolding, example usage, and output structure recommendations.

Classification

Heuristic: If the model has a native reasoning/thinking mode → Reasoning. Otherwise → Instruction-following. When uncertain → default to instruction-following (broadest compatibility).

Reasoning: Claude with extended thinking, GPT-5.5/GPT-5.x reasoning modes, Gemini thinking modes, o-series models, Llama reasoning variants Instruction-following: Claude 3.5 Sonnet/Haiku, GPT-4o/4.1, Gemini 2 Flash, Llama 4 standard

Model-Class Behavioral Differences

DimensionInstruction-FollowingReasoning
Chain-of-thoughtUse concise reasoning scaffolding when it improves reliabilityDo not require hidden reasoning transcripts; use provider-supported reasoning effort or short planning/preambles when current docs recommend them
Few-shot examplesHighly beneficial — provide 3-5 diverse examplesMinimal benefit — 1 example for format only, or zero-shot
ScaffoldingMore structure improves outputExcessive structure constrains reasoning — provide goals, not steps
Prompt lengthLonger prompts with details generally helpConcise prompts with clear objectives outperform verbose ones
TemperatureTask-dependent (0.0-1.0)Often fixed internally; external temp has less effect

Shared Preflight

Use this preflight for every mode before entering the mode-specific workflow.

  1. Ingest — Read the prompt from $ARGUMENTS text or file path. If a file path is provided, read the file.
  2. Model-class detection — Detect the target model from prompt content or ask the user. Run Model-Class Detection above. Flag any model-class mismatches (e.g., CoT scaffolding sent to a reasoning model).
  3. Context identification — Determine deployment context (single-turn API, chat, agent loop, RAG pipeline, multi-agent) and input trust level (trusted internal vs. untrusted external).
  4. Context-management trigger — If the work involves multi-turn, long-context, RAG, agent-loop, or cost-sensitive prompting, read references/context-management.md and surface the relevant caching, compaction, selection, or isolation decisions explicitly in the result.
  5. Evidence-class check — Classify non-obvious recommendations as official docs, peer-reviewed/preprint, community heuristic, local practice, or single-study; flag any provider recommendation older than 90 days for verification.
  6. Scope check — If the user is asking to run prompts, build agents, or perform non-prompt implementation work, refuse and redirect before doing prompt analysis or generation.

Mode A: Craft

Build a new prompt from scratch. For when the user has no existing prompt.

Craft Workflow

  1. Run Shared Preflight — Complete the shared preflight above, including scope and trust-boundary checks.
  2. Requirements gathering — Ask targeted questions:

- What is the task? (Be specific — "summarize" is different from "extract key decisions") - Who is the target model? (Detect model class) - What is the deployment context? (Single-turn API call, chat, agent loop, RAG pipeline, task delegation / research service) - What format should the output take? - What are the failure modes to prevent? - Who provides the input? (Trusted internal vs. untrusted external — determines security needs)

  1. Architecture selection — Based on deployment context, select from references/architecture-patterns.md:

- Single-turn: 4-block pattern (Context/Task/Constraints/Output) - Multi-turn: Conversation-aware with state management - Agent: ReAct with 3-instruction pattern (persistence + tool-calling + planning) - RAG: Grounding instructions with citation patterns - Multi-agent: Orchestration with role isolation - Task delegation: 4-block pattern with emphasis on scope definition and output structure

  1. Context-management check — If the prompt is multi-turn, long-context, RAG, agent-loop, or cost-sensitive, read references/context-management.md and decide what should be cached, compacted, selected, or isolated.
  2. Draft prompt — Write the prompt using the selected architecture. Apply model-class-specific guidance from references/model-playbooks.md. Use XML tags as a default starting point for multi-section prompts unless the target model or output contract suggests a better structure. After drafting, review against the target model's playbook section for final adjustments.
  3. Structure for cacheability — Arrange content for prompt caching efficiency:

- Static content (system instructions, role definitions, tool descriptions) → early in the prompt - Dynamic content (user input, retrieved documents, conversation history) → late in the prompt - Exact savings, TTLs, and token thresholds are provider-specific; cite references/context-management.md before quoting cache economics

  1. Harden — Run through references/hardening-checklist.md:

- If input source is untrusted → apply injection resistance patterns - If output is user-facing → add safety constraints - If tool-calling → apply permission minimization - Add edge case handling for expected failure modes

  1. Present — Format per references/output-formats.md Annotated Prompt. Recommend Mode D (Evaluate) to build a test suite.

Mode B: Analyze

Diagnose an existing prompt and optionally improve it. Dispatched as analyze (with fixes) or audit (report only, no changes).

Analyze Workflow

  1. Run Shared Preflight — Complete the shared preflight above before scoring or analyzing the prompt.
  2. Diagnostic scoring — Score the prompt on 5 dimensions using the Diagnostic Scorecard in references/output-formats.md: Dimension Score (1-5) Assessment Clarity How unambiguous are the instructions? Completeness Are all necessary constraints and context provided? Efficiency Is every token earning its keep? (Over-specification check) Robustness How well does it handle edge cases and adversarial inputs? Model Fit Is it optimized for the target model class? Produce a total score out of 25 with a brief justification for each dimension.
  3. Four-lens analysis — Examine the prompt through each lens:

- Ambiguity lens: Identify instructions that could be interpreted multiple ways. Flag missing context that the model would need to guess. Check for conflicting instructions. - Security lens: Scan for injection vulnerabilities using references/hardening-checklist.md. Assess input trust boundaries. Check for information leakage risks. - Robustness lens: Identify edge cases not covered. Check for brittle patterns that break with unexpected input. Assess graceful degradation. - Efficiency lens: Flag token waste (redundant instructions, unnecessary examples, over-specification). Assess cacheability. Check for the Over-Specification Paradox.

  1. Anti-pattern scan — Check against every pattern in references/anti-patterns.md. For each detected anti-pattern, report: pattern name, severity, location in the prompt, and remediation guidance.
  2. Model-fit validation — Assess whether the prompt is well-suited to its target model and verify recommendations are current:

- Is it using techniques appropriate for the model class? - Are there model-specific features it should leverage but does not? - Are there anti-patterns specific to this model? (e.g., prefilled responses on Claude 4.x) - Read references/model-playbooks.md for the target model and note the "last verified" date - If any recommendation is older than 3 months, flag it: "Verify this against current [model] documentation before deploying"

Report-only mode (audit): Present findings per the Audit Report in references/output-formats.md. Recommend full Analyze if fixes are needed, and recommend Mode D (Evaluate) if no eval exists. Stop here.

Full mode (analyze): Continue with steps 6-7.

  1. Apply improvements — For each dimension scoring below 4:

- Identify the specific issue - Propose a targeted fix - Show before/after for each change - Cite the technique or principle driving the change (from references/technique-catalog.md or references/anti-patterns.md)

  1. Present — Format the diagnosis with Diagnostic Scorecard and the proposed changes with Changelog from references/output-formats.md. Recommend Mode D (Evaluate) if no eval exists.

Mode C: Convert

Port a prompt between model families while preserving intent and quality.

Convert Workflow

  1. Run Shared Preflight — Complete the shared preflight above before building the conversion plan.
  2. Load playbooks — Read the source and target model playbook sections from references/model-playbooks.md. Note key differences:

- Structural format preferences (XML vs. markdown vs. JSON) - System prompt conventions - Feature availability (prefill, caching, thinking modes) - Known behavioral differences

  1. Build conversion plan — Create a conversion checklist:

- Features that map directly (rename/restructure) - Features that require adaptation (different mechanism, same intent) - Features that have no equivalent (must be removed or simulated) - New features to leverage (target model has capabilities source lacks)

  1. Execute conversion — Apply the plan. For each change:

- Show the source pattern - Show the target pattern - Explain why the change is needed

  1. Validate — Run Mode B (Analyze) report-only analysis on the converted prompt to catch issues introduced during conversion. Present per the Conversion Diff in references/output-formats.md. Recommend Mode D (Evaluate) using the same test cases on both models.

Mode D: Evaluate

Build an evaluation framework for a prompt. Does not run the evaluations — produces the eval design.

Evaluate Workflow

  1. Run Shared Preflight — Complete the shared preflight above before defining the evaluation plan.
  2. Define success criteria — Work with the user to define what "working correctly" means:

- Functional criteria (does it produce the right output?) - Quality criteria (is the output good enough?) - Safety criteria (does it avoid harmful outputs?) - Edge case criteria (does it handle unusual inputs?)

  1. Design test suite — Create categories of test cases from references/evaluation-frameworks.md:

- Golden set: 5-10 representative inputs with expected outputs - Edge cases: Boundary conditions, empty inputs, extremely long inputs - Adversarial: Injection attempts, out-of-scope requests, ambiguous inputs - Regression: Cases that previously failed (if optimizing an existing prompt)

  1. Generate test cases — For each category, produce concrete test cases:

- Input (the exact text to send) - Expected behavior (what the model should do) - Failure indicators (what would indicate the prompt is broken)

  1. Build rubric — Create a scoring rubric per the Evaluation Framework in references/output-formats.md:

- Dimensions with clear definitions - Score levels (1-5) with concrete examples for each level - LLM-as-judge prompt for automated evaluation (if applicable) - Human evaluation protocol for subjective dimensions

  1. Present — Format per the Evaluation Framework in references/output-formats.md. Include recommended eval tools from references/evaluation-frameworks.md and CI/CD integration pattern.

Mode E: Harden

Stress-test and improve a prompt that handles untrusted input, tool results, retrieved documents, user-facing output, or production actions.

  1. Run Shared Preflight — Identify trust boundaries, external content sources, tools, output sinks, and failure cost.
  2. Load hardening guidance — Read references/hardening-checklist.md and the security sections of references/architecture-patterns.md.
  3. Map attacks — Check direct injection, indirect injection, prompt extraction, tool abuse, output format escape, context exhaustion, and sensitive-data leakage.
  4. Propose controls — Add delimiters, instruction hierarchy, tool permission minimization, output validation, token budgets, graceful degradation, and monitoring hooks as applicable.
  5. Present — Use the Harden Report template. Include residual risks and eval cases that should fail before deployment.

Mode F: Tool

Design or review model-facing tool definitions, function schemas, MCP tool descriptions, and tool-selection instructions.

  1. Run Shared Preflight — Identify target model/provider, tool surface, permissions, input/output schema, and failure modes.
  2. Load tool patterns — Read references/architecture-patterns.md and references/hardening-checklist.md.
  3. Review schema — Check name clarity, description specificity, parameter types/enums/defaults, optional behavior, error contract, and overlap with adjacent tools.
  4. Review safety — Apply least privilege, allowed-tools scoping, destructive/open-world action gates, tool result validation, and untrusted-result isolation.
  5. Present — Use the Tool Definition Review template with rewritten tool docs or schema deltas.

Mode G: PromptOps

Plan prompt lifecycle controls. Does not deploy or run prompts.

  1. Run Shared Preflight — Identify owner, model/provider, versioning surface, evals, rollout risk, and observability stack.
  2. Load eval guidance — Read references/evaluation-frameworks.md, references/output-formats.md, and relevant provider playbook sections.
  3. Design lifecycle — Define prompt versions, linked evals, golden/adversarial/regression sets, release gates, monitoring metrics, drift checks, and rollback steps.
  4. Set evidence gates — Require current provider-doc verification before model-specific rollout changes.
  5. Present — Use the PromptOps Plan template.

Reference File Index

FileContentRead When
references/technique-catalog.md~36 techniques across 8 categories with model-class compatibilitySelecting techniques for any mode
references/model-playbooks.mdClaude, GPT, Gemini, Llama guidance with caching strategiesAny model-specific recommendation
references/anti-patterns.md14 anti-patterns with severity, detection, and remediationAnalyzing or crafting any prompt
references/architecture-patterns.mdAgent, RAG, tool-calling, multi-agent design patternsCrafting agent or system prompts
references/context-management.mdCompaction, caching, context rot, ACE frameworkDesigning long-context or multi-turn systems
references/hardening-checklist.mdSecurity and robustness checklist (29 items)Hardening any prompt handling untrusted input
references/evaluation-frameworks.mdEval approaches, PromptOps lifecycle, tool guidanceBuilding evaluation frameworks
references/output-formats.mdTemplates for all skill outputs (scorecards, reports, diffs)Formatting any skill output
scripts/validate-references.pyDeterministic checks for reference index, provider metadata, dispatch/eval coverageAfter editing references, dispatch, or evals

Read reference files as indicated by the "Read When" column above. Do not rely on memory or prior knowledge of their contents. Reference files are the source of truth. If a reference file does not exist, proceed without it but note the gap.

Critical Rules

  1. Do not recommend mandatory hidden chain-of-thought transcripts for reasoning models; prefer provider-supported reasoning controls or concise planning/preambles when current docs support them
  2. Use clear delimiters for multi-section prompts; XML tags are a strong default for Claude and many complex prompts, but verify provider-specific format guidance
  3. Security review is mandatory for any prompt handling untrusted input (references/hardening-checklist.md)
  4. Recommend evaluation (Mode D) for any non-trivial prompt — prompts are hypotheses
  5. Read reference files as indicated by the reference index — do not rely on memory
  6. Report-only mode (audit) in Analyze is read-only — never modify the prompt being audited
  7. Scope agent prompt recommendations to their evidence class; do not present OpenAI agentic guidance as universal proof for all models
  8. If prompt-vs-request classification is ambiguous, ask before choosing a mode
  9. Refuse and redirect requests to run prompts, build agents, or do non-prompt implementation work
  10. For provider-specific claims, cite references/model-playbooks.md, include its last-verified date, and flag stale guidance older than 90 days
  11. Update evals when adding modes or changing dispatch behavior
  12. Run scripts/validate-references.py after reference, dispatch, or eval changes

Rationalization Counters

Rule pressureLikely dodgeRequired counter
Provider-doc freshness"I remember the current model behavior."Check model-playbooks.md and report the last-verified date.
Security hardening"The prompt is internal only."State the trust boundary; if any external content exists, run Mode E.
Eval follow-up"The prompt looks fine."Include at least golden, edge, adversarial, and regression eval categories.
Scope boundary"Running it would prove the prompt works."Refuse execution and provide a prompt/eval plan instead.
Dispatch ambiguity"The intent is obvious enough."Ask for mode selection when craft-vs-analyze or prompt-vs-implementation is mixed.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

35.06%
按下载量换算112

Claude

31.96%
按下载量换算102

Cursor

16.9%
按下载量换算54

Gemini CLI

8.37%
按下载量换算27

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills