retro

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Session Retrospective

会话回顾

Adaptive end-of-session review. Light by default, deep on request. Produces
retro.md
alongside
plan.md
and
lessons.md
in the session's prompt-logs directory.
自适应的会话结束复盘。默认轻量化,可按需切换深度模式。 会在会话的prompt-logs目录下生成
retro.md
,同时与
plan.md
lessons.md
放在一起。

Invocation

调用方式

text
/retro [path]            # adaptive (light by default)
/retro --deep [path]     # full analysis with expert lens
  • path
    : optional override for output directory
  • --deep
    : force full 7-section analysis (expert lens, learning resources, web search)
text
/retro [path]            # 自适应模式(默认轻量化)
/retro --deep [path]     # 启用专家视角的全面分析
  • path
    :可选参数,用于覆盖输出目录
  • --deep
    :强制启用包含7个板块的深度分析(含专家视角、学习资源、网页搜索)

Workflow

工作流程

1. Locate Output Directory

1. 确定输出目录

Resolution order:
  1. If
    [path]
    argument provided, use it
  2. Scan session for
    prompt-logs/
    paths already used (plan.md, lessons.md writes)
  3. List
    prompt-logs/
    dirs matching today's date (
    {YYMMDD}-*
    )
  4. If ambiguous, AskUserQuestion with candidates
  5. If none exist, create
    prompt-logs/{YYMMDD}-{NN}-{title}/
    (date via
    date +%y%m%d
    ; NN = next sequence number from existing dirs)
优先级顺序:
  1. 如果提供了
    [path]
    参数,则使用该路径
  2. 扫描会话中已使用的
    prompt-logs/
    路径(即写入过plan.md、lessons.md的路径)
  3. 列出与今日日期匹配的
    prompt-logs/
    目录(格式为
    {YYMMDD}-*
  4. 如果存在多个候选路径,向用户询问选择
  5. 如果不存在任何相关目录,则创建
    prompt-logs/{YYMMDD}-{NN}-{title}/
    (日期通过
    date +%y%m%d
    获取;NN为现有目录的下一个序列号)

2. Read Existing Artifacts

2. 读取已有文档

Read
plan.md
,
lessons.md
(if they exist in target dir),
CLAUDE.md
from project root, and project context document (e.g.
docs/project-context.md
) — to understand session goals and avoid duplicating content.
读取目标目录中的
plan.md
lessons.md
(如果存在)、项目根目录下的
CLAUDE.md
,以及项目上下文文档(如
docs/project-context.md
)——以理解会话目标,避免内容重复。

3. Select Mode

3. 选择模式

Parse the
--deep
flag from the invocation arguments.
If
--deep
is present
: mode = deep (full 7 sections).
If
--deep
is absent
: assess session weight to decide mode:
  • Light (Sections 1-4 + 7): Session < 3 turns, OR routine/simple tasks (config changes, small fixes, doc edits)
  • Deep suggestion: Session has non-trivial architectural decisions, complex debugging, or multi-step implementations → output sections 1-4 + 7 in light mode, but append a note: "This session had significant decisions. Run
    /retro --deep
    for expert analysis and learning resources."
  • Default bias: Light. When in doubt, choose light (fast, low cost).
解析调用参数中的
--deep
标志。
如果存在
--deep
:模式为深度模式(完整7个板块)。
如果不存在
--deep
:评估会话权重以决定模式:
  • 轻量化模式(板块1-4 + 7):会话交互少于3轮,或者是常规/简单任务(配置修改、小修复、文档编辑)
  • 建议切换深度模式:会话包含非琐碎的架构决策、复杂调试或多步骤实现→在轻量化模式下输出板块1-4 +7,并附加提示:“本次会话包含重要决策。运行
    /retro --deep
    获取专家分析和学习资源。”
  • 默认倾向:轻量化模式。存疑时选择轻量化(快速、低成本)。

4. Draft Retro

4. 起草回顾文档

Analyze the full conversation to produce the retro sections. Draft everything internally before writing to file.
分析完整会话内容以生成各板块内容。在写入文件前先完成内部起草。

Section 1: Context Worth Remembering

板块1:值得留存的上下文

User, org, and project facts useful for future sessions: domain knowledge, tech stack, conventions, team structure, decision-making patterns. Only genuinely useful items.
对未来会话有用的用户、组织和项目信息:领域知识、技术栈、约定、团队结构、决策模式。仅保留真正有价值的内容。

Section 2: Collaboration Preferences

板块2:协作偏好

Work style and communication observations; compare against current CLAUDE.md. If warranted, draft
### Suggested CLAUDE.md Updates
as a bullet list (omit if none). Right-placement check: if a learning belongs to a doc that CLAUDE.md already references, suggest updating that doc instead.
工作风格和沟通方式的观察结果;与当前的CLAUDE.md进行对比。如果有必要,起草
### 建议的CLAUDE.md更新
作为项目符号列表(若无则省略)。正确位置检查:如果某个经验属于CLAUDE.md已引用的文档,则建议更新该文档而非CLAUDE.md。

Section 3: Waste Reduction

板块3:减少浪费

Identify all forms of wasted effort in the session. Broader than prompting habits — covers the full spectrum of inefficiency:
  • Wasted turns: Misunderstandings, wrong assumptions, rework
  • Over-engineering: Unnecessary complexity, premature abstractions
  • Missed shortcuts: Existing tools/patterns/code that could have been used
  • Context waste: Large file reads, redundant searches, information not reused
  • Communication waste: Ambiguous instructions that caused wrong-direction work
Format: free-form analysis citing specific session moments. No table required. Frame constructively with actionable suggestions.
Root cause drill-down (5 Whys): For each significant waste item, don't stop at the symptom. Ask "why did this happen?" repeatedly until you reach a structural or systemic cause. The goal is to distinguish:
  • One-off mistake (no action needed beyond noting it)
  • Knowledge gap (persist as context or learning resource)
  • Process gap (suggest tool, checklist, or protocol change)
  • Structural constraint (persist to project-context or CLAUDE.md)
Shallow analysis (stopping at "we should have done X") misses persist-worthy structural insights. Always drill to the level where you can recommend a durable fix.
识别会话中所有形式的无效工作。范围不限于提示习惯——覆盖所有低效场景:
  • 无效交互:误解、错误假设、返工
  • 过度设计:不必要的复杂度、过早抽象
  • 错过的捷径:可复用的现有工具/模式/代码
  • 上下文浪费:大文件读取、重复搜索、未复用的信息
  • 沟通浪费:模糊指令导致的方向错误工作
格式:自由形式的分析,引用会话中的具体时刻。无需表格。以建设性的方式提出可操作的建议。
根因深挖(5Why法):对于每个重要的浪费项,不要停留在表面症状。反复问“为什么会发生?”直到找到结构性或系统性原因。目标是区分:
  • 一次性错误(无需额外行动,仅记录即可)
  • 知识缺口(作为上下文或学习资源留存)
  • 流程缺口(建议工具、检查清单或流程变更)
  • 结构约束(留存到project-context.md或CLAUDE.md中)
浅层分析(仅停留在“我们本应做X”)会错过值得留存的结构性洞见。始终要深挖到可以提出持久解决方案的层面。

Section 4: Critical Decision Analysis (CDM)

板块4:关键决策分析(CDM)

Read
{SKILL_DIR}/references/cdm-guide.md
for methodology.
Identify 2-4 critical decision moments from the session. Apply CDM probes to each. This section is unconditional — every retro-worthy session has decisions worth analyzing.
阅读
{SKILL_DIR}/references/cdm-guide.md
了解方法论。
从会话中识别2-4个关键决策时刻。对每个时刻应用CDM探查方法。本板块为必填项——所有值得回顾的会话都有值得分析的决策。

Section 5: Expert Lens

板块5:专家视角

Mode: deep only. In light mode, output: "Run
/retro --deep
for expert analysis."
Condition: Does the session contain decisions that domain experts would analyze differently? If the session is too lightweight (simple config changes, routine tasks), skip this section with a brief note.
Expert selection:
  1. Scan the conversation for
    /deep-clarify
    invocations. If found, extract expert names and use them as preferred starting points.
  2. If no deep-clarify experts available, select independently per
    {SKILL_DIR}/references/expert-lens-guide.md
    .
Execution: Launch Expert alpha and Expert beta in parallel via Task tool. Each sub-agent prompt: "Read
{SKILL_DIR}/references/expert-lens-guide.md
. You are Expert {alpha|beta}. Session summary: {Sections 1-4 summary}. Deep-clarify experts: {names or 'not available'}. Analyze through your framework. Use web search to verify expert identity and cite published work." Integrate both results into Section 5.
模式:仅深度模式可用。在轻量化模式下,输出:“运行
/retro --deep
获取专家分析。”
适用条件:会话中的决策是否会被领域专家以不同方式分析?如果会话过于轻量化(简单配置修改、常规任务),则跳过本板块并附简短说明。
专家选择
  1. 扫描会话中的
    /deep-clarify
    调用记录。如果存在,提取专家姓名并作为首选。
  2. 如果没有可用的深度澄清专家,则根据
    {SKILL_DIR}/references/expert-lens-guide.md
    独立选择。
执行:通过Task工具并行启动Expert alpha和Expert beta子代理。每个子代理的提示:“阅读
{SKILL_DIR}/references/expert-lens-guide.md
。你是Expert {alpha|beta}。会话摘要:{板块1-4的摘要}。深度澄清专家:{姓名或‘不可用’}。通过你的框架进行分析。使用网页搜索验证专家身份并引用其公开成果。”将两个结果整合到板块5中。

Section 6: Learning Resources

板块6:学习资源

Mode: deep only. In light mode, output: "Run
/retro --deep
for learning resources."
Condition: Does the session contain topics where the user showed knowledge gaps or genuine curiosity? If the session is too lightweight (simple config changes, routine tasks), skip this section with a brief note.
Search the web for 2-3 resources calibrated to the user's knowledge level. For each: title + URL, 2-3 sentence summary of key takeaways, and why it matters for the user's work.
模式:仅深度模式可用。在轻量化模式下,输出:“运行
/retro --deep
获取学习资源。”
适用条件:会话中是否存在用户表现出知识缺口或真正感兴趣的主题?如果会话过于轻量化(简单配置修改、常规任务),则跳过本板块并附简短说明。
根据用户的知识水平搜索2-3个合适的网页资源。每个资源需包含:标题+URL、2-3句话的核心要点总结,以及该资源对用户工作的重要性。

Section 7: Relevant Skills

板块7:相关Skills

Step 1 — Scan installed skills (always, both modes):
  1. Glob for marketplace skills:
    ~/.claude/plugins/*/skills/*/SKILL.md
  2. Glob for local skills:
    .claude/skills/*/SKILL.md
  3. For each found skill: read the frontmatter (name, description, triggers)
  4. Analyze: "Could any of these skills have helped in this session?" and "Should the user try a skill they haven't been using?"
  5. Report relevant installed skills with brief explanation of how they apply
Step 2 — External skill discovery (if workflow gap identified):
Assess whether the session reveals a workflow gap or repetitive pattern not covered by installed skills. If no clear gap: state "No additional skill gaps identified." Otherwise:
  • Finding existing skills: Use
    /find-skills
    to search for existing solutions and report findings.
  • Creating new skills: If no existing skill fits, use
    /skill-creator
    to describe and scaffold the needed skill.
  • Prerequisite check: If
    find-skills
    (by Vercel) or
    skill-creator
    (by Anthropic) are not installed, recommend installing them from https://skills.sh/ before proceeding.
步骤1 — 扫描已安装的Skills(所有模式都执行):
  1. 遍历市场Skills:
    ~/.claude/plugins/*/skills/*/SKILL.md
  2. 遍历本地Skills:
    .claude/skills/*/SKILL.md
  3. 对于每个找到的Skill:读取其前置元数据(名称、描述、触发词)
  4. 分析:“这些Skills中有没有可以在本次会话中提供帮助的?”以及“用户是否应该尝试他们尚未使用的Skill?”
  5. 报告相关的已安装Skill,并简要说明其适用场景
步骤2 — 外部Skill发现(如果识别到工作流缺口):
评估会话是否暴露出已安装Skill未覆盖的工作流缺口或重复模式。如果没有明确缺口:说明“未识别到额外的Skill缺口。”否则:
  • 查找现有Skill:使用
    /find-skills
    搜索现有解决方案并报告结果。
  • 创建新Skill:如果没有合适的现有Skill,使用
    /skill-creator
    描述并搭建所需的Skill。
  • 前置检查:如果未安装Vercel的
    find-skills
    或Anthropic的
    skill-creator
    ,建议从https://skills.sh/安装后再继续。

5. Write retro.md

5. 写入retro.md

Write to
{output-dir}/retro.md
using the format below.
使用以下格式写入
{output-dir}/retro.md

6. Link Session Log

6. 关联会话日志

If
prompt-logs/sessions/
exists (prompt-logger plugin installed):
  1. List files matching today's date (
    {YYMMDD}-*.md
    ), filter out already-symlinked ones
  2. Read a sample of each candidate to verify it matches the current session
  3. If verified and
    {output-dir}/session.md
    does not exist, create a relative symlink:
    bash
    ln -s "../sessions/{filename}" "{output-dir}/session.md"
  4. If no candidates or directory does not exist, skip silently
如果
prompt-logs/sessions/
目录存在(已安装prompt-logger插件):
  1. 列出与今日日期匹配的文件(
    {YYMMDD}-*.md
    ),过滤掉已创建符号链接的文件
  2. 读取每个候选文件的样本内容以验证是否匹配当前会话
  3. 如果验证通过且
    {output-dir}/session.md
    不存在,创建相对符号链接:
    bash
    ln -s "../sessions/{filename}" "{output-dir}/session.md"
  4. 如果没有候选文件或目录不存在,则静默跳过

7. Persist Findings

7. 留存发现成果

retro.md is session-specific. Persist findings to project-level documents:
  • Context (Section 1): Offer to append new context to project-context.md (or create it)
  • CLAUDE.md (Section 2): If suggestions exist, AskUserQuestion "Apply?" — edit on approval
  • Root causes (Section 3): For each structural root cause identified via 5 Whys, evaluate its future job: "What recurring situation will this learning prevent?" (JTBD lens). If the answer is clear, it belongs in a persistent doc. Use right-placement check: CLAUDE.md for behavioral rules, project-context.md for architectural patterns, protocol/skill docs for process changes.
  • Process improvements (Section 3): If waste reduction identifies repeatable process improvements (not one-off observations), suggest updating CLAUDE.md, protocol docs, or project-context.md. Right-placement check applies.
  • Actionable improvements (Section 7): If concrete improvements identified, AskUserQuestion "Implement now?" to prevent findings from becoming stale
retro.md是会话专属文档。将发现成果留存到项目级文档中:
  • 上下文(板块1):提议将新上下文追加到project-context.md中(或创建该文档)
  • CLAUDE.md(板块2):如果有更新建议,向用户询问“是否应用?”——获得批准后再编辑
  • 根因(板块3):对于通过5Why法识别的每个结构性根因,评估其未来价值:“这个经验能避免哪些重复场景?”(JTBD视角)。如果答案明确,则应留存到持久文档中。使用正确位置检查:行为规则存入CLAUDE.md,架构模式存入project-context.md,流程变更存入协议/Skill文档。
  • 流程改进(板块3):如果减少浪费环节识别到可重复的流程改进(非一次性观察),建议更新CLAUDE.md、协议文档或project-context.md。适用正确位置检查。
  • 可操作改进(板块7):如果识别到具体改进措施,向用户询问“现在实施?”以避免成果过时

8. Post-Retro Discussion

8. 回顾后讨论

The user may continue the conversation after the retro. During post-retro discussion:
  • Update
    retro.md
    — append under
    ### Post-Retro Findings
  • Update
    lessons.md
    with new learnings
  • Persistence check — for each new learning, evaluate: CLAUDE.md? Skills/protocol docs? project-context.md?
  • If plugin code was changed, follow normal release procedures (version bump, CHANGELOG)
Do not prompt the user to start this discussion.
用户可能在回顾结束后继续对话。在回顾后讨论期间:
  • 更新
    retro.md
    ——将内容追加到
    ### 回顾后发现
  • 将新经验更新到
    lessons.md
  • 留存检查——对于每个新经验,评估:存入CLAUDE.md?存入Skills/协议文档?存入project-context.md?
  • 如果修改了插件代码,遵循正常发布流程(版本升级、更新CHANGELOG)
不要主动提示用户启动此讨论。

Output Format

输出格式

Light mode

轻量化模式

markdown
undefined
markdown
undefined

Retro: {session-title}

回顾:{会话标题}

Session date: {YYYY-MM-DD} Mode: light
会话日期:{YYYY-MM-DD} 模式:轻量化

1. Context Worth Remembering

1. 值得留存的上下文

2. Collaboration Preferences

2. 协作偏好

Suggested CLAUDE.md Updates

建议的CLAUDE.md更新

3. Waste Reduction

3. 减少浪费

4. Critical Decision Analysis (CDM)

4. 关键决策分析(CDM)

5. Expert Lens

5. 专家视角

Run
/retro --deep
for expert analysis.
运行
/retro --deep
获取专家分析。

6. Learning Resources

6. 学习资源

Run
/retro --deep
for learning resources.
运行
/retro --deep
获取学习资源。

7. Relevant Skills

7. 相关Skills

Installed Skills

已安装Skills

Skill Gaps

Skill缺口

undefined
undefined

Deep mode

深度模式

markdown
undefined
markdown
undefined

Retro: {session-title}

回顾:{会话标题}

Session date: {YYYY-MM-DD} Mode: deep
会话日期:{YYYY-MM-DD} 模式:深度

1. Context Worth Remembering

1. 值得留存的上下文

2. Collaboration Preferences

2. 协作偏好

Suggested CLAUDE.md Updates

建议的CLAUDE.md更新

3. Waste Reduction

3. 减少浪费

4. Critical Decision Analysis (CDM)

4. 关键决策分析(CDM)

5. Expert Lens

5. 专家视角

6. Learning Resources

6. 学习资源

7. Relevant Skills

7. 相关Skills

Installed Skills

已安装Skills

Skill Gaps

Skill缺口

undefined
undefined

References

参考资料

  • {SKILL_DIR}/references/cdm-guide.md
    — CDM probe methodology and output format
  • {SKILL_DIR}/references/expert-lens-guide.md
    — Expert identity, grounding, and analysis format
  • {SKILL_DIR}/references/cdm-guide.md
    — CDM探查方法论和输出格式
  • {SKILL_DIR}/references/expert-lens-guide.md
    — 专家身份、依据和分析格式

Language

语言

Write retro.md in the user's language. Detect from conversation, not from this skill file.
使用用户的语言编写retro.md。从会话中检测语言,而非从本Skill文件中获取。

Rules

规则

  1. Never duplicate content already in lessons.md
  2. Be specific — cite session moments, not generic advice
  3. Keep each section focused — if nothing to say, state that briefly
  4. CLAUDE.md changes require explicit user approval
  5. If early session context is unavailable due to conversation length, focus on what is visible and note the limitation
  6. CDM analysis (Section 4) is unconditional — every session has decisions to analyze
  7. Expert Lens (Section 5) is deep-mode only — in light mode, output a one-line pointer to
    --deep
  8. Learning Resources (Section 6) is deep-mode only — in light mode, output a one-line pointer to
    --deep
  9. Section 7 always scans installed skills first, before suggesting external skill discovery
  10. When writing code fences in retro.md or any markdown output, always include a language specifier (
    bash
    ,
    json
    ,
    yaml
    ,
    text
    ,
    markdown
    , etc.). Never use bare code fences.
  1. 绝不要重复lessons.md中已有的内容
  2. 内容要具体——引用会话中的具体时刻,而非泛泛建议
  3. 每个板块保持聚焦——若无内容可写,简要说明
  4. 修改CLAUDE.md需要用户明确批准
  5. 如果因会话长度限制无法获取早期上下文,聚焦于可见内容并注明限制
  6. CDM分析(板块4)是必填项——所有值得回顾的会话都有可分析的决策
  7. 专家视角(板块5)仅在深度模式下可用——轻量化模式下输出指向
    --deep
    的单行提示
  8. 学习资源(板块6)仅在深度模式下可用——轻量化模式下输出指向
    --deep
    的单行提示
  9. 板块7始终先扫描已安装的Skills,再建议外部Skill发现
  10. 在retro.md或任何markdown输出中使用代码块时,必须指定语言类型(
    bash
    json
    yaml
    text
    markdown
    等)。禁止使用无语言指定的代码块。