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.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "optimize-prompt" with this command: npx skills add thepexcel/agent-skills/thepexcel-agent-skills-optimize-prompt

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:

QuestionWhy It Matters
Platform?Claude API / OpenAI API / Gemini API / CLAUDE.md / ChatGPT / n8n
Model?Opus / Sonnet / Haiku / GPT-4o / GPT-5 / Gemini
Prompt type?System prompt / User prompt / Both
Goal?What should the AI do?
Current issues?What's not working?

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).

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 PromptPut in User Prompt
Role/personaSpecific task
Persistent behaviorDynamic content
Output formatUser's actual input
Boundaries & rulesTask-specific context
Tool usage guidelinesCurrent session info

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

Platform Quick Guide

PlatformKey Optimization
Claude APIXML tags, anti-over-engineering clause, tools in API field
OpenAI APIMessage roles, pin model version, tools in tools field
Gemini APICritical instructions at END, temp=1.0, knowledge cutoff
CLAUDE.mdInline content, 150-200 instructions, no progressive disclosure
ChatGPTMarkdown, Memory integration, 1500 char limit
n8nDynamic variables {{ $now }}, clear tool naming, memory node

Model-Specific Additions

ModelRequired Addition
Claude Opus 4.5Anti-over-engineering clause (mandatory)
Claude HaikuMore examples (3-5), numbered steps
OpenAI GPTExplicit verbosity control
GeminiGrounding clause if using context

Core Techniques

1. Structure by Platform

Claude (API & CLAUDE.md): XML tags

<context>Role and project</context>
<instructions>What to do</instructions>
<examples>Concrete examples</examples>

OpenAI/ChatGPT: Markdown with clear sections

## 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

PriorityMarkerUse For
1stCRITICALSecurity, data loss prevention
2ndIMPORTANTQuality-affecting rules
3rdRegularNormal instructions

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

3. Anti-Over-Engineering (Opus Required)

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)

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

5. Tables Over Paragraphs

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

Anti-Patterns

Anti-PatternFix
Vague instructionsReplace with specific steps
Everything is CRITICALMax 2-3 truly critical items
No examplesAdd 3-5 concrete examples
Explaining basicsTrust the model knows
Wrong format for platformMatch platform conventions
System/User confusionSeparate by persistence vs task-specific

Output Format

## 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

ReferenceUse For
platforms.mdPlatform-specific deep dive
system-vs-user.mdSystem/User prompt guidance
techniques.mdCore optimization techniques
checklist.mdScoring checklist by platform
model-comparison.mdModel-specific behaviors

Related Skills

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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

graphic-designer

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

power-query-coaching

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

manage-business-strategy

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

generate-creative-ideas

No summary provided by upstream source.

Repository SourceNeeds Review