@orion-qa/orion 3.0.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (637) hide show
  1. package/.claude/agents/automation-strategist.md +1 -0
  2. package/.claude/agents/change-agent.md +1 -0
  3. package/.claude/agents/codebase-analyst.md +2 -1
  4. package/.claude/agents/environment-discovery.md +1 -0
  5. package/.claude/agents/evidence-validator.md +1 -0
  6. package/.claude/agents/executor.md +1 -0
  7. package/.claude/agents/failure-analyst.md +2 -1
  8. package/.claude/agents/implementer.md +2 -1
  9. package/.claude/agents/requirement-analyst.md +1 -0
  10. package/.claude/agents/reviewer.md +1 -0
  11. package/.claude/agents/test-reporter.md +1 -0
  12. package/.claude/settings.json +25 -0
  13. package/.claude/skills/appium/SKILL.md +1 -1
  14. package/.claude/skills/appium/templates/README.md +6 -9
  15. package/.claude/skills/appium/templates/ci/github-actions-android.yml +8 -2
  16. package/.claude/skills/appium/templates/ci/github-actions-ios.yml +8 -2
  17. package/.claude/skills/appium/templates/ci/github-actions-windows.yml +9 -2
  18. package/.claude/skills/appium/templates/project-java/.env.example +4 -0
  19. package/.claude/skills/appium/templates/project-java/pom.xml +2 -0
  20. package/.claude/skills/appium/templates/project-java/src/test/java/automation/{framework/Config.java → config/Env.java} +43 -52
  21. package/.claude/skills/appium/templates/project-java/src/test/java/automation/config/Flags.java +45 -0
  22. package/.claude/skills/appium/templates/project-java/src/test/java/automation/config/Paths.java +14 -0
  23. package/.claude/skills/appium/templates/project-java/src/test/java/automation/desc/SignInDesc.java +30 -0
  24. package/.claude/skills/appium/templates/project-java/src/test/java/automation/{framework → driver}/DriverFactory.java +19 -13
  25. package/.claude/skills/appium/templates/project-java/src/test/java/automation/{framework → driver}/DriverManager.java +12 -9
  26. package/.claude/skills/appium/templates/project-java/src/test/java/automation/fixtures/BaseTest.java +75 -0
  27. package/.claude/skills/appium/templates/project-java/src/test/java/automation/{screens → pageObjects}/BaseScreen.java +12 -12
  28. package/.claude/skills/appium/templates/project-java/src/test/java/automation/pageObjects/HomeScreen.java +26 -0
  29. package/.claude/skills/appium/templates/project-java/src/test/java/automation/pageObjects/LoginScreen.java +63 -0
  30. package/.claude/skills/appium/templates/project-java/src/test/java/automation/pageObjects/ShellScreen.java +26 -0
  31. package/.claude/skills/appium/templates/project-java/src/test/java/automation/setup/AuthSetup.java +49 -0
  32. package/.claude/skills/appium/templates/project-java/src/test/java/automation/testData/TestData.java +78 -0
  33. package/.claude/skills/appium/templates/project-java/src/test/java/automation/tests/ui/SignInTest.java +45 -0
  34. package/.claude/skills/appium/templates/project-java/src/test/java/automation/tests/unit/UtilsTest.java +34 -0
  35. package/.claude/skills/appium/templates/project-java/src/test/java/automation/{framework → utils}/AutomationError.java +4 -4
  36. package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/Case.java +20 -0
  37. package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/CaseTransformer.java +54 -0
  38. package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/Dates.java +42 -0
  39. package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/Log.java +45 -0
  40. package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/MissingSettingError.java +13 -0
  41. package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/RandomData.java +41 -0
  42. package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/Redact.java +33 -0
  43. package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/TestDescription.java +25 -0
  44. package/.claude/skills/appium/templates/project-java/src/test/resources/testData/testData.properties +7 -0
  45. package/.claude/skills/appium/templates/project-java/testng.xml +11 -4
  46. package/.claude/skills/architecture-analysis/SKILL.md +3 -2
  47. package/.claude/skills/automation-implementation/SKILL.md +8 -5
  48. package/.claude/skills/automation-implementation/references/patterns.md +46 -24
  49. package/.claude/skills/automation-review/references/assertion-guard.md +1 -1
  50. package/.claude/skills/code-review/SKILL.md +5 -2
  51. package/.claude/skills/code-review/references/pattern-rules.md +12 -7
  52. package/.claude/skills/documentation/SKILL.md +23 -18
  53. package/.claude/skills/execution/SKILL.md +7 -3
  54. package/.claude/skills/httpclient/templates/README.md +6 -7
  55. package/.claude/skills/httpclient/templates/csharp-nunit/.env.example +4 -0
  56. package/.claude/skills/httpclient/templates/csharp-nunit/Automation.csproj +7 -3
  57. package/.claude/skills/httpclient/templates/csharp-nunit/Config/Env.cs +62 -0
  58. package/.claude/skills/httpclient/templates/csharp-nunit/Config/Flags.cs +35 -0
  59. package/.claude/skills/httpclient/templates/csharp-nunit/Config/Paths.cs +22 -0
  60. package/.claude/skills/httpclient/templates/csharp-nunit/Fixtures/BaseTest.cs +22 -0
  61. package/.claude/skills/httpclient/templates/csharp-nunit/Resources/Desc/ProductsDesc.cs +22 -0
  62. package/.claude/skills/httpclient/templates/csharp-nunit/Resources/TestData/TestData.cs +61 -0
  63. package/.claude/skills/httpclient/templates/csharp-nunit/Resources/TestData/testData.json +9 -0
  64. package/.claude/skills/httpclient/templates/csharp-nunit/Services/ApiClient.cs +48 -0
  65. package/.claude/skills/httpclient/templates/csharp-nunit/Services/HealthApi.cs +11 -0
  66. package/.claude/skills/httpclient/templates/csharp-nunit/{Api → Services}/ProductsApi.cs +8 -5
  67. package/.claude/skills/httpclient/templates/csharp-nunit/Tests/Api/ProductsTests.cs +61 -0
  68. package/.claude/skills/httpclient/templates/csharp-nunit/Tests/Unit/UtilsTests.cs +40 -0
  69. package/.claude/skills/httpclient/templates/csharp-nunit/Utils/AutomationError.cs +15 -0
  70. package/.claude/skills/httpclient/templates/csharp-nunit/Utils/Dates.cs +18 -0
  71. package/.claude/skills/httpclient/templates/csharp-nunit/Utils/Log.cs +37 -0
  72. package/.claude/skills/httpclient/templates/csharp-nunit/Utils/RandomData.cs +26 -0
  73. package/.claude/skills/httpclient/templates/csharp-nunit/Utils/Redact.cs +22 -0
  74. package/.claude/skills/httpclient/templates/csharp-nunit/Utils/TestDescription.cs +55 -0
  75. package/.claude/skills/javascript/references/sources.md +1 -1
  76. package/.claude/skills/k6/SKILL.md +1 -1
  77. package/.claude/skills/k6/templates/README.md +5 -3
  78. package/.claude/skills/k6/templates/project/{data/cases.js → resources/desc/products.desc.js} +1 -1
  79. package/.claude/skills/k6/templates/project/resources/testData/testData.js +32 -0
  80. package/.claude/skills/k6/templates/project/{lib/config.js → src/config/env.js} +10 -5
  81. package/.claude/skills/k6/templates/project/{lib → src/services}/products-api.js +7 -5
  82. package/.claude/skills/k6/templates/project/{load → tests/load}/products.js +8 -8
  83. package/.claude/skills/karate/templates/README.md +4 -5
  84. package/.claude/skills/karate/templates/java-junit5/.env.example +2 -0
  85. package/.claude/skills/karate/templates/java-junit5/pom.xml +4 -0
  86. package/.claude/skills/karate/templates/java-junit5/src/test/java/{support → config}/EnvSettings.java +1 -1
  87. package/.claude/skills/karate/templates/java-junit5/src/test/java/karate-config.js +13 -6
  88. package/.claude/skills/karate/templates/java-junit5/src/test/java/logback-test.xml +1 -1
  89. package/.claude/skills/karate/templates/java-junit5/src/test/java/{api → tests}/ApiTest.java +7 -4
  90. package/.claude/skills/karate/templates/java-junit5/src/test/java/{api → tests/api}/health.feature +3 -3
  91. package/.claude/skills/karate/templates/java-junit5/src/test/java/tests/api/products.feature +29 -0
  92. package/.claude/skills/karate/templates/java-junit5/src/test/java/{support → utils}/MaskingLogModifier.java +1 -1
  93. package/.claude/skills/karate/templates/java-junit5/src/test/resources/testData/newProduct.js +7 -0
  94. package/.claude/skills/karate/templates/java-junit5/src/test/resources/testData/testData.json +6 -0
  95. package/.claude/skills/newman/templates/README.md +4 -5
  96. package/.claude/skills/newman/templates/collection/.env.example +2 -0
  97. package/.claude/skills/newman/templates/collection/collections/api.postman_collection.json +165 -145
  98. package/.claude/skills/newman/templates/collection/package.json +2 -1
  99. package/.claude/skills/newman/templates/collection/resources/desc/products.desc.json +53 -0
  100. package/.claude/skills/newman/templates/collection/resources/testData/testData.json +10 -0
  101. package/.claude/skills/newman/templates/collection/run.js +41 -31
  102. package/.claude/skills/newman/templates/collection/src/config/env.js +37 -0
  103. package/.claude/skills/orion/SKILL.md +19 -12
  104. package/.claude/skills/orion/references/assess-fix.md +35 -0
  105. package/.claude/skills/orion/references/batch.md +64 -0
  106. package/.claude/skills/orion/references/blockers.md +1 -1
  107. package/.claude/skills/orion/references/capabilities.md +1 -1
  108. package/.claude/skills/orion/references/conversation.md +65 -20
  109. package/.claude/skills/orion/references/delivery-formats.md +24 -36
  110. package/.claude/skills/orion/references/doctor.md +1 -1
  111. package/.claude/skills/orion/references/hosts.md +1 -0
  112. package/.claude/skills/orion/references/modes.md +7 -3
  113. package/.claude/skills/orion/references/plain-language.md +55 -0
  114. package/.claude/skills/orion/references/project-context-files.md +8 -2
  115. package/.claude/skills/orion/references/recovery-loop.md +8 -0
  116. package/.claude/skills/orion/references/setup-card.md +29 -8
  117. package/.claude/skills/orion/references/status-lines.md +9 -4
  118. package/.claude/skills/orion/references/task-brief.md +1 -0
  119. package/.claude/skills/orion/references/work-branch.md +3 -1
  120. package/.claude/skills/orion/scripts/batch_detect.mjs +98 -0
  121. package/.claude/skills/orion/scripts/batch_state.mjs +179 -0
  122. package/.claude/skills/orion/scripts/browser_setup.mjs +41 -21
  123. package/.claude/skills/orion/scripts/cases_export.py +724 -0
  124. package/.claude/skills/orion/scripts/codemap.mjs +116 -0
  125. package/.claude/skills/orion/scripts/done_check.mjs +195 -0
  126. package/.claude/skills/orion/scripts/env_check.mjs +8 -3
  127. package/.claude/skills/orion/scripts/env_check.py +12 -5
  128. package/.claude/skills/orion/scripts/fix_plan.mjs +170 -0
  129. package/.claude/skills/orion/scripts/graph.mjs +400 -0
  130. package/.claude/skills/orion/scripts/hooks/lean_guard.mjs +162 -0
  131. package/.claude/skills/orion/scripts/lib/inside.mjs +31 -0
  132. package/.claude/skills/orion/scripts/lib/scan.mjs +357 -0
  133. package/.claude/skills/orion/scripts/lib/table.mjs +116 -0
  134. package/.claude/skills/orion/scripts/parity_check.mjs +166 -0
  135. package/.claude/skills/orion/scripts/quiet.mjs +160 -0
  136. package/.claude/skills/orion/scripts/report_check.mjs +77 -0
  137. package/.claude/skills/orion/scripts/results_parse.mjs +209 -0
  138. package/.claude/skills/orion/scripts/reuse_check.mjs +251 -0
  139. package/.claude/skills/orion/scripts/rules.mjs +92 -0
  140. package/.claude/skills/orion/scripts/run_state.mjs +238 -0
  141. package/.claude/skills/orion/scripts/suite_check.mjs +267 -0
  142. package/.claude/skills/orion/scripts/timing_profile.mjs +128 -0
  143. package/.claude/skills/orion/scripts/usage_report.mjs +315 -0
  144. package/.claude/skills/orion/templates/project-context/assessment.md +45 -0
  145. package/.claude/skills/orion/templates/project-context/defects.md +5 -0
  146. package/.claude/skills/orion/templates/project-context/report.md +45 -0
  147. package/.claude/skills/orion/templates/project-context/retry-policy.md +6 -0
  148. package/.claude/skills/orion/templates/project-context/run.md +4 -1
  149. package/.claude/skills/orion/templates/project-context/test-case-map.md +5 -0
  150. package/.claude/skills/orion/templates/project-context/test-design.md +24 -0
  151. package/.claude/skills/pact/SKILL.md +2 -2
  152. package/.claude/skills/pact/templates/README.md +4 -2
  153. package/.claude/skills/pact/templates/project/package.json +2 -2
  154. package/.claude/skills/pact/templates/project/{data/cases.js → resources/desc/products.desc.js} +3 -3
  155. package/.claude/skills/pact/templates/project/resources/testData/testData.js +21 -0
  156. package/.claude/skills/pact/templates/project/src/config/env.js +32 -0
  157. package/.claude/skills/pact/templates/project/src/{products-client.js → services/products-client.js} +4 -2
  158. package/.claude/skills/pact/templates/project/tests/contract/products.contract.test.js +46 -0
  159. package/.claude/skills/pact/templates/project/{verify → tests/verify}/products.verify.js +7 -22
  160. package/.claude/skills/playwright/SKILL.md +6 -6
  161. package/.claude/skills/playwright/templates/README.md +29 -10
  162. package/.claude/skills/playwright/templates/ci/Jenkinsfile +1 -1
  163. package/.claude/skills/playwright/templates/ci/azure-pipelines.yml +1 -1
  164. package/.claude/skills/playwright/templates/ci/github-actions-javascript.yml +1 -1
  165. package/.claude/skills/playwright/templates/ci/github-actions.yml +1 -1
  166. package/.claude/skills/playwright/templates/ci/gitlab-ci.yml +1 -1
  167. package/.claude/skills/playwright/templates/dotnet/.env.example +7 -0
  168. package/.claude/skills/playwright/templates/dotnet/.runsettings +17 -0
  169. package/.claude/skills/playwright/templates/dotnet/Automation.csproj +8 -0
  170. package/.claude/skills/playwright/templates/dotnet/Config/Env.cs +89 -0
  171. package/.claude/skills/playwright/templates/dotnet/Config/Flags.cs +56 -0
  172. package/.claude/skills/playwright/templates/dotnet/Config/Paths.cs +31 -0
  173. package/.claude/skills/playwright/templates/dotnet/Fixtures/ApiBaseTest.cs +39 -0
  174. package/.claude/skills/playwright/templates/dotnet/Fixtures/BaseTest.cs +72 -0
  175. package/.claude/skills/playwright/templates/dotnet/PageObjects/BasePage.cs +63 -0
  176. package/.claude/skills/playwright/templates/dotnet/PageObjects/HomePage.cs +21 -0
  177. package/.claude/skills/playwright/templates/dotnet/PageObjects/LoginPage.cs +54 -0
  178. package/.claude/skills/playwright/templates/dotnet/PageObjects/ShellPage.cs +29 -0
  179. package/.claude/skills/playwright/templates/dotnet/Resources/Desc/SignInDesc.cs +23 -0
  180. package/.claude/skills/playwright/templates/dotnet/Resources/TestData/TestData.cs +74 -0
  181. package/.claude/skills/playwright/templates/dotnet/Resources/TestData/testData.json +19 -0
  182. package/.claude/skills/playwright/templates/dotnet/Services/ApiClient.cs +51 -0
  183. package/.claude/skills/playwright/templates/dotnet/Setup/AuthSetup.cs +63 -0
  184. package/.claude/skills/playwright/templates/dotnet/Tests/Api/SessionTests.cs +18 -0
  185. package/.claude/skills/playwright/templates/dotnet/Tests/Ui/SignInTests.cs +48 -0
  186. package/.claude/skills/playwright/templates/dotnet/Tests/Unit/UtilsTests.cs +40 -0
  187. package/.claude/skills/playwright/templates/dotnet/Utils/AutomationError.cs +15 -0
  188. package/.claude/skills/playwright/templates/dotnet/Utils/Dates.cs +18 -0
  189. package/.claude/skills/playwright/templates/dotnet/Utils/Log.cs +37 -0
  190. package/.claude/skills/playwright/templates/dotnet/Utils/RandomData.cs +26 -0
  191. package/.claude/skills/playwright/templates/dotnet/Utils/Redact.cs +22 -0
  192. package/.claude/skills/playwright/templates/dotnet/Utils/TestDescription.cs +55 -0
  193. package/.claude/skills/playwright/templates/dotnet/gitignore +6 -1
  194. package/.claude/skills/playwright/templates/javascript/.env.example +8 -0
  195. package/.claude/skills/playwright/templates/javascript/fixtures/index.js +85 -0
  196. package/.claude/skills/playwright/templates/javascript/fixtures/session.js +82 -0
  197. package/.claude/skills/playwright/templates/javascript/gitignore +7 -0
  198. package/.claude/skills/playwright/templates/javascript/jsconfig.json +12 -0
  199. package/.claude/skills/playwright/templates/javascript/package.json +7 -3
  200. package/.claude/skills/playwright/templates/javascript/pageObjects/basePage.js +62 -0
  201. package/.claude/skills/playwright/templates/javascript/pageObjects/homePage.js +19 -0
  202. package/.claude/skills/playwright/templates/javascript/pageObjects/loginPage.js +44 -0
  203. package/.claude/skills/playwright/templates/javascript/pageObjects/shellPage.js +26 -0
  204. package/.claude/skills/playwright/templates/javascript/playwright.config.js +45 -24
  205. package/.claude/skills/playwright/templates/javascript/reporters/summaryReporter.js +233 -0
  206. package/.claude/skills/playwright/templates/javascript/resources/desc/signIn.desc.js +33 -0
  207. package/.claude/skills/playwright/templates/javascript/resources/testData/testData.js +45 -0
  208. package/.claude/skills/playwright/templates/javascript/setup/auth.setup.js +17 -0
  209. package/.claude/skills/playwright/templates/javascript/setup/auth.teardown.js +16 -0
  210. package/.claude/skills/playwright/templates/javascript/src/config/env.js +107 -0
  211. package/.claude/skills/playwright/templates/javascript/src/config/flags.js +70 -0
  212. package/.claude/skills/playwright/templates/javascript/src/config/loadEnv.js +21 -0
  213. package/.claude/skills/playwright/templates/javascript/src/config/paths.js +22 -0
  214. package/.claude/skills/playwright/templates/javascript/src/services/apiClient.js +68 -0
  215. package/.claude/skills/playwright/templates/javascript/tests/api/session.spec.js +15 -0
  216. package/.claude/skills/playwright/templates/javascript/tests/ui/signIn.spec.js +35 -0
  217. package/.claude/skills/playwright/templates/javascript/tests/unit/summaryReporter.test.js +34 -0
  218. package/.claude/skills/playwright/templates/javascript/tests/unit/utils.test.js +31 -0
  219. package/.claude/skills/playwright/templates/javascript/utils/date.js +28 -0
  220. package/.claude/skills/playwright/templates/javascript/{src → utils}/errors.js +1 -0
  221. package/.claude/skills/playwright/templates/javascript/utils/formFill.js +29 -0
  222. package/.claude/skills/playwright/templates/javascript/utils/logger.js +33 -0
  223. package/.claude/skills/playwright/templates/javascript/utils/random.js +37 -0
  224. package/.claude/skills/playwright/templates/javascript/utils/redact.js +35 -0
  225. package/.claude/skills/playwright/templates/javascript/utils/titles.js +38 -0
  226. package/.claude/skills/playwright/templates/project/.env.example +8 -0
  227. package/.claude/skills/playwright/templates/project/fixtures/index.ts +86 -0
  228. package/.claude/skills/playwright/templates/project/fixtures/session.ts +78 -0
  229. package/.claude/skills/playwright/templates/project/gitignore +9 -2
  230. package/.claude/skills/playwright/templates/project/package.json +8 -6
  231. package/.claude/skills/playwright/templates/project/pageObjects/basePage.ts +57 -0
  232. package/.claude/skills/playwright/templates/project/pageObjects/homePage.ts +20 -0
  233. package/.claude/skills/playwright/templates/project/pageObjects/loginPage.ts +47 -0
  234. package/.claude/skills/playwright/templates/project/pageObjects/shellPage.ts +22 -0
  235. package/.claude/skills/playwright/templates/project/playwright.config.ts +49 -23
  236. package/.claude/skills/playwright/templates/project/reporters/summaryReporter.ts +241 -0
  237. package/.claude/skills/playwright/templates/project/resources/desc/signIn.desc.ts +32 -0
  238. package/.claude/skills/playwright/templates/project/resources/testData/testData.ts +42 -0
  239. package/.claude/skills/playwright/templates/project/setup/auth.setup.ts +16 -0
  240. package/.claude/skills/playwright/templates/project/setup/auth.teardown.ts +15 -0
  241. package/.claude/skills/playwright/templates/project/src/config/env.ts +109 -0
  242. package/.claude/skills/playwright/templates/project/src/config/flags.ts +70 -0
  243. package/.claude/skills/playwright/templates/project/src/config/loadEnv.ts +17 -0
  244. package/.claude/skills/playwright/templates/project/src/config/paths.ts +19 -0
  245. package/.claude/skills/playwright/templates/project/src/services/apiClient.ts +70 -0
  246. package/.claude/skills/playwright/templates/project/tests/api/session.spec.ts +14 -0
  247. package/.claude/skills/playwright/templates/project/tests/ui/signIn.spec.ts +34 -0
  248. package/.claude/skills/playwright/templates/project/tests/unit/summaryReporter.test.ts +33 -0
  249. package/.claude/skills/playwright/templates/project/tests/unit/utils.test.ts +30 -0
  250. package/.claude/skills/playwright/templates/project/tsconfig.json +3 -8
  251. package/.claude/skills/playwright/templates/project/utils/date.ts +25 -0
  252. package/.claude/skills/playwright/templates/project/utils/formFill.ts +27 -0
  253. package/.claude/skills/playwright/templates/project/utils/logger.ts +32 -0
  254. package/.claude/skills/playwright/templates/project/utils/random.ts +34 -0
  255. package/.claude/skills/playwright/templates/project/utils/redact.ts +32 -0
  256. package/.claude/skills/playwright/templates/project/utils/titles.ts +42 -0
  257. package/.claude/skills/playwright/templates/python/.env.example +8 -0
  258. package/.claude/skills/playwright/templates/python/conftest.py +91 -16
  259. package/.claude/skills/playwright/templates/python/gitignore +5 -0
  260. package/.claude/skills/playwright/templates/python/page_objects/__init__.py +1 -0
  261. package/.claude/skills/playwright/templates/python/page_objects/base_page.py +57 -0
  262. package/.claude/skills/playwright/templates/python/page_objects/home_page.py +22 -0
  263. package/.claude/skills/playwright/templates/python/page_objects/login_page.py +42 -0
  264. package/.claude/skills/playwright/templates/python/page_objects/shell_page.py +21 -0
  265. package/.claude/skills/playwright/templates/python/pytest.ini +5 -2
  266. package/.claude/skills/playwright/templates/python/requirements.txt +1 -0
  267. package/.claude/skills/playwright/templates/python/resources/__init__.py +1 -0
  268. package/.claude/skills/playwright/templates/python/resources/desc/__init__.py +1 -0
  269. package/.claude/skills/playwright/templates/python/resources/desc/sign_in_desc.py +27 -0
  270. package/.claude/skills/playwright/templates/python/resources/test_data/__init__.py +1 -0
  271. package/.claude/skills/playwright/templates/python/resources/test_data/test_data.py +41 -0
  272. package/.claude/skills/playwright/templates/python/setup/__init__.py +1 -0
  273. package/.claude/skills/playwright/templates/python/setup/auth.py +53 -0
  274. package/.claude/skills/playwright/templates/python/src/__init__.py +1 -0
  275. package/.claude/skills/playwright/templates/python/src/config/__init__.py +1 -0
  276. package/.claude/skills/playwright/templates/python/src/config/env.py +109 -0
  277. package/.claude/skills/playwright/templates/python/src/config/flags.py +63 -0
  278. package/.claude/skills/playwright/templates/python/src/config/load_env.py +16 -0
  279. package/.claude/skills/playwright/templates/python/src/config/paths.py +25 -0
  280. package/.claude/skills/playwright/templates/python/src/services/__init__.py +1 -0
  281. package/.claude/skills/playwright/templates/python/src/services/api_client.py +60 -0
  282. package/.claude/skills/playwright/templates/python/tests/api/test_session.py +14 -0
  283. package/.claude/skills/playwright/templates/python/tests/ui/test_sign_in.py +36 -0
  284. package/.claude/skills/playwright/templates/python/tests/unit/test_utils.py +32 -0
  285. package/.claude/skills/playwright/templates/python/utils/__init__.py +1 -0
  286. package/.claude/skills/playwright/templates/python/utils/dates.py +23 -0
  287. package/.claude/skills/playwright/templates/python/{framework → utils}/errors.py +3 -2
  288. package/.claude/skills/playwright/templates/python/utils/form_fill.py +26 -0
  289. package/.claude/skills/playwright/templates/python/utils/logger.py +40 -0
  290. package/.claude/skills/playwright/templates/python/utils/markers.py +6 -0
  291. package/.claude/skills/playwright/templates/python/utils/random_data.py +35 -0
  292. package/.claude/skills/playwright/templates/python/utils/redact.py +30 -0
  293. package/.claude/skills/playwright/templates/python/utils/titles.py +53 -0
  294. package/.claude/skills/quality-checks/SKILL.md +11 -11
  295. package/.claude/skills/quality-checks/templates/README.md +14 -12
  296. package/.claude/skills/quality-checks/templates/playwright-js/pageObjects/scannedPage.js +21 -0
  297. package/.claude/skills/quality-checks/templates/playwright-js/resources/desc/quality.desc.js +63 -0
  298. package/.claude/skills/quality-checks/templates/playwright-js/resources/testData/qualityData.js +32 -0
  299. package/.claude/skills/quality-checks/templates/playwright-js/src/checks/accessibility.js +50 -0
  300. package/.claude/skills/quality-checks/templates/playwright-js/src/checks/pageHealth.js +38 -0
  301. package/.claude/skills/quality-checks/templates/playwright-js/src/checks/performance.js +21 -0
  302. package/.claude/skills/quality-checks/templates/playwright-js/src/services/graphqlClient.js +28 -0
  303. package/.claude/skills/quality-checks/templates/playwright-js/tests/api/graphql.spec.js +23 -0
  304. package/.claude/skills/quality-checks/templates/playwright-js/tests/ui/quality.spec.js +50 -0
  305. package/.claude/skills/quality-checks/templates/playwright-ts/pageObjects/scannedPage.ts +20 -0
  306. package/.claude/skills/quality-checks/templates/playwright-ts/resources/desc/quality.desc.ts +59 -0
  307. package/.claude/skills/quality-checks/templates/playwright-ts/{src/data/quality.data.ts → resources/testData/qualityData.ts} +3 -2
  308. package/.claude/skills/quality-checks/templates/playwright-ts/tests/api/graphql.spec.ts +22 -0
  309. package/.claude/skills/quality-checks/templates/playwright-ts/tests/ui/quality.spec.ts +49 -0
  310. package/.claude/skills/requests/templates/README.md +6 -7
  311. package/.claude/skills/requests/templates/python-pytest/.env.example +4 -0
  312. package/.claude/skills/requests/templates/python-pytest/conftest.py +24 -9
  313. package/.claude/skills/requests/templates/python-pytest/pytest.ini +6 -3
  314. package/.claude/skills/requests/templates/python-pytest/requirements.txt +1 -0
  315. package/.claude/skills/requests/templates/python-pytest/resources/__init__.py +1 -0
  316. package/.claude/skills/requests/templates/python-pytest/resources/desc/__init__.py +1 -0
  317. package/.claude/skills/requests/templates/python-pytest/resources/desc/products_desc.py +27 -0
  318. package/.claude/skills/requests/templates/python-pytest/resources/test_data/__init__.py +1 -0
  319. package/.claude/skills/requests/templates/python-pytest/resources/test_data/test_data.py +27 -0
  320. package/.claude/skills/requests/templates/python-pytest/src/__init__.py +1 -0
  321. package/.claude/skills/requests/templates/python-pytest/src/config/__init__.py +1 -0
  322. package/.claude/skills/requests/templates/python-pytest/src/config/env.py +39 -0
  323. package/.claude/skills/requests/templates/python-pytest/src/config/flags.py +35 -0
  324. package/.claude/skills/requests/templates/python-pytest/src/config/load_env.py +16 -0
  325. package/.claude/skills/requests/templates/python-pytest/src/config/paths.py +16 -0
  326. package/.claude/skills/requests/templates/python-pytest/src/services/__init__.py +1 -0
  327. package/.claude/skills/requests/templates/python-pytest/{api/client.py → src/services/api_client.py} +19 -10
  328. package/.claude/skills/requests/templates/python-pytest/{api → src/services}/products_api.py +3 -9
  329. package/.claude/skills/requests/templates/python-pytest/tests/api/test_products.py +35 -0
  330. package/.claude/skills/requests/templates/python-pytest/tests/unit/test_utils.py +32 -0
  331. package/.claude/skills/requests/templates/python-pytest/utils/__init__.py +1 -0
  332. package/.claude/skills/requests/templates/python-pytest/utils/dates.py +23 -0
  333. package/.claude/skills/{selenium/templates/python-pytest/framework → requests/templates/python-pytest/utils}/errors.py +4 -3
  334. package/.claude/skills/requests/templates/python-pytest/utils/logger.py +40 -0
  335. package/.claude/skills/requests/templates/python-pytest/utils/random_data.py +35 -0
  336. package/.claude/skills/requests/templates/python-pytest/utils/redact.py +30 -0
  337. package/.claude/skills/requests/templates/python-pytest/utils/titles.py +53 -0
  338. package/.claude/skills/requirement-analysis/SKILL.md +1 -1
  339. package/.claude/skills/rest-assured/SKILL.md +1 -1
  340. package/.claude/skills/rest-assured/templates/README.md +6 -7
  341. package/.claude/skills/rest-assured/templates/ci/github-actions.yml +5 -2
  342. package/.claude/skills/rest-assured/templates/java-testng/.env.example +3 -0
  343. package/.claude/skills/rest-assured/templates/java-testng/pom.xml +7 -0
  344. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/{api/ApiConfig.java → config/Env.java} +35 -22
  345. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/config/Flags.java +17 -0
  346. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/config/Paths.java +14 -0
  347. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/desc/ProductsDesc.java +26 -0
  348. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/fixtures/BaseTest.java +29 -0
  349. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/services/ApiSpec.java +31 -0
  350. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/services/HealthApi.java +17 -0
  351. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/{api → services}/ProductsApi.java +19 -14
  352. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/{data → testData}/ProductBuilder.java +4 -8
  353. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/testData/TestData.java +64 -0
  354. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/tests/api/ProductsTest.java +49 -0
  355. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/tests/unit/UtilsTest.java +34 -0
  356. package/.claude/skills/{selenium/templates/java-testng/src/test/java/automation/framework → rest-assured/templates/java-testng/src/test/java/automation/utils}/AutomationError.java +4 -4
  357. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/Case.java +20 -0
  358. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/CaseTransformer.java +54 -0
  359. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/Dates.java +42 -0
  360. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/Log.java +45 -0
  361. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/MissingSettingError.java +13 -0
  362. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/RandomData.java +41 -0
  363. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/Redact.java +33 -0
  364. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/TestDescription.java +25 -0
  365. package/.claude/skills/rest-assured/templates/java-testng/src/test/resources/testData/testData.properties +14 -0
  366. package/.claude/skills/rest-assured/templates/java-testng/testng.xml +14 -0
  367. package/.claude/skills/selenium/SKILL.md +1 -1
  368. package/.claude/skills/selenium/templates/README.md +25 -13
  369. package/.claude/skills/selenium/templates/ci/github-actions-java.yml +5 -2
  370. package/.claude/skills/selenium/templates/csharp-nunit/.env.example +15 -0
  371. package/.claude/skills/selenium/templates/csharp-nunit/Automation.csproj +7 -0
  372. package/.claude/skills/selenium/templates/csharp-nunit/{Framework/Config.cs → Config/Env.cs} +33 -34
  373. package/.claude/skills/selenium/templates/csharp-nunit/Config/Flags.cs +39 -0
  374. package/.claude/skills/selenium/templates/csharp-nunit/Config/Paths.cs +31 -0
  375. package/.claude/skills/selenium/templates/csharp-nunit/{Framework → Driver}/DriverFactory.cs +16 -13
  376. package/.claude/skills/selenium/templates/csharp-nunit/Driver/DriverManager.cs +27 -0
  377. package/.claude/skills/selenium/templates/csharp-nunit/Fixtures/BaseTest.cs +56 -0
  378. package/.claude/skills/selenium/templates/csharp-nunit/{Pages → PageObjects}/BasePage.cs +44 -14
  379. package/.claude/skills/selenium/templates/csharp-nunit/PageObjects/HomePage.cs +21 -0
  380. package/.claude/skills/selenium/templates/csharp-nunit/PageObjects/LoginPage.cs +53 -0
  381. package/.claude/skills/selenium/templates/csharp-nunit/PageObjects/ShellPage.cs +22 -0
  382. package/.claude/skills/selenium/templates/csharp-nunit/Resources/Desc/SignInDesc.cs +23 -0
  383. package/.claude/skills/selenium/templates/csharp-nunit/Resources/TestData/TestData.cs +74 -0
  384. package/.claude/skills/selenium/templates/csharp-nunit/Resources/TestData/testData.json +14 -0
  385. package/.claude/skills/selenium/templates/csharp-nunit/Services/ApiClient.cs +71 -0
  386. package/.claude/skills/selenium/templates/csharp-nunit/Setup/AuthSetup.cs +104 -0
  387. package/.claude/skills/selenium/templates/csharp-nunit/Tests/Api/SessionTests.cs +23 -0
  388. package/.claude/skills/selenium/templates/csharp-nunit/Tests/Ui/SignInTests.cs +42 -0
  389. package/.claude/skills/selenium/templates/csharp-nunit/Tests/Unit/UtilsTests.cs +40 -0
  390. package/.claude/skills/selenium/templates/csharp-nunit/Utils/AutomationError.cs +15 -0
  391. package/.claude/skills/selenium/templates/csharp-nunit/Utils/Dates.cs +18 -0
  392. package/.claude/skills/selenium/templates/csharp-nunit/Utils/FormFill.cs +20 -0
  393. package/.claude/skills/selenium/templates/csharp-nunit/Utils/Log.cs +37 -0
  394. package/.claude/skills/selenium/templates/csharp-nunit/Utils/RandomData.cs +26 -0
  395. package/.claude/skills/selenium/templates/csharp-nunit/Utils/Redact.cs +22 -0
  396. package/.claude/skills/selenium/templates/csharp-nunit/Utils/TestDescription.cs +55 -0
  397. package/.claude/skills/selenium/templates/csharp-nunit/gitignore +6 -2
  398. package/.claude/skills/selenium/templates/java-testng/.env.example +12 -0
  399. package/.claude/skills/selenium/templates/java-testng/gitignore +5 -2
  400. package/.claude/skills/selenium/templates/java-testng/pom.xml +2 -0
  401. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/{framework/Config.java → config/Env.java} +45 -55
  402. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/config/Flags.java +50 -0
  403. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/config/Paths.java +20 -0
  404. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/desc/SignInDesc.java +30 -0
  405. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/{framework → driver}/DriverFactory.java +15 -12
  406. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/{framework → driver}/DriverManager.java +4 -7
  407. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/fixtures/BaseTest.java +87 -0
  408. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/{pages → pageObjects}/BasePage.java +41 -17
  409. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pageObjects/HomePage.java +32 -0
  410. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pageObjects/LoginPage.java +69 -0
  411. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pageObjects/ShellPage.java +34 -0
  412. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/services/ApiClient.java +93 -0
  413. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/setup/AuthSetup.java +125 -0
  414. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/testData/TestData.java +88 -0
  415. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/api/SessionTest.java +23 -0
  416. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/ui/SignInTest.java +46 -0
  417. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/unit/UtilsTest.java +34 -0
  418. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/AutomationError.java +18 -0
  419. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/Case.java +20 -0
  420. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/CaseTransformer.java +54 -0
  421. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/Dates.java +42 -0
  422. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/FormFill.java +25 -0
  423. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/Log.java +45 -0
  424. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/MissingSettingError.java +13 -0
  425. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/RandomData.java +41 -0
  426. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/Redact.java +33 -0
  427. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/TestDescription.java +25 -0
  428. package/.claude/skills/selenium/templates/java-testng/src/test/resources/testData/testData.properties +11 -0
  429. package/.claude/skills/selenium/templates/java-testng/testng.xml +15 -5
  430. package/.claude/skills/selenium/templates/python-pytest/.env.example +12 -0
  431. package/.claude/skills/selenium/templates/python-pytest/conftest.py +63 -12
  432. package/.claude/skills/selenium/templates/python-pytest/gitignore +7 -2
  433. package/.claude/skills/selenium/templates/python-pytest/page_objects/__init__.py +1 -0
  434. package/.claude/skills/selenium/templates/python-pytest/{pages → page_objects}/base_page.py +20 -20
  435. package/.claude/skills/selenium/templates/python-pytest/page_objects/home_page.py +17 -0
  436. package/.claude/skills/selenium/templates/python-pytest/{pages → page_objects}/login_page.py +12 -14
  437. package/.claude/skills/selenium/templates/python-pytest/page_objects/shell_page.py +16 -0
  438. package/.claude/skills/selenium/templates/python-pytest/pytest.ini +6 -2
  439. package/.claude/skills/selenium/templates/python-pytest/requirements.txt +1 -0
  440. package/.claude/skills/selenium/templates/python-pytest/resources/__init__.py +1 -0
  441. package/.claude/skills/selenium/templates/python-pytest/resources/desc/__init__.py +1 -0
  442. package/.claude/skills/selenium/templates/python-pytest/resources/desc/sign_in_desc.py +27 -0
  443. package/.claude/skills/selenium/templates/python-pytest/resources/test_data/__init__.py +1 -0
  444. package/.claude/skills/selenium/templates/python-pytest/resources/test_data/test_data.py +25 -0
  445. package/.claude/skills/selenium/templates/python-pytest/setup/__init__.py +1 -0
  446. package/.claude/skills/selenium/templates/python-pytest/setup/auth.py +60 -0
  447. package/.claude/skills/selenium/templates/python-pytest/src/__init__.py +1 -0
  448. package/.claude/skills/selenium/templates/python-pytest/src/config/__init__.py +1 -0
  449. package/.claude/skills/selenium/templates/python-pytest/src/config/env.py +68 -0
  450. package/.claude/skills/selenium/templates/python-pytest/src/config/flags.py +40 -0
  451. package/.claude/skills/selenium/templates/python-pytest/src/config/load_env.py +16 -0
  452. package/.claude/skills/selenium/templates/python-pytest/src/config/paths.py +25 -0
  453. package/.claude/skills/selenium/templates/python-pytest/src/driver/__init__.py +1 -0
  454. package/.claude/skills/selenium/templates/python-pytest/{framework → src/driver}/driver_factory.py +11 -18
  455. package/.claude/skills/selenium/templates/python-pytest/{framework → src/driver}/driver_manager.py +3 -3
  456. package/.claude/skills/selenium/templates/python-pytest/src/services/__init__.py +1 -0
  457. package/.claude/skills/selenium/templates/python-pytest/src/services/api_client.py +89 -0
  458. package/.claude/skills/selenium/templates/python-pytest/tests/api/test_session.py +11 -0
  459. package/.claude/skills/selenium/templates/python-pytest/tests/ui/test_sign_in.py +34 -0
  460. package/.claude/skills/selenium/templates/python-pytest/tests/unit/test_utils.py +32 -0
  461. package/.claude/skills/selenium/templates/python-pytest/utils/__init__.py +1 -0
  462. package/.claude/skills/selenium/templates/python-pytest/utils/dates.py +23 -0
  463. package/.claude/skills/selenium/templates/python-pytest/utils/errors.py +28 -0
  464. package/.claude/skills/selenium/templates/python-pytest/utils/form_fill.py +29 -0
  465. package/.claude/skills/selenium/templates/python-pytest/utils/logger.py +40 -0
  466. package/.claude/skills/selenium/templates/python-pytest/utils/markers.py +6 -0
  467. package/.claude/skills/selenium/templates/python-pytest/utils/random_data.py +35 -0
  468. package/.claude/skills/selenium/templates/python-pytest/utils/redact.py +30 -0
  469. package/.claude/skills/selenium/templates/python-pytest/utils/titles.py +53 -0
  470. package/.claude/skills/self-healing/SKILL.md +2 -2
  471. package/.claude/skills/test-design/SKILL.md +1 -1
  472. package/.claude/skills/test-reporting/references/tool-mapping.md +13 -9
  473. package/.claude/skills/ui-observation/SKILL.md +8 -6
  474. package/.claude/skills/ui-observation/references/login-methods.md +1 -1
  475. package/.claude-plugin/plugin.json +15 -2
  476. package/.codex/agents/automation-strategist.toml +1 -0
  477. package/.codex/agents/change-agent.toml +1 -0
  478. package/.codex/agents/codebase-analyst.toml +1 -0
  479. package/.codex/agents/environment-discovery.toml +1 -0
  480. package/.codex/agents/evidence-validator.toml +1 -0
  481. package/.codex/agents/executor.toml +1 -0
  482. package/.codex/agents/failure-analyst.toml +1 -0
  483. package/.codex/agents/implementer.toml +2 -1
  484. package/.codex/agents/requirement-analyst.toml +1 -0
  485. package/.codex/agents/reviewer.toml +1 -0
  486. package/.codex/agents/test-reporter.toml +1 -0
  487. package/.codex/hooks.json +15 -0
  488. package/.cursor/commands/orion.md +1 -1
  489. package/.cursor/hooks.json +10 -0
  490. package/.devin/hooks.v1.json +13 -0
  491. package/.gemini/agents/automation-strategist.md +1 -0
  492. package/.gemini/agents/change-agent.md +1 -0
  493. package/.gemini/agents/codebase-analyst.md +1 -0
  494. package/.gemini/agents/environment-discovery.md +1 -0
  495. package/.gemini/agents/evidence-validator.md +1 -0
  496. package/.gemini/agents/executor.md +1 -0
  497. package/.gemini/agents/failure-analyst.md +1 -0
  498. package/.gemini/agents/implementer.md +2 -1
  499. package/.gemini/agents/requirement-analyst.md +1 -0
  500. package/.gemini/agents/reviewer.md +1 -0
  501. package/.gemini/agents/test-reporter.md +1 -0
  502. package/.gemini/commands/orion.toml +2 -2
  503. package/.github/hooks/orion-lean.json +13 -0
  504. package/.github/prompts/orion.prompt.md +2 -2
  505. package/.windsurf/workflows/orion.md +2 -2
  506. package/AGENTS.md +6 -6
  507. package/README.md +55 -140
  508. package/assets/architecture.svg +104 -0
  509. package/assets/run-flow.svg +1 -1
  510. package/bin/orion.mjs +6 -6
  511. package/hosts/gemini-extension/gemini-extension.json +1 -1
  512. package/hosts/gemini-extension/hooks/hooks.json +16 -0
  513. package/hosts/gemini-extension/policies/platform.toml +5 -0
  514. package/package.json +6 -1
  515. package/.claude/skills/appium/templates/project-java/src/test/java/automation/data/Cases.java +0 -37
  516. package/.claude/skills/appium/templates/project-java/src/test/java/automation/data/SignInData.java +0 -25
  517. package/.claude/skills/appium/templates/project-java/src/test/java/automation/flows/SignInFlow.java +0 -34
  518. package/.claude/skills/appium/templates/project-java/src/test/java/automation/framework/Account.java +0 -19
  519. package/.claude/skills/appium/templates/project-java/src/test/java/automation/screens/HomeScreen.java +0 -36
  520. package/.claude/skills/appium/templates/project-java/src/test/java/automation/screens/LoginScreen.java +0 -57
  521. package/.claude/skills/appium/templates/project-java/src/test/java/automation/tests/BaseTest.java +0 -33
  522. package/.claude/skills/appium/templates/project-java/src/test/java/automation/tests/SmokeTest.java +0 -17
  523. package/.claude/skills/httpclient/templates/csharp-nunit/Api/ApiClient.cs +0 -61
  524. package/.claude/skills/httpclient/templates/csharp-nunit/Api/ApiConfig.cs +0 -61
  525. package/.claude/skills/httpclient/templates/csharp-nunit/Api/ApiError.cs +0 -17
  526. package/.claude/skills/httpclient/templates/csharp-nunit/Data/Cases.cs +0 -41
  527. package/.claude/skills/httpclient/templates/csharp-nunit/Data/HealthData.cs +0 -11
  528. package/.claude/skills/httpclient/templates/csharp-nunit/Data/ProductBuilder.cs +0 -16
  529. package/.claude/skills/httpclient/templates/csharp-nunit/Data/ProductsData.cs +0 -17
  530. package/.claude/skills/httpclient/templates/csharp-nunit/Tests/HealthTests.cs +0 -18
  531. package/.claude/skills/httpclient/templates/csharp-nunit/Tests/ProductsTests.cs +0 -48
  532. package/.claude/skills/k6/templates/project/data/builders.js +0 -8
  533. package/.claude/skills/karate/templates/java-junit5/src/test/java/api/products.feature +0 -33
  534. package/.claude/skills/pact/templates/project/test/contract/products.contract.test.js +0 -45
  535. package/.claude/skills/playwright/templates/dotnet/Components/AccountMenu.cs +0 -23
  536. package/.claude/skills/playwright/templates/dotnet/Data/Cases.cs +0 -43
  537. package/.claude/skills/playwright/templates/dotnet/Data/SignInData.cs +0 -24
  538. package/.claude/skills/playwright/templates/dotnet/Flows/SignInFlow.cs +0 -51
  539. package/.claude/skills/playwright/templates/dotnet/Framework/AutomationError.cs +0 -17
  540. package/.claude/skills/playwright/templates/dotnet/Framework/Config.cs +0 -91
  541. package/.claude/skills/playwright/templates/dotnet/Pages/BasePage.cs +0 -57
  542. package/.claude/skills/playwright/templates/dotnet/Pages/HomePage.cs +0 -26
  543. package/.claude/skills/playwright/templates/dotnet/Pages/LoginPage.cs +0 -45
  544. package/.claude/skills/playwright/templates/dotnet/Tests/SmokeTests.cs +0 -47
  545. package/.claude/skills/playwright/templates/javascript/src/components/account-menu.component.js +0 -30
  546. package/.claude/skills/playwright/templates/javascript/src/config.js +0 -53
  547. package/.claude/skills/playwright/templates/javascript/src/data/accounts.js +0 -23
  548. package/.claude/skills/playwright/templates/javascript/src/data/cases.js +0 -49
  549. package/.claude/skills/playwright/templates/javascript/src/data/sign-in.data.js +0 -12
  550. package/.claude/skills/playwright/templates/javascript/src/flows/sign-in.flow.js +0 -53
  551. package/.claude/skills/playwright/templates/javascript/src/pages/base.page.js +0 -59
  552. package/.claude/skills/playwright/templates/javascript/src/pages/home.page.js +0 -31
  553. package/.claude/skills/playwright/templates/javascript/src/pages/login.page.js +0 -56
  554. package/.claude/skills/playwright/templates/javascript/tests/fixtures.js +0 -20
  555. package/.claude/skills/playwright/templates/javascript/tests/smoke.spec.js +0 -22
  556. package/.claude/skills/playwright/templates/project/src/components/account-menu.component.ts +0 -27
  557. package/.claude/skills/playwright/templates/project/src/config.ts +0 -56
  558. package/.claude/skills/playwright/templates/project/src/data/accounts.ts +0 -21
  559. package/.claude/skills/playwright/templates/project/src/data/cases.ts +0 -55
  560. package/.claude/skills/playwright/templates/project/src/data/sign-in.data.ts +0 -10
  561. package/.claude/skills/playwright/templates/project/src/flows/sign-in.flow.ts +0 -51
  562. package/.claude/skills/playwright/templates/project/src/pages/base.page.ts +0 -52
  563. package/.claude/skills/playwright/templates/project/src/pages/home.page.ts +0 -30
  564. package/.claude/skills/playwright/templates/project/src/pages/login.page.ts +0 -53
  565. package/.claude/skills/playwright/templates/project/tests/fixtures.ts +0 -25
  566. package/.claude/skills/playwright/templates/project/tests/smoke.spec.ts +0 -22
  567. package/.claude/skills/playwright/templates/python/components/__init__.py +0 -1
  568. package/.claude/skills/playwright/templates/python/components/account_menu.py +0 -22
  569. package/.claude/skills/playwright/templates/python/data/accounts.py +0 -14
  570. package/.claude/skills/playwright/templates/python/data/cases.py +0 -33
  571. package/.claude/skills/playwright/templates/python/data/sign_in_data.py +0 -9
  572. package/.claude/skills/playwright/templates/python/flows/sign_in.py +0 -63
  573. package/.claude/skills/playwright/templates/python/framework/config.py +0 -86
  574. package/.claude/skills/playwright/templates/python/pages/base_page.py +0 -51
  575. package/.claude/skills/playwright/templates/python/pages/home_page.py +0 -21
  576. package/.claude/skills/playwright/templates/python/pages/login_page.py +0 -40
  577. package/.claude/skills/playwright/templates/python/tests/test_smoke.py +0 -26
  578. package/.claude/skills/quality-checks/templates/playwright-ts/src/pages/scanned.page.ts +0 -16
  579. package/.claude/skills/quality-checks/templates/playwright-ts/tests/quality.spec.ts +0 -58
  580. package/.claude/skills/requests/templates/python-pytest/api/config.py +0 -43
  581. package/.claude/skills/requests/templates/python-pytest/api/errors.py +0 -15
  582. package/.claude/skills/requests/templates/python-pytest/data/builders.py +0 -16
  583. package/.claude/skills/requests/templates/python-pytest/data/cases.py +0 -30
  584. package/.claude/skills/requests/templates/python-pytest/data/health_data.py +0 -6
  585. package/.claude/skills/requests/templates/python-pytest/data/products_data.py +0 -10
  586. package/.claude/skills/requests/templates/python-pytest/tests/test_health.py +0 -12
  587. package/.claude/skills/requests/templates/python-pytest/tests/test_products.py +0 -25
  588. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/api/ApiError.java +0 -18
  589. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/api/ApiSpec.java +0 -29
  590. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/api/HealthApi.java +0 -21
  591. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/data/Cases.java +0 -45
  592. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/data/HealthData.java +0 -12
  593. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/data/ProductsData.java +0 -16
  594. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/tests/HealthTest.java +0 -15
  595. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/tests/ProductsTest.java +0 -37
  596. package/.claude/skills/selenium/templates/csharp-nunit/Components/AccountMenu.cs +0 -26
  597. package/.claude/skills/selenium/templates/csharp-nunit/Data/Cases.cs +0 -43
  598. package/.claude/skills/selenium/templates/csharp-nunit/Data/SignInData.cs +0 -24
  599. package/.claude/skills/selenium/templates/csharp-nunit/Flows/SignInFlow.cs +0 -51
  600. package/.claude/skills/selenium/templates/csharp-nunit/Framework/AutomationError.cs +0 -17
  601. package/.claude/skills/selenium/templates/csharp-nunit/Framework/DriverManager.cs +0 -26
  602. package/.claude/skills/selenium/templates/csharp-nunit/Pages/HomePage.cs +0 -28
  603. package/.claude/skills/selenium/templates/csharp-nunit/Pages/LoginPage.cs +0 -58
  604. package/.claude/skills/selenium/templates/csharp-nunit/Tests/BaseTest.cs +0 -22
  605. package/.claude/skills/selenium/templates/csharp-nunit/Tests/SmokeTests.cs +0 -37
  606. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/components/AccountMenu.java +0 -37
  607. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/data/Cases.java +0 -48
  608. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/data/SignInData.java +0 -36
  609. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/flows/SignInFlow.java +0 -60
  610. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/framework/Account.java +0 -19
  611. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pages/HomePage.java +0 -45
  612. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pages/LoginPage.java +0 -78
  613. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/BaseTest.java +0 -33
  614. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/SmokeTest.java +0 -33
  615. package/.claude/skills/selenium/templates/python-pytest/components/__init__.py +0 -1
  616. package/.claude/skills/selenium/templates/python-pytest/components/account_menu.py +0 -19
  617. package/.claude/skills/selenium/templates/python-pytest/data/accounts.py +0 -14
  618. package/.claude/skills/selenium/templates/python-pytest/data/cases.py +0 -33
  619. package/.claude/skills/selenium/templates/python-pytest/data/sign_in_data.py +0 -9
  620. package/.claude/skills/selenium/templates/python-pytest/flows/__init__.py +0 -0
  621. package/.claude/skills/selenium/templates/python-pytest/flows/sign_in.py +0 -61
  622. package/.claude/skills/selenium/templates/python-pytest/framework/__init__.py +0 -0
  623. package/.claude/skills/selenium/templates/python-pytest/framework/config.py +0 -90
  624. package/.claude/skills/selenium/templates/python-pytest/pages/__init__.py +0 -0
  625. package/.claude/skills/selenium/templates/python-pytest/pages/home_page.py +0 -23
  626. package/.claude/skills/selenium/templates/python-pytest/tests/test_smoke.py +0 -25
  627. /package/.claude/skills/karate/templates/java-junit5/src/test/java/{api → tests/api}/delete-product.feature +0 -0
  628. /package/.claude/skills/playwright/templates/{python/data/__init__.py → dotnet/auth/.gitkeep} +0 -0
  629. /package/.claude/skills/playwright/templates/{python/flows/__init__.py → javascript/auth/.gitkeep} +0 -0
  630. /package/.claude/skills/playwright/templates/{python/framework/__init__.py → project/auth/.gitkeep} +0 -0
  631. /package/.claude/skills/playwright/templates/project/{src → utils}/errors.ts +0 -0
  632. /package/.claude/skills/playwright/templates/python/{pages/__init__.py → auth/.gitkeep} +0 -0
  633. /package/.claude/skills/quality-checks/templates/playwright-ts/src/checks/{page-health.ts → pageHealth.ts} +0 -0
  634. /package/.claude/skills/quality-checks/templates/playwright-ts/src/{api/graphql.ts → services/graphqlClient.ts} +0 -0
  635. /package/.claude/skills/{requests/templates/python-pytest/api/__init__.py → selenium/templates/csharp-nunit/auth/.gitkeep} +0 -0
  636. /package/.claude/skills/{requests/templates/python-pytest/data/__init__.py → selenium/templates/java-testng/auth/.gitkeep} +0 -0
  637. /package/.claude/skills/selenium/templates/python-pytest/{data/__init__.py → auth/.gitkeep} +0 -0
@@ -0,0 +1,357 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Read-only scanner for a test suite in any of the supported languages (JavaScript, TypeScript, Python, Java, C#, plus
4
+ * Gherkin and Robot files). No dependencies and no parser: it reads manifests, file names, imports and lines with
5
+ * regular expressions, so everything it reports carries the evidence it came from, and what it can't see is listed
6
+ * under `limits`. Used by `suite_check.mjs --existing` and by the Orion graph.
7
+ *
8
+ * Usage (from the workspace root):
9
+ * node .claude/skills/orion/scripts/lib/scan.mjs <suite folder> (prints the scan as JSON)
10
+ * import { scan } from './lib/scan.mjs' (returns the same object)
11
+ *
12
+ * Output: frameworks (with the file that shows each), languages, kind (ui | api | ui+api | unknown), the files by role
13
+ * (tests with their test names, page objects, fixtures, test data, config, helpers, locator files), edges from tests to
14
+ * the files they use (`confirmed` when an import names the file, `inferred` when only a class name matches) and
15
+ * findings for the rules a script can see (U1, U2, U3, U7, P1, P2, P5, P6/P18, P8, P17), each with file, line and a
16
+ * short quote. A quote never shows a secret: string values on a line that names a password, token, secret or key are
17
+ * replaced by `***`. Reads source files only; never `.env` files or saved sessions.
18
+ */
19
+ import fs from 'node:fs';
20
+ import path from 'node:path';
21
+ import { fileURLToPath } from 'node:url';
22
+
23
+ const SKIP_DIRS = new Set(['node_modules', '.git', 'auth', 'playwright-report', 'test-results', 'allure-results', 'blob-report',
24
+ 'bin', 'obj', 'target', 'reports', 'TestResults', '.venv', 'venv', '__pycache__', '.pytest_cache', 'test-output', 'dist',
25
+ 'build', '.gradle', '.idea', '.vscode', 'coverage', 'screenshots', 'videos', 'downloads', 'project-context', '.claude',
26
+ '.cursor', '.github', '.ui-map', 'app']);
27
+ const SOURCE = /\.(m?[jt]sx?|py|java|cs|feature|robot|kt)$/;
28
+ const MAX_BYTES = 400_000;
29
+
30
+ const LANG_OF = (f) => (/\.m?tsx?$/.test(f) ? 'ts' : /\.m?jsx?$/.test(f) ? 'js' : /\.py$/.test(f) ? 'py' : /\.java$/.test(f) ? 'java'
31
+ : /\.cs$/.test(f) ? 'cs' : /\.feature$/.test(f) ? 'gherkin' : /\.robot$/.test(f) ? 'robot' : /\.kt$/.test(f) ? 'kotlin' : null);
32
+
33
+ /** Test files by name, per language. */
34
+ const TEST_FILE = /(\.(spec|test|cy|e2e)\.m?[jt]sx?$)|((^|\/)tests?\/(load|perf|performance)\/[^/]+\.m?js$)|((^|\/)test_\w+\.py$)|(_test\.py$)|((^|\/)(src\/test\/.*\/)?\w+Tests?\.(java|kt)$)|(\w+Tests?\.cs$)|(\.feature$)|(\.robot$)/;
35
+ /** Page, screen or component objects by folder or name. */
36
+ const PAGE_FILE = /(^|\/)(pages|pageObjects|page_objects|pageobjects|PageObjects|screens|Screens|components)\/[^/]+\.(m?[jt]sx?|py|java|cs|kt)$|(Page|Screen)\.(m?[jt]sx?|java|cs|kt)$|_(page|screen)\.py$|\.(page|screen)\.m?[jt]s$/;
37
+ const FIXTURE_FILE = /(^|\/)(fixtures?|Fixtures)\/[^/]+\.(m?[jt]s|py|java|cs)$|(^|\/)fixtures\.m?[jt]s$|(^|\/)conftest\.py$|(Base(Ui|Api)?Test|TestBase|BaseTest)\.(java|cs|kt)$|(^|\/)support\/(e2e|commands)\.[jt]s$/;
38
+ const DATA_FILE = /(^|\/)(data|testData|test_data|TestData|testdata)\/[^/]+$|(^|\/)(testData|test_data|TestData)\.\w+$|(^|\/)users\.\w+$/i;
39
+ const CONFIG_FILE = /(^|\/)(config|Config)\/[^/]+\.(m?[jt]s|py|java|cs)$|(^|\/)(Config|ApiConfig|Settings|Environment)\.(java|cs|kt)$|(^|\/)config\.(py|m?[jt]s)$|(^|\/)settings\.py$|(^|\/)(playwright|cypress|wdio|jest|vitest)\.conf(ig)?\.m?[jt]s$|(^|\/)(pytest\.ini|pyproject\.toml|testng\.xml|pom\.xml|build\.gradle(\.kts)?|[\w.-]+\.csproj|appsettings\.json|config\.properties)$/;
40
+ const SERVICE_FILE = /(^|\/)(services?|clients?|api|Services|Clients|Api)\/[^/]+\.(m?[jt]s|py|java|cs|kt)$|(Client|Service|Api)\.(m?[jt]s|java|cs|kt)$|_(client|service|api)\.py$/;
41
+ const HELPER_FILE = /(^|\/)(helpers?|utils?|support|Utils|Helpers|Support|lib|common)\/[^/]+\.(m?[jt]s|py|java|cs|kt)$/;
42
+ const LOCATOR_FILE = /(^|\/)locators?(\/|\.(m?[jt]s|py|java|cs|json)$)|\.locators\.m?[jt]s$|(^|\/)selectors\.json$/i;
43
+
44
+ /** Lines that find an element, per language family (P2: these belong in page objects). */
45
+ const LOCATOR_CALL = /\b(page|this\.page|frame)\.(locator|getBy(Role|Text|Label|TestId|Placeholder|AltText|Title))\(|\bcy\.(get|contains|find)\(|\$\$?\(\s*['"`]|\bBy\.(xpath|cssSelector|id|name|className|linkText|tagName|XPath|CssSelector|Id|Name|ClassName|LinkText)\(|\bAppiumBy\.|find_elements?\(\s*By\.|\.(FindElement|FindElements)\(|@FindBy\(|\bpage\.(locator|get_by_\w+)\(/;
46
+ const ASSERTION = /\bexpect\(|^\s*assert\s|\bassert(That|Equals|True|False|NotNull|Null)\(|\bAssert\.\w+\(|\.should\(|\bassertions\.\w+\(/;
47
+ const ENV_READ = /process\.env|os\.environ|os\.getenv|System\.getenv|Environment\.GetEnvironmentVariable|Cypress\.env\(/;
48
+ const SECRET_NAME = /(pass(word|wd)?|pwd|secret|token|api[_-]?key|apikey|client[_-]?secret|authorization|bearer)/i;
49
+
50
+ /** Rules a script can see, per language; each gives the rule, a short label and the line pattern. */
51
+ const LINE_RULES = [
52
+ { rule: 'U1', what: 'fixed wait', langs: ['java', 'kotlin'], rx: /\bThread\.sleep\(/ },
53
+ { rule: 'U1', what: 'fixed wait', langs: ['py'], rx: /\btime\.sleep\(|\bsleep\(\s*\d|\bwait_for_load_state\(\s*['"]networkidle['"]|\bwait_for_timeout\(|wait_until\s*=\s*['"]networkidle['"]/ },
54
+ { rule: 'U1', what: 'fixed wait', langs: ['cs'], rx: /\bThread\.Sleep\(|\bTask\.Delay\(|LoadState\.NetworkIdle|WaitUntilState\.NetworkIdle|\bWaitForTimeoutAsync\(/ },
55
+ { rule: 'U1', what: 'fixed wait', langs: ['js', 'ts'], rx: /\bwaitForTimeout\(|\bwaitForLoadState\(\s*['"]networkidle['"]|waitUntil:\s*['"]networkidle['"]|\bdriver\.sleep\(|\bbrowser\.pause\(|\bcy\.wait\(\s*\d|new Promise\(\s*\(?\w*\)?\s*=>\s*setTimeout\(/ },
56
+ { rule: 'U1', what: 'fixed wait', langs: ['robot'], rx: /^\s+Sleep\s/ },
57
+ { rule: 'U3', what: 'tests depend on order', langs: ['java', 'kotlin'], rx: /dependsOnMethods|@Order\(/ },
58
+ { rule: 'U3', what: 'tests depend on order', langs: ['js', 'ts'], rx: /describe\.serial\(|mode:\s*['"]serial['"]/ },
59
+ { rule: 'U3', what: 'tests depend on order', langs: ['py'], rx: /@pytest\.mark\.(order|run\(order)|pytest\.mark\.dependency/ },
60
+ { rule: 'U3', what: 'tests depend on order', langs: ['cs'], rx: /\[Order\(/ },
61
+ { rule: 'U7', what: 'absolute XPath', langs: ['js', 'ts', 'py', 'java', 'cs', 'kotlin', 'robot'], rx: /['"`](xpath=)?\/html\/|['"`]\/\/?body\// },
62
+ { rule: 'U7', what: 'position-based locator', langs: ['js', 'ts', 'py', 'java', 'cs', 'kotlin', 'robot'], rx: /:nth-child\(|:nth-of-type\(|\.nth\(\d+\)|\.eq\(\d+\)|\)\[\d+\]['"`]/ },
63
+ { rule: 'P5', what: 'static driver shared across threads', langs: ['java', 'kotlin'], rx: /\bstatic\s+(?!final\s+ThreadLocal)(?:final\s+)?(Remote)?WebDriver\s+\w+\s*[;=]|\bstatic\s+(AppiumDriver|AndroidDriver|IOSDriver)(<\w+>)?\s+\w+\s*[;=]/ },
64
+ { rule: 'P5', what: 'static driver shared across threads', langs: ['cs'], rx: /\bstatic\s+(IWebDriver|WebDriver|AppiumDriver)\S*\s+\w+\s*(;|=(?!>)|\{\s*get;\s*set;)/ },
65
+ { rule: 'P8', what: 'implicit wait', langs: ['java', 'kotlin', 'py', 'cs', 'js', 'ts'], rx: /implicitlyWait\(|implicitly_wait\(|ImplicitWait\s*=|\.implicit\b/ },
66
+ ];
67
+
68
+ /** Same line, with every string value replaced by `***` when the line names a secret (so a quote never shows one). */
69
+ function safeQuote(line) {
70
+ let q = line.trim();
71
+ if (SECRET_NAME.test(q)) q = q.replace(/(['"`])(?:\\.|(?!\1).)*\1/g, '"***"');
72
+ return q.length > 120 ? `${q.slice(0, 117)}...` : q;
73
+ }
74
+
75
+ /**
76
+ * U2: a string literal of 3+ characters, without spaces, given to a secret-looking key (`password: '…'`,
77
+ * `"token": "…"`, `put("api_key", "…")`), an Authorization header with a literal credential, or typed into a field on a
78
+ * line that names a password or token. Not an env read, a placeholder, a label equal to its key (`password: 'Password'`)
79
+ * or an auth scheme word (`"Bearer"`).
80
+ */
81
+ function secretLiteral(line, lang) {
82
+ if (ENV_READ.test(line) || /\.env\.example|getenv|placeholder|example\.(test|com)|<[^>]+>|\$\{|\{\{/.test(line)) return false;
83
+ if (/^\s*(\/\/|#|\*|\/\*)/.test(line)) return false;
84
+ if (lang === 'gherkin' || lang === 'robot') return /\b(password|token)\b.*\s{2,}\S{4,}/i.test(line) && !/\$\{/.test(line);
85
+ const name = '(?:pass(?:word|wd)?|pwd|secret|token|api[_-]?key|apikey|client[_-]?secret|authorization|bearer)';
86
+ const keyed = new RegExp(`(?:^|[\\s{(,.])['"\`]?\\w*${name}\\w*['"\`]?\\s*(?::|=|=>)\\s*(?:new\\s+\\w+\\()?(?<q>['"\`])(?<v>[^'"\`\\s]{3,})\\k<q>`, 'ig');
87
+ const paired = new RegExp(`(?<k>['"\`])\\w*${name}\\w*\\k<k>\\s*,\\s*(?<q>['"\`])(?<v>[^'"\`\\s]{3,})\\k<q>`, 'ig');
88
+ const label = (v) => /^(bearer|basic|token|password|secret)$/i.test(v) || (new RegExp(name, 'i').test(v) && /^[A-Z][a-z]+$/.test(v));
89
+ for (const rx of [keyed, paired]) for (const m of line.matchAll(rx)) if (!label(m.groups.v)) return true;
90
+ if (/['"`]Authorization['"`]\s*[,:]\s*['"`](Bearer|Basic)\s+[A-Za-z0-9._~+/=-]{6,}/.test(line)) return true;
91
+ return /(pass(word|wd)?|pwd|secret|token)/i.test(line) && /\.(fill|type|sendKeys|send_keys|SendKeys|setValue|press_sequentially)\(\s*['"`][^'"`\s]{3,}['"`]/.test(line);
92
+ }
93
+
94
+ /** Every source and manifest file under root (relative, forward slashes). */
95
+ function listFiles(root) {
96
+ const out = [];
97
+ const walk = (dir) => {
98
+ let entries = [];
99
+ try { entries = fs.readdirSync(dir, { withFileTypes: true }); } catch { return; }
100
+ for (const e of entries) {
101
+ if (e.isDirectory()) { if (!SKIP_DIRS.has(e.name) && !e.name.startsWith('.')) walk(path.join(dir, e.name)); continue; }
102
+ if (/^\.env(\.|$)/.test(e.name) && e.name !== '.env.example') continue;
103
+ out.push(path.relative(root, path.join(dir, e.name)).split(path.sep).join('/'));
104
+ }
105
+ };
106
+ walk(root);
107
+ return out.sort();
108
+ }
109
+
110
+ function readText(root, rel) {
111
+ try {
112
+ const p = path.join(root, rel);
113
+ if (fs.statSync(p).size > MAX_BYTES) return null;
114
+ return fs.readFileSync(p, 'utf8');
115
+ } catch { return null; }
116
+ }
117
+
118
+ /** Frameworks from manifests and config files, each with the file that shows it. */
119
+ function detectFrameworks(root, files) {
120
+ const found = new Map();
121
+ const add = (name, file) => { if (!found.has(name)) found.set(name, file); };
122
+ const has = (rx) => files.find((f) => rx.test(f));
123
+ const text = (f) => readText(root, f) || '';
124
+ for (const f of files.filter((x) => /(^|\/)package\.json$/.test(x))) {
125
+ let deps = {};
126
+ try { const j = JSON.parse(text(f)); deps = { ...j.dependencies, ...j.devDependencies }; } catch { /* not JSON */ }
127
+ if (deps['@playwright/test'] || deps.playwright) add('playwright', f);
128
+ if (deps.cypress) add('cypress', f);
129
+ if (deps['@wdio/cli'] || deps.webdriverio) add('webdriverio', f);
130
+ if (deps['selenium-webdriver']) add('selenium', f);
131
+ if (deps.appium || deps['@wdio/appium-service']) add('appium', f);
132
+ if (deps.jest) add('jest', f);
133
+ if (deps.vitest) add('vitest', f);
134
+ if (deps.mocha) add('mocha', f);
135
+ if (deps.supertest) add('supertest', f);
136
+ if (deps.axios || deps['node-fetch']) add('http-client-js', f);
137
+ if (deps.newman) add('newman', f);
138
+ if (deps['@pact-foundation/pact']) add('pact', f);
139
+ if (deps['@cucumber/cucumber'] || deps['playwright-bdd']) add('cucumber', f);
140
+ }
141
+ for (const [rx, name] of [[/(^|\/)playwright\.config\.m?[jt]s$/, 'playwright'], [/(^|\/)cypress\.config\.m?[jt]s$/, 'cypress'],
142
+ [/(^|\/)wdio\.conf\.m?[jt]s$/, 'webdriverio'], [/(^|\/)conftest\.py$/, 'pytest'], [/(^|\/)pytest\.ini$/, 'pytest'],
143
+ [/(^|\/)testng\.xml$/, 'testng'], [/\.robot$/, 'robot'], [/\.postman_collection\.json$/, 'newman'], [/(^|\/)k6[^/]*\.m?js$/, 'k6']]) {
144
+ const f = has(rx); if (f) add(name, f);
145
+ }
146
+ for (const f of files.filter((x) => /(^|\/)(pom\.xml|build\.gradle(\.kts)?)$/.test(x))) {
147
+ const t = text(f);
148
+ add(/pom\.xml$/.test(f) ? 'maven' : 'gradle', f);
149
+ if (/selenium-java|org\.seleniumhq/.test(t)) add('selenium', f);
150
+ if (/io\.appium|java-client/.test(t)) add('appium', f);
151
+ if (/rest-assured|io\.rest-assured/.test(t)) add('rest-assured', f);
152
+ if (/<artifactId>testng<|org\.testng/.test(t)) add('testng', f);
153
+ if (/junit-jupiter|junit\.jupiter/.test(t)) add('junit5', f);
154
+ if (/karate/.test(t)) add('karate', f);
155
+ if (/cucumber/.test(t)) add('cucumber', f);
156
+ if (/com\.microsoft\.playwright/.test(t)) add('playwright', f);
157
+ }
158
+ for (const f of files.filter((x) => /\.csproj$/.test(x))) {
159
+ const t = text(f);
160
+ add('dotnet', f);
161
+ if (/Selenium\.WebDriver/.test(t)) add('selenium', f);
162
+ if (/Microsoft\.Playwright/.test(t)) add('playwright', f);
163
+ if (/Appium\.WebDriver/.test(t)) add('appium', f);
164
+ if (/\bNUnit\b/.test(t)) add('nunit', f);
165
+ if (/\bxunit\b/i.test(t)) add('xunit', f);
166
+ if (/MSTest/.test(t)) add('mstest', f);
167
+ if (/RestSharp/.test(t)) add('restsharp', f);
168
+ if (/Reqnroll|SpecFlow/.test(t)) add('cucumber', f);
169
+ }
170
+ for (const f of files.filter((x) => /(^|\/)(pyproject\.toml|requirements[\w.-]*\.txt|setup\.cfg|Pipfile)$/.test(x))) {
171
+ const t = text(f);
172
+ if (/pytest/.test(t)) add('pytest', f);
173
+ if (/playwright/.test(t)) add('playwright', f);
174
+ if (/selenium/.test(t)) add('selenium', f);
175
+ if (/appium/i.test(t)) add('appium', f);
176
+ if (/\brequests\b|httpx/.test(t)) add('http-client-py', f);
177
+ if (/robotframework/.test(t)) add('robot', f);
178
+ if (/behave|pytest-bdd/.test(t)) add('cucumber', f);
179
+ }
180
+ if (!found.has('http-client-py')) {
181
+ const f = files.find((x) => /\.py$/.test(x) && /^\s*(import (requests|httpx)|from (requests|httpx) )/m.test(text(x)));
182
+ if (f) add('http-client-py', f);
183
+ }
184
+ if (!found.has('playwright')) {
185
+ const f = files.find((x) => /\.py$/.test(x) && /from playwright|import playwright/.test(text(x)));
186
+ if (f) add('playwright', f);
187
+ }
188
+ if (!found.has('selenium')) {
189
+ const f = files.find((x) => /\.py$/.test(x) && /from selenium|import selenium/.test(text(x)));
190
+ if (f) add('selenium', f);
191
+ }
192
+ if (has(/\.feature$/) && !found.has('cucumber') && !found.has('karate')) add('gherkin', has(/\.feature$/));
193
+ return [...found].map(([name, evidence]) => ({ name, evidence }));
194
+ }
195
+
196
+ /** Test names in a test file, with their lines. */
197
+ function testNames(text, lang) {
198
+ const out = [];
199
+ const lines = text.split('\n');
200
+ lines.forEach((line, i) => {
201
+ let m;
202
+ if ((lang === 'js' || lang === 'ts') && (m = line.match(/\b(?:test|it)(?:\.(?:only|skip|fixme|fail))?\(\s*(['"`])((?:\\.|(?!\1).)+)\1/))) out.push({ line: i + 1, name: m[2] });
203
+ else if (lang === 'py' && (m = line.match(/^\s*(?:async\s+)?def\s+(test_\w+)\s*\(/))) out.push({ line: i + 1, name: m[1] });
204
+ else if ((lang === 'java' || lang === 'kotlin') && /@Test\b/.test(line)) {
205
+ for (let j = i; j < Math.min(i + 6, lines.length); j++) {
206
+ const mm = lines[j].match(/(?:public|protected|private|fun)?\s*(?:void\s+|fun\s+)(\w+)\s*\(/);
207
+ if (mm) { out.push({ line: j + 1, name: mm[1] }); break; }
208
+ }
209
+ } else if (lang === 'cs' && /\[(Test|Fact|Theory|TestMethod|TestCase)\b/.test(line)) {
210
+ for (let j = i; j < Math.min(i + 6, lines.length); j++) {
211
+ const mm = lines[j].match(/public\s+(?:async\s+)?(?:Task|void)\s+(\w+)\s*\(/);
212
+ if (mm) { if (!out.some((o) => o.name === mm[1])) out.push({ line: j + 1, name: mm[1] }); break; }
213
+ }
214
+ } else if (lang === 'gherkin' && (m = line.match(/^\s*Scenario(?: Outline)?:\s*(.+)$/))) out.push({ line: i + 1, name: m[1].trim() });
215
+ });
216
+ if (lang === 'robot') {
217
+ let inCases = false;
218
+ lines.forEach((line, i) => {
219
+ if (/^\*+\s*Test Cases/i.test(line)) { inCases = true; return; }
220
+ if (/^\*+/.test(line)) { inCases = false; return; }
221
+ if (inCases && /^\S/.test(line)) out.push({ line: i + 1, name: line.trim() });
222
+ });
223
+ }
224
+ return out;
225
+ }
226
+
227
+ /** Project files a source file imports (JS/TS relative imports, Python modules, Java/C# imports by class name). */
228
+ function importsOf(text, lang, from, files, classIndex) {
229
+ const out = [];
230
+ const dir = path.posix.dirname(from);
231
+ if (lang === 'js' || lang === 'ts') {
232
+ for (const m of text.matchAll(/(?:from\s+|require\(\s*|import\(\s*)['"](\.{1,2}\/[^'"]+)['"]/g)) {
233
+ const base = path.posix.normalize(path.posix.join(dir, m[1])).replace(/\.m?js$/, '');
234
+ const hit = files.find((f) => f === base || new RegExp(`^${base.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}(\\.m?[jt]sx?|/index\\.m?[jt]sx?)$`).test(f));
235
+ if (hit) out.push({ to: hit, tag: 'confirmed', via: 'import' });
236
+ }
237
+ } else if (lang === 'py') {
238
+ for (const m of text.matchAll(/^\s*(?:from\s+([\w.]+)\s+import|import\s+([\w.]+))/gm)) {
239
+ const mod = (m[1] || m[2]).replace(/^\.+/, '').replace(/\./g, '/');
240
+ const hit = files.find((f) => f.endsWith(`${mod}.py`) || f.endsWith(`${mod}/__init__.py`));
241
+ if (hit) out.push({ to: hit, tag: 'confirmed', via: 'import' });
242
+ }
243
+ } else if (lang === 'java' || lang === 'kotlin' || lang === 'cs') {
244
+ const imported = new Set([...text.matchAll(/^\s*import\s+(?:static\s+)?[\w.]+\.(\w+)\s*;?/gm)].map((m) => m[1]));
245
+ for (const [cls, file] of classIndex) {
246
+ if (file === from) continue;
247
+ if (!new RegExp(`\\b${cls}\\b`).test(text)) continue;
248
+ out.push({ to: file, tag: imported.has(cls) ? 'confirmed' : 'inferred', via: imported.has(cls) ? 'import' : 'class name' });
249
+ }
250
+ }
251
+ const seen = new Set();
252
+ return out.filter((e) => (seen.has(e.to) ? false : seen.add(e.to)));
253
+ }
254
+
255
+ /** Scan a suite folder. Returns the scan object (see the header). */
256
+ export function scan(root) {
257
+ const files = listFiles(root);
258
+ const sources = files.filter((f) => SOURCE.test(f));
259
+ const languages = {};
260
+ for (const f of sources) { const l = LANG_OF(f); if (l) languages[l] = (languages[l] || 0) + 1; }
261
+ const frameworks = detectFrameworks(root, files);
262
+ const fw = new Set(frameworks.map((x) => x.name));
263
+
264
+ const role = (f) => (LOCATOR_FILE.test(f) ? 'locators' : TEST_FILE.test(f) && !PAGE_FILE.test(f) && !FIXTURE_FILE.test(f) ? 'test'
265
+ : PAGE_FILE.test(f) ? 'page' : FIXTURE_FILE.test(f) ? 'fixture' : CONFIG_FILE.test(f) ? 'config' : DATA_FILE.test(f) ? 'data'
266
+ : SERVICE_FILE.test(f) ? 'service' : HELPER_FILE.test(f) ? 'helper' : 'other');
267
+ const byRole = { test: [], page: [], fixture: [], data: [], config: [], service: [], helper: [], locators: [], other: [] };
268
+ for (const f of files) {
269
+ const r = role(f);
270
+ if (r === 'other' && !SOURCE.test(f)) continue;
271
+ byRole[r].push(f);
272
+ }
273
+
274
+ const classIndex = new Map();
275
+ for (const f of sources.filter((x) => /\.(java|cs|kt)$/.test(x))) classIndex.set(path.posix.basename(f).replace(/\.\w+$/, ''), f);
276
+
277
+ const tests = [];
278
+ const edges = [];
279
+ const findings = [];
280
+ let uiSignals = 0; let apiSignals = 0;
281
+ for (const f of sources) {
282
+ const lang = LANG_OF(f);
283
+ const text = readText(root, f);
284
+ if (text == null) continue;
285
+ const r = role(f);
286
+ if (/\bpage\.goto\(|\bcy\.visit\(|\bdriver\.(get|navigate)|\bbrowser\.url\(|\.Navigate\(\)|\bpage\.(click|fill)\(|getBy(Role|Label)\(|@FindBy/.test(text)) uiSignals++;
287
+ if (/\brequest\.(get|post|put|patch|delete)\(|\bgiven\(\)|RestAssured|\brequests\.(get|post|put|patch|delete)\(|httpx\.|HttpClient\b|\bsupertest\(|\baxios\.|APIRequestContext|\bcy\.request\(|RestClient\b|\bfetch\(/.test(text)) apiSignals++;
288
+ if (r === 'test') {
289
+ const names = testNames(text, lang);
290
+ tests.push({ file: f, count: names.length, names });
291
+ }
292
+ if (['test', 'page', 'fixture', 'service', 'helper', 'data'].includes(r)) {
293
+ for (const e of importsOf(text, lang, f, files, classIndex)) edges.push({ from: f, to: e.to, to_role: role(e.to), tag: e.tag, via: e.via });
294
+ }
295
+ if (r === 'test' && lang === 'py') {
296
+ // pytest hands fixtures in by parameter name, not by import: link the conftest.py files above the test.
297
+ for (const c of files.filter((x) => /(^|\/)conftest\.py$/.test(x) && (path.posix.dirname(x) === '.' || f.startsWith(`${path.posix.dirname(x)}/`)))) {
298
+ edges.push({ from: f, to: c, to_role: 'fixture', tag: 'inferred', via: 'pytest fixture' });
299
+ }
300
+ }
301
+ const lines = text.split('\n');
302
+ const unit = /(^|\/)(tests?\/unit|Tests\/Unit|unit)\//.test(f);
303
+ let inDoc = false;
304
+ lines.forEach((line, i) => {
305
+ const at = { file: f, line: i + 1, quote: safeQuote(line), detected: 'script' };
306
+ if (lang === 'py') {
307
+ const q = (line.match(/"""|'''/g) || []).length;
308
+ if (inDoc || q) { if (q % 2 === 1) inDoc = !inDoc; return; }
309
+ }
310
+ if (/^\s*(\/\/|#|\*|\/\*)/.test(line)) return;
311
+ for (const rule of LINE_RULES) if (rule.langs.includes(lang) && rule.rx.test(line)) findings.push({ rule: rule.rule, what: rule.what, ...at });
312
+ if (!unit && secretLiteral(line, lang)) findings.push({ rule: 'U2', what: 'secret in code', ...at });
313
+ if (r === 'test' && LOCATOR_CALL.test(line) && lang !== 'gherkin' && lang !== 'robot') findings.push({ rule: 'P2', what: 'locator in a test file', ...at });
314
+ if (r === 'page' && ASSERTION.test(line) && !/\bimport\b/.test(line)) findings.push({ rule: 'P1', what: 'assertion in a page object', ...at });
315
+ if (!unit && (r === 'test' || r === 'page') && ENV_READ.test(line)) findings.push({ rule: 'P6', what: 'environment read outside the config layer', ...at });
316
+ });
317
+ }
318
+ for (const f of byRole.locators) findings.push({ rule: 'P17', what: 'separate locators file', file: f, line: 1, quote: '', detected: 'script' });
319
+
320
+ const severity = (rule) => (rule === 'U2' ? 'critical' : rule.startsWith('U') ? 'blocking' : rule.startsWith('P') ? 'major' : 'minor');
321
+ for (const x of findings) x.severity = severity(x.rule);
322
+ findings.sort((a, b) => ['critical', 'blocking', 'major', 'minor'].indexOf(a.severity) - ['critical', 'blocking', 'major', 'minor'].indexOf(b.severity)
323
+ || a.file.localeCompare(b.file) || a.line - b.line);
324
+
325
+ const uiFw = ['playwright', 'cypress', 'webdriverio', 'selenium', 'appium'].some((n) => fw.has(n));
326
+ const apiFw = ['rest-assured', 'http-client-py', 'supertest', 'http-client-js', 'restsharp', 'karate', 'newman', 'pact', 'k6'].some((n) => fw.has(n));
327
+ const isUi = (uiFw && (byRole.page.length > 0 || uiSignals > 0));
328
+ const isApi = apiFw || (apiSignals > 0 && !isUi) || (apiSignals > 0 && tests.some((t) => /api/i.test(t.file)));
329
+ const kind = isUi && isApi ? 'ui+api' : isUi ? 'ui' : isApi ? 'api' : 'unknown';
330
+
331
+ return {
332
+ root: root.split(path.sep).join('/'),
333
+ frameworks,
334
+ languages,
335
+ kind,
336
+ files: { tests: byRole.test, pages: byRole.page, fixtures: byRole.fixture, data: byRole.data, config: byRole.config,
337
+ services: byRole.service, helpers: byRole.helper, locators: byRole.locators },
338
+ tests,
339
+ edges,
340
+ findings,
341
+ limits: [
342
+ 'regular expressions, not a parser: a locator or wait built across several lines, or through a project helper, can be missed',
343
+ 'secrets are found only next to a name like password, token, secret or key; a secret passed positionally (for example new User("alice", "…")) is left to the reviewer',
344
+ 'edges from Java, Kotlin and C# tests are by class name: `confirmed` when imported, `inferred` when only the name matches (same package or namespace)',
345
+ 'folders skipped: dependencies, build output, reports, saved sessions, app/, project-context/, host folders; .env files are never read',
346
+ ],
347
+ };
348
+ }
349
+
350
+ if (process.argv[1] && fileURLToPath(import.meta.url) === path.resolve(process.argv[1])) {
351
+ const root = process.argv[2];
352
+ if (!root || !fs.existsSync(root) || !fs.statSync(root).isDirectory()) {
353
+ console.log('usage: node .claude/skills/orion/scripts/lib/scan.mjs <suite folder>');
354
+ process.exit(2);
355
+ }
356
+ process.stdout.write(`${JSON.stringify(scan(root.replace(/[\\/]+$/, '')), null, 2)}\n`);
357
+ }
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Rows of a CSV or Excel (.xlsx) file as arrays of strings, with Node alone (an .xlsx is a zip of XML parts; zlib
3
+ * inflates it). The same reading rules as `requirement-analysis/scripts/tm.py xlsx-to-csv`: the first sheet unless one
4
+ * is named, shared and inline strings, booleans as TRUE/FALSE, numbers as written; empty trailing rows dropped.
5
+ * Used by batch_detect.mjs and batch_state.mjs (a batch from a stories file) and checked by check_batch.py.
6
+ */
7
+ import fs from 'node:fs';
8
+ import zlib from 'node:zlib';
9
+
10
+ /** Entries of a zip file: Map name → Buffer (stored or deflated entries; encrypted ones are refused). */
11
+ export function unzip(buf) {
12
+ let eocd = -1;
13
+ for (let i = buf.length - 22; i >= Math.max(0, buf.length - 65557); i--) {
14
+ if (buf.readUInt32LE(i) === 0x06054b50) { eocd = i; break; }
15
+ }
16
+ if (eocd < 0) throw new Error('not a zip file (no end of central directory)');
17
+ const count = buf.readUInt16LE(eocd + 10);
18
+ let p = buf.readUInt32LE(eocd + 16);
19
+ const out = new Map();
20
+ for (let n = 0; n < count; n++) {
21
+ if (buf.readUInt32LE(p) !== 0x02014b50) throw new Error('broken zip central directory');
22
+ const flags = buf.readUInt16LE(p + 8);
23
+ const method = buf.readUInt16LE(p + 10);
24
+ const size = buf.readUInt32LE(p + 20);
25
+ const nameLen = buf.readUInt16LE(p + 28);
26
+ const extraLen = buf.readUInt16LE(p + 30);
27
+ const commentLen = buf.readUInt16LE(p + 32);
28
+ const local = buf.readUInt32LE(p + 42);
29
+ const name = buf.toString('utf8', p + 46, p + 46 + nameLen);
30
+ if (flags & 1) throw new Error(`${name} is encrypted`);
31
+ const lNameLen = buf.readUInt16LE(local + 26);
32
+ const lExtraLen = buf.readUInt16LE(local + 28);
33
+ const start = local + 30 + lNameLen + lExtraLen;
34
+ const data = buf.subarray(start, start + size);
35
+ if (method === 0) out.set(name, data);
36
+ else if (method === 8) out.set(name, zlib.inflateRawSync(data));
37
+ else throw new Error(`${name}: unsupported compression ${method}`);
38
+ p += 46 + nameLen + extraLen + commentLen;
39
+ }
40
+ return out;
41
+ }
42
+
43
+ const decode = (s) => s.replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&apos;/g, "'")
44
+ .replace(/&#(\d+);/g, (_, d) => String.fromCodePoint(Number(d))).replace(/&#x([0-9a-f]+);/gi, (_, h) => String.fromCodePoint(parseInt(h, 16)))
45
+ .replace(/&amp;/g, '&');
46
+ /** The text of a string item: every <t> run joined (rich text included), phonetic runs (<rPh>) left out. */
47
+ const textOf = (xml) => decode([...xml.replace(/<rPh\b[\s\S]*?<\/rPh>/g, '').matchAll(/<t(?:\s[^>]*)?>([\s\S]*?)<\/t>/g)].map((m) => m[1]).join(''));
48
+ const colIndex = (ref) => [...ref.replace(/\d+/g, '')].reduce((n, c) => n * 26 + (c.charCodeAt(0) - 64), 0) - 1;
49
+
50
+ /** Rows of one sheet of an .xlsx file (the first unless `sheet` names one). */
51
+ export function xlsxRows(file, sheet = null) {
52
+ const z = unzip(fs.readFileSync(file));
53
+ const read = (n) => (z.has(n) ? z.get(n).toString('utf8') : '');
54
+ const shared = [...read('xl/sharedStrings.xml').matchAll(/<si>([\s\S]*?)<\/si>/g)].map((m) => textOf(m[1]));
55
+ const wb = read('xl/workbook.xml');
56
+ const rels = read('xl/_rels/workbook.xml.rels');
57
+ const sheets = [...wb.matchAll(/<sheet\b([^>]*)\/?>/g)].map((m) => ({
58
+ name: decode(m[1].match(/\bname="([^"]*)"/)?.[1] || ''),
59
+ rid: m[1].match(/\br:id="([^"]*)"/)?.[1] || m[1].match(/\bid="([^"]*)"/)?.[1],
60
+ }));
61
+ if (!sheets.length) throw new Error('no sheets in the workbook');
62
+ const pick = sheet ? sheets.find((s) => s.name === sheet) : sheets[0];
63
+ if (!pick) throw new Error(`no sheet named "${sheet}" (sheets: ${sheets.map((s) => s.name).join(', ')})`);
64
+ const target = [...rels.matchAll(/<Relationship\b([^>]*)\/?>/g)].map((m) => m[1])
65
+ .find((r) => r.includes(`Id="${pick.rid}"`))?.match(/Target="([^"]*)"/)?.[1] || 'worksheets/sheet1.xml';
66
+ const xml = read(target.startsWith('/') ? target.slice(1) : `xl/${target.replace(/^\.\//, '')}`);
67
+ const rows = [];
68
+ for (const rm of xml.matchAll(/<row\b[^>]*>([\s\S]*?)<\/row>|<row\b[^>]*\/>/g)) {
69
+ const row = [];
70
+ for (const cm of (rm[1] || '').matchAll(/<c\b([^>]*?)(?:\/>|>([\s\S]*?)<\/c>)/g)) {
71
+ const attrs = cm[1];
72
+ const ref = attrs.match(/\br="([A-Z]+\d+)"/)?.[1];
73
+ const t = attrs.match(/\bt="(\w+)"/)?.[1];
74
+ const inner = cm[2] || '';
75
+ const v = inner.match(/<v>([\s\S]*?)<\/v>/)?.[1];
76
+ let val = '';
77
+ if (t === 's') val = shared[Number(v)] ?? '';
78
+ else if (t === 'inlineStr') val = textOf(inner);
79
+ else if (t === 'b') val = v === '1' ? 'TRUE' : 'FALSE';
80
+ else if (v !== undefined) val = decode(v);
81
+ const at = ref ? colIndex(ref) : row.length;
82
+ while (row.length < at) row.push('');
83
+ row[at] = val;
84
+ }
85
+ rows.push(row);
86
+ }
87
+ while (rows.length && rows[rows.length - 1].every((c) => !String(c).trim())) rows.pop();
88
+ return rows;
89
+ }
90
+
91
+ /** Rows of a CSV text (RFC 4180: quoted fields, doubled quotes, newlines inside quotes; a leading BOM dropped). */
92
+ export function csvRows(text) {
93
+ const rows = [];
94
+ let row = [], field = '', quoted = false;
95
+ const s = text.replace(/^/, '');
96
+ for (let i = 0; i < s.length; i++) {
97
+ const c = s[i];
98
+ if (quoted) {
99
+ if (c === '"' && s[i + 1] === '"') { field += '"'; i++; } else if (c === '"') quoted = false; else field += c;
100
+ } else if (c === '"') quoted = true;
101
+ else if (c === ',') { row.push(field); field = ''; } else if (c === '\n' || c === '\r') {
102
+ if (c === '\r' && s[i + 1] === '\n') i++;
103
+ row.push(field); rows.push(row); row = []; field = '';
104
+ } else field += c;
105
+ }
106
+ if (field || row.length) { row.push(field); rows.push(row); }
107
+ while (rows.length && rows[rows.length - 1].every((c) => !c.trim())) rows.pop();
108
+ return rows;
109
+ }
110
+
111
+ /** Rows of a .csv or .xlsx file. */
112
+ export function readRows(file, sheet = null) {
113
+ if (/\.xlsx$/i.test(file)) return xlsxRows(file, sheet);
114
+ if (/\.csv$/i.test(file)) return csvRows(fs.readFileSync(file, 'utf8'));
115
+ throw new Error('only .csv and .xlsx files are read (save other formats as one of these)');
116
+ }
@@ -0,0 +1,166 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Fix-mode guard: a batch of fixes to an existing suite is kept only if the suite still tests at least what it tested
4
+ * before. Run by the orchestrator after each fix batch (`/orion fix`); a failing check means the batch is reverted.
5
+ *
6
+ * Usage (from the workspace root):
7
+ * node .claude/skills/orion/scripts/parity_check.mjs --before-src <dir> --after-src <dir>
8
+ * [--before <results.json> --after <results.json>] [--map "<old>=<new>" …] [--allow-assertion-change <test|all>]
9
+ * [--json]
10
+ * results files are `results_parse.mjs` output; <dir> is the suite before and after the batch (e.g. a `git worktree`
11
+ * at the previous commit and the working copy). `--map` declares a renamed or moved test (`file#name=file#name`, or
12
+ * `file::title=file::title` for results). `--allow-assertion-change` is given only after the user approved changing
13
+ * that test's expected values (H8).
14
+ *
15
+ * Fails (one line each) when, compared with before:
16
+ * results a test is gone · a passed test now fails or is flaky · a test is newly skipped
17
+ * source a test is gone · a test gained a skip marker · a test has fewer assertions · an assertion's contract changed
18
+ * (its matcher or its expected values), which needs the user's H8 approval
19
+ * An assertion's contract is its matcher names (toHaveText, assertEquals, Is.EqualTo, ==, in …) and its literal
20
+ * values; what is being checked (the locator, the variable) may change, so moving a locator into a page object passes.
21
+ * Moving an expected value into a test-data file shows as a changed contract: approve it (H8) after checking the value.
22
+ * Exit code: 0 parity holds · 1 a check failed · 2 wrong arguments.
23
+ */
24
+ import fs from 'node:fs';
25
+ import path from 'node:path';
26
+ import { scan } from './lib/scan.mjs';
27
+ import { functionsOf } from './reuse_check.mjs';
28
+
29
+ const LANG = (f) => (/\.m?[jt]sx?$/.test(f) ? 'js' : /\.py$/.test(f) ? 'py' : /\.(java|kt)$/.test(f) ? 'java' : /\.cs$/.test(f) ? 'cs' : null);
30
+ const ASSERT = {
31
+ js: /\bexpect(?:\.soft)?\(|\bassert(?:\.\w+)?\(/,
32
+ py: /^\s*assert\b|\bexpect\(|\bassert_\w+\(/,
33
+ java: /\bassert\w*\(|\bAssert\.\w+\(|\bassertThat\(|\bAssertions\.\w+\(/,
34
+ cs: /\bAssert\.\w+\(|\bExpect\(|\.Should\(\)?/,
35
+ };
36
+ const SKIP = {
37
+ js: /\b(?:test|it|describe)\.(?:skip|fixme)\b|\bx(?:it|describe)\(/,
38
+ py: /@pytest\.mark\.(?:skip|skipif|xfail)\b|\bpytest\.skip\(/,
39
+ java: /@Disabled\b|@Ignore\b|enabled\s*=\s*false|throw new SkipException/,
40
+ cs: /\[[^\]]*\b(?:Ignore|Explicit)\b|Assert\.Ignore\(|Skip\s*=/,
41
+ };
42
+ const MATCHER = /^(?:not|to\w+|assert\w*|Assert|That|Is|Has|Does|Should|Be\w*|Equal\w*|Contain\w*|Match\w*|True|False|Null|NotNull|Empty|Greater\w*|Less\w*|Throws\w*|have_\w+|to_\w+)$/;
43
+
44
+ function usage(msg) {
45
+ if (msg) console.log(msg);
46
+ console.log('usage: parity_check.mjs --before-src DIR --after-src DIR [--before R.json --after R.json] [--map OLD=NEW …] [--allow-assertion-change TEST|all] [--json]');
47
+ process.exit(2);
48
+ }
49
+
50
+ function args() {
51
+ const o = { map: {}, allow: new Set() };
52
+ const a = process.argv.slice(2);
53
+ for (let i = 0; i < a.length; i++) {
54
+ const k = a[i];
55
+ if (k === '--json') { o.json = true; continue; }
56
+ const v = a[++i];
57
+ if (v === undefined) usage(`${k} needs a value`);
58
+ if (k === '--map') { const [x, y] = v.split('='); if (!y) usage('--map takes OLD=NEW'); o.map[x] = y; }
59
+ else if (k === '--allow-assertion-change') o.allow.add(v);
60
+ else if (['--before-src', '--after-src', '--before', '--after'].includes(k)) o[k.slice(2).replace('-src', 'Src')] = v;
61
+ else usage(`unknown option ${k}`);
62
+ }
63
+ if (!o.beforeSrc || !o.afterSrc) usage();
64
+ if (!!o.before !== !!o.after) usage('--before and --after go together');
65
+ return o;
66
+ }
67
+
68
+ /** The contract of one assertion line: matcher names and literal values, in order; the subject is left out. */
69
+ /** Calls that find an element: their arguments are locators (the subject), not expected values. */
70
+ const LOCATOR_CALL = /\b(?:locator|getBy\w+|get_by_\w+|find_elements?|findElements?|FindElements?|By\.\w+|By\w*|querySelector(?:All)?|\$\$?|cy\.get|cy\.contains|element|elements|AppiumBy\.\w+)\s*\(/g;
71
+ function stripLocators(line) {
72
+ let out = line; let m;
73
+ LOCATOR_CALL.lastIndex = 0;
74
+ while ((m = LOCATOR_CALL.exec(out))) {
75
+ let depth = 0; let i = m.index + m[0].length - 1;
76
+ for (; i < out.length; i++) { if (out[i] === '(') depth++; else if (out[i] === ')') { depth--; if (!depth) break; } }
77
+ out = `${out.slice(0, m.index)}SUBJECT${out.slice(i + 1)}`;
78
+ LOCATOR_CALL.lastIndex = m.index + 7;
79
+ }
80
+ return out;
81
+ }
82
+ function contract(raw) {
83
+ const line = stripLocators(raw);
84
+ const literals = [...line.matchAll(/(['"`])((?:\\.|(?!\1).)*)\1|\b\d+(?:\.\d+)?\b|\b(?:true|false|True|False|null|None)\b/g)].map((m) => (m[1] ? `"${m[2]}"` : m[0]));
85
+ const words = [...line.replace(/(['"`])(?:\\.|(?!\1).)*\1/g, ' ').matchAll(/[A-Za-z_]\w*/g)].map((m) => m[0]).filter((w) => MATCHER.test(w));
86
+ const ops = (line.match(/^\s*assert\b.*?(==|!=|>=|<=|\bnot in\b|\bin\b|\bis not\b|\bis\b|>|<)/) || [])[1];
87
+ return [...words, ...(ops ? [ops] : []), ...literals].join(' ');
88
+ }
89
+
90
+ /** Tests in a suite folder: key file#name → { assertions: [contract], skipped, line }. */
91
+ function tests(root) {
92
+ const s = scan(root);
93
+ const out = {};
94
+ for (const t of s.tests) {
95
+ const lang = LANG(t.file);
96
+ if (!lang) continue;
97
+ let text; try { text = fs.readFileSync(path.join(root, t.file), 'utf8'); } catch { continue; }
98
+ const lines = text.split('\n');
99
+ for (const fn of functionsOf(text, lang)) {
100
+ const above = lines.slice(Math.max(0, fn.line - 5), fn.line).join('\n');
101
+ const isTest = /^test: /.test(fn.name) || (lang === 'py' && /^test_/.test(fn.name))
102
+ || ((lang === 'java' || lang === 'cs') && /@Test\b|\[(?:Test|Fact|Theory|TestCase|TestMethod)\b/.test(above));
103
+ if (!isTest) continue;
104
+ const decl = lines[fn.line - 1] || '';
105
+ const body = fn.body.split('\n');
106
+ out[`${t.file}#${fn.name}`] = {
107
+ line: fn.line,
108
+ assertions: body.filter((l) => ASSERT[lang].test(l)).map(contract),
109
+ skipped: SKIP[lang].test(`${above}\n${decl}`) || body.some((l) => /\btest\.skip\(\s*\)|\bpytest\.skip\(|Assert\.Ignore\(|throw new SkipException/.test(l)),
110
+ };
111
+ }
112
+ }
113
+ return out;
114
+ }
115
+
116
+ function results(file) {
117
+ let r; try { r = JSON.parse(fs.readFileSync(file, 'utf8')); } catch { usage(`can't read results ${file}`); }
118
+ const out = {};
119
+ for (const t of r.tests || []) out[`${t.file}::${t.title}`] = t.status;
120
+ return out;
121
+ }
122
+
123
+ function main() {
124
+ const o = args();
125
+ const fail = []; const notes = [];
126
+ const mapped = (k) => o.map[k] || k;
127
+
128
+ if (o.before) {
129
+ const b = results(o.before); const a = results(o.after);
130
+ for (const [k, st] of Object.entries(b)) {
131
+ const now = a[mapped(k)];
132
+ if (now === undefined) fail.push(`results: ${k} is gone (map it with --map if it was renamed)`);
133
+ else if (st === 'passed' && (now === 'failed' || now === 'flaky')) fail.push(`results: ${k} passed before, now ${now}`);
134
+ else if (st !== 'skipped' && now === 'skipped') fail.push(`results: ${k} is now skipped`);
135
+ else if (st === 'failed' && now === 'passed') notes.push(`results: ${k} failed before, passes now`);
136
+ }
137
+ const added = Object.keys(a).filter((k) => !Object.keys(b).some((x) => mapped(x) === k));
138
+ if (added.length) notes.push(`results: ${added.length} new test(s)`);
139
+ }
140
+
141
+ const B = tests(o.beforeSrc); const A = tests(o.afterSrc);
142
+ for (const [k, t] of Object.entries(B)) {
143
+ const n = A[mapped(k)];
144
+ if (!n) { fail.push(`source: ${k} is gone (map it with --map if it was renamed or moved)`); continue; }
145
+ if (!t.skipped && n.skipped) fail.push(`source: ${mapped(k)} gained a skip marker`);
146
+ if (n.assertions.length < t.assertions.length) fail.push(`source: ${mapped(k)} has ${n.assertions.length} assertion(s), had ${t.assertions.length}`);
147
+ const left = [...n.assertions];
148
+ const lost = [];
149
+ for (const c of t.assertions) { const i = left.indexOf(c); if (i >= 0) left.splice(i, 1); else lost.push(c); }
150
+ if (lost.length && !(o.allow.has('all') || o.allow.has(k) || o.allow.has(mapped(k)))) {
151
+ fail.push(`source: ${mapped(k)} changed what it asserts (needs H8): before [${lost.join(' | ')}] now [${left.join(' | ') || 'nothing'}]`);
152
+ }
153
+ }
154
+ const newTests = Object.keys(A).filter((k) => !Object.keys(B).some((x) => mapped(x) === k));
155
+ if (newTests.length) notes.push(`source: ${newTests.length} new test(s)`);
156
+
157
+ if (o.json) process.stdout.write(`${JSON.stringify({ parity: !fail.length, failures: fail, notes, tests_before: Object.keys(B).length, tests_after: Object.keys(A).length }, null, 2)}\n`);
158
+ else {
159
+ fail.forEach((l) => console.log(`FAIL ${l}`));
160
+ notes.forEach((l) => console.log(`note ${l}`));
161
+ console.log(`parity: ${fail.length ? 'broken' : 'holds'} · tests before ${Object.keys(B).length}, after ${Object.keys(A).length} · ${fail.length} failure(s)`);
162
+ }
163
+ process.exit(fail.length ? 1 : 0);
164
+ }
165
+
166
+ main();