context-snapshot
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseContext Snapshot
上下文快照
Create one handoff file with the highest-signal context from the current conversation.
创建一份包含当前对话中最高价值上下文的交接文件。
Workflow
工作流
1. Choose output path
1. 选择输出路径
- If the user provides a path, use it.
- Otherwise create .
handoffs/context-<YYYY-MM-DD-HHMM>.md - Create the parent directory if it does not exist.
- 如果用户提供了路径,则使用该路径。
- 否则创建。
handoffs/context-<YYYY-MM-DD-HHMM>.md - 如果父目录不存在,则创建它。
2. Map territory (MANDATORY)
2. 梳理核心范畴(必填)
- Inventory key domains before writing:
- Goals and success criteria.
- Decisions and rationale.
- Constraints and non-goals.
- Files/artifacts and command outcomes.
- Risks, blockers, open questions.
- Capture exact wording for non-negotiable decisions and constraints.
- 在撰写前先梳理关键领域:
- 目标与成功标准。
- 决策及其依据。
- 约束条件与非目标。
- 文件/工件与命令执行结果。
- 风险、障碍与待解答问题。
- 对于不可协商的决策和约束条件,保留原文措辞。
3. Score friction and choose depth mode (MANDATORY)
3. 评估复杂度并选择深度模式(必填)
Select one mode:
| Mode | Use when | Depth |
|---|---|---|
| Estimated conversation size is small and task scope is single-track | Minimal bullets, highest-priority items only |
| Typical multi-step task with moderate context | Full template, balanced detail |
| Large context, contradictions, or high-risk decisions | Full template plus contradiction/TODO tracking |
选择以下一种模式:
| 模式 | 适用场景 | 深度 |
|---|---|---|
| 对话规模较小且任务范围为单一轨道 | 仅保留最高优先级的极简项目符号 |
| 典型的多步骤任务,上下文复杂度中等 | 完整模板,细节均衡 |
| 上下文规模大、存在矛盾或涉及高风险决策 | 完整模板,外加矛盾/TODO追踪 |
4. Respond by mode
4. 根据模式生成响应
Extract only what a new agent needs to continue safely:
- User goals and success criteria.
- Decisions and rationale.
- Constraints, assumptions, and non-goals.
- Files touched or referenced.
- Commands run and key outcomes.
- Open questions, risks, and blockers.
- Current status and next steps.
仅提取新Agent安全继续工作所需的信息:
- 用户目标与成功标准。
- 决策及其依据。
- 约束条件、假设与非目标。
- 涉及或引用的文件。
- 已执行的命令与关键结果。
- 待解答问题、风险与障碍。
- 当前状态与下一步行动。
5. Write the handoff file
5. 撰写交接文件
- Copy context-template.md into the output path.
- Fill every section.
- If a section has no data, write .
None - Add tags to major claims, decisions, blockers, and next steps.
source: - Example:
- API key rotation blocked by IAM policy (source: command output, aws iam get-role)
- 将context-template.md复制到输出路径。
- 填写所有章节。
- 如果某章节无数据,填写。
None - 为主要结论、决策、障碍和下一步行动添加标签。
source: - 示例:
- API密钥轮换被IAM策略阻止(source: 命令输出, aws iam get-role)
6. Validate before finishing
6. 完成前验证
- Keep facts concrete and traceable to the conversation.
- Keep paths, commands, and identifiers exact.
- Remove low-signal narrative and duplicate points.
- Ensure next steps are actionable and ordered.
- Mark uncertainty with instead of guessing.
TODO - Set confidence level: ,
high, ormedium.low
- 确保事实具体可追溯至对话内容。
- 路径、命令和标识符保持原样。
- 删除低价值的叙述性内容和重复要点。
- 确保下一步行动可执行且有序。
- 用标记不确定性,而非猜测。
TODO - 设置置信级别:、
high或medium。low
Critical Rules (MANDATORY)
关键规则(必填)
- Prioritize fidelity over prose.
- Preserve exact phrasing for decisions and hard constraints.
- Separate facts from assumptions using explicit labels.
- Include concrete dates when timing matters.
- Do not omit failed attempts if they affect next steps.
- Keep output concise but complete; use bullets.
- 优先保证准确性而非文采。
- 保留决策和硬约束条件的原文措辞。
- 使用明确标签区分事实与假设。
- 若时间重要,需包含具体日期。
- 若失败尝试会影响下一步行动,不得省略。
- 输出需简洁但完整;使用项目符号。
Forbidden Behaviors
禁止行为
- Do not invent decisions, rationale, owners, or outcomes.
- Do not silently resolve conflicting statements.
- Do not omit blockers just because they are unresolved.
- Do not rewrite critical commitments into generic language.
- Do not output only narrative text when structured fields are required.
- 不得编造决策、依据、负责人或结果。
- 不得私下解决相互矛盾的陈述。
- 不得因障碍未解决就省略它们。
- 不得将重要承诺改写为通用语言。
- 当需要结构化字段时,不得仅输出叙述性文本。
Confidence Gate
置信度门槛
- : No material contradictions; next steps are executable.
high - : Minor uncertainty;
mediumitems are explicit.TODO - : Major gaps or contradictions; list blocking questions before handoff.
low
- :无实质性矛盾;下一步行动可执行。
high - :存在轻微不确定性;
medium项明确。TODO - :存在重大缺口或矛盾;交接前需列出阻塞性问题。
low
Compression Heuristics
压缩原则
- Keep only information needed for safe continuation.
- Remove conversational filler and repeated explanations.
- Merge related updates into one state description.
- Preserve irreversible decisions and unresolved risks.
- 仅保留安全继续工作所需的信息。
- 删除对话式填充内容和重复解释。
- 将相关更新合并为单一状态描述。
- 保留不可撤销的决策和未解决的风险。