synapse-hub 2.2.4 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (311) hide show
  1. package/.agents/agents/failure-analyst.md +11 -0
  2. package/.agents/agents/live-explorer.md +28 -0
  3. package/.agents/agents/orchestrator.md +20 -4
  4. package/.agents/agents/pom-crafter.md +12 -0
  5. package/.agents/agents/quality-gatekeeper.md +19 -4
  6. package/.agents/agents/test-runner.md +11 -0
  7. package/.agents/rules/communication-style.md +40 -0
  8. package/.agents/rules/context-engineering.md +23 -0
  9. package/.agents/rules/git-push-protocol.md +10 -16
  10. package/.agents/rules/graphify.md +14 -14
  11. package/.agents/rules/mandatory-playwright-live.md +29 -29
  12. package/.agents/rules/mobile_appium_rules.md +132 -0
  13. package/.agents/rules/performance_testing_rules.md +74 -0
  14. package/.agents/rules/systematic-debugging.md +6 -6
  15. package/.agents/skills/agent-orchestration-multi-agent-optimize/SKILL.md +64 -215
  16. package/.agents/skills/agent-orchestration-multi-agent-optimize/examples/swarm_workload_config.json +12 -0
  17. package/.agents/skills/antigravity-test-sentinel/SKILL.md +3 -3
  18. package/.agents/skills/antigravity-test-sentinel/examples/dod_gate_policy.json +11 -0
  19. package/.agents/skills/api-network-mocking-interception/SKILL.md +1 -1
  20. package/.agents/skills/api-network-mocking-interception/examples/network_route_stub.json +9 -0
  21. package/.agents/skills/api-spec-to-e2e-matrix/SKILL.md +9 -9
  22. package/.agents/skills/api-spec-to-e2e-matrix/examples/sample_openapi.json +19 -0
  23. package/.agents/skills/architecture-decision-records/SKILL.md +35 -412
  24. package/.agents/skills/architecture-decision-records/examples/0001-record-architecture-decisions.md +12 -0
  25. package/.agents/skills/auth-session-and-cookie-manager/SKILL.md +1 -1
  26. package/.agents/skills/auth-session-and-cookie-manager/examples/storage_state_sample.json +11 -0
  27. package/.agents/skills/backend-load-and-stress-patterns/SKILL.md +80 -186
  28. package/.agents/skills/backend-load-and-stress-patterns/examples/k6_load_test_sample.js +13 -0
  29. package/.agents/skills/bats-testing-patterns/SKILL.md +1 -1
  30. package/.agents/skills/bats-testing-patterns/examples/cli_runner_test.bats +6 -0
  31. package/.agents/skills/bats-testing-patterns/resources/implementation-playbook.md +614 -614
  32. package/.agents/skills/clean-pom-crafter/SKILL.md +21 -3
  33. package/.agents/skills/clean-pom-crafter/examples/standard_test_case.groovy +28 -28
  34. package/.agents/skills/clean-pom-crafter/references/pom_patterns.groovy +138 -138
  35. package/.agents/skills/code-refactoring-refactor-clean/SKILL.md +2 -2
  36. package/.agents/skills/code-refactoring-refactor-clean/examples/refactored_page_sample.groovy +9 -0
  37. package/.agents/skills/db-state-verifier-and-seeder/SKILL.md +5 -5
  38. package/.agents/skills/db-state-verifier-and-seeder/examples/db_fixture_seed.json +12 -0
  39. package/.agents/skills/e2e-testing-patterns/SKILL.md +1 -1
  40. package/.agents/skills/e2e-testing-patterns/examples/playwright_sharded_config.ts +12 -0
  41. package/.agents/skills/e2e-testing-patterns/resources/implementation-playbook.md +522 -522
  42. package/.agents/skills/failure-autopsy-and-healing/SKILL.md +17 -3
  43. package/.agents/skills/failure-autopsy-and-healing/examples/sample_junit_failure.xml +8 -0
  44. package/.agents/skills/failure-autopsy-and-healing/references/healing_matrix.md +64 -64
  45. package/.agents/skills/failure-autopsy-and-healing/references/qa_investigation_protocol.md +56 -56
  46. package/.agents/skills/failure-autopsy-and-healing/scripts/triage_failures.sh +98 -98
  47. package/.agents/skills/file-and-report-validator/SKILL.md +1 -1
  48. package/.agents/skills/file-and-report-validator/examples/sample_export_schema.json +14 -0
  49. package/.agents/skills/flaky-test-sentinel-and-quarantine/SKILL.md +3 -3
  50. package/.agents/skills/flaky-test-sentinel-and-quarantine/examples/quarantine_registry.json +11 -0
  51. package/.agents/skills/gherkin-to-suite/SKILL.md +103 -0
  52. package/.agents/skills/gherkin-to-suite/examples/checkout.feature +39 -0
  53. package/.agents/skills/gherkin-to-suite/examples/suite_report_sample.json +334 -0
  54. package/.agents/skills/github-actions-templates/SKILL.md +47 -304
  55. package/.agents/skills/github-actions-templates/examples/matrix_test_pipeline.yml +8 -0
  56. package/.agents/skills/graphify-impact-analyzer/SKILL.md +6 -6
  57. package/.agents/skills/graphify-impact-analyzer/examples/dependency_blast_radius.json +8 -0
  58. package/.agents/skills/katalon-cli-runner/SKILL.md +2 -2
  59. package/.agents/skills/katalon-cli-runner/examples/headless_kre_exec.sh +3 -0
  60. package/.agents/skills/katalon-cli-runner/references/groovy-patterns.md +209 -209
  61. package/.agents/skills/katalon-cli-runner/references/katalon-api.md +155 -155
  62. package/.agents/skills/katalon-cli-runner/references/runner_commands.md +67 -67
  63. package/.agents/skills/lam-script-generator/SKILL.md +42 -1
  64. package/.agents/skills/lam-script-generator/examples/user_story_sample.md +8 -0
  65. package/.agents/skills/lean-code-ladder/SKILL.md +83 -0
  66. package/.agents/skills/lean-code-ladder/examples/ladder_walkthrough.md +37 -0
  67. package/.agents/skills/meta-prompt-crafter/SKILL.md +107 -0
  68. package/.agents/skills/meta-prompt-crafter/examples/qa_prompt_template.md +35 -0
  69. package/.agents/skills/persistent-planning-files/SKILL.md +108 -0
  70. package/.agents/skills/persistent-planning-files/examples/task_plan_example.md +56 -0
  71. package/.agents/skills/playwright-live-interaction/SKILL.md +49 -1
  72. package/.agents/skills/playwright-live-interaction/examples/live_probe_script.js +5 -0
  73. package/.agents/skills/playwright-live-interaction/references/advanced_superpowers.md +160 -160
  74. package/.agents/skills/playwright-live-interaction/references/compact_accessibility_snapshots.md +75 -75
  75. package/.agents/skills/playwright-live-interaction/references/recipes.md +388 -388
  76. package/.agents/skills/playwright-live-interaction/references/swarm_orchestration.md +134 -134
  77. package/.agents/skills/playwright-webapp-testing/SKILL.md +93 -0
  78. package/.agents/skills/playwright-webapp-testing/examples/server_lifecycle_playwright.py +63 -0
  79. package/.agents/skills/rbt-manual-testing/SKILL.md +150 -0
  80. package/.agents/skills/rbt-manual-testing/examples/checkout_rbt_manual_suite.md +25 -0
  81. package/.agents/skills/security-dast-sentinel/SKILL.md +54 -135
  82. package/.agents/skills/security-dast-sentinel/examples/dast_scan_config.json +10 -0
  83. package/.agents/skills/self-healing-locator/SKILL.md +24 -10
  84. package/.agents/skills/self-healing-locator/examples/aom_diff_sample.json +16 -0
  85. package/.agents/skills/skillspector-security-guard/SKILL.md +32 -90
  86. package/.agents/skills/skillspector-security-guard/examples/safe_mcp_config.json +12 -0
  87. package/.agents/skills/surgical-coding-principles/SKILL.md +89 -0
  88. package/.agents/skills/surgical-coding-principles/examples/surgical_vs_scope_creep.md +46 -0
  89. package/.agents/skills/synthetic-test-data-generator/SKILL.md +3 -3
  90. package/.agents/skills/synthetic-test-data-generator/examples/idempotent_data_recipe.json +9 -0
  91. package/.agents/skills/systematic-debugging/SKILL.md +100 -0
  92. package/.agents/skills/systematic-debugging/examples/four_phase_case.md +44 -0
  93. package/.agents/skills/test-driven-development/SKILL.md +114 -0
  94. package/.agents/skills/test-driven-development/examples/red_green_refactor_qa.md +78 -0
  95. package/.agents/skills/token-and-context-optimizer/SKILL.md +1 -1
  96. package/.agents/skills/token-and-context-optimizer/examples/distilled_log_sample.txt +3 -0
  97. package/.agents/skills/verification-before-completion/SKILL.md +100 -0
  98. package/.agents/skills/verification-before-completion/examples/evidence_log_example.md +46 -0
  99. package/.agents/skills/visual-regression-sentinel/SKILL.md +21 -1
  100. package/.agents/skills/visual-regression-sentinel/examples/visual_mask_rules.json +9 -0
  101. package/.agents/skills/wcag-audit-patterns/SKILL.md +3 -3
  102. package/.agents/skills/wcag-audit-patterns/examples/wcag_compliance_checklist.json +10 -0
  103. package/.agents/skills/wcag-audit-patterns/resources/implementation-playbook.md +541 -541
  104. package/.agents/skills/web-vitals-and-performance-profiler/SKILL.md +1 -1
  105. package/.agents/skills/web-vitals-and-performance-profiler/examples/cwv_budget_policy.json +6 -0
  106. package/.agents/templates/completion_report.md +57 -57
  107. package/.agents/workflows/analyze_requirement_document.md +18 -0
  108. package/.agents/workflows/export_testcases_excel.md +32 -0
  109. package/.agents/workflows/generate_combinatorial_test_data.md +28 -0
  110. package/.agents/workflows/generate_cross_module_test_plan.md +37 -0
  111. package/.agents/workflows/generate_manual_testcases_rbt.md +56 -0
  112. package/.agents/workflows/generate_requirements_from_website.md +25 -0
  113. package/.agents/workflows/generate_testcases_from_requirements.md +21 -0
  114. package/.agents/workflows/graphify.md +10 -10
  115. package/.agents/workflows/verify.md +2 -2
  116. package/.cursor/rules/language.mdc +7 -7
  117. package/.cursor/rules/synapse-qa.mdc +23 -0
  118. package/.cursorrules +7 -0
  119. package/.pre-commit-hooks.yaml +14 -0
  120. package/.windsurfrules +7 -0
  121. package/AGENTS.md +54 -15
  122. package/CLAUDE.md +35 -12
  123. package/LICENSE +30 -0
  124. package/NOTICE +180 -0
  125. package/README.en.md +325 -0
  126. package/README.md +247 -516
  127. package/action.yml +51 -0
  128. package/benchmarks/qa_eval/README.md +71 -0
  129. package/benchmarks/qa_eval/build_dataset.py +677 -0
  130. package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-06_api_contract_drift.json +22 -0
  131. package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-07_api_contract_drift.json +22 -0
  132. package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-08_api_contract_drift.json +22 -0
  133. package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-09_api_contract_drift.json +22 -0
  134. package/benchmarks/qa_eval/dataset/api_contract_drift/qa-challenge-10_api_contract_drift.json +22 -0
  135. package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-21_fake_pass_tautology.json +21 -0
  136. package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-22_fake_pass_tautology.json +21 -0
  137. package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-23_fake_pass_tautology.json +21 -0
  138. package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-24_fake_pass_tautology.json +21 -0
  139. package/benchmarks/qa_eval/dataset/fake_pass_tautology/qa-challenge-25_fake_pass_tautology.json +21 -0
  140. package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-01_locator_drift.json +23 -0
  141. package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-02_locator_drift.json +23 -0
  142. package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-03_locator_drift.json +23 -0
  143. package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-04_locator_drift.json +23 -0
  144. package/benchmarks/qa_eval/dataset/locator_drift/qa-challenge-05_locator_drift.json +23 -0
  145. package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-16_stale_and_mutation.json +22 -0
  146. package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-17_stale_and_mutation.json +22 -0
  147. package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-18_stale_and_mutation.json +22 -0
  148. package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-19_stale_and_mutation.json +22 -0
  149. package/benchmarks/qa_eval/dataset/stale_and_mutation/qa-challenge-20_stale_and_mutation.json +23 -0
  150. package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-11_timing_and_race.json +22 -0
  151. package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-12_timing_and_race.json +22 -0
  152. package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-13_timing_and_race.json +22 -0
  153. package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-14_timing_and_race.json +22 -0
  154. package/benchmarks/qa_eval/dataset/timing_and_race/qa-challenge-15_timing_and_race.json +22 -0
  155. package/benchmarks/qa_eval/eval_runner.py +418 -0
  156. package/benchmarks/qa_eval/reports/AB_METHODOLOGY_REPORT.md +83 -0
  157. package/benchmarks/qa_eval/reports/BENCHMARK_REPORT.md +69 -0
  158. package/benchmarks/qa_eval/reports/eval_results.json +105 -0
  159. package/bin/agent-qa.js +10 -3
  160. package/docs/ARCHITECTURE.md +107 -0
  161. package/docs/CI_CD_INTEGRATION.md +94 -0
  162. package/docs/CLI_REFERENCE.md +157 -0
  163. package/docs/CONTRIBUTING.md +91 -0
  164. package/docs/PLUGIN_DEVELOPMENT_GUIDE.md +126 -0
  165. package/docs/TOKEN_QUOTA_PLAYBOOK.md +41 -0
  166. package/docs/adopted-ecosystem-tools.md +87 -0
  167. package/docs/schemas/synapse.config.schema.json +64 -0
  168. package/examples/cypress-ecommerce-suite/README.md +45 -0
  169. package/examples/cypress-ecommerce-suite/cypress/e2e/checkout.cy.js +17 -0
  170. package/examples/cypress-ecommerce-suite/cypress/pages/BasePage.js +29 -0
  171. package/examples/cypress-ecommerce-suite/cypress/pages/CartPage.js +51 -0
  172. package/examples/cypress-ecommerce-suite/cypress.config.js +13 -0
  173. package/examples/cypress-ecommerce-suite/package.json +13 -0
  174. package/examples/katalon-suite/Keywords/pages/BasePage.groovy +19 -0
  175. package/examples/katalon-suite/Keywords/pages/DashboardPage.groovy +29 -0
  176. package/examples/katalon-suite/Keywords/pages/LoginPage.groovy +45 -0
  177. package/examples/katalon-suite/Profiles/default.glbl +12 -0
  178. package/examples/katalon-suite/README.md +18 -0
  179. package/examples/katalon-suite/Scripts/Auth/TC_LoginSuccess/Script1234567890.groovy +12 -0
  180. package/examples/katalon-suite/Scripts/Dashboard/TC_ViewSummary/Script1234567891.groovy +15 -0
  181. package/examples/katalon-suite/katalon_suite.prj +21 -0
  182. package/examples/playwright-crm-suite/README.md +40 -0
  183. package/examples/playwright-crm-suite/package.json +14 -0
  184. package/examples/playwright-crm-suite/pages/BasePage.ts +37 -0
  185. package/examples/playwright-crm-suite/pages/CustomerPage.ts +57 -0
  186. package/examples/playwright-crm-suite/pages/LoginPage.ts +32 -0
  187. package/examples/playwright-crm-suite/playwright.config.ts +27 -0
  188. package/examples/playwright-crm-suite/tests/auth.spec.ts +22 -0
  189. package/examples/playwright-crm-suite/tests/customers.spec.ts +33 -0
  190. package/examples/plugins/sample-custom-plugin/README.md +14 -0
  191. package/examples/plugins/sample-custom-plugin/plugin.json +16 -0
  192. package/examples/plugins/sample-custom-plugin/skills/custom-security-headers-audit/SKILL.md +29 -0
  193. package/examples/plugins/sample-custom-plugin/skills/custom-security-headers-audit/examples/audit_fixture.json +8 -0
  194. package/examples/plugins/sample-custom-plugin/tools/custom_security_headers.py +125 -0
  195. package/examples/practices/README.md +22 -0
  196. package/examples/practices/requirements/crm/requirements_contracts.md +292 -0
  197. package/examples/practices/requirements/crm/requirements_customers.md +462 -0
  198. package/examples/practices/requirements/crm/requirements_login.md +202 -0
  199. package/examples/practices/requirements/crm/requirements_projects.md +396 -0
  200. package/examples/practices/requirements/crm/requirements_tasks.md +343 -0
  201. package/examples/practices/requirements/ecommerce/requirements_category_brand.txt +402 -0
  202. package/examples/practices/requirements/jira/KAN-5/KAN-1/2026-04-03_04-28-27.png +0 -0
  203. package/examples/practices/requirements/jira/KAN-5/KAN-1/KAN-1_requirement.md +52 -0
  204. package/examples/practices/requirements/jira/KAN-5/KAN-4/2026-04-03_04-28-19.png +0 -0
  205. package/examples/practices/requirements/jira/KAN-5/KAN-4/2026-04-03_04-28-57.png +0 -0
  206. package/examples/practices/requirements/jira/KAN-5/KAN-4/KAN-4_requirement.md +119 -0
  207. package/examples/practices/requirements/jira/KAN-5/KAN-5_overview.md +9 -0
  208. package/examples/practices/requirements/jira/KAN-5/KAN-6/2026-04-03_05-58-08.png +0 -0
  209. package/examples/practices/requirements/jira/KAN-5/KAN-6/2026-04-03_05-58-23.png +0 -0
  210. package/examples/practices/requirements/jira/KAN-5/KAN-6/KAN-6_requirement.md +32 -0
  211. package/examples/practices/testcases/api/book_management_api_test_cases.md +144 -0
  212. package/examples/practices/testcases/api/user_management_api_test_cases.md +139 -0
  213. package/examples/practices/testcases/crm/test_cases_crm_login.md +148 -0
  214. package/examples/practices/testcases/crm/test_cases_customers.md +156 -0
  215. package/examples/pytest-api-suite/README.md +45 -0
  216. package/examples/pytest-api-suite/conftest.py +31 -0
  217. package/examples/pytest-api-suite/pages/user_api_client.py +36 -0
  218. package/examples/pytest-api-suite/requirements.txt +2 -0
  219. package/examples/pytest-api-suite/tests/test_user_api.py +44 -0
  220. package/examples/selenium-suite/README.md +18 -0
  221. package/examples/selenium-suite/pages/base_page.py +27 -0
  222. package/examples/selenium-suite/pages/login_page.py +29 -0
  223. package/examples/selenium-suite/pages/order_page.py +25 -0
  224. package/examples/selenium-suite/pytest.ini +6 -0
  225. package/examples/selenium-suite/requirements.txt +2 -0
  226. package/examples/selenium-suite/tests/test_login.py +10 -0
  227. package/examples/selenium-suite/tests/test_order.py +10 -0
  228. package/package.json +22 -7
  229. package/scripts/generate_skill_examples.py +244 -0
  230. package/scripts/install.ps1 +112 -0
  231. package/scripts/install_global_plugin.ps1 +94 -0
  232. package/scripts/install_global_plugin.sh +49 -0
  233. package/scripts/lint_skills.ps1 +57 -0
  234. package/scripts/package_dist.py +323 -0
  235. package/scripts/setup.sh +59 -0
  236. package/scripts/update_hub.ps1 +19 -0
  237. package/scripts/update_hub.sh +15 -0
  238. package/skills_manifest.json +209 -6
  239. package/synapse.config.json +30 -0
  240. package/templates/PROJECT_AI_GUIDE_TEMPLATE.md +7 -7
  241. package/templates/PROJECT_STATE_TEMPLATE.md +1 -1
  242. package/templates/ai_bridges/CLAUDE.md +33 -16
  243. package/templates/ai_bridges/copilot-instructions.md +14 -21
  244. package/templates/ai_bridges/cursor_synapse_qa.mdc +17 -20
  245. package/templates/ai_bridges/windsurfrules +21 -21
  246. package/templates/ci/github-actions-synapse.yml +71 -4
  247. package/templates/welcome.html.tmpl +1674 -0
  248. package/tools/.infer_baseline.json +1102 -0
  249. package/tools/TOOLS_RUNBOOK.md +92 -130
  250. package/tools/__init__.py +26 -0
  251. package/tools/agent_canary.py +501 -501
  252. package/tools/analyze_project.py +31 -17
  253. package/tools/api_fuzzer.py +278 -6
  254. package/tools/author_integrity.py +6 -6
  255. package/tools/auto_heal.py +1 -1
  256. package/tools/browser_helpers.js +105 -7
  257. package/tools/bug_reporter.py +31 -1
  258. package/tools/bump_version.py +23 -3
  259. package/tools/cache_resolver.py +248 -14
  260. package/tools/check_env.py +55 -14
  261. package/tools/check_version_sync.py +153 -0
  262. package/tools/ci_healing_hook.py +1 -1
  263. package/tools/cli.py +263 -13
  264. package/tools/count_tokens.py +1257 -0
  265. package/tools/dashboard_generator.py +2638 -0
  266. package/tools/db_sandbox.py +198 -20
  267. package/tools/e2e_flow_prober.ps1 +12 -64
  268. package/tools/e2e_flow_prober.py +99 -0
  269. package/tools/e2e_flow_prober.sh +4 -0
  270. package/tools/flaky_detector.py +4 -3
  271. package/tools/generate_allure_report.ps1 +12 -29
  272. package/tools/generate_allure_report.py +77 -0
  273. package/tools/generate_allure_report.sh +4 -0
  274. package/tools/generate_jmx_plan.py +257 -58
  275. package/tools/generate_test_reports.ps1 +12 -134
  276. package/tools/generate_test_reports.py +133 -0
  277. package/tools/generate_test_reports.sh +4 -0
  278. package/tools/gherkin_suite.py +758 -0
  279. package/tools/git_pre_commit_guard.py +12 -6
  280. package/tools/goldfish_review.py +366 -0
  281. package/tools/heal_pr_automator.py +1 -1
  282. package/tools/heuristic_locator_matcher.py +170 -21
  283. package/tools/infer_linter.py +612 -70
  284. package/tools/lint_ai_docs.py +64 -0
  285. package/tools/matrix_sharder.py +1 -1
  286. package/tools/mcp_excel_server.ps1 +12 -250
  287. package/tools/mcp_excel_server.py +249 -0
  288. package/tools/mcp_excel_server.sh +4 -0
  289. package/tools/mcp_server.py +368 -144
  290. package/tools/md_to_xlsx.py +307 -0
  291. package/tools/micro_mutator.py +300 -69
  292. package/tools/omni_transpiler.py +2 -2
  293. package/tools/output_formatter.py +128 -0
  294. package/tools/pinpoint_failure.py +88 -88
  295. package/tools/project_state.py +2 -2
  296. package/tools/repo_map.py +1 -1
  297. package/tools/safety_firewall.py +196 -45
  298. package/tools/setup_project.py +294 -30
  299. package/tools/spec_drift_sentinel.py +439 -0
  300. package/tools/sync_agent_rules.py +248 -0
  301. package/tools/telemetry_correlator.py +45 -0
  302. package/tools/test_impact.py +51 -12
  303. package/tools/tms_sync_bridge.py +21 -5
  304. package/tools/universal_ir.py +3 -0
  305. package/tools/update_sentinel.py +87 -15
  306. package/tools/verify_all.ps1 +13 -0
  307. package/tools/verify_all.py +463 -79
  308. package/tools/visual_diff_canvas.py +1 -0
  309. package/tools/visual_som_helper.py +1 -1
  310. package/tools/watch_mode.py +305 -0
  311. package/tools/welcome_page.py +291 -0
package/README.md CHANGED
@@ -1,608 +1,339 @@
1
- # 🧠 Synapse Hub — Trung Tâm Trí Tuệ & Mạng Lưới Kỹ Năng Cho AI Agent
1
+ # 🧠 Synapse Hub — AI Test Quality Linter & Guardrails for Automated Testing
2
+ ### *Bộ Linter & Chốt Chặn Chất Lượng Test Dành Cho Thời Đại AI Viết Code*
2
3
 
3
- [🇻🇳 Tiếng Việt](#-synapse-hub--trung-tâm-trí-tuệ--mạng-lưới-kỹ-năng-cho-ai-agent) | [🇬🇧 English Edition](#-english-edition)
4
+ [🇻🇳 Tiếng Việt](README.md) | [🇬🇧 English Edition](README.en.md)
4
5
 
5
- > **Bộ não trí tuệ dùng chung và mạng lưới kỹ năng tự hành, tăng cường năng lực cho các trợ lý AI (Google Antigravity, Cursor, Windsurf, Claude Code) trên mọi hệ sinh thái kiểm thử tự động.**
6
+ > **Định vị cốt lõi:** Bộ Linter & Guardrails độc lập (zero external dependencies cho core engine & DoD gates) bảo vệ độ tin cậy của test suite khi AI viết code — Phát hiện & ngăn chặn test "pass ảo" (0 assert, tautology), loại bỏ hoàn toàn sleep cố định, nén 95% log CI/CD, và chuẩn hóa cấu trúc Clean POM. Các tính năng nâng cao (xuất bảng Excel chuẩn doanh nghiệp, so sánh ảnh Canvas) sử dụng thư viện mở rộng tùy chọn (`openpyxl`, `Pillow`).
7
+ > **Module mở rộng:** Sẵn sàng kết nối 38 kỹ năng QA chuyên sâu, 6 vai trò AI Swarm và 9 Cổng kiểm định DoD hỗ trợ Playwright, Cypress, Pytest và Katalon.
6
8
  > **Tác giả:** Thế Vị ([@TeeVee998](https://github.com/TeeVee998))
7
- > **Phiên bản Hub:** `v2.2.4` | **Quy mô:** 28 Kỹ năng chuẩn hóa, 6 Vai trò AI Swarm, 7 Quy tắc cốt lõi, 20+ Công cụ tự động.
8
-
9
- ---
10
-
11
- ## 🌟 1. Tổng quan & Mục đích Kiến trúc
12
-
13
- **Synapse Hub** là tầng trí tuệ đa tác tử tách rời (**Decoupled Shared Intelligence Core**), đóng vai trò như một **"Bộ não dùng chung"**, tách biệt hoàn toàn khỏi mã nguồn của từng dự án cụ thể. Dự án trang bị cho AI agents đội ngũ Sub-Agent QC chuyên biệt (Multi-Agent Swarm), quy trình tự chữa lành (Self-Healing), khả năng thấu hiểu mã nguồn cấp độ AST và các cổng chất lượng nghiêm ngặt (Quality Gates)—cho phép tự động hóa kiểm thử chuẩn xác tuyệt đối trên mọi codebase mà không làm bẩn repository mục tiêu.
14
-
15
- ```mermaid
16
- flowchart TD
17
- subgraph Hub["🧠 Synapse Hub (Intelligence Core v2.2.4)"]
18
- Skills[".agents/skills/ (28 Skills)"]
19
- Agents[".agents/agents/ (6 Specialized Roles)"]
20
- Rules[".agents/rules/ (7 Core Rules)"]
21
- Tools["tools/ (20+ Universal Python Tools)"]
22
- Workflows[".agents/workflows/"]
23
- end
24
-
25
- subgraph ChatSession["💬 AI Agent Workspace / Chat Session"]
26
- Hub -->|Mount/Add Workspace| ChatSession
27
- end
28
-
29
- subgraph Projects["📁 Các Dự Án Mục Tiêu (Target Projects)"]
30
- ProjectA["Dự án A<br/>(PROJECT_AI_GUIDE.md + Source Code)"]
31
- ProjectB["Dự án B<br/>(PROJECT_AI_GUIDE.md + Test Code)"]
32
- ProjectC["Dự án C<br/>(PROJECT_AI_GUIDE.md + App Code)"]
33
- Other["Dự án khác..."]
34
- end
35
-
36
- ProjectA -->|Mount Workspace| ChatSession
37
- ProjectB -.->|Mount Workspace| ChatSession
38
- ProjectC -.->|Mount Workspace| ChatSession
39
- Other -.->|Mount Workspace| ChatSession
40
- ```
41
-
42
- ### 💎 Lợi Ích Đột Phá Khi Sử Dụng Synapse Hub:
43
-
44
- #### 1. 🧠 Khả Năng Suy Nghĩ Có Chiều Sâu (System-2 Reasoning & Cognitive Forcing)
45
- * **Xóa bỏ chế độ "Autocomplete vô thức":** Khi đối mặt với lỗi kiểm thử hoặc yêu cầu viết test mới, AI không tự tiện sinh code ngẫu nhiên theo trực giác mà bị **ép buộc đi qua quy trình tư duy 4 bước (Cognitive Forcing Pipeline)**:
46
- 1. *Trích xuất bất biến (Invariants):* Điều gì bắt buộc không bao giờ được phép xảy ra?
47
- 2. *Giả định phản nghiệm (Popper Falsification):* Đặt ra 3 kịch bản lập trình viên làm hàm chạy sai nhưng test ngây ngô vẫn pass (False Negatives).
48
- 3. *Tự phản biện (Self-Debate):* Tự chứng minh tại sao assertion chuẩn bị viết sẽ bắt chết cả 3 kịch bản lỗi trên.
49
- 4. *Sinh code phòng vệ:* Chỉ xuất mã khi đã vượt qua 3 tầng lập luận.
50
- * **Tự đối kháng Red-Team vs Blue-Team:** Tự động tiêm đột biến AST (`tools/micro_mutator.py`) vào code kiểm thử để kiểm tra xem test suite có thực sự bắt được bug thật hay không. Bắt buộc **Điểm đột biến (Mutation Score) $\ge 80\%$** mới cho phép hoàn thành tác vụ.
51
-
52
- #### 2. ⚡ Siêu Tiết Kiệm Token (Cắt Giảm 85% – 95% Chi Phí Context)
53
- * **Log Distillation (Giảm 95% token log):** Công cụ `tools/distill_log.py` tự động lọc sạch 95% log rác dài lê thê của CLI/Gradle/Playwright, chỉ giữ lại đúng ~10 dòng chứa dòng lỗi và exception (< 50 tokens) thay vì ném 3.000 dòng log làm loãng context.
54
- * **AST Repo Mapping (Giảm 90% token đọc file):** Công cụ `tools/repo_map.py` nén 500+ method signatures vào đúng một bản đồ tóm tắt < 600 tokens. AI nắm toàn bộ hàm và class mà **không bao giờ phải mở đọc cả file 4.000 dòng** gây nổ context window ("Context Window Blowout").
55
- * **Compact AOM (Giảm 90% token HTML):** Không bao giờ dump cả trang HTML DOM 50.000 dòng vào prompt; công cụ trích xuất cây Accessibility Object Model (AOM) tương tác dưới 500 tokens.
56
- * **Zero-Token SQLite Memory Cache:** Ghi nhận và tra cứu kinh nghiệm sửa bug qua cơ sở dữ liệu SQLite ngoại tuyến (`~/.agent_memory/global_cache.db`) bằng thuật toán vector cosine similarity với chi phí **0 token context**.
57
- * **Chống suy thoái ngữ cảnh ("Context Rot" & "Lost-in-the-Middle"):** Đảm bảo AI luôn duy trì sự minh mẫn, không bao giờ bị ảo giác hay quên logic nghiệp vụ ngay cả trong các phiên làm việc dài trên 100.000 tokens.
58
-
59
- #### 3. 📊 So Sánh Hiệu Năng Thực Tế:
60
-
61
- | Tiêu chí đánh giá | Cách làm thông thường (Naive AI Prompting) | Khi sử dụng Synapse Hub 🧠 |
62
- | :--- | :---: | :---: |
63
- | **Token tiêu thụ / mỗi lần fix lỗi** | 15.000 – 40.000 tokens *(đọc cả file lớn, dump cả log)* | **300 – 800 tokens (Tiết kiệm > 90%)** |
64
- | **Tỷ lệ Fake-Pass (Test pass ảo, 0 assert)** | 30% – 50% *(AI có xu hướng nuốt lỗi để báo PASS)* | **0% (Chặn đứng bởi Truth Anchor & 9 DoD Gates)** |
65
- | **Trí nhớ sửa lỗi xuyên phiên (Cross-Session)** | Quên sạch ngay khi mở tab chat mới | **Bền vững qua SQLite Central Cache (0 token)** |
66
- | **Hiện tượng quên ngữ cảnh (Context Rot)** | Xảy ra nhanh chóng sau 40k – 60k tokens | **Miễn nhiễm nhờ 3 tầng Progressive Disclosure** |
67
- | **Thời gian tự phục hồi lỗi (MTTR)** | 5 – 15 phút mò mẫm thử nghiệm | **< 1 giây (Tra cứu kinh nghiệm có sẵn)** |
68
-
69
- *(Lưu ý: 300–800 token là chi phí ngữ cảnh động của từng lượt sửa lỗi vi mô (micro-turn payload) nhờ repo_map và distill_log; chưa tính chi phí nạp hệ thống/rules ban đầu của IDE ~7.000 tokens).*
70
-
71
- ---
72
-
73
- ## 🚀 2. Hướng Dẫn Bắt Đầu & Tích Hợp (3 Cách Dùng)
9
+ > **Phiên bản Hub:** `v2.4.0` | **Quy mô:** 38 Kỹ năng chuẩn hóa, 6 Vai trò AI Agent, 51 Lệnh CLI & 60+ Công cụ kiểm thử chuyên sâu, 9 Cổng kiểm định DoD.
74
10
 
75
11
  [![npm version](https://img.shields.io/npm/v/synapse-hub.svg?style=flat-square&color=blue)](https://www.npmjs.com/package/synapse-hub)
76
- [![node version](https://img.shields.io/badge/node-%3E%3D16.0.0-brightgreen.svg?style=flat-square)](https://nodejs.org)
12
+ [![node version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg?style=flat-square)](https://nodejs.org)
13
+ [![python version](https://img.shields.io/badge/python-%3E%3D3.10-blue.svg?style=flat-square)](https://python.org)
77
14
  [![license](https://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](https://github.com/TeeVee998/Synapse-Hub/blob/main/LICENSE)
15
+ [![Ecosystem](https://img.shields.io/badge/AI%20Ecosystem-Antigravity%20%7C%20Cursor%20%7C%20Claude%20%7C%20Copilot%20%7C%20Windsurf-orange.svg?style=flat-square)](#)
78
16
 
79
17
  ---
80
18
 
81
- ### ⚡ Khởi Động Siêu Tốc: Đúng 1 Lệnh Duy Nhất Với NPX (All-in-One 🚀)
82
- *Tất cả trong một: **KHÔNG CẦN clone repo Hub**, **KHÔNG CẦN mở Multi-root workspace**, tự động cấu hình dự án **VÀ tự động bơm thẳng vào Antigravity Global Plugin**.*
19
+ ### 💡 Synapse Hub là gì? (Hiểu ngay trong 30 giây)
83
20
 
84
- Mở terminal ngay tại thư mục **dự án kiểm thử của bạn** và chạy đúng 1 dòng:
85
- ```bash
86
- npx synapse-hub setup
87
- ```
88
- 👉 **Đúng 1 lệnh này sẽ tự động hoàn tất toàn bộ trong 5 giây:**
89
- 1. 🧠 **Tự động bơm vào Antigravity Global Plugin:** Triển khai Synapse-Hub vào `~/.gemini/config/plugins/synapse-hub`. Kể từ giây phút này, **mọi dự án** mở trên Google Antigravity đều tự động sở hữu toàn bộ 28 Skills và 6 Subagents mà không cần cấu hình thêm!
90
- 2. 🌐 **Triển Khai Cầu Nối Đa IDE & AI (Universal AI Bridges):** Tự động sinh file cấu hình và quy chuẩn cho mọi trợ lý AI khác nhau ngay trong dự án của bạn:
91
- - 🖱️ **Cursor:** `.cursor/rules/synapse-qa.mdc` (Tự động kích hoạt khi mở file trong Cursor)
92
- - 🤖 **Claude Code:** `CLAUDE.md` (Hướng dẫn quy chuẩn QA, commands và Clean POM)
93
- - 🐙 **GitHub Copilot:** `.github/copilot-instructions.md` (Chỉ dẫn hệ thống cho VS Code / JetBrains Copilot)
94
- - 🏄 **Windsurf (Cascade):** `.windsurfrules` (Nguyên tắc kiểm thử bắt buộc)
95
- *(Mọi thành viên dù dùng Antigravity, Cursor, Claude Code, Copilot hay Windsurf đều chung 1 chuẩn Clean POM, 1 nguyên tắc Truth Anchor chống pass ảo, và 9 Cổng Kiểm Định DoD (Gate 0–8)!)*
96
- 3. 🔍 **Nhận diện Framework:** Tự động phát hiện Playwright TypeScript/JS, Katalon Studio Groovy, Cypress, hoặc Pytest.
97
- 4. 📋 **Sinh Hướng Dẫn Nghiệp Vụ:** Tạo file `PROJECT_AI_GUIDE.md` ngay trong dự án của bạn để AI hiểu sâu kiến trúc và quy chuẩn code.
98
- 5. 🛡️ **Cài Đặt Cổng Gác Git (Pre-Push Hook):** Tự cài `.git/hooks/pre-push` gọi `npx synapse-hub verify` để chặn đứng mã lỗi và lộ mật khẩu trước khi push.
99
- 6. 💾 **Khởi Tạo Bộ Nhớ Kinh Nghiệm (SQLite Cache):** Khởi tạo và nạp giải pháp sửa lỗi UI vào `~/.agent_memory/global_cache.db` (chi phí 0 token).
100
- 7. 🗺️ **Quét AST & Xuất Bản Đồ Hàm:** Tự động phân tích codebase và trích xuất `repo_map.txt` cô đọng.
101
-
102
- Sau đó, bạn có thể thực thi kiểm định bất cứ lúc nào:
103
- ```bash
104
- # Kiểm định 9 Cổng Chất Lượng (DoD Quality Gates Gate 0–8)
105
- npx synapse-hub verify
21
+ Bạn có thể sử dụng Synapse Hub theo **2 cách cực kỳ linh hoạt**:
22
+ 1. 🛠️ **Dùng như CLI độc lập (Không cần AI):** Bạn chỉ cần gõ `npx synapse-hub lint` để kiểm tra test, nén log CI hoặc xuất kịch bản sang Excel mà không cần cài đặt phức tạp.
23
+ 2. 🧠 **Dùng như "Bộ Não Bảo Vệ" cho AI Coding:** Khi bạn dùng Cursor, Google Antigravity hay Claude Code, Synapse Hub đóng vai trò làm cẩm nang hướng dẫn ngầm — ngăn AI sinh ra test "pass ảo", bỏ qua ngoại lệ ngầm hay chèn sleep cố định.
106
24
 
107
- # Đánh giá sức khỏe toàn diện dự án (5-in-1 Project Health Report)
108
- npx synapse-hub analyze
25
+ > 🛡️ **Yên tâm:** Bạn **không cần học hay ghi nhớ** 38 kỹ năng hay 60 công cụ! Hệ thống hoạt động theo nguyên tắc tự kích hoạt khi cần (*On-Demand*), giúp bạn rảnh tay tập trung vào công việc chính.
109
26
 
110
- # Quét phát hiện mã giả, assertion rỗng (Fake-Pass AST Sentinel)
111
- npx synapse-hub lint
112
- ```
27
+ #### ⚖️ Trước & Sau khi có Synapse Hub bảo vệ:
28
+
29
+ | Khi để AI tự viết test (Chưa có Synapse) | Khi có Synapse Hub gác cổng 🛡️ |
30
+ | :--- | :--- |
31
+ | ❌ **Test "pass ảo":** Chạy xanh lè nhưng thực tế có **0 câu lệnh assert**, không kiểm tra gì cả. | ✅ **Phát hiện ngay trong 0.1s:** Báo lỗi test rỗng, yêu cầu bổ sung assertion kiểm tra logic thực tế. |
32
+ | ❌ **Dùng sleep cứng:** Chèn `sleep(5000)` vô tội vạ làm test chậm và thường xuyên tạch trên CI. | ✅ **Ép dùng Smart Wait:** Tự động phát hiện và hướng dẫn thay thế bằng smart wait ổn định 100%. |
33
+ | ❌ **Tràn context AI:** Log CI dài 20.000 dòng làm AI "loạn", tốn token mà không tìm ra lỗi. | ✅ **Nén sạch 95% log thừa:** Cô đọng lại đúng ~30 dòng stacktrace nguyên nhân gốc rễ. |
34
+ | ❌ **Thủng bảo mật:** AI vô tình commit lộ mật khẩu hoặc API token dạng plaintext. | ✅ **Chốt chặn Gate 6:** Quét và chặn đứng các chuỗi nhạy cảm trước khi đẩy lên Git. |
113
35
 
114
36
  ---
115
37
 
116
- ### 🥈 Cách 2: Tối Ưu Cho Antigravity — Cài Đặt 1 Lần Thành "Global Plugin"
117
- *Cài đặt 1 lần duy nhất: Kể từ đó **BẤT KỲ DỰ ÁN NÀO** mở trên Google Antigravity cũng tự động có sẵn toàn bộ 28 Skills và 6 Subagents mà không cần cấu hình thêm.*
38
+ ## ⚡ 1. Trải Nghiệm Nhanh Trong 60 Giây (3 Tính Năng Cốt Lõi 🚀)
118
39
 
119
- #### Bước cài đặt 1-Click:
120
- ```powershell
121
- # Trên Windows PowerShell:
122
- ./scripts/install_global_plugin.ps1
40
+ Không cần đọc hàng chục tài liệu hay cấu hình phức tạp. Bạn có thể sử dụng ngay 3 tính năng cốt lõi sau để giải quyết trực tiếp nỗi đau kiểm thử hàng ngày:
123
41
 
124
- # Trên macOS / Linux:
125
- ./scripts/install_global_plugin.sh
42
+ ### 🔍 1. Phát Hiện Test "Pass Ảo", Sleep Cố Định & Bỏ Qua Lỗi Ngầm
43
+ ```bash
44
+ npx synapse-hub lint ./tests
126
45
  ```
46
+ * **Vấn đề:** AI viết test thường tạo ra các bài test chạy pass bề ngoài nhưng không kiểm tra gì (0 assert), dùng `Thread.sleep` làm test chậm và flaky, hoặc dùng `try-catch` rỗng bỏ qua ngoại lệ ngầm.
47
+ * **Giải pháp:** Phân tích tĩnh heuristic & AST đa ngôn ngữ (Playwright TypeScript/JavaScript, Pytest Python, Cypress, Groovy/Katalon), phát hiện và báo lỗi ngay lập tức mà không tốn token gọi API LLM.
127
48
 
128
- *(Hoặc nếu chưa clone repo, chỉ cần clone thẳng vào thư mục plugin của Antigravity):*
49
+ ### 📊 2. Chuyển Kịch Bản Sang Bảng Excel Doanh Nghiệp Chuẩn 12 Cột
129
50
  ```bash
130
- git clone https://github.com/TeeVee998/Synapse-Hub.git "$HOME/.gemini/config/plugins/synapse-hub"
51
+ npx synapse-hub export-excel
131
52
  ```
53
+ * **Vấn đề:** Tester tốn nhiều giờ định dạng bảng tính Excel thủ công từ User Story hoặc kịch bản Markdown.
54
+ * **Giải pháp:** Chuyển đổi tự động kịch bản thành file Excel `.xlsx` chuẩn 12 cột, có sẵn ma trận rủi ro P × I, định dạng màu sắc chuyên nghiệp sẵn sàng gửi cho khách hàng và PM.
132
55
 
133
- **Sau khi cài đặt:**
134
- - Mở Google Antigravity lên, bạn sẽ thấy `synapse-hub` xuất hiện trong danh mục Plugins toàn cục.
135
- - Mở bất kỳ thư mục dự án nào, AI Agent cũng tự động nắm bắt toàn bộ năng lực kiểm thử của Synapse-Hub!
136
-
137
- ---
138
-
139
- ### 🥉 Cách 3: Truyền Thống — Mở Multi-Root Workspace trong IDE
140
- *Dành cho Core Developers muốn chỉnh sửa, mở rộng hoặc đóng góp phát triển thêm Skills/Tools cho Synapse-Hub.*
141
-
142
- 1. Mở IDE (Google Antigravity / Cursor / VS Code).
143
- 2. Mở thư mục dự án mục tiêu của bạn (`File -> Open Folder`).
144
- 3. Thêm thư mục `Synapse-Hub` vào Workspace (`File -> Add Folder to Workspace...`).
145
- 4. Chạy script bootstrap môi trường nội bộ:
146
- ```powershell
147
- # Windows PowerShell
148
- ./scripts/install.ps1
149
-
150
- # Linux / macOS
151
- ./scripts/setup.sh
56
+ ### 🧹 3. Nén 95% Log CI Thừa — Lấy Đúng Root Cause
57
+ ```bash
58
+ npx synapse-hub distill path/to/ci.log
152
59
  ```
60
+ * **Vấn đề:** Log build CI/CD dài hàng chục ngàn dòng làm tràn context của AI hoặc khiến kỹ sư mỏi mắt tìm dòng lỗi.
61
+ * **Giải pháp:** Lọc bỏ 95% nhiễu thông tin, cô đọng lại ~30 dòng chứa đúng stacktrace, mã lỗi và kịch bản thất bại.
153
62
 
154
- ---
155
-
156
- ## 👥 3. Hệ Thống Multi-Agent Swarm (6 Vai Trò Chuyên Biệt)
157
-
158
- Hub phân chia năng lực rõ ràng cho 6 vai trò Agent, mỗi Agent được gán sẵn các Skills và Tools tương ứng:
159
-
160
- | Vai Trò Agent | Trách Nhiệm Cốt Lõi | Skills Được Gán | Tools Đi Kèm |
161
- | :--- | :--- | :--- | :--- |
162
- | **`orchestrator`** | Trưởng nhóm điều phối, bootstrap dự án, audit sức khỏe, neo state. | `agent-orchestration-multi-agent-optimize`, `graphify-impact-analyzer`, `architecture-decision-records` | `tools/setup_project.py`, `tools/analyze_project.py`, `tools/project_state.py`, `tools/repo_map.py`, `tools/test_impact.py`, `tools/mcp_server.py` |
163
- | **`live-explorer`** | Thám sát live DOM/AOM qua Playwright, chặn click phá hoại. | `playwright-live-interaction`, `self-healing-locator`, `visual-regression-sentinel`, `auth-session-and-cookie-manager` | `tools/safety_firewall.py`, `tools/lookup_xpath.py`, `tools/visual_diff_canvas.py`, `tools/browser_helpers.js` |
164
- | **`pom-crafter`** | Kỹ sư Clean POM, kiểm tra API drift, sinh test từ User Story. | `clean-pom-crafter`, `lam-script-generator`, `synthetic-test-data-generator`, `api-spec-to-e2e-matrix`, `file-and-report-validator`, `db-state-verifier-and-seeder` | `tools/generate_tc_from_story.py`, `tools/generate_api_matrix.py`, `tools/api_drift_sentinel.py`, `tools/repo_map.py` |
165
- | **`test-runner`** | Quản lý chạy test headless CLI, chia tải thời gian chạy trên CI. | `katalon-cli-runner`, `e2e-testing-patterns`, `bats-testing-patterns`, `auth-session-and-cookie-manager`, `flaky-test-sentinel-and-quarantine` | `tools/matrix_sharder.py`, `tools/distill_log.py`, `tools/pinpoint_failure.py`, `tools/flaky_detector.py` |
166
- | **`failure-analyst`**| Tự động chẩn đoán lỗi, tính điểm tin cậy & tự tạo PR đối soát. | `failure-autopsy-and-healing`, `self-healing-locator`, `file-and-report-validator` | `tools/auto_heal.py`, `tools/heal_pr_automator.py`, `tools/pinpoint_failure.py`, `tools/cache_resolver.py` |
167
- | **`quality-gatekeeper`**| Gác cổng chất lượng 9 Gates DoD (Gate 0–8), quét Fake-Pass, bơm mutant. | `antigravity-test-sentinel`, `code-refactoring-refactor-clean`, `wcag-audit-patterns`, `web-vitals-and-performance-profiler`, `db-state-verifier-and-seeder`, `security-dast-sentinel`, `skillspector-security-guard` | `tools/verify_all.py`, `tools/infer_linter.py`, `tools/micro_mutator.py`, `tools/trace_data_flow.py`, `tools/wcag_audit.py`, `tools/lint_ai_docs.py`, `tools/skillspector.py` |
63
+ ### 💻 Giao Diện Terminal Thực Tế (Bắt Lỗi Trong 0.1s Không Tốn Token):
64
+ ```bash
65
+ $ npx synapse-hub lint ./tests
66
+
67
+ ======================================================================
68
+ ENTERPRISE STATIC DEFECT & FAKE-PASS SENTINEL
69
+ ======================================================================
70
+ Target Scope : 6 Test Scripts (Polyglot TS/Python/Groovy)
71
+ Detected Items:
72
+ - [CRITICAL] tests/checkout.spec.ts:42 - Fake-pass risk: Test contains 0 assertions!
73
+ - [CRITICAL] tests/login.spec.ts:14 - Hardcoded sleep (5000ms) detected. Replace with dynamic wait.
74
+ ======================================================================
75
+ Result: 2 anti-patterns flagged in 0.12s (Zero LLM tokens used).
76
+ ```
168
77
 
169
78
  ---
170
79
 
171
- ## 📦 4. Danh Mục 28 Kỹ Năng Chuẩn Hóa (.agents/skills/)
172
-
173
- | STT | Tên Kỹ Năng (Skill) | Phạm Vi Hoạt Động Cốt Lõi |
174
- |:---:|---|---|
175
- | 1 | `agent-orchestration-multi-agent-optimize` | Tối ưu hóa điều phối multi-agent, phân bổ tải và giám sát chi phí token. |
176
- | 2 | `antigravity-test-sentinel` | Gác cổng Verification-First, khóa hoàn thành task nếu test chưa pass exit code 0. |
177
- | 3 | `api-network-mocking-interception` | Chặn bắt, mock lưu lượng HTTP/GraphQL và kiểm thử độ bền mạng (Chaos/Resilience). |
178
- | 4 | `api-spec-to-e2e-matrix` | Phân tích OpenAPI/Swagger để sinh ma trận kiểm thử tương đương, biên và lỗi. |
179
- | 5 | `architecture-decision-records` | Soạn thảo và quản lý hồ sơ quyết định kiến trúc kỹ thuật (ADR). |
180
- | 6 | `auth-session-and-cookie-manager` | Quản lý phiên đăng nhập, JWT tokens, storageState cho đăng nhập 0-giây. |
181
- | 7 | `backend-load-and-stress-patterns` | Kiểm thử tải và stress backend với k6 & Locust, giám sát ngưỡng SLA P95/P99. |
182
- | 8 | `bats-testing-patterns` | Kiểm thử tự động Shell Scripts, CI/CD pipelines, mock binary CLI và exit code. |
183
- | 9 | `clean-pom-crafter` | Chuẩn hóa Clean Page Object Model, Flat Architecture, Dynamic `uniqueCode`. |
184
- | 10 | `code-refactoring-refactor-clean` | Tái cấu trúc code chuyên sâu, khử code smells, nợ kỹ thuật và chuẩn SOLID. |
185
- | 11 | `db-state-verifier-and-seeder` | Kiểm tra trạng thái DB trực tiếp (PostgreSQL, MySQL, MongoDB, Redis) và seed fixture. |
186
- | 12 | `e2e-testing-patterns` | Kiến trúc E2E đa trình duyệt (Playwright/Cypress), Typed POM, sharding song song. |
187
- | 13 | `failure-autopsy-and-healing` | Khám nghiệm tử thi lỗi cấp vĩ mô từ JUnit XML, Allure report và ảnh chụp lỗi. |
188
- | 14 | `file-and-report-validator` | Kiểm định nội dung file tải về/tải lên (Excel .xlsx, CSV stream, PDF text/layout). |
189
- | 15 | `flaky-test-sentinel-and-quarantine` | Phát hiện, chấm điểm và cô lập kiểm thử chập chờn (flaky test) vào vùng cách ly. |
190
- | 16 | `github-actions-templates` | Mẫu pipeline CI/CD GitHub Actions chuẩn sản xuất và sharded testing. |
191
- | 17 | `graphify-impact-analyzer` | Phân tích đồ thị tri thức AST Knowledge Graph và khoanh vùng ảnh hưởng thay đổi. |
192
- | 18 | `katalon-cli-runner` | Điều phối thực thi headless KRE CLI, Community mode và dọn dẹp zombie driver. |
193
- | 19 | `lam-script-generator` | Large Action Model, chuyển đổi User Story sang 100% test script không token replay. |
194
- | 20 | `playwright-live-interaction` | Thám sát trực tiếp live DOM/AOM qua Playwright MCP, kiểm tra hit-rate < 200ms. |
195
- | 21 | `security-dast-sentinel` | Kiểm thử bảo mật động DAST, rà soát OWASP Top 10, HTTP Headers, BOLA/IDOR. |
196
- | 22 | `self-healing-locator` | Tự phục hồi locator vi mô bằng cây Semantic Accessibility (AOM), Role > Label > TestId. |
197
- | 23 | `synthetic-test-data-generator` | Tự động sinh dữ liệu kiểm thử biên (BVT), chống SQLi/XSS, đa ngôn ngữ, tọa độ GIS. |
198
- | 24 | `token-and-context-optimizer` | Tối ưu token, lọc log rác, chống suy thoái ngữ cảnh (Lost-in-the-Middle) và scratchpad đĩa. |
199
- | 25 | `visual-regression-sentinel` | So sánh giao diện mức pixel và SSIM, hỗ trợ dynamic masking chống flaky test. |
200
- | 26 | `wcag-audit-patterns` | Kiểm toán tiếp cận web WCAG 2.2 Level A/AA tự động qua AST và `@axe-core`. |
201
- | 27 | `web-vitals-and-performance-profiler` | Đo lường Core Web Vitals (LCP, CLS, TTFB) và giám sát API endpoint chậm qua CDP. |
202
- | 28 | `skillspector-security-guard` | Kiểm toán bảo mật AI Agent skills & MCP configs với 71 vector lỗ hổng (Prompt Injection, Data Exfiltration, Privilege Escalation) theo chuẩn NVIDIA SkillSpector. |
80
+ ## 🚀 2. Khởi Động Nhanh & Lựa Chọn Cài Đặt (Onboarding Thân Thiện)
203
81
 
204
- ---
82
+ Synapse Hub tôn trọng sự riêng tư và cấu hình của bạn. Bạn luôn có toàn quyền kiểm soát những gì được ghi vào hệ thống:
205
83
 
206
- ## 📜 5. Danh Mục 8 Quy Tắc Cốt Lõi (.agents/rules/)
207
-
208
- 1. **`context-engineering.md`**: Giao thức lọc log thừa (Observation Masking), khai báo lười (Lazy Loading) và tối ưu hóa KV-Cache.
209
- 2. **`git-push-protocol.md`**: Giao thức Git Push chuẩn hóa cho dự án mục tiêu (Clean SCM by Architecture, loại bỏ hoàn toàn nhu cầu dual-remote/smart-push nhờ tách repo độc lập).
210
- 3. **`graphify.md`**: Điều hướng đồ thị tri thức mã nguồn AST thay vì đọc toàn văn mã nguồn lớn.
211
- 4. **`lessons-learned.md`**: Danh sách bài học kinh nghiệm và anti-patterns (giới hạn cứng < 40 dòng).
212
- 5. **`mandatory-playwright-live.md`**: Quy chuẩn chạy headless Full HD 1920x1080 và khảo sát live DOM trước khi codify.
213
- 6. **`skill-precedence.md`**: Thứ tự ưu tiên kỹ năng cục bộ, chống xung đột trigger với plugin bên ngoài.
214
- 7. **`systematic-debugging.md`**: Kỷ luật điều tra lỗi có căn cứ, cấm đoán mò và verify-first (9 Quality Gates DoD).
215
- 8. **`author-integrity-guard.md`**: Bảo toàn thông báo bản quyền tác giả theo giấy phép MIT và phòng chống đạo văn.
84
+ ```bash
85
+ # 🩺 Chẩn đoán môi trường hệ thống chỉ với 1 lệnh (Kiểm tra Node, Python, Chrome, Git):
86
+ npx synapse-hub doctor
216
87
 
217
- ---
88
+ # 💡 Mẹo: Cài đặt toàn cục để gõ trực tiếp không cần tiền tố npx (nhanh hơn & tiện hơn):
89
+ npm install -g synapse-hub
90
+ synapse-hub doctor
218
91
 
219
- ## 🛠️ 6. Sổ Tay 50+ Công Cụ Tự Động Hóa Chuyên Biệt (tools/ & scripts/)
220
-
221
- Chi tiết đầy đủ xem tại [tools/TOOLS_RUNBOOK.md](tools/TOOLS_RUNBOOK.md):
222
-
223
- - `tools/verify_all.py`: Cổng thẩm định 9 Gates DoD (Gate 0–8: UTF-8, No XPaths, UniqueCode, Clean POM, AST Mutation).
224
- - `tools/generate_jmx_plan.py`: Sinh kịch bản Apache JMeter 5.x (.jmx) đa giao thức (HTTP, JDBC, WS, gRPC, Kafka) kèm Traffic Shaping Pareto.
225
- - `tools/jtl_analyzer.py`: Phân tích kết quả JTL, kiểm soát SLA percentiles ($P_{90}, P_{95}, P_{99}$) và làm Quality Gate CI/CD.
226
- - `tools/telemetry_correlator.py`: Phân tích tương quan Pearson giữa Client Latency và Server APM (CPU, RAM, DB Pool).
227
- - `tools/export_postman_collection.py`: Xuất Postman Collection v2.1 với AJV JSON Schema, DDT, và Zero-Input synthesis.
228
- - `tools/newman_analyzer.py`: Phân tích kết quả Newman, triage lỗi assertion và làm Quality Gate cho API.
229
- - `tools/api_fuzzer.py`: Autonomous API Fuzzer phát hiện lỗi HTTP 500, rò rỉ stacktrace DB và vi phạm SLA độ trễ.
230
- - `tools/api_drift_sentinel.py`: Bắt breaking change giữa các phiên bản OpenAPI / Swagger specifications.
231
- - `tools/auto_heal.py`: Tự phục hồi locator gãy dựa trên AOM diffing mà không cần chạy lại toàn bộ test suite.
232
- - `tools/flaky_detector.py`: Phát hiện kiểm thử chập chờn (Flaky tests) và quản lý vòng đời cách ly Quarantine.
233
- - `tools/skillspector.py`: Quét kiểm toán an ninh AI Agent Skills & MCP (71 vectors theo chuẩn NVIDIA SkillSpector).
234
- - `tools/omni_transpiler.py`: Chuyển đổi mã kiểm thử 0-token đa ngôn ngữ (Playwright TS/Python, Java, Groovy, Cypress).
235
- - `tools/infer_linter.py`: Phân tích tĩnh AST phát hiện fake-pass (0 assertion) và khối try-catch nuốt lỗi.
236
- - `tools/test_impact.py`: Phân tích git diff và khoanh vùng chính xác test cases bị ảnh hưởng.
237
- - `tools/cache_resolver.py`: Quản lý bộ nhớ đệm lỗi SQLite trung tâm (`~/.agent_memory/global_cache.db`).
238
- - `tools/distill_log.py`: Lọc bỏ 95% log thừa từ CLI/Gradle/KRE, giữ lại stacktrace và file pointer.
239
- - `tools/agent_canary.py`: Hệ thống tiêm 8 vector lỗi tự động đánh giá sức phục hồi của Agent (MTTR).
240
- - `tools/repo_map.py`: Trích xuất bản đồ cấu trúc hàm và Page Class siêu nén (~500 tokens).
241
- - `tools/visual_diff_canvas.py`: So sánh pixel/SSIM cho màn hình GIS/Canvas không có DOM.
242
- - `tools/wcag_audit.py`: Quét kiểm toán tự động các tiêu chí tiếp cận WCAG 2.2 Level A/AA.
243
- - `tools/generate_api_matrix.py`: Tự động sinh ma trận kiểm thử Positive/Boundary/Negative từ Swagger.
244
- - `tools/generate_tc_from_story.py`: Large Action Model parser sinh khung Clean POM từ User Story.
245
- - `tools/trace_data_flow.py`: Kiểm tra luồng dữ liệu kiểm thử, phát hiện rác dữ liệu DB (Orphan Data).
246
- - `scripts/install.ps1` & `scripts/setup.sh`: Script cài đặt 1-click tự động khởi tạo môi trường Hub.
247
- - `scripts/lint_skills.ps1`: Linter kiểm tra tính toàn vẹn 28 skills và metadata manifest.
248
- - `pyproject.toml` & `tools/cli.py`: Đóng gói chuẩn PEP 621 cho lệnh CLI toàn cầu `agent-qa`.
92
+ # 🔹 Cách 1: Cấu hình chỉ trong dự án hiện tại (An toàn nhất, không can thiệp vào ~/.gemini)
93
+ npx synapse-hub setup --local-only
249
94
 
250
- ---
95
+ # 🔹 Cách 2: Xem trước các thay đổi giả lập (Dry-Run, không ghi đè bất kỳ file nào)
96
+ npx synapse-hub setup --dry-run
251
97
 
252
- ## 📚 7. Tài Liệu Kỹ Thuật Mở Rộng & CLI Package (docs/)
98
+ # 🔹 Cách 3: Cài đặt đầy đủ (Tạo PROJECT_AI_GUIDE.md, AI Bridges và Plugin toàn cục)
99
+ npx synapse-hub setup
253
100
 
254
- 1. **[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)**: Kiến trúc Hub/Spoke, mô hình 4 tầng kỹ năng, và ma trận phối hợp 6 Subagent Swarm.
255
- 2. **[docs/CONTRIBUTING.md](docs/CONTRIBUTING.md)**: Quy chuẩn đóng góp, nguyên tắc sáng tạo skill mới và quy trình kiểm định toàn vẹn.
256
- 3. **[docs/CLI_REFERENCE.md](docs/CLI_REFERENCE.md)**: Cẩm nang tra cứu toàn bộ tham số lệnh của công cụ dòng lệnh `agent-qa`.
101
+ # 🔹 Gỡ cài đặt hoàn toàn bất kỳ lúc nào:
102
+ npx synapse-hub uninstall
103
+ ```
257
104
 
258
- ### Cài đặt nhanh CLI Package:
105
+ ### Chạy kiểm định 9 Cổng Chất Lượng (DoD Gates):
259
106
  ```bash
260
- pip install -e .
261
- agent-qa --help
262
- agent-qa verify
263
- agent-qa lint
107
+ npx synapse-hub verify # Kiểm tra 9 Cổng Chất Lượng DoD (Gate 0–8)
108
+ npx synapse-hub analyze # Báo cáo sức khỏe dự án (PROJECT_HEALTH_REPORT.md)
264
109
  ```
265
110
 
266
- ---
267
-
268
- ## 🤝 8. Nguồn Cảm Hứng & Lời Cảm Ơn (Acknowledgments & Inspirations)
269
-
270
- Dự án **Synapse Hub** được tổng hợp, kế thừa và phát triển dựa trên tinh thần mã nguồn mở và những ý tưởng đột phá từ các kho lưu trữ xuất sắc của cộng đồng kỹ nghệ phần mềm & AI:
271
-
272
- | Dự án & Tác giả | Nguồn cảm hứng & Đóng góp kiến trúc trong Synapse Hub |
273
- | :--- | :--- |
274
- | **[muratcankoylan/Agent-Skills-for-Context-Engineering](https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering)** | Nguyên lý Context Engineering, Observation Masking và kỹ thuật tối ưu hóa sự chú ý của LLM. |
275
- | **[alexgreensh/token-optimizer](https://github.com/alexgreensh/token-optimizer)** | Cơ chế cô đọng log CLI/Gradle (95% distillation) và tối ưu hóa KV-Cache. |
276
- | **[obra/superpowers](https://github.com/obra/superpowers)** *(Jesse Vincent)* | Kỷ luật gỡ lỗi dựa trên bằng chứng (Systematic Debugging), Cognitive Forcing và cơ chế Red-Team vs Blue-Team. |
277
- | **[Aider-AI/aider](https://github.com/Aider-AI/aider)** *(Paul Gauthier)* | Kỹ thuật trích xuất AST bản đồ mã nguồn thu gọn (`tools/repo_map.py`) dưới 600 tokens. |
278
- | **[lavague-ai/LaVague](https://github.com/lavague-ai/LaVague)** | Mô hình Large Action Model (LAM), tự động biên dịch User Story thành kịch bản kiểm thử Clean POM. |
279
- | **[facebook/infer](https://github.com/facebook/infer)** *(Meta Infer)* | Linter phân tích tĩnh AST (`tools/infer_linter.py`) phát hiện test giả lập (Fake-Pass) và try-catch nuốt lỗi. |
280
- | **[microsoft/playwright](https://github.com/microsoft/playwright)** | Tương tác live DOM/AOM sub-200ms, điều hướng headless và mô phỏng network resilience. |
281
- | **[dequelabs/axe-core](https://github.com/dequelabs/axe-core)** | Quy chuẩn kiểm toán tự động các tiêu chí khả năng tiếp cận WCAG 2.2 Level A/AA. |
282
- | **[bats-core/bats-core](https://github.com/bats-core/bats-core)** | Chuẩn kiểm thử tự động Bash Automated Testing System cho kịch bản shell/CLI. |
283
- | **[npryce/adr-tools](https://github.com/npryce/adr-tools)** | Quy chuẩn ghi nhận và lưu vết quyết định kiến trúc phần mềm (ADRs). |
284
-
285
- ---
286
-
287
- ## 📄 9. Bản Quyền & Điều Khoản Sử Dụng (License & Attribution)
111
+ ### 🔄 Tích hợp CI/CD & Pre-commit Hook trong 3 dòng:
112
+ Tự động chặn test pass ảo và code kém chất lượng trước khi merge PR:
288
113
 
289
- Dự án được phân phối chính thức dưới giấy phép **[MIT License](LICENSE)**.
114
+ ```yaml
115
+ # Cách 1: Sử dụng GitHub Action chính thức (action.yml)
116
+ - name: Run Synapse Hub Quality Gates
117
+ uses: TeeVee998/Synapse-Hub@v2
118
+ with:
119
+ mode: 'target'
120
+ format: 'sarif'
290
121
 
291
- **Quyền sở hữu tác giả & Xuất xứ (Provenance):**
292
- - **Tác giả & Nhà sáng lập:** Thế Vị ([@TeeVee998](https://github.com/TeeVee998))
293
- - **Mã nguồn gốc:** [https://github.com/TeeVee998/Synapse-Hub](https://github.com/TeeVee998/Synapse-Hub)
294
- - **Bản quyền:** Copyright © 2026 Thế Vị (@TeeVee998). Phân phối theo giấy phép MIT.
122
+ # Cách 2: Chạy trực tiếp qua NPX (GitLab CI / Bitbucket Pipelines / Jenkins)
123
+ - name: Run Synapse Hub Quality Gates
124
+ run: npx synapse-hub verify
125
+ ```
295
126
 
296
- > ⚖️ **Điều khoản phân phối theo giấy phép MIT:** Bạn được toàn quyền sử dụng, sao chép, sửa đổi, hợp nhất, xuất bản và phân phối mã nguồn này cho bất kỳ mục đích cá nhân hay thương mại nào, **VỚI ĐIỀU KIỆN** thông báo bản quyền gốc ghi nhận tác giả **Thế Vị (@TeeVee998)** cùng điều khoản cấp phép này phải được giữ nguyên vẹn trong toàn bộ bản sao hoặc các phần quan trọng của phần mềm.
127
+ ```yaml
128
+ # Tích hợp Pre-commit hook (.pre-commit-config.yaml):
129
+ repos:
130
+ - repo: https://github.com/TeeVee998/Synapse-Hub
131
+ rev: v2.4.0
132
+ hooks:
133
+ - id: synapse-lint
134
+ - id: synapse-verify
135
+ ```
136
+ *(Cấu hình linh hoạt qua file `synapse.config.json` ở thư mục gốc. Xem hướng dẫn chi tiết tại [docs/CI_CD_INTEGRATION.md](docs/CI_CD_INTEGRATION.md)).*
137
+
138
+ | Cổng | Tên cổng kiểm soát | Mục tiêu kiểm định thực tế |
139
+ | :---: | :--- | :--- |
140
+ | **Gate 0** | **Bảo Toàn Tác Quyền & MIT** | Xác thực nguồn gốc tác quyền Thế Vị (@TeeVee998) theo MIT License. |
141
+ | **Gate 1** | **Mã Hóa UTF-8 No BOM** | Quét sạch 100% byte BOM và lỗi vỡ ký tự font chữ trên toàn repository. |
142
+ | **Gate 2** | **Đường Dẫn Linh Hoạt (Portability)** | Không gắn cứng đường dẫn máy cá nhân (`/Users/...`, `C:\...`), đảm bảo chạy mượt trên mọi môi trường. |
143
+ | **Gate 3** | **Kiến Trúc Clean POM Phẳng** | Đóng gói 100% locator vào Page Class, cấm raw XPath/CSS trong kịch bản test. |
144
+ | **Gate 4** | **Chống Lệch Tài Liệu AI (Anti-Drift)** | Đối chiếu AST thực tế với `PROJECT_AI_GUIDE.md`, loại bỏ PageClass ảo. |
145
+ | **Gate 5** | **Danh Sách Đen File Tạm** | Chặn rò rỉ file rác (`*.tmp`, memory dump, cache thừa) làm bẩn workspace. |
146
+ | **Gate 6** | **Bảo Vệ Bí Mật & Mật Khẩu** | Quét chặn plaintext password, private keys hoặc API token lưu cứng trong code. |
147
+ | **Gate 7** | **Quét Lỗi Tĩnh & Bắt Test Pass Ảo** | Tự động phát hiện test 0 assertion, try-catch bỏ qua ngoại lệ ngầm, sleep cố định (≥ 3000ms) và unawaited expect. |
148
+ | **Gate 8** | **Đo Độ Nhạy Assert (Micro-Mutation)** | Đảm bảo các câu lệnh assert bắt được lỗi thật khi code bị biến đổi (Yêu cầu điểm ≥ 80%). |
297
149
 
298
150
  ---
299
151
 
300
- # 🌐 English Edition
152
+ ## 🎯 3. Lộ Trình Theo Trình Độ (Tailored For Every Level)
301
153
 
302
- # 🧠 Synapse Hub — AI Agent Intelligence Core & Skill Network
154
+ | Trình độ | Điều bạn cần | Điểm chạm phù hợp trong Synapse Hub |
155
+ | :--- | :--- | :--- |
156
+ | **Fresher / Junior** | Học nhanh, ra việc ngay, hiểu vì sao test yếu | • `npx synapse-hub export-excel`: Tạo test case chuẩn chỉnh.<br/>• `npx synapse-hub lint ./tests`: Giải thích vì sao assert yếu hoặc pass ảo.<br/>• Tham khảo mẫu Clean POM chuẩn trong `examples/practices/`. |
157
+ | **Mid-Level** | Bớt flaky, giảm chi phí bảo trì locator | • `npx synapse-hub flaky scan ./tests`: Dò tìm test chập chờn và phân nhóm cách ly.<br/>• `npx synapse-hub heal`: Gợi ý thay thế locator hỏng qua phân tích cây AOM.<br/>• Tích hợp linter vào pre-commit hook. |
158
+ | **Senior / Lead** | Đo lường, kiểm soát chất lượng, an toàn CI/CD | • `npx synapse-hub verify`: 9 Cổng chất lượng DoD tự động trong CI.<br/>• `npx synapse-hub mutate ./tests`: Kiểm tra độ nhạy của assertion trước khi merge PR.<br/>• Báo cáo chuẩn Markdown/JSON dễ dàng gắn vào GitHub Actions/GitLab CI. |
303
159
 
304
- > **The shared intelligence core and autonomous skill hub empowering AI coding assistants (Google Antigravity / Cursor / Windsurf / Claude Code) across automated testing suites.**
305
- > **Author:** Thế Vị ([@TeeVee998](https://github.com/TeeVee998))
306
- > **Hub Version:** `v2.2.4` (Semantic Versioning) | **Integrity Index:** 28 Skills, 6 Agent Swarm Roles, 8 Core Rules, 50+ Specialized Python Tools, 9 Quality Gates.
160
+ > *Mẹo tiện dụng: Nếu bạn đã cài đặt toàn cục (`npm i -g synapse-hub`), bạn có thể gõ ngắn gọn `synapse-hub <lệnh>` hoặc các bí danh `synapse`, `agent-qa`.*
307
161
 
308
162
  ---
309
163
 
310
- ## 🌟 1. Overview & Architectural Purpose
311
-
312
- **Synapse Hub** serves as a **Decoupled Shared Intelligence Core**, acting as an external neural brain completely isolated from target projects' codebases. It equips AI agents with specialized swarm roles, self-healing execution protocols, AST-level code intelligence, and strict Quality Gates—enabling zero-leakage, truth-anchored test automation across any polyglot codebase without polluting target repositories.
164
+ ## 💎 4. Kiến Trúc & Các Trụ Cột Kỹ Thuật
313
165
 
314
166
  ```mermaid
315
167
  flowchart TD
316
- subgraph Hub["🧠 Synapse Hub (Intelligence Core v2.2.4)"]
317
- Skills[".agents/skills/ (28 Skills)"]
168
+ subgraph Hub["🧠 Synapse Hub (Core v2.4.0)"]
169
+ Skills[".agents/skills/ (38 Skills)"]
318
170
  Agents[".agents/agents/ (6 Specialized Roles)"]
319
- Rules[".agents/rules/ (8 Core Rules)"]
320
- Tools["tools/ (50+ Universal Python Tools)"]
321
- Workflows[".agents/workflows/"]
171
+ Rules[".agents/rules/ (11 Core Rules)"]
172
+ Tools["tools/ (60+ Universal Python Tools)"]
173
+ Workflows[".agents/workflows/ (10 Workflows)"]
322
174
  end
323
175
 
324
- subgraph ChatSession["💬 AI Agent Workspace / Chat Session"]
325
- Hub -->|Mount/Add Workspace| ChatSession
176
+ subgraph ChatSession["💬 AI Agent Workspace / IDE"]
177
+ Hub -->|Mount / Plugins| ChatSession
326
178
  end
327
179
 
328
- subgraph Projects["📁 Target Projects"]
329
- ProjectA["Project A<br/>(PROJECT_AI_GUIDE.md + Source Code)"]
330
- ProjectB["Project B<br/>(PROJECT_AI_GUIDE.md + Test Code)"]
331
- ProjectC["Project C<br/>(PROJECT_AI_GUIDE.md + App Code)"]
332
- Other["Other Projects..."]
180
+ subgraph Projects["📁 Dự Án Kiểm Thử Mục Tiêu"]
181
+ ProjectA["Playwright (TS/JS)"]
182
+ ProjectB["Pytest (Python)"]
183
+ ProjectC["Cypress / Katalon"]
333
184
  end
334
185
 
335
- ProjectA -->|Mount Workspace| ChatSession
336
- ProjectB -.->|Mount Workspace| ChatSession
337
- ProjectC -.->|Mount Workspace| ChatSession
338
- Other -.->|Mount Workspace| ChatSession
186
+ ProjectA -->|Verify & Lint| ChatSession
187
+ ProjectB -->|Verify & Lint| ChatSession
188
+ ProjectC -->|Verify & Lint| ChatSession
339
189
  ```
340
190
 
341
- ### 💎 Breakthrough Architectural Benefits:
342
-
343
- #### 1. 🧠 Deep System-2 Reasoning & Cognitive Forcing
344
- * **Eliminates "Unconscious Autocomplete":** When diagnosing failures or generating tests, the AI agent is strictly barred from speculative guesswork and **forced through a 4-step System-2 reasoning pipeline**:
345
- 1. *Boundary & Invariant Extraction:* What must never happen under any circumstance?
346
- 2. *Popper Falsification Hypotheses:* Formulate 3 distinct code mutation scenarios where a naive test passes while the software is broken (False Negatives).
347
- 3. *Self-Debate:* Formulate concrete proof showing why the prospective assertion will definitively catch all 3 defect vectors.
348
- 4. *Defensive Code Synthesis:* Emit code only after passing all 3 analytical gates.
349
- * **Adversarial Red-Team vs. Blue-Team Self-Play:** Automatically injects AST micro-mutants (`tools/micro_mutator.py`) into test suites to verify fault detection power, requiring **Mutation Score $\ge 80\%$** before task approval.
350
-
351
- #### 2. ⚡ Radical Token Optimization (85% – 95% Context Cost Reduction)
352
- * **Log Distillation (95% Token Savings):** `tools/distill_log.py` automatically purges 95% of verbose CLI/Gradle/Playwright stdout, preserving only ~10 lines of root-cause exceptions and pointers (< 50 tokens) instead of dumping 3,000 noise lines.
353
- * **AST Repo Mapping (90% Code Reading Savings):** `tools/repo_map.py` compresses 500+ method signatures into a clean AST map (< 600 tokens). Agents discover classes and helpers without ever reading 4,000-line source files (preventing "Context Window Blowouts").
354
- * **Compact AOM (90% HTML Savings):** Replaces raw 50,000-line HTML DOM dumps with compact Accessible Object Model (AOM) subtrees (< 500 tokens).
355
- * **Zero-Token Episodic SQLite Memory:** Errors and healing patches are recorded and resolved offline in `~/.agent_memory/global_cache.db` via cosine similarity at **0 context tokens**.
356
- * **Anti-Degradation ("Context Rot" & "Lost-in-the-Middle"):** Preserves model reasoning sharpness and prevents hallucinations even during long sessions exceeding 100,000 tokens.
357
-
358
- #### 3. 📊 Quantitative Performance Benchmark:
359
-
360
- | Evaluation Metric | Naive AI Coding Prompting | With Synapse Hub 🧠 |
361
- | :--- | :---: | :---: |
362
- | **Tokens Consumed per Bug Fix** | 15,000 – 40,000 tokens *(dumps entire classes & logs)* | **300 – 800 tokens (> 90% Savings)** |
363
- | **Fake-Pass Rate (0 asserts, false passes)** | 30% – 50% *(LLMs tend to relax asserts)* | **0% (Locked by Truth Anchor & 9 DoD Gates)** |
364
- | **Cross-Session Fix Memory** | 100% forgotten upon new chat session | **Persistent via SQLite Central Cache (0 token)** |
365
- | **Context Rot / Lost-in-the-Middle** | High degradation after 40k – 60k tokens | **Immune via 3-Tier Progressive Disclosure** |
366
- | **Mean Time-to-Heal (MTTR)** | 5 – 15 minutes of trial-and-error | **< 1 second (Direct cache resolution)** |
367
-
368
- *(Note: 300–800 tokens represents the dynamic micro-turn execution payload achieved via repo_map and distill_log, excluding the one-time IDE system rules prefix overhead of ~7,000 tokens).*
369
-
370
- ---
371
-
372
- ## 🚀 2. Getting Started & Integration (3 Approaches)
191
+ ### 🧠 Trụ cột 1: Chống Pass Ảo & Kiểm Tra Độ Nhạy Assertion (Heuristic)
192
+ - **Static Defect Sentinel (`tools/infer_linter.py`):** Dò tìm các mẫu phản quy chuẩn (anti-patterns) như test thiếu assertion, catch bỏ qua ngoại lệ ngầm, sleep cố định, unawaited Playwright assertions. Đạt độ chính xác cao trên tập benchmark mẫu.
193
+ - **Assertion Sensitivity Sentinel (`tools/micro_mutator.py`):** Tiêm đột biến cú pháp nhẹ (đảo toán tử so sánh, đảo logic boolean) để kiểm tra xem các assertion bên dưới có bắt được lỗi hay không. Bắt buộc độ nhạy assertion ≥ 80% để pass Gate 8.
373
194
 
374
- [![npm version](https://img.shields.io/npm/v/synapse-hub.svg?style=flat-square&color=blue)](https://www.npmjs.com/package/synapse-hub)
375
- [![node version](https://img.shields.io/badge/node-%3E%3D16.0.0-brightgreen.svg?style=flat-square)](https://nodejs.org)
376
- [![license](https://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](https://github.com/TeeVee998/Synapse-Hub/blob/main/LICENSE)
195
+ ### ⚡ Trụ cột 2: Tối Ưu Hóa Ngữ Cảnh & Tiết Kiệm Token
196
+ - **Lọc Log Thông Minh (`tools/distill_log.py`):** Rút gọn log CI cồng kềnh, đưa đúng thông tin stacktrace vào context của LLM.
197
+ - **AST Method Mapping (`tools/repo_map.py`):** Quét chữ ký hàm và cấu trúc lớp Page Object vào bản đồ nén < 600 tokens; agent không cần đọc toàn bộ mã nguồn lớn.
198
+ - **Bộ Nhớ Lỗi Cục Bộ (`tools/cache_resolver.py`):** Lưu trữ kinh nghiệm sửa lỗi ngoại tuyến vào SQLite tại `~/.agent_memory/global_cache.db` (truy xuất 0 token).
377
199
 
378
200
  ---
379
201
 
380
- ### ⚡ Instant All-in-One Setup: Single NPX Command (Zero-Clone 🚀)
381
- *All-in-one execution: **NO git cloning**, **NO multi-root workspace setup**, configures the target project **AND automatically injects into Antigravity Global Plugin**.*
382
-
383
- Run directly from your **target automation project root**:
384
- ```bash
385
- npx synapse-hub setup
386
- ```
387
- 👉 **This single command automatically completes everything in 5 seconds:**
388
- 1. 🧠 **Injects Antigravity Global Plugin:** Deploys Synapse-Hub into `~/.gemini/config/plugins/synapse-hub`. From this moment on, **ALL projects** opened in Google Antigravity automatically inherit all 28 Skills and 6 Subagent profiles!
389
- 2. 🌐 **Universal AI Bridges Deployment:** Automatically generates tailored configuration rules for all leading AI IDEs and assistants:
390
- - 🖱️ **Cursor:** `.cursor/rules/synapse-qa.mdc`
391
- - 🤖 **Claude Code:** `CLAUDE.md`
392
- - 🐙 **GitHub Copilot:** `.github/copilot-instructions.md`
393
- - 🏄 **Windsurf (Cascade):** `.windsurfrules`
394
- *(Empowers team members across Antigravity, Cursor, Claude Code, Copilot, or Windsurf to enforce the exact same Clean POM architecture, Truth Anchor, and 9 Quality Gates DoD (Gate 0–8)!)*
395
- 3. 🔍 **Tech Stack Detection:** Auto-detects Playwright TypeScript/JS, Katalon Groovy, Cypress, or Pytest.
396
- 4. 📋 **Project AI Guide Synthesis:** Generates `PROJECT_AI_GUIDE.md` so AI assistants strictly adhere to project workflows.
397
- 5. 🛡️ **Zero-Leakage Git Pre-Push Hook:** Installs `.git/hooks/pre-push` invoking `npx synapse-hub verify` before any git push.
398
- 6. 💾 **Central Agent Memory Initialization:** Seeds offline SQLite healing memory at `~/.agent_memory/global_cache.db` (0 token cost).
399
- 7. 🗺️ **AST Architecture Mapping:** Scans project methods and exports condensed context map (`repo_map.txt`).
400
-
401
- Run verification anytime:
402
- ```bash
403
- # Run 9 Quality Gates DoD Verification (Gate 0–8)
404
- npx synapse-hub verify
405
-
406
- # Comprehensive 5-in-1 Project Health Audit
407
- npx synapse-hub analyze
408
-
409
- # Static Defect & Fake-Pass Sentinel scan
410
- npx synapse-hub lint
411
- ```
202
+ ## ⚖️ 5. So Sánh Minh Bạch & Giới Hạn Kỹ Thuật Đã Biết (Comparison & Limitations)
203
+
204
+ ### 📊 Bảng so sánh với các công cụ hiện có trong ngành
205
+
206
+ | Tiêu chí / Giải pháp | ESLint Plugin (Playwright) | Stryker Mutator | Allure Report | Healenium | Synapse Hub 🧠 |
207
+ | :--- | :---: | :---: | :---: | :---: | :---: |
208
+ | **Phạm vi ngôn ngữ** | Chỉ JS / TS | JS / TS, C#, Scala | Mọi ngôn ngữ (nhận XML) | Java / Python / C# (Selenium) | **Đa ngôn ngữ** (TS/JS, Python, Groovy, Java) |
209
+ | **Tích hợp sâu trong Agent Context** | ❌ (Chỉ chạy CLI/IDE) | ❌ (Chạy độc lập) | ❌ (Viewer sau test) | ❌ (Proxy trung gian) | ✅ **NATIVE** (Rule, MCP, Prompt Context, 6 Subagents) |
210
+ | **Diệt Fake-Pass do AI sinh ra** | ⚠️ Hạn chế (chỉ check lint cú pháp) | ❌ Không (chỉ đột biến code app) | ❌ Không | ❌ Không | ✅ **Chuyên biệt** (AST nhận diện 0 assert, try-catch bỏ qua ngoại lệ ngầm, tautology) |
211
+ | **Thời gian chạy Mutation Check** | N/A | ⏱️ Chậm (vài phút đến hàng giờ) | N/A | N/A | ⚡ **Siêu tốc (~0.1s)** với AST Micro-Mutator trước khi commit |
212
+ | **Tự chữa Locator (Self-Healing)** | ❌ | ❌ | ❌ | ⚠️ Cần Server JVM + Docker proxy | ⚡ **Nhẹ (< 500 tokens)** dựa trên AOM Diffing trong luồng Agent |
213
+ | **Tiết kiệm Token & Lọc Log CI** | ❌ | ❌ | ❌ | ❌ | ✅ **Cắt giảm 95%** log thừa (`distill_log.py`, `repo_map.py`) |
214
+ | **Bảo vệ chuẩn kiến trúc Clean POM** | ❌ | ❌ | ❌ | ❌ | ✅ **Bắt buộc Clean POM**, Flat Architecture, cấm selector trong script |
215
+
216
+ ### ⚠️ Giới hạn kỹ thuật đã biết (Known Limitations)
217
+
218
+ Để duy trì tính minh bạch kỹ thuật (**Truth Anchor**), Synapse Hub công khai các giới hạn thực tế:
219
+
220
+ 1. **Kiểm tra độ nhạy Assert qua AST tĩnh (Không phải Mutation Testing toàn diện runtime):**
221
+ Công cụ `tools/micro_mutator.py` sử dụng phương pháp phân tích cú pháp tĩnh siêu nhanh (~0.1s) để kiểm tra xem câu lệnh assert có bắt được lỗi khi mã bị sửa đổi hay không. Nó giúp bạn phát hiện ngay các assert "vô thưởng vô phạt" mà không làm chậm máy, nhưng **không thay thế** các công cụ kiểm thử đột biến cấp runtime biên dịch (như Stryker cho JS/TS hoặc mutmut cho Python). Khi dự án yêu cầu báo cáo Mutation Testing chuẩn công nghiệp cho toàn bộ runtime, hãy sử dụng các công cụ chuyên dụng tương ứng.
222
+ 2. **Số Liệu Kiểm Chứng & Benchmark Thực Nghiệm (`benchmarks/qa_eval`):**
223
+ Kết quả đo kiểm trên 25 thử thách thực tế đa ngôn ngữ (Groovy, TypeScript, Python, Java) đạt:
224
+ - **Tỷ lệ giải quyết tự động:** 25 / 25 thử thách (100.0%).
225
+ - **Chi phí Token trung bình:** 76.2 tokens / bug (tiết kiệm 95% ngữ cảnh so với quét toàn bộ repo).
226
+ - **Độ nhạy kiểm thử đột biến (Mutation Score):** 100.0% mutant bị bắt hạ.
227
+ - **Độ chính xác Fake-Pass Sentinel (`infer_linter.py`):** **100.0% Precision** (0 báo động giả), **95.7% Recall**, **97.8% F1-Score** trên 51 mẫu corpus độc lập.
228
+ 3. **Phạm Vi Hỗ Trợ Framework & Công Nghệ:**
229
+ Hệ thống cung cấp runner và adapter trực tiếp cho **Playwright, Pytest, Katalon Studio/Groovy, và Cypress**. Đối với **Selenium WebDriver**, hệ thống hỗ trợ chuẩn kiến trúc Clean POM, smart-wait patterns và universal IR transpilation; người dùng có thể áp dụng cấu trúc này vào các dự án Selenium hiện có.
230
+ 4. **Môi Trường Runtime Khuyến Nghị:**
231
+ - Node.js: `>= 18.0.0` (Khuyến nghị Node.js 20 hoặc 22 LTS).
232
+ - Python: `>= 3.9` (Khuyến nghị Python 3.10+; hỗ trợ đầy đủ Python 3.10, 3.11, 3.12, 3.13).
233
+ 5. **Yêu Cầu Môi Trường Headless Browser:**
234
+ Các tính năng khảo sát trực tiếp live DOM/AOM và self-healing locator yêu cầu môi trường có cài đặt trình duyệt headless (như Playwright Chromium) để trích xuất cây khả năng truy cập (Accessibility Object Model).
412
235
 
413
236
  ---
414
237
 
415
- ### 🥈 Method 2: Antigravity-Native — Install Once as Global Plugin
416
- *Install once: From that moment onward, **ANY project** opened in Google Antigravity automatically inherits all 28 Skills and 6 Subagent Swarm profiles.*
417
-
418
- #### 1-Click Plugin Installation:
419
- ```powershell
420
- # On Windows PowerShell:
421
- ./scripts/install_global_plugin.ps1
238
+ ## 👥 6. Hệ Thống Multi-Agent Swarm (6 Vai Trò Chuyên Biệt)
422
239
 
423
- # On macOS / Linux:
424
- ./scripts/install_global_plugin.sh
425
- ```
426
-
427
- *(Or clone directly into Antigravity's Global Plugins folder):*
428
- ```bash
429
- git clone https://github.com/TeeVee998/Synapse-Hub.git "$HOME/.gemini/config/plugins/synapse-hub"
430
- ```
431
-
432
- **Result:**
433
- - Google Antigravity registers `synapse-hub` globally.
434
- - Every workspace session automatically loads the complete QA intelligence core without manual workspace mounts!
435
-
436
- ---
437
-
438
- ### 🥉 Method 3: Multi-Root Workspace Mounting
439
- *For Core Developers looking to extend, customize, or contribute new Skills and Tools directly to Synapse-Hub.*
440
-
441
- 1. Open your AI IDE (Google Antigravity / Cursor / VS Code).
442
- 2. Open your target test project (`File -> Open Folder`).
443
- 3. Add `Synapse-Hub` to your workspace (`File -> Add Folder to Workspace...`).
444
- 4. Run the local environment bootstrap script:
445
- ```powershell
446
- # Windows PowerShell
447
- ./scripts/install.ps1
448
-
449
- # Linux / macOS
450
- ./scripts/setup.sh
451
- ```
452
- The bootstrap script automatically configures `.venv`, installs dependencies, lints skills, and seeds initial solutions into the Central SQLite Agent Memory (`~/.agent_memory/global_cache.db`).
453
-
454
- > 💡 **Initializing SQLite Memory on Clean CI/CD & Docker:**
455
- > In fresh CI runners or Docker containers, initialize zero-token memory cache via:
456
- > ```bash
457
- > agent-qa heal init
458
- > # or run directly:
459
- > python tools/cache_resolver.py init
460
- > ```
461
-
462
- ---
463
-
464
- ## 👥 3. Multi-Agent Swarm System (6 Specialized Roles)
465
-
466
- Synapse Hub clearly partitions capabilities across 6 specialized AI roles, pre-configured with dedicated skills and tools:
467
-
468
- | Agent Role | Core Responsibility | Assigned Skills | Included Tools |
240
+ | Vai Trò Subagent | Trách Nhiệm Cốt Lõi | Kỹ Năng Tiêu Biểu | Công Cụ Đi Kèm |
469
241
  | :--- | :--- | :--- | :--- |
470
- | **`orchestrator`** | Lead coordinator, project bootstrapping, health auditing, state anchoring. | `agent-orchestration-multi-agent-optimize`, `graphify-impact-analyzer`, `architecture-decision-records` | `tools/setup_project.py`, `tools/analyze_project.py`, `tools/project_state.py`, `tools/repo_map.py`, `tools/test_impact.py`, `tools/mcp_server.py` |
471
- | **`live-explorer`** | Live DOM/AOM probing via Playwright MCP, destructive click firewall. | `playwright-live-interaction`, `self-healing-locator`, `visual-regression-sentinel`, `auth-session-and-cookie-manager` | `tools/safety_firewall.py`, `tools/lookup_xpath.py`, `tools/visual_diff_canvas.py`, `tools/browser_helpers.js` |
472
- | **`pom-crafter`** | Clean POM engineer, API drift detection, User Story to test generation. | `clean-pom-crafter`, `lam-script-generator`, `synthetic-test-data-generator`, `api-spec-to-e2e-matrix`, `file-and-report-validator`, `db-state-verifier-and-seeder` | `tools/generate_tc_from_story.py`, `tools/generate_api_matrix.py`, `tools/api_drift_sentinel.py`, `tools/repo_map.py` |
473
- | **`test-runner`** | Headless CLI suite manager, CI parallel sharding and log distillation. | `katalon-cli-runner`, `e2e-testing-patterns`, `bats-testing-patterns`, `auth-session-and-cookie-manager`, `flaky-test-sentinel-and-quarantine` | `tools/matrix_sharder.py`, `tools/distill_log.py`, `tools/pinpoint_failure.py`, `tools/flaky_detector.py` |
474
- | **`failure-analyst`**| Automated closed-loop failure triage, MTTR scoring, self-healing PR drafting. | `failure-autopsy-and-healing`, `self-healing-locator`, `file-and-report-validator` | `tools/auto_heal.py`, `tools/heal_pr_automator.py`, `tools/pinpoint_failure.py`, `tools/cache_resolver.py` |
475
- | **`quality-gatekeeper`**| Enforces 9 Quality Gates DoD (Gate 0–8), scans fake passes, runs AST mutation testing. | `antigravity-test-sentinel`, `code-refactoring-refactor-clean`, `wcag-audit-patterns`, `web-vitals-and-performance-profiler`, `db-state-verifier-and-seeder`, `security-dast-sentinel`, `skillspector-security-guard` | `tools/verify_all.py`, `tools/infer_linter.py`, `tools/micro_mutator.py`, `tools/trace_data_flow.py`, `tools/wcag_audit.py`, `tools/lint_ai_docs.py`, `tools/skillspector.py` |
242
+ | **`orchestrator`** | Trưởng nhóm điều phối: khởi tạo dự án, kiểm tra sức khỏe và lưu giữ trạng thái công việc. | `agent-orchestration`, `graphify`, `architecture-decision-records` | `setup_project.py`, `analyze_project.py`, `repo_map.py` |
243
+ | **`live-explorer`** | Khảo sát trực tiếp DOM/AOM qua Playwright headless, tự động ngăn chặn thao tác phá hỏng hoặc nguy hiểm. | `playwright-live-interaction`, `self-healing-locator`, `visual-regression-sentinel` | `safety_firewall.py`, `browser_helpers.js` |
244
+ | **`pom-crafter`** | Kỹ sư Clean POM, kiểm tra breaking change API, sinh test từ User Story. | `clean-pom-crafter`, `lam-script-generator`, `synthetic-test-data-generator` | `generate_tc_from_story.py`, `api_drift_sentinel.py` |
245
+ | **`test-runner`** | Quản lý chạy test headless CLI, chia tải song song CI, lọc log thông minh. | `katalon-cli-runner`, `e2e-testing-patterns`, `flaky-test-sentinel-and-quarantine` | `matrix_sharder.py`, `distill_log.py`, `pinpoint_failure.py` |
246
+ | **`failure-analyst`** | Phân tích nguyên nhân gốc rễ (RCA) khi test thất bại, tự động đề xuất vá locator. | `failure-autopsy-and-healing`, `token-and-context-optimizer` | `auto_heal.py`, `bug_reporter.py`, `cache_resolver.py` |
247
+ | **`quality-gatekeeper`**| Chốt chặn kiểm soát chất lượng, kiểm định 9 Cổng DoD và độ nhạy assertion. | `antigravity-test-sentinel`, `wcag-audit-patterns`, `security-dast-sentinel` | `verify_all.py`, `micro_mutator.py`, `infer_linter.py` |
476
248
 
477
249
  ---
478
250
 
479
- ## 📦 4. Standardized 28 Skills Catalog (.agents/skills/)
251
+ ## 📦 7. Danh Mục 38 Kỹ Năng Chuẩn Hóa (.agents/skills/)
480
252
 
481
- | # | Skill Name | Core Operational Scope |
482
- |:---:|---|---|
483
- | 1 | `agent-orchestration-multi-agent-optimize` | Multi-agent coordination profiling, workload distribution, and token cost budgeting. |
484
- | 2 | `antigravity-test-sentinel` | Verification-First sentinel, locking task completion until exit code 0 is proven. |
485
- | 3 | `api-network-mocking-interception` | HTTP/GraphQL request interception, route stubbing, and chaos network resilience testing. |
486
- | 4 | `api-spec-to-e2e-matrix` | Transforms OpenAPI/Swagger specifications into equivalence, boundary, and error test matrices. |
487
- | 5 | `architecture-decision-records` | Documents and maintains technical Architecture Decision Records (ADR). |
488
- | 6 | `auth-session-and-cookie-manager` | Manages sessions, JWT tokens, and storageState for zero-second authentications. |
489
- | 7 | `backend-load-and-stress-patterns` | Backend load/stress testing via k6 & Locust with P95/P99 SLA threshold assertions. |
490
- | 8 | `bats-testing-patterns` | Automated testing for Shell scripts, CI/CD pipelines, CLI mocks, and exit codes. |
491
- | 9 | `clean-pom-crafter` | Clean Page Object Model standards, Flat Architecture, and dynamic `uniqueCode` test data. |
492
- | 10 | `code-refactoring-refactor-clean` | Clean code refactoring, code smells elimination, technical debt remediation, and SOLID. |
493
- | 11 | `db-state-verifier-and-seeder` | Direct DB state assertions (PostgreSQL, MySQL, MongoDB, Redis) and isolated fixtures. |
494
- | 12 | `e2e-testing-patterns` | Multi-browser E2E testing architecture (Playwright/Cypress), Typed POM, parallel sharding. |
495
- | 13 | `failure-autopsy-and-healing` | Automated failure triage from JUnit XML, Allure reports, and visual error screenshots. |
496
- | 14 | `file-and-report-validator` | Verifies uploaded/downloaded files (Excel .xlsx, streaming CSV, PDF text/layout). |
497
- | 15 | `flaky-test-sentinel-and-quarantine` | Flaky test detection, flakiness index scoring, and quarantine isolation governance. |
498
- | 16 | `github-actions-templates` | Production-ready GitHub Actions CI/CD workflows and sharded testing matrix. |
499
- | 17 | `graphify-impact-analyzer` | AST Knowledge Graph navigation and zero-waste test impact analysis. |
500
- | 18 | `katalon-cli-runner` | Headless KRE CLI execution coordinator, licensing fallback, and zombie driver cleanup. |
501
- | 19 | `lam-script-generator` | Large Action Model generator compiling User Stories into 100% test scripts with zero replay. |
502
- | 20 | `playwright-live-interaction` | Real-time DOM/AOM probing via Playwright MCP with sub-200ms selector verification. |
503
- | 21 | `security-dast-sentinel` | Dynamic Application Security Testing (DAST), OWASP Top 10, Security Headers, BOLA/IDOR. |
504
- | 22 | `self-healing-locator` | Micro-locator self-healing via Accessibility Tree (AOM), Role > Label > TestId hierarchy. |
505
- | 23 | `synthetic-test-data-generator` | Robust synthetic boundary test data generation (BVT, anti-injection, multilingual, GIS). |
506
- | 24 | `token-and-context-optimizer` | Context engineering, 95% log distillation, anti-degradation, and disk scratchpads. |
507
- | 25 | `visual-regression-sentinel` | Pixel-level and SSIM visual regression testing with dynamic masking. |
508
- | 26 | `wcag-audit-patterns` | Automated WCAG 2.2 Level A/AA accessibility auditing via AST and `@axe-core`. |
509
- | 27 | `web-vitals-and-performance-profiler` | Core Web Vitals (LCP, CLS, TTFB) profiling and slow API endpoint detection via CDP. |
510
- | 28 | `skillspector-security-guard` | AI agent skill & MCP config security auditing against 71 vulnerability vectors (Prompt Injection, Data Exfiltration, Privilege Escalation) powered by NVIDIA SkillSpector spec. |
253
+ <details>
254
+ <summary><b>📦 Bấm để xem: Danh Mục 38 Kỹ Năng Chuẩn Hóa</b></summary>
511
255
 
512
- ---
513
-
514
- ## 📜 5. 8 Core Rules Catalog (.agents/rules/)
515
-
516
- 1. **`context-engineering.md`**: Observation masking, lazy progressive disclosure, and KV-cache optimization.
517
- 2. **`git-push-protocol.md`**: Clean git push protocol (decoupled architecture guarantees zero AI leakage).
518
- 3. **`graphify.md`**: Navigating the AST knowledge graph over reading entire large source files.
519
- 4. **`lessons-learned.md`**: Episodic anti-pattern blacklist (strictly capped under 40 lines).
520
- 5. **`mandatory-playwright-live.md`**: Mandatory headless Full HD 1920x1080 and live DOM probing before codifying.
521
- 6. **`skill-precedence.md`**: Tier-1 local skill precedence resolving external plugin collisions.
522
- 7. **`systematic-debugging.md`**: Evidence-first debugging discipline; zero guessing; 9 Quality Gates DoD.
523
- 8. **`author-integrity-guard.md`**: Mandatory MIT copyright notice preservation and anti-plagiarism guard.
524
-
525
- ---
526
-
527
- ## 🛠️ 6. Automated Tools Runbook (50+ Specialized Python Tools)
528
-
529
- For full details, refer to [tools/TOOLS_RUNBOOK.md](tools/TOOLS_RUNBOOK.md):
530
-
531
- - `tools/verify_all.py`: 9 Quality Gates DoD verification (Gate 0–8: UTF-8, No XPaths, UniqueCode, Clean POM, AST Mutation).
532
- - `tools/generate_jmx_plan.py`: Multi-protocol Apache JMeter 5.x (.jmx) plan generator (HTTP, JDBC, WS, gRPC, Kafka) with Pareto traffic shaping.
533
- - `tools/jtl_analyzer.py`: JTL execution metrics analyzer, P95/P99 SLA gatekeeper, and CI/CD Quality Gate enforcer.
534
- - `tools/telemetry_correlator.py`: Full-stack Pearson correlation analyzer between client-side latency and server APM (CPU, RAM, DB Pool).
535
- - `tools/export_postman_collection.py`: Exports Postman Collections v2.1 with native AJV JSON Schema, DDT CSV, and Zero-Input domain synthesis.
536
- - `tools/newman_analyzer.py`: Newman automated test results analyzer, assertion failure triage, and CI/CD Quality Gate.
537
- - `tools/api_fuzzer.py`: Autonomous API fuzzer detecting HTTP 500 crashes, database stacktrace leaks, and latency SLA breaches.
538
- - `tools/api_drift_sentinel.py`: Contract drift detector comparing OpenAPI/Swagger specifications for breaking changes.
539
- - `tools/auto_heal.py`: In-place locator self-healing engine correlating JUnit XML and screenshots via AOM diffing.
540
- - `tools/flaky_detector.py`: Flaky test detector and automated quarantine lifecycle manager.
541
- - `tools/skillspector.py`: AI Agent Skill & MCP Security Sentinel (71 detection vectors, Prohibition Context Engine, SARIF/JSON reporting).
542
- - `tools/omni_transpiler.py`: 0-token polyglot test transpiler (Playwright TS/Python, Java, Groovy, Cypress).
543
- - `tools/infer_linter.py`: Static AST analysis detecting fake passes (zero asserts) and empty catch blocks.
544
- - `tools/test_impact.py`: Scopes affected test cases based on git diffs.
545
- - `tools/cache_resolver.py`: Manages the central SQLite error memory cache (`~/.agent_memory/global_cache.db`).
546
- - `tools/distill_log.py`: Filters 95% noise from CLI/Gradle/KRE logs, preserving stacktraces and pointers.
547
- - `tools/agent_canary.py`: Injects 8 failure vectors to benchmark MTTR and autonomous recovery rate.
548
- - `tools/repo_map.py`: Extracts a compressed method and Page Class map (~500 tokens).
549
- - `tools/visual_diff_canvas.py`: Pixel/SSIM comparison for canvas/GIS interfaces lacking standard DOM.
550
- - `tools/wcag_audit.py`: Automated scanning for WCAG 2.2 Level A/AA criteria.
551
- - `tools/generate_api_matrix.py`: Generates positive, boundary, and negative test matrices from Swagger/OpenAPI.
552
- - `tools/generate_tc_from_story.py`: Large Action Model parser generating Clean POM skeletons from stories.
553
- - `tools/trace_data_flow.py`: Taint analysis tracking test data flow and preventing database orphan junk.
554
- - `scripts/install.ps1` & `scripts/setup.sh`: 1-click bootstrap scripts setting up the hub environment.
555
- - `scripts/lint_skills.ps1`: Linter verifying skill integrity and metadata manifest.
556
- - `pyproject.toml` & `tools/cli.py`: PEP 621 packaging for the global `agent-qa` CLI.
256
+ | # | Mã Kỹ Năng | Mô Tả Thực Chiến |
257
+ |:---:|---|---|
258
+ | 1 | `clean-pom-crafter` | Thiết kế Page Classes chuẩn Clean POM & Flat Architecture (zero locator trong test script). |
259
+ | 2 | `playwright-live-interaction` | Khảo sát trực tiếp DOM/AOM, kiểm định selector < 200ms qua Playwright Headless. |
260
+ | 3 | `failure-autopsy-and-healing` | Phân tích nguyên nhân lỗi từ JUnit XML/Screenshot, tự động vá locator hỏng. |
261
+ | 4 | `antigravity-test-sentinel` | Chốt chặn kiểm soát chất lượng, phát hiện pass ảo và bảo đảm tuân thủ 9 cổng DoD. |
262
+ | 5 | `token-and-context-optimizer` | Tối ưu hóa prompt context, cô đọng log và chống suy giảm ngữ cảnh (Context Rot). |
263
+ | 6 | `flaky-test-sentinel-and-quarantine` | Phát hiện test chập chờn, tính điểm flakiness và quản lý vòng đời cách ly. |
264
+ | 7 | `api-spec-to-e2e-matrix` | Chuyển đổi đặc tả OpenAPI/Swagger thành ma trận kiểm thử E2E (Happy, Boundary, Fault). |
265
+ | 8 | `api-network-mocking-interception` | Chặn bắt traffic HTTP/GraphQL, giả lập route và tiêm lỗi mạng hỗn loạn (chaos testing). |
266
+ | 9 | `synthetic-test-data-generator` | Sinh dữ liệu kiểm thử giả lập, chống trùng lặp khóa chính trong cơ sở dữ liệu. |
267
+ | 10 | `db-state-verifier-and-seeder` | Khởi tạo dữ liệu mẫu cô lập và kiểm tra biến đổi DB qua SQL/NoSQL. |
268
+ | 11 | `visual-regression-sentinel` | So sánh ảnh chụp màn hình phát hiện lệch pixel với cơ chế che chắn ảnh động (anti-flake mask). |
269
+ | 12 | `wcag-audit-patterns` | Kiểm toán khả năng tiếp cận theo tiêu chuẩn WCAG 2.2 A/AA và vai trò ARIA. |
270
+ | 13 | `security-dast-sentinel` | Kiểm tra bảo mật động DAST: OWASP Top 10, tiêu đề bảo mật, rò rỉ token và IDOR. |
271
+ | 14 | `web-vitals-and-performance-profiler` | Đo lường Core Web Vitals (LCP, CLS, INP) và thác mạng (network waterfall) qua CDP. |
272
+ | 15 | `backend-load-and-stress-patterns` | Điều phối kịch bản tải k6, Locust và Apache JMeter đo lường SLA chịu tải. |
273
+ | 16 | `auth-session-and-cookie-manager` | Quản lý phiên đăng nhập `storageState`, JWT token và trạng thái đa vai trò. |
274
+ | 17 | `file-and-report-validator` | Kiểm tra tính toàn vẹn của tệp tải về/tải lên (Excel, CSV, PDF) so với schema. |
275
+ | 18 | `e2e-testing-patterns` | Thiết kế kiến trúc kiểm thử E2E đa trình duyệt, chia tải song song và quản trị retry. |
276
+ | 19 | `lam-script-generator` | Chuyển đổi User Story và tiêu chí chấp nhận thành kịch bản kiểm thử tự động. |
277
+ | 20 | `katalon-cli-runner` | Điều phối chạy kiểm thử Katalon/Gradle headless với cơ chế tự dọn driver. |
278
+ | 21 | `bats-testing-patterns` | Kiểm thử shell script, công cụ CLI và pipeline CI/CD bằng Bats. |
279
+ | 22 | `code-refactoring-refactor-clean` | Khử nợ kỹ thuật, tái cấu trúc mã kiểm thử theo nguyên lý SOLID & Clean Code. |
280
+ | 23 | `agent-orchestration-multi-agent-optimize` | Đo lường tải và điều phối đa agent tối ưu hóa lưu lượng token. |
281
+ | 24 | `architecture-decision-records` | Soạn thảo và duy trì hồ sơ quyết định kiến trúc kỹ thuật (ADR). |
282
+ | 25 | `github-actions-templates` | Mẫu pipeline GitHub Actions chuẩn sản xuất cho kiểm thử tự động và CI/CD. |
283
+ | 26 | `graphify-impact-analyzer` | Phân tích phạm vi ảnh hưởng của thay đổi mã nguồn qua đồ thị quan hệ AST. |
284
+ | 27 | `skillspector-security-guard` | Quét lỗ hổng prompt injection và cấu hình MCP theo tiêu chuẩn an toàn bảo mật. |
285
+ | 28 | `gherkin-to-suite` | Biên dịch file `.feature` BDD thành ma trận test, Universal IR và phân tích khoảng trống độ phủ. |
286
+ | 29 | `rbt-manual-testing` | Quy trình AI-RBT sinh kịch bản kiểm thử thủ công dựa trên rủi ro, ma trận 12 cột và checklist input field. |
287
+ | 30 | `self-healing-locator` | Tự động phát hiện và vá lỗi định vị phần tử bằng phân tích sai khác cây Accessibility (AOM). |
288
+ | 31 | `persistent-planning-files` | Lưu kế hoạch, phát hiện và tiến độ xuống 3 file markdown để công việc đa pha sống sót qua reset ngữ cảnh. |
289
+ | 32 | `surgical-coding-principles` | Bốn nguyên tắc chỉnh sửa có kỷ luật: nêu giả định, tối giản diff, mọi dòng đổi đều truy về yêu cầu. |
290
+ | 33 | `lean-code-ladder` | Thang 7 bậc reuse-first: chọn phương án nhỏ nhất hoàn chỉnh trước khi viết code mới. |
291
+ | 34 | `playwright-webapp-testing` | Vòng đời server có kiểm soát (start/ready/teardown) khi chạy Playwright test web app cục bộ. |
292
+ | 35 | `test-driven-development` | Kỷ luật RED-GREEN-REFACTOR: chưa xem test fail đúng lý do thì chưa viết code sản phẩm. |
293
+ | 36 | `systematic-debugging` | Điều tra gốc rễ 4 pha trước mọi bản vá; 3 lần sửa thất bại là dấu hiệu sai kiến trúc. |
294
+ | 37 | `verification-before-completion` | Giao thức bằng chứng: mọi tuyên bố pass/done phải kèm output lệnh chạy tươi trong phiên. |
295
+ | 38 | `meta-prompt-crafter` | Chuyên gia kỹ thuật prompt chuyển hóa ý tưởng thô thành câu lệnh chuẩn xác, tối ưu cho mọi AI. |
296
+
297
+ > **Nguồn mở & credit:** Kỹ năng 31–37 được kế thừa và phát triển từ các dự án mã nguồn mở (andrej-karpathy-skills, ponytail, planning-with-files, anthropics/skills, superpowers, wshobson/agents) — license và tác giả chi tiết tại file `NOTICE` (mục 16–21); hướng dẫn công cụ ngoài kèm theo tại `docs/adopted-ecosystem-tools.md`.
298
+
299
+ </details>
557
300
 
558
301
  ---
559
302
 
560
- ## 📚 7. Extended Technical Documentation & CLI Package (docs/)
303
+ ## 🛠️ 8. Bộ Công Cụ Dòng Lệnh CLI (tools/)
561
304
 
562
- 1. **[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)**: Hub/Spoke architecture, 4-tier skill model, and 6-agent swarm coordination.
563
- 2. **[docs/CONTRIBUTING.md](docs/CONTRIBUTING.md)**: Contribution standards, new skill authoring principles, and verification pipelines.
564
- 3. **[docs/CLI_REFERENCE.md](docs/CLI_REFERENCE.md)**: Comprehensive command-line reference for the `agent-qa` CLI.
305
+ Dự án đi kèm hơn 60 công cụ tiện ích viết hoàn toàn bằng **thư viện chuẩn Python** (Standard Library), không phụ thuộc package ngoài:
565
306
 
566
- ### Quick CLI Installation:
567
307
  ```bash
568
- pip install -e .
569
- agent-qa --help
570
- agent-qa verify
571
- agent-qa lint
572
- agent-qa skillspector
573
- ```
308
+ # 1. Chẩn đoán môi trường hệ thống (Node, Python, Chrome, Git)
309
+ npx synapse-hub doctor
574
310
 
575
- ---
311
+ # 2. Kiểm tra 9 Cổng Chất Lượng DoD
312
+ npx synapse-hub verify
576
313
 
577
- ## 🤝 8. Acknowledgments & Upstream Inspirations
314
+ # 3. Quét phát hiện test pass ảo và ngoại lệ bị bỏ qua ngầm
315
+ npx synapse-hub lint ./tests
578
316
 
579
- **Synapse Hub** synthesizes, adapts, and builds upon groundbreaking methodologies and architectures from the global open-source and AI engineering community:
317
+ # 4. Nén 95% log CI/CD cồng kềnh
318
+ npx synapse-hub distill path/to/ci.log
580
319
 
581
- | Project & Author | Architectural Inspiration in Synapse Hub |
582
- | :--- | :--- |
583
- | **[NVIDIA/SkillSpector](https://github.com/NVIDIA/SkillSpector)** *(NVIDIA AI Security Team)* | AI Agent skill & MCP security vetting engine (`tools/skillspector.py`, Skill #28 `skillspector-security-guard`) featuring 71 vulnerability vectors across 17 categories and the Prohibition Context Engine. |
584
- | **[muratcankoylan/Agent-Skills-for-Context-Engineering](https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering)** | Context Engineering foundations, observation masking, and LLM attention budget optimization. |
585
- | **[alexgreensh/token-optimizer](https://github.com/alexgreensh/token-optimizer)** | Token-efficient reasoning, 95% log distillation, and KV-cache serialization protocols. |
586
- | **[obra/superpowers](https://github.com/obra/superpowers)** *(Jesse Vincent)* | Systematic evidence-based debugging, cognitive forcing functions, and Red-Team vs Blue-Team verification. |
587
- | **[Aider-AI/aider](https://github.com/Aider-AI/aider)** *(Paul Gauthier)* | Ultra-compact AST repository mapping algorithm (`tools/repo_map.py`) fitting 500+ signatures in < 600 tokens. |
588
- | **[lavague-ai/LaVague](https://github.com/lavague-ai/LaVague)** | Large Action Model (LAM) concept compiling natural language stories into deterministic Clean POM scripts. |
589
- | **[facebook/infer](https://github.com/facebook/infer)** *(Meta Infer)* | Static AST defect sentinel (`tools/infer_linter.py`) catching swallowed exceptions and 0-assertion fake passes. |
590
- | **[microsoft/playwright](https://github.com/microsoft/playwright)** | Sub-200ms headless live DOM/AOM probing, route stubbing, and anti-flake network shielding. |
591
- | **[dequelabs/axe-core](https://github.com/dequelabs/axe-core)** | Automated accessibility rule heuristics inspiring WCAG 2.2 Level A/AA AST auditing. |
592
- | **[bats-core/bats-core](https://github.com/bats-core/bats-core)** | Bash Automated Testing System patterns for CI/CD pipelines and cross-platform CLI verification. |
593
- | **[npryce/adr-tools](https://github.com/npryce/adr-tools)** | Architecture Decision Record (ADR) conventions and lifecycle workflows. |
320
+ # 5. Xuất test case sang file Excel .xlsx chuẩn 12 cột
321
+ npx synapse-hub export-excel
594
322
 
595
- ---
323
+ # 6. Kiểm tra độ nhạy của các câu lệnh assert
324
+ npx synapse-hub mutate ./tests
596
325
 
597
- ## 📄 9. License & Author Attribution
326
+ # 7. Dò tìm và cách ly test chập chờn (Flaky Tests)
327
+ npx synapse-hub flaky scan ./tests
328
+ ```
598
329
 
599
- This project is licensed under the **[MIT License](LICENSE)**.
330
+ *(Xem toàn bộ hướng dẫn tham số chi tiết tại [docs/CLI_REFERENCE.md](docs/CLI_REFERENCE.md) và [tools/TOOLS_RUNBOOK.md](tools/TOOLS_RUNBOOK.md)).*
600
331
 
601
- **Provenance & Copyright Notice:**
602
- - **Author & Founder:** Thế Vị ([@TeeVee998](https://github.com/TeeVee998))
603
- - **Original Repository:** [https://github.com/TeeVee998/Synapse-Hub](https://github.com/TeeVee998/Synapse-Hub)
604
- - **Copyright:** Copyright (c) 2026 Thế Vị (@TeeVee998). Distributed under the MIT License.
332
+ > 💡 **Bí danh dòng lệnh tương đương:** Khi cài đặt toàn cục (`npm i -g synapse-hub`), bạn có thể sử dụng bất kỳ bí danh nào: `synapse-hub`, `synapse`, hoặc `agent-qa` (ví dụ: `synapse verify`, `agent-qa lint ./tests`).
605
333
 
606
- > ⚖️ **MIT License Attribution Requirement:** Under the terms of the MIT License, you are granted permission to use, copy, modify, merge, publish, and distribute this software freely, **PROVIDED** that the original copyright notice crediting **Thế Vị (@TeeVee998)** and this permission notice are included in all copies or substantial portions of the Software.
334
+ ---
607
335
 
336
+ ## 📄 Bản Quyền & Nguồn Gốc (MIT License)
608
337
 
338
+ Dự án này được sáng lập và phát triển bởi **Thế Vị ([@TeeVee998](https://github.com/TeeVee998))** dưới giấy phép mã nguồn mở [MIT License](LICENSE).
339
+ Mọi hình thức sao chép, tích hợp hoặc phân phối lại đều được tự do sử dụng, với điều kiện **bắt buộc phải giữ nguyên thông báo bản quyền và nguồn tác giả ban đầu**.