[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FDFQNQZFTQ82PQJTGSDB0K":3,"skill-same:01M6FDFQNQZFTQ82PQJTGSDB0K":52},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":25,"linkOnly":26,"markdownContent":27,"markdownBody":27,"frontMatter":28,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":34,"ownerHtmlUrl":35,"ownerBlogUrl":6,"ownerDescription":36,"updatedAt":37,"install":38,"resources":51},"01M6FDFQNQZFTQ82PQJTGSDB0K","interleaved-thinking",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",66,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fmuratcankoylan\u002FAgent-Skills-for-Context-Engineering\u002Finterleaved-thinking\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[23,24],"thinking","interleaved thinking","2026-11-10 10:12:30",false,"# Reasoning Trace Optimizer\n\nDebug and optimize AI agents by analyzing their reasoning traces. This skill uses MiniMax M2.1's interleaved thinking to provide deep insight into agent decision-making and generate concrete improvements.\n\n## When to Activate\n\n- User asks to \"debug agent\", \"analyze reasoning\", or \"optimize prompt\"\n- Agent task fails and user wants to understand why\n- User mentions \"context degradation\", \"tool confusion\", or \"instruction drift\"\n- Request to improve agent performance or reduce errors\n- User wants to generate shareable learnings from debugging sessions\n- After repeated failures on similar tasks\n\n## Core Concepts\n\n### Interleaved Thinking\n\nUnlike standard reasoning models that think once at the start, interleaved thinking allows reasoning BETWEEN each tool interaction. This is critical because:\n\n1. **Long-horizon tasks** require maintaining focus across many turns\n2. **External perturbations** (tool outputs, environment changes) need real-time adaptation\n3. **Debugging** requires seeing HOW decisions were made, not just WHAT was output\n\n### The Optimization Loop\n\n```\nExecute Agent → Capture Traces → Analyze Patterns → Optimize Prompt → Re-run\n                                                          ↑____________|\n```\n\nEach iteration improves the prompt based on detected patterns until convergence.\n\n### Pattern Detection\n\nCommon failure patterns the analyzer detects:\n\n| Pattern | Description |\n|---------|-------------|\n| `context_degradation` | Model loses track of information over long contexts |\n| `tool_confusion` | Model misunderstands tool capabilities or outputs |\n| `instruction_drift` | Model gradually deviates from original instructions |\n| `goal_abandonment` | Model stops pursuing the original goal |\n| `circular_reasoning` | Model repeats similar actions without progress |\n| `premature_conclusion` | Model concludes before completing the task |\n\n## Usage Modes\n\n### Mode 1: M2.1 Agent Debugging\n\nRun a task through M2.1 and analyze its reasoning:\n\n```python\nfrom reasoning_trace_optimizer import TraceCapture, TraceAnalyzer\n\ncapture = TraceCapture()\ntrace = capture.run(\n    task=\"Search for Python tutorials and summarize them\",\n    system_prompt=\"You are a research assistant.\",\n    tools=[search_tool],\n    tool_executor=execute_search\n)\n\nanalyzer = TraceAnalyzer()\nanalysis = analyzer.analyze(trace)\n\nprint(f\"Score: {analysis.overall_score}\u002F100\")\nfor pattern in analysis.patterns:\n    print(f\"Found: {pattern.type.value} - {pattern.suggestion}\")\n```\n\n### Mode 2: Full Optimization Loop\n\nAutomatically iterate until the prompt is optimized:\n\n```python\nfrom reasoning_trace_optimizer import OptimizationLoop, LoopConfig\n\nconfig = LoopConfig(\n    max_iterations=5,\n    min_score_threshold=80.0,\n)\n\nloop = OptimizationLoop(config=config)\nresult = loop.run(\n    task=\"Analyze this codebase and suggest improvements\",\n    initial_prompt=\"You are a code reviewer.\",\n    tools=[read_file_tool, search_tool],\n    tool_executor=execute_tool\n)\n\nprint(f\"Improved: {result.initial_score} → {result.final_score}\")\nprint(f\"Final prompt:\\n{result.final_prompt}\")\n```\n\n### Mode 3: Universal Session Analysis\n\nAnalyze any agent's previous thinking (works with Claude, GPT, etc.):\n\nWhen this skill is activated in Claude Code, it can analyze the current session's thinking blocks to identify issues and suggest improvements.\n\n```\n\u002Freasoning-trace-optimizer analyze-session\n```\n\n### Mode 4: Generate Shareable Skills\n\nConvert optimization learnings into reusable Agent Skills:\n\n```python\nfrom reasoning_trace_optimizer import SkillGenerator\n\ngenerator = SkillGenerator()\nskill_path = generator.generate(\n    result=loop_result,\n    skill_name=\"web-search-best-practices\",\n    output_dir=\".\u002Fskills\"\n)\n```\n\n## CLI Commands\n\n```bash\n# Capture reasoning trace\nrto capture \"Search for Python tutorials\" -s \"You are a helpful assistant.\"\n\n# Analyze a task\nrto analyze \"Debug this code\" -o analysis.txt\n\n# Run optimization loop\nrto optimize \"Research AI papers\" --max-iterations 5 --generate-skill\n\n# Generate skill from artifacts\nrto generate-skill my-skill-name --artifacts-dir .\u002Foptimization_artifacts\n```\n\n## Integration with Claude Code\n\n### Auto-trigger on Failure\n\nAdd to your hooks to automatically analyze failures:\n\n```json\n{\n  \"hooks\": {\n    \"post_tool_error\": {\n      \"command\": \"rto analyze-session --last-error\"\n    }\n  }\n}\n```\n\n### On-demand Analysis\n\nUse the slash command to analyze current session:\n\n```\n\u002Freasoning-trace-optimizer\n```\n\nThis will:\n1. Extract thinking blocks from the current session\n2. Identify patterns and issues\n3. Suggest prompt improvements\n4. Optionally update the system prompt\n\n## Guidelines\n\n1. **Preserve full context**: M2.1 requires full response history including thinking blocks for optimal performance\n2. **Use appropriate tools**: Define tools clearly with unambiguous descriptions\n3. **Set realistic convergence thresholds**: 5-10% improvement per iteration is typical\n4. **Review generated skills**: Auto-generated skills should be reviewed before sharing\n5. **Monitor token usage**: Each optimization iteration uses significant tokens\n\n## Examples\n\n### Before Optimization\n\n```\nSystem: You are a helpful assistant.\n\nIssue: Agent called wrong tools, lost track of goal after 3 turns\nScore: 45\u002F100\nPatterns: tool_confusion, goal_abandonment\n```\n\n### After Optimization\n\n```\nSystem: You are a research assistant focused on finding accurate information.\n\nIMPORTANT GUIDELINES:\n- Always verify search results before summarizing\n- If a tool returns an error, try an alternative approach\n- Keep track of your original goal throughout the task\n- Validate findings against multiple sources when possible\n\nIssue: None\nScore: 85\u002F100\nPatterns: None detected\n```\n\n## References\n\n- MiniMax M2.1 Documentation: https:\u002F\u002Fplatform.minimax.io\u002Fdocs\n- Interleaved Thinking Guide: See `docs\u002Finterleavedthinking.md`\n- Agent Generalization: See `docs\u002Fagentthinking.md`\n\n---\n\n## Skill Metadata\n\n**Created**: 2025-01-11\n**Author**: Muratcan Koylan\n**Version**: 0.1.0\n**Powered by**: MiniMax M2.1\n**Partnership**: Built in collaboration with MiniMax AI\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fmuratcankoylan\u002FAgent-Skills-for-Context-Engineering\u002Finterleaved-thinking",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill interleaved-thinking",{"tool":44,"command":45},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill interleaved-thinking",{"tool":47,"command":48},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill interleaved-thinking","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fmuratcankoylan\u002FAgent-Skills-for-Context-Engineering\u002Finterleaved-thinking\u002FSKILL.md",true,[],[53,63,73,82,88,95],{"skillNo":54,"name":55,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":59,"publishedAt":25},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[58],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[60,61,62],"model","model hierarchy","model hierarchy skill",{"skillNo":64,"name":65,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":69,"publishedAt":25},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[68],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[70,71,72],"MCP","zoom","zoom mcp",{"skillNo":74,"name":75,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":25},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[79,80,81,71],"sdk","zoom apps sdk","apps",{"skillNo":83,"name":84,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":25},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[84],{"skillNo":89,"name":90,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":94,"publishedAt":25},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[93],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[90],{"skillNo":96,"name":97,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":25},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[97]]