Agent skill
self-improvement
Evolutionary mechanisms for the agent to rewrite its own prompts (Neuroplasticity).
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/brain-andreibesleaga-gabbe-5
SKILL.md
Self-Improvement Skill
"The software that writes itself."
1. Evolutionary Prompts (The Genome)
Treat the system_prompt and skill.md files as DNA.
- Genes: Individual instructions (e.g., "Always use TDD").
- Phenotype: The agent's actual behavior in a session.
- Fitness Function: Did the user accept the code? Did the tests pass?
2. The Mutation Cycle
When the agent encounters a novel failure or success:
- Selection: Identify the "Gene" (Prompt Instruction) responsible.
- Mutation: Rewrite the instruction.
- Example: Change "Write clean code" -> "Write clean code adhering to AIRBNB style guiding."
- Crossover: Combine two successful skills into a new hybrid skill.
3. Recursive Self-Editing
The agent has permission to edit its own skill files.
Protocol:
- Trigger: "I keep failing to import this library correctly."
- Analysis: "My knowledge base is outdated."
- Action: calling
replace_file_contentonmy-language.skill.md. - Commit: "Updated skill memory with correct import syntax."
4. Safety Guardrails (Homeostasis)
To prevent "Cancer" (Runaway bad mutations):
- Version Control: All skill edits must be git-committed.
- Revert: If
success_ratedrops after a mutation, auto-revert. - Core Immutable: The "Prime Directives" (Safety, Obedience) cannot be mutated.
5. Implementation
def optimize_prompt(task_history):
# 1. Analyze Failure
failure_pattern = find_pattern(task_history, status="failed")
# 2. Propose Mutation
new_instruction = llm.generate_fix(failure_pattern)
# 3. Simulate (Mental Sandbox)
predicted_success = llm.simulate(new_instruction)
# 4. Integrate
if predicted_success > threshold:
update_skill_file(new_instruction)
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?