Community编程与开发github.com

提出功能需求规格

使用EARS表示法创建或更新功能需求规格说明书,包含示例和附录。

提出功能需求规格 是什么?

该技能用于为AI Agent(如Claude Code、Cursor、Codex等)生成结构化的功能需求规格说明书。它基于“功能概念文档”自动创建需求文件,要求所有需求使用EARS(WHILE/WHEN/WHERE/THEN/SHALL)关键词来确保可测试性和精确性。技能支持定义功能性需求、非功能性需求(包括可扩展性指标)和错误处理逻辑,并建议将大型示例放入附录以保持正文简洁。通过该技能,开发者可以系统地将功能概念转化为具体的、可验证的系统行为规范,为后续的设计阶段奠定坚实基础。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/cbgbt/bottlerocket-forest/tree/main/skills/propose-feature-requirements

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

提出功能需求规格技能

目的

使用EARS表示法为功能创建正式的需求规格说明书。将概念转化为可测试的、具体的要求。

何时使用

  • 功能概念已存在并获得批准
  • 需要明确指定系统必须执行的操作
  • 准备好定义功能性和非功能性需求

前置条件

  • 功能概念文档存在于 docs/features/NNNN-feature-name/concept.md
  • 概念已经过审查并获得批准
  • 用户理解功能范围

步骤

1. 验证概念是否存在

# 检查概念是否存在
ls ./docs/features/NNNN-feature-name/concept.md

如果不存在,请先使用 提出功能概念 技能。

2. 检查想法打磨文档

ls ./planning/NNNN-feature-name/idea-honing.md 2>/dev/null

如果存在,请审阅其中见解以指导需求。问答环节可能揭示边缘情况和约束条件。

3. 复制需求模板

cp ./docs/features/0000-templates/requirements.md ./docs/features/NNNN-feature-name/

4. 确定需求前缀

为需求ID选择一个短前缀(2-5个字符):

  • 应能描述该功能
  • 示例:SEM 表示语义搜索,REG 表示注册管理
  • 使用方式如 SEM-1、SEM-2 等

5. 填写概述

编写本规格涵盖内容的简要描述。可参考概念文档。

6. 定义功能性需求

对每个需求使用EARS格式:

**WHILE** [状态或条件]
**WHEN** [触发条件或事件]
**THEN** 系统 **SHALL** [所需行为]

仅当示例非常简短(1-3行)时才添加内联示例:

key = "value"

对于较大的示例,请注明放入附录。

7. 定义非功能性需求

添加性能、可用性、安全性或其他质量需求:

**WHILE** [运行条件]
**THEN** 系统 **SHALL** [性能需求]

可扩展性提示(对每个主要操作提出以下问题):

  • 当项目数量增加1000倍时会发生什么?100万个文件?1000万行?
  • 内存使用量应随数据大小变化,还是保持恒定?
  • 可接受的延迟是多少?是否随规模增长而劣化?

这些问题会揭示约束条件,这些约束在设计阶段将成为关键约束。 如果某个操作必须是 O(1) 内存或 O(log n) 时间,请在此处说明。

8. 定义错误处理

指定应如何处理错误:

**WHILE** [操作进行中]
**WHERE** [错误条件发生]
**THEN** 系统 **SHALL** [错误处理行为]

9. 添加附录

对于会扰乱需求的较大示例:

  • API响应模式
  • 配置文件格式
  • 数据结构
  • 协议规范

每个附录应清晰标注:

## 附录 A:API响应模式
## 附录 B:配置文件格式

10. 审查完整性

确保:

  • 所有需求均使用EARS关键词
  • 需求可测试且具体
  • 内联示例确实短小
  • 较大示例已放入附录
  • 需求具有所选前缀的唯一ID

验证

验证需求文档:

# 检查文件是否存在
ls ./docs/features/NNNN-feature-name/requirements.md

# 验证文件有内容
head -50 ./docs/features/NNNN-feature-name/requirements.md

# 检查EARS关键词
grep -E "WHILE|WHEN|WHERE|THEN|SHALL" ./docs/features/NNNN-feature-name/requirements.md

常见问题

缺少EARS关键词:每个需求都应使用 WHILE/WHEN/WHERE/THEN/SHALL。

过于模糊:需求应足够具体以便测试。

内联示例过大:将超过3行的内容移至附录。

前缀不一致:所有需求ID应使用相同前缀。

后续步骤

创建需求后:

  1. 审查完整性和可测试性
  2. 征求实现者的反馈
  3. 需求确定后,使用 提出功能设计 技能进入设计阶段

Individual skills in this repo

This repo contains 19 individual skills — each has its own dedicated page.

ad-hoc-implementation-plan

Transform a rough plan into implement-commit ready artifacts. Allows rigorous review while implementing.

build-kit-locally

Build a kit and publish it to a locally hosted registry for development testing

build-variant-from-local-kits

Build a variant using locally published kits for development validation

deep-research

Create educational documents that build understanding progressively with citations

edit-spec-file

Edit Bottlerocket RPM spec files following project style conventions

fact-find

Quick lookup of specific facts about Bottlerocket with citations

idea-honing

Clarify feature ideas through iterative Q&A, recording insights to guide concept development

implement-commit

Implement commits from an implementation plan using a TDD pipeline

local-registry

Start and manage a local OCI registry for Bottlerocket kit development

prepare-core-kit-release

Prepare bottlerocket-core-kit for release by bumping version and updating changelog

propose-feature-concept

Create a new feature concept document to pitch the idea and explain the problem/solution

propose-feature-design

Create or update feature technical design document with architecture and implementation guidance

propose-feature-test-plan

Create a test plan mapping EARS requirements and Critical Constraints to specific tests

propose-implementation-plan

Create an implementation plan with atomic commits that build toward a complete feature

review-code

Deep code review generating PR comments via principled question-driven analysis

review-scope

Verify code changes match intended scope and requirements without exceeding boundaries

review-style

Verify code follows project style guides without providing improvement suggestions

test-local-twoliter

Build and test local changes to twoliter before releasing

update-twoliter

Update all Bottlerocket repositories to a new Twoliter version

相关技能