What problem does it solve? AI agents fail in opaque ways: they call wrong tools, lose track of goals, or hallucinate information, and you cannot see why. This Skill captures the reasoning traces between every tool call, detects failure patterns like context degradation and tool confusion, and automatically generates improved prompts. ## Core Features & Use Cases - Trace Capture & Analysis: Wrap the MiniMax M2.1 API to record thinking blocks, tool calls, and results, then score reasoning quality and detect patterns such as hallucination, goal abandonment, and circular reasoning. - Automated Optimization Loop: Run capture-analyze-optimize cycles with convergence detection, best-prompt tracking, and prompt growth limits until the agent's score improves. - Skill Generation: Convert optimization learnings into shareable Agent Skills with documented patterns to avoid and recommended practices. - Use Case: Your research agent keeps citing sources that failed to load. Run the optimization loop to capture its reasoning, detect the missing_validation pattern, and produce an improved system prompt that requires explicit source verification. ## Quick Start Ask the agent to debug why your agent task failed by capturing and analyzing its reasoning trace with the reasoning-trace-optimizer.