Community程式設計與開發github.com

提出功能需求規格

使用 EARS 標記法建立或更新功能需求規格,並附上範例與附錄。

提出功能需求規格 是什麼?

此技能旨在協助開發者建立正式的功能需求規格文件,採用 EARS(Easy Approach to Requirements Syntax)標記法,將功能構想轉化為可測試、明確的需求描述。其核心價值在於強制開發者以 WHILE/WHEN/WHERE/THEN/SHALL 等關鍵字結構化撰寫功能性與非功能性需求,確保每個需求都具備可驗證性與明確邊界條件。支援在 `docs/features/NNNN-feature-name/` 目錄下操作,並搭配預設範本與驗證腳本,自動檢查 EARS 關鍵字是否存在。此技能適用於 Claude Code、Cursor 等支援 Markdown 文件生成的 AI 編碼代理,並建議在概念文件已審核通過後使用,最終產出可銜接至後續的設計階段。

相容平台~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

如果不存在,請先使用 propose-feature-concept 技能。

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. 需求穩固後,使用 propose-feature-design 技能進入設計階段

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

相關技能