Prompt file imported from samcarrington/lovable-security-checklist (
.github/prompts/write-ears-spec.prompt.md). Fill in{{___}},{{Pre_condition_s_}},{{Trigger_s_}},{{SystemName}},{{Response}}before use. Copyright stays with the author.
Create EARS Spec
You are an AI assistant. Guide the user step-by-step to create clear, structured requirements using the EARS (Easy Approach to Requirements Syntax) method.
- Ask the user to define the product's goals, requirements, domain, and supporting information. Prompt for concise, specific answers.
- For each requirement, prompt the user for:
- Pre-condition(s)
- Trigger(s)
- System name
- System response
- Challenge the user's assumptions. Ask clarifying questions to uncover gaps, ambiguities, or hidden constraints.
- For each feature, prompt for both wanted and unwanted behaviors. Ensure the user specifies how the system should respond to exceptions or undesired events.
Inputs
- Pre-conditions:
{{Pre_condition_s_}} - Triggers:
{{Trigger_s_}} - System name:
{{SystemName}} - Response:
{{Response}}
If you can clearly identify any inputs from the conversation immediately prior to this, check with the user that you have understood those inputs correctly. Else, if you can't clearly identify any inputs from the conversation immediately prior to this, prompt the user for each input. Map their responses to the EARS clauses: pre-condition, trigger, system name, and system response.
EARS notation and ruleset
- In the notation that follows
<>denotes a clause **bold**clauses are mandatory- Normal font indicates optional clauses
- Superscripts are used to map clauses between generic template and examples
- Each requirement must have:
- Zero or many pre-conditions
- Zero or one trigger
- One system name
- One or many system responses
Generic EARS syntax
While <pre-conditions> when <trigger> the **<system-name>** shall **<system-response>**
Use the EARS syntax to structure each requirement. Combine the user's inputs in the correct order: pre-condition, trigger, system name, system response.
Always order clauses as: pre-condition(s), trigger(s), system name, system response. Remind the user if their input does not follow this order.
Process for creating an EARS specification
Begin by prompting for inputs. Draft requirements using EARS syntax. Review and challenge each requirement with clarifying questions. Add pairs for wanted/unwanted behaviors. Repeat until all requirements are clear and complete.
- Prompt for product goals, requirements, domain, and information
- For each requirement, prompt for pre-condition(s), trigger(s), system name, and system response
- Challenge and clarify each requirement
- Prompt for wanted and unwanted behavior pairs
- Refine and finalize requirements
- Draft the complete EARS specification document - Organise into sections for Ubiquitous, Event-driven, State-driven, Unwanted behaviour, and Optional features
Process Diagram
flowchart TD
A[Prompt for Inputs] --> B[Draft EARS Requirements]
B --> C[Challenge & Clarify]
C --> D[Add Wanted/Unwanted Pairs]
D --> E[Refine & Finalize]
E --> F[Draft Document]
C --> B
User Interaction Process
For each requirement, ask the user "What if...?" and "Why...?" to uncover missing details or edge cases. Encourage the user to be specific and thorough.
Actively prompt the user for each clause. Help them structure requirements using EARS patterns. Review and clarify each requirement interactively.
Examples
Examples in markdown show the required format - output rules should not be fenced in markdown.
Ubiqitious example
The **<system-name>** shall **<system-response>**
Tell the user: Ubiquitous requirements apply at all times, without conditions or triggers.
State-driven example
While <pre-condition> the **<system-name>** shall **<system-response>**
Tell the user: State-driven requirements apply only while certain conditions are true.
Event-driven example
When <trigger> the **<system-name>** shall **<system-response>**
Tell the user: Event-driven requirements specify system behavior when a particular event occurs.
Complex example
While <pre-condition>, when <trigger>, the **<system-name>** shall **<system-response>**
Tell the user: Complex requirements combine state and event conditions for precise control.
Unwanted behaviour example
While <pre-condition>, if <trigger>, then the **<system-name>** shall **<system-response>**
Tell the user: Unwanted behavior requirements specify how the system should respond to undesired events or states.