synapse-hub 2.2.4 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (312) 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 +23 -4
  4. package/.agents/agents/pom-crafter.md +15 -0
  5. package/.agents/agents/quality-gatekeeper.md +20 -4
  6. package/.agents/agents/test-runner.md +12 -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 +331 -0
  126. package/README.md +252 -515
  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 +16 -4
  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 +27 -12
  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 +98 -131
  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 +30 -3
  259. package/tools/cache_resolver.py +248 -14
  260. package/tools/check_env.py +55 -14
  261. package/tools/check_version_sync.py +171 -0
  262. package/tools/ci_healing_hook.py +1 -1
  263. package/tools/cli.py +454 -42
  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 +302 -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 +295 -31
  299. package/tools/skillspector.py +31 -0
  300. package/tools/spec_drift_sentinel.py +439 -0
  301. package/tools/sync_agent_rules.py +248 -0
  302. package/tools/telemetry_correlator.py +45 -0
  303. package/tools/test_impact.py +51 -12
  304. package/tools/tms_sync_bridge.py +21 -5
  305. package/tools/universal_ir.py +3 -0
  306. package/tools/update_sentinel.py +87 -15
  307. package/tools/verify_all.ps1 +13 -0
  308. package/tools/verify_all.py +479 -85
  309. package/tools/visual_diff_canvas.py +1 -0
  310. package/tools/visual_som_helper.py +1 -1
  311. package/tools/watch_mode.py +305 -0
  312. package/tools/welcome_page.py +291 -0
@@ -1,179 +1,98 @@
1
1
  ---
2
2
  name: security-dast-sentinel
3
- description: "Run dynamic security audits: OWASP Top 10, security headers, IDOR, and token leakage."
3
+ description: "Run dynamic security audits: OWASP Top 10, security headers, IDOR, and token leakage. Use when running or planning DAST and security scans against a target app."
4
4
  ---
5
5
 
6
6
  # Security DAST Sentinel (Dynamic Application Security & OWASP Top 10)
7
7
 
8
- > **Purpose:** Automated Dynamic Application Security Testing (DAST) and defensive runtime verification across enterprise web applications and REST/GraphQL APIs. Bridges functional automated testing with OWASP Top 10 defensive compliance gates.
8
+ > **Purpose:** Automated Dynamic Application Security Testing (DAST) and defensive runtime verification across enterprise web applications and APIs. Bridges functional automated testing with OWASP Top 10 compliance gates.
9
9
  >
10
10
  > [!IMPORTANT] Authorization & Scope of Engagement
11
11
  > Dynamic security testing and fuzzing must **ONLY** be conducted against environments, domains, and applications for which explicit written authorization and testing agreements are established. Never direct automated security payloads or fuzzers against third-party production infrastructure.
12
12
 
13
13
  ---
14
14
 
15
- ## 1. Core Defensive Scope & OWASP Top 10 Coverage
16
-
17
- ```mermaid
18
- flowchart TD
19
- A["<b>Security DAST Sentinel</b><br/>Runtime Defensive Verification"] --> B["<b>1. HTTP Security Headers</b><br/>CSP, HSTS, X-Frame-Options, MIME Sniff"]
20
- A --> C["<b>2. Sensitive Data Exposure</b><br/>PII, Secrets, Tokens, Stacktrace Leakage"]
21
- A --> D["<b>3. Broken Object Auth (BOLA/IDOR)</b><br/>Horizontal/Vertical Role Token Swapping"]
22
- A --> E["<b>4. CORS & Origin Misconfig</b><br/>Origin Reflection, Credentials Wildcard"]
23
- ```
15
+ ## 1. Core Defensive Scope & OWASP Top 10
24
16
 
25
17
  | OWASP Category | Threat Vector | Automated Defensive Check | Assertion Target |
26
18
  | :--- | :--- | :--- | :--- |
27
- | **A01: Broken Access Control** | BOLA / IDOR | Swapping User A's Bearer token into User B's resource URI | HTTP `403 Forbidden` or `404 Not Found` (Never `200 OK`) |
28
- | **A01: Broken Access Control** | CORS Misconfiguration | Sending unauthorized `Origin` header with `Credentials: include` | Must NOT reflect origin with `Access-Control-Allow-Credentials: true` |
29
- | **A02: Cryptographic Failures** | Insecure Transport & Missing HSTS | Inspecting headers on HTTPS endpoints | `Strict-Transport-Security: max-age=31536000; includeSubDomains` |
30
- | **A05: Security Misconfiguration** | Missing Security Headers | Passive audit on all page navigations & API responses | CSP, X-Frame-Options, X-Content-Type-Options: nosniff |
31
- | **A05: Security Misconfiguration** | Verbose Error Disclosure | Injecting invalid payload to trigger 4xx/5xx | Response must NOT contain `SQLException`, `Traceback`, or internal paths |
32
- | **A09: Security Logging & Monitoring** | Sensitive Data Leakage | Regex scan on API responses and local storage | Zero plaintext passwords, credit cards, or private keys |
19
+ | **A01: Broken Access Control** | BOLA / IDOR | Swapping User A token into User B resource URI | HTTP `403` or `404` (Never `200`) |
20
+ | **A01: Broken Access Control** | CORS Misconfiguration | Sending untrusted `Origin` with `Credentials: include` | Must NOT reflect origin with `Credentials: true` |
21
+ | **A02: Cryptographic Failures** | Missing HSTS | Inspecting headers on HTTPS endpoints | `Strict-Transport-Security: max-age=...` |
22
+ | **A05: Security Misconfiguration** | Missing Security Headers | Passive audit on page navigations & API responses | CSP, X-Frame-Options, nosniff |
23
+ | **A05: Security Misconfiguration** | Verbose Error Disclosure | Fuzzing invalid inputs to trigger errors | Response must NOT contain `SQLException` or stacktrace |
24
+ | **A09: Logging & Secrets Leak** | Sensitive Data Leakage | Regex scan on responses and local storage | Zero plaintext passwords, API keys, or private keys |
33
25
 
34
26
  ---
35
27
 
36
- ## 2. HTTP Security Response Headers Audit
37
-
38
- All production and staging responses must enforce strict defensive headers to prevent Clickjacking, Cross-Site Scripting (XSS), and MIME-sniffing attacks.
39
-
40
- ### Mandatory Security Header Policy
41
- 1. `Content-Security-Policy`: Must define `default-src 'self'` or restrictive directive; must avoid `'unsafe-eval'` or open wildcards `*` in script sources.
42
- 2. `Strict-Transport-Security`: `max-age=31536000; includeSubDomains` on HTTPS.
43
- 3. `X-Frame-Options`: `DENY` or `SAMEORIGIN` (prevents UI clickjacking in external iframes).
44
- 4. `X-Content-Type-Options`: `nosniff` (prevents browser MIME-type confusion).
45
- 5. `Referrer-Policy`: `strict-origin-when-cross-origin` or `no-referrer`.
46
- 6. `Permissions-Policy`: Restricts camera, microphone, and geolocation APIs.
28
+ ## 2. Automated Security Headers Audit (Playwright TypeScript)
47
29
 
48
- ### Playwright Automated Headers Fixture (TypeScript)
49
30
  ```typescript
50
31
  import { test, expect } from '@playwright/test';
51
32
 
52
- test.describe('DAST Security Headers Audit', () => {
53
- test('verify mandatory security headers on target application', async ({ page }) => {
54
- const response = await page.goto('/dashboard');
55
- expect(response).not.toBeNull();
56
- const headers = response!.headers();
33
+ test('DAST: Verify mandatory HTTP security headers', async ({ page }) => {
34
+ const response = await page.goto('/dashboard');
35
+ expect(response).not.toBeNull();
36
+ const headers = response!.headers();
57
37
 
58
- // 1. Clickjacking Protection
59
- const xFrame = headers['x-frame-options']?.toUpperCase();
60
- expect(['DENY', 'SAMEORIGIN'], 'X-Frame-Options must be DENY or SAMEORIGIN').toContain(xFrame);
38
+ // 1. Clickjacking & MIME Sniffing
39
+ expect(['DENY', 'SAMEORIGIN']).toContain(headers['x-frame-options']?.toUpperCase());
40
+ expect(headers['x-content-type-options']).toBe('nosniff');
61
41
 
62
- // 2. MIME Sniffing Protection
63
- expect(headers['x-content-type-options'], 'Must prevent MIME sniffing').toBe('nosniff');
64
-
65
- // 3. Strict Transport Security
66
- if (page.url().startsWith('https://')) {
67
- expect(headers['strict-transport-security'], 'HSTS must be enabled on HTTPS').toContain('max-age=');
68
- }
69
-
70
- // 4. Content Security Policy
71
- const csp = headers['content-security-policy'];
72
- expect(csp, 'Content-Security-Policy must be declared').toBeTruthy();
73
- expect(csp).not.toContain("default-src *");
74
- });
42
+ // 2. Strict Transport Security & CSP
43
+ if (page.url().startsWith('https://')) {
44
+ expect(headers['strict-transport-security']).toContain('max-age=');
45
+ }
46
+ expect(headers['content-security-policy']).toBeTruthy();
75
47
  });
76
48
  ```
77
49
 
78
50
  ---
79
51
 
80
- ## 3. Sensitive Data Exposure (PII, Secrets & Error Leakage)
81
-
82
- API responses and client-side storage must never leak internal stack traces, system paths, unmasked PII, or authorization credentials.
83
-
84
- ### Automated Response Interceptor Linter (Python / Playwright)
85
- ```python
86
- import re
87
- from typing import Dict, List
88
-
89
- # Patterns matching accidental secret or stacktrace leakage
90
- SENSITIVE_LEAK_PATTERNS = [
91
- (re.compile(r'-----BEGIN (?:RSA )?PRIVATE KEY-----'), "Exposed Private Key"),
92
- (re.compile(r'(?i)\b(?:password|passwd|pwd)\b\s*[:=]\s*["\'][^"\']{4,}["\']'), "Exposed Plaintext Password"),
93
- (re.compile(r'\b(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14})\b'), "Raw Credit Card Number (Visa/MC)"),
94
- (re.compile(r'(?i)(?:SQLException|HibernateException|org\.postgresql\.util|java\.lang\.NullPointerException)'), "Database Stacktrace Leak"),
95
- (re.compile(r'(?i)(?:Traceback \(most recent call last\)|File "[a-zA-Z0-9_\-\\/]+\.py", line \d+)'), "Python Stacktrace Leak"),
96
- (re.compile(r'\b[a-zA-Z]:\\[a-zA-Z0-9_.\-\\]+\b'), "Internal Windows File Path Leak"),
97
- ]
98
-
99
- def scan_response_for_leaks(body_text: str) -> List[str]:
100
- """Inspects API response text for prohibited sensitive data leaks."""
101
- violations = []
102
- for pattern, description in SENSITIVE_LEAK_PATTERNS:
103
- if pattern.search(body_text):
104
- violations.append(description)
105
- return violations
106
- ```
107
-
108
- ---
109
-
110
- ## 4. Broken Object-Level Authorization (BOLA / IDOR) Testing
111
-
112
- BOLA occurs when an API endpoint uses user-supplied IDs to retrieve object instances without validating user ownership.
113
-
114
- ### Automated Dual-Role Permutation Protocol
115
- 1. **User A (Victim):** Log in and create Entity `X` (ID: `10042`).
116
- 2. **User B (Attacker):** Log in as an unrelated user or tenant, acquire Token `B`.
117
- 3. **Execute Cross-Tenant Query:** Dispatch `GET /api/v1/entities/10042` with `Authorization: Bearer <Token_B>`.
118
- 4. **Assert Access Barrier:**
119
- - `HTTP 403 Forbidden` or `HTTP 404 Not Found` => **PASS** (Zero BOLA).
120
- - `HTTP 200 OK` with Entity `X` payload => **CRITICAL DEFECT: BOLA / IDOR VULNERABILITY**.
52
+ ## 3. BOLA / IDOR Defense Check
121
53
 
122
54
  ```typescript
123
- test('BOLA Defense: Tenant B cannot access Tenant A entity', async ({ request }) => {
124
- // Tenant A creates resource
125
- const createRes = await request.post('/api/v1/invoices', {
126
- headers: { 'Authorization': `Bearer ${tokenTenantA}` },
127
- data: { amount: 5000, description: 'Confidential Invoice A' }
128
- });
129
- const invoiceId = (await createRes.json()).id;
130
-
131
- // Tenant B attempts to read Tenant A's invoice
132
- const readAttempt = await request.get(`/api/v1/invoices/${invoiceId}`, {
55
+ test('DAST: Tenant B cannot access Tenant A entity', async ({ request }) => {
56
+ // Tenant B attempts to read Tenant A resource
57
+ const readAttempt = await request.get('/api/v1/invoices/10042', {
133
58
  headers: { 'Authorization': `Bearer ${tokenTenantB}` }
134
59
  });
135
-
136
- // Assertion: System must block cross-tenant read
137
- expect([403, 404], 'Tenant B must not access Tenant A invoice').toContain(readAttempt.status());
60
+ expect([403, 404], 'Cross-tenant resource must be forbidden').toContain(readAttempt.status());
138
61
  });
139
62
  ```
140
63
 
141
64
  ---
142
65
 
143
- ## 5. CORS Misconfiguration Audit
66
+ ## 4. Environment Allowlist Guard
144
67
 
145
- CORS policies must never reflect arbitrary untrusted origins when credentials (cookies/tokens) are supported.
68
+ - Automated security checks, fuzzing (`tools/api_fuzzer.py`), and DB sandboxing (`tools/db_sandbox.py`) enforce non-production allowlists (`localhost`, `staging`, `dev`, `qa`, `sandbox`).
69
+ - Fuzzing production hosts without `SYNAPSE_ALLOW_PROD_FUZZ=1` is automatically blocked.
146
70
 
147
- ```typescript
148
- test('CORS Defense: Server must not reflect arbitrary untrusted Origin with credentials', async ({ request }) => {
149
- const untrustedOrigin = 'https://untrusted-attacker.com';
150
- const response = await request.get('/api/v1/user/profile', {
151
- headers: {
152
- 'Origin': untrustedOrigin,
153
- 'Authorization': `Bearer ${validUserToken}`
154
- }
155
- });
71
+ ---
156
72
 
157
- const allowOrigin = response.headers()['access-control-allow-origin'];
158
- const allowCredentials = response.headers()['access-control-allow-credentials'];
73
+ ## 5. Passive vs Active Scan Taxonomy & Severity Levels
159
74
 
160
- // Critical CORS Flaw: Reflecting untrusted origin while allowing credentials
161
- if (allowOrigin === untrustedOrigin && allowCredentials === 'true') {
162
- throw new Error('CRITICAL CORS VULNERABILITY: Arbitrary origin reflection with credentials enabled');
163
- }
75
+ > *Borrowed and adapted from the OWASP ZAP scanning model (Apache-2.0, zaproxy/zaproxy).*
164
76
 
165
- // Critical CORS Flaw: Wildcard with credentials
166
- if (allowOrigin === '*' && allowCredentials === 'true') {
167
- throw new Error('CRITICAL CORS VULNERABILITY: Wildcard origin with credentials enabled');
168
- }
169
- });
170
- ```
77
+ Structure every DAST engagement in two phases, and severity-tag every finding
78
+ so CI can gate on risk instead of raw counts:
171
79
 
172
- ---
173
-
174
- ## 6. Security DoD Verification Checklist
175
- - [ ] Mandatory security headers verified on root and core dashboard routes.
176
- - [ ] No `500 Server Error` response contains raw SQL exceptions or language stacktraces.
177
- - [ ] All ID-based mutation and query endpoints verified against BOLA/IDOR permutations.
178
- - [ ] CORS policies enforce whitelist or block `Credentials: true` with arbitrary origins.
179
- - [ ] All security testing conducted non-destructively in defensive QA test suites.
80
+ | Phase | Traffic | Purpose | Hub Tooling |
81
+ | :--- | :--- | :--- | :--- |
82
+ | **Passive** | Zero traffic | Audit the OpenAPI/Swagger contract pre-flight: mutating endpoints without declared auth, unprotected admin paths, unbounded string props | `agent-qa fuzz-api --mode passive` |
83
+ | **Active** | Controlled attacks | Dispatch fuzz vectors against staging and evaluate the defect oracle | `agent-qa fuzz-api` (allowlist-guarded) |
84
+
85
+ Severity ladder (fixed mapping): `CRITICAL` (stacktrace/DB leak, auth bypass) →
86
+ `HIGH` (server crash 5xx, unprotected sensitive path) → `MEDIUM` (connection
87
+ errors, unverified targets) → `LOW` (SLA breaches, unbounded input) → `INFO`.
88
+
89
+ Rules:
90
+ 1. **Never skip passive** — a contract that leaks an admin route costs zero
91
+ requests to find; active scan only after passive findings are triaged.
92
+ 2. **Gate on CRITICAL alone** — a run with any CRITICAL alarm fails CI
93
+ regardless of total counts.
94
+ 3. **An untested endpoint must never PASS** — connection failures are
95
+ `CONNECTION_ERROR` findings, not green results (Truth Anchor).
96
+ 4. **OpenAPI-driven breadth** — ingest the spec (JSON) so every path/method is
97
+ enumerated; combine with authentication scripts from
98
+ `auth-session-and-cookie-manager` before active scanning.
@@ -0,0 +1,10 @@
1
+ {
2
+ "targetUrl": "https://staging.internal.example.com",
3
+ "checks": [
4
+ "OWASP_TOP_10",
5
+ "HEADER_SECURITY",
6
+ "TOKEN_EXPOSURE",
7
+ "SQLI_PROBING"
8
+ ],
9
+ "failOnSeverity": "HIGH"
10
+ }
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  name: self-healing-locator
3
- description: "Heal broken locators using semantic AOM diffing with Role, Label, and TestId hierarchy."
3
+ description: "Heal broken locators using semantic AOM diffing with Role, Label, and TestId hierarchy. Use when locators break and automated healing strategies are needed."
4
4
  ---
5
5
 
6
- # Self-Healing Locator Skill — Token-Efficient AOM Diffing
6
+ # Self-Healing Locator Skill — Token-Efficient AOM Diffing
7
7
 
8
8
  This skill provides an automated, token-conservative mechanism to diagnose, diff, and repair broken web element locators across web applications without overwhelming the LLM context window with raw HTML dumps.
9
9
 
@@ -28,18 +28,18 @@ flowchart LR
28
28
 
29
29
  When searching for a replacement locator, evaluate candidates in this strict priority order:
30
30
 
31
- 1. **Tier 1 — ARIA Role & Accessible Name:**
32
- - Playwright: `page.getByRole('button', { name: 'Thêm mới' })`
33
- - CSS: `[role="button"][aria-label="Thêm mới"]`
34
- 2. **Tier 2 — Form Control & Business Semantics:**
31
+ 1. **Tier 1 — ARIA Role & Accessible Name:**
32
+ - Playwright: `page.getByRole('button', { name: 'Thêm mới' })`
33
+ - CSS: `[role="button"][aria-label="Thêm mới"]`
34
+ 2. **Tier 2 — Form Control & Business Semantics:**
35
35
  - `input[formcontrolname="code"]`
36
36
  - `p-dropdown[formcontrolname="categoryId"]`
37
- 3. **Tier 3 — Dedicated Test Identifiers:**
37
+ 3. **Tier 3 — Dedicated Test Identifiers:**
38
38
  - `[data-testid="btn-create"]`
39
39
  - `[data-test="submit"]`
40
- 4. **Tier 4 — Stable Visual Text:**
41
- - `button:has-text("Xác nhận")`
42
- 5. **Tier 5 — Scoped Resilient Relative CSS:**
40
+ 4. **Tier 4 — Stable Visual Text:**
41
+ - `button:has-text("Xác nhận")`
42
+ 5. **Tier 5 — Scoped Resilient Relative CSS:**
43
43
  - `.card.popup-data input.p-inputtext`
44
44
 
45
45
  ---
@@ -70,3 +70,17 @@ Execute this compact JavaScript probe via Playwright or Chrome DevTools to locat
70
70
  1. **Verify Uniqueness:** Ensure the candidate locator matches exactly 1 element on the live DOM.
71
71
  2. **Encapsulate in Page Class:** Update the locator constant or private selector inside the relevant Page Class (e.g. `BasePage` or domain Page Class).
72
72
  3. **Never Leak to Test Scripts:** Test scripts must remain 100% clean of raw selectors.
73
+
74
+ ---
75
+
76
+ ## 5. Boundary vs `failure-autopsy-and-healing`
77
+
78
+ - **This skill** = a locator-repair cascade (cache → testid → text-semantic →
79
+ geometric relative match), used when the diagnosis "stale/broken locator"
80
+ is ALREADY established. It takes a broken selector plus a DOM snapshot and
81
+ returns healed candidates with confidence scores.
82
+ - **`failure-autopsy-and-healing`** = the upstream diagnosis that decides WHEN
83
+ this skill is needed (it also handles every non-locator failure class this
84
+ skill does not touch).
85
+ - Chain of custody: autopsy RCA → "locator drift" verdict → this skill repairs
86
+ → autopsy re-runs the healed test to close the loop.
@@ -0,0 +1,16 @@
1
+ {
2
+ "brokenLocator": "#old-checkout-btn",
3
+ "historicalAttributes": {
4
+ "role": "button",
5
+ "text": "Confirm Order",
6
+ "testid": "checkout-submit"
7
+ },
8
+ "currentAOMSnapshot": [
9
+ {
10
+ "role": "button",
11
+ "name": "Confirm Order",
12
+ "testid": "checkout-submit-v2"
13
+ }
14
+ ],
15
+ "healedLocator": "button[data-testid='checkout-submit-v2']"
16
+ }
@@ -1,115 +1,57 @@
1
1
  ---
2
2
  name: skillspector-security-guard
3
- description: "Audit and verify AI agent skills, prompts, and MCP configurations against 71 vulnerability vectors inspired by NVIDIA SkillSpector."
3
+ description: "Audit and verify AI agent skills, prompts, and MCP configurations against vulnerability vectors inspired by NVIDIA SkillSpector. Use when auditing skills and plugins for prompt-injection and security threats."
4
4
  ---
5
5
 
6
6
  # SkillSpector Security Guard — AI Agent & MCP Security Sentinel
7
7
 
8
- > **Purpose:** Autonomous security auditing, vulnerability vetting, and supply-chain inspection for AI Agent skills, prompt instruction files, Model Context Protocol (MCP) server configurations, and automation scripts.
9
- > **Upstream Heritage:** Synthesized and adapted from **[NVIDIA/SkillSpector](https://github.com/NVIDIA/SkillSpector)** (Apache 2.0).
8
+ > **Purpose:** Autonomous security vetting for AI Agent skills, prompt instructions, Model Context Protocol (MCP) servers, and automation tools.
9
+ > **Heritage:** Inspired by and adapted from **[NVIDIA/SkillSpector](https://github.com/NVIDIA/SkillSpector)** (Apache 2.0).
10
10
 
11
11
  ---
12
12
 
13
- ## 1. The Threat Model for AI Agent Skills
14
-
15
- AI agent skills execute with user-level permissions, terminal shell execution rights, and implicit trust. Unvetted third-party skills, instructions, or MCP configs can introduce severe vulnerabilities:
16
- - **Prompt Injection:** Overriding core system safety rules, steering model logic covertly, or forcing jailbreaks.
17
- - **Data Exfiltration:** Covertly shipping conversation memory, user secrets, or environment keys to external URLs.
18
- - **Privilege Escalation:** Running root/sudo commands, mounting `/var/run/docker.sock`, or stealing SSH/AWS keys.
19
- - **Agent Snooping:** Reading configuration stores (`~/.claude`, `~/.gemini`, `~/.codex`) or parsing `mcp.json` to steal tokens.
20
- - **MCP Tool Poisoning:** Injecting hidden instructions in tool metadata (HTML comments, Unicode homoglyphs, Base64).
21
-
22
- ```mermaid
23
- flowchart TD
24
- CandidateSkill["Candidate Skill / MCP Config / Prompt"] --> Scanner["<b>SkillSpector Sentinel</b><br/>(tools/skillspector.py)"]
25
-
26
- subgraph Vectors["71 Detection Vectors across 17 Categories"]
27
- V1["Prompt Injection & Jailbreaks (P1-P4, P9)"]
28
- V2["Data Exfiltration & Sinks (E1-E5)"]
29
- V3["Privilege Escalation (PE1-PE5)"]
30
- V4["Agent Snooping (~/.claude, mcp.json) (AS1-AS3)"]
31
- V5["Tool Poisoning & Homoglyphs (TP1-TP4)"]
32
- V6["Behavioral AST & Deserialization (AST1-AST10)"]
33
- end
34
-
35
- Scanner --> Vectors
36
- Vectors --> ProhibitionGuard["<b>Prohibition Context Guard</b><br/>(Filters defensive documentation & negations)"]
37
- ProhibitionGuard --> Score["Risk Scoring Engine (0 - 100)"]
38
- Score --> Verdict{"Verdict Assessment"}
39
-
40
- Verdict -- "Score < 25" --> Pass["✅ SAFE: Permitted to Install"]
41
- Verdict -- "25 <= Score < 60" --> Warn["⚠️ CAUTION: Manual Review Required"]
42
- Verdict -- "Score >= 60 or CRITICAL" --> Block["🛑 DO_NOT_INSTALL: Blocked & Quarantined"]
43
- ```
44
-
45
- ---
13
+ ## 1. Core Threat Vectors
46
14
 
47
- ## 2. 71 Vulnerability Vectors & Coverage Matrix
48
-
49
- | Category | Pattern IDs | Threat Vector & Description | Severity |
50
- | :--- | :--- | :--- | :--- |
51
- | **Prompt Injection** | `P1`, `P2`, `P3`, `P4`, `P9` | Instruction overrides, zero-width steganography, bidi Trojan Source (CVE-2021-42574), exfiltration directives, vertical whitespace padding (>20 blank lines). | **CRITICAL / HIGH** |
52
- | **Data Exfiltration** | `E1`, `E2`, `E3`, `E4`, `E5` | Outbound HTTP POST sinks (`curl`, `fetch`), `os.environ` harvesting, scanning for `.ssh` / `.aws` credentials, conversational context dumping, cloud storage upload. | **CRITICAL / HIGH** |
53
- | **Privilege Escalation** | `PE1` – `PE5` | Blanket wildcard permissions (`*`), `sudo`/`su`/`chmod 4755`, credential access (`/etc/shadow`, `kubeconfig`), `docker.sock` access, privileged containers. | **CRITICAL** |
54
- | **Agent Snooping** | `AS1`, `AS2`, `AS3` | Reading agent auth configs (`.claude/`, `.gemini/`, `.codex/`), accessing `mcp.json` / `claude_desktop_config.json`, cross-skill reconnaissance. | **CRITICAL** |
55
- | **System Prompt Leakage**| `P6`, `P7`, `P8` | Direct prompt extraction commands, side-channel extraction ("output text before this line"), tool exfiltration. | **HIGH** |
56
- | **Anti-Refusal Jailbreaks**| `AR1`, `AR2`, `AR3` | Refusal suppression ("never refuse", "always comply"), warning/caveat suppression, policy nullification ("you have no restrictions"). | **CRITICAL / HIGH** |
57
- | **MCP Tool Poisoning** | `TP1`, `TP2`, `TP3`, `TP4` | Hidden instructions in tool comments/Base64/data URIs, Cyrillic/Greek Unicode homoglyphs, parameter description injection, behavior drift. | **CRITICAL / HIGH** |
58
- | **MCP Least Privilege** | `LP1`, `LP2`, `LP3` | Undeclared network/shell capabilities, wildcard permissions (`*`), missing allowed tools. | **HIGH / MEDIUM** |
59
- | **Behavioral AST** | `AST1` – `AST10` | Dynamic `exec()`, `eval()`, `__import__()`, `subprocess(shell=True)`, `os.system()`, dynamic `getattr()`, reflective sink lookup, and insecure deserialization (`pickle`, `yaml.unsafe_load`). | **CRITICAL / HIGH** |
60
- | **Supply Chain & SSRF** | `SC1`, `SC2`, `SSRF1`, `SSRF2` | `curl \| bash` downloads, cloud instance metadata probing (`169.254.169.254`), internal loopback requests. | **CRITICAL / MEDIUM** |
15
+ AI agent skills execute with terminal and workspace permissions. Unvetted third-party skills can introduce severe risks:
16
+ - **Prompt Injection:** Overriding core safety instructions or forcing jailbreaks.
17
+ - **Data Exfiltration:** Covertly exfiltrating conversation memory, environment keys, or tokens to external endpoints.
18
+ - **Privilege Escalation:** Running unauthorized `sudo`/root commands or accessing sensitive credentials (`.ssh`, `.aws`).
19
+ - **Agent Snooping:** Accessing IDE authentication configs (`~/.gemini`, `~/.claude`) or parsing `mcp.json`.
20
+ - **Tool Poisoning:** Injecting obfuscated Unicode homoglyphs, Base64 payloads, or hidden comments into tool schemas.
61
21
 
62
22
  ---
63
23
 
64
- ## 3. NVIDIA Prohibition Context Engine (Defensive Language Guard)
65
-
66
- In software testing and quality engineering hubs, security rules and documentation frequently describe anti-patterns (e.g., *"Never use eval()"*, *"Strictly forbidden: do not run sudo"*).
24
+ ## 2. Threat Vector Categories
67
25
 
68
- **SkillSpector Sentinel incorporates the NVIDIA Prohibition Context Engine:**
69
- 1. **Direct Negative Imperatives:** Matches governed by preceding negations (`never`, `do not`, `don't`, `must not`, `strictly forbidden`, `avoid`) are exempted.
70
- 2. **Defensive Callouts:** Patterns appearing inside `> [!CAUTION]`, `> [!WARNING]`, or `> [!IMPORTANT]` documentation blocks do not trigger false alerts.
71
- 3. **Emoji ZWJ Preservation:** Legitimate Zero-Width Joiner emoji sequences (e.g. `👨‍👩‍👧‍👦`, `🏳️‍🌈`) are preserved, while standalone steganographic zero-width bytes are flagged.
72
- 4. **Request-Anchored SSRF:** Localhost references in documentation or comments are ignored; only active request-issuing functions (`fetch('http://localhost...')`, `curl`) trigger SSRF checks.
26
+ | Category | Description | Severity |
27
+ | :--- | :--- | :--- |
28
+ | **Prompt Injection** | Instruction overrides, zero-width steganography, bidi Trojan Source, exfiltration directives. | **CRITICAL** |
29
+ | **Data Exfiltration** | Outbound HTTP POST sinks (`curl`, `fetch`), harvesting `os.environ`, scanning credentials. | **CRITICAL** |
30
+ | **Privilege Escalation** | Wildcard permissions (`*`), `sudo`/`su`, `/etc/shadow`, Docker socket access. | **CRITICAL** |
31
+ | **Agent Snooping** | Reading agent auth configs (`.gemini/`, `.claude/`), extracting `mcp.json` tokens. | **CRITICAL** |
32
+ | **Behavioral AST** | Dynamic `exec()`, `eval()`, `__import__()`, `subprocess(shell=True)`, `os.system()`, insecure deserialization (`pickle`). | **CRITICAL / HIGH** |
33
+ | **Supply Chain & SSRF** | `curl \| bash` downloads, cloud instance metadata probing (`169.254.169.254`). | **CRITICAL** |
73
34
 
74
35
  ---
75
36
 
76
- ## 4. Operational Runbook & CLI Usage
37
+ ## 3. Defense Guard & Prohibition Context
77
38
 
78
- ### 1. Autonomous Pre-Install Audit
79
- Before loading or installing any new skill, rule, or MCP tool into the environment, run:
80
- ```bash
81
- # Scan a single skill file or directory
82
- python3 tools/skillspector.py path/to/skill/
39
+ To prevent false alarms in educational documentation (e.g. *"Never run sudo"*):
40
+ 1. **Negative Imperatives:** Matches preceded by negations (`never`, `do not`, `avoid`, `forbidden`) are recognized as defensive rules.
41
+ 2. **Defensive Callouts:** Patterns appearing inside `> [!WARNING]` or `> [!CAUTION]` blocks are evaluated with contextual negative verbs.
42
+ 3. **Emoji ZWJ Handling:** Legitimate Zero-Width Joiner sequences are preserved while hidden steganographic bytes are flagged.
83
43
 
84
- # Or using the agent-qa unified CLI:
85
- agent-qa skillspector path/to/skill/
44
+ ---
86
45
 
87
- # Or via npx (zero-install):
88
- npx synapse-hub skillspector path/to/skill/
89
- ```
46
+ ## 4. CLI Audit Commands
90
47
 
91
- ### 2. Multi-Format Reporting for CI/CD
92
48
  ```bash
93
- # Generate GitHub Actions SARIF format (Security Tab integration)
94
- python3 tools/skillspector.py .agents/skills/ --format sarif --output reports/skillspector.sarif
49
+ # Scan a specific candidate skill or file
50
+ synapse skillspector path/to/SKILL.md
95
51
 
96
- # Generate JSON for automated policy gating
97
- python3 tools/skillspector.py .agents/skills/ --format json --output reports/skillspector.json
52
+ # Scan entire skills directory
53
+ synapse skillspector --scan-skills
98
54
 
99
- # Strict gating: Exit with error code 1 if any CRITICAL or DO_NOT_INSTALL findings exist
100
- python3 tools/skillspector.py .agents/skills/ --strict
55
+ # Fail CI pipeline if high or critical risks are detected
56
+ synapse skillspector --scan-skills --strict
101
57
  ```
102
-
103
- ### 3. Verdict Interpretation & Action Table
104
-
105
- | Risk Score | Verdict | Permitted Action | Mandatory Remediation |
106
- | :---: | :---: | :---: | :--- |
107
- | **0 – 24** | **`SAFE`** | ✅ Install & execute freely. | No remediation required; skill is verified clean. |
108
- | **25 – 59** | **`CAUTION`** | ⚠️ Hold for manual inspection. | Inspect flagged lines; replace unpinned dependencies or wildcards. |
109
- | **60 – 100** | **`DO_NOT_INSTALL`** | 🛑 Blocked immediately. | Quarantined. Contains active prompt injection, RCE sink, or credential theft. |
110
-
111
- ---
112
-
113
- ## 5. Acknowledgments & Upstream Attribution
114
-
115
- This skill and its underlying inspection engine (`tools/skillspector.py`) are directly based on the research, pattern definitions, and defensive grammar created by the **NVIDIA AI Security Team** in **[NVIDIA/SkillSpector](https://github.com/NVIDIA/SkillSpector)** (Apache License 2.0).
@@ -0,0 +1,12 @@
1
+ {
2
+ "mcpServers": {
3
+ "playwright-live": {
4
+ "command": "npx",
5
+ "args": [
6
+ "-y",
7
+ "@modelcontextprotocol/server-playwright"
8
+ ],
9
+ "sandboxPolicy": "HEADLESS_VIRTUAL_DISPLAY"
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: surgical-coding-principles
3
+ description: "Enforce four behavioral principles (Think Before Coding, Simplicity First, Surgical Changes, Goal-Driven Execution) when writing or modifying test automation code. Use when implementing Page Classes, editing test scripts, or changing hub tools to prevent assumption drift and over-engineering."
4
+ ---
5
+
6
+ # Surgical Coding Principles — Enterprise Minimal-Diff Discipline
7
+
8
+ Specialized skill for reducing the three classic LLM coding failure modes — silent assumptions, over-engineering, and out-of-scope edits — across Page Classes, test scripts, and `tools/*.py` maintenance.
9
+
10
+ ---
11
+
12
+ ## 1. The Four Principles
13
+
14
+ ```mermaid
15
+ flowchart LR
16
+ A["<b>1. Think Before Coding</b><br/>State assumptions, surface ambiguity"] --> B["<b>2. Simplicity First</b><br/>Minimum code, nothing speculative"]
17
+ B --> C["<b>3. Surgical Changes</b><br/>Every diff line traces to the request"]
18
+ C --> D["<b>4. Goal-Driven Execution</b><br/>Success criteria verified before done"]
19
+ ```
20
+
21
+ **Tradeoff:** these principles bias toward caution over speed. For trivial, single-line fixes, apply judgment and do not ritualize.
22
+
23
+ ## 2. Principle 1: Think Before Coding
24
+
25
+ - **Rule:** Do not assume; do not hide confusion. Before implementing, state assumptions explicitly and ask when uncertain.
26
+ - **Enforcement:**
27
+ - If multiple interpretations of the request exist, present them — never pick silently.
28
+ - If a simpler approach exists, say so before writing code; push back when warranted.
29
+ - If something is unclear, stop, name what is confusing, and ask. Proceeding on a guess converts one clarification into one full rework cycle.
30
+
31
+ ## 3. Principle 2: Simplicity First
32
+
33
+ - **Rule:** Write the minimum code that solves the stated problem. Nothing speculative.
34
+ - **Forbidden:** features beyond what was asked; abstractions for single-use code; "flexibility" or configurability that was not requested; error handling for impossible scenarios.
35
+ - **Self-test:** if 200 lines were written and 50 would do, rewrite. Ask: "Would a senior engineer call this overcomplicated?" If yes, simplify before continuing.
36
+
37
+ ## 4. Principle 3: Surgical Changes
38
+
39
+ - **Rule:** Touch only what the request requires. Clean up only the mess your own change created.
40
+ - **When editing existing code (Page Classes, test scripts, hub tools):**
41
+ - Do not "improve" adjacent code, comments, or formatting.
42
+ - Do not refactor what is not broken; match the existing style even if you would write it differently.
43
+ - If unrelated dead code is noticed, mention it in the report — do not delete it.
44
+ - **Orphan rule:** remove imports, variables, or functions that YOUR change made unused; leave pre-existing dead code untouched unless asked.
45
+ - **The test:** every changed line must trace directly to the user's request.
46
+
47
+ ## 5. Principle 4: Goal-Driven Execution
48
+
49
+ - **Rule:** Transform every task into a verifiable goal with explicit success criteria, then loop until verified.
50
+ - **Rewrites:** "add validation" becomes "write tests for invalid inputs, then make them pass"; "fix the bug" becomes "write a test that reproduces it, then make it pass" (pair with `test-driven-development`).
51
+ - **Multi-step tasks** state a plan where every step carries its own verify action:
52
+
53
+ | Step | Verify |
54
+ |---|---|
55
+ | 1. Modify the Page Class method | Selector verified live under 200ms (`playwright-live-interaction`) |
56
+ | 2. Update the calling scripts | Affected TCs pass via `tools/test_impact.py` subset |
57
+ | 3. Hub tool change | `python3 tools/verify_all.py --mode hub` reports 9/9 gates |
58
+
59
+ Strong success criteria allow independent looping; weak criteria ("make it work") force constant clarification.
60
+
61
+ ## 6. Pre-Diff Self-Check
62
+
63
+ Before handing back any change, verify all boxes:
64
+
65
+ - [ ] Assumptions were stated before implementation started
66
+ - [ ] No speculative abstraction, option, or config was introduced
67
+ - [ ] Every changed line traces to the request
68
+ - [ ] Orphans created by this change were removed; pre-existing dead code was left alone
69
+ - [ ] Success criteria were defined up front and verified with real command output
70
+
71
+ These principles are working if diffs shrink, rewrites due to overcomplication disappear, and clarifying questions arrive before implementation instead of after mistakes.
72
+
73
+ ## 7. Boundary vs Sibling Skills (Do Not Confuse)
74
+
75
+ | Sibling | Owns | Hand-off |
76
+ |---|---|---|
77
+ | `clean-pom-crafter` | Page Class architecture, locator tiers | This skill governs HOW the change is made, not WHAT the POM looks like |
78
+ | `code-refactoring-refactor-clean` | Deliberate debt-elimination refactors | A refactor task still obeys surgical scope: diff lines trace to the refactor request |
79
+ | `lean-code-ladder` | The 7-rung reuse-first decision ladder | Use the ladder to choose the solution; use this skill to keep the diff disciplined |
80
+
81
+ ## 8. Reference Documentation
82
+
83
+ - `python3 tools/verify_all.py --mode hub` — 9 Quality Gates as the verification anchor for Goal-Driven Execution.
84
+ - `python3 tools/test_impact.py --git-diff` — scope the blast radius of a change before editing.
85
+ - `python3 tools/infer_linter.py` — confirm no fake-pass assertions were introduced by the change.
86
+
87
+ ## 9. Attribution
88
+
89
+ Adapted from **andrej-karpathy-skills** (https://github.com/multica-ai/andrej-karpathy-skills) — MIT License (declared in repository `plugin.json`), by forrestchang, derived from Andrej Karpathy's published observations on LLM coding pitfalls. Principles re-scoped for enterprise QA automation in Synapse Hub; wording, structure, and examples modified.
@@ -0,0 +1,46 @@
1
+ # Example: Surgical Change vs Scope Creep
2
+
3
+ Request: "The `verifyKPI` step in the report test is flaky because it asserts on a live-computed percentage; make it deterministic."
4
+
5
+ ## GOOD — every line traces to the request
6
+
7
+ ```text
8
+ Changed:
9
+ - tests/TC-305_ExportReport: replace live percentage comparison with a
10
+ fixture-backed expected value passed via test data.
11
+ - Test data: add deterministic expected KPI values for the report fixture.
12
+
13
+ Removed (orphans of this change):
14
+ - unused import of the random helper previously used for sample values.
15
+ ```
16
+
17
+ Why it passes: two touched files, both directly required by the request; the
18
+ orphan removed was created by this very change.
19
+
20
+ ## BAD — scope creep
21
+
22
+ ```text
23
+ Changed:
24
+ - tests/TC-305_ExportReport: deterministic assertion (requested)
25
+ - tests/TC-118_Login: "improved" waiting strategy while passing by
26
+ - page objects: reformatted indentation and reworded comments
27
+ - tools/distill_log.py: renamed a variable that "looked confusing"
28
+ ```
29
+
30
+ Why it fails the Surgical Changes test:
31
+ - TC-118 was not part of the request — a drive-by change hides risk inside an
32
+ unrelated diff.
33
+ - Comment/formatting rewrites bloat the diff and bury the actual fix in review.
34
+ - Renaming inside a hub tool was not requested; pre-existing code is left
35
+ alone and mentioned in the report instead.
36
+
37
+ ## Assumption surfacing (Think Before Coding)
38
+
39
+ Before implementing, the GOOD flow states:
40
+
41
+ > "Assumption: the fixture data can express the expected KPI as an exact value.
42
+ > If the report computes values the fixture cannot predict, I will need a
43
+ > fixture extension — confirming before I change the test data schema."
44
+
45
+ The BAD flow silently assumes the fixture is sufficient and discovers the
46
+ schema gap after the diff is already written.