构建您自己的工作流
Build your own workflow
Summary
Covers automating the SDD workflow with Agent Skills, transitioning from MCP servers to CLI-based skills, and using community tools like Spec Kit and OpenSpec. Also introduces research backlogs for mid-feature ideas.
Key Takeaways
- Agent Skills automate repeatable prompts: package frequently-used prompts (like feature spec generation) into reusable skills
- MCP to CLI + Skills trend: CLI tools with skills are increasingly replacing MCP servers for lower setup cost and less context usage
- Community tools extend SDD: Spec Kit and OpenSpec provide pre-built SDD workflows; plugins add new capabilities to agents
English Script
You’ve now mastered an SDD workflow. Want something faster and lightweight? In this lesson, we will automate things but doing it our way with a custom process. We previously showed Agent Skills, an open standard to give agents new capabilities and expertise. For example, we repeat the same prompt when starting a feature spec. Do this, do that, write these three files. Let’s automate this with a skill and with help from the agent to write it. Ask the agent to use its skill creator to talk through this with us. As a note, there are many of these skill skills in the community that you can also install and use. As the agent runs, it might ask some follow-up questions. These are usually quite good. When the interview is done, we submit the responses and the agent proceeds. While the agent is working on the skill, keep an eye on the output. Is it making the choices you wanted? Success. As you can see, the agent wrote the skill to this directory. As a note, skills can be per project or global.
Skills can be invoked in several ways. In your prompt, refer to the skill before saying what to do. Also, you can ask the agent to call a skill from another skill. According to the skills open standard, agents use the skill description to decide when to call it in a process called progressive disclosure. But their judgment isn’t always perfect, especially as the context window gets larger. Use the same heuristic as file tagging. If you know you want a skill used, name it. That saves you some thinking tokens. Agents have built-in / commands like /clear. Though initially popular, many agents are moving from custom/commands over to skills.
Sometimes you need to give the agent more resources like access to some API, a private knowledge base, database, and so on. Until now the universal way to extend an agent has been MCP, Model Context Protocol. For example, agents need current quality context about packages. The most popular choice, Context7, an MCP that brings updated documentation of packages into your agent context. Now your agent can stay up to date with React 9.2 and higher instead of React 9.0. MCP servers are still popular, but skills that use code tools like a CLI, command line interface, often accomplish the same purpose more elegantly. Context7 now suggests this, a skill that calls a CLI tool for Context7. Let’s install the Context7 package for Claude Code. During the setup, we see this immediately. A choice between MCP server and CLI + Skills. We’ll use the second choice. If this is your first time, you’ll need to make an account. We already did so and logged in. Once done, we can go back into Claude Code and put it to use with an example prompt that uses Context7. As the agent runs, we see it detects the need to use Context7. When it completes, the agent shows it now knows how to find out information about our tech stack. This trend from MCP servers to skills plus CLI is accelerating. People are rethinking MCP because CLI tools can take action with less setup and less context usage.
As you scale your workflow implementation, skills, etc. You will want to share it with yourself, across machines, with teammates, perhaps with the outside world. Some agents such as Claude Code have plugins, a collection of agent extensions that can be installed and updated. There’s a growing community of free plugins. Check them out to see if any will boost your SDD productivity. Remember, plugins are not yet a cross-agent standard. Like apps or dependencies, plugins can execute code, so make sure you trust them on install and update. GitHub’s Spec Kit is one attempt at formalizing a spec-driven development workflow with agents. Installing Spec Kit for a project gives you access to / commands in your agent, similar to the workflow you used in this course. spec-kit constitution, plan, tasks, and implement. Another popular alternative is OpenSpec from Fission AI. OpenSpec follows a similar propose, explore, apply, archive workflow, where propose and explore match with the plan step, apply matches with implement, and archive matches with replanning. It also has canonical patterns for quick features. Both packages include helpful features like branch management, verification scripts, and opinionated spec document formats. I encourage you to experiment with these open source workflows to help refine your own.
Sometimes in the middle of a feature, you have an idea. You want to research it with the agent, but you don’t want to stop your branch work. For example, a choice of databases. But you’re not yet committed to this idea, so you don’t want it on the roadmap. The conversation produces some good ideas and some good questions. We accept most of the recommendations, but change our mind on one of them. You don’t want to lose it. So, let’s keep a backlog of research by telling the agent to write a report in a well-known location. This file is a record of your conversation and results. You can later ask the agent to schedule this research on the roadmap with a link to the backlog file. As this grows, you can write a skill to automate your research. Spec-Driven Development helps the agent write code your way. You can adopt an existing SDD framework or tool, then customize it using skills to operate your projects with your team, your way.
构建您自己的工作流
摘要
讲述使用智能体技能(Agent Skills)自动化 SDD 工作流、从 MCP 服务器向基于 CLI 的技能过渡,以及使用社区工具如 Spec Kit 和 OpenSpec。同时介绍了用于记录功能开发中途想法的研究积压清单。
关键要点
- 智能体技能自动化重复提示:将常用提示词(如功能规格说明生成)打包为可复用的技能
- MCP 向 CLI + 技能的趋势:带技能的 CLI 工具正逐步取代 MCP 服务器,设置成本更低、上下文占用更少
- 社区工具扩展 SDD:Spec Kit 和 OpenSpec 提供预构建的 SDD 工作流;插件为智能体增加新能力
视频信息:构建您自己的工作流
视频脚本(中文翻译)
你现在已经掌握了一套 SDD 工作流。想要更快速、更轻量级的做法吗?在本节课中,我们将把事情自动化,但会以我们自己自定义流程的方式来做。我们之前展示过”智能体技能(Agent Skills)“,这是一种为智能体提供新能力和专业知识的开放标准。例如,我们在开始编写功能规范时会重复相同的提示词:做这个,做那个,写这三个文件。让我们用一个”技能”把它自动化,并在智能体的帮助下来编写它。要求智能体使用它的”技能创造器(skill creator)“与我们探讨如何实现它。值得注意的是,社区中有很多这种”生成技能的技能”,你也可以安装和使用它们。在智能体运行时,它可能会提出一些跟进问题。这些问题通常都很好。当访谈结束后,我们提交回复,智能体就会继续工作。当智能体在编写技能时,密切关注它的输出。它做出了你想要的选择吗?成功了。正如你所看到的,智能体将技能写入了这个目录。顺便说一下,技能可以是项目级别的,也可以是全局级别的。
技能可以通过几种方式被调用。在你的提示词中,在告诉它要做什么之前,先提到这个技能的名字。此外,你还可以要求智能体从一个技能中去调用另一个技能。根据技能开放标准,智能体会通过一个被称为”渐进式披露(progressive disclosure)“的过程,使用技能描述来决定何时调用它。但它们的判断并不总是完美的,尤其是当上下文窗口变大时。使用与文件打标签相同的启发式方法:如果你明知想要使用某个技能,那就直接点名。这能为你节省一些 AI 的推理 Token。智能体有内置的 / 命令,比如 /clear。尽管这些自定义命令最初很流行,但许多智能体正在从自定义 / 命令转向使用”技能”。
有时你需要给智能体提供更多的资源,比如访问某个 API、私有知识库、数据库等等。到目前为止,扩展智能体的通用方法一直是 MCP(Model Context Protocol,模型上下文协议)。例如,智能体需要关于依赖包的、最新高质量的上下文。最受欢迎的选择是 Context7,这是一个将各类包的最新文档引入你的智能体上下文的 MCP 服务器。现在你的智能体可以跟进 React 9.2 或更高版本,而不是停留在老旧的 React 9.0 上。MCP 服务器仍然很受欢迎,但使用代码工具(比如 CLI 命令行界面)的”技能”往往能更优雅地实现相同的目的。Context7 官方现在也建议这样做:使用一个调用 Context7 CLI 工具的技能。让我们为 Claude Code 安装 Context7 包。在设置过程中,我们马上就看到了这个选项。在 MCP 服务器和 CLI + Skills 之间做选择。我们将使用第二个选项。如果你是第一次使用,你需要注册一个账号。我们已经注册并登录了。完成后,我们可以回到 Claude Code 中,并使用一个带有 Context7 调用的示例提示词来测试。当智能体运行时,我们看到它检测到了需要使用 Context7。完成后,智能体展示出它现在知道如何查找关于我们技术栈的最新信息了。这种从 MCP 服务器转向”技能 + CLI”的趋势正在加速。人们在重新思考 MCP,因为 CLI 工具只需更少的设置和更少的上下文开销就能执行操作。
随着你的工作流实现和各项技能规模的扩大,你将希望在不同机器之间与自己共享,或者与队友分享,甚至可能是与外部世界分享。一些智能体(如 Claude Code)拥有插件(plugins),这是一种可以安装和更新的智能体扩展合集。目前有一个不断壮大的免费插件社区。去看看它们,看是否有任何插件能提升你的 SDD 生产力。请记住,插件目前还不是跨智能体的通用标准。像各种应用程序或代码依赖项一样,插件是可以执行代码的,因此在安装和更新时请确保你信任它们。GitHub 的 Spec Kit 是通过智能体将规格驱动开发工作流形式化的一种尝试。为一个项目安装 Spec Kit,你就可以在你的智能体中使用专属的 / 命令,这类似于你在这门课程中使用的流程。如:spec-kit constitution、plan、tasks 和 implement。另一个流行的替代方案是来自 Fission AI 的 OpenSpec。OpenSpec 遵循一个类似的”提出(propose)、探索(explore)、应用(apply)、归档(archive)“的工作流。其中提出和探索对应计划(plan)步骤,应用对应实现(implement),归档对应重新规划(replanning)。它还具有用于快速开发功能的规范化模式。这两个包都包含很有用的功能,比如分支管理、验证脚本以及一些自成一派的主观规格文档格式。我鼓励你尝试这些开源工作流,来帮助改进你自己的工作流。
有时候,在一个功能开发到一半时,你突然有了一个主意。你想和智能体一起研究一下它,但你不想中止当前分支的工作。例如,对不同数据库的选择。但你还没完全下定决心采用这个主意,所以你暂时不想把它放到路线图上。在这番对话中,你们产生了一些好主意和好问题。我们接受了大部分的建议,但对其中一个改变了主意。你不想丢失这些宝贵的探讨。因此,让我们要求智能体在一个常用的文档位置写一份报告,来保留一份”研究积压清单(backlog)“。这个文件是你对话和研究结果的记录。之后你可以要求智能体将这项研究安排到未来的路线图上,并附带这个积压清单文件的链接。随着研究清单的增加,你可以编写一个技能来自动化你的调研工作。规格驱动开发帮助智能体以你期望的方式编写代码。你可以采用现有的 SDD 框架或工具,然后利用技能(skills)进行自定义,从而以你和你团队喜欢的方式来运营你们的项目。