第二个功能阶段
The second feature phase
Summary
Demonstrates strategies to combat AI fatigue — maintaining clean divisions between features, clearing agent context, implementing in manageable chunks, and using sub-agents for deep project review during validation.
Key Takeaways
- Fight AI fatigue with clean breaks: ensure each feature starts fresh with cleared context and a clear flow state
- Implement in manageable chunks: if a feature is too large, ask the agent to implement parts of the plan first
- Sub-agents for deep review: spawn sub-agents to review the entire project, preserving the main agent’s context window
English Script
We have an improved constitution and an improved workflow. We’re getting better. But before moving on to the next roadmap feature, let’s tackle some strategies to deal with a common pain point. AI fatigue. Agents can generate a lot of code with a lot of changes. This massive amount of code makes the human in the loop validation exhausting. So much to review. To fight this confusion, make sure you have a clean division between each feature phase. We should start each feature in the right flow state. Do I have unfinished work? Did I merge the last feature branch to main? Is the next roadmap item the right thing to do? Did I clear the agent’s context to ensure the specs capture the intent instead of memory snapshots? And to let it focus its limited context budget on the next work. Take a moment to make a good start to help yourself finish.
We’ve done all this. Let’s clear the context and start the next feature, agents and ailments. As a note, we keep typing the same thing. We’ll talk about how you can streamline this repeated prompting into a custom workflow in a future lesson. As before, the agent asks good questions. The first one is about whether to keep all these features in one phase. We already decided to do this together in the previous lesson, so we’ll say yes. For the migrations, we’ll choose plain SQL. For validation, let’s select one, two, and three. That’s good. Now, let’s submit. When the agent drafts the spec, we can see some of its choices. The agent’s reasoning process is useful to watch. If you’re using an agent with verbose mode, that could give you even more insight into its intermediate ideas. Looks good, but we want to make one small change to capture our intent. We want to use PicoCSS as our CSS framework. Next, we review the three files in the feature spec, starting with the requirements. Let’s ask the agent to change the requirements to make sure any other files reflect the change. When the work is finished, let’s commit the feature spec. This time, we’ll let the agent come up with the message. With the spec for the second feature ready, let’s go to implementation.
The division between the planning phase and the feature phase helps us to not overflow context, hours and agents. If the feature seems too big to implement all at once, ask the agent to implement part of the feature plan first. This will keep the size of the changes manageable. Our agent has implemented the phase two feature. We watched the agent’s progress, so we have a rough idea of what was done. But that’s not enough. Slow down, do some thinking. Let’s do an in-depth review of the changes. Everybody has their own style on how much to review the agent’s results. To play to the agent’s strengths and reduce AI fatigue, stick to higher level requirements. Avoid nitpicking stuff like variable names. Just make sure it creates code that you can commit under your name. For example, it used inline type information for the props. We’d like the prop definition in a standalone TypeScript type. Let’s tell the agent to fix this everywhere in the code. You probably didn’t include this decision in your spec. Remember, an omission such as extracted prop types isn’t a failure. You are evolving the spec as you discover new details and capturing that leads to better future results. We’re finished with our review. This is a good moment for another small step commit.
Last step validation. Let’s review what the agent plans to do for the validation step in this feature spec. Looks good. Let’s do our validation. Remember, we want to make sure the changes are good by running the application. But we also want to prevent cognitive debt by validating that we understand these changes. Tests are a great place to work through the flow. Let’s read some tests and run them under the debugger as exploration. Sometimes you need to validate that you weren’t lied to. Tell the agent to spawn several sub-agents to do a deep review of the entire project with this feature change. This deep review gives the agent more space to think about the changes. And using sub-agents preserves the main agent’s context window, rather than polluting it. These sub-agents will come back with a number of issues and recommendations. All these look good, so let’s proceed. The agent goes off, does a bunch of fixes, runs tests, and gets our project into a good state. Keep this in your tool chest. The agent can usually find important issues during a second look.
Once we are finished with our validation, our feature is complete. It’s time to commit our feature. As our last step on this feature, let’s use the change log skill that we made in the previous lesson. We’ve now documented the changes on this feature branch. One more commit, then merge the branch. In a previous lesson, we saw the replan step in between features. Let’s do a quick version of this by looking at the roadmap. Does the next feature still seem right? Looks good. Our project is in good shape, ready for the next feature. This clean break between features helps manage AI fatigue. Now you can take a break for some coffee. We’re starting to see a repeatable SDD process for feature development. One that captures our decisions. In the next step, let’s test that hypothesis. Do we have enough to build an MVP?
第二个功能阶段
摘要
演示对抗 AI 疲劳的策略——在功能之间保持清晰的划分、清理智能体上下文、以可控的块进行实现,以及在验证阶段使用子智能体进行深度项目审查。
关键要点
- 用干净的间隔对抗 AI 疲劳:确保每个功能都从清理后的上下文和清晰的心流状态开始
- 以可控的块进行实现:如果功能太大,让智能体先实现计划的一部分
- 使用子智能体进行深度审查:生成子智能体审查整个项目,保护主智能体的上下文窗口
视频信息:第二个功能阶段
视频脚本(中文翻译)
我们有了一个改进过的章程和一个改进过的工作流。我们正在变得越来越好。但是在继续下一个路线图功能之前,让我们先来讨论一些应对常见痛点的策略:“AI 疲劳(AI fatigue)“。智能体会生成大量带有大量改动的代码。这海量的代码使得人类干预验证变得极其耗费精力。有太多的东西要审查。为了对抗这种混乱,确保你在每个功能阶段之间有一个清晰的划分。我们应该以正确的心流状态开始每个功能。我还有未完成的工作吗?我把上一个功能分支合并到 main 了吗?路线图上的下一个项目是否是目前该做的正确工作?我是否清理了智能体的上下文,以确保规格说明捕捉到的是意图,而不是过去的记忆快照?并让它把有限的上下文预算集中在接下来的工作上。花点时间开个好头,这将帮助你更好地完成收尾。
我们已经做好了这些。让我们清理上下文并开始下一个功能:智能体与疾病系统(agents and ailments)。提示一下,我们一直在反复输入同样的东西。在未来的课程中,我们将讨论如何将这种重复的提示简化为一个自定义工作流。和以前一样,智能体问出了好问题。第一个问题是关于是否将所有这些功能保持在一个阶段。我们已经在上一节课中决定一起完成,所以我们回答”是”。对于数据库迁移,我们选择原生 SQL。对于验证,我们选择一、二、三项。很好。现在,让我们提交。当智能体起草规格说明时,我们可以看到它做的一些选择。观察智能体的推理过程是很有用的。如果你使用的智能体带有详细输出模式(verbose mode),那能让你更深入地了解它的中间思路。看起来不错,但我们想做一点小改动来体现我们的意图:我们想使用 PicoCSS 作为我们的 CSS 框架。接下来,我们从需求文件开始,审查功能规格中的三个文件。让我们要求智能体修改需求,以确保任何其他相关文件都能反映这一变化。工作完成后,我们提交(commit)功能规格说明。这一次,我们让智能体来写提交信息。有了为第二个功能准备好的规格说明,让我们进入代码实现阶段。
在计划阶段与功能阶段之间的划分,有助于我们避免上下文、工时和智能体的溢出超载。如果某个功能看起来太大,无法一次性全部实现,你可以要求智能体先实现功能计划的一部分。这将使修改的代码量保持在可控范围内。我们的智能体已经实现了第二阶段的功能。我们观察了智能体的进度,所以我们大概知道它做了些什么。但这还不够。慢下来,做一些思考。让我们对这些更改进行深入审查。每个人对于应该在多大程度上审查智能体的结果都有自己的风格。为了发挥智能体的优势并减少 AI 疲劳,请坚持关注高层次需求。避免对像变量名这样琐碎的东西吹毛求疵。只需确保它生成的代码是你可以用你的名字提交的代码。例如,它对 props 使用了内联类型信息。我们希望在一个独立的 TypeScript 类型中定义 prop。让我们告诉智能体在代码的各个地方修复这个问题。你可能没有在你的规格说明中包含这个决策。请记住,像没有抽出 prop 类型这种遗漏并不是失败。随着你发现新的细节,你正在不断演进你的规格说明,将这记录下来将会在未来带来更好的结果。我们的审查完成了。现在正是进行又一次小步提交的好时机。
最后一步:验证。让我们复习一下智能体打算在这个功能规格的验证步骤中做些什么。看起来不错。让我们进行人工验证。记住,我们要通过运行应用程序来确保改动没问题。但我们同时还要验证我们自己是否理解了这些代码变动,以防止认知债务。测试是梳理流程的绝佳地点。让我们阅读一些测试用例,并在调试器下运行它们以作探索。有时候你需要验证你没有被 AI 糊弄。告诉智能体去生成几个”子智能体(sub-agents)“,对包含这个功能变动的整个项目进行一次深度审查。这种深度审查给了智能体更多思考这些变更的空间。使用子智能体可以保护主智能体的上下文窗口,而不是污染它。这些子智能体会带着一些问题和建议回来。这些看起来都不错,让我们继续执行。智能体开始去做了很多修复,运行测试,并使我们的项目进入良好状态。请将这个技巧保留在你的工具箱里。智能体在看第二遍的时候,通常能发现重要的问题。
一旦我们完成了验证,我们的功能就算完成了。是时候提交我们的功能了。作为此功能的最后一步,让我们使用上一课中制作的”更新日志(change log)技能”。现在,我们已经记录了这个功能分支上的变更。再做一次提交(commit),然后合并该分支。在之前的课程中,我们了解了在不同功能之间进行的”重新规划”步骤。让我们通过查看路线图来快速进行一下这个步骤。下一个功能看起来依然正确吗?看起来不错。我们的项目处于良好状态,准备迎接下一个功能。在不同功能之间的这种干净利落的停顿有助于控制 AI 疲劳。现在你可以去休息喝杯咖啡了。我们开始看到了一个用于功能开发的可重复的 SDD 流程。一个能捕获我们决策的流程。在下一步中,让我们测试一个假设。我们是否有足够的基础来构建一个 MVP(最小可行性产品)了?