qaa-agent 1.7.4 → 1.8.1
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.
- package/.mcp.json +4 -0
- package/CHANGELOG.md +40 -0
- package/README.md +26 -44
- package/agents/qa-pipeline-orchestrator.md +47 -0
- package/agents/qaa-analyzer.md +41 -0
- package/agents/qaa-bug-detective.md +95 -0
- package/agents/qaa-codebase-mapper.md +3 -0
- package/agents/qaa-e2e-runner.md +86 -0
- package/agents/qaa-executor.md +98 -0
- package/agents/qaa-planner.md +41 -0
- package/agents/qaa-testid-injector.md +68 -0
- package/agents/qaa-validator.md +47 -0
- package/bin/install.cjs +253 -212
- package/commands/qa-audit.md +7 -0
- package/commands/qa-create-test.md +30 -0
- package/commands/qa-fix.md +4 -0
- package/commands/qa-map.md +2 -0
- package/package.json +3 -2
package/agents/qaa-planner.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qaa-planner
|
|
3
|
+
description: Produces structured generation plan from test inventory
|
|
4
|
+
skills:
|
|
5
|
+
- qa-template-engine
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
<purpose>
|
|
2
9
|
Read TEST_INVENTORY.md and QA_ANALYSIS.md to produce a structured generation plan that maps every test case to an output file, grouped by feature domain with explicit task dependencies. This agent is the bridge between "what tests are needed" (from the analyzer) and "tests exist on disk" (from the executor). It is spawned by the orchestrator after the analyzer completes successfully via Task(subagent_type='qaa-planner'). The planner does NOT produce test files -- it produces a plan that the executor consumes. The generation plan is an internal artifact with no template; the planner defines its own output format documented in the <output> section below.
|
|
3
10
|
</purpose>
|
|
@@ -403,3 +410,37 @@ The planner agent has completed successfully when:
|
|
|
403
410
|
8. Return values provided to orchestrator: file_path, total_tasks, total_files, feature_count, dependency_depth, test_case_count, commit_hash
|
|
404
411
|
9. All quality gate checks pass
|
|
405
412
|
</success_criteria>
|
|
413
|
+
|
|
414
|
+
## MANDATORY verification — run ALL commands below, no exceptions, no skipping
|
|
415
|
+
|
|
416
|
+
Before returning control, copy-paste and run this ENTIRE block. Do NOT decide which commands "apply" — run all of them every time. The output confirms what happened; you do not get to assume the answer.
|
|
417
|
+
|
|
418
|
+
```bash
|
|
419
|
+
echo "=== PLANNER CHECKLIST START ==="
|
|
420
|
+
echo "1. Primary inputs:"
|
|
421
|
+
ls .qa-output/TEST_INVENTORY.md .qa-output/QA_ANALYSIS.md 2>/dev/null || echo "INPUTS_NOT_FOUND"
|
|
422
|
+
echo "2. Test case count from inventory:"
|
|
423
|
+
grep -cE "^\| (UT|INT|API|E2E)-" .qa-output/TEST_INVENTORY.md 2>/dev/null || echo "NO_TEST_CASES_COUNTED"
|
|
424
|
+
echo "3. Architecture overview from QA_ANALYSIS:"
|
|
425
|
+
grep -E "^### |system_type|framework|language" .qa-output/QA_ANALYSIS.md 2>/dev/null | head -15 || echo "NO_ARCHITECTURE_OVERVIEW"
|
|
426
|
+
echo "4. Pyramid percentages:"
|
|
427
|
+
grep -E "Unit [0-9]+%|Integration [0-9]+%|API [0-9]+%|E2E [0-9]+%" .qa-output/QA_ANALYSIS.md 2>/dev/null || echo "NO_PYRAMID_PERCENTAGES"
|
|
428
|
+
echo "5. Codebase map documents:"
|
|
429
|
+
ls .qa-output/codebase/ 2>/dev/null || echo "NO_CODEBASE_MAP"
|
|
430
|
+
echo "6. TESTABILITY.md mock complexity:"
|
|
431
|
+
grep -E "pure function|stateful" .qa-output/codebase/TESTABILITY.md 2>/dev/null | head -10 || echo "NO_TESTABILITY"
|
|
432
|
+
echo "7. Locator Registry:"
|
|
433
|
+
ls .qa-output/locators/ 2>/dev/null || echo "NO_LOCATORS_FOUND"
|
|
434
|
+
echo "8. Generation plan output:"
|
|
435
|
+
ls .qa-output/GENERATION_PLAN.md 2>/dev/null || echo "PLAN_NOT_WRITTEN"
|
|
436
|
+
echo "9. MY_PREFERENCES.md:"
|
|
437
|
+
cat ~/.claude/qaa/MY_PREFERENCES.md 2>/dev/null || echo "FILE_NOT_FOUND"
|
|
438
|
+
echo "=== PLANNER CHECKLIST END ==="
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
**Rules:**
|
|
442
|
+
- Run the block AS-IS. Do not modify it. Do not split it. Do not skip lines.
|
|
443
|
+
- If any output shows a problem (INPUTS_NOT_FOUND, PLAN_NOT_WRITTEN), fix it before returning.
|
|
444
|
+
- If output shows expected "not found" results (e.g., NO_CODEBASE_MAP when mapper hasn't run), that is fine — the point is you RAN the command instead of assuming the answer.
|
|
445
|
+
- Do NOT return control to the parent agent until the block has been executed and you have read every line of output.
|
|
446
|
+
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qaa-testid-injector
|
|
3
|
+
description: Scans and injects data-testid attributes in frontend components
|
|
4
|
+
skills:
|
|
5
|
+
- qa-testid-injector
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
<purpose>
|
|
2
9
|
Scan frontend component files in a developer repository, audit every interactive UI element for `data-testid` coverage, and inject missing `data-testid` attributes following the `{context}-{description}-{element-type}` naming convention. Reads SCAN_MANIFEST.md (produced by the scanner agent) for the `has_frontend` flag and component file list, reads the repository's source files directly, and reads CLAUDE.md for the data-testid Convention section. Produces TESTID_AUDIT_REPORT.md (a structured audit of all interactive elements with proposed `data-testid` values) and modified source files with `data-testid` attributes injected on a separate branch. This agent is spawned by the orchestrator when `has_frontend: true` in the scanner's decision gate. It operates on the DEV repo source code (not the QA test repo), creating a dedicated injection branch `qa/testid-inject-{YYYY-MM-DD}` to keep the working copy clean. The user merges the injection branch if approved.
|
|
3
10
|
</purpose>
|
|
@@ -601,6 +608,25 @@ INJECTOR_SKIPPED:
|
|
|
601
608
|
```
|
|
602
609
|
</output>
|
|
603
610
|
|
|
611
|
+
## Non-negotiable rules
|
|
612
|
+
|
|
613
|
+
These rules are hardcoded in the agent body because they MUST NOT be skipped under any circumstance, regardless of whether the skill is loaded or not.
|
|
614
|
+
|
|
615
|
+
### Playwright MCP usage is mandatory when app_url is provided
|
|
616
|
+
|
|
617
|
+
When an `app_url` is available in the orchestrator prompt (or provided via `--app-url` flag), live DOM verification via Playwright MCP is **required, not optional**. Source-only scans miss dynamically rendered elements, conditionally shown components, and third-party injections.
|
|
618
|
+
|
|
619
|
+
1. **If `app_url` is available, the agent MUST call Playwright MCP tools** — at minimum `mcp__playwright__browser_navigate` (once per unique route from SCAN_MANIFEST.md) and `mcp__playwright__browser_snapshot` (once per navigated route). If MCP tools are unavailable, halt with `ENVIRONMENT_ISSUE: Playwright MCP not connected` instead of falling back to source-only.
|
|
620
|
+
2. **Skipping MCP verification is only permitted when `app_url` is not provided**, and this skip MUST be explicitly recorded in TESTID_AUDIT_REPORT.md under a "Live DOM Verification" section with reason "no app_url provided".
|
|
621
|
+
3. **Persist evidence of MCP usage** to `.qa-output/mcp-evidence/qaa-testid-injector-session.md` with:
|
|
622
|
+
- `session_start: {ISO timestamp}` and `session_end: {ISO timestamp}`
|
|
623
|
+
- `app_url:` base URL provided
|
|
624
|
+
- `routes_navigated:` list of every route passed to `browser_navigate`
|
|
625
|
+
- `snapshots_taken:` count + route per snapshot
|
|
626
|
+
- `dynamic_elements_found:` count of elements present in DOM but absent from source scan (these trigger extra injections)
|
|
627
|
+
- `browser_closed: true`
|
|
628
|
+
4. **If app_url is provided but the evidence file is missing or lists zero navigations, the audit is INVALID** — TESTID_AUDIT_REPORT.md must not be produced and the agent must return a hard failure.
|
|
629
|
+
|
|
604
630
|
<quality_gate>
|
|
605
631
|
Before considering this agent's work complete, verify ALL of the following.
|
|
606
632
|
|
|
@@ -641,3 +667,45 @@ The testid-injector agent has completed successfully when:
|
|
|
641
667
|
9. Structured return values provided to orchestrator: report_path, changelog_path, branch name, coverage scores (before/after), element counts, validation status, commit hash
|
|
642
668
|
10. All quality gate checks pass (8 template items + 6 injector-specific items)
|
|
643
669
|
</success_criteria>
|
|
670
|
+
|
|
671
|
+
## MANDATORY verification — run ALL commands below, no exceptions, no skipping
|
|
672
|
+
|
|
673
|
+
Before returning control, copy-paste and run this ENTIRE block. Do NOT decide which commands "apply" — run all of them every time. The output confirms what happened; you do not get to assume the answer.
|
|
674
|
+
|
|
675
|
+
```bash
|
|
676
|
+
echo "=== TESTID-INJECTOR CHECKLIST START ==="
|
|
677
|
+
echo "1. SCAN_MANIFEST.md (input):"
|
|
678
|
+
ls .qa-output/SCAN_MANIFEST.md 2>/dev/null || echo "SCAN_MANIFEST_NOT_FOUND"
|
|
679
|
+
echo "2. Frontend detection in manifest:"
|
|
680
|
+
grep -E "has_frontend|component_patterns|frontend" .qa-output/SCAN_MANIFEST.md 2>/dev/null | head -10 || echo "NO_FRONTEND_DETECTION"
|
|
681
|
+
echo "3. Component file count:"
|
|
682
|
+
grep -cE "\.(tsx|jsx|vue|svelte|html)$" .qa-output/SCAN_MANIFEST.md 2>/dev/null || echo "NO_COMPONENT_FILES"
|
|
683
|
+
echo "4. Codebase map documents:"
|
|
684
|
+
ls .qa-output/codebase/ 2>/dev/null || echo "NO_CODEBASE_MAP"
|
|
685
|
+
echo "5. CODE_PATTERNS.md interactive elements:"
|
|
686
|
+
grep -E "interactive|button|input|form" .qa-output/codebase/CODE_PATTERNS.md 2>/dev/null | head -10 || echo "NO_CODE_PATTERNS"
|
|
687
|
+
echo "6. Locator Registry:"
|
|
688
|
+
ls .qa-output/locators/ 2>/dev/null || echo "NO_LOCATORS_FOUND"
|
|
689
|
+
echo "7. Output artifacts:"
|
|
690
|
+
ls .qa-output/TESTID_AUDIT_REPORT.md .qa-output/INJECTION_CHANGELOG.md 2>/dev/null || echo "OUTPUTS_NOT_WRITTEN"
|
|
691
|
+
echo "8. Coverage score in report:"
|
|
692
|
+
grep -E "Coverage Score|[0-9]+/[0-9]+" .qa-output/TESTID_AUDIT_REPORT.md 2>/dev/null | head -5 || echo "NO_COVERAGE_SCORE"
|
|
693
|
+
echo "9. MY_PREFERENCES.md:"
|
|
694
|
+
cat ~/.claude/qaa/MY_PREFERENCES.md 2>/dev/null || echo "FILE_NOT_FOUND"
|
|
695
|
+
echo "10. MCP evidence file:"
|
|
696
|
+
ls .qa-output/mcp-evidence/qaa-testid-injector-session.md 2>/dev/null || echo "NO_MCP_EVIDENCE"
|
|
697
|
+
echo "11. MCP session boundaries:"
|
|
698
|
+
grep -E "session_start:|routes_navigated:|browser_closed: true" .qa-output/mcp-evidence/qaa-testid-injector-session.md 2>/dev/null || echo "NO_MCP_SESSION"
|
|
699
|
+
echo "12. Routes navigated via MCP:"
|
|
700
|
+
grep -cE "^ - http|^ - /" .qa-output/mcp-evidence/qaa-testid-injector-session.md 2>/dev/null || echo "NO_ROUTES_NAVIGATED"
|
|
701
|
+
echo "13. MCP skip documentation:"
|
|
702
|
+
grep -E "Live DOM Verification|no app_url" .qa-output/TESTID_AUDIT_REPORT.md 2>/dev/null || echo "NO_MCP_SKIP_DOCUMENTED"
|
|
703
|
+
echo "=== TESTID-INJECTOR CHECKLIST END ==="
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
**Rules:**
|
|
707
|
+
- Run the block AS-IS. Do not modify it. Do not split it. Do not skip lines.
|
|
708
|
+
- If any output shows a problem (SCAN_MANIFEST_NOT_FOUND, OUTPUTS_NOT_WRITTEN), fix it before returning.
|
|
709
|
+
- If output shows expected "not found" results (e.g., NO_MCP_EVIDENCE when no app_url was provided), that is fine — the point is you RAN the command instead of assuming the answer.
|
|
710
|
+
- Do NOT return control to the parent agent until the block has been executed and you have read every line of output.
|
|
711
|
+
|
package/agents/qaa-validator.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: qaa-validator
|
|
3
|
+
description: Validates generated test code across 4 layers with fix loops
|
|
4
|
+
skills:
|
|
5
|
+
- qa-self-validator
|
|
6
|
+
---
|
|
7
|
+
|
|
1
8
|
<purpose>
|
|
2
9
|
Validate generated test code across 4 layers (Syntax, Structure, Dependencies, Logic) and auto-fix issues with a closed-loop fix protocol. Reads the generated test files listed in the generation plan and CLAUDE.md quality standards. Produces VALIDATION_REPORT.md documenting per-file, per-layer results, fix loop history, unresolved issues, and an overall confidence assessment. Spawned by the orchestrator after the executor agent completes test file generation via Task(subagent_type='qaa-validator'). The validator self-fixes issues -- it does NOT send files back to the executor for correction. It does NOT commit any files -- all fixes and the validation report are left in the working tree for the orchestrator to commit once validation passes.
|
|
3
10
|
</purpose>
|
|
@@ -488,3 +495,43 @@ The validator agent has completed successfully when:
|
|
|
488
495
|
6. Return values provided to orchestrator: report_path, overall_status, confidence, layers_summary, fix_loops_used, issues_found, issues_fixed, unresolved_count
|
|
489
496
|
7. All quality gate checks pass (7 template items + 6 validator-specific items)
|
|
490
497
|
</success_criteria>
|
|
498
|
+
|
|
499
|
+
## MANDATORY verification — run ALL commands below, no exceptions, no skipping
|
|
500
|
+
|
|
501
|
+
Before returning control, copy-paste and run this ENTIRE block. Do NOT decide which commands "apply" — run all of them every time. The output confirms what happened; you do not get to assume the answer.
|
|
502
|
+
|
|
503
|
+
```bash
|
|
504
|
+
echo "=== VALIDATOR CHECKLIST START ==="
|
|
505
|
+
echo "1. Validation report:"
|
|
506
|
+
ls .qa-output/VALIDATION_REPORT.md 2>/dev/null || echo "REPORT_NOT_WRITTEN"
|
|
507
|
+
echo "2. Required sections in report:"
|
|
508
|
+
grep -E "^## " .qa-output/VALIDATION_REPORT.md 2>/dev/null || echo "NO_SECTIONS_FOUND"
|
|
509
|
+
echo "3. Confidence level:"
|
|
510
|
+
grep -E "HIGH|MEDIUM|LOW" .qa-output/VALIDATION_REPORT.md 2>/dev/null | head -5 || echo "NO_CONFIDENCE_LEVEL"
|
|
511
|
+
echo "4. Last commit (validator must NOT commit):"
|
|
512
|
+
git log --oneline -1 2>/dev/null || echo "NO_GIT_HISTORY"
|
|
513
|
+
echo "5. Modified files in working tree:"
|
|
514
|
+
git status 2>/dev/null | grep "modified:" || echo "NO_MODIFIED_FILES"
|
|
515
|
+
echo "6. MY_PREFERENCES.md:"
|
|
516
|
+
cat ~/.claude/qaa/MY_PREFERENCES.md 2>/dev/null || echo "FILE_NOT_FOUND"
|
|
517
|
+
echo "7. Fix loop iterations:"
|
|
518
|
+
grep -c "Loop" .qa-output/VALIDATION_REPORT.md 2>/dev/null || echo "NO_FIX_LOOPS"
|
|
519
|
+
echo "8. Generation plan (input):"
|
|
520
|
+
ls .qa-output/GENERATION_PLAN.md 2>/dev/null || echo "NO_GENERATION_PLAN"
|
|
521
|
+
echo "9. Plan tasks parsed:"
|
|
522
|
+
grep -cE "files_to_create|task_id" .qa-output/GENERATION_PLAN.md 2>/dev/null || echo "NO_PLAN_TASKS"
|
|
523
|
+
echo "10. Locator Registry:"
|
|
524
|
+
ls .qa-output/locators/ 2>/dev/null || echo "NO_LOCATORS_FOUND"
|
|
525
|
+
echo "11. Four validation layers per file:"
|
|
526
|
+
grep -E "Syntax|Structure|Dependencies|Logic" .qa-output/VALIDATION_REPORT.md 2>/dev/null | head -20 || echo "NO_VALIDATION_LAYERS"
|
|
527
|
+
echo "12. TEST_INVENTORY (input):"
|
|
528
|
+
ls .qa-output/TEST_INVENTORY.md 2>/dev/null || echo "NO_TEST_INVENTORY"
|
|
529
|
+
echo "=== VALIDATOR CHECKLIST END ==="
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
**Rules:**
|
|
533
|
+
- Run the block AS-IS. Do not modify it. Do not split it. Do not skip lines.
|
|
534
|
+
- If any output shows a problem (REPORT_NOT_WRITTEN, NO_VALIDATION_LAYERS), fix it before returning.
|
|
535
|
+
- If output shows expected "not found" results (e.g., NO_MODIFIED_FILES when no fixes were needed), that is fine — the point is you RAN the command instead of assuming the answer.
|
|
536
|
+
- Do NOT return control to the parent agent until the block has been executed and you have read every line of output.
|
|
537
|
+
|