{"skill":{"slug":"checkpoints","displayName":"Checkpoints","summary":"Records full context of AI-generated code and binds it to git commits. When the agent writes and commits code, capture prompts, conversation history, reasoni...","description":"---\r\nname: checkpoints\r\ndescription: Records full context of AI-generated code and binds it to git commits. When the agent writes and commits code, capture prompts, conversation history, reasoning steps, decision logic, and token/metadata, then associate that checkpoint with the commit. Use when committing AI-produced changes or when the user wants to save or audit why and how code was generated.\r\n---\r\n\r\n# Checkpoints\r\n\r\nCheckpoints 用于**自动记录 AI 生成代码的完整上下文**，并与对应的**代码提交（Commit）**绑定，便于回溯、审计和复现“这段代码是怎么来的”。\r\n\r\n---\r\n\r\n## 何时使用\r\n\r\n- 智能体编写并即将提交（或刚提交）代码时，需要把本次生成的上下文一并留存。\r\n- 用户明确要求“把这次改动的依据/对话记录下来”“和 commit 绑在一起”。\r\n- 需要事后查看某次提交对应的提示词、推理过程和决策逻辑时，本 Skill 指导如何生成和存放 checkpoint 数据。\r\n\r\n---\r\n\r\n## Checkpoint 应包含的内容\r\n\r\n在生成或提交 AI 代码时，将以下信息与 commit 绑定：\r\n\r\n| 内容 | 说明 |\r\n|------|------|\r\n| **提示词（Prompts）** | 用户或系统触发生成的那条（或几条）主要 prompt，可做脱敏。 |\r\n| **对话记录** | 与本次改动相关的对话摘要或关键轮次（可精简为要点）。 |\r\n| **推理步骤** | 模型/智能体的推理链：先做了什么判断、尝试了哪些方案、为何选当前实现。 |\r\n| **决策逻辑** | 关键决策点（例如：为何用 A 库而非 B、为何采用这种结构）。 |\r\n| **元数据** | 可选：Token 消耗量、模型/版本、时间戳、涉及文件列表等。 |\r\n| **关联 Commit** | 明确对应的 commit hash（或 branch + 即将提交的说明），保证可追溯。 |\r\n\r\n---\r\n\r\n## 与 Commit 绑定的方式\r\n\r\n- **方式一：独立 checkpoint 文件**  \r\n  在仓库中维护 checkpoint 存储（例如 `.checkpoints/` 或 `docs/checkpoints/`），每个 commit 对应一个文件，命名包含 commit hash 或时间戳，便于通过 hash 查找。\r\n- **方式二：Commit 消息或 tag**  \r\n  在 commit message 中写简短摘要，并注明“详细上下文见 .checkpoints/<hash>.json”；或打 tag 指向该 commit，tag 名/描述中带 checkpoint 标识。\r\n- **方式三：外部系统**  \r\n  若有现成的 Checkpoints 工具或服务，按该工具的 API/CLI 上传上述内容，并在 commit message 或仓库内留一条引用（如 URL 或 id）。\r\n\r\n按项目约定或用户指定选择一种方式，并保持一致。\r\n\r\n---\r\n\r\n## Checkpoint 文件结构建议\r\n\r\n若用文件形式保存，可采用结构化格式（便于后续解析和展示），例如：\r\n\r\n```json\r\n{\r\n  \"commit\": \"abc123...\",\r\n  \"timestamp\": \"ISO8601\",\r\n  \"prompts\": [\"用户请求的原始或摘要 prompt\"],\r\n  \"conversation_summary\": \"与本次改动相关的对话要点\",\r\n  \"reasoning_steps\": [\"步骤1\", \"步骤2\", \"...\"],\r\n  \"decisions\": [\"决策1及原因\", \"...\"],\r\n  \"files_changed\": [\"path/a\", \"path/b\"],\r\n  \"meta\": {\r\n    \"model\": \"optional\",\r\n    \"tokens_used\": \"optional\",\r\n    \"agent_version\": \"optional\"\r\n  }\r\n}\r\n```\r\n\r\n也可用 Markdown 书写，便于人工阅读，但需固定章节（Prompts、对话摘要、推理步骤、决策、元数据、Commit）。\r\n\r\n---\r\n\r\n## 工作流程（智能体侧）\r\n\r\n1. **在准备提交或完成提交后**：判断本次改动是否主要由 AI 生成；若是，则生成 checkpoint 内容。\r\n2. **组装内容**：从当前对话中提取或总结：提示词、相关对话、推理步骤、决策逻辑；若有 token/模型信息则填入 meta。\r\n3. **绑定 commit**：若尚未提交，先执行提交，取得 commit hash；再写入 checkpoint 文件或调用外部工具，并确保文件名/引用中包含该 hash。\r\n4. **不污染主流程**：checkpoint 文件可加入 `.gitignore` 若仅本地使用；若团队需要共享审计，则纳入版本库并提交。\r\n\r\n---\r\n\r\n## 使用原则\r\n\r\n- **一致性**：同一仓库内固定用一种绑定方式和目录/命名规则。\r\n- **隐私与脱敏**：若 prompt 或对话中含敏感信息，存盘前做脱敏或仅存摘要。\r\n- **可追溯**：通过 commit hash 能从 checkpoint 反查到提交，或从提交找到对应 checkpoint。\r\n","tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":583,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1773369137758,"updatedAt":1778491872769},"latestVersion":{"version":"1.0.0","createdAt":1773369137758,"changelog":"Initial release of the \"checkpoints\" skill.\n\n- Captures and stores full context (prompts, conversation, reasoning, decisions, metadata) related to AI-generated code changes.\n- Binds context data to specific git commits for traceability and auditing.\n- Supports multiple binding methods: standalone files, commit messages/tags, or external tools.\n- Provides structured guidelines for checkpoint content and workflow integration.\n- Emphasizes consistency, privacy, and traceability in checkpoint handling.","license":"MIT-0"},"metadata":null,"owner":{"handle":"openlang-cn","userId":"s17dqxdtqm3n7dpc7r06vmnqfd83gw7r","displayName":"openlang","image":"https://avatars.githubusercontent.com/u/45782174?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1780089863028}}