Answers from the documentation; checking which model is on duty
Hi - I answer from the OpenSmartRoute documentation: routing, the API, plans and quotas, self-hosting. Ask away, or open a support ticket if you need a person.
Grounded in the docs - follow a source before acting on it.
Automatically intercepts and optimizes prompts using the prompt-learning MCP server. Learns from performance over time via embedding-indexed history. Uses APE, OPRO, DSPy patterns. Activate on "optimi
Imported from curiositech/some_claude_skills (.claude/skills/automatic-stateful-prompt-improver/SKILL.md). Install upstream with npx skills add curiositech/some_claude_skills --skill automatic-stateful-prompt-improver. Copyright stays with the author.
Automatic Stateful Prompt Improver
MANDATORY AUTOMATIC BEHAVIOR
When this skill is active, I MUST follow these rules:
Auto-Optimization Triggers
I AUTOMATICALLY call mcp__prompt-learning__optimize_prompt BEFORE responding when:
1. INTERCEPT the user's request
2. CALL: mcp__prompt-learning__optimize_prompt
- prompt: [user's original request]
- domain: [inferred domain]
- max_iterations: [3-20 based on complexity]
3. RECEIVE: optimized prompt + improvement details
4. INFORM user briefly: "I've refined your request for [reason]"
5. PROCEED with the OPTIMIZED version
Do NOT Optimize
Simple questions ("what is X?")
Direct commands ("run npm install")
Conversational responses ("hello", "thanks")
File operations without reasoning
Already-optimized prompts
Learning Loop (Post-Response)
After completing ANY significant task:
1. ASSESS: Did the response achieve the goal?
2. CALL: mcp__prompt-learning__record_feedback
- prompt_id: [from optimization response]
- success: [true/false]
- quality_score: [0.0-1.0]
3. This enables future retrievals to learn from outcomes
Quick Reference
Iteration Decision
Factor
Low (3-5)
Medium (5-10)
High (10-20)
Complexity
Simple
Multi-step
Agent/pipeline
Ambiguity
Clear
Some
Underspecified
Domain
Known
Moderate
Novel
Stakes
Low
Moderate
Critical
Convergence (When to Stop)
Improvement < 1% for 3 iterations
User satisfied
Token budget exhausted
20 iterations reached
Validation score > 0.95
Performance Expectations
Scenario
Improvement
Iterations
Simple task
10-20%
3-5
Complex reasoning
20-40%
10-15
Agent/pipeline
30-50%
15-20
With history
+10-15% bonus
Varies
Anti-Patterns
Over-Optimization
What it looks like
Why it's wrong
Prompt becomes overly complex with many constraints
Goal: Simplest prompt that achieves the outcome reliably. Optimize for clarity, specificity, and measurable improvement.
Installed into a catalogue, chosen by a router
Install automatic-stateful-prompt-improver and it becomes one more candidate the router can pick - when it fits.
A listing is a routing target with a manifest: what it does, which domains it covers, what it costs and who publishes it. Once installed it sits beside your own models and tools, is scored like any other candidate for each request, and shows up in the trace when it wins. Ratings come from workspaces that installed it, one per account.
When a provider is down or over quota the request moves on; the trace says it did.
Use it
Copy one of these into your project. Installing also returns the manifest and these snippets.
# after Install: the listing is in your workspace's routing pool - a plan picks it for its slotcurl-s-X POST https://api.opensmartroute.ai/api/v1/route -H 'Authorization: Bearer $OSR_API_KEY' -H 'Content-Type: application/json' -d '{"text": "...", "plan": true}'
Manifest
An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.