specweave 0.23.18 → 0.24.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 (167) hide show
  1. package/.claude-plugin/marketplace.json +93 -49
  2. package/CLAUDE.md +137 -4
  3. package/dist/src/cli/helpers/ado-area-path-mapper.d.ts +89 -0
  4. package/dist/src/cli/helpers/ado-area-path-mapper.d.ts.map +1 -0
  5. package/dist/src/cli/helpers/ado-area-path-mapper.js +213 -0
  6. package/dist/src/cli/helpers/ado-area-path-mapper.js.map +1 -0
  7. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts +29 -0
  8. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts.map +1 -0
  9. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js +109 -0
  10. package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js.map +1 -0
  11. package/dist/src/cli/helpers/issue-tracker/ado.d.ts +1 -0
  12. package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
  13. package/dist/src/cli/helpers/issue-tracker/ado.js +2 -0
  14. package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
  15. package/dist/src/cli/helpers/smart-filter.d.ts +83 -0
  16. package/dist/src/cli/helpers/smart-filter.d.ts.map +1 -0
  17. package/dist/src/cli/helpers/smart-filter.js +265 -0
  18. package/dist/src/cli/helpers/smart-filter.js.map +1 -0
  19. package/dist/src/core/qa/quality-gate-decider.d.ts +1 -1
  20. package/dist/src/core/qa/quality-gate-decider.js +2 -2
  21. package/dist/src/core/qa/quality-gate-decider.js.map +1 -1
  22. package/dist/src/core/qa/risk-calculator.d.ts +2 -2
  23. package/dist/src/core/qa/risk-calculator.js +2 -2
  24. package/dist/src/core/validators/ac-presence-validator.d.ts +56 -0
  25. package/dist/src/core/validators/ac-presence-validator.d.ts.map +1 -0
  26. package/dist/src/core/validators/ac-presence-validator.js +149 -0
  27. package/dist/src/core/validators/ac-presence-validator.js.map +1 -0
  28. package/dist/src/integrations/ado/area-path-mapper.d.ts +137 -0
  29. package/dist/src/integrations/ado/area-path-mapper.d.ts.map +1 -0
  30. package/dist/src/integrations/ado/area-path-mapper.js +267 -0
  31. package/dist/src/integrations/ado/area-path-mapper.js.map +1 -0
  32. package/dist/src/integrations/jira/filter-processor.d.ts +126 -0
  33. package/dist/src/integrations/jira/filter-processor.d.ts.map +1 -0
  34. package/dist/src/integrations/jira/filter-processor.js +207 -0
  35. package/dist/src/integrations/jira/filter-processor.js.map +1 -0
  36. package/dist/src/integrations/jira/jira-client.d.ts +13 -0
  37. package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
  38. package/dist/src/integrations/jira/jira-client.js +33 -0
  39. package/dist/src/integrations/jira/jira-client.js.map +1 -1
  40. package/dist/src/utils/ac-embedder.d.ts +63 -0
  41. package/dist/src/utils/ac-embedder.d.ts.map +1 -0
  42. package/dist/src/utils/ac-embedder.js +217 -0
  43. package/dist/src/utils/ac-embedder.js.map +1 -0
  44. package/dist/src/utils/env-manager.d.ts +86 -0
  45. package/dist/src/utils/env-manager.d.ts.map +1 -0
  46. package/dist/src/utils/env-manager.js +188 -0
  47. package/dist/src/utils/env-manager.js.map +1 -0
  48. package/package.json +1 -1
  49. package/plugins/specweave/.claude-plugin/plugin.json +1 -1
  50. package/plugins/specweave/agents/AGENTS-INDEX.md +1 -1
  51. package/plugins/specweave/agents/increment-quality-judge-v2/AGENT.md +9 -9
  52. package/plugins/specweave/commands/specweave-do.md +37 -0
  53. package/plugins/specweave/commands/specweave-done.md +159 -0
  54. package/plugins/specweave/commands/specweave-embed-acs.md +446 -0
  55. package/plugins/specweave/commands/specweave-next.md +148 -3
  56. package/plugins/specweave/commands/specweave-qa.md +2 -2
  57. package/plugins/specweave/hooks/pre-increment-start.sh +168 -0
  58. package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
  59. package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
  60. package/plugins/specweave-ado/commands/specweave-ado-import-projects.md +331 -0
  61. package/plugins/specweave-alternatives/.claude-plugin/plugin.json +10 -0
  62. package/plugins/specweave-alternatives/commands/alternatives-analyze.md +336 -0
  63. package/plugins/specweave-alternatives/skills/architecture-alternatives/SKILL.md +651 -0
  64. package/plugins/specweave-alternatives/skills/bmad-method/SKILL.md +420 -0
  65. package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +487 -0
  66. package/plugins/specweave-backend/commands/api-scaffold.md +80 -0
  67. package/plugins/specweave-backend/commands/crud-generate.md +109 -0
  68. package/plugins/specweave-backend/commands/migration-generate.md +139 -0
  69. package/plugins/specweave-confluent/commands/connector-deploy.md +154 -0
  70. package/plugins/specweave-confluent/commands/ksqldb-query.md +179 -0
  71. package/plugins/specweave-confluent/commands/schema-register.md +123 -0
  72. package/plugins/specweave-core/.claude-plugin/plugin.json +21 -0
  73. package/plugins/specweave-core/commands/architecture-review.md +288 -0
  74. package/plugins/specweave-core/commands/code-review.md +213 -0
  75. package/plugins/specweave-core/commands/refactor-plan.md +249 -0
  76. package/plugins/specweave-core/skills/code-quality/SKILL.md +157 -0
  77. package/plugins/specweave-core/skills/design-patterns/SKILL.md +244 -0
  78. package/plugins/specweave-core/skills/software-architecture/SKILL.md +83 -0
  79. package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +22 -0
  80. package/plugins/specweave-cost-optimizer/commands/cost-analyze.md +360 -0
  81. package/plugins/specweave-cost-optimizer/commands/cost-optimize.md +480 -0
  82. package/plugins/specweave-cost-optimizer/skills/aws-cost-expert/SKILL.md +416 -0
  83. package/plugins/specweave-cost-optimizer/skills/cloud-pricing/SKILL.md +325 -0
  84. package/plugins/specweave-cost-optimizer/skills/cost-optimization/SKILL.md +337 -0
  85. package/plugins/specweave-diagrams/.claude-plugin/plugin.json +1 -1
  86. package/plugins/specweave-diagrams/commands/diagrams-generate.md +168 -0
  87. package/plugins/specweave-docs/.claude-plugin/plugin.json +10 -0
  88. package/plugins/specweave-docs/commands/docs-generate.md +441 -0
  89. package/plugins/specweave-docs/commands/docs-init.md +334 -0
  90. package/plugins/specweave-docs/skills/docusaurus/SKILL.md +581 -0
  91. package/plugins/specweave-docs/skills/spec-driven-brainstorming/SKILL.md +689 -0
  92. package/plugins/specweave-docs/skills/technical-writing/SKILL.md +1039 -0
  93. package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +1 -1
  94. package/plugins/specweave-figma/.claude-plugin/plugin.json +23 -0
  95. package/plugins/specweave-figma/commands/figma-import.md +690 -0
  96. package/plugins/specweave-figma/commands/figma-to-react.md +834 -0
  97. package/plugins/specweave-figma/commands/figma-tokens.md +815 -0
  98. package/plugins/specweave-frontend/.claude-plugin/plugin.json +21 -0
  99. package/plugins/specweave-frontend/agents/frontend-architect/AGENT.md +387 -0
  100. package/plugins/specweave-frontend/agents/frontend-architect/README.md +385 -0
  101. package/plugins/specweave-frontend/agents/frontend-architect/examples.md +590 -0
  102. package/plugins/specweave-frontend/agents/frontend-architect/templates/component-template.tsx +152 -0
  103. package/plugins/specweave-frontend/agents/frontend-architect/templates/hook-template.ts +311 -0
  104. package/plugins/specweave-frontend/agents/frontend-architect/templates/page-template.tsx +228 -0
  105. package/plugins/specweave-frontend/commands/component-generate.md +510 -0
  106. package/plugins/specweave-frontend/commands/design-system-init.md +494 -0
  107. package/plugins/specweave-frontend/commands/frontend-scaffold.md +207 -0
  108. package/plugins/specweave-frontend/commands/nextjs-setup.md +396 -0
  109. package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +278 -0
  110. package/plugins/specweave-frontend/skills/frontend/SKILL.md +420 -0
  111. package/plugins/specweave-frontend/skills/nextjs/SKILL.md +546 -0
  112. package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
  113. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +194 -0
  114. package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +1 -1
  115. package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
  116. package/plugins/specweave-jira/commands/import-projects.js +183 -0
  117. package/plugins/specweave-jira/commands/import-projects.md +97 -0
  118. package/plugins/specweave-jira/commands/import-projects.ts +288 -0
  119. package/plugins/specweave-jira/commands/specweave-jira-import-projects.md +298 -0
  120. package/plugins/specweave-kafka/.claude-plugin/plugin.json +1 -1
  121. package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +1 -1
  122. package/plugins/specweave-kubernetes/commands/cluster-setup.md +262 -0
  123. package/plugins/specweave-kubernetes/commands/deployment-generate.md +242 -0
  124. package/plugins/specweave-kubernetes/commands/helm-scaffold.md +333 -0
  125. package/plugins/specweave-ml/.claude-plugin/plugin.json +1 -1
  126. package/plugins/specweave-mobile/commands/app-scaffold.md +233 -0
  127. package/plugins/specweave-mobile/commands/build-config.md +256 -0
  128. package/plugins/specweave-mobile/commands/screen-generate.md +289 -0
  129. package/plugins/specweave-n8n/.claude-plugin/plugin.json +1 -1
  130. package/plugins/specweave-plugin-dev/.claude-plugin/plugin.json +13 -12
  131. package/plugins/specweave-plugin-dev/commands/plugin-create.md +333 -0
  132. package/plugins/specweave-plugin-dev/commands/plugin-publish.md +339 -0
  133. package/plugins/specweave-plugin-dev/commands/plugin-test.md +293 -0
  134. package/plugins/specweave-plugin-dev/skills/claude-sdk/SKILL.md +162 -0
  135. package/plugins/specweave-plugin-dev/skills/marketplace-publishing/SKILL.md +263 -0
  136. package/plugins/specweave-plugin-dev/skills/plugin-development/SKILL.md +316 -0
  137. package/plugins/specweave-release/.claude-plugin/plugin.json +1 -1
  138. package/plugins/specweave-release/commands/specweave-release-npm.md +110 -0
  139. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +168 -0
  140. package/plugins/specweave-testing/.claude-plugin/plugin.json +21 -0
  141. package/plugins/specweave-testing/agents/qa-engineer/AGENT.md +797 -0
  142. package/plugins/specweave-testing/agents/qa-engineer/README.md +443 -0
  143. package/plugins/specweave-testing/agents/qa-engineer/templates/playwright-e2e-test.ts +470 -0
  144. package/plugins/specweave-testing/agents/qa-engineer/templates/test-data-factory.ts +507 -0
  145. package/plugins/specweave-testing/agents/qa-engineer/templates/vitest-unit-test.ts +400 -0
  146. package/plugins/specweave-testing/agents/qa-engineer/test-strategies.md +726 -0
  147. package/plugins/specweave-testing/commands/e2e-setup.md +1081 -0
  148. package/plugins/specweave-testing/commands/test-coverage.md +979 -0
  149. package/plugins/specweave-testing/commands/test-generate.md +1156 -0
  150. package/plugins/specweave-testing/commands/test-init.md +409 -0
  151. package/plugins/specweave-testing/skills/e2e-playwright/SKILL.md +769 -0
  152. package/plugins/specweave-testing/skills/tdd-expert/SKILL.md +934 -0
  153. package/plugins/specweave-testing/skills/unit-testing-expert/SKILL.md +1011 -0
  154. package/plugins/specweave-tooling/.claude-plugin/plugin.json +22 -0
  155. package/plugins/specweave-tooling/commands/specweave-tooling-skill-create.md +691 -0
  156. package/plugins/specweave-tooling/commands/specweave-tooling-skill-package.md +751 -0
  157. package/plugins/specweave-tooling/commands/specweave-tooling-skill-validate.md +858 -0
  158. package/plugins/specweave-ui/.claude-plugin/plugin.json +10 -0
  159. package/plugins/specweave-ui/commands/ui-automate.md +199 -0
  160. package/plugins/specweave-ui/commands/ui-inspect.md +70 -0
  161. package/plugins/specweave-ui/skills/browser-automation/SKILL.md +314 -0
  162. package/plugins/specweave-ui/skills/ui-testing/SKILL.md +716 -0
  163. package/plugins/specweave-ui/skills/visual-regression/SKILL.md +728 -0
  164. package/plugins/specweave/commands/check-hooks.md +0 -257
  165. package/plugins/specweave/commands/specweave-archive-increments.md +0 -82
  166. package/plugins/specweave-plugin-dev/skills/plugin-expert/SKILL.md +0 -1231
  167. /package/plugins/specweave/{agents/code-reviewer.md → skills/code-reviewer/SKILL.md} +0 -0
@@ -0,0 +1,487 @@
1
+ ---
2
+ name: spec-kit-expert
3
+ description: Specification Kit expert covering RFC 2119 keywords, Gherkin syntax, user story formats, acceptance criteria patterns, and specification best practices. Activates for spec writing, specification format, RFC 2119, Gherkin, BDD, user stories, acceptance criteria, requirements, INVEST criteria, given-when-then, spec-driven development, specification templates.
4
+ ---
5
+
6
+ # Specification Kit Expert Skill
7
+
8
+ Expert in specification formats, patterns, and best practices for writing clear, testable, and comprehensive requirements documentation.
9
+
10
+ ## Core Competencies
11
+
12
+ ### 1. RFC 2119 Keywords
13
+ **Standard requirement levels** for precise specification language:
14
+
15
+ - **MUST / SHALL**: Absolute requirement (mandatory)
16
+ - **MUST NOT / SHALL NOT**: Absolute prohibition
17
+ - **SHOULD**: Recommended (flexibility allowed)
18
+ - **SHOULD NOT**: Not recommended (discouraged but not prohibited)
19
+ - **MAY / OPTIONAL**: Truly optional feature
20
+
21
+ **Usage example**:
22
+ ```markdown
23
+ The system MUST validate email format before saving.
24
+ The API SHOULD return results within 200ms.
25
+ The cache MAY expire after 1 hour.
26
+ The system MUST NOT store passwords in plain text.
27
+ ```
28
+
29
+ ### 2. Gherkin Syntax (BDD)
30
+ **Behavior-Driven Development** format for executable specifications:
31
+
32
+ ```gherkin
33
+ Feature: User Authentication
34
+ As a registered user
35
+ I want to log in to my account
36
+ So that I can access personalized features
37
+
38
+ Background:
39
+ Given the user database is initialized
40
+ And the user "john@example.com" exists with password "SecurePass123"
41
+
42
+ Scenario: Successful login with valid credentials
43
+ Given I am on the login page
44
+ When I enter email "john@example.com"
45
+ And I enter password "SecurePass123"
46
+ And I click the "Login" button
47
+ Then I should be redirected to the dashboard
48
+ And I should see "Welcome, John"
49
+
50
+ Scenario: Failed login with invalid password
51
+ Given I am on the login page
52
+ When I enter email "john@example.com"
53
+ And I enter password "WrongPassword"
54
+ And I click the "Login" button
55
+ Then I should see error message "Invalid credentials"
56
+ And I should remain on the login page
57
+
58
+ Scenario Outline: Password validation rules
59
+ Given I am on the registration page
60
+ When I enter password "<password>"
61
+ Then the validation message should be "<message>"
62
+
63
+ Examples:
64
+ | password | message |
65
+ | abc | Password must be at least 8 characters |
66
+ | password | Password must contain numbers |
67
+ | Pass123 | Password must contain special chars |
68
+ | Pass123! | Password accepted |
69
+ ```
70
+
71
+ ### 3. User Story Formats
72
+
73
+ #### Standard User Story (Role-Feature-Benefit)
74
+ ```markdown
75
+ **As a** [type of user/role]
76
+ **I want** [goal/desire]
77
+ **So that** [benefit/value]
78
+
79
+ Example:
80
+ As a shopping cart user
81
+ I want to save items for later
82
+ So that I can purchase them when I'm ready without searching again
83
+ ```
84
+
85
+ #### Job Story Format (Context-Event-Outcome)
86
+ ```markdown
87
+ **When** [situation/context]
88
+ **I want to** [motivation/job to be done]
89
+ **So I can** [expected outcome]
90
+
91
+ Example:
92
+ When I'm browsing products but not ready to buy
93
+ I want to save items to a wishlist
94
+ So I can easily find them later when I have budget
95
+ ```
96
+
97
+ #### Feature-Driven Format
98
+ ```markdown
99
+ **In order to** [business value]
100
+ **As a** [role]
101
+ **I want** [feature]
102
+
103
+ Example:
104
+ In order to increase user retention
105
+ As a product manager
106
+ I want users to receive personalized recommendations
107
+ ```
108
+
109
+ ### 4. Acceptance Criteria Patterns
110
+
111
+ #### Given-When-Then Format
112
+ ```markdown
113
+ ## Acceptance Criteria
114
+
115
+ **AC-001**: User login with valid credentials
116
+ - **Given** the user has a registered account
117
+ - **When** they enter correct email and password
118
+ - **Then** they are logged in and redirected to dashboard
119
+
120
+ **AC-002**: User login with invalid credentials
121
+ - **Given** the user enters incorrect password
122
+ - **When** they submit the login form
123
+ - **Then** an error message "Invalid credentials" is displayed
124
+ - **And** the login form remains visible
125
+ ```
126
+
127
+ #### Checklist Format
128
+ ```markdown
129
+ ## Acceptance Criteria
130
+
131
+ **AC-001**: User can complete checkout
132
+ - [ ] User can review cart before payment
133
+ - [ ] User can select shipping address
134
+ - [ ] User can choose payment method
135
+ - [ ] User receives order confirmation email
136
+ - [ ] Order appears in user's order history
137
+
138
+ **AC-002**: Error handling
139
+ - [ ] System validates card number format
140
+ - [ ] System shows error for expired cards
141
+ - [ ] User can retry payment without losing cart
142
+ ```
143
+
144
+ #### Rule-Oriented Format (SBVR - Semantics of Business Vocabulary)
145
+ ```markdown
146
+ ## Business Rules
147
+
148
+ **BR-001**: Password complexity requirements
149
+ - It is MANDATORY that passwords contain at least 8 characters
150
+ - It is MANDATORY that passwords contain at least one uppercase letter
151
+ - It is MANDATORY that passwords contain at least one number
152
+ - It is MANDATORY that passwords contain at least one special character
153
+ - It is PROHIBITED that passwords match the user's email
154
+
155
+ **BR-002**: Discount eligibility
156
+ - It is POSSIBLE that users with loyalty status "Gold" receive 10% discount
157
+ - It is POSSIBLE that users with loyalty status "Platinum" receive 20% discount
158
+ - It is PROHIBITED that discounts stack beyond 25% total
159
+ ```
160
+
161
+ ### 5. INVEST Criteria for User Stories
162
+
163
+ **I - Independent**: Can be developed and tested independently
164
+ **N - Negotiable**: Details can be refined through conversation
165
+ **V - Valuable**: Delivers clear value to users or business
166
+ **E - Estimable**: Team can estimate effort required
167
+ **S - Small**: Completable within one sprint/iteration
168
+ **T - Testable**: Clear acceptance criteria for validation
169
+
170
+ **Example - Poor User Story**:
171
+ ```
172
+ As a user, I want the system to be fast
173
+ ❌ Not testable (what is "fast"?)
174
+ ❌ Too broad (not small)
175
+ ❌ Not estimable (unclear scope)
176
+ ```
177
+
178
+ **Example - INVEST-Compliant User Story**:
179
+ ```
180
+ As a search user
181
+ I want search results to load within 1 second for queries under 10 characters
182
+ So that I can quickly find products without frustration
183
+
184
+ Acceptance Criteria:
185
+ - Search returns results in < 1 second for 95% of queries
186
+ - Timeout message shown after 3 seconds if no results
187
+ - Analytics track search performance metrics
188
+
189
+ ✅ Independent: Doesn't depend on other stories
190
+ ✅ Negotiable: Performance target can be refined
191
+ ✅ Valuable: Improves user experience
192
+ ✅ Estimable: Team can estimate backend + frontend work
193
+ ✅ Small: Can complete in one sprint
194
+ ✅ Testable: Clear performance metrics
195
+ ```
196
+
197
+ ### 6. Specification Templates
198
+
199
+ #### Feature Specification Template
200
+ ```markdown
201
+ # Feature: [Feature Name]
202
+
203
+ ## Overview
204
+ Brief description of the feature and its purpose.
205
+
206
+ ## User Stories
207
+
208
+ ### US-001: [Story Title]
209
+ **As a** [role]
210
+ **I want** [goal]
211
+ **So that** [benefit]
212
+
213
+ **Priority**: High/Medium/Low
214
+ **Estimated Effort**: [story points or time]
215
+
216
+ ## Acceptance Criteria
217
+
218
+ ### AC-US1-01: [Criterion Title]
219
+ - **Given** [context]
220
+ - **When** [action]
221
+ - **Then** [expected outcome]
222
+
223
+ ### AC-US1-02: [Criterion Title]
224
+ - **Given** [context]
225
+ - **When** [action]
226
+ - **Then** [expected outcome]
227
+
228
+ ## Technical Considerations
229
+ - Database changes required
230
+ - API endpoints needed
231
+ - Third-party integrations
232
+ - Security requirements
233
+ - Performance requirements
234
+
235
+ ## Non-Functional Requirements
236
+ - Performance: Response time < 200ms
237
+ - Security: Data encrypted at rest and in transit
238
+ - Accessibility: WCAG 2.1 AA compliance
239
+ - Scalability: Support 10,000 concurrent users
240
+
241
+ ## Dependencies
242
+ - [Other features or systems required]
243
+
244
+ ## Risks & Mitigations
245
+ | Risk | Probability | Impact | Mitigation |
246
+ |------|-------------|--------|------------|
247
+ | API downtime | Medium | High | Implement retry logic + cache |
248
+
249
+ ## Test Scenarios
250
+ 1. Happy path: User completes flow successfully
251
+ 2. Error path: Invalid input validation
252
+ 3. Edge cases: Boundary conditions
253
+ 4. Performance: Load testing under peak traffic
254
+
255
+ ## Success Metrics
256
+ - User adoption: 40% of users enable feature within 30 days
257
+ - Performance: P95 response time < 300ms
258
+ - Error rate: < 0.5% of requests fail
259
+ ```
260
+
261
+ #### API Specification Template (OpenAPI-style)
262
+ ```markdown
263
+ # API Specification: [Endpoint Name]
264
+
265
+ ## Endpoint
266
+ `POST /api/v1/users`
267
+
268
+ ## Description
269
+ Creates a new user account with email verification.
270
+
271
+ ## Request
272
+
273
+ ### Headers
274
+ - `Content-Type: application/json` (REQUIRED)
275
+ - `Authorization: Bearer <token>` (OPTIONAL - for admin creation)
276
+
277
+ ### Body
278
+ ```json
279
+ {
280
+ "email": "user@example.com", // REQUIRED, valid email format
281
+ "password": "SecurePass123!", // REQUIRED, min 8 chars, RFC 2119 MUST
282
+ "name": "John Doe", // REQUIRED, 1-100 characters
283
+ "age": 25, // OPTIONAL, integer >= 18
284
+ "preferences": { // OPTIONAL
285
+ "newsletter": true,
286
+ "notifications": false
287
+ }
288
+ }
289
+ ```
290
+
291
+ ### Validation Rules
292
+ - Email MUST be unique in the system
293
+ - Password MUST meet complexity requirements (see BR-001)
294
+ - Name MUST NOT contain special characters
295
+ - Age SHOULD be >= 18 for most features
296
+
297
+ ## Response
298
+
299
+ ### Success (201 Created)
300
+ ```json
301
+ {
302
+ "id": "uuid-v4",
303
+ "email": "user@example.com",
304
+ "name": "John Doe",
305
+ "created_at": "2024-01-15T10:30:00Z",
306
+ "verification_email_sent": true
307
+ }
308
+ ```
309
+
310
+ ### Error (400 Bad Request)
311
+ ```json
312
+ {
313
+ "error": "VALIDATION_ERROR",
314
+ "message": "Email already exists",
315
+ "field": "email"
316
+ }
317
+ ```
318
+
319
+ ### Error (422 Unprocessable Entity)
320
+ ```json
321
+ {
322
+ "error": "INVALID_PASSWORD",
323
+ "message": "Password must contain at least one special character",
324
+ "field": "password"
325
+ }
326
+ ```
327
+
328
+ ## Business Rules
329
+ - **BR-001**: Email verification MUST be sent within 5 minutes
330
+ - **BR-002**: Unverified accounts SHOULD be deleted after 7 days
331
+ - **BR-003**: Password reset MUST use secure tokens (expiry: 1 hour)
332
+
333
+ ## Rate Limiting
334
+ - 5 requests per minute per IP address
335
+ - 429 Too Many Requests response after limit exceeded
336
+
337
+ ## Security
338
+ - Passwords MUST be hashed using bcrypt (cost factor 12)
339
+ - Email MUST be normalized (lowercase, trimmed)
340
+ - Verification tokens MUST expire after 24 hours
341
+ ```
342
+
343
+ ## Best Practices
344
+
345
+ ### 1. Clear and Concise Language
346
+ ❌ **Bad**: "The system should probably validate stuff"
347
+ ✅ **Good**: "The system MUST validate email format before saving (RFC 5322 compliance)"
348
+
349
+ ### 2. Measurable Criteria
350
+ ❌ **Bad**: "The page should load quickly"
351
+ ✅ **Good**: "Page MUST load within 2 seconds for 95% of requests (P95 latency < 2s)"
352
+
353
+ ### 3. Specific Edge Cases
354
+ ❌ **Bad**: "Handle errors gracefully"
355
+ ✅ **Good**:
356
+ ```markdown
357
+ Error Handling:
358
+ - Network timeout (>5s): Show retry button
359
+ - 401 Unauthorized: Redirect to login
360
+ - 500 Server Error: Show generic error + log ID
361
+ - Rate limited (429): Show "Too many requests, try again in 60s"
362
+ ```
363
+
364
+ ### 4. Use Examples
365
+ ```markdown
366
+ **Input Validation**: Email MUST match RFC 5322 format
367
+
368
+ Examples:
369
+ ✅ Valid: user@example.com, john.doe+tag@company.co.uk
370
+ ❌ Invalid: user@, @example.com, user @example.com (space)
371
+ ```
372
+
373
+ ### 5. Define "Done"
374
+ ```markdown
375
+ ## Definition of Done
376
+
377
+ This story is complete when:
378
+ - [ ] Code implemented and reviewed
379
+ - [ ] Unit tests pass (>80% coverage)
380
+ - [ ] Integration tests pass
381
+ - [ ] Manual QA completed
382
+ - [ ] Acceptance criteria validated by PO
383
+ - [ ] Documentation updated
384
+ - [ ] Deployed to staging
385
+ - [ ] Performance benchmarks met
386
+ ```
387
+
388
+ ## Anti-Patterns to Avoid
389
+
390
+ ### 1. Vague Requirements
391
+ ❌ "The system should be secure"
392
+ ✅ "Authentication MUST use OAuth 2.0 with PKCE. Passwords MUST be hashed with bcrypt (cost 12). Sessions MUST expire after 30 minutes of inactivity."
393
+
394
+ ### 2. Implementation Details in Specs
395
+ ❌ "Use React hooks to fetch data and store in Redux"
396
+ ✅ "When user loads dashboard, display their recent orders (limit: 10)"
397
+
398
+ ### 3. No Acceptance Criteria
399
+ ❌ "Improve search performance"
400
+ ✅ "Search results MUST load in <500ms for 95% of queries (P95). Benchmark: current P95 is 2.3s."
401
+
402
+ ### 4. Overlapping Stories
403
+ Ensure stories are **Independent** (INVEST):
404
+ - ❌ "US-001: Build login form" + "US-002: Add submit button to login"
405
+ - ✅ "US-001: User can log in with email/password"
406
+
407
+ ### 5. Technical Jargon Without Context
408
+ ❌ "Implement CQRS with eventual consistency"
409
+ ✅ "Commands (writes) and queries (reads) use separate models. Read models are updated asynchronously (< 100ms delay)."
410
+
411
+ ## Gherkin Advanced Patterns
412
+
413
+ ### Data Tables
414
+ ```gherkin
415
+ Scenario: Bulk user import
416
+ Given the following users exist:
417
+ | email | role | status |
418
+ | admin@example.com | admin | active |
419
+ | user@example.com | user | active |
420
+ | guest@example.com | guest | inactive |
421
+ When I export users to CSV
422
+ Then the CSV should contain 3 rows
423
+ ```
424
+
425
+ ### Scenario Hooks (Background)
426
+ ```gherkin
427
+ Feature: Shopping Cart
428
+
429
+ Background:
430
+ Given I am logged in as "john@example.com"
431
+ And my cart contains 2 items
432
+
433
+ Scenario: Remove item from cart
434
+ When I remove "Product A" from cart
435
+ Then my cart should contain 1 item
436
+
437
+ Scenario: Apply discount code
438
+ When I enter discount code "SAVE10"
439
+ Then the total should be reduced by 10%
440
+ ```
441
+
442
+ ### Tagged Scenarios
443
+ ```gherkin
444
+ @critical @smoke
445
+ Scenario: User login
446
+
447
+ @slow @integration
448
+ Scenario: Generate monthly report
449
+
450
+ @wip @experimental
451
+ Scenario: AI-powered recommendations
452
+ ```
453
+
454
+ ## Specification Review Checklist
455
+
456
+ Before finalizing a specification, verify:
457
+
458
+ - [ ] **Clarity**: Can a developer implement without questions?
459
+ - [ ] **Testability**: Can QA write test cases from this?
460
+ - [ ] **Completeness**: All edge cases covered?
461
+ - [ ] **Consistency**: Terminology used consistently?
462
+ - [ ] **RFC 2119**: MUST/SHOULD/MAY used correctly?
463
+ - [ ] **INVEST**: User stories are Independent, Negotiable, Valuable, Estimable, Small, Testable?
464
+ - [ ] **Examples**: Concrete examples provided for complex logic?
465
+ - [ ] **Non-functionals**: Performance, security, accessibility specified?
466
+ - [ ] **Dependencies**: External systems and APIs documented?
467
+ - [ ] **Risks**: Potential issues identified with mitigations?
468
+
469
+ ## Resources
470
+
471
+ - RFC 2119: [Key words for requirement levels](https://www.ietf.org/rfc/rfc2119.txt)
472
+ - Gherkin Reference: [Cucumber Documentation](https://cucumber.io/docs/gherkin/reference/)
473
+ - INVEST Criteria: [Bill Wake's original article](https://xp123.com/articles/invest-in-good-stories-and-smart-tasks/)
474
+ - OpenAPI Specification: [OpenAPI 3.1](https://spec.openapis.org/oas/v3.1.0)
475
+
476
+ ## Activation Keywords
477
+
478
+ Ask me about:
479
+ - "How do I write good acceptance criteria?"
480
+ - "RFC 2119 keywords for specifications"
481
+ - "Gherkin syntax examples"
482
+ - "User story format and INVEST criteria"
483
+ - "BDD specification patterns"
484
+ - "How to write testable requirements"
485
+ - "Specification templates for features"
486
+ - "Given-When-Then examples"
487
+ - "Best practices for spec writing"
@@ -0,0 +1,80 @@
1
+ # API Scaffolding Command
2
+
3
+ Generate production-ready backend API structure with authentication, database, and best practices.
4
+
5
+ ## Task
6
+
7
+ You are an expert backend API architect. Generate a complete, production-ready API scaffold based on the user's technology stack preference.
8
+
9
+ ### Steps:
10
+
11
+ 1. **Detect or Ask for Stack**:
12
+ - Node.js (Express, NestJS, Fastify)
13
+ - Python (FastAPI, Django, Flask)
14
+ - .NET (ASP.NET Core)
15
+
16
+ 2. **Generate Project Structure**:
17
+ ```
18
+ src/
19
+ ├── api/
20
+ │ ├── controllers/
21
+ │ ├── routes/
22
+ │ └── middleware/
23
+ ├── core/
24
+ │ ├── config/
25
+ │ ├── database/
26
+ │ └── auth/
27
+ ├── models/
28
+ ├── services/
29
+ ├── utils/
30
+ └── tests/
31
+ ```
32
+
33
+ 3. **Include Essential Components**:
34
+ - **Authentication**: JWT-based auth with refresh tokens
35
+ - **Database**: ORM setup (TypeORM, Sequelize, SQLAlchemy, Entity Framework)
36
+ - **Validation**: Request validation (Joi, Pydantic, FluentValidation)
37
+ - **Error Handling**: Global error handler
38
+ - **Logging**: Structured logging (Winston, Pino, Serilog)
39
+ - **Testing**: Unit and integration test setup
40
+ - **Docker**: Dockerfile and docker-compose.yml
41
+ - **Environment**: .env.example with all required variables
42
+
43
+ 4. **Generate Configuration Files**:
44
+ - package.json / requirements.txt / .csproj
45
+ - tsconfig.json (TypeScript) / pyproject.toml (Python)
46
+ - .gitignore
47
+ - README.md with setup instructions
48
+ - .env.example
49
+
50
+ 5. **Add Sample Endpoints**:
51
+ - GET /health (health check)
52
+ - POST /auth/register
53
+ - POST /auth/login
54
+ - POST /auth/refresh
55
+ - GET /users/me (protected)
56
+ - CRUD for a sample resource
57
+
58
+ 6. **Best Practices**:
59
+ - Dependency injection
60
+ - Clean architecture separation
61
+ - Security headers (CORS, Helmet)
62
+ - Rate limiting
63
+ - API versioning
64
+ - OpenAPI/Swagger documentation
65
+
66
+ ### Example Usage:
67
+
68
+ ```
69
+ User: "Scaffold a NestJS API with PostgreSQL"
70
+ Result: Complete NestJS project with TypeORM, JWT auth, Swagger docs
71
+ ```
72
+
73
+ ```
74
+ User: "Create FastAPI backend with MongoDB"
75
+ Result: FastAPI project with Motor (async MongoDB), Pydantic models, JWT
76
+ ```
77
+
78
+ ### Output:
79
+
80
+ Generate all files with proper content, not just placeholders. Include comments explaining key configurations.
@@ -0,0 +1,109 @@
1
+ # CRUD Generator Command
2
+
3
+ Generate complete CRUD (Create, Read, Update, Delete) operations for a database entity.
4
+
5
+ ## Task
6
+
7
+ You are an expert backend developer. Generate a complete CRUD implementation for a specified entity/model with:
8
+
9
+ ### Required Information (Ask if not provided):
10
+
11
+ 1. **Entity Name**: e.g., "User", "Product", "Order"
12
+ 2. **Fields/Schema**: List of fields with types
13
+ 3. **Stack**: Node.js/Python/.NET
14
+ 4. **Framework**: Express/NestJS/FastAPI/Django/ASP.NET Core
15
+ 5. **Database**: PostgreSQL/MySQL/MongoDB
16
+
17
+ ### Generate:
18
+
19
+ #### 1. **Model/Entity**
20
+ ```typescript
21
+ // Example for TypeORM
22
+ @Entity()
23
+ export class Product {
24
+ @PrimaryGeneratedColumn('uuid')
25
+ id: string;
26
+
27
+ @Column()
28
+ name: string;
29
+
30
+ @Column('decimal', { precision: 10, scale: 2 })
31
+ price: number;
32
+
33
+ @Column({ type: 'text', nullable: true })
34
+ description: string;
35
+
36
+ @CreateDateColumn()
37
+ createdAt: Date;
38
+
39
+ @UpdateDateColumn()
40
+ updatedAt: Date;
41
+ }
42
+ ```
43
+
44
+ #### 2. **Repository/Data Access**
45
+ - Custom query methods
46
+ - Filtering, sorting, pagination
47
+ - Relationships (if applicable)
48
+
49
+ #### 3. **Service Layer**
50
+ ```typescript
51
+ export class ProductService {
52
+ async create(dto: CreateProductDto): Promise<Product> { }
53
+ async findAll(query: QueryDto): Promise<PaginatedResponse<Product>> { }
54
+ async findById(id: string): Promise<Product> { }
55
+ async update(id: string, dto: UpdateProductDto): Promise<Product> { }
56
+ async delete(id: string): Promise<void> { }
57
+ }
58
+ ```
59
+
60
+ #### 4. **DTOs (Data Transfer Objects)**
61
+ - CreateDto (input validation)
62
+ - UpdateDto (partial update)
63
+ - ResponseDto (output serialization)
64
+ - QueryDto (filtering/pagination)
65
+
66
+ #### 5. **Controller/Routes**
67
+ ```typescript
68
+ // REST endpoints
69
+ POST /api/products - Create
70
+ GET /api/products - List (with pagination/filtering)
71
+ GET /api/products/:id - Get by ID
72
+ PUT /api/products/:id - Update
73
+ PATCH /api/products/:id - Partial update
74
+ DELETE /api/products/:id - Delete
75
+ ```
76
+
77
+ #### 6. **Validation Rules**
78
+ - Required fields
79
+ - Type validation
80
+ - Custom business rules
81
+ - Unique constraints
82
+
83
+ #### 7. **Error Handling**
84
+ - Not found errors
85
+ - Validation errors
86
+ - Duplicate key errors
87
+ - Foreign key violations
88
+
89
+ #### 8. **Tests**
90
+ - Unit tests for service
91
+ - Integration tests for endpoints
92
+ - E2E tests with test database
93
+
94
+ ### Best Practices:
95
+
96
+ - **Transactions**: Wrap complex operations in DB transactions
97
+ - **Soft Delete**: Add deletedAt column instead of hard delete
98
+ - **Audit Fields**: createdAt, updatedAt, createdBy, updatedBy
99
+ - **Pagination**: Cursor or offset-based
100
+ - **Filtering**: Support for common operators (eq, ne, gt, lt, like)
101
+ - **Relationships**: Handle related entities properly
102
+ - **Security**: Authorization checks, input sanitization
103
+
104
+ ### Example:
105
+
106
+ ```
107
+ User: "Generate CRUD for Product entity with name, price, description"
108
+ Result: Complete model, service, controller, DTOs, tests for Product
109
+ ```