SuperAPI AI 工具集

retro

智能体与模型

查看项目

更新于 10-16 06:22

技能介绍

用途:把近期工作流执行转成可改进项。当用户要求 retro、事后分析、工作流改进,或希望从智能体错误中学习时使用。

输出:写入 docs/retros/{feature}/{timestamp}.md 与 docs/retros/{feature}/{timestamp}-actions.md。

输入:Pi 会话日志(JSONL,位于 ~/.pi/agent/sessions/.../.jsonl);.orchestration-state.json;.orchestration-logs/**/events.jsonl、stderr.log、validation.phase.json、scope.json;以及 docs/specs/{feature}-spec.md、docs/plans/{feature}.md、docs/tasks/{feature}-phase-.md。

流程:1)确定 feature 与时间范围,优先取 .orchestration-state.json.feature,否则询问用户;时间戳格式 YYYY-MM-DDTHH-mm-ssZ。2)定位相关 Pi 会话日志,查找首行含 "type":"session" 且为项目 cwd 的最新 JSONL。可用 ls -t ~/.pi/agent/sessions/* | head 与 rg -n --fixed-string '"cwd":"' ~/.pi/agent/sessions -S | head。3)提取失败信号:工具失败(tool_execution_end 且 isError=true)、重复重试/auto_retry、合并失败、验证失败。可用 jq -rc 'select(.type=="tool_execution_end" and .isError==true)' session.jsonl | tail -n 50 及 jq -rc 'select(.type=="message_end" and .message.role=="assistant") | .message.content' session.jsonl | tail -n 20。4)与编排产物关联,读取 .orchestration-state.json 中的分支、worktree 路径、运行日志目录、验证报告路径,并检查各阶段 events.jsonl、validation.phase.json、scope.json。5)撰写复盘。主文档含摘要(2-5 条)、时间线、做得好/出问题的部分、前三大失败模式;actions 文档含文档漂移修正(具体文件与改动)、模板修正、自动化缺口及 P0/P1/P2 优先级。6)可选:复杂复盘时启动 agent: session-reviewer,branch: chore/{feature}-retro 来产出上述两份文档。

限制:未经用户确认不得自动应用文档改动;无需守护进程,建议保持在进程内。