optimize-prompt

Prompt optimization consultant for AI system prompts and custom instructions. Supports Claude API, OpenAI API, Gemini API, CLAUDE.md, ChatGPT, and n8n. Use when user wants to improve, review, or create prompts, system instructions, or custom instructions for any AI platform.

16 stars

Best use case

optimize-prompt is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Prompt optimization consultant for AI system prompts and custom instructions. Supports Claude API, OpenAI API, Gemini API, CLAUDE.md, ChatGPT, and n8n. Use when user wants to improve, review, or create prompts, system instructions, or custom instructions for any AI platform.

Teams using optimize-prompt should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/optimize-prompt/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/development/optimize-prompt/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/optimize-prompt/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How optimize-prompt Compares

Feature / Agentoptimize-promptStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Prompt optimization consultant for AI system prompts and custom instructions. Supports Claude API, OpenAI API, Gemini API, CLAUDE.md, ChatGPT, and n8n. Use when user wants to improve, review, or create prompts, system instructions, or custom instructions for any AI platform.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Prompt Optimization Consultant

Expert consultant for optimizing AI prompts across platforms. **Asks first, optimizes second.**

## Consultant Workflow

```
DISCOVER → DIAGNOSE → OPTIMIZE → VALIDATE
```

### Phase 1: DISCOVER (Always First)

**Before touching any prompt, ask these questions:**

| Question | Why It Matters |
|----------|----------------|
| **Platform?** | Claude API / OpenAI API / Gemini API / CLAUDE.md / ChatGPT / n8n | Format differs by platform |
| **Model?** | Opus / Sonnet / Haiku / GPT-4o / GPT-5 / Gemini | Model-specific clauses needed |
| **Prompt type?** | System prompt / User prompt / Both | Different optimization strategies |
| **Goal?** | What should the AI do? | Informs structure and examples |
| **Current issues?** | What's not working? | Prioritizes fixes |

**Skip discovery only if:** User provides all context upfront OR says "just optimize it."

### Phase 2: DIAGNOSE

Score against platform-appropriate criteria (see [checklist.md](references/checklist.md)).

### Phase 3: OPTIMIZE

Apply platform-specific techniques. Show before/after for each change.

### Phase 4: VALIDATE

Verify no conflicting instructions and structure is coherent.

---

## Quick Reference

### System Prompt vs User Prompt

| Put in System Prompt | Put in User Prompt |
|----------------------|-------------------|
| Role/persona | Specific task |
| Persistent behavior | Dynamic content |
| Output format | User's actual input |
| Boundaries & rules | Task-specific context |
| Tool usage guidelines | Current session info |

**Rule:** Consistency across sessions → System. Specific to this interaction → User.

### Platform Quick Guide

| Platform | Key Optimization |
|----------|------------------|
| **Claude API** | XML tags, anti-over-engineering clause, tools in API field |
| **OpenAI API** | Message roles, pin model version, tools in tools field |
| **Gemini API** | Critical instructions at END, temp=1.0, knowledge cutoff |
| **CLAUDE.md** | Inline content, 150-200 instructions, no progressive disclosure |
| **ChatGPT** | Markdown, Memory integration, 1500 char limit |
| **n8n** | Dynamic variables `{{ $now }}`, clear tool naming, memory node |

### Model-Specific Additions

| Model | Required Addition |
|-------|-------------------|
| **Claude Opus 4.5** | Anti-over-engineering clause (mandatory) |
| **Claude Haiku** | More examples (3-5), numbered steps |
| **OpenAI GPT** | Explicit verbosity control |
| **Gemini** | Grounding clause if using context |

---

## Core Techniques

### 1. Structure by Platform

**Claude (API & CLAUDE.md):** XML tags
```xml
<context>Role and project</context>
<instructions>What to do</instructions>
<examples>Concrete examples</examples>
```

**OpenAI/ChatGPT:** Markdown with clear sections
```markdown
## Role
You are a helpful assistant...

## Instructions
1. Always...
2. Never...
```

**Gemini:** XML or Markdown (pick one, don't mix)
- Place critical instructions at END for long context

### 2. Instruction Hierarchy

| Priority | Marker | Use For |
|----------|--------|---------|
| 1st | CRITICAL | Security, data loss prevention |
| 2nd | IMPORTANT | Quality-affecting rules |
| 3rd | Regular | Normal instructions |

**Max 2-3 CRITICAL items.** If everything is critical, nothing is.

### 3. Anti-Over-Engineering (Opus Required)

```markdown
Avoid over-engineering. Only make changes that are directly requested.
Keep solutions simple and focused. Don't add features beyond what was asked.
Don't create abstractions for one-time operations.
```

### 4. Examples (3-5 Diverse)

```markdown
<example>
User: "Add caching"
Bad: "Adding Redis..."
Good: "What's the bottleneck? Let me profile first."
</example>
```

### 5. Tables Over Paragraphs

```markdown
| Tool | Purpose | Flag |
|------|---------|------|
| sql_query.py | Query | --schema |
| sql_write.py | Update | --save |
```

---

## Anti-Patterns

| Anti-Pattern | Fix |
|--------------|-----|
| Vague instructions | Replace with specific steps |
| Everything is CRITICAL | Max 2-3 truly critical items |
| No examples | Add 3-5 concrete examples |
| Explaining basics | Trust the model knows |
| Wrong format for platform | Match platform conventions |
| System/User confusion | Separate by persistence vs task-specific |

---

## Output Format

```markdown
## Discovery Summary
- Platform: [X]
- Model: [X]
- Type: [System/User/Both]
- Goal: [X]
- Issues: [X]

## Score: [X/100]

## Issues Found
1. **[Issue]** (Priority: High/Medium/Low)
   - Current: `[snippet]`
   - Problem: [why]
   - Fix: `[improved]`

## Optimized Prompt
[Full optimized version]

## Changes Made
- [bullet list]
```

---

## References

| Reference | Use For |
|-----------|---------|
| [platforms.md](references/platforms.md) | Platform-specific deep dive |
| [system-vs-user.md](references/system-vs-user.md) | System/User prompt guidance |
| [techniques.md](references/techniques.md) | Core optimization techniques |
| [checklist.md](references/checklist.md) | Scoring checklist by platform |
| [model-comparison.md](references/model-comparison.md) | Model-specific behaviors |

---

## Related Skills

- `/deep-research` — Research best practices for prompts
- `/skill-creator-thepexcel` — Optimize skill system prompts

Related Skills

prompting

16
from diegosouzapw/awesome-omni-skill

Meta-prompting system for dynamic prompt generation using templates, standards, and patterns. USE WHEN meta-prompting, template generation, prompt optimization, or programmatic prompt composition.

prompt-optimizer

16
from diegosouzapw/awesome-omni-skill

This skill should be used when users request help optimizing, improving, or refining their prompts or instructions for AI models. Use this skill when users provide vague, unclear, or poorly structured prompts and need assistance transforming them into clear, effective, and well-structured instructions that AI models can better understand and execute. This skill applies comprehensive prompt engineering best practices to enhance prompt quality, clarity, and effectiveness.

prompt-library

16
from diegosouzapw/awesome-omni-skill

Curated collection of high-quality prompts for various use cases. Includes role-based prompts, task-specific templates, and prompt refinement techniques. Use when user needs prompt templates, role-play prompts, or ready-to-use prompt examples for coding, writing, analysis, or creative tasks.

prompt-generation-rules

16
from diegosouzapw/awesome-omni-skill

General rules to generate prompt.

prompt-expander

16
from diegosouzapw/awesome-omni-skill

EXPAND vague prompts into precise, platform-optimized instructions. Detects target platform (Claude, GPT, Gemini, Midjourney, Sora, etc.) and applies appropriate prompting patterns. Use when user says "coggle", "expand", "improve prompt", "make better".

prompt-enhancer

16
from diegosouzapw/awesome-omni-skill

Enhance user prompts by analyzing project context (code structure, dependencies, conventions, existing patterns). Use when users provide brief development requests that would benefit from project-specific context to generate more accurate, contextually-aware prompts.

prompt-engineering-patterns

16
from diegosouzapw/awesome-omni-skill

Master advanced prompt engineering techniques to maximize LLM performance, reliability, and controllability in production. Use when optimizing prompts, improving LLM outputs, or designing production prompt templates.

prompt-architect

16
from diegosouzapw/awesome-omni-skill

Create and enhance prompts, system instructions, and principle files. Capabilities: transform verbose prompts, add patterns/heuristics, optimize token usage, structure CLAUDE.md principles, improve agent/persona definitions, apply prompt engineering techniques (CoT, few-shot, ReAct). Actions: create, enhance, optimize, refactor, compress prompts. Keywords: prompt engineering, system prompt, CLAUDE.md, principle files, instruction optimization, agent prompt, persona prompt, token efficiency, prompt structure, workflow prompts, rules, constraints, few-shot, chain-of-thought, soul, tensions, dialectic. Use when: creating new prompts, enhancing principle files, improving system instructions, optimizing CLAUDE.md, restructuring verbose prompts, adding patterns to workflows, defining agent behaviors.

performance-optimizer

16
from diegosouzapw/awesome-omni-skill

Performance analysis, profiling techniques, bottleneck identification, and optimization strategies for code and systems. Use when the user needs to improve performance, reduce resource usage, or identify and fix performance bottlenecks.

optimize

16
from diegosouzapw/awesome-omni-skill

Optimize your SaaS app across four dimensions - Speed (page load, API response), Code (unused files, dead code), Database (orphaned data, schema hygiene), and Dependencies (package bloat, bundle size). Use when app feels slow, codebase feels bloated, or after significant development work accumulates. Each path follows AUDIT → CLEAN → PREVENT workflow.

midjourney-prompt-engineering

16
from diegosouzapw/awesome-omni-skill

Use when generating images with Midjourney, constructing MJ prompts, iterating on MJ output quality, choosing between --sref/--oref/style codes, scoring image results, or building reusable prompt patterns. Also use when exploring MJ style codes, animating images, or debugging why a prompt isn't producing the intended result.

hinge-profile-optimizer

16
from diegosouzapw/awesome-omni-skill

Comprehensive, research-backed Hinge dating profile optimization. Use when someone wants to improve their Hinge profile, audit an existing profile, write better prompts/captions, select and order photos strategically, or understand why they're not getting quality matches. This is the thorough process (60-90 mins) - discovery interview, game theory analysis, photo strategy, copy creation, settings optimization, and implementation support. Based on 45+ peer-reviewed sources on dating app behavior.