/automatic-stateful-prompt-improver:automatic-stateful-prompt-improverfrom automatic-stateful-prompt-improver
Automatically intercepts and optimizes complex prompts using a prompt-learning MCP server with APE, OPRO, and DSPy patterns. Learns from performance over time via embedding-indexed history.
Ships in automatic-stateful-prompt-improver. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
When this skill is active, I MUST follow these rules:
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
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
| 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 |
| 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 |
| What it looks like | Why it's wrong |
|---|---|
| Prompt becomes overly complex with many constraints | Causes brittleness, model confusion, token waste |
| Instead: Apply Occam's Razor - simplest sufficient prompt wins |
| What it looks like | Why it's wrong |
|---|---|
| Focusing on templates rather than task understanding | Templates don't generalize; understanding does |
| Instead: Focus on WHAT the task requires, not HOW to format it |
| What it looks like | Why it's wrong |
|---|---|
| Multiple rewrites without tracking improvements | Can't know if changes help without metrics |
| Instead: Always define success criteria before optimizing |
| What it looks like | Why it's wrong |
|---|---|
| Assumes model can't do things it can | Over-scaffolding wastes tokens |
| Instead: Test capabilities before heavy prompting |
Load for detailed implementations:
| File | Contents |
|---|---|
references/optimization-techniques.md | APE, OPRO, CoT, instruction rewriting, constraint engineering |
references/learning-architecture.md | Warm start, embedding retrieval, MCP setup, drift detection |
references/iteration-strategy.md | Decision matrices, complexity scoring, convergence algorithms |
Goal: Simplest prompt that achieves the outcome reliably. Optimize for clarity, specificity, and measurable improvement.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
prompt-optimization, prompt-engineering, dspy, ape, opro, embedding-history
npx claudepluginhub curiositech/some_claude_skills --plugin automatic-stateful-prompt-improverOther plugins' skills for the same job