项目重新规划
Project replanning
Summary
Covers the replanning phase between features — updating the constitution (adding testing framework, responsive design), revising the roadmap, and introducing Agent Skills for workflow automation. Demonstrates creating a changelog skill.
Key Takeaways
- Replan between features: update the constitution and roadmap based on what you’ve learned; use a separate branch
- Agent Skills automate repeatable workflows: a changelog skill demonstrates packaging instructions for the agent
- Replanning also improves process: not just the project, but your SDD workflow itself can be refined between features
视频信息:Project replanning
English Script
We successfully implemented the first feature. Can’t wait to do it again and again. Don’t rush into it. Take a step back and reflect with some replanning. You have to run slow to run fast. We have a workflow step called validation. Tests are good for validation, but we didn’t give the agent all our testing preferences. Let’s make a replanning branch to update the tech stack in our constitution. As you saw in the previous video, spec versioning is an evolving topic. The constitution is a living document. It’s good practice to make updates to it in its own separate branch, so you can keep track of which versions of it produced which code. We’ll use a prompt to state our policy. It looks like the agent updated the package.json just to have a script, no dependency. Something to note for later, when we do run tests. This change to add a testing framework applies to future code. But let’s tell the agent to update existing feature specs and implementation based on this constitution change. After these two prompts, we have some good changes. The agent set up this testing change, but didn’t write the tests themselves. Let’s tell the agent to write some new tests. With this setup, we can run tests conveniently in our editor. Let’s run under the debugger to give us a chance to step through code execution as part of the human in the loop. Looks good. We now have tests as part of validation. Let’s commit.
Sometimes we realize we want to do something differently in the product plan. For example, after implementing the first feature, we got an update from the product manager. Because 40% of our users are on mobile, we want to emphasize a responsive design. Let’s go to the agent. Tell the agent we want responsive design and to correct the product specs and feature specs as well as any code. Since we’re so early on in development, this update is a small change, so it makes sense to directly implement it during replanning. But if the new work is big, it’s better to schedule it on the roadmap as its own feature phase, instead of just doing it in replanning. Use your judgment. Remember, we want the specs to capture decisions, not just the code. We want to try to keep both in sync to help team communication. The agent has implemented our responsive fix with updates not just in code, but also to the product and feature specs. Time for us to do our part and review the changes. Let’s go through the diffs. This looks good. Let’s do a commit. Remember, working in small steps with frequent commits keeps the review from overloading your brain.
While this first part of replanning is working, let’s step back and do some project housekeeping. For example, let’s revisit the project roadmap and look at the next task. Does it still make sense? The roadmap shows the next feature which we cover in the next lesson. Is it still the correct one? Looking through the roadmap, it looks like features two, three, four, and five kind of hang together. Let’s update the roadmap to tackle those in one step. We’ll commit and start on this new feature shortly.
The replanning step can be about a feature or the whole project. But replanning can also be about improving your spec-driven development workflow, across projects, across your organization. For example, maybe you have a few non-technical stakeholders that want to monitor the project’s progress. You’d like it to update a changelog on each merge to main. Most AI coding agents support skills, a package of instructions and resources providing the agent new capabilities and expertise. Skills are great for definable, repeatable workflows that require context specific to your project or organization. A skill would be great for implementing a changelog update. You could write this skill by hand, but many agents actually have skills that help you write a skill. Let’s use the agent to help us write and maintain a changelog skill. The agent gets to work. One thing for us to consider is this skill unique to this project? Or should it be a standard part of all projects? This is a style choice and you’ll gain better understanding as you use it. You’ll learn to automate your SDD workflow with skills. For example, your validation step might include updating the readme, linting, formatting, test writing, and other quality checks. You can work with your agent to package those into a validation skill. Repeatable process, less manual work.
The agent is finished. We can scroll through the window to see what it created and how to use it. Note that it chose to create this in the global skills area. This skill will now be usable across all projects. Also, Claude Code used the new skill to generate a CHANGELOG in this project. CHANGELOGs are how you talk to your stakeholders, including the agent. So, let’s open it and review it manually. Looks good. We are finished with this replanning work. Let’s wrap up with a commit. Then merge the branch. Now that most of your work as a developer is in planning and validation, rather than implementing, make time between features to replan. In the next video, we’ll work on another roadmap feature.
项目重新规划
摘要
讲述功能之间的重新规划阶段——更新项目章程(添加测试框架、响应式设计)、修订路线图,以及引入智能体技能(Agent Skills)进行工作流自动化。演示了创建更新日志(changelog)技能的过程。
关键要点
- 功能之间要重新规划:根据所学更新章程和路线图;使用单独的分支
- 智能体技能自动化可重复工作流:更新日志技能演示了如何为智能体打包指令
- 重新规划也改进流程:不仅是项目本身,你的 SDD 工作流也可以在功能之间不断优化
视频信息:项目重新规划
视频脚本(中文翻译)
我们成功实现了第一个功能。简直迫不及待想要一次次地继续下去。别急。退后一步,通过”重新规划(Replanning)“来进行反思。为了能跑得快,你得先慢下来。我们的工作流中有一个名为”验证”的步骤。测试是用于验证的好方法,但我们之前并没有把我们所有的测试偏好告诉智能体。让我们创建一个重新规划的代码分支,来更新我们项目章程中的技术栈。正如你在上一个视频中看到的,规格说明的版本控制是一个不断演进的话题。项目章程是一份活文档。在它自己单独的分支中对其进行更新是一种良好的实践,这样你就能追踪是它的哪个版本产生了哪些代码。我们将使用提示词来声明我们的策略。看起来智能体只在 package.json 中更新了一个 script,并没有添加依赖包。这是我们以后运行测试时需要注意的一点。这个添加测试框架的改变适用于未来的代码。但让我们告诉智能体,基于这次项目章程的变更,更新现有的功能规格和代码实现。在这两个提示词之后,我们得到了一些很好的修改。智能体设置了测试变更,但并没有自己编写测试代码。让我们告诉智能体写一些新的测试用例。有了这样的设置,我们就可以在编辑器中方便地运行测试了。让我们在调试器(debugger)下运行测试,这给了我们一个机会,作为回路中的人类参与者,去单步执行代码执行过程。看起来不错。我们现在有了作为验证环节一部分的测试功能。让我们提交代码(commit)。
有时我们会意识到产品计划中想做一些不一样的改动。例如,在实现第一个功能之后,我们从产品经理那里得到了一个更新:因为我们 40% 的用户都在使用移动设备,我们想强调响应式设计。让我们去找智能体。告诉智能体我们想要响应式设计,并更正产品规格说明、功能规格说明以及所有的相关代码。因为我们处于开发的极早期,这个更新是一个非常小的变动,所以直接在重新规划阶段实现它是合理的。但如果是一项庞大的新工作,最好将其安排在路线图上,作为单独的功能阶段来处理,而不是仅仅在重新规划里草草完成。请运用你的判断力。记住,我们希望规格说明能捕捉到各种决策,而不仅仅是去修改代码。我们想努力保持两者同步,以帮助团队沟通。智能体实现了我们的响应式修复,不仅更新了代码,还更新了产品和功能规格说明。现在该我们尽我们的责任来审查这些变更了。让我们看看 diff 差异比对。看起来不错。让我们进行一次提交。记住,小步快跑、频繁提交,能避免代码审查使你的大脑超载。
在这个重新规划的第一部分成功运转的同时,让我们退一步,做一些项目的内务管理。例如,让我们重新审视一下项目的路线图,看看下一个任务。它还有意义吗?路线图显示了我们在下节课要讲的下一个功能。它还是正确的选项吗?浏览路线图后发现,看起来功能 2、3、4、5 应该是一起连贯进行的。让我们更新路线图,将它们放在一步中处理。我们马上就会提交并开始这个新功能。
重新规划这一步可以是关于某一个功能的,也可以是关于整个项目的。但重新规划也可以是关于改进你的规格驱动开发(SDD)工作流的,它能跨越不同项目,跨越整个组织。例如,也许你有几个非技术背景的项目干系人,他们想监控项目的进度。你希望在每次合并到主分支(main)时自动更新一个更新日志(changelog)。大多数 AI 编程智能体都支持”技能(skills)“——这是一个打包了指令和资源的包,能为智能体提供新的能力和专业知识。技能非常适合于那些需要特定项目或组织上下文背景的、可明确且可重复的工作流。写一个用于实现更新日志变更的技能再好不过了。你可以手动编写这个技能,但许多智能体实际上自带”帮你写技能的技能”。让我们用智能体来帮助我们编写和维护一个更新日志技能。智能体开始工作了。我们需要考虑的一件事是,这个技能是本项目独有的吗?还是应该成为所有项目的标准配置?这是一种风格选择,随着使用的深入,你会对其有更好的理解。你将学会用技能来自动化你的 SDD 工作流。例如,你的验证步骤可能包括更新 readme、代码检查(linting)、格式化、编写测试,以及其他质量检查。你可以与你的智能体合作,将这些打包成一个”验证技能”。可重复的流程,更少的手工劳动。
智能体完成了。我们可以滚动查看窗口,看看它创建了什么以及如何使用它。注意,它选择在全球(全局)技能区创建这个技能。这个技能现在可以在所有项目中使用了。此外,Claude Code 还使用了这个新技能来生成该项目的 CHANGELOG。更新日志是你与项目干系人(包括智能体在内)沟通的方式。所以,让我们打开它并手动查看一下。看起来不错。我们完成了这项重新规划的工作。让我们以一次 commit 提交作为收尾。然后合并分支。既然现在你作为开发者的绝大部分工作都在计划和验证阶段,而不是实现阶段,请在不同功能之间留出时间重新规划。在下个视频中,我们将着手处理路线图上的另一个功能。