npx skills add https://github.com/ibutters/claudecodeplugins --skill 'EARS Notation'EARS(简易需求语法方法)是一种用于编写明确、可测试验收标准的正式表示法。
每个验收标准都遵循带有大写关键词的严格模式。关键词 SHALL 是强制性的——切勿使用 "should"、"must"、"will"、"can" 或 "may"。
THE [系统] SHALL [行为]
用于始终有效、没有前提条件的需求。
示例: THE System SHALL encrypt all passwords using bcrypt
WHEN [事件] THE [系统] SHALL [响应]
当特定触发器引发行为时使用。
示例: WHEN a user submits the login form THE System SHALL validate credentials
WHILE [状态] THE [系统] SHALL [行为]
用于只要条件为真就持续发生的行为。
示例: WHILE the user is authenticated THE System SHALL display the dashboard
WHERE [功能存在] THE [系统] SHALL [行为]
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
用于依赖于功能标志或配置的行为。
示例: WHERE two-factor authentication is enabled THE System SHALL require a verification code
IF [条件] THEN THE [系统] SHALL [响应]
用于错误情况、边界情况和异常处理。
示例: IF the password is incorrect THEN THE System SHALL display an error message
WHILE [状态] WHEN [事件] THE [系统] SHALL [响应]
当状态和事件共同触发行为时使用。
示例: WHILE the cart is not empty WHEN the user clicks checkout THE System SHALL navigate to payment
| 场景 | 模式 | 关键词 |
|---|---|---|
| 总是发生 | 普遍模式 | THE...SHALL |
| 用户动作触发 | 事件驱动模式 | WHEN...THE...SHALL |
| 在某个状态期间 | 状态驱动模式 | WHILE...THE...SHALL |
| 功能依赖 | 可选模式 | WHERE...THE...SHALL |
| 错误/边界情况 | 错误处理模式 | IF...THEN THE...SHALL |
| 状态 + 动作 | 复杂模式 | WHILE...WHEN...THE...SHALL |
| 错误 | 正确 |
|---|---|
| "The system should..." | "THE System SHALL..." |
| "When clicking..." | "WHEN the user clicks... THE System SHALL..." |
| "Must validate..." | "THE System SHALL validate..." |
| "Handle errors appropriately" | "IF validation fails THEN THE System SHALL display..." |
关于详细模式和示例:
references/patterns.md - 包含边界情况的全面模式文档examples/good-requirements.md - 完整的示例需求文档要验证 EARS 语法,请使用 ears-validator 脚本:
node scripts/ears-validator.js .specs/<feature>/requirements.md
每周安装次数
–
代码仓库
GitHub 星标数
1
首次出现时间
–
安全审计
EARS (Easy Approach to Requirements Syntax) is a formal notation for writing unambiguous, testable acceptance criteria.
Every acceptance criterion follows a strict pattern with uppercase keywords. The keyword SHALL is mandatory - never use "should", "must", "will", "can", or "may".
THE [System] SHALL [behavior]
Use for requirements that are always active, with no preconditions.
Example: THE System SHALL encrypt all passwords using bcrypt
WHEN [event] THE [System] SHALL [response]
Use when a specific trigger causes behavior.
Example: WHEN a user submits the login form THE System SHALL validate credentials
WHILE [state] THE [System] SHALL [behavior]
Use for behavior that continues as long as a condition is true.
Example: WHILE the user is authenticated THE System SHALL display the dashboard
WHERE [feature is present] THE [System] SHALL [behavior]
Use for behavior dependent on a feature flag or configuration.
Example: WHERE two-factor authentication is enabled THE System SHALL require a verification code
IF [condition] THEN THE [System] SHALL [response]
Use for error cases, edge cases, and exception handling.
Example: IF the password is incorrect THEN THE System SHALL display an error message
WHILE [state] WHEN [event] THE [System] SHALL [response]
Use when both a state and an event trigger behavior.
Example: WHILE the cart is not empty WHEN the user clicks checkout THE System SHALL navigate to payment
| Scenario | Pattern | Keywords |
|---|---|---|
| Always happens | Ubiquitous | THE...SHALL |
| User action triggers | Event-Driven | WHEN...THE...SHALL |
| During a state | State-Driven | WHILE...THE...SHALL |
| Feature-dependent | Optional | WHERE...THE...SHALL |
| Error/edge case | Error Handling | IF...THEN THE...SHALL |
| State + action | Complex | WHILE...WHEN...THE...SHALL |
| Wrong | Right |
|---|---|
| "The system should..." | "THE System SHALL..." |
| "When clicking..." | "WHEN the user clicks... THE System SHALL..." |
| "Must validate..." | "THE System SHALL validate..." |
| "Handle errors appropriately" | "IF validation fails THEN THE System SHALL display..." |
For detailed patterns and examples:
references/patterns.md - Comprehensive pattern documentation with edge casesexamples/good-requirements.md - Complete example requirements documentTo validate EARS syntax, use the ears-validator script:
node scripts/ears-validator.js .specs/<feature>/requirements.md
Weekly Installs
–
Repository
GitHub Stars
1
First Seen
–
Security Audits
冲刺回顾模板:敏捷团队回顾会议指南与模板(开始-停止-继续/愤怒-悲伤-高兴/4Ls)
10,400 周安装