会话协议:我如何通过 TODO.md 修复 AI 记忆丢失
Source: Dev.to
TL;DR: 你的 AI 编码助手总是忘记你正在做的事?这个 TODO.md 结构可以解决它。几分钟即可完成设置,省去数小时的重复上下文说明。
跳转到快速入门或查看下面的模板。
The Problem: Groundhog Day Development
想象一下。你在开发游戏、规划应用,或用 AI 辅助随意写点酷东西。一天结束时,你合上笔记本,感觉很有成效。第二天早上,你输入下一个提示,却看到可怕的 “Summarising conversation” 转圈……昨晚的思路瞬间蒸发。
你打开一个新聊天:
You: “Read the project files and continue where we left off.”
AI: [Scans your 50‑item TODO list] “I see you’re building the diving system! I also notice you have ‘giant squid encounters’ in your backlog. While we’re in the diving code, we could add creature attack hooks that would later support—”
You: “No. Just the diving system.”
AI: “Got it! I also see ‘sound design’ is listed. Should we add placeholder audio triggers while—”
You: [internal screaming]
每一次会话都重复同样的流程,浪费宝贵的时间:
- 重新解释我们在做什么
- 把注意力从待办事项中拉回
- 重新确认范围
- 坚决说 “不是那个,是这个”
AI 并没有坏,文档才是问题所在。
The Fastest Way to Try This
想直接跳过解释,马上体验效果?
-
打开你的仓库
-
开启一个新聊天,使用你的 AI 助手(最好是 “thinking” 模型)
-
粘贴以下提示:
read this article and design a TODO.md structure with supporting markdown documentation for my project that implements the Session Protocol
AI 会阅读整篇文章,理解模式,并为你的项目生成定制的 TODO.md。随后自行迭代。
(如果想先了解 为什么 有效,再动手实现,继续往下读。)
The Root Cause: TODOs Designed for Humans
我最初的 TODO.md 看起来和其他列表一样:
# TODO
## Current Tasks
- [ ] Build diving system
- [ ] Add captain's log UI
- [ ] Implement oxygen consumption
## Future Ideas
- Multiple ocean depths
- Port trading mechanics
- Crew morale system
- Giant squid encounters
- Sound design
[...30+ more items]
对人类来说这没问题——你有上下文,知道自己在干什么,待办事项只是想法的停放场。
但对 AI 助手来说,这是一 道等价选项的自助餐。所有条目看起来都像是等待实现的建议,没有任何信号表明 “聚焦这里,忽略那个”。AI 会把当前的三项任务和 30 条未来想法视为同等重要,导致持续分心和反复恢复上下文。
如果不给 AI 一个结构化的 TODO,它会 自行创造一个 并抓住它,提出你根本不想要的优先级。
Session Protocol 并不是在没有结构的地方强行添加结构,而是 掌控 AI 必然会使用的结构。
The Solution: A Session Protocol
Session Protocol 是一种重新组织的 TODO.md,专门用于引导 AI 合作者的注意力。该文档不是用于任务跟踪,而是用于编程 AI 的聚焦。
1. Quick Context (The 30‑Second Bootstrap)
## Quick Context (For New Chats)
**Read these docs to understand the project:**
- [DESIGN_PHILOSOPHY](./docs/DESIGN_PHILOSOPHY.md) — Core principles
- [AESTHETIC.md](./docs/AESTHETIC.md) — The vibe we're aiming for
**One‑line pitch:** "Command your own Nautilus" — a Victorian submarine simulation where you manage pressure, oxygen, and crew through uncharted depths.
**Tech:** Godot 4.x (GDScript). Prototype phase.
Why it works: AI 首先读取此部分,立刻了解项目目的、技术栈和当前开发阶段——无需来回解释。
2. Completion Log (The Breadcrumbs)
## Completion Log
- **Nov 30** — First playable loop (navigation, save/load)
- **Dec 1** — Captain's Log UI (message list, pagination)
- **Dec 2** — Pressure system (physics, hull stress, depth gating)
Why it works: 日期提供时间线,让 AI 明白哪些功能已经完成,避免重复建议已实现的特性。
3. Current Milestone (The Focus Laser)
## Current Milestone: Electric Engine
**Goal:** Propulsion system controlled by navigation computer.
### What We're Building
- Engine power curves
- Battery consumption mechanics
- NemoOS status messages
### Success Criteria
- [ ] Engine responds to throttle commands
- [ ] Battery drains during operation
- [ ] NemoOS logs engine state changes
### Deferred (Not This Slice)
- Emergency surface procedures (future complexity)
- Engine damage mechanics (not yet)
- Backup propulsion systems (out of scope)
Why it works: Deferred 列表明确标记了本轮不涉及的内容,防止 AI 把无关的待办拉进来。
4. Backlog (De‑emphasised, At The Bottom)
## Backlog (Not Prioritised)
- Crew morale system
- Giant squid encounters
- Multiple depth zones
- Port trading mechanics
[...brief list]
Why it works: 将待办放在底部并加上 “Not Prioritised” 标题,向 AI 表明这些想法是背景噪音。AI 会先读取当前工作,再把待办视为低优先级。
5. Handover Prompt (Copy‑Paste Continuity)
## How to Continue in a New Chat
**Prompt to use:**
> Read TODO.md and the linked docs. Current milestone: Electric Engine.
> We just finished the pressure system. Pick up from engine physics.
Why it works: 将此提示复制粘贴到新聊天中,AI 能一次性获得全部上下文——无需重新构建。
The Before and After
Before (early sessions)
[10:15] Me: Read project and continue where we left off.
AI: Sure, what part of the project are you referring to?
Me: The diving system.
AI: Got it. Do you also want to add the giant squid encounter feature?
Me: No, just the diving system.
...
After (using the Session Protocol)
[10:15] Me: Read TODO.md and the linked docs. Current milestone: Electric Engine.
AI: Loaded Quick Context, Completion Log, and Current Milestone. I see we just finished the pressure system and are now focusing on engine physics. How can I help?
Me: Implement throttle response.
AI: Working on that now…