cadence-resumelisted
Install: claude install-skill hxt9805/cadence
# cadence-resume(v0.4)
## 定位
用户跑 `/cadence-resume` 或说"继续上次" → 展示可 resume 的 handoff 列表 → 用户选择 → 加载对应 handoff 上下文 + 对比当前档案状态 → 报告"你上次讨论到哪、和现在有何差异"。
## 路径约定
所有 handoff 产物必须位于 `<project-root>/cadence/.handoff/`。不得在项目根创建或读取裸 `.handoff/`;Step 1 前置检测发现时只提示迁移,不阻断主流程。
## 流程
### Step 1:列出可 resume 的 handoff
#### 前置检测(路径漂移护栏)
读取 index 之前,先检测项目根是否存在裸 `.handoff/`(历史版本不一致 bug 痕迹):
- 若 `<project-root>/.handoff/` 存在 **且** `<project-root>/cadence/.handoff/` 不存在 → 一行提示:
`⚠️ 检测到 .handoff/ 在项目根,这是 v0.2.0 历史路径不一致 bug 的痕迹。建议:mv .handoff cadence/.handoff 后重试。`
本次仍按规范从 `cadence/.handoff/` 读取(为空则展示"无 handoff")。
- 若两者都存在 → 警告 `⚠️ 同时存在项目根 .handoff/ 和 cadence/.handoff/,请手动合并(以 cadence/.handoff/ 为准)。`
- 否则静默通过。
检测失败(IO 异常等)→ 不抛、不阻断主流程(参 § Step 6 失败优雅降级风格),继续 Step 1 主体。
#### 主体
读 `cadence/.handoff/index.json`,按 `created_at` 倒序展示最近 N 条(默认 N=5):
```
最近 handoff:
1. 2026-04-23 18:00 v0.3 Phase D handoff 联动重构
2. 2026-04-20 12:00 阶段 B 深度审查(legacy v0.2.2)
...
要继续哪条?(输入编号 / "new" 开新 session)
```
### Step 2:用户选择后读取 handoff 快照
`Read cadence/.handoff/<handoff_id>.md`,解析 frontmatter。
### Step 3:识别版本(v0.4 / v0.3 / legacy v0.2.2)
```python
# 伪代码(Claude 按逻辑执行,不跑真 python)
is_legacy = (
"content_hashes" not in frontmatter
and "item_counts" in frontmatter
)
```
- 有 `content_hashes + continuation_refs + fidelity` → v0.4,走 Step 4a
- 仅有 `content_hashes` → v0.3,走 Step 4a 的兼容路径
- legacy v0.2.2 → 走 Step 4b
**判据优先级**:字段判据为主(覆盖 99% 场景);若字段判据**两字段都不存在或都存在**(corner case,如文件损坏或迁移中)→ 调用 `python ${