qaa-agent 1.0.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 (56) hide show
  1. package/.claude/commands/create-test.md +40 -0
  2. package/.claude/commands/qa-analyze.md +60 -0
  3. package/.claude/commands/qa-audit.md +37 -0
  4. package/.claude/commands/qa-blueprint.md +54 -0
  5. package/.claude/commands/qa-fix.md +36 -0
  6. package/.claude/commands/qa-from-ticket.md +88 -0
  7. package/.claude/commands/qa-gap.md +54 -0
  8. package/.claude/commands/qa-pom.md +36 -0
  9. package/.claude/commands/qa-pyramid.md +37 -0
  10. package/.claude/commands/qa-report.md +38 -0
  11. package/.claude/commands/qa-start.md +33 -0
  12. package/.claude/commands/qa-testid.md +54 -0
  13. package/.claude/commands/qa-validate.md +54 -0
  14. package/.claude/commands/update-test.md +58 -0
  15. package/.claude/settings.json +19 -0
  16. package/.claude/skills/qa-bug-detective/SKILL.md +122 -0
  17. package/.claude/skills/qa-repo-analyzer/SKILL.md +88 -0
  18. package/.claude/skills/qa-self-validator/SKILL.md +109 -0
  19. package/.claude/skills/qa-template-engine/SKILL.md +113 -0
  20. package/.claude/skills/qa-testid-injector/SKILL.md +93 -0
  21. package/.claude/skills/qa-workflow-documenter/SKILL.md +87 -0
  22. package/CLAUDE.md +543 -0
  23. package/README.md +418 -0
  24. package/agents/qa-pipeline-orchestrator.md +1217 -0
  25. package/agents/qaa-analyzer.md +508 -0
  26. package/agents/qaa-bug-detective.md +444 -0
  27. package/agents/qaa-executor.md +618 -0
  28. package/agents/qaa-planner.md +374 -0
  29. package/agents/qaa-scanner.md +422 -0
  30. package/agents/qaa-testid-injector.md +583 -0
  31. package/agents/qaa-validator.md +450 -0
  32. package/bin/install.cjs +176 -0
  33. package/bin/lib/commands.cjs +709 -0
  34. package/bin/lib/config.cjs +307 -0
  35. package/bin/lib/core.cjs +497 -0
  36. package/bin/lib/frontmatter.cjs +299 -0
  37. package/bin/lib/init.cjs +989 -0
  38. package/bin/lib/milestone.cjs +241 -0
  39. package/bin/lib/model-profiles.cjs +60 -0
  40. package/bin/lib/phase.cjs +911 -0
  41. package/bin/lib/roadmap.cjs +306 -0
  42. package/bin/lib/state.cjs +748 -0
  43. package/bin/lib/template.cjs +222 -0
  44. package/bin/lib/verify.cjs +842 -0
  45. package/bin/qaa-tools.cjs +607 -0
  46. package/package.json +34 -0
  47. package/templates/failure-classification.md +391 -0
  48. package/templates/gap-analysis.md +409 -0
  49. package/templates/pr-template.md +48 -0
  50. package/templates/qa-analysis.md +381 -0
  51. package/templates/qa-audit-report.md +465 -0
  52. package/templates/qa-repo-blueprint.md +636 -0
  53. package/templates/scan-manifest.md +312 -0
  54. package/templates/test-inventory.md +582 -0
  55. package/templates/testid-audit-report.md +354 -0
  56. package/templates/validation-report.md +243 -0
@@ -0,0 +1,354 @@
1
+ ---
2
+ template_name: testid-audit-report
3
+ version: "1.0"
4
+ artifact_type: audit
5
+ produces: TESTID_AUDIT_REPORT.md
6
+ producer_agent: qa-testid-injector
7
+ consumer_agents:
8
+ - qa-executor
9
+ - human-reviewer
10
+ required_sections:
11
+ - summary
12
+ - coverage-score
13
+ - file-details
14
+ - naming-convention-compliance
15
+ - decision-gate
16
+ example_domain: shopflow
17
+ ---
18
+
19
+ # TESTID_AUDIT_REPORT.md Template
20
+
21
+ **Purpose:** Audit of `data-testid` coverage across frontend component files, identifying interactive elements that lack stable test selectors and proposing injection values following a consistent naming convention.
22
+
23
+ **Producer:** `qa-testid-injector` (Phase 2: AUDIT step)
24
+ **Consumers:** `qa-executor` (uses proposed test IDs when writing E2E tests), `human-reviewer` (reviews proposed values before injection)
25
+
26
+ ---
27
+
28
+ ## Required Sections
29
+
30
+ ### Section 1: Summary
31
+
32
+ **Description:** High-level counts of scanned files, interactive elements found, and breakdown of missing `data-testid` attributes by priority.
33
+
34
+ **Fields:**
35
+
36
+ | Field | Type | Required | Description |
37
+ |-------|------|----------|-------------|
38
+ | files_scanned | integer | YES | Total number of component files scanned |
39
+ | total_interactive_elements | integer | YES | Total interactive elements found across all files |
40
+ | elements_with_testid | integer | YES | Elements that already have a `data-testid` attribute |
41
+ | elements_missing_testid | integer | YES | Elements that need a `data-testid` injected |
42
+ | p0_missing | integer | YES | P0 (must have): form inputs, submit buttons, primary actions |
43
+ | p1_missing | integer | YES | P1 (should have): navigation links, secondary actions, feedback elements |
44
+ | p2_missing | integer | YES | P2 (nice to have): decorative images, static containers showing dynamic data |
45
+
46
+ **Priority Definitions:**
47
+
48
+ | Priority | Label | Elements |
49
+ |----------|-------|----------|
50
+ | P0 | Must Have | Form `<input>`, `<select>`, `<textarea>`, submit `<button>`, primary action buttons, `<form>` tags |
51
+ | P1 | Should Have | Navigation `<a>` links, secondary buttons, error/alert messages, toggle/checkbox/radio |
52
+ | P2 | Nice to Have | Images showing product data, badges, decorative containers with dynamic content |
53
+
54
+ ---
55
+
56
+ ### Section 2: Coverage Score
57
+
58
+ **Description:** Quantified coverage percentage with interpretation and projected post-injection score.
59
+
60
+ **Fields:**
61
+
62
+ | Field | Type | Required | Description |
63
+ |-------|------|----------|-------------|
64
+ | current_coverage | percentage | YES | `elements_with_testid / total_interactive_elements * 100` |
65
+ | projected_coverage | percentage | YES | Coverage percentage after all proposed injections are applied |
66
+ | score_interpretation | string | YES | One of: EXCELLENT, GOOD, NEEDS WORK, CRITICAL |
67
+
68
+ **Formula:**
69
+ ```
70
+ Current Coverage = (elements_with_testid / total_interactive_elements) * 100
71
+ Projected Coverage = ((elements_with_testid + elements_missing_testid) / total_interactive_elements) * 100
72
+ ```
73
+
74
+ **Interpretation Thresholds:**
75
+
76
+ | Score Range | Interpretation | Meaning |
77
+ |-------------|---------------|---------|
78
+ | > 90% | EXCELLENT | Most elements already have test IDs; selective injection only |
79
+ | 50% - 90% | GOOD | Decent baseline; targeted injection pass needed |
80
+ | 1% - 49% | NEEDS WORK | Significant gaps; full injection pass required |
81
+ | 0% | CRITICAL | No test IDs exist; P0-first strategy recommended |
82
+
83
+ ---
84
+
85
+ ### Section 3: File Details
86
+
87
+ **Description:** Per-component file audit showing every interactive element, its current selector state, and the proposed `data-testid` value.
88
+
89
+ **Per-File Structure:**
90
+
91
+ | Field | Type | Required | Description |
92
+ |-------|------|----------|-------------|
93
+ | file_path | string | YES | Full path to the component file |
94
+ | component_name | string | YES | Name of the React/Vue/Angular component |
95
+ | element_count | integer | YES | Total interactive elements in this file |
96
+
97
+ **Per-Element Table Columns:**
98
+
99
+ | Column | Description |
100
+ |--------|-------------|
101
+ | Line | Line number in the source file where the element appears |
102
+ | Element | HTML tag and type (e.g., `<input type="email">`, `<button type="submit">`) |
103
+ | Current Selector | What exists now: `data-testid="value"`, `className="..."`, `name="..."`, or `none` |
104
+ | Proposed data-testid | The proposed value following `{context}-{description}-{element-type}` convention, or `EXISTING -- no change` if already has a `data-testid` |
105
+ | Priority | P0, P1, or P2 |
106
+
107
+ **Rules:**
108
+ - Elements with an EXISTING `data-testid` are marked `EXISTING -- no change` and are never modified
109
+ - Elements missing `data-testid` receive a proposed value following `{context}-{description}-{element-type}` naming convention
110
+ - Context is derived from the component filename (e.g., `LoginPage.tsx` -> `login`, `CheckoutForm.tsx` -> `checkout`)
111
+
112
+ ---
113
+
114
+ ### Section 4: Naming Convention Compliance
115
+
116
+ **Description:** Audit of existing `data-testid` values against the `{context}-{description}-{element-type}` naming pattern.
117
+
118
+ **Fields:**
119
+
120
+ | Field | Type | Required | Description |
121
+ |-------|------|----------|-------------|
122
+ | total_existing | integer | YES | Count of elements with existing `data-testid` |
123
+ | compliant_count | integer | YES | Count that follow the naming convention |
124
+ | non_compliant_count | integer | YES | Count that violate the naming convention |
125
+
126
+ **Per-Value Table Columns:**
127
+
128
+ | Column | Description |
129
+ |--------|-------------|
130
+ | Existing Value | The current `data-testid` value |
131
+ | Compliant | YES or NO |
132
+ | Issue | If non-compliant: what is wrong (e.g., "missing element-type suffix", "camelCase instead of kebab-case") |
133
+ | Suggested Rename | If non-compliant: the corrected value following convention |
134
+
135
+ **Convention Rules:**
136
+ - All values MUST be kebab-case: `login-submit-btn`, never `loginSubmitBtn` or `login_submit_btn`
137
+ - All values MUST end with an element-type suffix: `-btn`, `-input`, `-link`, `-form`, `-img`, etc.
138
+ - All values MUST start with a context prefix derived from the component name
139
+ - No framework-specific prefixes: no `cy-`, `pw-`, `qa-` prefixes
140
+
141
+ ---
142
+
143
+ ### Section 5: Decision Gate
144
+
145
+ **Description:** Automated recommendation based on coverage score that determines the injection strategy.
146
+
147
+ **Decision Matrix:**
148
+
149
+ | Coverage | Decision | Strategy |
150
+ |----------|----------|----------|
151
+ | > 90% | SELECTIVE | Inject only P0 missing elements |
152
+ | 50% - 90% | TARGETED | Inject P0 and P1 missing elements |
153
+ | 1% - 49% | FULL PASS | Inject all P0, P1, P2 elements |
154
+ | 0% | P0 FIRST | Inject P0 elements only, then re-audit after |
155
+ | 0 files scanned | STOP | No frontend component files detected -- abort injection |
156
+
157
+ **Output Format:**
158
+ ```
159
+ DECISION: {decision_type}
160
+ REASON: Current coverage {X}%, {explanation}
161
+ ACTION: {what the injector should do next}
162
+ FILES: {count} files to process
163
+ ELEMENTS: {count} elements to inject
164
+ ```
165
+
166
+ ---
167
+
168
+ ## Worked Example (ShopFlow E-Commerce API)
169
+
170
+ ### Summary
171
+
172
+ | Metric | Count |
173
+ |--------|-------|
174
+ | Files Scanned | 6 |
175
+ | Total Interactive Elements | 42 |
176
+ | Elements with Existing data-testid | 8 |
177
+ | Elements Missing data-testid | 34 |
178
+ | P0 Missing (must have) | 18 |
179
+ | P1 Missing (should have) | 12 |
180
+ | P2 Missing (nice to have) | 4 |
181
+
182
+ ### Coverage Score
183
+
184
+ ```
185
+ Current Coverage = 8 / 42 * 100 = 19.05%
186
+ Projected Coverage = 42 / 42 * 100 = 100%
187
+ ```
188
+
189
+ **Score: 19% -- NEEDS WORK**
190
+
191
+ Current coverage is well below the 50% threshold. A full injection pass is recommended to bring all interactive elements up to testability standards before E2E test generation.
192
+
193
+ ### File Details
194
+
195
+ #### LoginPage.tsx -- LoginPage Component
196
+
197
+ **Path:** `src/components/auth/LoginPage.tsx`
198
+ **Interactive elements:** 8 (4 P0, 3 P1, 1 P2)
199
+
200
+ | Line | Element | Current Selector | Proposed data-testid | Priority |
201
+ |------|---------|-----------------|----------------------|----------|
202
+ | 18 | `<form>` | `className="login-form"` | `login-form` | P0 |
203
+ | 22 | `<input type="email">` | `name="email"` | `login-email-input` | P0 |
204
+ | 28 | `<input type="password">` | `name="password"` | `login-password-input` | P0 |
205
+ | 34 | `<button type="submit">` | `className="btn-primary"` | `login-submit-btn` | P0 |
206
+ | 40 | `<a href="/forgot-password">` | none | `login-forgot-password-link` | P1 |
207
+ | 45 | `<a href="/register">` | none | `login-register-link` | P1 |
208
+ | 50 | `<div className="error">` | `className="error-message"` | `login-error-alert` | P1 |
209
+ | 55 | `<img>` | `className="logo"` | `login-logo-img` | P2 |
210
+
211
+ #### CheckoutForm.tsx -- CheckoutForm Component
212
+
213
+ **Path:** `src/components/checkout/CheckoutForm.tsx`
214
+ **Interactive elements:** 10 (6 P0, 3 P1, 1 P2)
215
+
216
+ | Line | Element | Current Selector | Proposed data-testid | Priority |
217
+ |------|---------|-----------------|----------------------|----------|
218
+ | 12 | `<form>` | `className="checkout-form"` | `checkout-form` | P0 |
219
+ | 18 | `<input type="email">` | `data-testid="email"` | EXISTING -- no change | P0 |
220
+ | 24 | `<input type="text">` (card number) | `name="cardNumber"` | `checkout-card-number-input` | P0 |
221
+ | 30 | `<input type="text">` (expiry) | `name="expiry"` | `checkout-expiry-input` | P0 |
222
+ | 36 | `<input type="text">` (CVV) | `name="cvv"` | `checkout-cvv-input` | P0 |
223
+ | 42 | `<button type="submit">` | `data-testid="submitBtn"` | EXISTING -- no change | P0 |
224
+ | 48 | `<select>` (country) | `name="country"` | `checkout-country-select` | P1 |
225
+ | 54 | `<input type="text">` (promo code) | none | `checkout-promo-code-input` | P1 |
226
+ | 60 | `<span>` (total display) | `className="order-total"` | `checkout-total-text` | P1 |
227
+ | 66 | `<img>` (card brand icon) | `className="card-icon"` | `checkout-card-brand-img` | P2 |
228
+
229
+ #### ProductCard.tsx -- ProductCard Component
230
+
231
+ **Path:** `src/components/products/ProductCard.tsx`
232
+ **Interactive elements:** 5 (2 P0, 2 P1, 1 P2)
233
+
234
+ | Line | Element | Current Selector | Proposed data-testid | Priority |
235
+ |------|---------|-----------------|----------------------|----------|
236
+ | 10 | `<button>` (add to cart) | `data-testid="add-cart"` | EXISTING -- no change | P0 |
237
+ | 16 | `<a>` (product detail link) | `className="product-link"` | `product-detail-link` | P0 |
238
+ | 22 | `<span>` (product name) | `data-testid="product_name"` | EXISTING -- no change | P1 |
239
+ | 28 | `<span>` (price display) | `className="price"` | `product-price-text` | P1 |
240
+ | 34 | `<img>` (product image) | `data-testid="productImg"` | EXISTING -- no change | P2 |
241
+
242
+ #### NavigationBar.tsx -- NavigationBar Component
243
+
244
+ **Path:** `src/components/layout/NavigationBar.tsx`
245
+ **Interactive elements:** 7 (1 P0, 5 P1, 1 P2)
246
+
247
+ | Line | Element | Current Selector | Proposed data-testid | Priority |
248
+ |------|---------|-----------------|----------------------|----------|
249
+ | 8 | `<a>` (logo/home link) | `className="brand"` | `navbar-home-link` | P0 |
250
+ | 14 | `<a>` (products link) | none | `navbar-products-link` | P1 |
251
+ | 20 | `<a>` (orders link) | none | `navbar-orders-link` | P1 |
252
+ | 26 | `<a>` (cart link) | `data-testid="cart-link"` | EXISTING -- no change | P1 |
253
+ | 32 | `<button>` (user menu toggle) | none | `navbar-user-menu-btn` | P1 |
254
+ | 38 | `<a>` (logout link) | none | `navbar-logout-link` | P1 |
255
+ | 44 | `<span>` (cart count badge) | `data-testid="cartCount"` | EXISTING -- no change | P2 |
256
+
257
+ #### OrderHistory.tsx -- OrderHistory Component
258
+
259
+ **Path:** `src/components/orders/OrderHistory.tsx`
260
+ **Interactive elements:** 6 (2 P0, 2 P1, 2 P2)
261
+
262
+ | Line | Element | Current Selector | Proposed data-testid | Priority |
263
+ |------|---------|-----------------|----------------------|----------|
264
+ | 10 | `<table>` | `className="orders-table"` | `order-history-table` | P0 |
265
+ | 15 | `<button>` (view details) | `className="btn-sm"` | `order-view-details-btn` | P0 |
266
+ | 22 | `<select>` (status filter) | `name="statusFilter"` | `order-status-filter-select` | P1 |
267
+ | 28 | `<input type="text">` (search) | `name="search"` | `order-search-input` | P1 |
268
+ | 34 | `<span>` (order status badge) | `className="status-badge"` | `order-status-badge` | P2 |
269
+ | 40 | `<span>` (order total) | `className="order-amount"` | `order-total-text` | P2 |
270
+
271
+ #### UserProfilePage.tsx -- UserProfilePage Component
272
+
273
+ **Path:** `src/components/user/UserProfilePage.tsx`
274
+ **Interactive elements:** 6 (3 P0, 2 P1, 1 P2)
275
+
276
+ | Line | Element | Current Selector | Proposed data-testid | Priority |
277
+ |------|---------|-----------------|----------------------|----------|
278
+ | 12 | `<form>` | `className="profile-form"` | `profile-form` | P0 |
279
+ | 18 | `<input type="text">` (name) | `name="displayName"` | `profile-name-input` | P0 |
280
+ | 24 | `<input type="email">` (email) | `name="email"` | `profile-email-input` | P0 |
281
+ | 30 | `<button type="submit">` | `className="save-btn"` | `profile-save-btn` | P1 |
282
+ | 36 | `<button>` (change password) | none | `profile-change-password-btn` | P1 |
283
+ | 42 | `<img>` (avatar) | `className="avatar"` | `profile-avatar-img` | P2 |
284
+
285
+ ### Naming Convention Compliance
286
+
287
+ **Existing values audited:** 8
288
+
289
+ | Existing Value | Compliant | Issue | Suggested Rename |
290
+ |----------------|-----------|-------|-----------------|
291
+ | `cart-link` | YES | -- | -- |
292
+ | `cartCount` | NO | camelCase instead of kebab-case; missing element-type suffix | `navbar-cart-count-badge` |
293
+ | `email` | NO | Too generic; missing context prefix and element-type suffix | `checkout-email-input` |
294
+ | `submitBtn` | NO | camelCase instead of kebab-case; missing context prefix | `checkout-submit-btn` |
295
+ | `add-cart` | YES | -- | -- |
296
+ | `product_name` | NO | snake_case instead of kebab-case; missing element-type suffix | `product-name-text` |
297
+ | `productImg` | NO | camelCase instead of kebab-case; missing context in description | `product-image-img` |
298
+ | `cart-count-badge` | YES | -- | -- |
299
+
300
+ **Summary:** 3 of 8 existing `data-testid` values are compliant with the `{context}-{description}-{element-type}` naming convention. 5 values are non-compliant and should be renamed during the injection pass.
301
+
302
+ ### Decision Gate
303
+
304
+ ```
305
+ DECISION: FULL PASS
306
+ REASON: Current coverage 19% (8/42), well below the 50% threshold
307
+ ACTION: Inject all P0, P1, P2 elements across 6 component files
308
+ FILES: 6 files to process
309
+ ELEMENTS: 34 elements to inject
310
+ ```
311
+
312
+ Additionally, 5 existing `data-testid` values should be renamed for naming convention compliance (coordinate with test files that reference old values).
313
+
314
+ ---
315
+
316
+ ## Guidelines
317
+
318
+ **DO:**
319
+ - Follow `{context}-{description}-{element-type}` pattern strictly for all proposed values
320
+ - Mark elements with existing `data-testid` as `EXISTING -- no change` -- never modify working test IDs without explicit approval
321
+ - Prioritize form inputs (`<input>`, `<select>`, `<textarea>`) and submit buttons as P0
322
+ - Derive context from the component filename: `LoginPage.tsx` becomes `login`, `CheckoutForm.tsx` becomes `checkout`
323
+ - Use the element-type suffix table from the naming convention (see SKILL.md)
324
+ - Include the line number for every element to enable precise injection
325
+ - Check for duplicate `data-testid` values within the same page scope before proposing
326
+
327
+ **DON'T:**
328
+ - Propose duplicate `data-testid` values within the same page or route scope
329
+ - Add `data-testid` to purely non-interactive elements (static `<div>`, `<span>`) unless they display dynamic data the tests need to read
330
+ - Use framework-specific prefixes: no `cy-`, `pw-`, `qa-` -- just the bare value
331
+ - Modify elements that already have a working `data-testid` -- flag for rename review only
332
+ - Skip the naming convention compliance check -- even "EXISTING" values should be audited
333
+ - Propose vague generic values like `input-1`, `button-2` -- always include semantic context and description
334
+
335
+ ---
336
+
337
+ ## Quality Gate
338
+
339
+ Before delivering this artifact, verify:
340
+
341
+ - [ ] Every interactive element across all scanned files has an entry in the File Details section
342
+ - [ ] All proposed `data-testid` values follow the `{context}-{description}-{element-type}` convention
343
+ - [ ] No duplicate `data-testid` values exist within the same page/route scope
344
+ - [ ] Coverage Score formula is shown explicitly with the correct calculation
345
+ - [ ] Decision Gate recommendation matches the coverage score thresholds
346
+ - [ ] All existing `data-testid` values are audited in the Naming Convention Compliance section
347
+ - [ ] Priority assignments are consistent: form inputs and submit buttons are P0, navigation and feedback are P1, decorative elements are P2
348
+ - [ ] Line numbers are included for every element in every File Details table
349
+
350
+ ---
351
+
352
+ *Template version: 1.0*
353
+ *Producer: qa-testid-injector*
354
+ *Last updated: {date}*
@@ -0,0 +1,243 @@
1
+ ---
2
+ template_name: validation-report
3
+ version: "1.0"
4
+ artifact_type: validation
5
+ produces: VALIDATION_REPORT.md
6
+ producer_agent: qa-validator
7
+ consumer_agents:
8
+ - qa-bug-detective
9
+ - human-reviewer
10
+ required_sections:
11
+ - summary
12
+ - file-details
13
+ - unresolved-issues
14
+ - fix-loop-log
15
+ - confidence-level
16
+ example_domain: shopflow
17
+ ---
18
+
19
+ # VALIDATION_REPORT.md Template
20
+
21
+ **Purpose:** Documents the results of 4-layer validation (Syntax, Structure, Dependencies, Logic) applied to generated test code. Tracks what was found, what was auto-fixed, what remains unresolved, and the overall confidence that the test suite is ready for delivery.
22
+
23
+ **Producer:** qa-validator (runs after test code generation, before delivery)
24
+ **Consumers:** qa-bug-detective (uses validation results to focus failure investigation), human-reviewer (reviews overall quality and unresolved issues)
25
+
26
+ ---
27
+
28
+ ## Required Sections
29
+
30
+ ### Section 1: Summary
31
+
32
+ **Description:** High-level overview of validation results across all 4 layers, aggregated across all validated files.
33
+
34
+ **Fields:**
35
+
36
+ | Field | Type | Required | Description |
37
+ |-------|------|----------|-------------|
38
+ | Layer | enum | YES | Syntax, Structure, Dependencies, or Logic |
39
+ | Status | enum | YES | PASS or FAIL (final status after fix loops) |
40
+ | Issues Found | integer | YES | Total issues discovered in this layer |
41
+ | Issues Fixed | integer | YES | Issues auto-fixed during fix loops |
42
+
43
+ Additional summary fields:
44
+ - Total files validated
45
+ - Total issues found (across all layers)
46
+ - Total issues fixed
47
+ - Fix loops used (1, 2, or 3)
48
+ - Overall status (PASS / PASS WITH WARNINGS / FAIL)
49
+
50
+ ---
51
+
52
+ ### Section 2: File Details
53
+
54
+ **Description:** Per-file breakdown showing every validation layer's result. Each validated file gets its own subsection with a table showing all 4 layers.
55
+
56
+ **Fields per file:**
57
+
58
+ | Field | Type | Required | Description |
59
+ |-------|------|----------|-------------|
60
+ | Filename | path | YES | Full relative path to the validated file |
61
+ | Layer | enum | YES | Syntax, Structure, Dependencies, or Logic |
62
+ | Status | enum | YES | PASS or FAIL |
63
+ | Details | text | YES | What passed, what failed, specific error messages. Never just "PASS" or "FAIL" without context. |
64
+
65
+ **Rule:** Report EVERY layer for EVERY file, even if all layers pass. A file with all PASS still shows 4 rows in its table.
66
+
67
+ ---
68
+
69
+ ### Section 3: Unresolved Issues
70
+
71
+ **Description:** Issues that could NOT be auto-fixed after the maximum 3 fix loops. Each unresolved issue gets detailed documentation to help human reviewers understand what went wrong and what to do about it.
72
+
73
+ **Fields per unresolved issue:**
74
+
75
+ | Field | Type | Required | Description |
76
+ |-------|------|----------|-------------|
77
+ | File | path | YES | Path to the affected file |
78
+ | Layer | enum | YES | Which validation layer detected the issue |
79
+ | Issue Description | text | YES | What the issue is, in specific terms |
80
+ | Attempted Fix | text | YES | What auto-fix was tried (or "No fix attempted" if issue type is not auto-fixable) |
81
+ | Why It Failed | text | YES | Why the auto-fix did not resolve the issue |
82
+ | Suggested Resolution | text | YES | What a human should do to resolve this |
83
+
84
+ If there are no unresolved issues, this section states: **"None -- all issues resolved within fix loops."**
85
+
86
+ ---
87
+
88
+ ### Section 4: Fix Loop Log
89
+
90
+ **Description:** Chronological record of each fix loop iteration showing progressive issue resolution. Essential for debugging validation failures and understanding the auto-fix progression.
91
+
92
+ **Fields per loop:**
93
+
94
+ | Field | Type | Required | Description |
95
+ |-------|------|----------|-------------|
96
+ | Loop Number | integer | YES | 1, 2, or 3 |
97
+ | Issues Found | integer | YES | How many issues were detected in this loop |
98
+ | Issues Description | text | YES | What specific issues were found |
99
+ | Fixes Applied | text | YES | What fixes were applied |
100
+ | Verification Result | text | YES | Did the fixes resolve the issues? What remains? |
101
+
102
+ ---
103
+
104
+ ### Section 5: Confidence Level
105
+
106
+ **Description:** Overall confidence assessment that the validated test code is ready for delivery. Based on quantitative criteria, not subjective judgment.
107
+
108
+ **Confidence Criteria Table:**
109
+
110
+ | Level | All Layers PASS | Unresolved Issues | Fix Loops Used | Description |
111
+ |-------|----------------|-------------------|----------------|-------------|
112
+ | HIGH | Yes | 0 | 0-1 | All validations pass with minimal or no fixes needed. Code is ready for delivery. |
113
+ | MEDIUM | Yes (after fixes) | 0-2 minor | 2-3 | All layers eventually pass, but required multiple fix rounds. Minor issues may exist. |
114
+ | LOW | No (any FAIL) | Any critical | 3 (max) | At least one layer still fails, or critical issues remain unresolved. Human review required before delivery. |
115
+
116
+ **Confidence statement format:** `[LEVEL]: [one-sentence reasoning referencing specific metrics from the summary]`
117
+
118
+ ---
119
+
120
+ ## Worked Example (ShopFlow E-Commerce API)
121
+
122
+ Below is a complete, filled VALIDATION_REPORT.md for ShopFlow test code validation.
123
+
124
+ ---
125
+
126
+ # Validation Report
127
+
128
+ **Generated:** 2026-03-18T14:30:00Z
129
+ **Validator:** qa-validator v1.0
130
+ **Target:** shopflow-qa-tests (4 files)
131
+
132
+ ## Summary
133
+
134
+ | Layer | Status | Issues Found | Issues Fixed |
135
+ |-------|--------|-------------|-------------|
136
+ | Syntax | PASS | 0 | 0 |
137
+ | Structure | PASS | 1 | 1 |
138
+ | Dependencies | PASS | 0 | 0 |
139
+ | Logic | PASS | 2 | 2 |
140
+
141
+ - **Total files validated:** 4
142
+ - **Total issues found:** 3
143
+ - **Total issues fixed:** 3
144
+ - **Fix loops used:** 2
145
+ - **Overall status:** PASS
146
+
147
+ ## File Details
148
+
149
+ ### tests/unit/priceCalculator.unit.spec.ts
150
+
151
+ | Layer | Status | Details |
152
+ |-------|--------|---------|
153
+ | Syntax | PASS | TypeScript compilation clean (`tsc --noEmit` exit 0). No ESLint errors. |
154
+ | Structure | PASS | Correct directory placement (`tests/unit/`). Naming follows convention (`*.unit.spec.ts`). Contains 4 test functions in 2 describe blocks. No hardcoded credentials. |
155
+ | Dependencies | PASS | All imports resolve: `priceCalculator` found at `src/utils/priceCalculator.ts`. No external packages needed beyond `@playwright/test`. |
156
+ | Logic | PASS | All 4 tests have concrete assertions (`toBe(89.97)`, `toBe(215.52)`). Happy path tests use `toBe`/`toEqual`. No vague assertions (no `toBeTruthy()` or `toBeDefined()`). Each test has at least one assertion. |
157
+
158
+ ### tests/api/orders.api.spec.ts
159
+
160
+ | Layer | Status | Details |
161
+ |-------|--------|---------|
162
+ | Syntax | PASS | TypeScript compilation clean. No ESLint errors. |
163
+ | Structure | PASS | **Fixed in Loop 1.** Originally placed in `tests/e2e/` directory. Moved to `tests/api/` per naming convention (file is `*.api.spec.ts`, must be in `tests/api/`). After fix: correct placement, naming compliant. |
164
+ | Dependencies | PASS | All imports resolve. `auth-data` fixture found at `fixtures/auth-data.ts`. API client uses `request` from `@playwright/test`. |
165
+ | Logic | PASS | **Fixed in Loop 1.** Original test at line 34 had vague assertion: `expect(response.status).toBeTruthy()`. Fixed to: `expect(response.status).toBe(201)`. All 6 tests now have concrete assertions with specific values. |
166
+
167
+ ### pages/auth/LoginPage.ts
168
+
169
+ | Layer | Status | Details |
170
+ |-------|--------|---------|
171
+ | Syntax | PASS | TypeScript compilation clean. No ESLint errors. |
172
+ | Structure | PASS | Correct directory placement (`pages/auth/`). Naming follows convention (`*Page.ts`). Extends BasePage. No assertions in page object (verified: 0 `expect()` calls). |
173
+ | Dependencies | PASS | All imports resolve. `BasePage` found at `pages/base/BasePage.ts`. Playwright `Page` and `Locator` types imported correctly. |
174
+ | Logic | PASS | All locators use Tier 1 selectors (`getByTestId`, `getByRole`). Actions return `void` or navigation promises. State query methods (`getErrorMessage()`, `isSubmitEnabled()`) return data without asserting. |
175
+
176
+ ### tests/e2e/smoke/checkout.e2e.spec.ts
177
+
178
+ | Layer | Status | Details |
179
+ |-------|--------|---------|
180
+ | Syntax | PASS | TypeScript compilation clean. No ESLint errors. |
181
+ | Structure | PASS | Correct directory placement (`tests/e2e/smoke/`). Naming follows convention (`*.e2e.spec.ts`). Contains 3 test functions. No hardcoded credentials (uses `process.env` for test user). |
182
+ | Dependencies | PASS | All imports resolve. Page objects (`CartPage`, `CheckoutPage`, `LoginPage`) found at expected paths. Fixtures import resolves. |
183
+ | Logic | PASS | **Fixed in Loop 2.** Missing `await` on `page.click('[data-testid="checkout-submit-btn"]')` at line 45. Added `await` keyword. After fix: all async operations properly awaited. All assertions concrete (`toHaveText('Order confirmed')`, `toBeVisible()`). |
184
+
185
+ ## Unresolved Issues
186
+
187
+ None -- all issues resolved within 2 fix loops.
188
+
189
+ ## Fix Loop Log
190
+
191
+ ### Loop 1
192
+
193
+ - **Issues found:** 2
194
+ 1. `tests/api/orders.api.spec.ts` placed in wrong directory (`tests/e2e/` instead of `tests/api/`)
195
+ 2. `tests/api/orders.api.spec.ts:34` has vague assertion: `expect(response.status).toBeTruthy()`
196
+ - **Fixes applied:**
197
+ 1. Moved file from `tests/e2e/orders.api.spec.ts` to `tests/api/orders.api.spec.ts`
198
+ 2. Changed assertion to `expect(response.status).toBe(201)` (verified against API spec: POST /orders returns 201)
199
+ - **Verification result:** Both fixes verified. Structure layer now PASS. Logic layer still has 1 remaining issue found in re-validation.
200
+
201
+ ### Loop 2
202
+
203
+ - **Issues found:** 1
204
+ 1. `tests/e2e/smoke/checkout.e2e.spec.ts:45` missing `await` on `page.click()` call
205
+ - **Fixes applied:**
206
+ 1. Added `await` keyword: `await page.click('[data-testid="checkout-submit-btn"]')`
207
+ - **Verification result:** Fix verified. All 4 layers PASS across all 4 files. No remaining issues.
208
+
209
+ ## Confidence Level
210
+
211
+ **HIGH:** All 4 validation layers pass across all 4 files. 3 issues were found and all 3 were auto-fixed within 2 fix loops. No unresolved issues. No guesses were made in fixes -- each fix was verified against project standards (directory convention, API spec, async requirements).
212
+
213
+ ---
214
+
215
+ ## Guidelines
216
+
217
+ **DO:**
218
+ - Report EVERY layer for EVERY file, even if all layers pass -- omitting passing layers makes it impossible to confirm they were actually checked
219
+ - Include the specific error message or code snippet in file details, not just "FAIL" -- reviewers need to understand what failed
220
+ - Show the before/after in fix loop entries -- what was the original issue and what was the fix
221
+ - Run verification AFTER each fix loop to confirm fixes work -- do not assume a fix resolves the issue
222
+ - Include timestamps and validator version in the report header for traceability
223
+
224
+ **DON'T:**
225
+ - Mark confidence HIGH if any fix was a guess or unverified -- confidence requires verified fixes
226
+ - Skip the fix loop log even if all layers pass on first check -- report "Loop 1: 0 issues found" to prove validation ran
227
+ - Combine multiple files into a single file details entry -- each file gets its own subsection
228
+ - Report Logic as PASS when assertions use `toBeTruthy()`, `toBeDefined()`, or `.should('exist')` without a concrete value -- these are vague assertions per CLAUDE.md standards
229
+ - Auto-fix more than 3 loops -- after 3 loops, document unresolved issues and deliver with LOW confidence
230
+
231
+ ---
232
+
233
+ ## Quality Gate
234
+
235
+ Before delivering a VALIDATION_REPORT.md, verify:
236
+
237
+ - [ ] All 5 required sections are present (Summary, File Details, Unresolved Issues, Fix Loop Log, Confidence Level)
238
+ - [ ] Summary table shows all 4 layers (Syntax, Structure, Dependencies, Logic) with counts
239
+ - [ ] Every validated file has its own File Details subsection with all 4 layers reported
240
+ - [ ] Unresolved Issues section is present (either with issues or "None" statement)
241
+ - [ ] Fix Loop Log documents every loop iteration with issues found, fixes applied, and verification result
242
+ - [ ] Confidence Level includes the criteria table and a specific confidence statement with reasoning
243
+ - [ ] No file details entry says just "PASS" or "FAIL" without explanatory details