Skip to content

Thomaszhou22/prompt-optimizer-skill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

34 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Prompt Optimizer

Dual-Engine Prompt Optimization Skill โ€” Template matching (3,344 library) + LLM meta-prompting (host AI as optimizer). Zero API cost.


๐Ÿ–ฅ๏ธ Platform Compatibility (Read This First!)

Different platforms have different capabilities. Find yours below and follow the recommended setup.

โญโญโญโญโญ OpenClaw (Best Experience)

Feature Status
Template Engine โœ… Full support
LLM Engine โœ…
Category Loading โœ…
State Persistence โœ… Auto-save config
Quality Evaluation โœ…

Install: Place in skills/prompt-optimizer/ directory. OpenClaw auto-detects. Recommended Mode: Template-first + LLM fallback (default). All features available. No limitations.


โญโญโญโญ Claude Code

Feature Status
Template Engine โœ… Reads local files
LLM Engine โœ…
Category Loading โœ…
State Persistence โš ๏ธ In-conversation only; lost on restart
Quality Evaluation โœ…

Install: Copy skill folder into your project. Add to CLAUDE.md: Read and follow skills/prompt-optimizer/SKILL.md Recommended Mode: Template-first (default), in-conversation state memory. Limitation: Must re-enable ("enable prompt optimizer") each new conversation.


โญโญโญยฝ Cursor

Feature Status
Template Engine โœ… Reads local files
LLM Engine โœ…
Category Loading โœ…
State Persistence โŒ No cross-session persistence
Quality Evaluation โœ…

Install: Copy skill folder into project root. Add to .cursorrules: Read and follow skills/prompt-optimizer/SKILL.md. Activate when user says "enable prompt optimizer". Recommended Mode: Template-first (default). Limitation: Must re-enable each session; manual file copy required.


โญโญโญ Gemini CLI

Feature Status
Template Engine โš ๏ธ Large files (>1MB) may truncate
LLM Engine โœ…
Category Loading โš ๏ธ Small categories recommended
State Persistence โŒ None
Quality Evaluation โœ…

Install: Same as Cursor โ€” place in project, reference in system instructions. Recommended Mode: "set engine to LLM-only" or load small categories only (Tech Tools 36KB, Translation 57KB). Limitation: Free tier context is limited; large JSON may truncate. LLM-only mode recommended.


โญโญโญยฝ Cline / AI Coding Assistants

Feature Status
Template Engine โœ… Reads local files
LLM Engine โœ…
Category Loading โœ…
State Persistence โŒ No cross-session persistence
Quality Evaluation โœ…

Install: Copy skill folder into project. Reference SKILL.md in Cline's custom instructions. Recommended Mode: Template-first (default). Limitation: Must re-enable each session; manual file copy required.


โญโญ ChatGPT Custom GPT

Feature Status
Template Engine โŒ Cannot read JSON files
LLM Engine โœ…
Category Loading โŒ
State Persistence โŒ
Quality Evaluation โš ๏ธ No baseline comparison data

Install: Paste the contents of STANDALONE-GPT.md into your Custom GPT's Instructions. Recommended Mode: LLM-only (the only available mode). Limitation: No template library, no category loading, no persistence. LLM optimization only. โš ๏ธ Use STANDALONE-GPT.md, NOT SKILL.md.


โญโญยฝ Aider

Feature Status
Template Engine โš ๏ธ Can read files but context is tight
LLM Engine โœ…
Category Loading โš ๏ธ Small categories only
State Persistence โŒ
Quality Evaluation โœ…

Install: Place skill folder in project. Reference with --file. Recommended Mode: "set engine to LLM-only" (saves context space). Limitation: Aider is designed for code editing; general chat feels unnatural. System prompt may be too long with SKILL.md added.


๐Ÿ“ฆ Installation Guide

Platform Files to Use How to Install
OpenClaw SKILL.md + all of references/ Place in skills/prompt-optimizer/
Claude Code SKILL.md + all of references/ Copy to project, reference in CLAUDE.md
Cursor SKILL.md + all of references/ Copy to project, reference in .cursorrules
Gemini CLI SKILL.md + small category JSONs Copy to project, reference in system instructions
Cline SKILL.md + all of references/ Copy to project, reference in custom instructions
ChatGPT GPT STANDALONE-GPT.md Paste into Custom GPT Instructions
Aider SKILL.md Copy to project directory

๐ŸŽฏ Default Configuration

Setting Default Options
Engine Template-first + LLM fallback Template-first / LLM-only / Template-only
Library Version Lite (~3MB, truncated at 800 chars) Lite / Full (~10MB)
Category Coding (1,672 prompts, ~1.5MB) Any combination of 14 categories
Output Format Plain text Plain text / Markdown / XML / All
State Off by default, manually enable โ€”

๐Ÿš€ Quick Start

Action Command
Enable "enable prompt optimizer" / "ๅผ€ๅฏๆ็คบ่ฏไผ˜ๅŒ–"
Enable (Full) "enable full version" / "ๅผ€ๅฏๅฎŒๆ•ด็‰ˆๆ็คบ่ฏไผ˜ๅŒ–"
Disable "disable prompt optimizer" / "ๅ…ณ้—ญๆ็คบ่ฏไผ˜ๅŒ–"

Minimal usage:

You: "enable prompt optimizer" (or any language)
You: "optimize this: help me write a login page"
Bot: [outputs optimized prompt]
You: "โœ…"

โš™๏ธ All Configuration Commands

๐ŸŒ All commands accept any language. Just express your intent naturally โ€” the AI will understand.

Engine Mode

Command Behavior
"set engine to template-first" (default) Search template library first; if no match, auto-fallback to LLM
"set engine to LLM-only" Skip template library; host AI optimizes directly
"set engine to template-only" Template library only; tells user if no match found

Template Categories

Command Behavior
"load only coding templates" (default) Loads only ~1.5MB
"load coding + data-analysis" Load multiple categories
"what categories are available" Show all 14 categories
"load all categories" Load complete library
"remove art-entertainment" Remove a loaded category
Category Prompts Size
Coding (default) 1,672 ~1.5MB
Art & Entertainment 404 ~411KB
Other 253 ~202KB
Writing 208 ~196KB
Education 117 ~107KB
Consulting 114 ~115KB
Business 108 ~98KB
Health & Lifestyle 82 ~76KB
Legal & Finance 82 ~80KB
Data Analysis 73 ~73KB
Creative Generation 73 ~66KB
Science & Research 61 ~55KB
Translation 60 ~57KB
Tech Tools 37 ~36KB

Output Format

Command Effect
"set format to plain text" (default) Raw prompt text
"set format to Markdown" Headings, lists, bold formatting
"set format to XML" <prompt><role>...</role></prompt> structure
"set format to all" All three formats side by side

๐Ÿ“‹ Post-Optimization Actions

Reply Action
"โœ…" Confirm and use
"โŒ" Discard; use original input
Free-form feedback Fine-tune (e.g., "add responsive design")
"continue optimizing" Iterate another round
"evaluate" Show before/after quality scores
"change format" Switch output format

๐Ÿ“Š Quality Evaluation

Say "evaluate" (or any equivalent) to trigger a before/after comparison. Scores 1-10 on 5 dimensions:

Dimension What It Measures
goalClarity Is the goal clear and specific?
instructionCompleteness Are instructions complete and unambiguous?
structuralExecutability Can the structure be executed step by step?
ambiguityControl Are vague terms eliminated?
robustness Will it hold up across varied inputs?

Output: Before vs. After scores + total improvement + highlights + remaining gaps.


๐Ÿง  Four Optimization Modes

Mode When What It Does
General (default) Most scenarios Structured Role/Profile/Skills/Rules/Workflows output
Analytical Complex scenarios 8-dimension deep analysis, 5 points per dimension
Iterative Say "continue optimizing" Merges new requirements into existing prompt
User Query Refinement Optimizing user queries Adds clarity, scope, parameters, output format

๐Ÿ”ง Full Workflow

1. Enable โ†’ Detect platform capabilities โ†’ Load defaults
   โ”œโ”€ File system available โ†’ Template engine ready
   โ””โ”€ File system unavailable โ†’ Auto-switch to LLM-only mode
2. User submits prompt
3. Parse intent (goal, domain, role, constraints, complexity)
4. Engine routing:
   โ”œโ”€ Template-first: Search โ†’ Match โ†’ CRAFT output / No match โ†’ LLM fallback
   โ”œโ”€ LLM-only: Meta-prompt generates directly
   โ””โ”€ Template-only: Search โ†’ Match โ†’ output / No match โ†’ notify user
5. Quality enhancement (precise instructions + constraints + examples)
6. Confirm & deliver
7. Optional: Evaluate / Iterate / Fine-tune

๐Ÿ—‚๏ธ Template Library Data

Curated from 7 major repositories, 3,344 prompts total:

Source Description
f/awesome-chatgpt-prompts CSV, 5MB
awesome-chatgpt-prompts (original) CSV format
ai-boost/awesome-prompts 228 high-quality detailed prompts
0xeb/TheBigPromptLibrary 115 system prompts
jamesponddotko/llm-prompts Categorized library
chatgpt-prompts-chinese Chinese prompts
Prompt Garden Community contributions

๐Ÿ“‚ File Structure

prompt-optimizer/
โ”œโ”€โ”€ SKILL.md                          # Core instructions (v4.0, full features)
โ”œโ”€โ”€ STANDALONE-GPT.md                 # ChatGPT Custom GPT lite version
โ”œโ”€โ”€ STANDALONE.md                     # Standalone usage guide
โ”œโ”€โ”€ README.md                         # This file
โ”œโ”€โ”€ references/
โ”‚   โ”œโ”€โ”€ prompt_library_full.json      # Full version (~10MB)
โ”‚   โ”œโ”€โ”€ prompt_library_lite.json      # Lite version (~3MB)
โ”‚   โ””โ”€โ”€ categories/                   # Split by category
โ”‚       โ”œโ”€โ”€ index.json
โ”‚       โ”œโ”€โ”€ coding.json              # Default (coding)
โ”‚       โ””โ”€โ”€ ... (14 categories)
โ””โ”€โ”€ scripts/                          # Build and maintenance scripts

๐Ÿ›ก๏ธ Features

  • Zero API Cost โ€” Host AI optimizes directly, no extra charges
  • Auto Platform Detection โ€” Graceful degradation when file system unavailable
  • Dual Engine โ€” Template library + LLM meta-prompting
  • Category Loading โ€” Load only what you need, save tokens
  • Model-Agnostic โ€” Works with all host AI platforms
  • Bilingual โ€” Chinese input โ†’ Chinese prompt; English โ†’ English
  • Quality Evaluation โ€” 5-dimension scoring
  • Iterative Optimization โ€” Multi-round fine-tuning

About

๐Ÿš€ 2,200+ curated AI prompt templates with auto-optimization. Works with OpenClaw, Claude Code, Cursor, Gemini CLI, and any AI. One command to install.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors