Recursive prompt improvement with real LLM integration
Transform AI outputs from good to great through recursive improvement
A real, working meta-prompting engine that recursively improves LLM outputs by:
- Calling the LLM with an initial prompt
- Extracting patterns and context from the response
- Generating an improved prompt using that context
- Repeating until quality threshold met
Not a simulation. Real Claude API calls with measurable improvements.
- Recursive Improvement Loop - Automatic prompt refinement based on extracted context
- Complexity-Adaptive Strategies - Simple/Medium/Complex task routing
- Real Claude API Integration - Production-ready with token tracking
- Quality Threshold Control - Stop when target quality reached
- Claude Code Plugin - Install as skills, agents, and workflows
- Full Transparency - View all API calls in
call_history
From our latest test with real Claude Sonnet 4.5:
Task: "Write function to find max number in list with error handling"
6 real API calls | 3,998 tokens | 89.7 seconds
- 2 complete iterations with context extraction
- Production-ready code with comprehensive error handling
- Full test suite included
- Two implementation variants (strict + lenient)
Typical improvement: 15-20% quality gain across iterations.
git clone https://github.com/manutej/meta-prompting-framework.git
cd meta-prompting-framework
./install-plugin.sh
export ANTHROPIC_API_KEY=sk-ant-your-key-heregit clone https://github.com/manutej/meta-prompting-framework.git
cd meta-prompting-framework
pip install -r requirements.txtfrom meta_prompting_engine.llm_clients.claude import ClaudeClient
from meta_prompting_engine.core import MetaPromptingEngine
engine = MetaPromptingEngine(ClaudeClient(api_key="your-key"))
result = engine.execute_with_meta_prompting(
skill="python-programmer",
task="Create a function to validate email addresses",
max_iterations=3,
quality_threshold=0.90
)
print(f"Quality: {result.quality_score:.2f}")See docs/QUICKSTART.md for detailed setup instructions.
| Complexity | Strategy | Approach |
|---|---|---|
| < 0.3 (Simple) | Direct Execution | Single-pass with clear reasoning |
| 0.3-0.7 (Medium) | Multi-Approach | Generate 2-3 approaches, evaluate, choose best |
| > 0.7 (Complex) | Autonomous Evolution | Hypothesize, test, refine iteratively |
The engine extracts patterns, requirements, and success indicators from each iteration to build progressively better prompts.
| Document | Description |
|---|---|
| QUICKSTART.md | 5-minute setup guide |
| INSTALL.md | Detailed installation options |
| PLUGIN_README.md | Claude Code plugin documentation |
| QUICK_REFERENCE.md | API reference card |
| CHANGELOG.md | Version history |
docs/guides/- Integration guides and workflow patternsdocs/research/- Research synthesis and referencesdocs/internal/- Implementation plans and summaries
meta_prompting_engine/
core.py # MetaPromptingEngine - recursive loop
complexity.py # ComplexityAnalyzer - 0.0-1.0 scoring
extraction.py # ContextExtractor - 7-phase extraction
llm_clients/
base.py # Abstract interface
claude.py # Claude Sonnet integration
# Validate without API key (uses mocks)
python3 validate_implementation.py
# Test with real Claude API
python3 test_real_api.py
# Show actual Claude responses
python3 show_claude_responses.pyMIT - see LICENSE file
- Issues: GitHub Issues
- Docs: See docs/ directory
Built with real meta-prompting, not simulations.
Recursive improvement for better AI outputs.