openai-prompt-engineer
Generate and improve prompts using best practices for OpenAI GPT-5 and other LLMs. Apply advanced techniques like chain-of-thought, few-shot prompting, and progressive disclosure.
What this skill does
# OpenAI Prompt Engineer
A comprehensive skill for crafting, analyzing, and improving prompts for OpenAI's GPT-5 and other modern Large Language Models (LLMs), with focus on GPT-5-specific optimizations and universal prompting techniques.
## What This Skill Does
Helps you create and optimize prompts using cutting-edge techniques:
- **Generate new prompts** - Build effective prompts from scratch
- **Improve existing prompts** - Enhance clarity, structure, and results
- **Apply best practices** - Use proven techniques for each model
- **Optimize for specific models** - GPT-5, Claude-specific strategies
- **Implement advanced patterns** - Chain-of-thought, few-shot, structured prompting
- **Analyze prompt quality** - Identify issues and suggest improvements
## Why Prompt Engineering Matters
**Without good prompts:**
- Inconsistent or incorrect outputs
- Poor instruction following
- Wasted tokens and API costs
- Multiple attempts needed
- Unpredictable behavior
**With optimized prompts:**
- Accurate, consistent results
- Better instruction adherence
- Lower costs and latency
- First-try success
- Predictable, reliable outputs
## Supported Models & Approaches
### GPT-5 (OpenAI)
- Structured prompting (role + task + constraints)
- Reasoning effort calibration
- Agentic behavior control
- Verbosity management
- Prompt optimizer integration
### Claude (Anthropic)
- XML tag structuring
- Step-by-step thinking
- Clear, specific instructions
- Example-driven prompting
- Progressive disclosure
### Universal Techniques
- Chain-of-thought prompting
- Few-shot learning
- Zero-shot prompting
- Self-consistency
- Role-based prompting
## Core Prompting Principles
### 1. Be Clear and Specific
**Bad:** "Write about AI"
**Good:** "Write a 500-word technical article explaining transformer architecture for software engineers with 2-3 years of experience. Include code examples in Python and focus on practical implementation."
### 2. Provide Structure
Use clear formatting to organize instructions:
```
Role: You are a senior Python developer
Task: Review this code for security vulnerabilities
Constraints:
- Focus on OWASP Top 10
- Provide specific line numbers
- Suggest fixes with code examples
Output format: Markdown with severity ratings
```
### 3. Use Examples (Few-Shot)
Show the model what you want:
```
Input: "User clicked login"
Output: "USER_LOGIN_CLICKED"
Input: "Payment processed successfully"
Output: "PAYMENT_PROCESSED_SUCCESS"
Input: "Email verification failed"
Output: [Your turn]
```
### 4. Enable Reasoning
Add phrases like:
- "Think step-by-step"
- "Let's break this down"
- "First, analyze... then..."
- "Show your reasoning"
### 5. Define Output Format
Specify exactly how you want the response:
```xml
<output_format>
<summary>One sentence overview</summary>
<details>
<point>Key finding 1</point>
<point>Key finding 2</point>
</details>
<recommendation>Specific action to take</recommendation>
</output_format>
```
## Prompt Engineering Workflow
### 1. Define Your Goal
- What task are you solving?
- What's the ideal output?
- Who's the audience?
- What model will you use?
### 2. Choose Your Technique
- **Simple task?** → Direct instruction
- **Complex reasoning?** → Chain-of-thought
- **Pattern matching?** → Few-shot examples
- **Need consistency?** → Structured format + examples
### 3. Build Your Prompt
Use this template:
```
[ROLE/CONTEXT]
You are [specific role with relevant expertise]
[TASK]
[Clear, specific task description]
[CONSTRAINTS]
- [Limitation 1]
- [Limitation 2]
[FORMAT]
Output should be [exact format specification]
[EXAMPLES - if using few-shot]
[Example 1]
[Example 2]
[THINK STEP-BY-STEP - if complex reasoning]
Before answering, [thinking instruction]
```
### 4. Test and Iterate
- Run the prompt
- Analyze output quality
- Identify issues
- Refine and retry
- Document what works
## Advanced Techniques
### Chain-of-Thought (CoT) Prompting
**When to use:** Complex reasoning, math, multi-step problems
**How it works:** Ask the model to show intermediate steps
**Example:**
```
Problem: A store has 15 apples. They sell 60% in the morning and
half of what's left in the afternoon. How many remain?
Please solve this step-by-step:
1. Calculate morning sales
2. Calculate remaining after morning
3. Calculate afternoon sales
4. Calculate final remaining
```
**Result:** More accurate answers through explicit reasoning
### Few-Shot Prompting
**When to use:** Pattern matching, classification, style transfer
**How it works:** Provide 2-5 examples, then the actual task
**Example:**
```
Convert casual text to professional business tone:
Input: "Hey! Thanks for reaching out. Let's chat soon!"
Output: "Thank you for your message. I look forward to our conversation."
Input: "That's a great idea! I'm totally on board with this."
Output: "I appreciate your suggestion and fully support this initiative."
Input: "Sounds good, catch you later!"
Output: [Model completes]
```
### Zero-Shot Chain-of-Thought
**When to use:** Complex problems without examples
**How it works:** Simply add "Let's think step by step"
**Example:**
```
Question: What are the security implications of storing JWTs
in localStorage?
Let's think step by step:
```
**Magic phrase:** "Let's think step by step" → dramatically improves reasoning
### Structured Output with XML
**When to use:** Working with Claude or need parsed output
**Example:**
```
Analyze this code for issues. Structure your response as:
<analysis>
<security_issues>
<issue severity="high|medium|low">
<description>What's wrong</description>
<location>File and line number</location>
<fix>How to fix it</fix>
</issue>
</security_issues>
<performance_issues>
<!-- Same structure -->
</performance_issues>
<best_practices>
<suggestion>Improvement suggestion</suggestion>
</best_practices>
</analysis>
```
### Progressive Disclosure
**When to use:** Large context, multi-step workflows
**How it works:** Break tasks into stages, only request what's needed now
**Example:**
```
Stage 1: "Analyze this codebase structure and list the main components"
[Get response]
Stage 2: "Now, for the authentication component you identified,
show me the security review"
[Get response]
Stage 3: "Based on that review, generate fixes for the high-severity issues"
```
## Model-Specific Best Practices
### GPT-5 Optimization
**Structured Prompting:**
```
ROLE: Senior TypeScript Developer
TASK: Implement user authentication service
CONSTRAINTS:
- Use JWT with refresh tokens
- TypeScript with strict mode
- Include comprehensive error handling
- Follow SOLID principles
OUTPUT: Complete TypeScript class with JSDoc comments
REASONING_EFFORT: high (for complex business logic)
```
**Control Agentic Behavior:**
```
"Implement this feature step-by-step, asking for confirmation
before each major decision"
OR
"Complete this task end-to-end without asking for guidance.
Persist until fully handled."
```
**Manage Verbosity:**
```
"Provide a concise implementation (under 100 lines) focusing
only on core functionality"
```
### Claude Optimization
**Use XML Tags:**
```
<instruction>
Review this pull request for security issues
</instruction>
<code>
[Code to review]
</code>
<focus_areas>
- SQL injection vulnerabilities
- XSS attack vectors
- Authentication bypasses
- Data exposure risks
</focus_areas>
<output_format>
For each issue found, provide:
1. Severity (Critical/High/Medium/Low)
2. Location
3. Explanation
4. Fix recommendation
</output_format>
```
**Step-by-Step Thinking:**
```
Think through this architecture decision step by step:
1. First, identify the requirements
2. Then, list possible approaches
3. Evaluate trade-offs for each
4. Make a recommendation with reasoning
```
**Clear Specificity:**
```
BAD: "Make the response professional"
GOOD: "Use formal business language, avoid contractions,
address the user as 'you', keep sentences under 20 words"
```
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.