| name | prompt-engineering |
| description | Prompt design, chain-of-thought, few-shot learning, system prompts, and structured output patterns |
| layer | domain |
| category | ai-ml |
| triggers | ["prompt engineering","prompt design","system prompt","few-shot","chain of thought","prompt template","LLM prompt"] |
| inputs | [{"task":"What the LLM should accomplish"},{"model":"Claude | GPT-4 | Gemini | Llama (optional)"},{"constraints":"Output format, token budget, latency requirements"},{"examples":"Example inputs and expected outputs (optional)"}] |
| outputs | [{"system_prompt":"Optimized system prompt"},{"user_prompt_template":"Parameterized user prompt template"},{"few_shot_examples":"Curated examples for in-context learning"},{"evaluation_criteria":"How to measure prompt quality"}] |
| linksTo | ["ai-agents","rag","research"] |
| linkedFrom | ["ai-agents","cook","plan"] |
| preferredNextSkills | ["ai-agents","rag"] |
| fallbackSkills | ["research"] |
| riskLevel | low |
| memoryReadPolicy | selective |
| memoryWritePolicy | none |
| sideEffects | [] |
Prompt Engineering Skill
Purpose
Design effective prompts for large language models that produce accurate, consistent, and well-structured outputs. This skill covers system prompt design, chain-of-thought reasoning, few-shot learning, structured output, and prompt evaluation. Good prompts are precise about what they want, explicit about format, and include enough context for the model to succeed.
Key Concepts
Prompt Components
SYSTEM PROMPT:
- Role and persona definition
- Core instructions and constraints
- Output format specification
- Rules and boundaries
USER PROMPT:
- The specific task or question
- Context and background information
- Input data to process
- Examples (few-shot)
ASSISTANT PREFILL:
- Partial response to guide format
- First few tokens to steer output
- JSON opening bracket for structured output
Prompting Techniques
ZERO-SHOT:
Just the instruction, no examples.
"Classify this email as spam or not spam."
FEW-SHOT:
Instruction + examples of input/output pairs.
"Classify these emails:
Email: 'Win a free iPhone!' -> spam
Email: 'Meeting at 3pm tomorrow' -> not spam
Email: '{input}' -> "
CHAIN-OF-THOUGHT (CoT):
Ask the model to think step by step.
"Think through this problem step by step before giving your answer."
SELF-CONSISTENCY:
Generate multiple CoT paths and take the majority answer.
TREE OF THOUGHTS:
Explore multiple reasoning branches, evaluate each, prune bad ones.
RETRIEVAL-AUGMENTED:
Provide relevant context from a knowledge base before asking the question.
Patterns
System Prompt Template
You are [ROLE] with expertise in [DOMAIN].
Your task is to [OBJECTIVE].
## Rules
- [Rule 1]
- [Rule 2]
- [Rule 3]
## Output Format
[Exactly how the response should be structured]
## Examples
[Input/output examples if needed]
## Constraints
- Do not [boundary 1]
- Always [boundary 2]
- If uncertain, [fallback behavior]
Classification Prompt (Few-Shot)
Classify the following customer support ticket into exactly one category.
Categories:
- billing: Payment issues, invoices, refunds, pricing questions
- technical: Bugs, errors, feature requests, integration help
- account: Login issues, password reset, account settings
- general: Everything else
Examples:
Ticket: "I was charged twice for my subscription"
Category: billing
Ticket: "The export button returns a 500 error"
Category: technical
Ticket: "I cannot log in with my Google account"
Category: account
Ticket: "{ticket_text}"
Category:
Structured Output (JSON)
Extract the following information from the provided text and return it as JSON.
Required fields:
- name (string): Full name of the person
- email (string): Email address
- company (string): Company name
- role (string): Job title or role
- sentiment (string): "positive", "neutral", or "negative"
If a field cannot be determined from the text, use null.
Text: "{input_text}"
Return ONLY valid JSON, no other text.