synapse-hub 0.0.0-stage → 2.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 (122) hide show
  1. package/.agents/agents/failure-analyst.md +47 -0
  2. package/.agents/agents/live-explorer.md +41 -0
  3. package/.agents/agents/orchestrator.md +43 -0
  4. package/.agents/agents/pom-crafter.md +81 -0
  5. package/.agents/agents/quality-gatekeeper.md +47 -0
  6. package/.agents/agents/test-runner.md +43 -0
  7. package/.agents/rules/context-engineering.md +88 -0
  8. package/.agents/rules/git-push-protocol.md +101 -0
  9. package/.agents/rules/graphify.md +14 -0
  10. package/.agents/rules/lessons-learned.md +23 -0
  11. package/.agents/rules/mandatory-playwright-live.md +29 -0
  12. package/.agents/rules/skill-precedence.md +42 -0
  13. package/.agents/rules/systematic-debugging.md +99 -0
  14. package/.agents/skills/agent-orchestration-multi-agent-optimize/SKILL.md +239 -0
  15. package/.agents/skills/antigravity-test-sentinel/SKILL.md +64 -0
  16. package/.agents/skills/api-network-mocking-interception/SKILL.md +142 -0
  17. package/.agents/skills/api-spec-to-e2e-matrix/SKILL.md +70 -0
  18. package/.agents/skills/architecture-decision-records/SKILL.md +441 -0
  19. package/.agents/skills/auth-session-and-cookie-manager/SKILL.md +72 -0
  20. package/.agents/skills/backend-load-and-stress-patterns/SKILL.md +214 -0
  21. package/.agents/skills/bats-testing-patterns/SKILL.md +100 -0
  22. package/.agents/skills/bats-testing-patterns/resources/implementation-playbook.md +614 -0
  23. package/.agents/skills/clean-pom-crafter/SKILL.md +75 -0
  24. package/.agents/skills/clean-pom-crafter/examples/standard_test_case.groovy +28 -0
  25. package/.agents/skills/clean-pom-crafter/references/pom_patterns.groovy +138 -0
  26. package/.agents/skills/code-refactoring-refactor-clean/SKILL.md +64 -0
  27. package/.agents/skills/code-refactoring-refactor-clean/resources/implementation-playbook.md +879 -0
  28. package/.agents/skills/db-state-verifier-and-seeder/SKILL.md +123 -0
  29. package/.agents/skills/e2e-testing-patterns/SKILL.md +103 -0
  30. package/.agents/skills/e2e-testing-patterns/resources/implementation-playbook.md +522 -0
  31. package/.agents/skills/failure-autopsy-and-healing/SKILL.md +54 -0
  32. package/.agents/skills/failure-autopsy-and-healing/references/healing_matrix.md +64 -0
  33. package/.agents/skills/failure-autopsy-and-healing/references/qa_investigation_protocol.md +56 -0
  34. package/.agents/skills/failure-autopsy-and-healing/scripts/triage_failures.sh +98 -0
  35. package/.agents/skills/file-and-report-validator/SKILL.md +90 -0
  36. package/.agents/skills/flaky-test-sentinel-and-quarantine/SKILL.md +114 -0
  37. package/.agents/skills/github-actions-templates/SKILL.md +334 -0
  38. package/.agents/skills/graphify-impact-analyzer/SKILL.md +78 -0
  39. package/.agents/skills/katalon-cli-runner/SKILL.md +76 -0
  40. package/.agents/skills/katalon-cli-runner/references/groovy-patterns.md +209 -0
  41. package/.agents/skills/katalon-cli-runner/references/katalon-api.md +155 -0
  42. package/.agents/skills/katalon-cli-runner/references/runner_commands.md +67 -0
  43. package/.agents/skills/lam-script-generator/SKILL.md +83 -0
  44. package/.agents/skills/playwright-live-interaction/SKILL.md +86 -0
  45. package/.agents/skills/playwright-live-interaction/references/advanced_superpowers.md +160 -0
  46. package/.agents/skills/playwright-live-interaction/references/compact_accessibility_snapshots.md +75 -0
  47. package/.agents/skills/playwright-live-interaction/references/recipes.md +388 -0
  48. package/.agents/skills/playwright-live-interaction/references/swarm_orchestration.md +134 -0
  49. package/.agents/skills/security-dast-sentinel/SKILL.md +176 -0
  50. package/.agents/skills/self-healing-locator/SKILL.md +73 -0
  51. package/.agents/skills/synthetic-test-data-generator/SKILL.md +135 -0
  52. package/.agents/skills/token-and-context-optimizer/SKILL.md +70 -0
  53. package/.agents/skills/visual-regression-sentinel/SKILL.md +62 -0
  54. package/.agents/skills/wcag-audit-patterns/SKILL.md +77 -0
  55. package/.agents/skills/wcag-audit-patterns/resources/implementation-playbook.md +541 -0
  56. package/.agents/skills/web-vitals-and-performance-profiler/SKILL.md +65 -0
  57. package/.agents/templates/completion_report.md +57 -0
  58. package/.agents/workflows/graphify.md +10 -0
  59. package/.agents/workflows/test-impact.md +15 -0
  60. package/.agents/workflows/verify.md +34 -0
  61. package/AGENTS.md +115 -0
  62. package/README.md +394 -2
  63. package/bin/agent-qa.js +90 -0
  64. package/package.json +59 -4
  65. package/skills_manifest.json +262 -0
  66. package/templates/PROJECT_AI_GUIDE_TEMPLATE.md +97 -0
  67. package/templates/PROJECT_STATE_TEMPLATE.md +20 -0
  68. package/tools/TOOLS_RUNBOOK.md +298 -0
  69. package/tools/agent_canary.py +501 -0
  70. package/tools/analyze_project.py +242 -0
  71. package/tools/api_drift_sentinel.py +208 -0
  72. package/tools/auto_heal.py +189 -0
  73. package/tools/browser_helpers.js +593 -0
  74. package/tools/bug_reporter.py +224 -0
  75. package/tools/cache_resolver.py +846 -0
  76. package/tools/check_env.py +288 -0
  77. package/tools/ci_healing_hook.py +128 -0
  78. package/tools/cli.py +402 -0
  79. package/tools/config_decoupler.py +253 -0
  80. package/tools/db_sandbox.py +341 -0
  81. package/tools/distill_log.py +152 -0
  82. package/tools/e2e_flow_prober.ps1 +65 -0
  83. package/tools/flaky_detector.py +222 -0
  84. package/tools/fuzz_payloads.py +197 -0
  85. package/tools/generate_allure_report.ps1 +30 -0
  86. package/tools/generate_api_matrix.py +193 -0
  87. package/tools/generate_tc_from_story.py +182 -0
  88. package/tools/generate_test_reports.ps1 +135 -0
  89. package/tools/git_pre_commit_guard.py +203 -0
  90. package/tools/heal_pr_automator.py +195 -0
  91. package/tools/heuristic_locator_matcher.py +202 -0
  92. package/tools/infer_linter.py +238 -0
  93. package/tools/lint_ai_docs.py +254 -0
  94. package/tools/lookup_tc.py +165 -0
  95. package/tools/lookup_xpath.py +167 -0
  96. package/tools/matrix_sharder.py +146 -0
  97. package/tools/mcp_excel_server.ps1 +251 -0
  98. package/tools/mcp_server.py +490 -0
  99. package/tools/micro_mutator.py +309 -0
  100. package/tools/network_mock_shield.py +170 -0
  101. package/tools/omni_emitter.py +500 -0
  102. package/tools/omni_parser.py +435 -0
  103. package/tools/omni_transpiler.py +168 -0
  104. package/tools/pinpoint_failure.py +88 -0
  105. package/tools/project_state.py +169 -0
  106. package/tools/repo_map.json +12 -0
  107. package/tools/repo_map.py +277 -0
  108. package/tools/repo_map.txt +7 -0
  109. package/tools/safety_firewall.py +245 -0
  110. package/tools/setup_project.py +265 -0
  111. package/tools/smart_visual_masker.py +134 -0
  112. package/tools/test_impact.py +321 -0
  113. package/tools/tms_sync_bridge.py +342 -0
  114. package/tools/trace_data_flow.py +240 -0
  115. package/tools/traffic_session_converter.py +256 -0
  116. package/tools/universal_ir.py +480 -0
  117. package/tools/validate_groovy_scripts.py +173 -0
  118. package/tools/verify_all.py +496 -0
  119. package/tools/verify_all.sh +4 -0
  120. package/tools/visual_diff_canvas.py +142 -0
  121. package/tools/visual_som_helper.py +418 -0
  122. package/tools/wcag_audit.py +214 -0
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: db-state-verifier-and-seeder
3
+ description: Verify database records, seed isolated test fixtures, and assert database mutations across SQL (PostgreSQL, MySQL, Oracle) and NoSQL (MongoDB, Redis). Use on-demand when testing backend state mutations or DB consistency.
4
+ ---
5
+
6
+ # Database State Verifier & Seeder Skill
7
+
8
+ > **Target:** Eliminate shallow UI-only validations by asserting exact backend database mutations (PostgreSQL, MySQL, Oracle, MongoDB, Redis) and providing isolated, idempotent fixture seeding.
9
+
10
+ ---
11
+
12
+ ## 1. Core Principles
13
+
14
+ 1. **Dual-Layer Assertion (UI + DB):**
15
+ - Asserting a green UI toast is insufficient for transactional operations. Test suites must query the persistence layer to ensure records are properly inserted with correct foreign keys and audit fields (`created_at`, `created_by`).
16
+ 2. **Transaction Isolation & Fast Rollback:**
17
+ - Whenever possible, seed data inside transactional boundaries or maintain automated deletion queues tied to entity unique codes.
18
+ 3. **Zero Plaintext Connection Credentials:**
19
+ - All connection strings must be sourced strictly from environment variables (`DB_HOST`, `DB_USER`, `DB_PASS`).
20
+
21
+ ---
22
+
23
+ ## 2. Standard SQL Query & State Assertion Patterns
24
+
25
+ ### Pattern A: PostgreSQL / MySQL Record Persistence Assertion
26
+ ```python
27
+ import os
28
+ import psycopg2
29
+
30
+ def assert_record_created(unique_code: str, expected_status: str = "ACTIVE"):
31
+ conn = psycopg2.connect(
32
+ host=os.getenv("DB_HOST", "localhost"),
33
+ database=os.getenv("DB_NAME", "qa_db"),
34
+ user=os.getenv("DB_USER", "postgres"),
35
+ password=os.getenv("DB_PASS", "")
36
+ )
37
+ cursor = conn.cursor()
38
+ cursor.execute("SELECT id, status, is_deleted FROM business_entities WHERE code = %s", (unique_code,))
39
+ row = cursor.fetchone()
40
+
41
+ assert row is not None, f"Database assertion failed: Record with code {unique_code} not found!"
42
+ assert row[1] == expected_status, f"Expected status {expected_status}, but found {row[1]}"
43
+ assert row[2] is False, "Record flagged as deleted prematurely"
44
+
45
+ conn.close()
46
+ print(f"[PASS] Verified database persistence for code: {unique_code}")
47
+ ```
48
+
49
+ ### Pattern B: Idempotent SQL Teardown Cleanup
50
+ ```python
51
+ def teardown_test_entity(unique_code: str):
52
+ conn = psycopg2.connect(...)
53
+ cursor = conn.cursor()
54
+ cursor.execute("DELETE FROM business_entities WHERE code = %s", (unique_code,))
55
+ conn.commit()
56
+ conn.close()
57
+ ```
58
+
59
+ ---
60
+
61
+ ## 3. Standard NoSQL Patterns (MongoDB & Redis)
62
+
63
+ ### Pattern C: MongoDB Document Mutation & JSON Schema Assertion
64
+ ```python
65
+ import os
66
+ from pymongo import MongoClient
67
+
68
+ def assert_mongo_document_persisted(order_id: str, expected_item_count: int):
69
+ client = MongoClient(os.getenv("MONGO_URI", "mongodb://localhost:27017"))
70
+ db = client[os.getenv("MONGO_DB", "orders_db")]
71
+ collection = db["customer_orders"]
72
+
73
+ doc = collection.find_one({"orderId": order_id})
74
+ assert doc is not None, f"MongoDB error: Order {order_id} not found!"
75
+ assert len(doc.get("items", [])) == expected_item_count, f"Item count mismatch in doc: {doc}"
76
+ assert doc.get("paymentStatus") == "CONFIRMED", "Payment status is not CONFIRMED"
77
+
78
+ # Cleanup teardown
79
+ collection.delete_one({"orderId": order_id})
80
+ client.close()
81
+ print(f"[PASS] Verified and cleaned MongoDB document: {order_id}")
82
+ ```
83
+
84
+ ### Pattern D: Redis Cache Expiry & Invalidation Verification
85
+ ```python
86
+ import os
87
+ import redis
88
+
89
+ def assert_cache_invalidated(cache_key: str):
90
+ r = redis.Redis.from_url(os.getenv("REDIS_URL", "redis://localhost:6379/0"))
91
+ val = r.get(cache_key)
92
+ assert val is None, f"Cache leak error: Key '{cache_key}' should have been invalidated after mutation!"
93
+ print(f"[PASS] Verified Redis cache eviction for key: {cache_key}")
94
+ ```
95
+
96
+ ---
97
+
98
+ ## 4. Zero-Pollution DB Sandbox & Ephemeral Teardown (`tools/db_sandbox.py`)
99
+
100
+ To eliminate cascading flakiness and orphan test junk in parallel CI runs, agents utilize deterministic DB Sandbox operations:
101
+
102
+ ### 1. Transaction Savepoint Rollback Context
103
+ Wrap E2E test data creation inside transactional savepoints:
104
+ ```bash
105
+ python tools/db_sandbox.py rollback-test --db-path "path/to/db.sqlite"
106
+ ```
107
+ *Guarantees zero leftover records: state is automatically rolled back to pristine baseline upon test completion.*
108
+
109
+ ### 2. Ephemeral Snapshot & Instant Restore (< 0.5s)
110
+ ```bash
111
+ # Before test suite runs: capture pristine database baseline
112
+ python tools/db_sandbox.py snapshot --id pristine_baseline
113
+
114
+ # After suite execution: instantly restore clean database
115
+ python tools/db_sandbox.py restore --id pristine_baseline
116
+ ```
117
+
118
+ ### 3. Taint Pollution Audit & Cascading Purge
119
+ Scan all tables for orphan records carrying test prefixes (`AUTO_`, `TEST_`) and purge them cleanly:
120
+ ```bash
121
+ python tools/db_sandbox.py audit
122
+ ```
123
+
@@ -0,0 +1,103 @@
1
+ ---
2
+ name: e2e-testing-patterns
3
+ description: Master architectural and organizational patterns for multi-browser E2E testing (Playwright, Cypress) focusing on test suite structure, parallel sharding, and retry governance.
4
+ ---
5
+
6
+ # E2E Testing Architectural Patterns
7
+
8
+ Engineering standard for structuring, scaling, and maintaining large-scale End-to-End (E2E) test automation suites across modern web frameworks (React, Angular, Vue, Next.js).
9
+
10
+ ---
11
+
12
+ ## 1. Test Pyramid & E2E Scope Boundary
13
+
14
+ ```mermaid
15
+ flowchart TD
16
+ E2E["<b>E2E Tests (10%)</b><br/>Critical User Journeys, Multi-Page Flows, Payment, SSO"]
17
+ Integ["<b>Integration Tests (30%)</b><br/>Component contracts, API Routes, DB persistence"]
18
+ Unit["<b>Unit Tests (60%)</b><br/>Pure functions, business logic, validation rules"]
19
+
20
+ Unit --> Integ --> E2E
21
+ ```
22
+
23
+ - **What belongs in E2E:** High-risk customer journeys (Sign-up, Onboarding, Checkout, File Export, Role transitions).
24
+ - **What to avoid in E2E:** Exhaustive boundary value checks of simple form fields (delegate to Unit/API tests).
25
+
26
+ ---
27
+
28
+ ## 2. Core Operational Patterns
29
+
30
+ ### Pattern A: Clean Page Object Model (POM) with Typed Interfaces
31
+ ```typescript
32
+ // pages/base.page.ts
33
+ import { Page, Locator, expect } from '@playwright/test';
34
+
35
+ export abstract class BasePage {
36
+ constructor(protected readonly page: Page) {}
37
+
38
+ async waitForNetworkIdle(): Promise<void> {
39
+ await this.page.waitForLoadState('networkidle');
40
+ }
41
+
42
+ async clickSafe(locator: Locator): Promise<void> {
43
+ await locator.waitFor({ state: 'visible' });
44
+ await locator.click();
45
+ }
46
+ }
47
+ ```
48
+
49
+ ```typescript
50
+ // pages/checkout.page.ts
51
+ import { Locator, expect } from '@playwright/test';
52
+ import { BasePage } from './base.page';
53
+
54
+ export class CheckoutPage extends BasePage {
55
+ readonly submitBtn: Locator = this.page.getByRole('button', { name: /Complete Purchase/i });
56
+ readonly confirmationToast: Locator = this.page.getByTestId('checkout-toast');
57
+
58
+ async completeOrder(): Promise<void> {
59
+ await this.clickSafe(this.submitBtn);
60
+ await expect(this.confirmationToast).toBeVisible({ timeout: 5000 });
61
+ }
62
+ }
63
+ ```
64
+
65
+ ### Pattern B: Isolated Storage State Fixture (Zero Login Repetition)
66
+ ```typescript
67
+ // fixtures/auth.fixture.ts
68
+ import { test as base, Page } from '@playwright/test';
69
+
70
+ export const test = base.extend<{ authedPage: Page }>({
71
+ authedPage: async ({ browser }, use) => {
72
+ const context = await browser.newContext({ storageState: '.auth/user.json' });
73
+ const page = await context.newPage();
74
+ await use(page);
75
+ await context.close();
76
+ },
77
+ });
78
+ ```
79
+
80
+ ### Pattern C: Resilient Synchronization (No Static Delays)
81
+ ```typescript
82
+ // ANTI-PATTERN:
83
+ // await page.waitForTimeout(5000); // Flaky and slow!
84
+
85
+ // CORRECT PATTERN:
86
+ // 1. Wait for specific API response
87
+ const responsePromise = page.waitForResponse(resp => resp.url().includes('/api/orders') && resp.status() === 201);
88
+ await page.getByRole('button', { name: 'Save' }).click();
89
+ await responsePromise;
90
+
91
+ // 2. Assert final visual DOM state
92
+ await expect(page.getByText('Order Created')).toBeVisible();
93
+ ```
94
+
95
+ ---
96
+
97
+ ## 3. Parallel Sharding & CI/CD Governance
98
+ ```bash
99
+ # Run test suite sharded across 4 parallel CI workers
100
+ npx playwright test --shard=1/4 --reporter=html,junit:results.xml
101
+ ```
102
+ - **Retries:** Maximum 1 retry on CI, 0 retries locally. Never rely on retries to mask structural flakiness.
103
+ - **Trace on Failure:** Always configure `trace: 'retain-on-failure'` and `screenshot: 'only-on-failure'`.