
self-improving-agent
Use after a failure, user correction, repeated workflow problem, or validated success reveals a reusable lesson. Captures bounded redacted candidates, runs executable behavior evals, and separates validation from application in durable guidance.
- Installs
- 35.1K
- Last 24h
- +44
- Trending rank
- #3643
- Security
- Fail
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/zhaono1/agent-playbook --skill self-improving-agent- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads self-improving-agent automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
Security audits
Independent scans of the skill's instructions and bundled files.
SKILL.md
The instructions your agent reads when the skill is triggered.
Self-Improving Agent
Turn evidence from completed work into a small, auditable behavior change. The default result is a candidate or no change—not an automatic rewrite of skills.
Use This Skill When
- A tool or workflow failed in a way that may recur.
- The user corrected an assumption, requirement, or operating rule.
- The same workaround appeared more than once.
- A focused test proved a better reusable method.
- The user asks to review or consolidate learning candidates.
Do not use it for routine session summaries, raw transcript storage, speculative ideas without evidence, or project facts that belong in project documentation.
Required Outcome
Every run ends in exactly one state:
candidate: reusable but not yet validated.validated: representative evidence supports the lesson, but no owner change is claimed yet.applied: the validated lesson was installed in one named durable owner with a change reference.rejected: disproved, unsafe, too specific, or obsolete.supersededorrolled_back: an applied/validated lesson was replaced or reverted.no-delta: no reusable behavior change was found.open-question: evidence is insufficient and the missing proof is named.
An artifact is not proof of improvement. An applied lesson must change future behavior and have a representative check that demonstrates the change.
Start Packet
Before editing durable guidance, state:
- Future behavior: what the agent should do differently next time.
- Representative task: one concrete scenario that should now succeed.
- Evidence: current source, failure output, user correction, or focused test.
- Owner: the one skill, instruction file, script, or runtime component that owns it.
- Write boundary: files allowed to change and information that must remain local.
- Proof: the command, eval, or review that confirms the new behavior.
If any item is unknown, capture a candidate and stop before validation or application.
Lifecycle
1. Capture the Signal
Prefer facts over interpretation. Record only the minimum reusable summary; do not copy transcripts, tool inputs, credentials, private paths, or customer data.
Claude Code failure hooks explicitly enabled with apb init --hooks can call:
agent-playbook self-improve
Manual corrections or successes use an explicit summary and evidence label:
apb self-improve capture \
--kind correction \
--summary "Verify the current source before relying on cached state" \
--evidence "focused-test"
The CLI stores redacted events and deduplicated candidates under
~/.agent-playbook/self-improvement/. Override the root with
AGENT_PLAYBOOK_DATA_DIR or --data-dir.
2. Assess Reusability
Keep a candidate only when all are true:
- It describes future behavior, not just what happened.
- It is useful beyond one private task or repository.
- It does not conflict with a current authoritative source.
- A narrow owner and a realistic validation path exist.
Use apb behavior inbox to inspect the prioritized queue. Repeated evidence
increases occurrence count; it does not automatically increase truth. Use
apb behavior owners <candidate-id> --repo . for local suggestions, but treat
every result as a review candidate rather than an ownership decision.
3. Validate
Choose the smallest proof that can falsify the candidate, encode it as an
executable artifact, and run it with apb self-improve eval. See
references/eval-artifact.md for the schema and safety boundary.
| Candidate | Minimum proof |
|---|---|
| Prompt or workflow rule | Representative prompt plus rubric |
| CLI/runtime behavior | Focused automated test |
| External integration | Live capability check against current docs/runtime |
| Safety rule | Negative test showing the unsafe path is blocked |
| Repeated heuristic | Multiple independent episodes or explicit human confirmation |
Separate facts, hypotheses, and missing evidence. Structural validation alone does not prove that guidance is semantically current or executable by the host.
4. Validate, Apply, or Reject
Run the artifact first. A baseline scenario is recommended when the previous behavior can be reproduced safely; at least one candidate scenario is required:
apb self-improve eval cand-123 --artifact behavior-eval.json
apb self-improve review cand-123 \
--decision validate \
--reason "baseline reproduced and candidate scenarios passed" \
--eval-result /path/printed/by/the/eval/command.json
Validation accepts only a passing CLI-generated eval result for the same candidate. It does not claim runtime behavior changed.
Generate a local Behavior Change Proposal before editing the owner:
apb behavior proposal cand-123 \
--owner "skill:self-improving-agent" \
--output behavior-proposal.md
The proposal contains the behavior diff intent, eval proof, acceptance criteria, privacy boundary, and rollback plan. It does not edit the owner or create a remote pull request.
After changing exactly one durable owner, record the application separately:
apb self-improve review cand-123 \
--decision apply \
--reason "installed after the focused test passed" \
--owner "skill:self-improving-agent" \
--change-ref "commit:abc123"
Other decisions:
apb self-improve review cand-123 --decision observe --reason "needs a second episode"
apb self-improve review cand-123 --decision reject --reason "project-specific exception"
Apply into the narrowest owner:
- Executable test, script, or validator when behavior can be enforced.
- The owning skill or its reference when agent judgment is required.
- Project instructions only for project-wide constraints.
- A knowledge notebook for durable facts that should be retrieved, not always loaded.
Never silently modify repository rules, publish packages, or trigger external actions as a side effect of capture.
5. Prove the Loop
Run the representative task after application. Report:
- candidate id and final state;
- evidence used and what remains uncertain;
- durable owner changed;
- executable eval result and artifact hash;
- rollback path.
If the new rule does not change the representative behavior, revert or reject it.
Knowledge Export
Export applied rules and open candidates as Markdown for Obsidian or another local knowledge system:
apb self-improve export --output /path/to/vault/Agent/Learning.md
The export is a sink, not the source of truth. Candidate and active-rule state remain structured and auditable in the CLI data directory.
Host Boundary
Skills describe judgment; host adapters provide events and actions. Check the current host before claiming support:
- Claude Code: deterministic failure hook installed only by explicit
apb init --hooks. - Codex, Gemini, DeepSeek Harness: skill distribution is supported; learning event wiring depends on each host's current extension API.
- Unsupported hooks must remain manual or adapter-specific, never simulated by undocumented behavior.
Use apb conformance to inspect local-static contracts. A proven distribution
or hook configuration does not prove host discovery or runtime invocation; those
remain unverified until an observed host run supplies bounded evidence.
See references/learning-lifecycle.md for schemas and adapter contracts. Use
evals/cases.json with evals/rubric.md when changing this skill.
Done Checklist
- Candidate/no-delta decision is explicit.
- Stored text is minimal, redacted, and portable.
- Current authoritative sources were checked when relevant.
- Validation uses a passing executable eval result for the same candidate.
- Application names one durable owner and a concrete change reference.
- Representative behavior was tested after application.
- No private project detail entered public skill assets.
FAQ
What does the self-improving-agent skill do?
Use after a failure, user correction, repeated workflow problem, or validated success reveals a reusable lesson. Captures bounded redacted candidates, runs executable behavior evals, and separates validation from application in durable guidance.
How do I install self-improving-agent?
Run npx skills add https://github.com/zhaono1/agent-playbook --skill self-improving-agent in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/self-improving-agent/ (personal) or .claude/skills/self-improving-agent/ (project).
Which AI agents can use self-improving-agent?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is self-improving-agent safe to install?
Security partners have reviewed it: Gen Agent Trust Hub flagged risks; Socket passed; Snyk passed; Runlayer flagged items to review. As with any skill, read the SKILL.md and bundled scripts before installing.
Who maintains self-improving-agent?
It is published by zhaono1 in zhaono1/agent-playbook. It has 35,137 recorded installs.
More from zhaono1/agent-playbook
planning-with-files
zhaono1/agent-playbook
Uses persistent markdown files for general planning, progress tracking, and knowledge storage (Manus-style workflow). Use for multi-step tasks, research projects, or general organization WITHOUT mentioning PRD. For PRD-specific work, use prd-planner skill instead.
security-auditor
zhaono1/agent-playbook
Security vulnerability expert covering OWASP Top 10 and common security issues. Use when conducting security audits or reviewing code for vulnerabilities.
architecting-solutions
zhaono1/agent-playbook
Designs technical solutions and architecture. Use when user says "design solution", "architecture design", "technical design", or "方案设计" WITHOUT mentioning PRD. For PRD-specific work, use prd-planner skill instead.
skill-router
zhaono1/agent-playbook
Routes an agent request to the narrowest matching portable skill when the user asks which skill to use or needs help selecting one across supported hosts.
workflow-orchestrator
zhaono1/agent-playbook
Coordinates multi-skill workflows and records or runs follow-up actions when the host runtime supports them. Use when completing PRD creation, implementation, or any milestone that should be evaluated for additional skills.
prd-planner
zhaono1/agent-playbook
Creates PRDs using persistent file-based planning. Use when user explicitly says "PRD", "product requirements document", or "产品需求文档". Combines PRD methodology with planning-with-files to avoid context switching.
Popular ai & agents skills
google-agents-cli-publish
google/agents-cli
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).
google-agents-cli-eval
google/agents-cli
This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).
skill-creator
anthropics/skills
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
codex-pet
prime-skills/runcomfy-agent-skills
Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.
full-output-enforcement
leonxlnx/taste-skill
Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.
executing-plans
obra/superpowers
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available