Meta prompting

From Miosa-osa/canopy · View interactive version

Meta prompting is an AI agent skill from the GitHub repository Miosa-osa/canopy. Self-improving prompts through meta-level optimization

How to use this skill

Skill file

Meta-Prompting Skill

Uses the LLM to optimize its own prompts for better results.

Core Concept

Meta-prompting treats the LLM as both:

  1. Executor: Runs the actual task
  2. Optimizer: Improves the prompt for next iteration

When to Use

Meta-Prompt Structure

You are a prompt optimization expert.

ORIGINAL PROMPT:
{original_prompt}

RESULT QUALITY: {quality_score}/10
ISSUES IDENTIFIED:
{issues}

Generate an improved version of this prompt that:
1. Addresses the identified issues
2. Maintains the core intent
3. Adds clarity where needed
4. Includes examples if helpful

IMPROVED PROMPT:

Optimization Dimensions

1. Clarity Enhancement

2. Example Addition

3. Instruction Refinement

4. Context Optimization

Iterative Improvement Loop

Round 1: Execute original prompt
         ↓
         Score result (0-10)
         ↓
Round 2: Meta-optimize prompt
         ↓
         Execute improved prompt
         ↓
         Score result
         ↓
         If improved: Save as new baseline
         If not: Revert or try different optimization
         ↓
Repeat until convergence or max iterations (3-5)

Prompt Scoring Criteria

| Dimension | Weight | Evaluation |

|-----------|--------|------------|

| Correctness | 40% | Does output match expected? |

| Completeness | 25% | All requirements addressed? |

| Clarity | 20% | Output is clear and useful? |

| Efficiency | 15% | Minimal tokens for result? |

Meta-Prompt Templates

For Task Prompts

Analyze this task prompt and suggest 3 improvements:
{prompt}

Consider:
- Is the goal clear?
- Are constraints explicit?
- Would examples help?
- Is the format specified?

For System Prompts

Review this system prompt for an AI assistant:
{prompt}

Optimize for:
- Role clarity
- Behavioral consistency
- Edge case handling
- Output quality

For Chain-of-Thought

This CoT prompt produces inconsistent reasoning:
{prompt}

Restructure to:
- Guide step-by-step thinking
- Include verification steps
- Handle common errors

Storing Optimized Prompts

Save successful prompts to the skill library:

{
  "task_type": "code_review",
  "original_prompt": "...",
  "optimized_prompt": "...",
  "improvement": "+2.3 quality score",
  "iterations": 3,
  "date": "2026-01-26"
}

Integration


Reference: "Large Language Models as Optimizers" (OPRO, 2023)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.