Loading...
Loading...
Write unambiguous specifications using EARS (Easy Approach to Requirements Syntax) patterns. Provides 6 sentence templates that eliminate ambiguity: Ubiquitous, Event-driven, State-driven, Unwanted behavior, Optional feature, and Complex. Use when: "EARS", "specification writing", "write specs", "仕様を書く", "EARS記法", "仕様を明確化", "requirements specification", "unambiguous specification".
npx skill4agent add caldiaworks/caldiaworks-marketplace earsThe <system> shall <response>.The system shall encrypt all data at rest using AES-256.WHEN <trigger>, the <system> shall <response>.WHEN the user clicks "Submit", the system shall validate all required fields.WHILE <state>, the <system> shall <response>.WHILE the system is in maintenance mode, the system shall return HTTP 503 to all requests.IF <condition>, THEN the <system> shall <response>.IF the payment gateway returns an error, THEN the system shall cancel the pending order
and display an error message to the user.WHERE <feature>, the <system> shall <response>.WHERE two-factor authentication is enabled, the system shall require a TOTP code after password entry.WHILE the system is in offline mode, WHEN the user creates a record,
the system shall store it locally and queue it for synchronization.1. Is there a trigger event?
├─ Yes → Is there also a sustained state?
│ ├─ Yes → Complex (WHILE + WHEN)
│ └─ No → Event-driven (WHEN)
└─ No
2. Is there a sustained condition?
├─ Yes → State-driven (WHILE)
└─ No
3. Is it an error / failure / edge case?
├─ Yes → Unwanted behavior (IF-THEN)
└─ No
4. Does it depend on a feature / configuration?
├─ Yes → Optional feature (WHERE)
└─ No → Ubiquitous| Anti-Pattern | Problem | Corrected (EARS) |
|---|---|---|
| The system should be fast. | "should" is weak; "fast" is vague | The system shall respond to queries within 200 ms at the 95th percentile. |
| Handle errors appropriately. | "handle" and "appropriately" are vague | IF the API returns HTTP 5xx, THEN the system shall retry 3 times with exponential backoff. |
| The system supports PDF export. | "supports" is ambiguous | WHEN the user selects "Export as PDF", the system shall generate and download a PDF within 3 seconds. |
| Users are notified. | Passive; no trigger; no detail | WHEN a document is updated, the system shall send an email to all subscribed users within 2 minutes. |
| The system handles concurrent users. | No measurable criteria | The system shall process up to 10,000 concurrent sessions with average response time below 500 ms. |
| WHEN X, IF Y, WHILE Z, the system shall... | Too many keywords | Split into multiple specifications with at most 2 keywords each. |
references/ears-patterns.mdexamples/ears-examples.md