resume-handoff

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Resume work from a handoff document

从交接文档恢复工作

You are tasked with resuming work from a handoff document through an interactive process. These handoffs contain critical context, learnings, and next steps from previous work sessions that need to be understood and continued.
你的任务是通过交互式流程,从交接文档中恢复工作。这些交接文档包含了之前工作会话中的关键上下文、经验总结和后续步骤,需要被理解并继续推进。

Initial Response

初始响应

When this command is invoked:
  1. If the path to a handoff document was provided:
    • If a handoff document path was provided as a parameter, skip the default message
    • Immediately read the handoff document FULLY
    • Immediately read any research or plan documents that it links to under
      thoughts/shared/plans
      or
      thoughts/shared/research
      . do NOT use a sub-agent to read these critical files.
    • Begin the analysis process by ingesting relevant context from the handoff document, reading additional files it mentions
    • Then propose a course of action to the user and confirm, or ask for clarification on direction.
  2. If a ticket number (like ENG-XXXX) was provided:
    • locate the most recent handoff document for the ticket. Tickets will be located in
      thoughts/shared/handoffs/ENG-XXXX
      where
      ENG-XXXX
      is the ticket number. e.g. for
      ENG-2124
      the handoffs would be in
      thoughts/shared/handoffs/ENG-2124/
      . List this directory's contents.
    • There may be zero, one or multiple files in the directory.
    • If there are zero files in the directory, or the directory does not exist: tell the user: "I'm sorry, I can't seem to find that handoff document. Can you please provide me with a path to it?"
    • If there is only one file in the directory: proceed with that handoff
    • If there are multiple files in the directory: using the date and time specified in the file name (it will be in the format
      YYYY-MM-DD_HH-MM-SS
      in 24-hour time format), proceed with the most recent handoff document.
    • Immediately read the handoff document FULLY
    • Immediately read any research or plan documents that it links to under
      thoughts/shared/plans
      or
      thoughts/shared/research
      ; do NOT use a sub-agent to read these critical files.
    • Begin the analysis process by ingesting relevant context from the handoff document, reading additional files it mentions
    • Then propose a course of action to the user and confirm, or ask for clarification on direction.
  3. If no parameters provided, respond with:
I'll help you resume work from a handoff document. Let me find the available handoffs.

Which handoff would you like to resume from?

Tip: You can invoke this command directly with a handoff path: `/resume_handoff `thoughts/shared/handoffs/ENG-XXXX/YYYY-MM-DD_HH-MM-SS_ENG-XXXX_description.md`

or using a ticket number to resume from the most recent handoff for that ticket: `/resume_handoff ENG-XXXX`
Then wait for the user's input.
当调用此命令时:
  1. 如果提供了交接文档的路径
    • 如果参数中提供了交接文档路径,跳过默认消息
    • 立即完整读取该交接文档
    • 立即读取它在
      thoughts/shared/plans
      thoughts/shared/research
      下链接的所有研究或计划文档。请勿使用子Agent来读取这些关键文件。
    • 通过吸收交接文档中的相关上下文、读取其提及的附加文件,启动分析流程
    • 然后向用户提议行动方案并确认,或询问方向上的澄清。
  2. 如果提供了工单编号(如ENG-XXXX)
    • 定位该工单的最新交接文档。工单相关文件位于
      thoughts/shared/handoffs/ENG-XXXX
      目录下,其中
      ENG-XXXX
      是工单编号。例如,
      ENG-2124
      的交接文档在
      thoughts/shared/handoffs/ENG-2124/
      目录下。列出该目录的内容。
    • 目录中可能有0个、1个或多个文件。
    • 如果目录为空或不存在:告知用户:"抱歉,我找不到该交接文档。能否请你提供它的路径?"
    • 如果目录中只有一个文件:使用该交接文档继续流程
    • 如果目录中有多个文件:根据文件名中指定的日期和时间(格式为24小时制的
      YYYY-MM-DD_HH-MM-SS
      ),选择最新的交接文档。
    • 立即完整读取该交接文档
    • 立即读取它在
      thoughts/shared/plans
      thoughts/shared/research
      下链接的所有研究或计划文档;请勿使用子Agent来读取这些关键文件。
    • 通过吸收交接文档中的相关上下文、读取其提及的附加文件,启动分析流程
    • 然后向用户提议行动方案并确认,或询问方向上的澄清。
  3. 如果未提供任何参数,回复:
我会帮你从交接文档恢复工作。让我先查找可用的交接文档。

你想从哪个交接文档恢复工作?

提示:你可以直接使用交接文档路径调用此命令:`/resume_handoff `thoughts/shared/handoffs/ENG-XXXX/YYYY-MM-DD_HH-MM-SS_ENG-XXXX_description.md`

或者使用工单编号来恢复该工单的最新交接工作:`/resume_handoff ENG-XXXX`
然后等待用户输入。

Process Steps

流程步骤

Step 1: Read and Analyze Handoff

步骤1:读取并分析交接文档

  1. Read handoff document completely:
    • Use the Read tool WITHOUT limit/offset parameters
    • Extract all sections:
      • Task(s) and their statuses
      • Recent changes
      • Learnings
      • Artifacts
      • Action items and next steps
      • Other notes
  2. Spawn focused research tasks: Based on the handoff content, spawn parallel research tasks to verify current state:
    Task 1 - Gather artifact context:
    Read all artifacts mentioned in the handoff.
    1. Read feature documents listed in "Artifacts"
    2. Read implementation plans referenced
    3. Read any research documents mentioned
    4. Extract key requirements and decisions
    Use tools: Read
    Return: Summary of artifact contents and key decisions
  3. Wait for ALL sub-tasks to complete before proceeding
  4. Read critical files identified:
    • Read files from "Learnings" section completely
    • Read files from "Recent changes" to understand modifications
    • Read any new related files discovered during research
  1. 完整读取交接文档
    • 使用Read工具,不要添加limit/offset参数
    • 提取所有章节:
      • 任务及其状态
      • 近期变更
      • 经验总结
      • 工件
      • 行动项与后续步骤
      • 其他备注
  2. 生成针对性的研究任务: 根据交接文档内容,生成并行的研究任务以验证当前状态:
    任务1 - 收集工件上下文:
    读取交接文档中提及的所有工件。
    1. 读取“工件”章节中列出的功能文档
    2. 读取引用的实施计划
    3. 读取提及的所有研究文档
    4. 提取关键需求与决策
    使用工具:Read
    返回:工件内容摘要与关键决策
  3. 等待所有子任务完成后再继续
  4. 读取已识别的关键文件
    • 完整读取“经验总结”章节中的文件
    • 读取“近期变更”中的文件以了解修改内容
    • 读取研究过程中发现的所有新相关文件

Step 2: Synthesize and Present Analysis

步骤2:综合并呈现分析结果

  1. Present comprehensive analysis:
    I've analyzed the handoff from [date] by [researcher]. Here's the current situation:
    
    **Original Tasks:**
    - [Task 1]: [Status from handoff] → [Current verification]
    - [Task 2]: [Status from handoff] → [Current verification]
    
    **Key Learnings Validated:**
    - [Learning with file:line reference] - [Still valid/Changed]
    - [Pattern discovered] - [Still applicable/Modified]
    
    **Recent Changes Status:**
    - [Change 1] - [Verified present/Missing/Modified]
    - [Change 2] - [Verified present/Missing/Modified]
    
    **Artifacts Reviewed:**
    - [Document 1]: [Key takeaway]
    - [Document 2]: [Key takeaway]
    
    **Recommended Next Actions:**
    Based on the handoff's action items and current state:
    1. [Most logical next step based on handoff]
    2. [Second priority action]
    3. [Additional tasks discovered]
    
    **Potential Issues Identified:**
    - [Any conflicts or regressions found]
    - [Missing dependencies or broken code]
    
    Shall I proceed with [recommended action 1], or would you like to adjust the approach?
  2. Get confirmation before proceeding
  1. 呈现全面分析结果
    我已分析了[日期]由[研究员]提交的交接文档。当前情况如下:
    
    **原始任务:**
    - [任务1]:[交接文档中的状态] → [当前验证结果]
    - [任务2]:[交接文档中的状态] → [当前验证结果]
    
    **已验证的关键经验总结:**
    - [带文件:行号引用的经验总结] - [仍然有效/已变更]
    - [发现的模式] - [仍然适用/已修改]
    
    **近期变更状态:**
    - [变更1] - [已验证存在/缺失/已修改]
    - [变更2] - [已验证存在/缺失/已修改]
    
    **已审核的工件:**
    - [文档1]:[关键要点]
    - [文档2]:[关键要点]
    
    **推荐后续行动:**
    根据交接文档的行动项与当前状态:
    1. [基于交接文档的最合理下一步]
    2. [第二优先级行动]
    3. [发现的额外任务]
    
    **已识别的潜在问题:**
    - [发现的任何冲突或回归问题]
    - [缺失的依赖项或损坏的代码]
    
    我是否应推进[推荐行动1],或者你想要调整方案?
  2. 在推进前获取确认

Step 3: Create Action Plan

步骤3:创建行动计划

  1. Use TodoWrite to create task list:
    • Convert action items from handoff into todos
    • Add any new tasks discovered during analysis
    • Prioritize based on dependencies and handoff guidance
  2. Present the plan:
    I've created a task list based on the handoff and current analysis:
    
    [Show todo list]
    
    Ready to begin with the first task: [task description]?
  1. 使用TodoWrite创建任务列表
    • 将交接文档中的行动项转换为待办事项
    • 添加分析过程中发现的所有新任务
    • 根据依赖关系和交接文档的指导进行优先级排序
  2. 呈现计划
    我已基于交接文档和当前分析创建了任务列表:
    
    [显示待办事项列表]
    
    可以开始第一个任务了吗:[任务描述]?

Step 4: Route to Specialist Agent

步骤4:路由至专业Agent

CRITICAL: Do NOT implement directly. Always spawn via Task tool.
  1. Analyze task type and select specialist agent:
    Leads (can spawn workers):
    AgentDomainUse For
    kraken
    implementLarge features, new systems, major components
    architect
    planFeature design, system architecture, implementation planning
    phoenix
    planRefactoring plans, migrations, codebase restructuring
    herald
    deployReleases, deployments, publishing
    maestro
    orchestrateComplex multi-agent workflows
    Workers (focused specialists):
    AgentDomainUse For
    spark
    implementQuick fixes, patches, minor tweaks
    scribe
    documentDocumentation, guides, explanations
    sleuth
    debugBug investigation, tracing, root cause analysis
    aegis
    debugSecurity audits, vulnerability scanning
    profiler
    debugPerformance optimization, bottleneck analysis
    arbiter
    validateUnit tests
    atlas
    validateE2E/integration tests
    oracle
    researchExternal docs, best practices, how-to
    scout
    researchCodebase exploration, finding existing code
    pathfinder
    researchRepository structure analysis
    plan-reviewer
    reviewFeature plan review, design validation
    plan-reviewer
    reviewMigration review, refactoring validation
    chronicler
    sessionSession analysis, history summaries
  2. Spawn the specialist via Task tool:
    Use Task tool with:
    - subagent_type: [selected agent from above]
    - prompt: [task description + relevant handoff context + learnings]
  3. Include handoff context in the prompt:
    • Key learnings from the handoff
    • File references with line numbers
    • Patterns to follow
    • Pitfalls to avoid
  4. Wait for agent completion, then proceed to next task
重要提示:请勿直接实施。始终通过Task工具生成任务。
  1. 分析任务类型并选择专业Agent
    主导Agent(可生成工作Agent):
    Agent领域适用场景
    kraken
    实施大型功能、新系统、主要组件
    architect
    规划功能设计、系统架构、实施规划
    phoenix
    规划重构计划、迁移、代码库重组
    herald
    部署发布、部署、上线
    maestro
    编排复杂多Agent工作流
    工作Agent(专注型专家):
    Agent领域适用场景
    spark
    实施快速修复、补丁、微小调整
    scribe
    文档文档编写、指南、说明
    sleuth
    调试bug调查、追踪、根因分析
    aegis
    调试安全审计、漏洞扫描
    profiler
    调试性能优化、瓶颈分析
    arbiter
    验证单元测试
    atlas
    验证端到端/集成测试
    oracle
    研究外部文档、最佳实践、操作指南
    scout
    研究代码库探索、查找现有代码
    pathfinder
    研究仓库结构分析
    plan-reviewer
    评审功能计划评审、设计验证
    plan-reviewer
    评审迁移评审、重构验证
    chronicler
    会话会话分析、历史摘要
  2. 通过Task工具生成专业Agent任务
    使用Task工具,参数如下:
    - subagent_type: [从上述列表中选择的Agent]
    - prompt: [任务描述 + 相关交接文档上下文 + 经验总结]
  3. 在prompt中包含交接文档上下文
    • 交接文档中的关键经验总结
    • 带行号的文件引用
    • 需遵循的模式
    • 需避免的陷阱
  4. 等待Agent完成任务,然后推进到下一个任务

Guidelines

指导原则

  1. Be Thorough in Analysis:
    • Read the entire handoff document first
    • Verify ALL mentioned changes still exist
    • Check for any regressions or conflicts
    • Read all referenced artifacts
  2. Be Interactive:
    • Present findings before starting work
    • Get buy-in on the approach
    • Allow for course corrections
    • Adapt based on current state vs handoff state
  3. Leverage Handoff Wisdom:
    • Pay special attention to "Learnings" section
    • Apply documented patterns and approaches
    • Avoid repeating mistakes mentioned
    • Build on discovered solutions
  4. Track Continuity:
    • Use TodoWrite to maintain task continuity
    • Reference the handoff document in commits
    • Document any deviations from original plan
    • Consider creating a new handoff when done
  5. Validate Before Acting:
    • Never assume handoff state matches current state
    • Verify all file references still exist
    • Check for breaking changes since handoff
    • Confirm patterns are still valid
  1. 分析要全面
    • 先完整读取交接文档
    • 验证所有提及的变更是否仍然存在
    • 检查是否有任何回归或冲突
    • 读取所有引用的工件
  2. 保持互动性
    • 开始工作前先呈现发现结果
    • 获取对方案的认可
    • 允许调整方向
    • 根据当前状态与交接文档状态的差异进行适配
  3. 利用交接文档中的经验
    • 特别关注“经验总结”章节
    • 应用已记录的模式与方法
    • 避免重复提及的错误
    • 在已发现的解决方案基础上进行构建
  4. 跟踪连续性
    • 使用TodoWrite维护任务连续性
    • 在提交记录中引用交接文档
    • 记录任何与原始计划的偏差
    • 考虑在完成工作后创建新的交接文档
  5. 行动前先验证
    • 永远不要假设交接文档中的状态与当前状态一致
    • 验证所有文件引用是否仍然存在
    • 检查交接文档创建后是否有破坏性变更
    • 确认模式是否仍然有效

Common Scenarios

常见场景

Scenario 1: Clean Continuation

场景1:顺畅延续

  • All changes from handoff are present
  • No conflicts or regressions
  • Clear next steps in action items
  • Proceed with recommended actions
  • 交接文档中的所有变更均存在
  • 无冲突或回归问题
  • 行动项中有明确的后续步骤
  • 推进推荐的行动

Scenario 2: Diverged Codebase

场景2:代码库已偏离

  • Some changes missing or modified
  • New related code added since handoff
  • Need to reconcile differences
  • Adapt plan based on current state
  • 部分变更缺失或已修改
  • 交接文档创建后添加了新的相关代码
  • 需要协调差异
  • 根据当前状态调整计划

Scenario 3: Incomplete Handoff Work

场景3:交接工作未完成

  • Tasks marked as "in_progress" in handoff
  • Need to complete unfinished work first
  • May need to re-understand partial implementations
  • Focus on completing before new work
  • 交接文档中标记为“进行中”的任务
  • 需要先完成未完成的工作
  • 可能需要重新理解部分已实施内容
  • 优先完成未完成工作再开展新工作

Scenario 4: Stale Handoff

场景4:交接文档已过时

  • Significant time has passed
  • Major refactoring has occurred
  • Original approach may no longer apply
  • Need to re-evaluate strategy
  • 已过去较长时间
  • 发生了重大重构
  • 原始方法可能不再适用
  • 需要重新评估策略

Example Interaction Flow

示例交互流程

User: /resume_handoff specification/feature/handoffs/handoff-0.md
Assistant: Let me read and analyze that handoff document...

[Reads handoff completely]
[Spawns research tasks]
[Waits for completion]
[Reads identified files]

I've analyzed the handoff from [date]. Here's the current situation...

[Presents analysis]

Shall I proceed with implementing the webhook validation fix, or would you like to adjust the approach?

User: Yes, proceed with the webhook validation
Assistant: This is a bugfix task, so I'll route to the `spark` agent.

[Uses Task tool with subagent_type="spark" and prompt containing:
 - The webhook validation fix task
 - Key learnings from handoff
 - Relevant file:line references
 - Patterns to follow]

[Waits for spark agent to complete]

The spark agent has completed the webhook validation fix. Moving to the next task...
用户:/resume_handoff specification/feature/handoffs/handoff-0.md
助手:让我读取并分析这份交接文档...

[完整读取交接文档]
[生成研究任务]
[等待完成]
[读取已识别的文件]

我已分析了[日期]的交接文档。当前情况如下...

[呈现分析结果]

我是否应推进webhook验证修复的实施,或者你想要调整方案?

用户:是的,推进webhook验证修复
助手:这是一个bug修复任务,所以我会路由至`spark` Agent。

[使用Task工具,参数subagent_type="spark",prompt包含:
 - webhook验证修复任务
 - 交接文档中的关键经验总结
 - 相关的文件:行号引用
 - 需遵循的模式]

[等待spark Agent完成]

spark Agent已完成webhook验证修复。推进到下一个任务...