context-resume

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

context-resume Skill

context-resume Skill

Purpose: Universal entry point for resuming plugin work from
.continue-here.md
handoff files. Handles workflow, ideation, mockup, and improvement resume scenarios.
Capabilities:
  • Locates handoff files (2 possible locations)
  • Parses YAML frontmatter and markdown context
  • Presents state summary with time-ago calculation
  • Routes to appropriate continuation skill (via Skill tool)
  • Graceful error recovery for missing/corrupt handoffs
用途:
.continue-here.md
交接文件恢复插件工作的通用入口点。支持工作流、构思、原型和优化场景的恢复。
功能:
  • 查找交接文件(2个可能的位置)
  • 解析YAML前置元数据和Markdown上下文
  • 展示包含时间差计算的状态摘要
  • 路由至合适的续接Skill(通过Skill工具)
  • 对缺失/损坏的交接文件进行优雅的错误恢复

Orchestration Protocol

编排协议

<delegation_rule>
CRITICAL: This skill MUST NOT implement workflow stages directly.
When resuming workflow (Stages 0-3), this skill:
  1. Locates handoff file
  2. Parses context
  3. Presents summary to user
  4. Checks for
    orchestration_mode: true
    in handoff YAML
  5. If orchestration_mode enabled → Invokes plugin-workflow skill via Skill tool (resume context passed via handoff file, not invocation params)
  6. If orchestration_mode disabled → Uses legacy direct routing
NEVER bypass orchestration_mode. This enforces the dispatcher pattern:
  • plugin-workflow orchestrates
  • Subagents implement
  • context-resume just loads and routes
See references/continuation-routing.md Step 4a-1 for complete protocol.
What is orchestration_mode?
When enabled in handoff YAML, this flag activates the dispatcher pattern: plugin-workflow orchestrates implementation by invoking subagents in fresh contexts. When disabled (legacy mode), context-resume directly routes to implementation skills. Modern workflows always use orchestration_mode for consistent subagent dispatch and clean context isolation.
</delegation_rule>
<delegation_rule>
关键要求: 本Skill不得直接实现工作流阶段。
恢复工作流(阶段0-3)时,本Skill会:
  1. 查找交接文件
  2. 解析上下文
  3. 向用户展示摘要
  4. 检查交接文件YAML中的
    orchestration_mode: true
    配置
  5. 如果orchestration_mode已启用 → 通过Skill工具调用plugin-workflow Skill(恢复上下文通过交接文件传递,而非调用参数)
  6. 如果orchestration_mode已禁用 → 使用传统直接路由方式
切勿绕过orchestration_mode,这是为了强制执行调度器模式:
  • plugin-workflow负责编排
  • 子Agent负责实现
  • context-resume仅负责加载和路由
完整协议请参考**references/continuation-routing.md** 步骤4a-1。
什么是orchestration_mode?
当在交接文件YAML中启用该标志时,会激活调度器模式:plugin-workflow通过在全新上下文中调用子Agent来编排实现。禁用时(传统模式),context-resume会直接路由至实现类Skill。现代工作流始终使用orchestration_mode,以确保子Agent调度的一致性和上下文的清晰隔离。
</delegation_rule>

Handoff File Locations

交接文件位置

The system uses 2 handoff locations, checked in priority order:
Priority 1: Main Workflow Handoff
plugins/[PluginName]/.continue-here.md
Plugin in active development (Stages 0-3, ideation, improvement planning). Contains stage, phase, orchestration_mode, next_action, completed work, next steps.
Priority 2: Mockup Handoff
plugins/[PluginName]/.ideas/mockups/.continue-here.md
UI mockup iteration in progress. Contains mockup_version, iteration notes, finalization status.
Search order: Priority 1 → 2. If multiple found, present disambiguation menu to user (see references/handoff-location.md Step 1c).

系统使用2个交接文件位置,按优先级顺序检查:
优先级1:主工作流交接文件
plugins/[PluginName]/.continue-here.md
适用于处于活跃开发阶段的插件(阶段0-3、构思、优化规划)。包含阶段、周期、orchestration_mode、下一步操作、已完成工作、后续步骤等信息。
优先级2:原型交接文件
plugins/[PluginName]/.ideas/mockups/.continue-here.md
适用于UI原型迭代中的插件。包含原型版本、迭代记录、完成状态等信息。
搜索顺序: 优先级1 → 优先级2。如果找到多个文件,需向用户展示消歧菜单(参考references/handoff-location.md步骤1c)。

Resume Workflow

恢复工作流

Progress Tracking:
Copy this checklist to track your progress:
Context Resume Progress:
- [ ] Step 1: Locate handoff file (check 2 locations, disambiguate if needed)
- [ ] Step 2: Parse context (YAML + markdown body)
- [ ] Step 3: Present summary (wait for user confirmation)
- [ ] Step 4: Route to continuation skill (load context files first)
进度跟踪:
复制以下清单跟踪进度:
Context Resume Progress:
- [ ] Step 1: Locate handoff file (check 2 locations, disambiguate if needed)
- [ ] Step 2: Parse context (YAML + markdown body)
- [ ] Step 3: Present summary (wait for user confirmation)
- [ ] Step 4: Route to continuation skill (load context files first)

Step 1: Locate Handoff File

步骤1:查找交接文件

Search for handoff files across 2 locations (see Handoff File Locations above). Handle interactive plugin selection if no name provided, and present disambiguation menu when multiple handoffs exist for same plugin.
Details: references/handoff-location.md
Validation: MUST complete before Step 2. If no handoff found, proceed to error recovery.

在2个位置搜索交接文件(详见上文交接文件位置)。如果未提供插件名称,需处理交互式插件选择;如果同一插件存在多个交接文件,需展示消歧菜单。
详情: references/handoff-location.md
验证要求: 必须在步骤2前完成。如果未找到交接文件,进入错误恢复流程。

Step 2: Parse Context

步骤2:解析上下文

Parse YAML frontmatter (plugin, stage, status, last_updated, etc.) and markdown body (current state, completed work, next steps, key decisions).
Details: references/context-parsing.md
Validation: MUST complete before Step 3.

解析YAML前置元数据(插件、阶段、状态、最后更新时间等)和Markdown正文(当前状态、已完成工作、后续步骤、关键决策等)。
详情: references/context-parsing.md
验证要求: 必须在步骤3前完成。

Step 3: Present Summary

步骤3:展示摘要

Calculate "time ago" and build user-facing summary:
  • Where we are in workflow
  • What's completed
  • What's next
  • Build/test status
  • Time since last session
Details: references/context-parsing.md (presentation logic)
DECISION GATE: MUST wait for user confirmation. DO NOT auto-proceed. Present numbered decision menu following checkpoint protocol.

VALIDATION GATE: Before proceeding to Step 4, verify:
  1. Handoff parsed successfully (YAML + markdown body extracted)
  2. User confirmed continuation (received explicit confirmation, not assumed)
  3. Plugin name is known and valid
  4. Stage type is identified (workflow/ideation/mockup/improvement)
If any verification fails:
  • Return to failed step (Step 1 or Step 2)
  • Present error recovery options (see references/error-recovery.md)
Only proceed to Step 4 when all verifications pass.

计算“时间差”并构建面向用户的摘要:
  • 当前工作流所处位置
  • 已完成内容
  • 下一步计划
  • 构建/测试状态
  • 距离上次会话的时间
详情: references/context-parsing.md(展示逻辑部分)
决策节点: 必须等待用户确认,不得自动继续。需按照检查点协议展示编号决策菜单。

验证节点: 进入步骤4前,需验证:
  1. 交接文件解析成功(已提取YAML和Markdown正文)
  2. 用户已确认继续(收到明确确认,不得假设)
  3. 插件名称已知且有效
  4. 阶段类型已识别(工作流/构思/原型/优化)
如果任何验证失败:
  • 返回至失败步骤(步骤1或步骤2)
  • 展示错误恢复选项(参考references/error-recovery.md
仅当所有验证通过后,方可进入步骤4。

Step 4: Route to Continuation Skill

步骤4:路由至续接Skill

Determine routing based on stage type (workflow, ideation, mockup, improvement). Load relevant context files (contracts, source code, git history) BEFORE invoking continuation skill.
Routes to plugin-workflow (Stages 0-6), plugin-ideation (ideation/improvements), ui-mockup (mockup iteration), or plugin-improve (improvement implementation) based on stage type and orchestration_mode. See references/continuation-routing.md for complete routing logic.
Validation: Requires user confirmation from Step 3.

根据阶段类型(工作流、构思、原型、优化)确定路由目标。在调用续接Skill之前,需加载相关上下文文件(契约、源代码、Git历史)。
根据阶段类型和orchestration_mode,路由至plugin-workflow(阶段0-6)、plugin-ideation(构思/优化)、ui-mockup(原型迭代)或plugin-improve(优化实现)。完整路由逻辑请参考**references/continuation-routing.md**。
验证要求: 需要步骤3中用户的确认。

Error Recovery

错误恢复

Common error scenarios with recovery strategies:
  • No Handoff Found: Check PLUGINS.md and git log to infer state, offer reconstruction options
  • Corrupted Handoff File: Parse git log to infer stage, offer manual recreation
  • Stale Handoff (>2 weeks old): Warn about staleness, offer to verify code changes
  • Multiple Handoffs for Same Plugin: Present disambiguation menu with recommendations
See references/error-recovery.md for all error scenarios and advanced features.

常见错误场景及恢复策略:
  • 未找到交接文件:检查PLUGINS.md和Git日志推断状态,提供重建选项
  • 交接文件损坏:解析Git日志推断阶段,提供手动重建选项
  • 交接文件过期(超过2周):向用户发出过期警告,提供代码变更验证选项
  • 同一插件存在多个交接文件:展示带有推荐选项的消歧菜单
所有错误场景及高级功能请参考**references/error-recovery.md**。

Integration Points

集成点

<integration>
Inbound (Command triggers):
  1. /continue
    command (no args) → Triggers interactive plugin selection
  2. /continue [PluginName]
    command → Triggers specific plugin resume
  3. Natural language: "resume [PluginName]", "continue working on [PluginName]"
Backward Compatibility:
Handles legacy handoffs with old stage references:
  • Old validation stage → Maps to "Stage 3 complete, plugin validated, ready to install"
  • Old preset/finalization stage → Maps to "Stage 3 complete, plugin validated, ready to install"
  • Detects old stage numbers during parsing (Step 2)
  • Automatically migrates to new workflow state
  • Presents clear explanation to user
</integration> <integration>
Outbound (Skill delegation):
  1. plugin-workflow
    - For workflow resume at specific stage (Stages 0-3)
  2. plugin-ideation
    - For ideation resume (improvements or refinement)
  3. ui-mockup
    - For mockup iteration resume
  4. plugin-improve
    - For improvement implementation resume
  5. workflow-reconciliation
    - For corrupt handoff recovery scenarios (state mismatch detection)
  6. system-setup
    - If error recovery detects missing dependencies
MUST use Skill tool for invocation, NEVER implement directly.
</integration>
<state_requirement>
This skill is READ-ONLY for state files.
MUST read:
  • .continue-here.md
    files (all 2 locations)
  • PLUGINS.md (status verification)
  • Git log (commit history for inference)
  • Contract files (creative-brief.md, parameter-spec.md, architecture.md, plan.md)
  • Source files (if mentioned in handoff)
  • CHANGELOG.md (for improvements)
MUST NOT write:
  • Any
    .continue-here.md
    files
  • PLUGINS.md
  • Any source code or contract files
Why: This skill is an orchestrator - state updates are handled by the continuation skills it delegates to (plugin-workflow, plugin-ideation, ui-mockup, plugin-improve, etc.). Orchestrators read state and route; implementation skills update state and execute checkpoints. See Checkpoint Protocol in CLAUDE.md for state update requirements in implementation skills.
</state_requirement>

<integration>
入站(命令触发):
  1. /continue
    命令(无参数)→ 触发交互式插件选择
  2. /continue [PluginName]
    命令 → 触发特定插件的恢复
  3. 自然语言指令:"resume [PluginName]"、"continue working on [PluginName]"
向后兼容性:
支持包含旧阶段引用的传统交接文件:
  • 旧验证阶段 → 映射为“阶段3完成,插件已验证,可安装”
  • 旧预设/最终阶段 → 映射为“阶段3完成,插件已验证,可安装”
  • 解析过程中(步骤2)检测旧阶段编号
  • 自动迁移至新工作流状态
  • 向用户展示清晰的说明
</integration> <integration>
出站(Skill委托):
  1. plugin-workflow
    - 用于恢复特定阶段的工作流(阶段0-3)
  2. plugin-ideation
    - 用于恢复构思(优化或细化)
  3. ui-mockup
    - 用于恢复原型迭代
  4. plugin-improve
    - 用于恢复优化实现
  5. workflow-reconciliation
    - 用于损坏交接文件的恢复场景(状态不匹配检测)
  6. system-setup
    - 如果错误恢复检测到缺失依赖
必须使用Skill工具进行调用,不得直接实现
</integration>
<state_requirement>
本Skill对状态文件仅具有只读权限
允许读取:
  • .continue-here.md
    文件(所有2个位置)
  • PLUGINS.md(状态验证)
  • Git日志(提交历史用于推断)
  • 契约文件(creative-brief.md、parameter-spec.md、architecture.md、plan.md)
  • 源文件(如果交接文件中提及)
  • CHANGELOG.md(用于优化场景)
禁止写入:
  • 任何
    .continue-here.md
    文件
  • PLUGINS.md
  • 任何源代码或契约文件
原因: 本Skill是编排器,状态更新由其委托的续接Skill(plugin-workflow、plugin-ideation、ui-mockup、plugin-improve等)负责。编排器仅读取状态并路由,实现类Skill负责更新状态和执行检查点。实现类Skill的状态更新要求请参考CLAUDE.md中的检查点协议。
</state_requirement>

Success Criteria

成功标准

Resume is successful when:
  1. Handoff located: Found correct handoff file(s) from 2 possible locations
  2. Context parsed: YAML and markdown extracted without errors
  3. State understood: User sees clear summary of where they left off
  4. Continuity felt: User doesn't need to remember details, handoff provides everything
  5. Appropriate routing: Correct continuation skill invoked with right parameters
  6. Context loaded: Contract files and relevant code loaded before proceeding
  7. Error handled: Missing/corrupt handoff handled gracefully with fallbacks
  8. User control: User explicitly chooses to continue, not auto-proceeded

恢复成功的判定标准:
  1. 找到交接文件:从2个可能位置找到正确的交接文件
  2. 上下文解析成功:无错误提取YAML和Markdown内容
  3. 状态清晰传达:用户能看到清晰的进度摘要
  4. 保持工作连续性:用户无需记忆细节,交接文件提供全部必要信息
  5. 路由正确:调用了正确的续接Skill并传递了正确参数
  6. 上下文已加载:在继续前已加载契约文件和相关代码
  7. 错误处理得当:对缺失/损坏的交接文件进行了优雅处理并提供备选方案
  8. 用户掌控权:用户明确选择继续,而非自动推进

Execution Requirements

执行要求

<requirements>
MUST do when executing this skill:
  1. ALWAYS search all 2 handoff locations before declaring "not found"
  2. MUST parse YAML carefully - handle missing optional fields gracefully
  3. MUST present time-ago in human-readable format (not raw timestamps)
  4. MUST show enough context that user remembers where they were
  5. NEVER auto-proceed - wait for explicit user choice
  6. MUST load contract files BEFORE invoking continuation skill (provides context)
  7. MUST use git log as backup IF handoff is missing, stale (>2 weeks old), or corrupt
  8. MUST preserve user's mental model - summary should match how they think about plugin
</requirements>
<anti_patterns>
NEVER do these common mistakes:
  • Checking only Priority 1 location and stopping early (MUST check both locations)
  • Auto-proceeding after summary without waiting for user confirmation
  • Invoking continuation skill before loading contract files
  • Presenting raw YAML/markdown instead of formatted human-readable summary
  • Auto-selecting when multiple handoffs exist (MUST present disambiguation menu)
</anti_patterns>
<requirements>
执行本Skill时必须做到:
  1. 始终搜索所有2个交接文件位置,之后才能判定“未找到”
  2. 必须仔细解析YAML,对缺失的可选字段进行优雅处理
  3. 必须以人类可读格式展示时间差(而非原始时间戳)
  4. 必须展示足够的上下文,让用户回忆起之前的进度
  5. 切勿自动推进,需等待用户明确选择
  6. 必须在调用续接Skill之前加载契约文件(提供上下文)
  7. 如果交接文件缺失、过期(超过2周)或损坏,必须使用Git日志作为备份
  8. 必须保留用户的心智模型,摘要应符合用户对插件的认知方式
</requirements>
<anti_patterns>
切勿犯以下常见错误:
  • 仅检查优先级1位置就提前终止(必须检查两个位置)
  • 展示摘要后自动继续,未等待用户确认
  • 加载契约文件前就调用续接Skill
  • 展示原始YAML/Markdown内容,而非格式化的人类可读摘要
  • 当存在多个交接文件时自动选择(必须展示消歧菜单)
</anti_patterns>