# Learning Adaptation

> Learning Adaptation is an Agent Skill for agent building published in the majiayu000/claude-skill-registry repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Mechanisms for In-Context Reinforcement Learning, Meta-Learning, and Neuroplasticity.

- Skill name: `learning-adaptation`
- Category: [Agent Building](https://www.openparable.com/skill/agent-building/1)
- Source: https://github.com/majiayu000/claude-skill-registry/blob/HEAD/skills/ai-llm/brain-andreibesleaga-gabbe/SKILL.md
- Repository: majiayu000/claude-skill-registry (498 GitHub stars when collected)

## SKILL.md

# Learning & Adaptation Skill

> "Neurons that fire together, wire together." (Hebbian Learning)

## 1. Synaptic Plasticity (Rewiring)
This skill allows the system to "rewire" itself based on experience.
- **Potentiation (Strengthening):** If a prompt/tool works well, save it to a "Best Practices" bank.
- **Depression (Weakening):** If a tool fails often, add a warning or deprecate it.

## 2. Meta-Learning (Learning to Learn)
The agent should not just learn *information*; it should learn *strategies*.

### Strategy Reflection Loop
After a task is complete, perform a "Post-Mortem":
1.  **Observation:** "I hallucinated a library name."
2.  **Hypothesis:** "I didn't check the docs first."
3.  **New Rule:** ("ALWAYS check docs for library imports.")
4.  **Storage:** Save to `system_rules.md`.

## 3. Reinforcement Learning (RL) Integration
- **Actor:** The Agent performing the task.
- **Critic:** A separate module (or human) that scores the outcome (Reward).
- **Policy Update:** Update the **Few-Shot Context**.
    - *Old:* Zero-shot prompt.
    - *New:* Prompt + 3 Successful Examples from `learning-adaptation` bank.

## 4. Episodic Consolidation (Dreaming)
Biological brains consolidate short-term memories into long-term structures during sleep.

### Implementation: The "Nightly Build"
1.  **Compress:** Run a summarization job on the day's logs.
2.  **Extract:** Extract key facts and successful code patterns.
3.  **Consolidate:** Update the Knowledge Graph and clear the raw logs.

## References
- **Sutton, R. S., & Barto, A. G.** (2018). *Reinforcement Learning: An Introduction*.
- **Hebb, D. O.** (1949). *The Organization of Behavior*.

---

Source: https://www.openparable.com/skill/agent-building/learning-adaptation (OpenParable). Cite the canonical URL above.
