@teevee98/synapse-hub 4.2.0 β 4.2.2
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/.agents/skills/01-web-automation/auth-session-and-cookie-manager/SKILL.md +46 -2
- package/.agents/skills/01-web-automation/bats-testing-patterns/SKILL.md +49 -4
- package/.agents/skills/01-web-automation/clean-pom-crafter/SKILL.md +56 -66
- package/.agents/skills/01-web-automation/e2e-testing-patterns/SKILL.md +48 -3
- package/.agents/skills/01-web-automation/katalon-cli-runner/SKILL.md +56 -11
- package/.agents/skills/01-web-automation/lam-script-generator/SKILL.md +49 -7
- package/.agents/skills/01-web-automation/mobile-appium-som/SKILL.md +54 -11
- package/.agents/skills/01-web-automation/playwright-live-interaction/SKILL.md +48 -90
- package/.agents/skills/01-web-automation/playwright-webapp-testing/SKILL.md +53 -10
- package/.agents/skills/01-web-automation/web-agent-gym-benchmarking/SKILL.md +44 -3
- package/.agents/skills/02-test-design/architecture-decision-records/SKILL.md +49 -8
- package/.agents/skills/02-test-design/gherkin-to-suite/SKILL.md +49 -8
- package/.agents/skills/02-test-design/rbt-manual-testing/SKILL.md +49 -7
- package/.agents/skills/02-test-design/review-spec/SKILL.md +46 -5
- package/.agents/skills/02-test-design/tot-exploratory-testing/SKILL.md +44 -3
- package/.agents/skills/03-api-and-contracts/api-network-mocking-interception/SKILL.md +50 -4
- package/.agents/skills/03-api-and-contracts/api-spec-to-e2e-matrix/SKILL.md +47 -6
- package/.agents/skills/03-api-and-contracts/consumer-driven-contract-testing/SKILL.md +79 -34
- package/.agents/skills/04-performance-and-load/backend-load-and-stress-patterns/SKILL.md +47 -4
- package/.agents/skills/04-performance-and-load/lean-impact-scoreboard/SKILL.md +46 -5
- package/.agents/skills/04-performance-and-load/web-vitals-and-performance-profiler/SKILL.md +44 -2
- package/.agents/skills/05-security-and-compliance/security-dast-sentinel/SKILL.md +57 -13
- package/.agents/skills/05-security-and-compliance/skillspector-security-guard/SKILL.md +45 -4
- package/.agents/skills/05-security-and-compliance/wcag-audit-patterns/SKILL.md +48 -3
- package/.agents/skills/06-healing-and-resilience/agentless-qa-repair/SKILL.md +45 -4
- package/.agents/skills/06-healing-and-resilience/antigravity-test-sentinel/SKILL.md +47 -5
- package/.agents/skills/06-healing-and-resilience/failure-autopsy-and-healing/SKILL.md +48 -7
- package/.agents/skills/06-healing-and-resilience/flaky-test-sentinel-and-quarantine/SKILL.md +54 -23
- package/.agents/skills/06-healing-and-resilience/self-healing-locator/SKILL.md +46 -5
- package/.agents/skills/06-healing-and-resilience/systematic-debugging/SKILL.md +50 -9
- package/.agents/skills/06-healing-and-resilience/test-driven-development/SKILL.md +52 -11
- package/.agents/skills/06-healing-and-resilience/verification-before-completion/SKILL.md +52 -11
- package/.agents/skills/06-healing-and-resilience/visual-regression-sentinel/SKILL.md +47 -4
- package/.agents/skills/07-data-and-state/db-state-verifier-and-seeder/SKILL.md +50 -4
- package/.agents/skills/07-data-and-state/file-and-report-validator/SKILL.md +47 -3
- package/.agents/skills/07-data-and-state/synthetic-test-data-generator/SKILL.md +52 -4
- package/.agents/skills/08-code-quality/code-refactoring-refactor-clean/SKILL.md +51 -10
- package/.agents/skills/08-code-quality/graphify-impact-analyzer/SKILL.md +78 -34
- package/.agents/skills/08-code-quality/graphify-impact-analyzer/examples/dependency_blast_radius.json +3 -4
- package/.agents/skills/08-code-quality/lean-code-ladder/SKILL.md +49 -9
- package/.agents/skills/08-code-quality/repo-quality-audit/SKILL.md +45 -5
- package/.agents/skills/08-code-quality/senior-code-review/SKILL.md +48 -6
- package/.agents/skills/08-code-quality/surgical-coding-principles/SKILL.md +49 -9
- package/.agents/skills/08-code-quality/technical-debt-harvester/SKILL.md +47 -4
- package/.agents/skills/09-ci-and-devops/github-actions-templates/SKILL.md +48 -16
- package/.agents/skills/09-ci-and-devops/github-actions-templates/examples/matrix_test_pipeline.yml +2 -1
- package/.agents/skills/10-agent-orchestration/actor-qa-swarm/SKILL.md +44 -3
- package/.agents/skills/10-agent-orchestration/agent-orchestration-multi-agent-optimize/SKILL.md +47 -6
- package/.agents/skills/10-agent-orchestration/event-stream-qa-orchestrator/SKILL.md +44 -3
- package/.agents/skills/10-agent-orchestration/persistent-planning-files/SKILL.md +52 -12
- package/.agents/skills/10-agent-orchestration/qa-memory-os/SKILL.md +45 -4
- package/.agents/skills/11-ai-and-prompting/meta-prompt-crafter/SKILL.md +51 -9
- package/.agents/skills/11-ai-and-prompting/mipro-prompt-compiler/SKILL.md +44 -3
- package/.agents/skills/11-ai-and-prompting/qa-aci-interface/SKILL.md +44 -3
- package/.agents/skills/11-ai-and-prompting/token-and-context-optimizer/SKILL.md +49 -8
- package/.cursor/rules/synapse-qa.mdc +20 -7
- package/.cursorrules +19 -5
- package/.windsurfrules +18 -3
- package/AGENTS.md +51 -65
- package/CLAUDE.md +38 -24
- package/README.en.md +2 -2
- package/README.md +2 -2
- package/agentskills.json +1 -1
- package/docs/ARCHITECTURE.en.md +1 -1
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/CLIENT_SUPPORT_MATRIX.md +44 -0
- package/docs/SIDE_EFFECTING_TOOLS_INVENTORY.md +233 -0
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/skills_manifest.json +1 -1
- package/synapse.config.json +1 -1
- package/templates/ai_bridges/CLAUDE.md +29 -26
- package/templates/ai_bridges/copilot-instructions.md +14 -5
- package/templates/ai_bridges/cursor_synapse_qa.mdc +16 -7
- package/templates/ai_bridges/windsurfrules +14 -3
- package/tools/TOOLS_RUNBOOK.md +1 -1
- package/tools/__init__.py +1 -1
- package/tools/api_fuzzer.py +295 -41
- package/tools/benchmark_swarm_context.py +11 -4
- package/tools/browser_helpers.js +2 -2
- package/tools/bump_version.py +2 -2
- package/tools/cli.py +4 -4
- package/tools/core/bm25_retriever.py +1 -1
- package/tools/core/i18n.py +1 -1
- package/tools/core/provider_usage_adapter.py +66 -0
- package/tools/core/token_estimator.py +39 -1
- package/tools/count_tokens.py +2 -2
- package/tools/dashboard_generator.py +8 -8
- package/tools/db_sandbox.py +182 -43
- package/tools/distill_log.py +1 -1
- package/tools/distill_skill.py +17 -2
- package/tools/git_pre_commit_guard.py +190 -1
- package/tools/hub_publisher.py +2 -12
- package/tools/mcp_docx_server.py +1 -1
- package/tools/mcp_excel_server.py +1 -1
- package/tools/mcp_server.py +33 -5
- package/tools/micro_mutator.py +30 -1
- package/tools/pentest_scope_guard.py +288 -15
- package/tools/project_state.py +29 -5
- package/tools/reversible_sandbox.py +58 -13
- package/tools/rules_router.py +80 -27
- package/tools/skill_canonical_digest.py +60 -2
- package/tools/sync_agent_rules.py +187 -61
- package/tools/task_memory_manager.py +16 -1
- package/tools/ui_server.py +3 -1
- package/tools/update_sentinel.py +3 -3
- package/tools/validate_skills_schema.py +349 -56
- package/tools/verify_all.py +98 -4
- package/tools/welcome_page.py +1 -1
|
@@ -10,11 +10,35 @@ policies:
|
|
|
10
10
|
---
|
|
11
11
|
# Visual Regression Sentinel Skill
|
|
12
12
|
|
|
13
|
+
> **Author Attribution & MIT License Guard:** Synapse Hub is open-source software created by **ThαΊΏ Vα» (@TeeVee98)** (<https://github.com/TeeVee98/Synapse-Hub>) under the MIT License.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 1. Trigger & Activation
|
|
18
|
+
|
|
19
|
+
- **Trigger Clause:** Run pixel and layout shift visual regression checks with anti-flake masking. Use when comparing screenshots for visual regressions with anti-flake masking.
|
|
20
|
+
- **Activation Scope:** Domain workflows for `06-healing-and-resilience` involving `visual-regression-sentinel`.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 2. Non-Goals & Boundary Constraints
|
|
25
|
+
|
|
26
|
+
- **What NOT to do:**
|
|
27
|
+
- Do NOT capture visual baselines with dynamic animated content unpaused or dynamic timestamps visible.
|
|
28
|
+
- Do NOT use arbitrary pixel threshold tolerances without masking expected variable regions.
|
|
29
|
+
- Do NOT overwrite visual golden baselines without explicit human review and approval.
|
|
30
|
+
- **Sibling Skill Boundaries:**
|
|
31
|
+
- wcag-audit-patterns tests accessibility; visual-regression-sentinel detects unexpected pixel drift and visual layout regressions.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 3. Ordered Execution Workflow
|
|
36
|
+
|
|
13
37
|
> **Target:** Catch unintended UI rendering defects, CSS breakages, alignment shifts, and missing visual assets across viewports without manual visual inspection.
|
|
14
38
|
|
|
15
39
|
---
|
|
16
40
|
|
|
17
|
-
|
|
41
|
+
### Core Principles
|
|
18
42
|
|
|
19
43
|
1. **Anti-Flakiness Masking:**
|
|
20
44
|
- Always mask dynamic elements (timers, timestamps, random avatars, ads, blinking carets) before capturing baselines.
|
|
@@ -25,9 +49,10 @@ policies:
|
|
|
25
49
|
|
|
26
50
|
---
|
|
27
51
|
|
|
28
|
-
|
|
52
|
+
### Standard Playwright Visual Assertion Patterns
|
|
29
53
|
|
|
30
54
|
### Pattern A: Full-Page Screenshot with Dynamic Masking
|
|
55
|
+
<!-- classification: illustrative -->
|
|
31
56
|
```typescript
|
|
32
57
|
await expect(page).toHaveScreenshot('landing-page.png', {
|
|
33
58
|
fullPage: true,
|
|
@@ -42,6 +67,7 @@ await expect(page).toHaveScreenshot('landing-page.png', {
|
|
|
42
67
|
```
|
|
43
68
|
|
|
44
69
|
### Pattern B: Component-Level Snapshot
|
|
70
|
+
<!-- classification: illustrative -->
|
|
45
71
|
```typescript
|
|
46
72
|
// Isolate critical component to avoid cascade failures from header/footer changes
|
|
47
73
|
const dataTable = page.locator('.custom-data-table');
|
|
@@ -51,6 +77,7 @@ await expect(dataTable).toHaveScreenshot('table-component-default.png', {
|
|
|
51
77
|
```
|
|
52
78
|
|
|
53
79
|
### Pattern C: Color Mode / Responsive Variations
|
|
80
|
+
<!-- classification: illustrative -->
|
|
54
81
|
```typescript
|
|
55
82
|
// Test Dark Mode
|
|
56
83
|
await page.emulateMedia({ colorScheme: 'dark' });
|
|
@@ -59,7 +86,7 @@ await expect(page).toHaveScreenshot('dashboard-dark.png');
|
|
|
59
86
|
|
|
60
87
|
---
|
|
61
88
|
|
|
62
|
-
|
|
89
|
+
### Visual Failure Autopsy Protocol
|
|
63
90
|
When visual regression fails:
|
|
64
91
|
1. Review generated diff image: `*-diff.png`.
|
|
65
92
|
2. Determine if it is a **Real Regression** (CSS bug, broken layout) or **Intentional Redesign**.
|
|
@@ -68,7 +95,7 @@ When visual regression fails:
|
|
|
68
95
|
|
|
69
96
|
---
|
|
70
97
|
|
|
71
|
-
|
|
98
|
+
### Assert on Extracted Data, Not on the Model's Claim
|
|
72
99
|
|
|
73
100
|
> *Borrowed and adapted from the Midscene.js prompting model (MIT license, web-infra-dev/midscene).*
|
|
74
101
|
|
|
@@ -85,3 +112,19 @@ When an AI/vision agent reports a step as "done", that claim is **not evidence**
|
|
|
85
112
|
what is rendered.
|
|
86
113
|
4. **Only then run the visual diff** β feed the Β§3 autopsy protocol; a green
|
|
87
114
|
extraction plus a clean diff is proven, everything else is owed.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 4. Verification Points & DoD
|
|
119
|
+
|
|
120
|
+
1. Dynamic elements (spinners, timestamps, animations) masked before screenshot capture.
|
|
121
|
+
2. Visual diff score stays within acceptable tolerance thresholds ($\le 0.1\%$).
|
|
122
|
+
3. Visual failure autopsy highlights exact pixel drift bounding box.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## 5. Handoff Protocol
|
|
127
|
+
|
|
128
|
+
- **Deliverables:** Visual snapshot baselines, diff highlight images, and visual regression autopsy report.
|
|
129
|
+
- **Next Subagent:** quality-gatekeeper
|
|
130
|
+
- **Output Format:** Clean POM code, structured JSON telemetry, or validated markdown handoff.
|
|
@@ -10,11 +10,35 @@ policies:
|
|
|
10
10
|
---
|
|
11
11
|
# Database State Verifier & Seeder Skill
|
|
12
12
|
|
|
13
|
+
> **Author Attribution & MIT License Guard:** Synapse Hub is open-source software created by **ThαΊΏ Vα» (@TeeVee98)** (<https://github.com/TeeVee98/Synapse-Hub>) under the MIT License.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 1. Trigger & Activation
|
|
18
|
+
|
|
19
|
+
- **Trigger Clause:** Seed isolated test fixtures and assert database mutations across SQL and NoSQL. Use when seeding, verifying, or cleaning database state around tests.
|
|
20
|
+
- **Activation Scope:** Domain workflows for `07-data-and-state` involving `db-state-verifier-and-seeder`.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 2. Non-Goals & Boundary Constraints
|
|
25
|
+
|
|
26
|
+
- **What NOT to do:**
|
|
27
|
+
- Do NOT execute destructive DB mutations (DROP, PURGE, TRUNCATE) without explicit granular consent grants.
|
|
28
|
+
- Do NOT use static hardcoded primary keys that cause database unique constraint collisions.
|
|
29
|
+
- Do NOT leave residual test data in databases; pair seeding with automated teardown cleanup.
|
|
30
|
+
- **Sibling Skill Boundaries:**
|
|
31
|
+
- synthetic-test-data-generator generates data payloads; db-state-verifier-and-seeder seeds and validates database state across SQL/NoSQL stores.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 3. Ordered Execution Workflow
|
|
36
|
+
|
|
13
37
|
> **Target:** Eliminate shallow UI-only validations by asserting exact backend database mutations (PostgreSQL, MySQL, Oracle, MongoDB, Redis) and providing isolated, idempotent fixture seeding.
|
|
14
38
|
|
|
15
39
|
---
|
|
16
40
|
|
|
17
|
-
|
|
41
|
+
### Core Principles
|
|
18
42
|
|
|
19
43
|
1. **Dual-Layer Assertion (UI + DB):**
|
|
20
44
|
- 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`).
|
|
@@ -25,9 +49,10 @@ policies:
|
|
|
25
49
|
|
|
26
50
|
---
|
|
27
51
|
|
|
28
|
-
|
|
52
|
+
### Standard SQL Query & State Assertion Patterns
|
|
29
53
|
|
|
30
54
|
### Pattern A: PostgreSQL / MySQL Record Persistence Assertion
|
|
55
|
+
<!-- classification: illustrative -->
|
|
31
56
|
```python
|
|
32
57
|
import os
|
|
33
58
|
import psycopg2
|
|
@@ -52,6 +77,7 @@ def assert_record_created(unique_code: str, expected_status: str = "ACTIVE"):
|
|
|
52
77
|
```
|
|
53
78
|
|
|
54
79
|
### Pattern B: Idempotent SQL Teardown Cleanup
|
|
80
|
+
<!-- classification: illustrative -->
|
|
55
81
|
```python
|
|
56
82
|
def teardown_test_entity(unique_code: str):
|
|
57
83
|
conn = psycopg2.connect(...)
|
|
@@ -63,9 +89,10 @@ def teardown_test_entity(unique_code: str):
|
|
|
63
89
|
|
|
64
90
|
---
|
|
65
91
|
|
|
66
|
-
|
|
92
|
+
### Standard NoSQL Patterns (MongoDB & Redis)
|
|
67
93
|
|
|
68
94
|
### Pattern C: MongoDB Document Mutation & JSON Schema Assertion
|
|
95
|
+
<!-- classification: illustrative -->
|
|
69
96
|
```python
|
|
70
97
|
import os
|
|
71
98
|
from pymongo import MongoClient
|
|
@@ -87,6 +114,7 @@ def assert_mongo_document_persisted(order_id: str, expected_item_count: int):
|
|
|
87
114
|
```
|
|
88
115
|
|
|
89
116
|
### Pattern D: Redis Cache Expiry & Invalidation Verification
|
|
117
|
+
<!-- classification: illustrative -->
|
|
90
118
|
```python
|
|
91
119
|
import os
|
|
92
120
|
import redis
|
|
@@ -100,12 +128,13 @@ def assert_cache_invalidated(cache_key: str):
|
|
|
100
128
|
|
|
101
129
|
---
|
|
102
130
|
|
|
103
|
-
|
|
131
|
+
### Zero-Pollution DB Sandbox & Ephemeral Teardown (`tools/db_sandbox.py`)
|
|
104
132
|
|
|
105
133
|
To eliminate cascading flakiness and orphan test junk in parallel CI runs, agents utilize deterministic DB Sandbox operations:
|
|
106
134
|
|
|
107
135
|
### 1. Transaction Savepoint Rollback Context
|
|
108
136
|
Wrap E2E test data creation inside transactional savepoints:
|
|
137
|
+
<!-- classification: illustrative -->
|
|
109
138
|
```bash
|
|
110
139
|
python tools/db_sandbox.py rollback-test --db-path "path/to/db.sqlite"
|
|
111
140
|
```
|
|
@@ -113,6 +142,7 @@ python tools/db_sandbox.py rollback-test --db-path "path/to/db.sqlite"
|
|
|
113
142
|
|
|
114
143
|
### 2. Ephemeral Snapshot & Instant Restore (< 0.5s) [DESTRUCTIVE]
|
|
115
144
|
> β οΈ **Warning [DESTRUCTIVE]:** Database restore drops existing tables/objects and repopulates from snapshot (e.g. `pg_restore --clean --if-exists`). Zero-pollution guarantee is conditional upon isolated sandbox containers and valid snapshots; never execute against staging or production databases. Requires explicit `--confirm` (or setting `SYNAPSE_FORCE_RESTORE=1`).
|
|
145
|
+
<!-- classification: illustrative -->
|
|
116
146
|
```bash
|
|
117
147
|
# Before test suite runs: capture pristine database baseline
|
|
118
148
|
python tools/db_sandbox.py snapshot --id pristine_baseline
|
|
@@ -123,6 +153,7 @@ python tools/db_sandbox.py restore --id pristine_baseline --confirm
|
|
|
123
153
|
|
|
124
154
|
### 3. Taint Pollution Audit & Cascading Purge
|
|
125
155
|
Scan all tables for orphan records carrying test prefixes (`AUTO_`, `TEST_`). By default, `audit` runs in **safe dry-run preview** mode:
|
|
156
|
+
<!-- classification: illustrative -->
|
|
126
157
|
```bash
|
|
127
158
|
# Preview orphan records without deleting (safe default):
|
|
128
159
|
python tools/db_sandbox.py audit
|
|
@@ -131,3 +162,18 @@ python tools/db_sandbox.py audit
|
|
|
131
162
|
python tools/db_sandbox.py audit --apply
|
|
132
163
|
```
|
|
133
164
|
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## 4. Verification Points & DoD
|
|
168
|
+
|
|
169
|
+
1. Database seed data uses dynamic unique identifiers to eliminate collisions.
|
|
170
|
+
2. State assertions verify record existence, column values, and relational integrity.
|
|
171
|
+
3. Teardown routines remove test-generated records cleanly upon completion.
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## 5. Handoff Protocol
|
|
176
|
+
|
|
177
|
+
- **Deliverables:** Database seeding scripts, state assertion queries, and teardown cleanup hooks.
|
|
178
|
+
- **Next Subagent:** api-engineer / test-runner
|
|
179
|
+
- **Output Format:** Clean POM code, structured JSON telemetry, or validated markdown handoff.
|
|
@@ -10,11 +10,35 @@ policies:
|
|
|
10
10
|
---
|
|
11
11
|
# File & Report Validator Skill
|
|
12
12
|
|
|
13
|
+
> **Author Attribution & MIT License Guard:** Synapse Hub is open-source software created by **ThαΊΏ Vα» (@TeeVee98)** (<https://github.com/TeeVee98/Synapse-Hub>) under the MIT License.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 1. Trigger & Activation
|
|
18
|
+
|
|
19
|
+
- **Trigger Clause:** Validate downloaded and uploaded files (Excel, CSV, PDF) schemas and tabular integrity. Use when validating exported files or reports against a schema.
|
|
20
|
+
- **Activation Scope:** Domain workflows for `07-data-and-state` involving `file-and-report-validator`.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 2. Non-Goals & Boundary Constraints
|
|
25
|
+
|
|
26
|
+
- **What NOT to do:**
|
|
27
|
+
- Do NOT assert only file download existence; validate internal content structure and data integrity.
|
|
28
|
+
- Do NOT store downloaded test files in uncontrolled directories; use isolated temporary sandboxes.
|
|
29
|
+
- Do NOT parse large PDF/Excel files without proper error handling and resource cleanup.
|
|
30
|
+
- **Sibling Skill Boundaries:**
|
|
31
|
+
- db-state-verifier validates databases; file-and-report-validator validates downloaded report files (PDF, XLSX, CSV, JSON).
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 3. Ordered Execution Workflow
|
|
36
|
+
|
|
13
37
|
> **Target:** Eliminate superficial testing of file exports and imports by inspecting and asserting exact file contents, schemas, formulas, and values across Excel, CSV, and PDF formats.
|
|
14
38
|
|
|
15
39
|
---
|
|
16
40
|
|
|
17
|
-
|
|
41
|
+
### Core Principles
|
|
18
42
|
|
|
19
43
|
1. **Verify Binary Contents, Not Just Download Events:**
|
|
20
44
|
- Catching the browser `download` event is insufficient. The downloaded file must be opened, parsed, and its tabular records cross-referenced against expected database or UI table states.
|
|
@@ -25,8 +49,9 @@ policies:
|
|
|
25
49
|
|
|
26
50
|
---
|
|
27
51
|
|
|
28
|
-
|
|
52
|
+
### Standard Playwright Download Handling
|
|
29
53
|
|
|
54
|
+
<!-- classification: illustrative -->
|
|
30
55
|
```typescript
|
|
31
56
|
import { test, expect } from '@playwright/test';
|
|
32
57
|
import path from 'path';
|
|
@@ -45,9 +70,10 @@ test('export and verify financial report', async ({ page }) => {
|
|
|
45
70
|
|
|
46
71
|
---
|
|
47
72
|
|
|
48
|
-
|
|
73
|
+
### Deep Content Inspection Recipes (Python)
|
|
49
74
|
|
|
50
75
|
### Pattern A: Excel (.xlsx / .xls) Schema & Data Assertion
|
|
76
|
+
<!-- classification: illustrative -->
|
|
51
77
|
```python
|
|
52
78
|
import pandas as pd
|
|
53
79
|
|
|
@@ -65,6 +91,7 @@ def validate_excel_report(file_path: str, expected_min_rows: int = 1):
|
|
|
65
91
|
```
|
|
66
92
|
|
|
67
93
|
### Pattern B: CSV Chunk Streaming (For Big Data Exports > 100k Rows)
|
|
94
|
+
<!-- classification: illustrative -->
|
|
68
95
|
```python
|
|
69
96
|
import csv
|
|
70
97
|
|
|
@@ -81,6 +108,7 @@ def validate_large_csv_stream(file_path: str, expected_header: list):
|
|
|
81
108
|
```
|
|
82
109
|
|
|
83
110
|
### Pattern C: PDF Document Text & Metadata Extraction
|
|
111
|
+
<!-- classification: illustrative -->
|
|
84
112
|
```python
|
|
85
113
|
import pypdf
|
|
86
114
|
|
|
@@ -93,3 +121,19 @@ def assert_pdf_contains_text(pdf_path: str, expected_keywords: list):
|
|
|
93
121
|
assert kw in full_text, f"PDF assertion failed: Keyword '{kw}' missing in {pdf_path}"
|
|
94
122
|
print(f"[PASS] Verified keywords {expected_keywords} across {len(reader.pages)} PDF pages.")
|
|
95
123
|
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## 4. Verification Points & DoD
|
|
128
|
+
|
|
129
|
+
1. Downloaded file format, MIME type, and byte size verified.
|
|
130
|
+
2. Deep content inspection validates specific text strings, cell coordinates, and row counts.
|
|
131
|
+
3. Downloaded test files cleaned up from temporary sandbox upon test completion.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## 5. Handoff Protocol
|
|
136
|
+
|
|
137
|
+
- **Deliverables:** File validation test scripts, parsing helpers, and download integrity reports.
|
|
138
|
+
- **Next Subagent:** quality-gatekeeper
|
|
139
|
+
- **Output Format:** Clean POM code, structured JSON telemetry, or validated markdown handoff.
|
|
@@ -10,11 +10,35 @@ policies:
|
|
|
10
10
|
---
|
|
11
11
|
# Synthetic Test Data Generator & Edge-Case Fuzzing Skill
|
|
12
12
|
|
|
13
|
+
> **Author Attribution & MIT License Guard:** Synapse Hub is open-source software created by **ThαΊΏ Vα» (@TeeVee98)** (<https://github.com/TeeVee98/Synapse-Hub>) under the MIT License.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 1. Trigger & Activation
|
|
18
|
+
|
|
19
|
+
- **Trigger Clause:** Generate idempotent, boundary-value synthetic test data with unique runtime timestamps. Use when generating idempotent, unique test data for creation tests.
|
|
20
|
+
- **Activation Scope:** Domain workflows for `07-data-and-state` involving `synthetic-test-data-generator`.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 2. Non-Goals & Boundary Constraints
|
|
25
|
+
|
|
26
|
+
- **What NOT to do:**
|
|
27
|
+
- Do NOT use real customer PII or production credentials for test data.
|
|
28
|
+
- Do NOT generate static repetitive values that hide edge-case bugs.
|
|
29
|
+
- Do NOT generate unconstrained fuzzer payloads without containment and boundary checks.
|
|
30
|
+
- **Sibling Skill Boundaries:**
|
|
31
|
+
- db-state-verifier-and-seeder seeds databases; synthetic-test-data-generator synthesizes realistic, dynamic, and fuzz test payloads.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 3. Ordered Execution Workflow
|
|
36
|
+
|
|
13
37
|
> **Target:** Eliminate database collisions, race conditions in parallel testing, and stale fixture dependencies by dynamically generating valid, boundary-value, and edge-case fuzzing datasets.
|
|
14
38
|
|
|
15
39
|
---
|
|
16
40
|
|
|
17
|
-
|
|
41
|
+
### Core Principles
|
|
18
42
|
|
|
19
43
|
1. **Idempotence & Unique Prefixing:**
|
|
20
44
|
- Every generated string or identifier must contain an execution timestamp or UUID prefix (`AUTO_1719500000_...`) to allow parallel test executions without unique-key database collisions.
|
|
@@ -29,9 +53,10 @@ policies:
|
|
|
29
53
|
|
|
30
54
|
---
|
|
31
55
|
|
|
32
|
-
|
|
56
|
+
### Standard Generation Recipes
|
|
33
57
|
|
|
34
58
|
### Recipe A: Dynamic Unique Entity Names
|
|
59
|
+
<!-- classification: illustrative -->
|
|
35
60
|
```typescript
|
|
36
61
|
export class TestDataFactory {
|
|
37
62
|
static uniqueName(prefix: string = 'AUTO'): string {
|
|
@@ -47,6 +72,7 @@ export class TestDataFactory {
|
|
|
47
72
|
```
|
|
48
73
|
|
|
49
74
|
### Recipe B: Boundary Value String Suite
|
|
75
|
+
<!-- classification: illustrative -->
|
|
50
76
|
```json
|
|
51
77
|
{
|
|
52
78
|
"boundaryStrings": [
|
|
@@ -65,6 +91,7 @@ export class TestDataFactory {
|
|
|
65
91
|
```
|
|
66
92
|
|
|
67
93
|
### Recipe C: GeoJSON / GIS Valid Non-Overlapping Polygons
|
|
94
|
+
<!-- classification: illustrative -->
|
|
68
95
|
```typescript
|
|
69
96
|
export function generateValidPolygon(centerLat = 21.0285, centerLng = 105.8542, offset = 0.005) {
|
|
70
97
|
// Generates closed 5-point polygon bounding box
|
|
@@ -80,10 +107,11 @@ export function generateValidPolygon(centerLat = 21.0285, centerLng = 105.8542,
|
|
|
80
107
|
|
|
81
108
|
---
|
|
82
109
|
|
|
83
|
-
|
|
110
|
+
### Edge-Case Fuzzing & Input Sanitization Suite (`tools/fuzz_payloads.py`)
|
|
84
111
|
|
|
85
112
|
Transform functional tests into input sanitization and robustness validation by executing edge-case fuzzing vectors:
|
|
86
113
|
|
|
114
|
+
<!-- classification: illustrative -->
|
|
87
115
|
```bash
|
|
88
116
|
# Query CLI catalog for specific field vectors
|
|
89
117
|
python tools/fuzz_payloads.py --field username --type string
|
|
@@ -91,6 +119,7 @@ python tools/fuzz_payloads.py --category sqli --json
|
|
|
91
119
|
```
|
|
92
120
|
|
|
93
121
|
### Recipe D: Harmless SQLi Polyglot Sanity
|
|
122
|
+
<!-- classification: illustrative -->
|
|
94
123
|
```typescript
|
|
95
124
|
export const SQLI_FUZZ_PROBES = [
|
|
96
125
|
"' OR '1'='1' -- ",
|
|
@@ -103,6 +132,7 @@ export const SQLI_FUZZ_PROBES = [
|
|
|
103
132
|
```
|
|
104
133
|
|
|
105
134
|
### Recipe E: Unicode BiDi & RTL Trojan Source Vectors
|
|
135
|
+
<!-- classification: illustrative -->
|
|
106
136
|
```typescript
|
|
107
137
|
export const BIDI_FUZZ_PROBES = [
|
|
108
138
|
"\u202E\u0041\u0042\u0043_AUTO_TX", // Right-to-Left Override (RLO)
|
|
@@ -114,6 +144,7 @@ export const BIDI_FUZZ_PROBES = [
|
|
|
114
144
|
```
|
|
115
145
|
|
|
116
146
|
### Recipe F: Multi-Byte Emoji Surrogate Pairs & ZWJ Sequences
|
|
147
|
+
<!-- classification: illustrative -->
|
|
117
148
|
```typescript
|
|
118
149
|
export const EMOJI_FUZZ_PROBES = [
|
|
119
150
|
"π¨βπ©βπ§βπ¦_QA_RECORD", // Complex Zero-Width Joiner family sequence
|
|
@@ -125,6 +156,7 @@ export const EMOJI_FUZZ_PROBES = [
|
|
|
125
156
|
```
|
|
126
157
|
|
|
127
158
|
### Recipe G: Extreme Length Buffer Stress ($10^4$ Characters)
|
|
159
|
+
<!-- classification: illustrative -->
|
|
128
160
|
```typescript
|
|
129
161
|
export const BUFFER_STRESS_PAYLOADS = [
|
|
130
162
|
"A".repeat(10000), // 10,000 chars text block
|
|
@@ -136,5 +168,21 @@ export const BUFFER_STRESS_PAYLOADS = [
|
|
|
136
168
|
|
|
137
169
|
---
|
|
138
170
|
|
|
139
|
-
|
|
171
|
+
### Teardown & Lifecycle Integration
|
|
140
172
|
- Every test generating persistent records with `synthetic-test-data-generator` **MUST** register the generated ID into a teardown queue to clean up after test execution completes.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## 4. Verification Points & DoD
|
|
177
|
+
|
|
178
|
+
1. Generated data includes realistic edge cases (Unicode, boundary lengths, special characters).
|
|
179
|
+
2. Entity codes use dynamic timestamped prefixes (`BasePage.uniqueCode()`).
|
|
180
|
+
3. Zero PII or real credentials generated in test datasets.
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## 5. Handoff Protocol
|
|
185
|
+
|
|
186
|
+
- **Deliverables:** Synthetic data factories, fuzz payload dictionaries, and test data fixture files.
|
|
187
|
+
- **Next Subagent:** pom-crafter / api-engineer
|
|
188
|
+
- **Output Format:** Clean POM code, structured JSON telemetry, or validated markdown handoff.
|
|
@@ -10,9 +10,33 @@ policies:
|
|
|
10
10
|
---
|
|
11
11
|
# Refactor, Clean Code & Technical Debt Remediation
|
|
12
12
|
|
|
13
|
+
> **Author Attribution & MIT License Guard:** Synapse Hub is open-source software created by **ThαΊΏ Vα» (@TeeVee98)** (<https://github.com/TeeVee98/Synapse-Hub>) under the MIT License.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 1. Trigger & Activation
|
|
18
|
+
|
|
19
|
+
- **Trigger Clause:** Eliminate technical debt and refactor code using SOLID and Clean Code patterns. Use when refactoring legacy test code toward clean, maintainable structures.
|
|
20
|
+
- **Activation Scope:** Domain workflows for `08-code-quality` involving `code-refactoring-refactor-clean`.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 2. Non-Goals & Boundary Constraints
|
|
25
|
+
|
|
26
|
+
- **What NOT to do:**
|
|
27
|
+
- Do NOT introduce functional behavior changes or new features during a refactoring task.
|
|
28
|
+
- Do NOT refactor code without existing passing tests protecting the behavior boundary.
|
|
29
|
+
- Do NOT perform uncontrolled 'while I'm here' cleanups across untouched files.
|
|
30
|
+
- **Sibling Skill Boundaries:**
|
|
31
|
+
- surgical-coding-principles restricts where to touch; code-refactoring-refactor-clean executes behavior-preserving structure improvements.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 3. Ordered Execution Workflow
|
|
36
|
+
|
|
13
37
|
You are a code refactoring and technical debt expert specializing in clean code principles, SOLID design patterns, tech debt inventory, and modern software engineering best practices. Analyze, remediate, and refactor code to improve maintainability, performance, and architecture health.
|
|
14
38
|
|
|
15
|
-
|
|
39
|
+
### Use this skill when
|
|
16
40
|
|
|
17
41
|
- Refactoring tangled, overly complex, or hard-to-maintain code
|
|
18
42
|
- Identifying, quantifying, and prioritizing technical debt and code smells
|
|
@@ -20,16 +44,16 @@ You are a code refactoring and technical debt expert specializing in clean code
|
|
|
20
44
|
- Preparing modules for new features safely without regression
|
|
21
45
|
- Establishing automated quality gates and debt reduction roadmaps
|
|
22
46
|
|
|
23
|
-
|
|
47
|
+
### Do not use this skill when
|
|
24
48
|
|
|
25
49
|
- You only need a small one-line fix
|
|
26
50
|
- Refactoring is prohibited due to production freeze
|
|
27
51
|
- The request is for documentation only
|
|
28
52
|
|
|
29
|
-
|
|
53
|
+
### Context
|
|
30
54
|
The user needs actionable code refactoring and technical debt remediation. Focus on practical improvements that enhance code quality, reduce maintenance costs, and preserve passing tests.
|
|
31
55
|
|
|
32
|
-
|
|
56
|
+
### Instructions
|
|
33
57
|
|
|
34
58
|
- Assess code smells, dependencies, risky hotspots, and technical debt metrics.
|
|
35
59
|
- Propose a refactor plan with incremental steps and clear ROI.
|
|
@@ -37,7 +61,7 @@ The user needs actionable code refactoring and technical debt remediation. Focus
|
|
|
37
61
|
- Update tests, verify regressions, and maintain backward compatibility.
|
|
38
62
|
- If detailed patterns are required, refer to `resources/implementation-playbook.md`.
|
|
39
63
|
|
|
40
|
-
|
|
64
|
+
### Technical Debt & Code Smell Checklist
|
|
41
65
|
|
|
42
66
|
1. **Code Debt:**
|
|
43
67
|
- Duplication: identical logic, copy-paste snippets, repeated business rules.
|
|
@@ -48,15 +72,16 @@ The user needs actionable code refactoring and technical debt remediation. Focus
|
|
|
48
72
|
3. **Testing Debt:**
|
|
49
73
|
- Missing assertions, flaky synchronization, untracked test data collisions.
|
|
50
74
|
|
|
51
|
-
|
|
75
|
+
### Safety & Verification
|
|
52
76
|
|
|
53
77
|
- Never alter business logic without explicit confirmation.
|
|
54
78
|
- Keep diffs minimal, reviewable, and run verification gates:
|
|
55
|
-
|
|
79
|
+
<!-- classification: illustrative -->
|
|
80
|
+
```bash
|
|
56
81
|
synapse verify
|
|
57
|
-
|
|
82
|
+
```
|
|
58
83
|
|
|
59
|
-
|
|
84
|
+
### Output Format
|
|
60
85
|
|
|
61
86
|
- Summary of identified issues, code smells, and technical debt
|
|
62
87
|
- Incremental refactoring roadmap with risk assessment
|
|
@@ -64,6 +89,22 @@ The user needs actionable code refactoring and technical debt remediation. Focus
|
|
|
64
89
|
- Proposed changes and expected impact
|
|
65
90
|
- Test/verification notes
|
|
66
91
|
|
|
67
|
-
|
|
92
|
+
### Resources
|
|
68
93
|
|
|
69
94
|
- `resources/implementation-playbook.md` for detailed patterns and examples.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 4. Verification Points & DoD
|
|
99
|
+
|
|
100
|
+
1. Existing test suite passes before and after refactoring with zero regressions.
|
|
101
|
+
2. Code complexity, duplication, and coupling metrics improve measurably.
|
|
102
|
+
3. All public APIs and method contracts remain backward-compatible.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## 5. Handoff Protocol
|
|
107
|
+
|
|
108
|
+
- **Deliverables:** Refactored source files, regression test verification logs, and AST complexity diff.
|
|
109
|
+
- **Next Subagent:** pom-crafter / quality-gatekeeper
|
|
110
|
+
- **Output Format:** Clean POM code, structured JSON telemetry, or validated markdown handoff.
|