@teevee98/synapse-hub 0.0.0-stage → 3.8.3

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 (369) hide show
  1. package/.agents/agents/api-engineer.md +67 -0
  2. package/.agents/agents/failure-analyst.md +75 -0
  3. package/.agents/agents/live-explorer.md +70 -0
  4. package/.agents/agents/orchestrator.md +104 -0
  5. package/.agents/agents/perf-engineer.md +74 -0
  6. package/.agents/agents/pom-crafter.md +112 -0
  7. package/.agents/agents/quality-gatekeeper.md +87 -0
  8. package/.agents/agents/test-designer.md +73 -0
  9. package/.agents/agents/test-runner.md +67 -0
  10. package/.agents/rules/author-integrity-guard.md +33 -0
  11. package/.agents/rules/communication-style.md +18 -0
  12. package/.agents/rules/context-engineering.md +37 -0
  13. package/.agents/rules/git-push-protocol.md +33 -0
  14. package/.agents/rules/graphify.md +14 -0
  15. package/.agents/rules/lessons-learned.md +25 -0
  16. package/.agents/rules/mandatory-playwright-live.md +25 -0
  17. package/.agents/rules/mobile_appium_rules.md +43 -0
  18. package/.agents/rules/performance_testing_rules.md +35 -0
  19. package/.agents/rules/skill-precedence.md +29 -0
  20. package/.agents/rules/systematic-debugging.md +36 -0
  21. package/.agents/skills/actor-qa-swarm/SKILL.md +77 -0
  22. package/.agents/skills/actor-qa-swarm/examples/broker_sharding_sample.json +12 -0
  23. package/.agents/skills/agent-orchestration-multi-agent-optimize/SKILL.md +88 -0
  24. package/.agents/skills/agent-orchestration-multi-agent-optimize/examples/swarm_workload_config.json +15 -0
  25. package/.agents/skills/agentless-qa-repair/SKILL.md +69 -0
  26. package/.agents/skills/agentless-qa-repair/examples/healing_report_sample.json +17 -0
  27. package/.agents/skills/agentless-qa-repair/examples/three_phase_repair_workflow.md +40 -0
  28. package/.agents/skills/antigravity-test-sentinel/SKILL.md +63 -0
  29. package/.agents/skills/antigravity-test-sentinel/examples/dod_gate_policy.json +11 -0
  30. package/.agents/skills/antigravity-test-sentinel/examples/sprint_dod_enforcement.md +47 -0
  31. package/.agents/skills/api-network-mocking-interception/SKILL.md +142 -0
  32. package/.agents/skills/api-network-mocking-interception/examples/network_route_stub.json +9 -0
  33. package/.agents/skills/api-spec-to-e2e-matrix/SKILL.md +80 -0
  34. package/.agents/skills/api-spec-to-e2e-matrix/examples/sample_openapi.json +19 -0
  35. package/.agents/skills/architecture-decision-records/SKILL.md +64 -0
  36. package/.agents/skills/architecture-decision-records/examples/0001-record-architecture-decisions.md +12 -0
  37. package/.agents/skills/auth-session-and-cookie-manager/SKILL.md +75 -0
  38. package/.agents/skills/auth-session-and-cookie-manager/examples/multi_role_auth_matrix.md +70 -0
  39. package/.agents/skills/auth-session-and-cookie-manager/examples/storage_state_sample.json +11 -0
  40. package/.agents/skills/backend-load-and-stress-patterns/SKILL.md +85 -0
  41. package/.agents/skills/backend-load-and-stress-patterns/examples/k6_load_test_sample.js +13 -0
  42. package/.agents/skills/backend-load-and-stress-patterns/references/k6_load_template.js +82 -0
  43. package/.agents/skills/bats-testing-patterns/SKILL.md +100 -0
  44. package/.agents/skills/bats-testing-patterns/examples/cli_runner_test.bats +6 -0
  45. package/.agents/skills/bats-testing-patterns/resources/implementation-playbook.md +614 -0
  46. package/.agents/skills/clean-pom-crafter/SKILL.md +110 -0
  47. package/.agents/skills/clean-pom-crafter/examples/standard_test_case.groovy +28 -0
  48. package/.agents/skills/clean-pom-crafter/references/pom_patterns.groovy +138 -0
  49. package/.agents/skills/code-refactoring-refactor-clean/SKILL.md +64 -0
  50. package/.agents/skills/code-refactoring-refactor-clean/examples/refactored_page_sample.groovy +9 -0
  51. package/.agents/skills/code-refactoring-refactor-clean/examples/refactored_playwright_pom.ts +52 -0
  52. package/.agents/skills/code-refactoring-refactor-clean/resources/implementation-playbook.md +881 -0
  53. package/.agents/skills/consumer-driven-contract-testing/SKILL.md +147 -0
  54. package/.agents/skills/consumer-driven-contract-testing/examples/order_service_pact.json +45 -0
  55. package/.agents/skills/db-state-verifier-and-seeder/SKILL.md +123 -0
  56. package/.agents/skills/db-state-verifier-and-seeder/examples/db_fixture_seed.json +12 -0
  57. package/.agents/skills/e2e-testing-patterns/SKILL.md +103 -0
  58. package/.agents/skills/e2e-testing-patterns/examples/playwright_sharded_config.ts +12 -0
  59. package/.agents/skills/e2e-testing-patterns/resources/implementation-playbook.md +522 -0
  60. package/.agents/skills/event-stream-qa-orchestrator/SKILL.md +79 -0
  61. package/.agents/skills/event-stream-qa-orchestrator/examples/timeline_sample.jsonl +2 -0
  62. package/.agents/skills/failure-autopsy-and-healing/SKILL.md +66 -0
  63. package/.agents/skills/failure-autopsy-and-healing/examples/closed_loop_healing_walkthrough.md +48 -0
  64. package/.agents/skills/failure-autopsy-and-healing/examples/sample_junit_failure.xml +8 -0
  65. package/.agents/skills/failure-autopsy-and-healing/references/healing_matrix.md +64 -0
  66. package/.agents/skills/failure-autopsy-and-healing/references/qa_investigation_protocol.md +56 -0
  67. package/.agents/skills/failure-autopsy-and-healing/scripts/triage_failures.sh +83 -0
  68. package/.agents/skills/file-and-report-validator/SKILL.md +90 -0
  69. package/.agents/skills/file-and-report-validator/examples/sample_export_schema.json +14 -0
  70. package/.agents/skills/flaky-test-sentinel-and-quarantine/SKILL.md +114 -0
  71. package/.agents/skills/flaky-test-sentinel-and-quarantine/examples/quarantine_registry.json +11 -0
  72. package/.agents/skills/gherkin-to-suite/SKILL.md +103 -0
  73. package/.agents/skills/gherkin-to-suite/examples/checkout.feature +39 -0
  74. package/.agents/skills/gherkin-to-suite/examples/suite_report_sample.json +334 -0
  75. package/.agents/skills/github-actions-templates/SKILL.md +77 -0
  76. package/.agents/skills/github-actions-templates/examples/matrix_test_pipeline.yml +8 -0
  77. package/.agents/skills/graphify-impact-analyzer/SKILL.md +76 -0
  78. package/.agents/skills/graphify-impact-analyzer/examples/dependency_blast_radius.json +8 -0
  79. package/.agents/skills/katalon-cli-runner/SKILL.md +76 -0
  80. package/.agents/skills/katalon-cli-runner/examples/headless_kre_exec.sh +3 -0
  81. package/.agents/skills/katalon-cli-runner/references/groovy-patterns.md +209 -0
  82. package/.agents/skills/katalon-cli-runner/references/katalon-api.md +155 -0
  83. package/.agents/skills/katalon-cli-runner/references/runner_commands.md +67 -0
  84. package/.agents/skills/lam-script-generator/SKILL.md +123 -0
  85. package/.agents/skills/lam-script-generator/examples/user_story_sample.md +8 -0
  86. package/.agents/skills/lean-code-ladder/SKILL.md +94 -0
  87. package/.agents/skills/lean-code-ladder/examples/ladder_walkthrough.md +37 -0
  88. package/.agents/skills/lean-impact-scoreboard/SKILL.md +48 -0
  89. package/.agents/skills/lean-impact-scoreboard/examples/sample_benchmark_gain.md +20 -0
  90. package/.agents/skills/lean-impact-scoreboard/examples/sample_scoreboard.md +15 -0
  91. package/.agents/skills/meta-prompt-crafter/SKILL.md +107 -0
  92. package/.agents/skills/meta-prompt-crafter/examples/qa_prompt_template.md +35 -0
  93. package/.agents/skills/mipro-prompt-compiler/SKILL.md +59 -0
  94. package/.agents/skills/mipro-prompt-compiler/examples/compiled_module_sample.json +22 -0
  95. package/.agents/skills/mipro-prompt-compiler/examples/dspy_assertion_optimizer_case.md +46 -0
  96. package/.agents/skills/mobile-appium-som/SKILL.md +88 -0
  97. package/.agents/skills/mobile-appium-som/examples/BaseScreen.java +88 -0
  98. package/.agents/skills/mobile-appium-som/examples/LoginScreen.java +46 -0
  99. package/.agents/skills/mobile-appium-som/examples/TC_MobileLogin.java +43 -0
  100. package/.agents/skills/persistent-planning-files/SKILL.md +108 -0
  101. package/.agents/skills/persistent-planning-files/examples/task_plan_example.md +56 -0
  102. package/.agents/skills/playwright-live-interaction/SKILL.md +131 -0
  103. package/.agents/skills/playwright-live-interaction/examples/live_probe_script.js +5 -0
  104. package/.agents/skills/playwright-live-interaction/references/advanced_superpowers.md +160 -0
  105. package/.agents/skills/playwright-live-interaction/references/compact_accessibility_snapshots.md +75 -0
  106. package/.agents/skills/playwright-live-interaction/references/recipes.md +388 -0
  107. package/.agents/skills/playwright-live-interaction/references/swarm_orchestration.md +134 -0
  108. package/.agents/skills/playwright-webapp-testing/SKILL.md +93 -0
  109. package/.agents/skills/playwright-webapp-testing/examples/server_lifecycle_playwright.py +63 -0
  110. package/.agents/skills/qa-aci-interface/SKILL.md +67 -0
  111. package/.agents/skills/qa-aci-interface/examples/surgical_code_window_walkthrough.md +40 -0
  112. package/.agents/skills/qa-aci-interface/examples/surgical_edit_sample.json +12 -0
  113. package/.agents/skills/qa-memory-os/SKILL.md +80 -0
  114. package/.agents/skills/qa-memory-os/examples/archival_memory_sample.json +21 -0
  115. package/.agents/skills/rbt-manual-testing/SKILL.md +137 -0
  116. package/.agents/skills/rbt-manual-testing/examples/checkout_rbt_manual_suite.md +25 -0
  117. package/.agents/skills/rbt-manual-testing/references/field_validation_checklist.md +29 -0
  118. package/.agents/skills/repo-quality-audit/SKILL.md +68 -0
  119. package/.agents/skills/repo-quality-audit/examples/sample_audit_walkthrough.md +15 -0
  120. package/.agents/skills/repo-quality-audit/examples/sample_repo_audit.md +33 -0
  121. package/.agents/skills/review-spec/SKILL.md +60 -0
  122. package/.agents/skills/review-spec/examples/pocock_grilling_decision_rubric.md +40 -0
  123. package/.agents/skills/review-spec/examples/sample_spec_review.md +33 -0
  124. package/.agents/skills/security-dast-sentinel/SKILL.md +119 -0
  125. package/.agents/skills/security-dast-sentinel/examples/dast_scan_config.json +10 -0
  126. package/.agents/skills/security-dast-sentinel/references/AI-AND-LLM.md +113 -0
  127. package/.agents/skills/security-dast-sentinel/references/ATTACK-CLASSES.md +89 -0
  128. package/.agents/skills/security-dast-sentinel/references/dast_recipes.ts +33 -0
  129. package/.agents/skills/self-healing-locator/SKILL.md +86 -0
  130. package/.agents/skills/self-healing-locator/examples/aom_diff_sample.json +16 -0
  131. package/.agents/skills/senior-code-review/SKILL.md +108 -0
  132. package/.agents/skills/senior-code-review/examples/sample_review_walkthrough.md +29 -0
  133. package/.agents/skills/skillspector-security-guard/SKILL.md +57 -0
  134. package/.agents/skills/skillspector-security-guard/examples/audit_threat_vectors_report.json +35 -0
  135. package/.agents/skills/skillspector-security-guard/examples/safe_mcp_config.json +12 -0
  136. package/.agents/skills/surgical-coding-principles/SKILL.md +89 -0
  137. package/.agents/skills/surgical-coding-principles/examples/surgical_vs_scope_creep.md +46 -0
  138. package/.agents/skills/synthetic-test-data-generator/SKILL.md +135 -0
  139. package/.agents/skills/synthetic-test-data-generator/examples/idempotent_data_recipe.json +9 -0
  140. package/.agents/skills/systematic-debugging/SKILL.md +100 -0
  141. package/.agents/skills/systematic-debugging/examples/four_phase_case.md +44 -0
  142. package/.agents/skills/technical-debt-harvester/SKILL.md +70 -0
  143. package/.agents/skills/technical-debt-harvester/examples/sample_debt_ledger.md +25 -0
  144. package/.agents/skills/technical-debt-harvester/examples/sample_ledger_output.md +20 -0
  145. package/.agents/skills/test-driven-development/SKILL.md +114 -0
  146. package/.agents/skills/test-driven-development/examples/red_green_refactor_qa.md +78 -0
  147. package/.agents/skills/token-and-context-optimizer/SKILL.md +70 -0
  148. package/.agents/skills/token-and-context-optimizer/examples/distilled_log_sample.txt +3 -0
  149. package/.agents/skills/token-and-context-optimizer/references/context_engineering_guide.md +49 -0
  150. package/.agents/skills/tot-exploratory-testing/SKILL.md +59 -0
  151. package/.agents/skills/tot-exploratory-testing/examples/payment_gateway_tot_tree.json +62 -0
  152. package/.agents/skills/tot-exploratory-testing/examples/tot_graph_sample.json +35 -0
  153. package/.agents/skills/verification-before-completion/SKILL.md +100 -0
  154. package/.agents/skills/verification-before-completion/examples/evidence_log_example.md +46 -0
  155. package/.agents/skills/visual-regression-sentinel/SKILL.md +82 -0
  156. package/.agents/skills/visual-regression-sentinel/examples/visual_mask_rules.json +9 -0
  157. package/.agents/skills/wcag-audit-patterns/SKILL.md +77 -0
  158. package/.agents/skills/wcag-audit-patterns/examples/wcag_compliance_checklist.json +10 -0
  159. package/.agents/skills/wcag-audit-patterns/resources/implementation-playbook.md +541 -0
  160. package/.agents/skills/web-agent-gym-benchmarking/SKILL.md +62 -0
  161. package/.agents/skills/web-agent-gym-benchmarking/examples/benchmark_report_sample.json +22 -0
  162. package/.agents/skills/web-agent-gym-benchmarking/examples/enterprise_tasks_suite.json +38 -0
  163. package/.agents/skills/web-vitals-and-performance-profiler/SKILL.md +65 -0
  164. package/.agents/skills/web-vitals-and-performance-profiler/examples/cwv_budget_policy.json +6 -0
  165. package/.agents/skills/web-vitals-and-performance-profiler/examples/playwright_cwv_profiler_fixture.ts +118 -0
  166. package/.agents/templates/completion_report.md +57 -0
  167. package/.agents/workflows/analyze_requirement_document.md +18 -0
  168. package/.agents/workflows/export_testcases_excel.md +32 -0
  169. package/.agents/workflows/generate_combinatorial_test_data.md +28 -0
  170. package/.agents/workflows/generate_cross_module_test_plan.md +37 -0
  171. package/.agents/workflows/generate_manual_testcases_rbt.md +56 -0
  172. package/.agents/workflows/generate_requirements_from_website.md +25 -0
  173. package/.agents/workflows/generate_testcases_from_requirements.md +21 -0
  174. package/.agents/workflows/graphify.md +10 -0
  175. package/.agents/workflows/test-impact.md +15 -0
  176. package/.agents/workflows/verify.md +34 -0
  177. package/.cursor/rules/agents.mdc +16 -0
  178. package/.cursor/rules/language.mdc +7 -0
  179. package/.cursor/rules/synapse-qa.mdc +24 -0
  180. package/.cursorrules +27 -0
  181. package/.dockerignore +53 -0
  182. package/.pre-commit-hooks.yaml +14 -0
  183. package/.windsurfrules +26 -0
  184. package/AGENTS.md +86 -0
  185. package/CLAUDE.md +54 -0
  186. package/Dockerfile +81 -0
  187. package/LICENSE +52 -0
  188. package/NOTICE +264 -0
  189. package/README.en.md +171 -0
  190. package/README.md +170 -2
  191. package/action.yml +51 -0
  192. package/agentskills.json +16 -0
  193. package/bin/agent-qa.js +138 -0
  194. package/docker-compose.yml +74 -0
  195. package/docs/ARCHITECTURE.en.md +198 -0
  196. package/docs/ARCHITECTURE.md +199 -0
  197. package/docs/CI_CD_INTEGRATION.en.md +170 -0
  198. package/docs/CI_CD_INTEGRATION.md +170 -0
  199. package/docs/CLI_REFERENCE.en.md +174 -0
  200. package/docs/CLI_REFERENCE.md +176 -0
  201. package/docs/CONTRIBUTING.en.md +49 -0
  202. package/docs/CONTRIBUTING.md +49 -0
  203. package/docs/PERFORMANCE_AUDIT_REPORT.md +783 -0
  204. package/docs/PLUGIN_DEVELOPMENT_GUIDE.md +127 -0
  205. package/docs/QUALITY_GATES.en.md +118 -0
  206. package/docs/QUALITY_GATES.md +118 -0
  207. package/docs/TOKEN_QUOTA_PLAYBOOK.md +41 -0
  208. package/docs/TOOL_CATALOG.md +129 -0
  209. package/docs/adopted-ecosystem-tools.md +96 -0
  210. package/docs/research/EXTERNAL_AGENT_SKILLS_SURVEY.md +1062 -0
  211. package/docs/research/agent_skill_training_analysis.md +1358 -0
  212. package/docs/schemas/synapse.config.schema.json +86 -0
  213. package/package.json +94 -4
  214. package/plugin.json +31 -0
  215. package/scripts/generate_skill_examples.py +244 -0
  216. package/scripts/install.ps1 +112 -0
  217. package/scripts/install_global_plugin.ps1 +94 -0
  218. package/scripts/install_global_plugin.sh +49 -0
  219. package/scripts/lint_skills.ps1 +57 -0
  220. package/scripts/package_dist.py +337 -0
  221. package/scripts/setup.sh +59 -0
  222. package/scripts/update_hub.ps1 +19 -0
  223. package/scripts/update_hub.sh +15 -0
  224. package/skills_manifest.json +854 -0
  225. package/synapse.config.json +31 -0
  226. package/templates/PROJECT_AI_GUIDE_TEMPLATE.md +111 -0
  227. package/templates/PROJECT_STATE_TEMPLATE.md +20 -0
  228. package/templates/ai_bridges/CLAUDE.md +54 -0
  229. package/templates/ai_bridges/copilot-instructions.md +20 -0
  230. package/templates/ai_bridges/cursor_synapse_qa.mdc +24 -0
  231. package/templates/ai_bridges/windsurfrules +26 -0
  232. package/templates/ci/github-actions-synapse.yml +95 -0
  233. package/templates/ci/gitlab-ci-synapse.yml +16 -0
  234. package/templates/ui/index.html +1069 -0
  235. package/templates/welcome.html.tmpl +2074 -0
  236. package/tools/.infer_baseline.json +30 -0
  237. package/tools/TOOLS_RUNBOOK.md +1553 -0
  238. package/tools/TOOL_CATALOG.json +1769 -0
  239. package/tools/__init__.py +43 -0
  240. package/tools/_openapi_parser.py +158 -0
  241. package/tools/agent_canary.py +525 -0
  242. package/tools/agentless_patcher.py +417 -0
  243. package/tools/analyze_project.py +262 -0
  244. package/tools/api_drift_sentinel.py +208 -0
  245. package/tools/api_fuzzer.py +762 -0
  246. package/tools/author_integrity.py +190 -0
  247. package/tools/auto_heal.py +271 -0
  248. package/tools/auto_heal_reflexion.py +532 -0
  249. package/tools/autogen_qa_broker.py +844 -0
  250. package/tools/benchmark_swarm_context.py +394 -0
  251. package/tools/browser_helpers.js +746 -0
  252. package/tools/browsergym_eval.py +236 -0
  253. package/tools/bug_reporter.py +252 -0
  254. package/tools/bump_version.py +423 -0
  255. package/tools/cache_resolver.py +1214 -0
  256. package/tools/check_env.py +426 -0
  257. package/tools/check_version_sync.py +256 -0
  258. package/tools/ci_healing_hook.py +126 -0
  259. package/tools/cli.py +1598 -0
  260. package/tools/config_decoupler.py +253 -0
  261. package/tools/contract_validator.py +141 -0
  262. package/tools/core/__init__.py +70 -0
  263. package/tools/core/adapters.py +431 -0
  264. package/tools/core/circuit_breaker.py +263 -0
  265. package/tools/core/cli_runtime.py +66 -0
  266. package/tools/core/file_lock.py +159 -0
  267. package/tools/core/i18n.py +394 -0
  268. package/tools/core/memory_bus.py +905 -0
  269. package/tools/core/process_supervisor.py +332 -0
  270. package/tools/core/telemetry.py +329 -0
  271. package/tools/count_tokens.py +1267 -0
  272. package/tools/create_mock_docx.py +104 -0
  273. package/tools/dashboard_generator.py +2403 -0
  274. package/tools/db_sandbox.py +675 -0
  275. package/tools/debt_harvester.py +237 -0
  276. package/tools/distill_log.py +161 -0
  277. package/tools/dspy_qa_signatures.py +356 -0
  278. package/tools/e2e_flow_prober.py +132 -0
  279. package/tools/export_postman_collection.py +945 -0
  280. package/tools/flaky_detector.py +389 -0
  281. package/tools/fsm_enforcer.py +450 -0
  282. package/tools/fsm_middleware.py +401 -0
  283. package/tools/fuzz_payloads.py +197 -0
  284. package/tools/generate_allure_report.py +88 -0
  285. package/tools/generate_api_matrix.py +193 -0
  286. package/tools/generate_jmx_plan.py +1322 -0
  287. package/tools/generate_sbom.py +252 -0
  288. package/tools/generate_tc_from_story.py +203 -0
  289. package/tools/generate_test_reports.py +133 -0
  290. package/tools/generate_tool_catalog.py +482 -0
  291. package/tools/gherkin_suite.py +758 -0
  292. package/tools/git_pre_commit_guard.py +298 -0
  293. package/tools/goldfish_review.py +366 -0
  294. package/tools/heal/__init__.py +28 -0
  295. package/tools/heal_pr_automator.py +220 -0
  296. package/tools/heuristic_locator_matcher.py +351 -0
  297. package/tools/hub_publisher.py +623 -0
  298. package/tools/humanize_linter.py +438 -0
  299. package/tools/infer_linter.py +977 -0
  300. package/tools/init_config.py +306 -0
  301. package/tools/interview_story.py +116 -0
  302. package/tools/jira_sync.py +566 -0
  303. package/tools/jtl_analyzer.py +474 -0
  304. package/tools/lint/__init__.py +30 -0
  305. package/tools/lint_ai_docs.py +374 -0
  306. package/tools/lookup_tc.py +165 -0
  307. package/tools/lookup_xpath.py +167 -0
  308. package/tools/matrix_sharder.py +148 -0
  309. package/tools/mcp/__init__.py +18 -0
  310. package/tools/mcp_docx_server.ps1 +13 -0
  311. package/tools/mcp_docx_server.py +851 -0
  312. package/tools/mcp_excel_server.ps1 +13 -0
  313. package/tools/mcp_excel_server.py +441 -0
  314. package/tools/mcp_server.py +725 -0
  315. package/tools/md_to_xlsx.py +327 -0
  316. package/tools/micro_mutator.py +887 -0
  317. package/tools/mipro_assertion_tuner.py +210 -0
  318. package/tools/network_mock_shield.py +311 -0
  319. package/tools/newman_analyzer.py +384 -0
  320. package/tools/omni_emitter.py +579 -0
  321. package/tools/omni_parser.py +450 -0
  322. package/tools/omni_transpiler.py +168 -0
  323. package/tools/openxml_guard.py +438 -0
  324. package/tools/output_formatter.py +182 -0
  325. package/tools/package_release.py +325 -0
  326. package/tools/perf/__init__.py +24 -0
  327. package/tools/pinpoint_failure.py +190 -0
  328. package/tools/project_state.py +171 -0
  329. package/tools/qa_event_stream.py +358 -0
  330. package/tools/repo_map.py +346 -0
  331. package/tools/report/__init__.py +32 -0
  332. package/tools/reversible_sandbox.py +344 -0
  333. package/tools/safety_firewall.py +437 -0
  334. package/tools/security_coverage_ledger.py +538 -0
  335. package/tools/security_scanner.py +229 -0
  336. package/tools/senior_code_review.py +393 -0
  337. package/tools/setup_project.py +770 -0
  338. package/tools/skill_collision_guard.py +304 -0
  339. package/tools/skill_profiles.py +217 -0
  340. package/tools/skill_vault.py +481 -0
  341. package/tools/skillspector.py +1278 -0
  342. package/tools/smart_visual_masker.py +132 -0
  343. package/tools/spec_drift_sentinel.py +438 -0
  344. package/tools/swe_qa_aci.py +369 -0
  345. package/tools/synapse_observer.py +485 -0
  346. package/tools/synapse_qa_bench.py +190 -0
  347. package/tools/sync_agent_rules.py +274 -0
  348. package/tools/telemetry_correlator.py +397 -0
  349. package/tools/template_excel_exporter.py +514 -0
  350. package/tools/templates/jmeter-distributed/README.md +54 -0
  351. package/tools/templates/jmeter-distributed/docker-compose.yml +83 -0
  352. package/tools/test_impact.py +419 -0
  353. package/tools/test_memory_os.py +462 -0
  354. package/tools/textgrad_mutation_optimizer.py +237 -0
  355. package/tools/tms_sync_bridge.py +834 -0
  356. package/tools/tot_exploratory_tester.py +239 -0
  357. package/tools/trace_data_flow.py +240 -0
  358. package/tools/traffic_session_converter.py +256 -0
  359. package/tools/trend_analytics.py +314 -0
  360. package/tools/ui_server.py +401 -0
  361. package/tools/universal_ir.py +488 -0
  362. package/tools/update_sentinel.py +383 -0
  363. package/tools/validate_groovy_scripts.py +173 -0
  364. package/tools/verify_all.py +1271 -0
  365. package/tools/visual_diff_canvas.py +143 -0
  366. package/tools/visual_som_helper.py +550 -0
  367. package/tools/watch_mode.py +308 -0
  368. package/tools/wcag_audit.py +239 -0
  369. package/tools/welcome_page.py +290 -0
@@ -0,0 +1,33 @@
1
+ # Sample Spec Review (Goldfish Protocol)
2
+
3
+ Representative output of `python tools/goldfish_review.py` evaluating a draft specification for an e-commerce checkout flow.
4
+
5
+ ```markdown
6
+ # 🔍 Goldfish Specification Review Report
7
+ Target Spec: `specs/checkout_flow.md`
8
+ Timestamp: 2026-11-04 15:30:00
9
+
10
+ ## Scorecard: 85/100 (APPROVED)
11
+
12
+ 1. Comprehension & System Boundaries: 20/20
13
+ - Actor: Authenticated Buyer.
14
+ - Preconditions: Active cart with >= 1 item, valid shipping address.
15
+ - Target Scope: Payment step through Order Confirmation modal.
16
+
17
+ 2. Dynamic Data & Idempotent Teardown: 18/20
18
+ - Dynamic order ID with `AUTO_${Date.now()}`.
19
+ - Teardown: DB order status updated to `CANCELLED_TEST` via API hook.
20
+
21
+ 3. Assertion Rigor: 22/25
22
+ - Explicit confirmation message and total amount match.
23
+ - Anti-Fake Pass check: database order record mutation verified.
24
+
25
+ 4. Boundary & Negative Scenarios: 15/20
26
+ - Invalid credit card number and expired CVV covered.
27
+ - Recommendation: Add test case for network timeout during 3D Secure redirect.
28
+
29
+ 5. Implementation Target: 10/15
30
+ - Target Page: `CheckoutPage.ts`, `OrderConfirmationPage.ts`.
31
+
32
+ Verdict: PASS (Ready for POM Codification)
33
+ ```
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: security-dast-sentinel
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
+ ---
5
+
6
+ # Security DAST Sentinel & Enterprise Security Audit Harness
7
+
8
+ > **Purpose:** Automated Dynamic Application Security Testing (DAST), defensive runtime verification, and mathematical security audit orchestration across enterprise web applications, APIs, and AI agent swarms. Bridges functional automated testing with OWASP Top 10 compliance gates and Cloudflare 6-Phase audit rigor.
9
+ >
10
+ > [!IMPORTANT] Authorization & Scope of Engagement
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
+
13
+ ---
14
+
15
+ ## 0. 6-Phase Security Audit FSM (Cloudflare Enterprise Pattern)
16
+
17
+ ```text
18
+ Phase 1: Reconnaissance ──► Phase 2: Hunting Waves ──► Phase 3: Candidate Validation
19
+ │ │ │
20
+ ▼ ▼ ▼
21
+ Coverage Ledger Attack Classes Local Proof / POC
22
+ (tools/security_coverage_ledger) (ATTACK-CLASSES.md) (Zero Fake Passes)
23
+ │ │ │
24
+ ▼ ▼ ▼
25
+ Phase 6: Reporting ◄── Phase 5: Verification ◄── Phase 4: Structured Findings
26
+ ```
27
+
28
+ 1. **Phase 1: Reconnaissance & Attack Surface Mapping**:
29
+ Enumerate attack surface boundaries, components, and subsystems:
30
+ `Coverage Unit = Surface × Boundary × Subsystem × Attack Class [× Lifecycle]`
31
+ Initialize and track mathematical coverage via `tools/security_coverage_ledger.py`:
32
+ ```bash
33
+ python tools/security_coverage_ledger.py init -f coverage-ledger.json
34
+ python tools/security_coverage_ledger.py add -f coverage-ledger.json -s "web_api" -b "auth" --subsystem "billing" -a "idor"
35
+ ```
36
+ 2. **Phase 2: Coverage-Led Hunting Waves**:
37
+ Organize hunting into structured waves (Wave 1: core boundaries, Wave 2: integrations, Wave 3: edge cases). Refer to [**Attack Classes Taxonomy (`references/ATTACK-CLASSES.md`)**](references/ATTACK-CLASSES.md).
38
+ 3. **Phase 3: Candidate Validation**:
39
+ Validate candidates through bounded local checks and source AST analysis. Never report a candidate without proving the broken code boundary and observable unauthorized consequence.
40
+ 4. **Phase 4: Structured Findings Output**:
41
+ Record findings in structured formats: `confirmed` (complete local proof), `needs_validation` (unobservable deployment/cloud configuration), or `rejected`.
42
+ 5. **Phase 5: Record Verification**:
43
+ Verify coverage state invariants: ensure every covered unit has assigned agent ownership, reviewed file paths, and local assertions.
44
+ ```bash
45
+ python tools/security_coverage_ledger.py validate coverage-ledger.json
46
+ ```
47
+ 6. **Phase 6: Target-Neutral Reporting**:
48
+ Generate mathematical metrics and final risk summaries:
49
+ ```bash
50
+ python tools/security_coverage_ledger.py summary coverage-ledger.json
51
+ ```
52
+
53
+ ---
54
+
55
+ ## 1. Core Defensive Scope & OWASP Top 10
56
+
57
+ | OWASP Category | Threat Vector | Automated Defensive Check | Assertion Target |
58
+ | :--- | :--- | :--- | :--- |
59
+ | **A01: Broken Access Control** | BOLA / IDOR | Swapping User A token into User B resource URI | HTTP `403` or `404` (Never `200`) |
60
+ | **A01: Broken Access Control** | CORS Misconfiguration | Sending untrusted `Origin` with `Credentials: include` | Must NOT reflect origin with `Credentials: true` |
61
+ | **A02: Cryptographic Failures** | Missing HSTS | Inspecting headers on HTTPS endpoints | `Strict-Transport-Security: max-age=...` |
62
+ | **A05: Security Misconfiguration** | Missing Security Headers | Passive audit on page navigations & API responses | CSP, X-Frame-Options, nosniff |
63
+ | **A05: Security Misconfiguration** | Verbose Error Disclosure | Fuzzing invalid inputs to trigger errors | Response must NOT contain `SQLException` or stacktrace |
64
+ | **A09: Logging & Secrets Leak** | Sensitive Data Leakage | Regex scan on responses and local storage | Zero plaintext passwords, API keys, or private keys |
65
+
66
+ ---
67
+
68
+ ## 2. Automated Security Headers Audit
69
+
70
+ Automated DAST verification enforces mandatory HTTP security headers (`Strict-Transport-Security`, `Content-Security-Policy`, `X-Frame-Options`, `X-Content-Type-Options`) to prevent clickjacking, MIME sniffing, and insecure transport.
71
+
72
+ 👉 **Executable Recipes:** Full Playwright TypeScript test cases are maintained in [**DAST Recipes (`references/dast_recipes.ts`)**](references/dast_recipes.ts).
73
+
74
+ ---
75
+
76
+ ## 3. BOLA / IDOR Defense Check
77
+
78
+ Automated cross-tenant authorization checks verify that Tenant B cannot access Tenant A resources (returning `403` or `404`, never `200`).
79
+
80
+ 👉 **Executable Recipes:** Full Playwright TypeScript test cases are maintained in [**DAST Recipes (`references/dast_recipes.ts`)**](references/dast_recipes.ts).
81
+
82
+ ---
83
+
84
+ ## 4. Environment Allowlist Guard
85
+
86
+ - Automated security checks, fuzzing (`tools/api_fuzzer.py`), and DB sandboxing (`tools/db_sandbox.py`) enforce non-production allowlists (`localhost`, `staging`, `dev`, `qa`, `sandbox`).
87
+ - Fuzzing production hosts without `SYNAPSE_ALLOW_PROD_FUZZ=1` is automatically blocked.
88
+
89
+ ---
90
+
91
+ ## 5. Passive vs Active Scan Taxonomy & Severity Levels
92
+
93
+ > *Adapted from the OWASP ZAP scanning model (Apache-2.0, zaproxy/zaproxy).*
94
+
95
+ Structure every DAST engagement in two phases, and severity-tag every finding
96
+ so CI can gate on risk instead of raw counts:
97
+
98
+ | Phase | Traffic | Purpose | Hub Tooling |
99
+ | :--- | :--- | :--- | :--- |
100
+ | **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` |
101
+ | **Active** | Controlled attacks | Dispatch fuzz vectors against staging and evaluate the defect oracle | `agent-qa fuzz-api` (allowlist-guarded) |
102
+
103
+ Severity ladder: `CRITICAL` (stacktrace/DB leak, auth bypass) →
104
+ `HIGH` (server crash 5xx, unprotected sensitive path) → `MEDIUM` (connection
105
+ errors, unverified targets) → `LOW` (SLA breaches, unbounded input) → `INFO`.
106
+
107
+ Rules:
108
+ 1. **Never skip passive** — a contract that leaks an admin route costs zero requests to find; active scan only after passive findings are triaged.
109
+ 2. **Gate on CRITICAL alone** — a run with any CRITICAL alarm fails CI regardless of total counts.
110
+ 3. **An untested endpoint must never PASS** — connection failures are `CONNECTION_ERROR` findings, not green results (Truth Anchor).
111
+ 4. **OpenAPI-driven breadth** — ingest the spec (JSON) so every path/method is enumerated; combine with authentication scripts from `auth-session-and-cookie-manager` before active scanning.
112
+
113
+ ---
114
+
115
+ ## 6. AI, LLM & Agentic Security Hardening (Cloudflare Defense Pattern)
116
+
117
+ For systems with integrated LLMs, tool-calling agents, or MCP servers, inspect:
118
+ - [**Attack Classes Taxonomy (`references/ATTACK-CLASSES.md`)**](references/ATTACK-CLASSES.md): Core vulnerability categories across Injection, Access Control, File Handling, Cryptography, Business Logic, and Feature Abuse.
119
+ - [**AI & Agent Security Hunting Guide (`references/AI-AND-LLM.md`)**](references/AI-AND-LLM.md): Auditing indirect injection, persistent memory poisoning, tool-argument downstream sink execution, confused-deputy authorization, tool-schema disagreement, unbounded action loops, and MCP identity confusion.
@@ -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
+ }
@@ -0,0 +1,113 @@
1
+ <!--
2
+ SPDX-FileCopyrightText: Copyright (c) Cloudflare, Inc.
3
+ SPDX-License-Identifier: MIT
4
+ Adapted from cloudflare/security-audit-skill for Synapse-Hub Enterprise QA.
5
+ -->
6
+
7
+ # AI, LLM, and Autonomous Agent Security Hunting
8
+
9
+ #### When to use this guide
10
+
11
+ Reach for this guide whenever a language model or AI agent participates in a trust-sensitive decision: chatbots, RAG pipelines, persistent agent memory, autonomous tool-calling loops, MCP servers and clients, code that builds prompts from untrusted input, or code that consumes model output and executes actions. The critical data flow is:
12
+ `untrusted content → model / agent memory → capability, authority, or sink`.
13
+
14
+ Use this alongside `ATTACK-CLASSES.md`, not instead of it. Transport, access control, query construction, filesystem use, and output rendering remain ordinary trust boundaries. This guide covers the model-specific delegation layer.
15
+
16
+ ---
17
+
18
+ ## 1. Core Defensive Discipline
19
+
20
+ ```text
21
+ 1. Prompt injection alone is not a defect. Require a code-level boundary failure: content reaches another principal's context, invokes authority the requester lacks, discloses data they cannot read, or drives a sink they cannot reach directly.
22
+ 2. Model output, memory, tool descriptions, and MCP responses are untrusted inputs. Point to the code that grants authority, trusts output, writes durable state, or feeds a sink.
23
+ 3. A guardrail prompt is not a security boundary. Count only deterministic checks, resource-scoped authorization, isolation, binding, and constrained credentials.
24
+ 4. State the attacker, affected principal, effective execution identity, resource, exact action, authority used, and observable impact. An intentional direct request to use the requester's existing authority is not a delegation defect merely because a model executes it.
25
+ 5. Authorization and action binding are separate controls. Attacker-controlled content causing an action under an affected principal's valid authority is an action-binding failure when that principal did not intentionally request or approve the exact action.
26
+ 6. Classify every candidate as confirmed only after source evidence and bounded local validation establish the boundary and result. Use needs_validation when a required provider, deployment, model, renderer, or identity behavior is not observable locally.
27
+ ```
28
+
29
+ ---
30
+
31
+ ## 2. Context, Retrieval, and Memory Attack Classes
32
+
33
+ ### Indirect Injection Through Ingested Content
34
+ An attacker writes an untrusted document, issue title, git commit, customer review, or tool response that enters an agent's model context.
35
+ - **Trace:** Who can write each input source? Whose session consumes it? What capability is enabled in that session?
36
+ - **Defect:** Missing deterministic sanitization before feeding downstream sinks or tool handlers.
37
+
38
+ ### Cross-Session or Cross-Tenant Context Bleed
39
+ Conversation history, vector embeddings, RAG results, or prompt cache entries are keyed too broadly across tenants.
40
+ - **Verification:** Ensure tenant and ACL filters are included in the query itself and in every cache key. A tenant field stored on an object is NOT enforcement if an alternate query or shared cache omits it.
41
+
42
+ ### Persistent Memory Poisoning
43
+ Attacker-controlled content or model hallucinations are saved into long-term memory (`qa-memory-os`, vector DB, or user profile) that later shapes another task, user, or privileged session.
44
+ - **Verification:** Check who may create, update, or merge memory records. Low-trust observations must never become durable system instructions or tool policies.
45
+
46
+ ### Prompt Role and Provenance Confusion
47
+ Prompt assembly lets untrusted text impersonate a system message, prior turn, tool result, policy, or memory record. Look for string concatenation, untyped history, caller-controlled role fields, and serialization round trips that lose source labels. Confirm that the forged provenance changes a deterministic trust decision or reaches a meaningful capability.
48
+
49
+ ---
50
+
51
+ ## 3. Tool and Action Attack Classes
52
+
53
+ ### Tool-Argument Injection into a Downstream Sink
54
+ Model-produced arguments reach SQL queries, shell commands (`powershell`, `bash`), file paths, or external privileged APIs without handler-side validation.
55
+ - **Verification:** Structured output/JSON schema narrows input shape; it does NOT establish authorization, path traversal safety, URL allowlists, or safe query semantics. Every tool handler must re-validate arguments before execution.
56
+
57
+ ### Excessive Agency & Confused Deputy Authority
58
+ The AI agent operates using a broad service account or elevated identity, while the tool handler fails to re-check the requesting user's explicit permissions on the target resource.
59
+ - **Verification:** Both the effective identity and the requesting principal's permissions must be verified for the exact resource requested.
60
+
61
+ ### Action-Confirmation and Approval Binding
62
+ A user approves action A, but the agent's execution loop executes action B (mutated arguments, different resource ID, or duplicated side effect). An action-binding defect also exists when attacker-controlled content causes a side effect under a victim's valid authority without intentional approval.
63
+ - **Verification:** An approval token must bind the normalized tool name, exact argument payload hash, requester ID, target resource, and single-use expiration. Resumed sessions or retries must never re-use a prior approval for a mutated side effect.
64
+
65
+ ### Tool-Schema and Dispatcher Disagreement
66
+ The schema accepts aliases, extra fields, duplicate keys, coercions, nested free-form objects, or out-of-range values that the dispatcher or handler interprets differently. Compare schema validation, canonicalization, generated bindings, and handler defaults. Validate again where values become resource selectors or security-relevant options.
67
+
68
+ ### Unbounded Delegated Action Loops
69
+ A bounded request can enqueue repeated spend, send, mutation, or external API work without a per-request budget, per-action authorization, cancellation, or idempotency control. Confirm impact on shared cost, quotas, other users, or durable state. Do not test by exhausting a service; use code-level accounting and a locally bounded loop.
70
+
71
+ ---
72
+
73
+ ## 4. MCP and Multi-Agent Swarm Trust Classes
74
+
75
+ ### Sub-Agent and MCP Trust Inheritance
76
+ A delegated subagent receives full session credentials, environment secrets, or unrestricted tool access rather than the least authority required.
77
+ - **Verification:** Capability narrowing must apply at each delegation hop. Subagent results must be validated as untrusted inputs upon return.
78
+
79
+ ### MCP Server & Tool Identity Confusion
80
+ Tool dispatch routes calls by model-influenced names rather than verified server connection handles. Two MCP servers must not be allowed to hijack or override the same tool namespace. Check whether reconnect changes the binding, and whether a response from one server can satisfy another server's pending call.
81
+
82
+ ### MCP Metadata and Schema as Policy
83
+ Tool descriptions, resource metadata, prompts, completion hints, or schemas supplied by an MCP peer are trusted as policy or authorization. These fields can guide the model but cannot grant capability. Find the deterministic allowlist, server identity check, and handler authorization that remain authoritative when metadata conflicts.
84
+
85
+ ---
86
+
87
+ ## 5. Output and Disclosure Attack Classes
88
+
89
+ ### Insecure Output Rendering
90
+ Model output reaches an executing HTML, Markdown, template, URL, or command sink without the sink's required encoding and policy. For browser rendering, verify auto-loaded resources and CSP or sanitization; renderer behavior outside the repository makes the candidate `needs_validation`.
91
+
92
+ ### Sensitive Context Extraction
93
+ Model contexts containing system API keys, database credentials, or other tenants' data are tricked into emitting secrets in output text, markdown files, or log artifacts.
94
+ - **Verification:** Redact secrets before prompt assembly and filter model outputs with regex scrubbing before writing to disk.
95
+
96
+ ---
97
+
98
+ ## 6. Universal Moves (Hunting Methodology)
99
+
100
+ - Draw four maps first: each execution identity, each capability, every writable context or memory source, and each output destination. Then connect the principal at the start to the authority at the end.
101
+ - Start at side-effecting tools and work backward through dispatcher, schema, confirmation, model context, retrieval, and ingestion. Start at durable memory reads and trace every writer.
102
+ - Compare direct, queued, retry, resume, batch, and delegated paths for the same action. The strongest gate must apply after arguments are final and before every side effect.
103
+
104
+ ---
105
+
106
+ ## 7. Validation Rules (Apply Before Reporting Any Finding)
107
+
108
+ 1. **Name the crossed boundary and observable result**: attacker, affected principal or shared resource, execution identity, target, and unauthorized or unrequested action or disclosure.
109
+ 2. **Prove authority or binding failure**: For confused-deputy claims, prove the tool lacks requester-and-resource authorization and that the attacker cannot perform the same action normally. For action-binding claims, prove attacker-controlled content caused an action under the affected principal's authority without intentional request or approval.
110
+ 3. **Trace writes and reads for memory claims**: For memory or retrieval claims, cite both the attacker-controlled write and the later cross-principal read or privileged decision.
111
+ 4. **Compare approved intent with executed object**: Establish the intentional request or normalized approved object, if any, and compare it with the object the handler uses. Confirm locally observable unrequested action or mutation.
112
+ 5. **Verify MCP connections**: Verify authenticated connection, request correlation, tool namespace, and effective credential. Mark `needs_validation` if external server routing is required.
113
+ 6. **Classify strictly**: Return `confirmed` findings only with complete source trace and meaningful result. Return `needs_validation` for specific unresolved boundary facts and state the bounded local check needed to resolve them.
@@ -0,0 +1,89 @@
1
+ <!--
2
+ SPDX-FileCopyrightText: Copyright (c) Cloudflare, Inc.
3
+ SPDX-License-Identifier: MIT
4
+ Adapted from cloudflare/security-audit-skill for Synapse-Hub Enterprise QA.
5
+ -->
6
+
7
+ # Core Attack Classes & Vulnerability Taxonomy
8
+
9
+ #### When to use this guide
10
+
11
+ Select attack classes relevant to the application type and architecture. Frame security audit work as finding, validating, fixing, and prioritizing vulnerabilities. Validation is strictly bounded to source review, AST inspection, local mock fixtures, and authorized headless execution. Never test availability against live production services or take destructive action.
12
+
13
+ Classification standard:
14
+ - `confirmed`: Source evidence and bounded local validation establish the complete trust boundary crossing and observable defect.
15
+ - `needs_validation`: A specific deployment, platform, provider, identity, or runtime fact is unavailable locally; state the exact missing fact and the owner-observed check needed to resolve it.
16
+
17
+ ---
18
+
19
+ ## 1. Injection
20
+ Trace untrusted input from entry point to dangerous sink:
21
+ - **Web apps & APIs**: SQL queries, HTML/DOM output, shell commands (`subprocess`, `exec`, `powershell`), template engines, file paths, HTTP redirects, unsafe deserialization.
22
+ - **Libraries & Page Classes**: Functions processing caller-supplied data without validation (buffer operations, parsers, XPath/CSS selector construction).
23
+ - **CLI tools & Hub Scripts**: Shell command construction, path traversal, environment variable interpolation.
24
+ - **Microservices**: Query construction, message serialization, log injection, LDAP/GraphQL/XPATH queries.
25
+ - **Client-side (Browser/JS)**: DOM XSS, prototype pollution, `postMessage`/origin trust, and insecure storage.
26
+
27
+ *Rule:* Trace both direct and indirect injection (e.g. data stored safely, then retrieved and passed into an unescaped sink by background workers or reporting modules).
28
+
29
+ ---
30
+
31
+ ## 2. Access Control & Authorization (BOLA / IDOR)
32
+ Verify that a caller cannot execute operations outside their explicit authority:
33
+ - **Missing Authorization**: Endpoints that authenticate a user but forget to check if they own or are permitted to access the specific target resource ID (BOLA/IDOR).
34
+ - **Permission Asymmetry**: Alternate paths or secondary endpoints (e.g. bulk export, batch update, mobile API) performing the same state change with weaker permission checks.
35
+ - **Request Parameter Override**: Body or query parameters (e.g. `tenant_id`, `role`, `is_admin`, `owner_id`) that override what the authorization middleware intended to restrict.
36
+ - **Multi-Tenant Isolation**: Ensuring every database query, cache key, and vector search includes hard tenant isolation filters.
37
+
38
+ ---
39
+
40
+ ## 3. Resource and File Handling
41
+ - **Path Traversal**: Reading or writing outside intended directories via `../`, encoded sequences (`%2e%2e%2f`), symlinks, or Windows device paths.
42
+ - **SSRF (Server-Side Request Forgery)**: Inducing backend services to fetch attacker-controlled URLs, bypassing firewalls to hit internal cloud metadata endpoints (e.g. AWS IMDS, GCP metadata), internal microservices, or loopback interfaces.
43
+ - **Unsafe Deserialization & Archive Extraction**: Python `pickle`, Java deserialization, YAML `unsafe_load`, zip slip during archive extraction.
44
+ - **File Race Conditions (TOCTOU)**: Time-of-check to time-of-use gaps between file permission verification and file reading/writing.
45
+
46
+ ---
47
+
48
+ ## 4. Cryptography and Secrets Hygiene
49
+ - **Weak Randomness**: Using non-cryptographic PRNGs (`random.random()`, `Math.random()`) for security-critical values (session tokens, reset nonces, UUIDs).
50
+ - **Exposed Secrets**: Hardcoded credentials, private keys, API keys, or plaintext passwords in git history, environment dumps, error responses, or test fixtures.
51
+ - **Broken Cryptographic Primitives**: Static IVs, ECB mode, broken hash algorithms (MD5/SHA1 for signatures), missing HMAC verification.
52
+ - **Timing Attacks**: Comparing sensitive tokens or HMACs with standard string equality (`==`) rather than constant-time comparison (`hmac.compare_digest`).
53
+
54
+ ---
55
+
56
+ ## 5. Business Logic & State Invariants
57
+ Hunt logic errors through manual AST and workflow analysis:
58
+ - **State Machine Violations**: Skipping intermediate checkout/verification steps, replaying completed flows, or partial rollback failures.
59
+ - **Concurrency & Race Conditions**: Check-then-act gaps producing double-spend, double-redemption, or lost updates.
60
+ - **Numeric & Quantity Tampering**: Negative quantities, zero values, integer overflow, precision loss, currency rounding exploitation.
61
+ - **Default & Fallback Insecurity**: System security posture when configuration is missing, feature flags are off, or external identity providers time out.
62
+
63
+ ---
64
+
65
+ ## 6. Feature Abuse & Data Exfiltration
66
+ Legitimate enterprise features turned into exfiltration or injection channels:
67
+ - **Export & Backup Exfiltration**: Low-privilege accounts triggering full database exports, tenant snapshots, or audit log dumps containing sensitive PII.
68
+ - **Import & Restore Injection**: Bulk CSV/Excel/JSON imports that bypass field validation, overwrite existing IDs, or trigger blind formula injection (`=cmd|' /C ...'`).
69
+ - **Search & Filter Oracles**: Boolean search filters or response timing differences revealing existence of private records.
70
+ - **Webhooks as SSRF**: User-configured webhooks or callbacks fetching internal cloud metadata or intranet services without IP allowlists.
71
+
72
+ ---
73
+
74
+ ## 7. Chained Vulnerabilities & Trust Boundary Gaps
75
+ - **Cross-Component Gaps**: Component A sanitizes input and passes it to Component B; Component B makes assumptions about normalization, length limits, or encoding that A did not enforce.
76
+ - **Second-Order Exploitation**: Data that was benign when stored becomes dangerous when ingested by asynchronous background queues, analytics, or administrative dashboards.
77
+ - **Scope & Capability Inflation**: Tokens or API keys whose scopes inadvertently expand across delegation hops or background refreshes.
78
+
79
+ ---
80
+
81
+ ## 8. Obvious Exposures & Baseline Hygiene
82
+ Deterministic checklist of common exposures:
83
+ - Hardcoded secrets, API tokens, passwords (`TODO: remove secret`).
84
+ - Gated debug/admin endpoints accessible without authentication (`/debug`, `/admin`, `/metrics`, `/.env`).
85
+ - Missing security headers (`Content-Security-Policy`, `X-Content-Type-Options: nosniff`, `X-Frame-Options: DENY`, `Strict-Transport-Security`).
86
+ - Insecure cookies missing `HttpOnly`, `Secure`, or `SameSite` flags.
87
+ - Wildcard CORS with credentials (`Access-Control-Allow-Origin: *` + `Access-Control-Allow-Credentials: true`).
88
+ - Open redirects passing unvalidated user inputs into HTTP `302` redirect targets.
89
+ - Unpinned or vulnerable dependencies with known high-severity CVEs in lockfiles.
@@ -0,0 +1,33 @@
1
+ /**
2
+ * DAST Automated Security Test Recipes (Playwright TypeScript)
3
+ * Includes HTTP Security Headers auditing and BOLA / IDOR cross-tenant defense checks.
4
+ */
5
+
6
+ import { test, expect } from '@playwright/test';
7
+
8
+ // 1. Automated Security Headers Audit
9
+ test('DAST: Verify mandatory HTTP security headers', async ({ page }) => {
10
+ const response = await page.goto('/dashboard');
11
+ expect(response).not.toBeNull();
12
+ const headers = response!.headers();
13
+
14
+ // Clickjacking & MIME Sniffing protection
15
+ expect(['DENY', 'SAMEORIGIN']).toContain(headers['x-frame-options']?.toUpperCase());
16
+ expect(headers['x-content-type-options']).toBe('nosniff');
17
+
18
+ // Strict Transport Security & CSP
19
+ if (page.url().startsWith('https://')) {
20
+ expect(headers['strict-transport-security']).toContain('max-age=');
21
+ }
22
+ expect(headers['content-security-policy']).toBeTruthy();
23
+ });
24
+
25
+ // 2. BOLA / IDOR Defense Check (Multi-Tenant Authorization)
26
+ test('DAST: Tenant B cannot access Tenant A entity', async ({ request }) => {
27
+ const tokenTenantB = process.env.TEST_TENANT_B_TOKEN || 'tenant_b_bearer_token';
28
+ // Tenant B attempts to read Tenant A resource
29
+ const readAttempt = await request.get('/api/v1/invoices/10042', {
30
+ headers: { 'Authorization': `Bearer ${tokenTenantB}` }
31
+ });
32
+ expect([403, 404], 'Cross-tenant resource access must be forbidden').toContain(readAttempt.status());
33
+ });
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: self-healing-locator
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
+ ---
5
+
6
+ # Self-Healing Locator Skill — Token-Efficient AOM Diffing
7
+
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
+
10
+ ---
11
+
12
+ ## 1. The Token Conservation Principle
13
+
14
+ - **Raw HTML DOM Problem:** Dumping a complete HTML webpage into the prompt can consume 50,000 to 150,000 tokens, degrading AI reasoning and triggering context rot.
15
+ - **AOM Subtree Solution:** Extract exclusively the **Accessibility Object Model (AOM)** tree or a 2-hop semantic DOM subtree surrounding the target element, consuming under **500 tokens**.
16
+
17
+ ```mermaid
18
+ flowchart LR
19
+ Broken["Broken Locator Encountered"] --> Probe["Extract Compact AOM Tree (500 tokens)"]
20
+ Probe --> Rank["Apply Hierarchy: Role > Label > TestId"]
21
+ Rank --> Test["Verify Uniqueness on Live DOM"]
22
+ Test --> Patch["Patch Page Class Method"]
23
+ ```
24
+
25
+ ---
26
+
27
+ ## 2. Master Locator Ranking Hierarchy
28
+
29
+ When searching for a replacement locator, evaluate candidates in this strict priority order:
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:**
35
+ - `input[formcontrolname="code"]`
36
+ - `p-dropdown[formcontrolname="categoryId"]`
37
+ 3. **Tier 3 — Dedicated Test Identifiers:**
38
+ - `[data-testid="btn-create"]`
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:**
43
+ - `.card.popup-data input.p-inputtext`
44
+
45
+ ---
46
+
47
+ ## 3. In-Browser AOM Probing Snippet
48
+
49
+ Execute this compact JavaScript probe via Playwright or Chrome DevTools to locate the target node without dumping HTML:
50
+
51
+ ```javascript
52
+ // Extract interactive elements tree scoped to active modal or container
53
+ () => {
54
+ const container = document.querySelector('.p-dialog, .modal-content, form') || document.body;
55
+ const elements = container.querySelectorAll('button, input, select, textarea, p-dropdown, [role="button"]');
56
+ return Array.from(elements).map(el => ({
57
+ tag: el.tagName.toLowerCase(),
58
+ role: el.getAttribute('role') || el.type,
59
+ name: el.getAttribute('name') || el.getAttribute('formcontrolname') || el.id,
60
+ label: el.innerText?.trim() || el.getAttribute('aria-label') || el.placeholder,
61
+ testId: el.getAttribute('data-testid')
62
+ }));
63
+ }
64
+ ```
65
+
66
+ ---
67
+
68
+ ## 4. Healing Execution Checklist
69
+
70
+ 1. **Verify Uniqueness:** Ensure the candidate locator matches exactly 1 element on the live DOM.
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
+ 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
+ }
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: senior-code-review
3
+ description: "Review code changes across logic, security, concurrency, and test coverage. Use when conducting pull request reviews, diff inspections, or auditing commit changes before merge."
4
+ category: architecture_and_analysis
5
+ version: "1.1.0"
6
+ ---
7
+
8
+ # Senior Code Review — Enterprise Quality & Lean Diff Review
9
+
10
+ Review code changes like the senior engineer who will be paged at 2 AM when it breaks.
11
+ Order of importance: **Correctness -> Safety -> Scale -> Tests -> Speed -> Lean**.
12
+ Lean still matters: every extra line must be read, tested, and fixed later.
13
+
14
+ ---
15
+
16
+ ## 1. Understand First
17
+
18
+ - **Target Scoping:** Review what the user requests: uncommitted or staged changes, a branch, a PR link, or specific files. If unspecified: uncommitted changes (or last commit if clean).
19
+ - **Read Beyond the Diff:** Read the diff, then read the code it touches:
20
+ - Callers of every changed function or Page Class method.
21
+ - Functions and services called by the diff.
22
+ - Associated unit/E2E tests and fixtures.
23
+ - **Trace the Real Flow:** Where does user input arrive? What is validated? Where is state persisted? What is emitted?
24
+ - **Expected Scale:** Identify the expected operational load (single script execution vs concurrent CI runners or thousands of users). Judge scale against that.
25
+
26
+ ---
27
+
28
+ ## 2. Six Core Review Pillars
29
+
30
+ ### 1. Bug & Edge Cases
31
+ - Wrong calculation, crash, or unhandled edge cases (empty collections, zero values, timezone drift, string encoding).
32
+ - Callers broken by changed method signatures or altered return types.
33
+ - A bug fixed in one caller while the shared function/keyword remains broken for others.
34
+
35
+ ### 2. Risk & Security
36
+ - Injection vulnerabilities (SQL, Shell, Command, Path traversal).
37
+ - Hardcoded secrets, plain tokens, or private keys.
38
+ - Missing input validation at trust boundaries.
39
+ - Data loss risks: swallowed errors, unhandled promise rejections, missing DB transactions.
40
+
41
+ ### 3. Scale & Concurrency
42
+ - Race conditions (check-then-act without locking).
43
+ - Memory or cache leaks (unbounded collections that only grow).
44
+ - $O(n^2)$ iterations or N+1 queries on variable-sized data.
45
+ - Static delays (`Thread.sleep`, `time.sleep`) that block event loops or fail under variable network latency.
46
+
47
+ ### 4. Missing Tests
48
+ - New non-trivial logic (branch, loop, parser, auth check, payment/money path) lacking a test that fails when broken.
49
+ - Every bug fix must include a regression test proving the fix.
50
+
51
+ ### 5. Speed & Latency
52
+ - Bottlenecks in hot paths and repeated iterations.
53
+ - Unnecessary synchronous I/O or redundant API re-fetching.
54
+
55
+ ### 6. Lean & Anti-Bloat
56
+ - **Delete:** Dead code, commented-out code, unused options, speculative configuration.
57
+ - **Reuse:** Leverage existing Page Classes, BasePage helpers, or utility functions.
58
+ - **Stdlib / Native:** Use platform features instead of adding external dependencies.
59
+ - **YAGNI:** Remove single-use abstractions, single-impl interfaces, and passthrough wrappers.
60
+
61
+ ### 7. Anti-Junk Tests & Writing Hygiene (test-audit & humanize)
62
+ - **Anti-Junk Tests:** Flag tests asserting mock data, testing private implementation details, or introducing test-only seams in Page Classes.
63
+ - **Writing & Tone Hygiene:** Audit commit text, PR descriptions, and code docstrings using `tools/humanize_linter.py` to eradicate robotic AI buzzwords (`leverage`, `plethora`, `delve`, `vibrant tapestry`) and em-dash misuse.
64
+
65
+ ---
66
+
67
+ ## 3. The 4-Angle Cleanup Model (`simplify`)
68
+
69
+ > Adapted from the Claude Codex `simplify` plugin. Evaluate every diff through four independent cleanup lenses before accepting changes:
70
+
71
+ | Angle | Focus Question | Review Directive |
72
+ | :--- | :--- | :--- |
73
+ | **1. Reuse** | *Does this helper or pattern already exist?* | Flag new code that re-implements something the codebase already has. Grep shared helpers, `BasePage`, and adjacent Page Classes; call the existing function instead of adding a new one. |
74
+ | **2. Simplification** | *Can this be expressed in fewer moving parts?* | Flag unnecessary complexity added by the diff: redundant or derivable state, copy-paste with slight variation, deep nesting, dead code left behind. Name the simpler form that does the exact same job. |
75
+ | **3. Efficiency** | *Is work wasted or memory retained?* | Flag redundant computation, repeated I/O, independent operations run sequentially, and blocking delays added to hot paths. Flag long-lived closures that capture large outer scopes (closure memory leak); prefer classes/structs with only necessary fields. |
76
+ | **4. Altitude** | *Is the change made at the right architectural depth?* | Check that each change is implemented at the root cause, not as a fragile surface bandaid. Special cases layered on shared infrastructure indicate a fix that isn't deep enough; generalize the underlying mechanism rather than adding conditional special cases. |
77
+
78
+ ---
79
+
80
+ ## 4. Concrete Reporting Format
81
+
82
+ Every finding **must** have a concrete, reproducible failure scenario:
83
+
84
+ ```markdown
85
+ #### [Severity: Must fix | Should fix | Nice to have] <Finding Title> (`<file>:<line>`)
86
+ - **What this is:** <One concise sentence describing the touched code>
87
+ - **Problem:** <Specific input or scenario that leads to the defect or failure>
88
+ - **Fix:** <Smallest complete diff or code change to resolve the issue>
89
+ - **If we skip it:** <What goes wrong in production or CI pipeline>
90
+ ```
91
+
92
+ ---
93
+
94
+ ## 5. Automation CLI
95
+
96
+ Run the automated senior review tool on your current working tree:
97
+ ```bash
98
+ python3 tools/senior_code_review.py # Review uncommitted changes
99
+ python3 tools/senior_code_review.py --staged # Review staged git changes
100
+ python3 tools/senior_code_review.py --branch main # Compare against main branch
101
+ python3 tools/senior_code_review.py --output-md REVIEW_REPORT.md # Export to markdown report
102
+ ```
103
+
104
+ ---
105
+
106
+ ## 6. Attribution
107
+
108
+ Adapted from **ponytail-review** (https://github.com/DietrichGebert/ponytail) — MIT License, Copyright (c) 2026 DietrichGebert, and **claude-codex-settings / simplify** (Apache-2.0 / MIT). Re-architected for Enterprise QA, Clean POM, and Synapse Hub Quality Gates.
@@ -0,0 +1,29 @@
1
+ # Sample Senior Code Review Walkthrough
2
+
3
+ Below is a representative senior code review performed on an API and test diff.
4
+
5
+ ```markdown
6
+ # Senior Developer Quality & Lean Code Review
7
+
8
+ - **Files Changed:** `3`
9
+ - **Findings:** `2` (1 Must fix, 1 Should fix, 0 Nice to have)
10
+
11
+ ### 🚨 Must Fix (Blockers)
12
+
13
+ #### 1. Swallowed Database Exception (`src/services/billing.py:84`)
14
+ - **What this is:** Try-catch block around payment transaction commit.
15
+ - **Problem:** When the gateway returns a network error, the exception is caught with `pass`, silently failing the invoice without alerting the user or reverting the database transaction.
16
+ - **Fix:** Rethrow `PaymentGatewayException` and rollback the active DB transaction.
17
+ - **If we skip it:** Invoices will appear as paid in UI while payments actually failed.
18
+
19
+ ### ⚠️ Should Fix (Reliability & Scale)
20
+
21
+ #### 2. Static Sleep in Async Test (`tests/test_billing.py:32`)
22
+ - **What this is:** `time.sleep(3)` placed after dispatching webhook.
23
+ - **Problem:** Static wait causes test flakiness on slower CI runners and wastes 3 seconds on fast local runs.
24
+ - **Fix:** Replace with `await waitForCondition(isWebhookReceived, timeout=5000)`.
25
+ - **If we skip it:** CI pipeline will intermittently fail on high queue load.
26
+
27
+ ### Verdict
28
+ ❌ **Action Required:** Resolve 1 blocker before merging.
29
+ ```