jattac.libs.web.zest-button 1.2.9 → 1.4.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.
@@ -0,0 +1,435 @@
1
+ # AI BRS (Business Requirements Specification)
2
+
3
+ ## Terminology
4
+
5
+ The words MUST, MUST NOT, SHALL, SHALL NOT, SHOULD and MAY are to be interpreted as defined by RFC 2119.
6
+
7
+ ---
8
+
9
+ # Purpose
10
+
11
+ Every task MUST have a BRS before implementation begins.
12
+
13
+ The BRS defines:
14
+
15
+ • What needs to be done
16
+
17
+ • What "done" looks like
18
+
19
+ • What is explicitly out of scope
20
+
21
+ The BRS is a collaborative document. The AI SHALL ask questions, identify gaps, suggest edge cases, and challenge assumptions during creation.
22
+
23
+ ---
24
+
25
+ # Task-Type Variants
26
+
27
+ The BRS template is the same for all task types. The content varies.
28
+
29
+ | Task Type | Problem Statement Focus | Technical Design Focus |
30
+ |-----------|------------------------|----------------------|
31
+ | Feature | User story + business value | API, DB, services, UI, events |
32
+ | Bug fix | Reproduction steps + expected vs actual | Root cause + fix approach |
33
+ | Refactor | Current state + desired state | Behaviour preservation strategy |
34
+
35
+ ---
36
+
37
+ # Creation Process
38
+
39
+ ```
40
+ User request received
41
+
42
+ Does a BRS exist for this task?
43
+
44
+ YES → Read it. Verify completeness.
45
+
46
+ NO → Create collaboratively with user.
47
+
48
+ AI SHALL:
49
+ • Ask clarifying questions
50
+ • Identify gaps in requirements
51
+ • Suggest edge cases
52
+ • Critique technical decisions
53
+ • Recommend patterns
54
+ • Challenge assumptions
55
+
56
+ BRS complete?
57
+
58
+ YES → Save BRS. Proceed to workflow.
59
+
60
+ NO → STOP. Ask user to complete missing sections.
61
+ ```
62
+
63
+ ---
64
+
65
+ # Approval Gate
66
+
67
+ The BRS MUST be explicitly approved by the user before implementation begins.
68
+
69
+ Approval means: the user confirms the BRS is complete and accurate.
70
+
71
+ The AI SHALL NOT proceed without approval.
72
+
73
+ The AI SHALL NOT assume approval. The user MUST explicitly say "approved" or equivalent.
74
+
75
+ If the user says nothing after the BRS is presented, STOP and wait.
76
+
77
+ ---
78
+
79
+ # BRS Location
80
+
81
+ BRS is co-located with the code it describes.
82
+
83
+ C# backend:
84
+
85
+ ```
86
+ src/Features/<FeatureName>/BRS.md
87
+ ```
88
+
89
+ Next.js frontend:
90
+
91
+ ```
92
+ src/features/<featureName>/BRS.md
93
+ ```
94
+
95
+ Each layer has its own BRS. They are separate documents.
96
+
97
+ If a task spans both layers, both layers MUST have their own BRS.
98
+
99
+ ---
100
+
101
+ # BRS Template
102
+
103
+ ```markdown
104
+ # BRS — [Task Title]
105
+
106
+ ## Metadata
107
+
108
+ | Field | Value |
109
+ |-------|-------|
110
+ | Status | Draft / Approved / Implementing / Complete |
111
+ | Task Type | Feature / Bug Fix / Refactor / Other |
112
+ | Author | [Name] |
113
+ | Created | [Date] |
114
+ | Last Updated | [Date] |
115
+
116
+ ---
117
+
118
+ ## Problem Statement
119
+
120
+ ### For Features
121
+
122
+ As a [user type], I want [action] so that [benefit].
123
+
124
+ ### For Bug Fixes
125
+
126
+ **Reproduction Steps:**
127
+
128
+ 1. [Step 1]
129
+ 2. [Step 2]
130
+ 3. [Step 3]
131
+
132
+ **Expected Behaviour:** [What should happen]
133
+
134
+ **Actual Behaviour:** [What actually happens]
135
+
136
+ **Root Cause:** [If known]
137
+
138
+ ### For Refactors
139
+
140
+ **Current State:** [What exists now]
141
+
142
+ **Desired State:** [What it should look like]
143
+
144
+ **Why:** [Motivation for the refactor]
145
+
146
+ ---
147
+
148
+ ## Business Value / Impact
149
+
150
+ [Why this matters. What problem does it solve? What risk does it mitigate?]
151
+
152
+ ---
153
+
154
+ ## Acceptance Criteria
155
+
156
+ Each criterion MUST be specific and testable.
157
+
158
+ ### [Criterion 1: Short descriptive name]
159
+
160
+ - **Given** [precondition / context]
161
+ - **When** [action / trigger]
162
+ - **Then** [expected result]
163
+ - **And** [additional expected result, if any]
164
+
165
+ ### [Criterion 2: Short descriptive name]
166
+
167
+ - **Given** [precondition]
168
+ - **When** [action]
169
+ - **Then** [expected result]
170
+
171
+ [... continue for ALL acceptance criteria]
172
+
173
+ ---
174
+
175
+ ## Out of Scope
176
+
177
+ Explicitly list what this task does NOT include.
178
+
179
+ - [What this task does NOT do]
180
+ - [What this task does NOT change]
181
+ - [What this task does NOT fix]
182
+
183
+ ---
184
+
185
+ ## Technical Design
186
+
187
+ ### API Endpoints (if applicable)
188
+
189
+ | Method | Path | Description | Request Body | Response Body | Status Codes |
190
+ |--------|------|-------------|--------------|---------------|--------------|
191
+ | POST | /api/payments | Create payment | `{amount, currency}` | `{id, amount, status}` | 201, 400, 500 |
192
+
193
+ ### Database Changes (if applicable)
194
+
195
+ | Table | Change Type | Column | Type | Notes |
196
+ |-------|-------------|--------|------|-------|
197
+ | payments | CREATE | id | BIGINT | PK |
198
+ | payments | CREATE | amount | DECIMAL(10,2) | NOT NULL |
199
+
200
+ ### Service Methods (if applicable)
201
+
202
+ | Class | Method | Signature | Behaviour |
203
+ |-------|--------|-----------|-----------|
204
+ | PaymentService | CreatePayment | `async Task<Payment> CreatePayment(...)` | Creates record, publishes event |
205
+
206
+ ### UI Components (if applicable)
207
+
208
+ | Component | Purpose | Behaviour |
209
+ |-----------|---------|-----------|
210
+ | PaymentForm | Create payment | Submits, validates, redirects |
211
+
212
+ ### Events (if applicable)
213
+
214
+ | Event | Publisher | Consumers | Payload |
215
+ |-------|-----------|-----------|---------|
216
+ | PaymentCreated | PaymentService | ReceiptService | `{paymentId, amount}` |
217
+
218
+ ---
219
+
220
+ ## Edge Cases
221
+
222
+ ### [Edge Case 1]
223
+
224
+ **Scenario:** [Description]
225
+
226
+ **Expected:** [Behaviour]
227
+
228
+ ### [Edge Case 2]
229
+
230
+ **Scenario:** [Description]
231
+
232
+ **Expected:** [Behaviour]
233
+
234
+ ---
235
+
236
+ ## Dependencies
237
+
238
+ ### Internal
239
+
240
+ - [What must exist before this works]
241
+
242
+ ### External
243
+
244
+ - [What external systems are required]
245
+
246
+ ---
247
+
248
+ ## Risks and Open Questions
249
+
250
+ ### Risks
251
+
252
+ - [What could go wrong]
253
+
254
+ ### Open Questions
255
+
256
+ - [What needs clarification]
257
+
258
+ ---
259
+
260
+ ## Regression Prevention
261
+
262
+ ### For Bug Fixes
263
+
264
+ **Regression Test:** [Name of test that prevents this bug from recurring]
265
+
266
+ **Test Location:** [File path]
267
+
268
+ ### For Features
269
+
270
+ **New Tests Required:**
271
+
272
+ - [Test 1: what it verifies]
273
+ - [Test 2: what it verifies]
274
+
275
+ ### For Refactors
276
+
277
+ **Behaviour Preservation:** [How we verify behaviour is unchanged]
278
+
279
+ ---
280
+
281
+ ## Definition of Done
282
+
283
+ Every item MUST be checked before this task is considered complete.
284
+
285
+ - [ ] BRS approved by user
286
+ - [ ] All acceptance criteria pass
287
+ - [ ] All tests pass (new + existing)
288
+ - [ ] No regressions
289
+ - [ ] No unsolicited changes outside BRS scope
290
+ - [ ] Code matches existing patterns
291
+ - [ ] Change manifest produced
292
+ - [ ] Self review passed with all PASS items
293
+ ```
294
+
295
+ ---
296
+
297
+ # BRS Completeness Checklist
298
+
299
+ Before presenting the BRS to the user for approval, verify:
300
+
301
+ ✓ Metadata is filled in
302
+
303
+ ✓ Problem statement is clear and complete
304
+
305
+ ✓ Business value is articulated
306
+
307
+ ✓ Every acceptance criterion uses Given-When-Then format
308
+
309
+ ✓ Out of scope is explicit
310
+
311
+ ✓ Technical design covers all affected layers
312
+
313
+ ✓ Edge cases are identified
314
+
315
+ ✓ Dependencies are listed
316
+
317
+ ✓ Risks and open questions are documented
318
+
319
+ ✓ Regression prevention strategy is defined
320
+
321
+ ✓ Definition of done is complete
322
+
323
+ If any item is missing, the BRS is NOT complete.
324
+
325
+ ---
326
+
327
+ # BRS Review Process
328
+
329
+ The AI SHALL review the BRS for:
330
+
331
+ ### Completeness
332
+
333
+ Are all sections filled in?
334
+
335
+ Are there gaps in the requirements?
336
+
337
+ Are there missing edge cases?
338
+
339
+ ### Testability
340
+
341
+ Can every acceptance criterion be verified by a test?
342
+
343
+ Are the expected results specific enough?
344
+
345
+ Are there any vague terms ("should", "fast", "user-friendly")?
346
+
347
+ ### Consistency
348
+
349
+ Do the acceptance criteria contradict each other?
350
+
351
+ Does the technical design support all acceptance criteria?
352
+
353
+ Are there dependencies that create circular requirements?
354
+
355
+ ### Feasibility
356
+
357
+ Is the technical design achievable?
358
+
359
+ Are there technical risks that haven't been addressed?
360
+
361
+ Is the scope reasonable for the task?
362
+
363
+ ### Safety
364
+
365
+ Does the task introduce security risks?
366
+
367
+ Does the task affect data integrity?
368
+
369
+ Does the task break existing behaviour?
370
+
371
+ ---
372
+
373
+ # BRS Anti-Patterns
374
+
375
+ The following are NOT acceptable in a BRS:
376
+
377
+ • Vague acceptance criteria ("should work correctly")
378
+
379
+ • Missing edge cases for critical paths
380
+
381
+ • Acceptance criteria that cannot be tested
382
+
383
+ • Technical design that contradicts acceptance criteria
384
+
385
+ • Out of scope that is too broad (prevents the task from being done)
386
+
387
+ • Out of scope that is too narrow (allows scope creep)
388
+
389
+ • Missing regression prevention for bug fixes
390
+
391
+ • Definition of done that is not verifiable
392
+
393
+ ---
394
+
395
+ # Updating the BRS
396
+
397
+ The BRS MAY be updated during implementation if:
398
+
399
+ • New edge cases are discovered
400
+
401
+ • Technical design needs to change
402
+
403
+ • Acceptance criteria need refinement
404
+
405
+ When updating:
406
+
407
+ 1. Update the "Last Updated" field
408
+
409
+ 2. Document what changed and why
410
+
411
+ 3. Re-present to the user for approval
412
+
413
+ 4. Only proceed after re-approval
414
+
415
+ ---
416
+
417
+ # BRS and the Workflow
418
+
419
+ The BRS is Step 1 of the AI workflow.
420
+
421
+ Every subsequent step traces back to the BRS:
422
+
423
+ • Impact analysis (Step 3) identifies what the BRS requires
424
+
425
+ • Blast radius (Step 6) identifies what the BRS might affect
426
+
427
+ • Implementation (Step 10) satisfies the BRS acceptance criteria
428
+
429
+ • Tests (Step 12) verify the BRS acceptance criteria
430
+
431
+ • Self review (Step 13) checks BRS compliance
432
+
433
+ • Completion report (Step 16) maps changes back to the BRS
434
+
435
+ If any step reveals the BRS is incomplete, STOP and update the BRS.
@@ -0,0 +1,198 @@
1
+ # AI Code Review
2
+
3
+ Every completed task SHALL perform a self review.
4
+
5
+ No exceptions.
6
+
7
+ ---
8
+
9
+ # Review Checklist
10
+
11
+ Every item MUST be evaluated as PASS or FAIL with evidence.
12
+
13
+ If ANY item is FAIL, the task is NOT complete.
14
+
15
+ ---
16
+
17
+ ## Correctness
18
+
19
+ Does the change do what was requested?
20
+
21
+ Evidence: specific trace from user request to code change.
22
+
23
+ FAIL if: any change cannot be traced to a specific requirement.
24
+
25
+ ---
26
+
27
+ ## Blast Radius
28
+
29
+ Were all affected behaviours identified?
30
+
31
+ Evidence: list of behaviours checked.
32
+
33
+ FAIL if: any affected behaviour was not identified.
34
+
35
+ ---
36
+
37
+ ## Test Coverage
38
+
39
+ Does every change have a corresponding test?
40
+
41
+ Evidence: test names and locations.
42
+
43
+ FAIL if: any production change lacks a corresponding test.
44
+
45
+ ---
46
+
47
+ ## No Additions
48
+
49
+ Were any unnecessary additions made?
50
+
51
+ Review the diff for:
52
+
53
+ • Comments not requested
54
+
55
+ • Logging not requested
56
+
57
+ • Error handling not requested
58
+
59
+ • Null checks not requested
60
+
61
+ • TODO comments
62
+
63
+ • Defensive code not requested
64
+
65
+ Evidence: diff review.
66
+
67
+ FAIL if: any addition cannot be traced to a specific requirement.
68
+
69
+ ---
70
+
71
+ ## No Modifications
72
+
73
+ Were any unrelated lines modified?
74
+
75
+ Review the diff for:
76
+
77
+ • Formatting changes in unrelated code
78
+
79
+ • Renaming of symbols
80
+
81
+ • Reordering of methods or imports
82
+
83
+ • Changes to code not required by the task
84
+
85
+ Evidence: diff review.
86
+
87
+ FAIL if: any unrelated line was modified.
88
+
89
+ ---
90
+
91
+ ## Pattern Matching
92
+
93
+ Does the code match existing patterns?
94
+
95
+ Evidence: examples of existing patterns cited.
96
+
97
+ FAIL if: code introduces a new pattern when an existing one exists.
98
+
99
+ ---
100
+
101
+ ## Build
102
+
103
+ Does the build pass?
104
+
105
+ Evidence: build output.
106
+
107
+ FAIL if: build fails.
108
+
109
+ ---
110
+
111
+ ## Tests
112
+
113
+ Do all tests pass?
114
+
115
+ Evidence: test output with counts.
116
+
117
+ FAIL if: any test fails.
118
+
119
+ ---
120
+
121
+ ## Knowledge
122
+
123
+ Was ai-knowledge.md updated?
124
+
125
+ Evidence: diff of knowledge file.
126
+
127
+ FAIL if: new architectural knowledge was discovered but not recorded.
128
+
129
+ ---
130
+
131
+ ## Decision Log
132
+
133
+ Was decision-log.md updated?
134
+
135
+ Evidence: diff of decision log.
136
+
137
+ FAIL if: a decision was made but not recorded.
138
+
139
+ ---
140
+
141
+ ## Change Manifest
142
+
143
+ Was a change manifest produced?
144
+
145
+ Evidence: manifest text.
146
+
147
+ FAIL if: changes were made without justification.
148
+
149
+ ---
150
+
151
+ ## Rollback
152
+
153
+ Can every change be reverted independently?
154
+
155
+ Evidence: isolation assessment.
156
+
157
+ FAIL if: changes are interdependent in ways that prevent safe rollback.
158
+
159
+ ---
160
+
161
+ # Output Format
162
+
163
+ Report the review as:
164
+
165
+ ```
166
+ Self Review Results
167
+
168
+ [PASS/FAIL] Correctness — [evidence]
169
+ [PASS/FAIL] Blast radius — [evidence]
170
+ [PASS/FAIL] Test coverage — [evidence]
171
+ [PASS/FAIL] No additions — [evidence]
172
+ [PASS/FAIL] No modifications — [evidence]
173
+ [PASS/FAIL] Pattern matching — [evidence]
174
+ [PASS/FAIL] Build — [evidence]
175
+ [PASS/FAIL] Tests — [evidence]
176
+ [PASS/FAIL] Knowledge — [evidence]
177
+ [PASS/FAIL] Decision log — [evidence]
178
+ [PASS/FAIL] Change manifest — [evidence]
179
+ [PASS/FAIL] Rollback — [evidence]
180
+
181
+ Known Risks: [list]
182
+ Remaining Unknowns: [list]
183
+ Confidence: [low/medium/high]
184
+ ```
185
+
186
+ ---
187
+
188
+ # Failure Handling
189
+
190
+ If ANY item is FAIL, the task is NOT complete.
191
+
192
+ Address the failure before reporting completion.
193
+
194
+ Do NOT report completion with FAIL items.
195
+
196
+ Do NOT downgrade a FAIL to a PASS.
197
+
198
+ Do NOT skip items you cannot evaluate.