跳转到内容

to-spec

这个 skill 会根据当前会话上下文和对代码库的理解编写规格。不要采访用户,只综合你们已经讨论过的内容。

issue 跟踪系统和分类标签词汇应该已经提供给你。如果没有,请让用户运行 /setup-matt-pocock-skills。

  1. 如果你还不了解代码库的当前状态,先探索仓库。编写规格时全程使用项目领域词汇表中的术语,并遵守你要修改的部分所涉及的架构决策记录(ADR)。

  2. 梳理你打算在哪些位置测试这个功能。优先使用现有的测试接缝,并选择层级最高的接缝。如果需要新的接缝,尽可能在最高层提出。接缝越少越好,理想情况下只有一个。

和用户确认这些接缝是否符合他们的预期。

  1. 使用下面的模板编写规格,然后发布到项目的 issue 跟踪系统。加上 ready-for-agent 分类标签,无需额外分类。

从用户的角度描述他们遇到的问题。

从用户的角度描述解决问题的方案。

编写一份很长的编号用户故事列表。每条用户故事都要采用以下格式:

  1. 作为一名<角色>,我想要<功能>,这样就能<好处>
1. 作为一名手机银行客户,我想查看自己各个账户的余额,这样就能更清楚地了解自己的消费情况

这份列表要尽可能详尽,覆盖功能的各个方面。

列出已经做出的实现决策。内容可以包括:

  • 要构建或修改的模块
  • 这些模块中要修改的接口
  • 开发者提供的技术说明
  • 架构决策
  • 结构变更
  • API 契约
  • 具体交互方式

不要写具体文件路径或代码片段,因为它们很快就可能过时。

例外:如果 prototype 产出的代码片段比文字更准确地表达了一项决策,例如状态机、reducer、结构定义,可以把它放在相关决策中,并简要说明它来自 prototype。只保留能明确表达决策的部分,不要放入完整示例。

列出测试方面的决策。包括:

  • 好的测试应具备哪些特点,例如只测试外部行为,不测试实现细节
  • 要测试哪些模块
  • 测试的先例,也就是代码库中类似测试的例子

描述这份规格不涵盖的内容。

补充这项功能的其他说明。

读者要自己输入 /to-spec 才会用到它。它在 Claude Code 插件里。

根据当前会话和代码库信息编写规格,并发布到项目的 issue 跟踪系统。此 skill 不要求采访用户,只综合已有讨论。

Turn the current conversation into a spec and publish it to the project issue tracker: no interview, just synthesis of what you've already discussed.
英文 SKILL.md
---
name: to-spec
description: "Turn the current conversation into a spec and publish it to the project issue tracker: no interview, just synthesis of what you've already discussed."
disable-model-invocation: true
---
This skill takes the current conversation context and codebase understanding and produces a spec. Do NOT interview the user; just synthesize what you already know.
The issue tracker and triage label vocabulary should have been provided to you. If not, tell the user to run `/setup-matt-pocock-skills`.
## Process
1. Explore the repo to understand the current state of the codebase, if you haven't already. Use the project's domain glossary vocabulary throughout the spec, and respect any ADRs in the area you're touching.
2. Sketch out the seams at which you're going to test the feature. Existing seams should be preferred to new ones. Use the highest seam possible. If new seams are needed, propose them at the highest point you can. The fewer seams across the codebase, the better - the ideal number is one.
Check with the user that these seams match their expectations.
3. Write the spec using the template below, then publish it to the project issue tracker. Apply the `ready-for-agent` triage label - no need for additional triage.
<spec-template>
## Problem Statement
The problem that the user is facing, from the user's perspective.
## Solution
The solution to the problem, from the user's perspective.
## User Stories
A LONG, numbered list of user stories. Each user story should be in the format of:
1. As an <actor>, I want a <feature>, so that <benefit>
<user-story-example>
1. As a mobile bank customer, I want to see balance on my accounts, so that I can make better informed decisions about my spending
</user-story-example>
This list of user stories should be extremely extensive and cover all aspects of the feature.
## Implementation Decisions
A list of implementation decisions that were made. This can include:
- The modules that will be built/modified
- The interfaces of those modules that will be modified
- Technical clarifications from the developer
- Architectural decisions
- Schema changes
- API contracts
- Specific interactions
Do NOT include specific file paths or code snippets. They may end up being outdated very quickly.
Exception: if a prototype produced a snippet that encodes a decision more precisely than prose can (state machine, reducer, schema, type shape), inline it within the relevant decision and note briefly that it came from a prototype. Trim to the decision-rich parts, not a working demo, just the important bits.
## Testing Decisions
A list of testing decisions that were made. Include:
- A description of what makes a good test (only test external behavior, not implementation details)
- Which modules will be tested
- Prior art for the tests (i.e. similar types of tests in the codebase)
## Out of Scope
A description of the things that are out of scope for this spec.
## Further Notes
Any further notes about the feature.
</spec-template>

非官方学习站,与 Matt Pocock 和 AI Hero 没有隶属关系。本站不提供可安装的中文技能包。

技能原文采用 MIT 许可。Copyright (c) 2026 Matt Pocock

鲁ICP备2025189036号