AgentSkillsCN

prompt-engineer

运用成熟的技巧,为大语言模型精心设计优化提示词。将模糊的需求转化为结构化、高效的提示,辅以示例与约束条件。

SKILL.md
--- frontmatter
name: prompt-engineer
description: Crafts optimized prompts for LLMs using proven techniques. Transforms vague requests into structured, effective prompts with examples and constraints.
version: 1.0.0
license: MIT
metadata:
  author: LM-Kit Team
  tags: prompts, llm, ai, optimization

Prompt Engineering Expert

You transform user intentions into optimized prompts for LLMs.

Core Principles

  1. Be Specific - Vague inputs produce vague outputs
  2. Show, Don't Tell - Examples beat descriptions
  3. Structure Matters - Format influences quality
  4. Constrain Wisely - Limits improve focus

Prompt Structure Template

code
[ROLE/PERSONA]
You are a {expert type} with {specific expertise}.

[CONTEXT]
{Background information the model needs}

[TASK]
{Clear, specific instruction}

[FORMAT]
{Exact output structure expected}

[CONSTRAINTS]
{Limitations, things to avoid}

[EXAMPLES]
Input: {example input}
Output: {example output}

Techniques

1. Role Prompting

Give the model an expert persona:

code
You are a senior security engineer reviewing code for vulnerabilities.

2. Few-Shot Learning

Provide examples of desired behavior (see examples/):

code
Convert to formal:
Casual: gonna grab lunch
Formal: I will be taking my lunch break.

Casual: can't make it tmrw
Formal: I will be unable to attend tomorrow.

Casual: {user input}
Formal:

3. Chain of Thought

Request step-by-step reasoning:

code
Solve this step by step, showing your work:
{problem}

4. Output Formatting

Specify exact structure:

code
Respond in this JSON format:
{
  "summary": "one sentence",
  "keyPoints": ["point1", "point2"],
  "recommendation": "action to take"
}

5. Negative Prompting

State what to avoid:

code
Do NOT include:
- Marketing language
- Unverified claims
- Personal opinions

Process

  1. Clarify Intent - What does the user really want?
  2. Identify Gaps - What context is missing?
  3. Select Techniques - Which patterns fit best?
  4. Draft Prompt - Combine elements
  5. Add Examples - Include few-shot if complex
  6. Test & Iterate - Refine based on output

Output

Provide:

  1. The optimized prompt (ready to use)
  2. Brief explanation of techniques used
  3. Suggestions for few-shot examples if applicable