chucksrq/awesome-hermes-skills/agentic-self-improvement
Claude Code and agent skill by chucksrq/awesome-hermes-skills
- community
Checking that the SKILL.md file is still in the repository.
Run behavioral benchmarks against the agent, detect failure patterns, generate guidance patches, apply them with auto-revert safety net. Implements the closed-loop self-improvement cycle from Hermes PR #6120, extended with GEPA-style evolutionary optimization and session mining.
Install
npx vskill@latest install chucksrq/awesome-hermes-skills/agentic-self-improvementSKILL.md
Agentic Self-Improvement Loop
Behavioral benchmarking + evolutionary self-improvement for Hermes Agent. Combines closed-loop guidance patching (from Hermes PR #6120) with the GEPA optimization framework from hermes-agent-self-evolution (NousResearch, MIT).
Core Loop
Two modes operate together:
- Guidance Patch Loop — fast, surgical, targets specific behavioral failures via guidance blocks
- Evolutionary Optimization Loop — principled, uses GEPA + DSPy to optimize skill text end-to-end
Part 1: Guidance Patch Loop
Core Loop
Usage
Options
| Flag | Default | Description | |
|---|---|---|---|
--mode | suggest | suggest (show diff only) or apply (apply + verify) | |
--benchmarks | all | Benchmark YAML file(s) to run | |
--categories | all | Run only specific categories (by filename without .yaml) | |
--model | current | Model to benchmark | |
--parallel | 4 | Number of parallel prompt executions | |
--view-results | none | Show a past run's results | |
--revert | false | Revert the last applied patch |
Benchmark Categories
| Category | File | What it tests | |
|---|---|---|---|
mandatory_tool | BENCHMARKS/mandatory_tool.yaml | Must use tools for math/hashes/time/files | |
act_dont_ask | BENCHMARKS/act_dont_ask.yaml | Act on obvious interpretation, don't ask | |
no_hallucination | BENCHMARKS/no_hallucination.yaml | Check system, don't answer from profile/memory | |
verification | BENCHMARKS/verification.yaml | Verify outputs before finalizing | |
prerequisite | BENCHMARKS/prerequisite.yaml | Discover before acting | |
path_accuracy | BENCHMARKS/path_accuracy.yaml | Verify paths before using | |
context_grounding | BENCHMARKS/context_grounding.yaml | Check actual context, don't assume | |
auth_state | BENCHMARKS/auth_state.yaml | Verify credentials before using them | |
remember_to_obsidian | BENCHMARKS/remember_to_obsidian.yaml | Write durable facts to Obsidian, not just memory tool |
How the Guidance Patch Loop Works
1. Benchmark Runner
Each prompt runs in isolation via hermes chat --model <model> -q QUERY -Q as a subprocess. Captures:
- Tool calls made (detected as "preparing X..." text previews in quiet mode)
- Tool outputs
- Final response text
- Exit code
2. Failure Analyzer
Groups failures by category, computes per-category pass rates, extracts failure examples.
3. Patch Generator
Generates XML guidance blocks for the relevant model type:
- OpenAI/GPT/Codex →
OPENAI_MODEL_EXECUTION_GUIDANCE - Anthropic/Claude →
ANTHROPIC_MODEL_EXECUTION_GUIDANCE - Google/Gemini →
GEMINI_MODEL_EXECUTION_GUIDANCE - MiniMax →
MINIMAX_MODEL_EXECUTION_GUIDANCE
4. Apply + Verify + Auto-Revert
Suggest mode: Shows the diff, writes to ~/.hermes/self-improvement/proposed_patches/<run_id>.diff
Apply mode:
- Run baseline benchmarks → capture pass rates
- Backup
prompt_builder.pyto~/.hermes/self-improvement/backups/<timestamp>/ - Apply patch to relevant GUIDANCE constant
- Re-run benchmarks → compare pass rates
- If ANY category regresses → auto-revert to backup
- If all improve → keep patch, report delta
Output Locations
| What | Where | |
|---|---|---|
| Benchmark results | ~/.hermes/self-improvement/results/<run_id>/ | |
| Proposed patches | ~/.hermes/self-improvement/proposed_patches/<run_id>.diff | |
| Backups | ~/.hermes/self-improvement/backups/<timestamp>/ | |
| Logs | ~/.hermes/logs/ |
Part 2: Session Pattern Mining
Extract behavioral failure patterns from conversation history and convert them into concrete, actionable test cases.
When to Use
- Designing benchmarks for a self-improvement loop
- Finding recurring mistakes to address in skills or system prompts
- Building a behavioral test suite for an agent's capabilities
- Reviewing past sessions for systematic failures vs one-off errors
The Process
1. Search Broadly, Then Narrow
2. Extract the Failure Narrative
For each relevant session:
- What was the task? (the user's request)
- What went wrong? (the failure)
- What was the root cause? (why it failed)
- What category does it belong to? (see Categories below)
3. Categorize Failures
| Category | What it means | Signs in session | |
|---|---|---|---|
mandatory_tool | Model computed/guessed instead of using a tool | Mental math in response, hashes from training data | |
act_dont_ask | Model asked for clarification on obvious cases | "Should I do X or Y?" when X was clearly correct | |
no_hallucination | Model answered from memory/profile instead of checking | User profile substituted for system reality | |
verification | Model finalized without checking output | Responded to empty pages, wrong files, failed commands | |
prerequisite | Model started task without discovery steps | Tried to use a file/path without checking if it existed | |
path_accuracy | Model assumed paths without verification | FileNotFoundError in logs, "does ~/.X exist?" when it didn't | |
context_grounding | Model answered from wrong context | Wrong directory, wrong git branch, wrong session state | |
auth_state | Model tried to use credentials/files without checking validity | 403/401 errors from unverified tokens |
4. Convert Failures to Benchmark Prompts
Validator types:
tool_used— model must call a specific tooloutput_contains— tool output must contain expected stringrefused— model must refuse to answer (not enough context)exit_code— command must exit with specific codeerror_in_output— model must report an error it detectedcommand_contains— response or tool outputs contain specific stringsnon_empty_or_explicit_not_found— non-empty response or explicit not-foundtwo_step/sequence— multi-step (tool use demonstrates it)
5. Group Into Benchmark Sets
Cluster prompts by category. A complete benchmark set should have:
- 4-10 prompts per category
- Varied phrasings (don't make the expected action obvious)
- At least one negative example (task that should NOT use a tool)
Session Search Tips
- Search for the fix, not the failure — sessions that end with "fixed" often document what broke first
- Check session summaries first —
session_searchreturns LLM-generated summaries that surface failures efficiently - Look at truncated sessions — sessions that were "cut off" mid-investigation often reveal root causes
- Cross-reference with logs —
~/.hermes/logs/errors.logoften has the raw error that sessions later explained
Output Location
Save mined patterns to <obsidian-vault>/03-Notes/session-patterns/<YYYY-MM-DD>.md so they're preserved in long-term memory alongside other session research.
Part 3: Evolutionary Optimization (from hermes-agent-self-evolution)
The full GEPA + DSPy optimization framework from NousResearch/hermes-agent-self-evolution.
What Can Be Optimized — The Tier System
| Tier | Target | Risk | Status | |
|---|---|---|---|---|
| Tier 1 | Skill files (SKILL.md) | Low | Highest value, lowest risk | |
| Tier 2 | Tool descriptions | Low-Medium | Medium value, schema must stay frozen | |
| Tier 3 | System prompt sections | High | High value, must stay within 20% size budget | |
| Tier 4 | Tool implementation code | Highest | Darwinian Evolver, strictest guardrails |
Tier 1 is the primary target for self-improvement — skills are pure text, easily mutated, directly measurable.
The Optimization Loop (GEPA Framework)
Evaluation Dataset Sources (in priority order)
Source A: SessionDB mining (real usage, LLM-as-judge scored)
- Query SessionDB for sessions where the skill was loaded
- Extract the task the user gave and the agent's full response
- Use LLM-as-judge to score each (task, response) pair on a rubric
- High-scoring pairs → "good" examples; low-scoring → failure cases for GEPA
Source B: Synthetic generation (bootstrapping)
- Use a strong model (Claude Opus) to generate 15-30 test cases
- Read the skill file → understand what it does
- Generate (task_input, expected_behavior) pairs
- GEPA works with as few as 3 examples, so start small
Source C: Hand-curated golden sets
- Manually written test cases with expected outputs
- Highest quality signal but requires manual effort
- Reserve for critical skills
LLM-as-Judge Scoring (Multi-Dimensional Rubrics)
For most skills, there's no binary right/wrong — quality is subjective. Use an LLM judge with a rubric:
- Did the agent follow the skill's procedure? (0-1)
- Was the output correct/useful? (0-1)
- Was it concise (within token budget)? (0-1)
- Did it avoid the known failure modes? (0-1)
Aggregate into a composite score.
Constraint Gates (must pass before any change is valid)
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingagentic-self-improvement/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/chucksrq/awesome-hermes-skills/agentic-self-improvement)