What problem does it solve?
AI agents inevitably make mistakes, leading to delays, rework, and protocol violations. Manually identifying the root cause of these errors and implementing effective, lasting fixes is a time-consuming and complex process that often fails to prevent recurrence. This Skill automates that critical learning loop.
Core Features & Use Cases
- Root Cause Analysis: Systematically investigates agent conversations to pinpoint the "triggering thought" or context leading to a mistake.
- Automated Fixes: Designs and applies preventive measures, such as updating agent prompt templates, clarifying documentation, or creating active validation hooks.
- Reproduction Testing: Critically, it attempts to reproduce the original mistake after applying fixes to verify that the prevention mechanism works, ensuring "AI works, you rest."
- Use Case: An agent repeatedly creates files in the wrong worktree. This Skill analyzes the conversation, identifies the root cause (e.g., ambiguous working directory instructions), creates a
pre-write.sh hook to block future violations, and then attempts to make the same mistake to confirm the hook's effectiveness.
Quick Start
Use the learn-from-mistake skill to analyze the recent error where the 'architect' agent created files in the wrong worktree during the 'implement-formatter-api' task.