简介
专业级需求转化工具,基于 INVEST 原则与 MoSCoW 框架,将用户画像转为结构化开发规格,确保需求可测试、可交付。
原始描述
Convert persona docs into detailed feature specifications with acceptance criteria. Use when translating user needs into implementable specs, writing user stories, defining acceptance criteria, or preparing features for development.
通过你的 Agent 添加
安装目录:feature-specification/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
feature-specification 是一款面向产品经理与开发团队的Meta Skill(元技能),核心使命是弥合「用户画像」与「技术实现」之间的鸿沟。它不提供可执行代码,而是一套完整的功能规格编写方法论与模板系统。
使用流程
- 前置依赖:先完成
docs/PERSONA.md 用户画像文档,明确目标用户与痛点
- 触发场景:在
/new-feature 工作流或手动开发前调用
- 输出交付:生成标准化的
docs/specs/ 规格文档,包含:
- Metadata(优先级、目标用户、工作量估算)
- Problem Statement(关联画像痛点)
- User Stories(符合 INVEST 原则的用户故事)
- Acceptance Criteria(Given-When-Then 格式的 Gherkin 场景)
- Edge Cases & Non-Functional Requirements(边界与安全要求)
- Dependencies & Out of Scope(依赖管理与范围控制)
显著优点
维度
价值
标准化
强制统一的 MoSCoW 优先级框架与 INVEST 用户故事标准,消除团队沟通歧义
可追溯性
每个功能必须关联具体 Persona 痛点,防止「技术自嗨」式开发
验收驱动
Gherkin 格式的验收标准可直接转化为自动化测试用例(BDD 友好)
安全零负担
纯 Markdown 模板,无代码执行、无网络请求、无依赖
潜在局限
- 非自动化工具:仅提供编写规范,不自动生成代码或执行验证
- 强依赖前置文档:若 Persona 文档缺失或质量差,输出质量显著下降
- 模板僵化风险:团队可能机械套用模板而忽视实际业务上下文
- 维护成本:规格文档需随需求变更同步更新,否则成为「文档债务」
适合人群
- 产品经理:将用户研究转化为可落地的开发任务
- 技术负责人:在 Sprint 规划前明确范围边界与验收标准
- QA 工程师:基于 Given-When-Then 场景设计测试用例
- 敏捷团队:需要结构化用户故事与 MoSCoW 优先级对齐的场景
常规风险
风险类型
描述
缓解措施
范围蔓延
未严格执行「Out of Scope」章节导致需求膨胀
在评审环节强制检查 Out of Scope 完整性
验收标准遗漏
仅覆盖 Happy Path,忽略边界与错误场景
使用模板内置的「Edge Cases」检查清单
优先级误判
技术兴趣驱动而非用户价值驱动
强制要求每个 P0 必须阻断用户核心目标
来源与安全评估
docs/PERSONA.md 用户画像文档,明确目标用户与痛点/new-feature 工作流或手动开发前调用docs/specs/ 规格文档,包含:
- Metadata(优先级、目标用户、工作量估算)
- Problem Statement(关联画像痛点)
- User Stories(符合 INVEST 原则的用户故事)
- Acceptance Criteria(Given-When-Then 格式的 Gherkin 场景)
- Edge Cases & Non-Functional Requirements(边界与安全要求)
- Dependencies & Out of Scope(依赖管理与范围控制)
| 维度 | 价值 |
|---|---|
| 标准化 | 强制统一的 MoSCoW 优先级框架与 INVEST 用户故事标准,消除团队沟通歧义 |
| 可追溯性 | 每个功能必须关联具体 Persona 痛点,防止「技术自嗨」式开发 |
| 验收驱动 | Gherkin 格式的验收标准可直接转化为自动化测试用例(BDD 友好) |
| 安全零负担 | 纯 Markdown 模板,无代码执行、无网络请求、无依赖 |
潜在局限
- 非自动化工具:仅提供编写规范,不自动生成代码或执行验证
- 强依赖前置文档:若 Persona 文档缺失或质量差,输出质量显著下降
- 模板僵化风险:团队可能机械套用模板而忽视实际业务上下文
- 维护成本:规格文档需随需求变更同步更新,否则成为「文档债务」
适合人群
- 产品经理:将用户研究转化为可落地的开发任务
- 技术负责人:在 Sprint 规划前明确范围边界与验收标准
- QA 工程师:基于 Given-When-Then 场景设计测试用例
- 敏捷团队:需要结构化用户故事与 MoSCoW 优先级对齐的场景
常规风险
风险类型
描述
缓解措施
范围蔓延
未严格执行「Out of Scope」章节导致需求膨胀
在评审环节强制检查 Out of Scope 完整性
验收标准遗漏
仅覆盖 Happy Path,忽略边界与错误场景
使用模板内置的「Edge Cases」检查清单
优先级误判
技术兴趣驱动而非用户价值驱动
强制要求每个 P0 必须阻断用户核心目标
来源与安全评估
- 产品经理:将用户研究转化为可落地的开发任务
- 技术负责人:在 Sprint 规划前明确范围边界与验收标准
- QA 工程师:基于 Given-When-Then 场景设计测试用例
- 敏捷团队:需要结构化用户故事与 MoSCoW 优先级对齐的场景
常规风险
风险类型
描述
缓解措施
范围蔓延
未严格执行「Out of Scope」章节导致需求膨胀
在评审环节强制检查 Out of Scope 完整性
验收标准遗漏
仅覆盖 Happy Path,忽略边界与错误场景
使用模板内置的「Edge Cases」检查清单
优先级误判
技术兴趣驱动而非用户价值驱动
强制要求每个 P0 必须阻断用户核心目标
来源与安全评估
| 风险类型 | 描述 | 缓解措施 |
|---|---|---|
| 范围蔓延 | 未严格执行「Out of Scope」章节导致需求膨胀 | 在评审环节强制检查 Out of Scope 完整性 |
| 验收标准遗漏 | 仅覆盖 Happy Path,忽略边界与错误场景 | 使用模板内置的「Edge Cases」检查清单 |
| 优先级误判 | 技术兴趣驱动而非用户价值驱动 | 强制要求每个 P0 必须阻断用户核心目标 |
该 Skill 来自 GitHub 用户 wpank 的公开仓库,属个人开发者/社区项目(T3 级别)。经 CLS-Certify v2.1.0 扫描:
- 3 个文件 / 334 行代码,0 可执行行
- 100 分满分,S+ 顶级安全评级
- 无第三方依赖、无网络请求、无数据收集、无敏感权限
结论:可放心用于生产环境的文档编写工作流,无需额外安全加固。
技能正文
name: feature-specification
model: reasoning
description: Convert persona docs into detailed feature specifications with acceptance criteria. Use when translating user needs into implementable specs, writing user stories, defining acceptance criteria, or preparing features for development.
Feature Specification (Meta-Skill)
Bridge persona documentation and development. This skill translates user needs, pain points, and journeys identified in persona docs into structured, implementable feature specifications with clear acceptance criteria.
Installation
OpenClaw / Moltbot / Clawbot
npx clawhub@latest install feature-specification
Purpose
Persona docs define who and why. Feature specs define what and how well. This skill closes the gap:
- Extracts actionable features from persona pain points and journeys
- Structures requirements so developers know exactly what to build
- Defines acceptance criteria so QA knows exactly what to verify
- Prevents scope ambiguity before a single line of code is written
When to Use
- After persona docs exist (
docs/PERSONA.md or docs/personas/)
- Before development begins on a new feature or product
- When a feature request lacks clear acceptance criteria
- When stakeholders disagree on what "done" means
- When converting user feedback into development work
Feature Spec Template
docs/PERSONA.md or docs/personas/)Use this structure for every feature specification. Place specs in docs/specs/ or docs/features/.
# Feature: [Feature Name]
## Metadata
- **Priority:** [Must / Should / Could / Won't]
- **Target Persona:** [Persona name from persona docs]
- **Status:** Draft | Review | Approved | In Progress | Complete
- **Estimated Effort:** [T-shirt size: XS / S / M / L / XL]
## Problem Statement
[Directly reference the persona pain point this feature addresses.
Quote or link to the relevant section of persona docs.]
## Solution Description
[High-level description of what the feature does and how it solves
the problem. 2-4 sentences. No implementation details.]
## User Stories
- As a [persona], I want [action], so that [benefit].
- As a [persona], I want [action], so that [benefit].
## Acceptance Criteria
### Scenario: [Happy path description]
- **Given** [precondition]
- **When** [action]
- **Then** [expected result]
### Scenario: [Alternative path description]
- **Given** [precondition]
- **When** [action]
- **Then** [expected result]
### Scenario: [Error case description]
- **Given** [precondition]
- **When** [invalid action]
- **Then** [error handling result]
## Edge Cases
- [ ] [Edge case 1 — description and expected behavior]
- [ ] [Edge case 2 — description and expected behavior]
## Non-Functional Requirements
- **Performance:** [Response time, throughput, load targets]
- **Accessibility:** [WCAG level, keyboard nav, screen reader support]
- **Security:** [Auth requirements, data sensitivity, input validation]
- **Browser/Device:** [Support matrix]
## Dependencies
- [Feature or system this depends on]
- [External API or service required]
## Out of Scope
- [Explicitly list what this feature does NOT include]
- [Prevents scope creep during development]
## Design References
- [Link to mockups, wireframes, or design system components]
- [Screenshots or diagrams if available]
Writing Effective User Stories
User stories connect persona needs to developer tasks. Apply the INVEST criteria:
| Criterion | Meaning | Test Question |
|---|---|---|
| Independent | No ordering dependency on others | Can this be built and released alone? |
| Negotiable | Details can be discussed | Is this a conversation starter, not a contract? |
| Valuable | Delivers value to the persona | Would the persona care about this? |
| Estimable | Team can estimate effort | Is the scope clear enough to size? |
| Small | Fits in a single iteration | Can this ship in one sprint? |
| Testable | Clear pass/fail verification | Can QA write a test for this? |
Good vs Bad User Stories
Bad
Why It's Bad
Good
"Users can log in"
No persona, no benefit
"As a returning customer, I want to log in with my email, so that I can access my order history"
"Make it fast"
Vague, untestable
"As a mobile user on 3G, I want the product list to load in under 2s, so that I don't abandon the page"
"Add admin panel"
Solution-first, no problem
"As a store manager, I want to update product prices without developer help, so that I can respond to market changes daily"
"Handle errors"
No specificity
"As a checkout user, I want clear feedback when my payment fails, so that I know whether to retry or use a different card"
"Implement caching"
Implementation detail, not a story
"As a repeat visitor, I want previously viewed pages to load instantly, so that browsing feels responsive"
Acceptance Criteria Patterns
Pattern 1: Happy Path
Given a logged-in customer with items in their cart
When they click "Checkout"
Then they are taken to the payment page with their cart summary visible
Pattern 2: Boundary Conditions
Given a cart with 100 items (maximum allowed)
When the user tries to add another item
Then they see "Cart limit reached — remove an item to add a new one"
And the item is NOT added to the cart
Pattern 3: Error Cases
Given a user submitting the registration form
When the email field contains "not-an-email"
Then the form shows inline validation: "Enter a valid email address"
And the form is NOT submitted
And focus moves to the email field
Pattern 4: State Transitions
Given an order with status "Processing"
When the warehouse marks it as shipped
Then the order status changes to "Shipped"
And the customer receives a shipping confirmation email within 5 minutes
And the tracking number is visible on the order detail page
Pattern 5: Negative / Security
Given a user who is NOT the account owner
When they attempt to access /account/settings via direct URL
Then they receive a 403 Forbidden response
And the access attempt is logged
Priority Framework
| Bad | Why It's Bad | Good |
|---|---|---|
| "Users can log in" | No persona, no benefit | "As a returning customer, I want to log in with my email, so that I can access my order history" |
| "Make it fast" | Vague, untestable | "As a mobile user on 3G, I want the product list to load in under 2s, so that I don't abandon the page" |
| "Add admin panel" | Solution-first, no problem | "As a store manager, I want to update product prices without developer help, so that I can respond to market changes daily" |
| "Handle errors" | No specificity | "As a checkout user, I want clear feedback when my payment fails, so that I know whether to retry or use a different card" |
| "Implement caching" | Implementation detail, not a story | "As a repeat visitor, I want previously viewed pages to load instantly, so that browsing feels responsive" |
Pattern 1: Happy Path
Given a logged-in customer with items in their cart
When they click "Checkout"
Then they are taken to the payment page with their cart summary visible
Given a cart with 100 items (maximum allowed)
When the user tries to add another item
Then they see "Cart limit reached — remove an item to add a new one"
And the item is NOT added to the cart
Pattern 3: Error Cases
Given a user submitting the registration form
When the email field contains "not-an-email"
Then the form shows inline validation: "Enter a valid email address"
And the form is NOT submitted
And focus moves to the email field
Pattern 4: State Transitions
Given an order with status "Processing"
When the warehouse marks it as shipped
Then the order status changes to "Shipped"
And the customer receives a shipping confirmation email within 5 minutes
And the tracking number is visible on the order detail page
Pattern 5: Negative / Security
Given a user who is NOT the account owner
When they attempt to access /account/settings via direct URL
Then they receive a 403 Forbidden response
And the access attempt is logged
Priority Framework
Given a user submitting the registration form
When the email field contains "not-an-email"
Then the form shows inline validation: "Enter a valid email address"
And the form is NOT submitted
And focus moves to the email field
Given an order with status "Processing"
When the warehouse marks it as shipped
Then the order status changes to "Shipped"
And the customer receives a shipping confirmation email within 5 minutes
And the tracking number is visible on the order detail page
Pattern 5: Negative / Security
Given a user who is NOT the account owner
When they attempt to access /account/settings via direct URL
Then they receive a 403 Forbidden response
And the access attempt is logged
Priority Framework
Given a user who is NOT the account owner
When they attempt to access /account/settings via direct URL
Then they receive a 403 Forbidden response
And the access attempt is logged
Apply MoSCoW prioritization, anchored to persona impact:
| Priority | Label | Definition | Persona Alignment |
|---|---|---|---|
| P0 | Must | Product is unusable without this | Blocks the persona's primary goal |
| P1 | Should | Significant value, painful to defer | Addresses a top-3 pain point |
| P2 | Could | Nice to have, enhances experience | Improves a secondary journey |
| P3 | Won't | Explicitly deferred (this release) | Low-frequency need or niche scenario |
Prioritization process:
- List all candidate features
- Map each to a persona pain point or journey step
- Assign MoSCoW based on persona impact, not technical interest
- Validate: Do all P0s together form a usable product for the target persona?
- Cut scope until P0s are achievable in the timeline
Specification Anti-Patterns
Anti-Pattern
Example
Fix
Vague requirement
"System should be user-friendly"
Define measurable criteria: "Task completion in < 3 clicks"
Missing edge cases
Only specifying the happy path
Add boundary, error, and concurrent-use scenarios
No acceptance criteria
"Implement search"
Add Given/When/Then for each scenario
Solution masquerading as need
"Use Redis for caching"
State the need: "Repeat queries return in < 50ms"
Missing personas
"Users can export data"
Specify which persona and why they export
Unbounded scope
"Support all file formats"
List exact formats: "PDF, CSV, XLSX"
Implicit assumptions
Assuming auth exists without stating it
List all dependencies explicitly
Integration with Workflow
| Anti-Pattern | Example | Fix |
|---|---|---|
| Vague requirement | "System should be user-friendly" | Define measurable criteria: "Task completion in < 3 clicks" |
| Missing edge cases | Only specifying the happy path | Add boundary, error, and concurrent-use scenarios |
| No acceptance criteria | "Implement search" | Add Given/When/Then for each scenario |
| Solution masquerading as need | "Use Redis for caching" | State the need: "Repeat queries return in < 50ms" |
| Missing personas | "Users can export data" | Specify which persona and why they export |
| Unbounded scope | "Support all file formats" | List exact formats: "PDF, CSV, XLSX" |
| Implicit assumptions | Assuming auth exists without stating it | List all dependencies explicitly |
Feature specs connect to the broader development process:
- Persona docs (
docs/PERSONA.md) — Source of truth for user needs - Feature specs (
docs/specs/) — This skill's output; the development contract - Task creation — Each spec becomes one or more development tasks
- Implementation — Developers reference the spec for scope and criteria
- Testing — QA derives test cases directly from acceptance criteria
- Review — PR reviews check that acceptance criteria are met
When using with the /new-feature command or similar workflows:
- Read the relevant persona doc first
- Generate the spec using this template
- Validate acceptance criteria cover happy path, errors, and edge cases
- Confirm priority with stakeholders before development begins
NEVER Do
- NEVER write a spec without referencing a persona — every feature exists for a user
- NEVER skip acceptance criteria — "obvious" requirements cause the most bugs
- NEVER use vague qualifiers as requirements — "fast", "easy", "intuitive" are not testable
- NEVER combine multiple features in one spec — one spec, one feature, one clear scope
- NEVER specify implementation details in user stories — describe the what, not the how
- NEVER mark a spec as Approved without edge cases documented — happy paths are the easy part
- NEVER assume dependencies are obvious — list every system, API, feature, and data source the spec relies on
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。