session-continuity
会话暂停/恢复技能,融合 GSD 的 session pause/resume 机制。 在上下文即将溢出或需要跨会话接续时,生成最小化的恢复上下文, 确保新会话可以无缝接续。
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 1.6k
- Forks
- 491
01 前言 Front Matter
- name
- session-continuity
- description
- 会话暂停/恢复技能,融合 GSD 的 session pause/resume 机制。 在上下文即将溢出或需要跨会话接续时,生成最小化的恢复上下文, 确保新会话可以无缝接续。
03 SKILL.md 正文
Session Continuity
用途
- 把"上下文溢出时丢失关键信息"改成"主动暂停并生成恢复快照"。
- 把"新会话从头理解项目"改成"读取恢复快照直接继续"。
- 适合长期任务、跨天工作、上下文窗口接近上限的场景。
两种触发方式
主动暂停(pause)
用户或 agent 决定暂停当前工作,触发条件:
- 用户说"暂停"、"明天继续"、"save progress"
- 上下文使用率达到 70%+ 时建议暂停
- 任务进入等待外部输入的阻塞状态
自动恢复(resume)
新会话开始时检测并恢复之前的工作状态:
- 检查
docs/memory/sessions/下是否有未关闭的会话摘要 - 读取最近的恢复快照
- 将关键上下文重新注入
暂停时产出(STATE.md)
在 docs/memory/sessions/ 下创建会话状态文件:
---
artifact: session-state
date: {YYYY-MM-DD}
status: paused
task-slug: {slug}
---
# 会话状态 — {日期} #{序号}
## 当前任务
{一句话描述当前正在做什么}
## 完成进度
- [x] 已完成项
- [ ] 进行中项(标注进度百分比)
- [ ] 未开始项
## 关键上下文
- 当前分支:{branch name}
- 最近 commit:{hash + message}
- 修改中的文件:{file list}
- 待运行的验证命令:{commands}
## 关键决策
{本次会话中做出的重要决策,带简要原因}
## 阻塞项
{当前无法推进的事项}
## 恢复指令
{新会话开始时应执行的步骤}
恢复时做法
- 定位状态文件:读取
docs/memory/sessions/下最新的paused状态文件。 - 恢复上下文:按恢复指令执行,通常包括:
- 切换到正确分支
- 读取关键文件
- 验证当前代码状态
- 继续执行:从"进行中项"继续,按 todo list 推进。
- 更新状态:将会话状态从
paused改为active。 - 完成后收口:任务完成时将状态改为
completed并同步 session summary。
与现有机制的关系
| 能力 | 职责 |
|---|---|
session-continuity |
会话级暂停/恢复,保留工作状态 |
strategic-compact |
上下文压缩,在同一会话内释放空间 |
context-lifecycle |
四层记忆架构(L0-L3),跨会话的知识管理 |
| Session Summary(现有) | 会话结束后的总结,偏向文档归档 |
触发信号
- 上下文使用率 ≥70%(建议暂停)
- 上下文使用率 ≥85%(强烈建议暂停)
- 用户主动要求暂停
- 任务进入阻塞等待状态
- 跨天工作的自然断点
配套约束
- STATE.md 必须可操作:恢复指令必须足够具体,让新实例可以直接执行。
- 不替代 session summary:暂停状态是临时的可恢复快照,不是永久的交付记录。
- 及时清理:任务完成后将
paused状态文件标记为completed,避免积压。
04 同仓库更多 Skills
worktable-review-with-annotations
Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.
worktable-find-and-synthesize-context
Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.
worktable-create-or-update-docs
Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.
worktable-create-or-manage-records
Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.
worktable-create-or-manage-interactive-html
Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.
worktable-collaborate-threads
Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.