opencode-metis 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/README.md +140 -0
  2. package/dist/cli.cjs +63 -0
  3. package/dist/mcp-server.cjs +51 -0
  4. package/dist/plugin.cjs +4 -0
  5. package/dist/worker.cjs +224 -0
  6. package/opencode/agent/the-analyst/feature-prioritization.md +66 -0
  7. package/opencode/agent/the-analyst/market-research.md +77 -0
  8. package/opencode/agent/the-analyst/project-coordination.md +81 -0
  9. package/opencode/agent/the-analyst/requirements-analysis.md +77 -0
  10. package/opencode/agent/the-architect/compatibility-review.md +138 -0
  11. package/opencode/agent/the-architect/complexity-review.md +137 -0
  12. package/opencode/agent/the-architect/quality-review.md +67 -0
  13. package/opencode/agent/the-architect/security-review.md +127 -0
  14. package/opencode/agent/the-architect/system-architecture.md +119 -0
  15. package/opencode/agent/the-architect/system-documentation.md +83 -0
  16. package/opencode/agent/the-architect/technology-research.md +85 -0
  17. package/opencode/agent/the-chief.md +79 -0
  18. package/opencode/agent/the-designer/accessibility-implementation.md +101 -0
  19. package/opencode/agent/the-designer/design-foundation.md +74 -0
  20. package/opencode/agent/the-designer/interaction-architecture.md +75 -0
  21. package/opencode/agent/the-designer/user-research.md +70 -0
  22. package/opencode/agent/the-meta-agent.md +155 -0
  23. package/opencode/agent/the-platform-engineer/ci-cd-pipelines.md +109 -0
  24. package/opencode/agent/the-platform-engineer/containerization.md +106 -0
  25. package/opencode/agent/the-platform-engineer/data-architecture.md +81 -0
  26. package/opencode/agent/the-platform-engineer/dependency-review.md +144 -0
  27. package/opencode/agent/the-platform-engineer/deployment-automation.md +81 -0
  28. package/opencode/agent/the-platform-engineer/infrastructure-as-code.md +107 -0
  29. package/opencode/agent/the-platform-engineer/performance-tuning.md +82 -0
  30. package/opencode/agent/the-platform-engineer/pipeline-engineering.md +81 -0
  31. package/opencode/agent/the-platform-engineer/production-monitoring.md +105 -0
  32. package/opencode/agent/the-qa-engineer/exploratory-testing.md +66 -0
  33. package/opencode/agent/the-qa-engineer/performance-testing.md +81 -0
  34. package/opencode/agent/the-qa-engineer/quality-assurance.md +77 -0
  35. package/opencode/agent/the-qa-engineer/test-execution.md +66 -0
  36. package/opencode/agent/the-software-engineer/api-development.md +78 -0
  37. package/opencode/agent/the-software-engineer/component-development.md +79 -0
  38. package/opencode/agent/the-software-engineer/concurrency-review.md +141 -0
  39. package/opencode/agent/the-software-engineer/domain-modeling.md +66 -0
  40. package/opencode/agent/the-software-engineer/performance-optimization.md +113 -0
  41. package/opencode/command/analyze.md +149 -0
  42. package/opencode/command/constitution.md +178 -0
  43. package/opencode/command/debug.md +194 -0
  44. package/opencode/command/document.md +178 -0
  45. package/opencode/command/implement.md +225 -0
  46. package/opencode/command/refactor.md +207 -0
  47. package/opencode/command/review.md +229 -0
  48. package/opencode/command/simplify.md +267 -0
  49. package/opencode/command/specify.md +191 -0
  50. package/opencode/command/validate.md +224 -0
  51. package/opencode/skill/accessibility-design/SKILL.md +566 -0
  52. package/opencode/skill/accessibility-design/checklists/wcag-checklist.md +435 -0
  53. package/opencode/skill/agent-coordination/SKILL.md +224 -0
  54. package/opencode/skill/api-contract-design/SKILL.md +550 -0
  55. package/opencode/skill/api-contract-design/templates/graphql-schema-template.md +818 -0
  56. package/opencode/skill/api-contract-design/templates/rest-api-template.md +417 -0
  57. package/opencode/skill/architecture-design/SKILL.md +160 -0
  58. package/opencode/skill/architecture-design/examples/architecture-examples.md +170 -0
  59. package/opencode/skill/architecture-design/template.md +749 -0
  60. package/opencode/skill/architecture-design/validation.md +99 -0
  61. package/opencode/skill/architecture-selection/SKILL.md +522 -0
  62. package/opencode/skill/architecture-selection/examples/adrs/001-example-adr.md +71 -0
  63. package/opencode/skill/architecture-selection/examples/architecture-patterns.md +239 -0
  64. package/opencode/skill/bug-diagnosis/SKILL.md +235 -0
  65. package/opencode/skill/code-quality-review/SKILL.md +337 -0
  66. package/opencode/skill/code-quality-review/examples/anti-patterns.md +629 -0
  67. package/opencode/skill/code-quality-review/reference.md +322 -0
  68. package/opencode/skill/code-review/SKILL.md +363 -0
  69. package/opencode/skill/code-review/reference.md +450 -0
  70. package/opencode/skill/codebase-analysis/SKILL.md +139 -0
  71. package/opencode/skill/codebase-navigation/SKILL.md +227 -0
  72. package/opencode/skill/codebase-navigation/examples/exploration-patterns.md +263 -0
  73. package/opencode/skill/coding-conventions/SKILL.md +178 -0
  74. package/opencode/skill/coding-conventions/checklists/accessibility-checklist.md +176 -0
  75. package/opencode/skill/coding-conventions/checklists/performance-checklist.md +154 -0
  76. package/opencode/skill/coding-conventions/checklists/security-checklist.md +127 -0
  77. package/opencode/skill/constitution-validation/SKILL.md +315 -0
  78. package/opencode/skill/constitution-validation/examples/CONSTITUTION.md +202 -0
  79. package/opencode/skill/constitution-validation/reference/rule-patterns.md +328 -0
  80. package/opencode/skill/constitution-validation/template.md +115 -0
  81. package/opencode/skill/context-preservation/SKILL.md +445 -0
  82. package/opencode/skill/data-modeling/SKILL.md +385 -0
  83. package/opencode/skill/data-modeling/templates/schema-design-template.md +268 -0
  84. package/opencode/skill/deployment-pipeline-design/SKILL.md +579 -0
  85. package/opencode/skill/deployment-pipeline-design/templates/pipeline-template.md +633 -0
  86. package/opencode/skill/documentation-extraction/SKILL.md +259 -0
  87. package/opencode/skill/documentation-sync/SKILL.md +431 -0
  88. package/opencode/skill/domain-driven-design/SKILL.md +509 -0
  89. package/opencode/skill/domain-driven-design/examples/ddd-patterns.md +688 -0
  90. package/opencode/skill/domain-driven-design/reference.md +465 -0
  91. package/opencode/skill/drift-detection/SKILL.md +383 -0
  92. package/opencode/skill/drift-detection/reference.md +340 -0
  93. package/opencode/skill/error-recovery/SKILL.md +162 -0
  94. package/opencode/skill/error-recovery/examples/error-patterns.md +484 -0
  95. package/opencode/skill/feature-prioritization/SKILL.md +419 -0
  96. package/opencode/skill/feature-prioritization/examples/rice-template.md +139 -0
  97. package/opencode/skill/feature-prioritization/reference.md +256 -0
  98. package/opencode/skill/git-workflow/SKILL.md +453 -0
  99. package/opencode/skill/implementation-planning/SKILL.md +215 -0
  100. package/opencode/skill/implementation-planning/examples/phase-examples.md +217 -0
  101. package/opencode/skill/implementation-planning/template.md +220 -0
  102. package/opencode/skill/implementation-planning/validation.md +88 -0
  103. package/opencode/skill/implementation-verification/SKILL.md +272 -0
  104. package/opencode/skill/knowledge-capture/SKILL.md +265 -0
  105. package/opencode/skill/knowledge-capture/reference/knowledge-capture.md +402 -0
  106. package/opencode/skill/knowledge-capture/reference.md +444 -0
  107. package/opencode/skill/knowledge-capture/templates/domain-template.md +325 -0
  108. package/opencode/skill/knowledge-capture/templates/interface-template.md +255 -0
  109. package/opencode/skill/knowledge-capture/templates/pattern-template.md +144 -0
  110. package/opencode/skill/observability-design/SKILL.md +291 -0
  111. package/opencode/skill/observability-design/references/monitoring-patterns.md +461 -0
  112. package/opencode/skill/pattern-detection/SKILL.md +171 -0
  113. package/opencode/skill/pattern-detection/examples/common-patterns.md +359 -0
  114. package/opencode/skill/performance-analysis/SKILL.md +266 -0
  115. package/opencode/skill/performance-analysis/references/profiling-tools.md +499 -0
  116. package/opencode/skill/requirements-analysis/SKILL.md +139 -0
  117. package/opencode/skill/requirements-analysis/examples/good-prd.md +66 -0
  118. package/opencode/skill/requirements-analysis/template.md +177 -0
  119. package/opencode/skill/requirements-analysis/validation.md +69 -0
  120. package/opencode/skill/requirements-elicitation/SKILL.md +518 -0
  121. package/opencode/skill/requirements-elicitation/examples/interview-questions.md +226 -0
  122. package/opencode/skill/requirements-elicitation/examples/user-stories.md +414 -0
  123. package/opencode/skill/safe-refactoring/SKILL.md +312 -0
  124. package/opencode/skill/safe-refactoring/reference/code-smells.md +347 -0
  125. package/opencode/skill/security-assessment/SKILL.md +421 -0
  126. package/opencode/skill/security-assessment/checklists/security-review-checklist.md +285 -0
  127. package/opencode/skill/specification-management/SKILL.md +143 -0
  128. package/opencode/skill/specification-management/readme-template.md +32 -0
  129. package/opencode/skill/specification-management/reference.md +115 -0
  130. package/opencode/skill/specification-management/spec.py +229 -0
  131. package/opencode/skill/specification-validation/SKILL.md +397 -0
  132. package/opencode/skill/specification-validation/reference/3cs-framework.md +306 -0
  133. package/opencode/skill/specification-validation/reference/ambiguity-detection.md +132 -0
  134. package/opencode/skill/specification-validation/reference/constitution-validation.md +301 -0
  135. package/opencode/skill/specification-validation/reference/drift-detection.md +383 -0
  136. package/opencode/skill/task-delegation/SKILL.md +607 -0
  137. package/opencode/skill/task-delegation/examples/file-coordination.md +495 -0
  138. package/opencode/skill/task-delegation/examples/parallel-research.md +337 -0
  139. package/opencode/skill/task-delegation/examples/sequential-build.md +504 -0
  140. package/opencode/skill/task-delegation/reference.md +825 -0
  141. package/opencode/skill/tech-stack-detection/SKILL.md +89 -0
  142. package/opencode/skill/tech-stack-detection/references/framework-signatures.md +598 -0
  143. package/opencode/skill/technical-writing/SKILL.md +190 -0
  144. package/opencode/skill/technical-writing/templates/adr-template.md +205 -0
  145. package/opencode/skill/technical-writing/templates/system-doc-template.md +380 -0
  146. package/opencode/skill/test-design/SKILL.md +464 -0
  147. package/opencode/skill/test-design/examples/test-pyramid.md +724 -0
  148. package/opencode/skill/testing/SKILL.md +213 -0
  149. package/opencode/skill/testing/examples/test-pyramid.md +724 -0
  150. package/opencode/skill/user-insight-synthesis/SKILL.md +576 -0
  151. package/opencode/skill/user-insight-synthesis/templates/research-plan-template.md +217 -0
  152. package/opencode/skill/user-research/SKILL.md +508 -0
  153. package/opencode/skill/user-research/examples/interview-questions.md +265 -0
  154. package/opencode/skill/user-research/examples/personas.md +267 -0
  155. package/opencode/skill/vibe-security/SKILL.md +654 -0
  156. package/package.json +45 -0
@@ -0,0 +1,226 @@
1
+ # Interview Question Bank
2
+
3
+ ## Context
4
+
5
+ This document provides a structured bank of questions for stakeholder interviews across different phases of requirements elicitation. Questions are organized by purpose and stakeholder type. Select questions based on your session goals -- not all questions apply to every interview.
6
+
7
+ Use these in conjunction with the interview structure from SKILL.md (Context -> Current State -> Desired State -> Constraints -> Wrap-Up).
8
+
9
+ ---
10
+
11
+ ## Discovery Questions
12
+
13
+ These questions establish context and reveal the real problem. Ask them early to avoid solving the wrong thing.
14
+
15
+ ### Understanding the Initiative
16
+
17
+ - What's the business problem you're trying to solve?
18
+ - What happens if you don't solve this? What's the cost of inaction?
19
+ - What prompted this initiative now? Why not six months ago?
20
+ - Who requested this work, and why do they care?
21
+ - How does this fit into the broader product or company strategy?
22
+ - Is there a deadline, and what's driving it?
23
+
24
+ ### Uncovering the Real Need (The 5 Whys Starters)
25
+
26
+ - Walk me through why this matters to you personally.
27
+ - What would success look like in six months?
28
+ - If you had a magic wand and this was solved perfectly, what would be different?
29
+ - What's the worst thing that could happen if we build the wrong thing here?
30
+ - Is this a new problem or one that's been around for a while?
31
+
32
+ ### Stakeholder Landscape
33
+
34
+ - Who else is affected by this problem?
35
+ - Who do you think I should talk to next?
36
+ - Are there people who benefit from the current situation staying the same?
37
+ - Who signs off on this decision?
38
+ - Are there stakeholders outside your team -- customers, partners, regulators?
39
+
40
+ ---
41
+
42
+ ## Current State Questions
43
+
44
+ These questions document what exists today so you can identify pain points and understand workflows before proposing solutions.
45
+
46
+ ### Process and Workflow
47
+
48
+ - Walk me through how you handle this today, step by step.
49
+ - How often do you do this? Daily, weekly, monthly?
50
+ - How long does this take from start to finish?
51
+ - Who is involved at each step?
52
+ - What triggers this process to start? What marks it as done?
53
+
54
+ ### Tools and Systems
55
+
56
+ - What tools, systems, or software do you currently use for this?
57
+ - How do these systems talk to each other? Do they, or do you manually move data?
58
+ - How many places do you have to go to complete this task?
59
+ - What data do you need, and where does it come from?
60
+
61
+ ### Pain Points
62
+
63
+ - What's the most frustrating part of the current process?
64
+ - Where do things break down or slow down?
65
+ - Where do errors happen most often? What causes them?
66
+ - What workarounds have you built to cope with the current system?
67
+ - What do you spend time on that you shouldn't have to?
68
+ - If you could change one thing about how this works today, what would it be?
69
+
70
+ ### Volume and Scale
71
+
72
+ - How many people do this task?
73
+ - How much data is involved -- records, transactions, files?
74
+ - What happens during peak periods? How does the system cope?
75
+ - Has this grown significantly in the past year? Where do you expect it to be in two years?
76
+
77
+ ---
78
+
79
+ ## Desired State Questions
80
+
81
+ These questions clarify the goal and prevent gold plating by anchoring requirements to outcomes rather than features.
82
+
83
+ ### Defining Success
84
+
85
+ - Describe the ideal state -- what does "done" look like?
86
+ - What specific outcome tells you this worked?
87
+ - What metrics would you measure to know it's working?
88
+ - What's the minimum you need to declare this a success?
89
+ - If we had to cut scope, what absolutely must be there for this to be useful?
90
+
91
+ ### Workflows and Interactions
92
+
93
+ - Walk me through a typical scenario using the new solution.
94
+ - What should happen when things go right? When things go wrong?
95
+ - Who starts the process? Who hands it off? Who finishes it?
96
+ - What decisions does a person have to make, and which ones should the system make?
97
+
98
+ ### Priority and Trade-offs
99
+
100
+ - If you had to rank these capabilities -- fast, cheap, correct -- which matters most?
101
+ - What can we defer to a later phase without losing the core value?
102
+ - Are there features you think would be nice but aren't essential?
103
+ - Would you rather have something basic by [date] or something complete later?
104
+
105
+ ---
106
+
107
+ ## Validation Questions
108
+
109
+ These questions confirm your understanding and surface gaps before you commit to a direction.
110
+
111
+ ### Checking Comprehension
112
+
113
+ - Let me summarize what I've heard -- please correct me where I'm wrong.
114
+ - Is there anything important I haven't asked?
115
+ - What assumptions are you making that I might not share?
116
+ - What would you add if you had more time?
117
+
118
+ ### Probing Completeness
119
+
120
+ - Are there edge cases we haven't discussed?
121
+ - What happens if a user does something unexpected?
122
+ - What about users with accessibility needs or limited technical ability?
123
+ - Are there regulatory, legal, or compliance requirements that affect this?
124
+
125
+ ### Surfacing Conflict
126
+
127
+ - Have you talked to [other stakeholder]? Do you know if they agree with this?
128
+ - Are there people who see this differently than you do?
129
+ - What's the most controversial aspect of what you've described?
130
+
131
+ ---
132
+
133
+ ## Stakeholder-Specific Questions
134
+
135
+ Different roles have different perspectives. Tailor your questions to surface insights specific to each stakeholder's vantage point.
136
+
137
+ ### End Users
138
+
139
+ These questions focus on lived experience and day-to-day workflow. End users reveal what actually happens, not what the process says should happen.
140
+
141
+ - Tell me about the last time you did this task. Walk me through it.
142
+ - What would you do first if this tool disappeared tomorrow?
143
+ - What do you wish the system just knew, so you didn't have to tell it?
144
+ - When does the system get in your way?
145
+ - Are there parts of your job this doesn't touch that it probably should?
146
+ - What do new people struggle to learn about this process?
147
+
148
+ ### Product Owners / Business Stakeholders
149
+
150
+ These questions focus on value, priority, and business outcomes.
151
+
152
+ - What is the business impact of getting this right? Of getting it wrong?
153
+ - What customer segments does this affect?
154
+ - How does this compare in priority to other things on the roadmap?
155
+ - What are customers telling you about this problem?
156
+ - What does the competition do here? Is that relevant?
157
+ - What would make you confident enough to demo this to a customer?
158
+
159
+ ### Engineering and Technical Teams
160
+
161
+ These questions uncover implementation constraints and integration complexity.
162
+
163
+ - Are there existing systems this needs to integrate with?
164
+ - What parts of the current architecture make this harder than it should be?
165
+ - Are there data quality or availability issues we need to account for?
166
+ - What are the constraints we can't change -- legacy systems, contracts, infrastructure?
167
+ - What's the riskiest part of building this from a technical standpoint?
168
+ - Are there security, privacy, or compliance requirements that aren't obvious?
169
+
170
+ ### Executives and Sponsors
171
+
172
+ These questions focus on strategic alignment, risk tolerance, and go/no-go criteria.
173
+
174
+ - What does success look like in terms of business outcomes, not features?
175
+ - What's the risk you're most concerned about?
176
+ - What would make you pull the plug on this initiative?
177
+ - Who are the key decision-makers, and what do they care about?
178
+ - Is there a point at which this becomes "too expensive" relative to the value?
179
+ - What external pressures -- market, regulatory, competitive -- are driving this timeline?
180
+
181
+ ---
182
+
183
+ ## Domain-Specific Question Sets
184
+
185
+ ### For Internal Tools and Operations
186
+
187
+ - Who owns the process this tool supports?
188
+ - How is performance measured today, and how would you measure it with the new tool?
189
+ - What reporting or audit requirements exist?
190
+ - What happens during off-hours or when people are out of the office?
191
+
192
+ ### For Customer-Facing Products
193
+
194
+ - Who is the target user -- are they tech-savvy, occasional users, power users?
195
+ - What devices and environments will they use this on?
196
+ - What does the user already know when they arrive at this feature?
197
+ - What's the user's goal, and what might distract them from it?
198
+ - What's the cost to the user if they make a mistake?
199
+
200
+ ### For Data and Reporting Features
201
+
202
+ - What decisions will be made using this data?
203
+ - Who will look at this, and how often?
204
+ - What's the acceptable latency -- real-time, hourly, daily?
205
+ - What's the source of truth, and how reliable is it?
206
+ - What does "wrong" look like -- what data errors have caused problems before?
207
+
208
+ ### For Integration and API Features
209
+
210
+ - What systems will call this, and what do they expect back?
211
+ - What are the upstream and downstream dependencies?
212
+ - What's the acceptable error rate and latency?
213
+ - How will failures be handled -- retry, fallback, alert?
214
+ - Who is responsible for the other side of this integration?
215
+
216
+ ---
217
+
218
+ ## Wrap-Up Questions
219
+
220
+ Always close interviews with these to surface what you missed and identify next steps.
221
+
222
+ - What haven't I asked that I should have?
223
+ - Who else should I talk to about this?
224
+ - Is there any documentation, existing specs, or prior work I should read?
225
+ - Can I follow up with you if I have clarifying questions?
226
+ - What's the best way to share my summary of this conversation with you for review?
@@ -0,0 +1,414 @@
1
+ # User Story Examples
2
+
3
+ ## Context
4
+
5
+ This document provides annotated examples of well-crafted user stories with acceptance criteria, alongside examples of common mistakes and how to fix them. Use these as reference when writing or reviewing stories.
6
+
7
+ The format covered in SKILL.md is:
8
+
9
+ ```
10
+ As a [role],
11
+ I want [capability],
12
+ So that [benefit].
13
+ ```
14
+
15
+ The acceptance criteria format is Given-When-Then. This document shows what that looks like in practice across different domains.
16
+
17
+ ---
18
+
19
+ ## Good vs. Bad User Stories
20
+
21
+ Understanding what makes a story weak helps you write stronger ones from the start.
22
+
23
+ ### Example 1: The Vague Role
24
+
25
+ **Bad:**
26
+
27
+ ```
28
+ As a user,
29
+ I want to see notifications,
30
+ So that I know what's happening.
31
+ ```
32
+
33
+ Problems:
34
+ - "User" is too broad -- which type of user? The story means nothing without knowing who it serves.
35
+ - "See notifications" is undefined -- what kind, from where, in what format?
36
+ - "Know what's happening" has no testable outcome.
37
+
38
+ **Good:**
39
+
40
+ ```
41
+ As an order fulfillment coordinator,
42
+ I want to receive a real-time alert when an order's shipping status changes,
43
+ So that I can proactively contact customers before they reach out to us.
44
+ ```
45
+
46
+ Why this works:
47
+ - The role is specific enough to know who has this need and why.
48
+ - The capability describes an observable action (receive an alert, when something specific happens).
49
+ - The benefit explains the business value and the decision the coordinator needs to make.
50
+
51
+ ---
52
+
53
+ ### Example 2: The Solution-First Story
54
+
55
+ **Bad:**
56
+
57
+ ```
58
+ As a manager,
59
+ I want a dashboard with pie charts,
60
+ So that I can see the data.
61
+ ```
62
+
63
+ Problems:
64
+ - "Pie charts" is a solution, not a capability. The user's real need is to understand data -- the visualization type is an implementation choice.
65
+ - "See the data" says nothing about what data, why it matters, or what the manager will do with it.
66
+
67
+ **Good:**
68
+
69
+ ```
70
+ As a customer success manager,
71
+ I want to see each account's health score and its trend over the past 30 days,
72
+ So that I can identify at-risk accounts before they churn.
73
+ ```
74
+
75
+ Why this works:
76
+ - The capability describes what the manager needs to know, not how it's displayed.
77
+ - The benefit ties directly to a business outcome (preventing churn).
78
+ - This leaves implementation open -- a table, a chart, or a sorted list all become valid choices.
79
+
80
+ ---
81
+
82
+ ### Example 3: The Missing Benefit
83
+
84
+ **Bad:**
85
+
86
+ ```
87
+ As a developer,
88
+ I want API documentation,
89
+ So that I have it.
90
+ ```
91
+
92
+ Problems:
93
+ - The benefit "so that I have it" restates the want and adds no value.
94
+ - Removing the benefit makes this story unvalidatable -- you can't measure success without knowing why.
95
+
96
+ **Good:**
97
+
98
+ ```
99
+ As a developer integrating with the payment API,
100
+ I want interactive endpoint documentation with request/response examples,
101
+ So that I can implement and test my integration without needing support from the platform team.
102
+ ```
103
+
104
+ Why this works:
105
+ - The role is specific (developer integrating, not developers in general).
106
+ - The benefit is a measurable outcome -- reduced support requests, independent implementation.
107
+
108
+ ---
109
+
110
+ ### Example 4: The Epic Masquerading as a Story
111
+
112
+ **Bad:**
113
+
114
+ ```
115
+ As a shopper,
116
+ I want to be able to browse, filter, search, add items to my cart, check out, and track my order,
117
+ So that I can buy things online.
118
+ ```
119
+
120
+ Problems:
121
+ - This is an entire e-commerce system in one story.
122
+ - It cannot be completed in a single sprint.
123
+ - There is no way to write meaningful acceptance criteria for something this large.
124
+
125
+ **Good -- Split into stories:**
126
+
127
+ ```
128
+ As a shopper,
129
+ I want to filter products by category and price range,
130
+ So that I can find relevant items without browsing everything.
131
+ ```
132
+
133
+ ```
134
+ As a shopper,
135
+ I want to add items to a cart and adjust quantities before checkout,
136
+ So that I can review my order before committing to purchase.
137
+ ```
138
+
139
+ ```
140
+ As a shopper,
141
+ I want to receive an email confirmation with my order number after purchase,
142
+ So that I have a record and can track my order if there are issues.
143
+ ```
144
+
145
+ Each story is independently deliverable and testable.
146
+
147
+ ---
148
+
149
+ ## Well-Crafted Stories with Acceptance Criteria
150
+
151
+ ### Story 1: Authentication -- Password Reset
152
+
153
+ ```
154
+ As a registered user who has forgotten their password,
155
+ I want to reset my password via a link sent to my email,
156
+ So that I can regain access to my account without contacting support.
157
+ ```
158
+
159
+ **Acceptance Criteria:**
160
+
161
+ ```
162
+ Scenario: Request a password reset
163
+ Given I am on the login page
164
+ When I click "Forgot password" and enter my registered email address
165
+ Then I receive an email containing a password reset link within 2 minutes
166
+ And the link expires after 24 hours
167
+
168
+ Scenario: Complete a password reset
169
+ Given I have received a valid, unexpired reset link
170
+ When I click the link and enter a new password that meets the requirements
171
+ Then my password is updated
172
+ And I am redirected to the login page with a confirmation message
173
+ And the reset link is invalidated so it cannot be reused
174
+
175
+ Scenario: Reset link has expired
176
+ Given I have a reset link that is more than 24 hours old
177
+ When I click the link
178
+ Then I see a message that the link has expired
179
+ And I am offered the option to request a new reset link
180
+
181
+ Scenario: Email address is not registered
182
+ Given I am on the "Forgot password" page
183
+ When I enter an email address that has no account
184
+ Then I see the same success message as if the email were registered
185
+ And no email is sent
186
+ ```
187
+
188
+ Note on the last scenario: showing the same message regardless prevents user enumeration -- an attacker cannot determine which emails are registered by trying different addresses.
189
+
190
+ ---
191
+
192
+ ### Story 2: Search -- Finding Records
193
+
194
+ ```
195
+ As a support agent,
196
+ I want to search for customer accounts by name, email, or account ID,
197
+ So that I can quickly locate the right account when a customer contacts us.
198
+ ```
199
+
200
+ **Acceptance Criteria:**
201
+
202
+ ```
203
+ Scenario: Search returns results
204
+ Given I am on the customer search page
205
+ When I type at least 3 characters into the search field
206
+ Then results appear within 500ms
207
+ And each result shows the customer name, email, and account status
208
+
209
+ Scenario: Search by partial name
210
+ Given there are customers named "Sarah Johnson" and "Sarah Williams"
211
+ When I search for "Sarah"
212
+ Then both customers appear in the results
213
+
214
+ Scenario: Search by email
215
+ Given a customer with email "jane.doe@example.com"
216
+ When I search for "jane.doe"
217
+ Then that customer appears in the results
218
+
219
+ Scenario: No results found
220
+ Given no customers match the search term
221
+ When I complete a search
222
+ Then I see a "No results found" message
223
+ And I see a suggestion to check the spelling or try a different identifier
224
+
225
+ Scenario: Search is too short
226
+ Given I have typed fewer than 3 characters
227
+ When I look at the search field
228
+ Then no results are shown
229
+ And I see a hint indicating I need to type at least 3 characters
230
+ ```
231
+
232
+ ---
233
+
234
+ ### Story 3: Permissions -- Role-Based Access
235
+
236
+ ```
237
+ As an organization administrator,
238
+ I want to assign team members to roles with different permission levels,
239
+ So that each person only has access to the features and data their job requires.
240
+ ```
241
+
242
+ **Acceptance Criteria:**
243
+
244
+ ```
245
+ Scenario: Assign a role to a team member
246
+ Given I am an administrator on the organization account
247
+ When I navigate to Team Settings and select a team member
248
+ Then I can assign them one of the available roles: Viewer, Editor, or Admin
249
+ And the change takes effect immediately
250
+
251
+ Scenario: Viewer cannot edit content
252
+ Given a team member has the Viewer role
253
+ When they view a record
254
+ Then all fields are read-only
255
+ And the "Save" and "Delete" buttons are not visible
256
+
257
+ Scenario: Editor can edit but not manage users
258
+ Given a team member has the Editor role
259
+ When they navigate to Team Settings
260
+ Then they can view the team list
261
+ But they cannot add, remove, or change roles for other members
262
+
263
+ Scenario: Removing a team member
264
+ Given I am an administrator
265
+ When I remove a team member from the organization
266
+ Then they immediately lose access to all organization data
267
+ And they receive an email notifying them of the change
268
+
269
+ Scenario: Last administrator cannot be demoted
270
+ Given an organization has exactly one administrator
271
+ When that administrator attempts to change their own role to Editor
272
+ Then the action is blocked
273
+ And they see an error: "Organizations must have at least one administrator"
274
+ ```
275
+
276
+ ---
277
+
278
+ ### Story 4: Data Export -- CSV Download
279
+
280
+ ```
281
+ As a finance team member,
282
+ I want to export transaction records as a CSV file filtered by date range,
283
+ So that I can import them into our accounting software for monthly reconciliation.
284
+ ```
285
+
286
+ **Acceptance Criteria:**
287
+
288
+ ```
289
+ Scenario: Export with a valid date range
290
+ Given I am on the Transactions page
291
+ When I select a start date and end date and click "Export CSV"
292
+ Then a CSV file downloads containing all transactions within that range
293
+ And the file includes columns: transaction ID, date, description, amount, status
294
+
295
+ Scenario: Export with no results
296
+ Given no transactions exist in the selected date range
297
+ When I click "Export CSV"
298
+ Then a CSV file downloads containing only the header row
299
+ And no error is shown
300
+
301
+ Scenario: Export is limited to my permissions
302
+ Given I am a Viewer with access to only my team's transactions
303
+ When I export a CSV
304
+ Then the file contains only transactions I am authorized to see
305
+ And no transactions from other teams appear
306
+
307
+ Scenario: Large export
308
+ Given there are more than 10,000 transactions in the selected range
309
+ When I click "Export CSV"
310
+ Then the export is queued
311
+ And I receive an email with a download link when it is ready
312
+ And the link expires after 24 hours
313
+
314
+ Scenario: Invalid date range
315
+ Given I set the start date after the end date
316
+ When I attempt to export
317
+ Then the export button is disabled
318
+ And I see an inline error: "Start date must be before end date"
319
+ ```
320
+
321
+ ---
322
+
323
+ ### Story 5: Notifications -- Real-Time Alerts
324
+
325
+ ```
326
+ As a warehouse operations manager,
327
+ I want to receive an alert when inventory for a SKU drops below its reorder threshold,
328
+ So that I can initiate a purchase order before stock runs out.
329
+ ```
330
+
331
+ **Acceptance Criteria:**
332
+
333
+ ```
334
+ Scenario: Alert triggered when threshold is crossed
335
+ Given SKU-1234 has a reorder threshold of 50 units
336
+ And current stock is 51 units
337
+ When a sale reduces stock to 50 units or fewer
338
+ Then an alert appears in my notification center within 60 seconds
339
+ And the alert includes: SKU, product name, current quantity, and threshold
340
+
341
+ Scenario: Alert is not repeated for the same condition
342
+ Given an alert has already been sent for SKU-1234 being below threshold
343
+ When subsequent sales occur without restocking
344
+ Then no additional alerts are sent for the same threshold breach
345
+
346
+ Scenario: Alert clears when stock is replenished
347
+ Given SKU-1234 is in an alerted state
348
+ When stock is updated to a quantity above the threshold
349
+ Then the alert is dismissed from the notification center
350
+ And a new alert will be sent if stock drops again in the future
351
+
352
+ Scenario: Manager can configure thresholds
353
+ Given I am viewing a SKU's settings
354
+ When I update the reorder threshold and save
355
+ Then future alerts use the new threshold value
356
+ And the change is logged with my name and a timestamp
357
+
358
+ Scenario: Alert delivery via email
359
+ Given I have email notifications enabled for inventory alerts
360
+ When an inventory threshold is crossed
361
+ Then I receive an email within 5 minutes
362
+ And the email contains a direct link to the affected SKU's page
363
+ ```
364
+
365
+ ---
366
+
367
+ ## Acceptance Criteria Patterns
368
+
369
+ Certain patterns appear repeatedly in well-written acceptance criteria. Recognizing them helps you write criteria faster and more completely.
370
+
371
+ ### The Happy Path + Variations Pattern
372
+
373
+ Always start with the success scenario, then add variations:
374
+
375
+ ```
376
+ Scenario: [Feature] succeeds under normal conditions
377
+ Scenario: [Feature] when input is at the boundary (minimum/maximum)
378
+ Scenario: [Feature] when the user has limited permissions
379
+ Scenario: [Feature] fails gracefully with a clear error
380
+ ```
381
+
382
+ ### The Security Variant Pattern
383
+
384
+ For any feature that handles data or access:
385
+
386
+ ```
387
+ Scenario: [User A] cannot access [User B]'s data
388
+ Scenario: Unauthenticated user is redirected to login
389
+ Scenario: Error messages do not expose sensitive information
390
+ ```
391
+
392
+ ### The Scale Variant Pattern
393
+
394
+ For features involving lists, searches, or exports:
395
+
396
+ ```
397
+ Scenario: Returns correct results when list is empty
398
+ Scenario: Returns correct results when list has one item
399
+ Scenario: Handles large datasets without timeout or data loss
400
+ Scenario: Pagination works correctly at boundaries (first page, last page)
401
+ ```
402
+
403
+ ---
404
+
405
+ ## Anti-Patterns in Acceptance Criteria
406
+
407
+ | Anti-Pattern | Problem | Fix |
408
+ |---|---|---|
409
+ | **"Works correctly"** | Not testable -- correct according to whom? | Define the specific expected output |
410
+ | **"Should be fast"** | Relative and unmeasurable | "Loads within 2 seconds on a 4G connection" |
411
+ | **"The system handles errors"** | What errors? What does handling mean? | Specify the error condition and the exact user-visible response |
412
+ | **Only happy path** | Misses the majority of real-world usage | Add scenarios for empty state, boundaries, failures, and unauthorized access |
413
+ | **Implementation detail in criteria** | Ties acceptance to a technical choice | Describe the observable outcome, not how it's achieved |
414
+ | **Passive voice throughout** | Obscures who is doing what | "The user sees X" or "The system sends Y" -- name the actor |