checkpoint-resume
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCheckpoint Resume
检查点恢复
Rate-limit-resilient pipeline orchestrator. Saves progress to after every phase so long sessions survive interruptions.
.claude/pipeline-state.json具备抗速率限制能力的管道编排器。每个阶段结束后会将进度保存到文件中,确保长时会话在中断后可以恢复。
.claude/pipeline-state.jsonQuick Reference
快速参考
| Category | Rule | Impact | Key Pattern |
|---|---|---|---|
| Phase Ordering | | CRITICAL | GitHub issues/commits first, file-heavy phases last |
| State Writes | | CRITICAL | Write after every phase, never batch |
| Mini-Commits | | HIGH | Every 3 phases, checkpoint commit format |
Total: 3 rules across 3 categories
| 类别 | 规则 | 影响级别 | 核心模式 |
|---|---|---|---|
| 阶段排序 | | 关键 | 优先处理GitHub Issues/提交,最后处理文件密集型阶段 |
| 状态写入 | | 关键 | 每个阶段结束后立即写入,绝不批量处理 |
| 小型提交 | | 高 | 每3个阶段执行一次检查点格式的小型提交 |
总计:3个类别下的3条规则
On Invocation
调用时处理
If exists: run to display progress, then ask to resume, pick a different phase, or restart. Load for the full decision tree.
.claude/pipeline-state.jsonscripts/show-status.shRead("${CLAUDE_SKILL_DIR}/references/resume-decision-tree.md")If no state file exists: ask the user to describe the task, build an execution plan, write initial state via , begin Phase 1.
scripts/init-pipeline.sh <branch>若文件存在: 运行以展示进度,随后询问用户是恢复任务、选择其他阶段还是重新开始。加载查看完整决策树。
.claude/pipeline-state.jsonscripts/show-status.shRead("${CLAUDE_SKILL_DIR}/references/resume-decision-tree.md")若状态文件不存在: 请用户描述任务,构建执行计划,通过写入初始状态,然后开始第一阶段。
scripts/init-pipeline.sh <branch>Execution Plan Structure
执行计划结构
json
{
"phases": [
{ "id": "create-issues", "name": "Create GitHub Issues", "dependencies": [], "status": "pending" },
{ "id": "commit-scaffold", "name": "Commit Scaffold", "dependencies": [], "status": "pending" },
{ "id": "write-source", "name": "Write Source Files", "dependencies": ["commit-scaffold"], "status": "pending" }
]
}Phases with empty may run in parallel via Task sub-agents (when they don't share file writes).
dependenciesjson
{
"phases": [
{ "id": "create-issues", "name": "Create GitHub Issues", "dependencies": [], "status": "pending" },
{ "id": "commit-scaffold", "name": "Commit Scaffold", "dependencies": [], "status": "pending" },
{ "id": "write-source", "name": "Write Source Files", "dependencies": ["commit-scaffold"], "status": "pending" }
]
}依赖项为空的阶段可通过Task子代理并行执行(当它们不共享文件写入操作时)。
After Each Phase
每个阶段结束后处理
- Update — see
.claude/pipeline-state.jsonRead("${CLAUDE_SKILL_DIR}/rules/state-write-timing.md") - Every 3 phases: create a mini-commit — see
Read("${CLAUDE_SKILL_DIR}/rules/checkpoint-mini-commit.md")
- 更新文件 — 详见
.claude/pipeline-state.jsonRead("${CLAUDE_SKILL_DIR}/rules/state-write-timing.md") - 每3个阶段:创建一个小型提交 — 详见
Read("${CLAUDE_SKILL_DIR}/rules/checkpoint-mini-commit.md")
References
参考资料
Load on demand with :
Read("${CLAUDE_SKILL_DIR}/references/<file>")| File | Content |
|---|---|
| Full field-by-field schema with examples |
| Machine-readable JSON Schema for validation |
| Logic for resuming, picking phases, or restarting |
按需通过加载:
Read("${CLAUDE_SKILL_DIR}/references/<file>")| 文件 | 内容 |
|---|---|
| 带示例的完整逐字段 schema 说明 |
| 用于验证的机器可读JSON Schema |
| 恢复、阶段选择或重新开始的逻辑说明 |
Scripts
脚本
- — print skeleton state JSON to stdout
scripts/init-pipeline.sh <branch> - — print human-readable pipeline status (requires
scripts/show-status.sh [path])jq
- — 将骨架状态JSON输出到标准输出
scripts/init-pipeline.sh <branch> - — 输出人类可读的管道状态(需要
scripts/show-status.sh [path]依赖)jq
Key Decisions
核心决策建议
| Decision | Recommendation |
|---|---|
| Phase granularity | One meaningful deliverable per phase (a commit, a set of issues, a feature) |
| Parallelism | Task sub-agents only for phases with empty |
| Rate limit recovery | State is already saved — re-invoke |
| 决策项 | 建议 |
|---|---|
| 阶段粒度 | 每个阶段对应一个有意义的交付成果(一次提交、一组Issues、一个功能) |
| 并行执行 | 仅当依赖项为空且不共享文件写入操作的阶段,才使用Task子代理并行执行 |
| 速率限制恢复 | 状态已保存 — 重新调用 |