Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
erichowens avatar

Automatic Stateful Prompt Improver

  • 142 installs
  • 178 repo stars
  • Updated July 14, 2026
  • erichowens/some_claude_skills

Iteratively refine agent prompts across sessions using persisted state, version history, and measured output quality so production instructions keep improving without manual copy-paste.

About

Guides Claude through automatic, stateful prompt improvement for agent workflows in erichowens/some_claude_skills. It stores prior prompt drafts, critiques, and outcomes, then proposes tighter instructions based on observed failures and wins so teams converge on reliable system prompts without ad-hoc editing.

  • Persists prompt versions and evaluation notes across runs
  • Applies structured critique-and-rewrite loops automatically
  • Tracks which prompt variants improved task success
  • Integrates with multi-step agent workflows
  • Reduces manual prompt tuning during feature work

Automatic Stateful Prompt Improver by the numbers

  • 142 all-time installs (skills.sh)
  • Ranked #3,455 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/erichowens/some_claude_skills --skill automatic-stateful-prompt-improver

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs142
repo stars178
Last updatedJuly 14, 2026
Repositoryerichowens/some_claude_skills

What it does

Iteratively refine agent prompts across sessions using persisted state, version history, and measured output quality so production instructions keep improving without manual copy-paste.

Files

SKILL.mdMarkdownGitHub ↗

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. Complex task (multi-step, requires reasoning) 2. Technical output (code, analysis, structured data) 3. Reusable content (system prompts, templates, instructions) 4. Explicit request ("improve", "better", "optimize") 5. Ambiguous requirements (underspecified, multiple interpretations) 6. Precision-critical (code, legal, medical, financial)

Auto-Optimization Process

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

FactorLow (3-5)Medium (5-10)High (10-20)
ComplexitySimpleMulti-stepAgent/pipeline
AmbiguityClearSomeUnderspecified
DomainKnownModerateNovel
StakesLowModerateCritical

Convergence (When to Stop)

  • Improvement < 1% for 3 iterations
  • User satisfied
  • Token budget exhausted
  • 20 iterations reached
  • Validation score > 0.95

Performance Expectations

ScenarioImprovementIterations
Simple task10-20%3-5
Complex reasoning20-40%10-15
Agent/pipeline30-50%15-20
With history+10-15% bonusVaries

Anti-Patterns

Over-Optimization

What it looks likeWhy it's wrong
Prompt becomes overly complex with many constraintsCauses brittleness, model confusion, token waste
Instead: Apply Occam's Razor - simplest sufficient prompt wins

Template Obsession

What it looks likeWhy it's wrong
Focusing on templates rather than task understandingTemplates don't generalize; understanding does
Instead: Focus on WHAT the task requires, not HOW to format it

Iteration Without Measurement

What it looks likeWhy it's wrong
Multiple rewrites without tracking improvementsCan't know if changes help without metrics
Instead: Always define success criteria before optimizing

Ignoring Model Capabilities

What it looks likeWhy it's wrong
Assumes model can't do things it canOver-scaffolding wastes tokens
Instead: Test capabilities before heavy prompting

Reference Files

Load for detailed implementations:

FileContents
references/optimization-techniques.mdAPE, OPRO, CoT, instruction rewriting, constraint engineering
references/learning-architecture.mdWarm start, embedding retrieval, MCP setup, drift detection
references/iteration-strategy.mdDecision matrices, complexity scoring, convergence algorithms

---

Goal: Simplest prompt that achieves the outcome reliably. Optimize for clarity, specificity, and measurable improvement.

Related skills

AI & Agent Buildingagentsllmautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.