@orion-qa/orion 3.0.0 → 3.1.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 (578) hide show
  1. package/.claude/agents/codebase-analyst.md +1 -1
  2. package/.claude/settings.json +9 -0
  3. package/.claude/skills/appium/SKILL.md +1 -1
  4. package/.claude/skills/appium/templates/README.md +6 -9
  5. package/.claude/skills/appium/templates/ci/github-actions-android.yml +8 -2
  6. package/.claude/skills/appium/templates/ci/github-actions-ios.yml +8 -2
  7. package/.claude/skills/appium/templates/ci/github-actions-windows.yml +9 -2
  8. package/.claude/skills/appium/templates/project-java/.env.example +4 -0
  9. package/.claude/skills/appium/templates/project-java/pom.xml +2 -0
  10. package/.claude/skills/appium/templates/project-java/src/test/java/automation/{framework/Config.java → config/Env.java} +43 -52
  11. package/.claude/skills/appium/templates/project-java/src/test/java/automation/config/Flags.java +45 -0
  12. package/.claude/skills/appium/templates/project-java/src/test/java/automation/config/Paths.java +14 -0
  13. package/.claude/skills/appium/templates/project-java/src/test/java/automation/desc/SignInDesc.java +30 -0
  14. package/.claude/skills/appium/templates/project-java/src/test/java/automation/{framework → driver}/DriverFactory.java +19 -13
  15. package/.claude/skills/appium/templates/project-java/src/test/java/automation/{framework → driver}/DriverManager.java +12 -9
  16. package/.claude/skills/appium/templates/project-java/src/test/java/automation/fixtures/BaseTest.java +75 -0
  17. package/.claude/skills/appium/templates/project-java/src/test/java/automation/{screens → pageObjects}/BaseScreen.java +12 -12
  18. package/.claude/skills/appium/templates/project-java/src/test/java/automation/pageObjects/HomeScreen.java +26 -0
  19. package/.claude/skills/appium/templates/project-java/src/test/java/automation/pageObjects/LoginScreen.java +63 -0
  20. package/.claude/skills/appium/templates/project-java/src/test/java/automation/pageObjects/ShellScreen.java +26 -0
  21. package/.claude/skills/appium/templates/project-java/src/test/java/automation/setup/AuthSetup.java +49 -0
  22. package/.claude/skills/appium/templates/project-java/src/test/java/automation/testData/TestData.java +78 -0
  23. package/.claude/skills/appium/templates/project-java/src/test/java/automation/tests/ui/SignInTest.java +45 -0
  24. package/.claude/skills/appium/templates/project-java/src/test/java/automation/tests/unit/UtilsTest.java +34 -0
  25. package/.claude/skills/appium/templates/project-java/src/test/java/automation/{framework → utils}/AutomationError.java +4 -4
  26. package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/Case.java +20 -0
  27. package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/CaseTransformer.java +54 -0
  28. package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/Dates.java +42 -0
  29. package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/Log.java +45 -0
  30. package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/MissingSettingError.java +13 -0
  31. package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/RandomData.java +41 -0
  32. package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/Redact.java +33 -0
  33. package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/TestDescription.java +25 -0
  34. package/.claude/skills/appium/templates/project-java/src/test/resources/testData/testData.properties +7 -0
  35. package/.claude/skills/appium/templates/project-java/testng.xml +11 -4
  36. package/.claude/skills/architecture-analysis/SKILL.md +2 -1
  37. package/.claude/skills/automation-implementation/SKILL.md +2 -1
  38. package/.claude/skills/automation-implementation/references/patterns.md +46 -24
  39. package/.claude/skills/code-review/SKILL.md +3 -2
  40. package/.claude/skills/code-review/references/pattern-rules.md +12 -7
  41. package/.claude/skills/documentation/SKILL.md +23 -18
  42. package/.claude/skills/execution/SKILL.md +6 -3
  43. package/.claude/skills/httpclient/templates/README.md +6 -7
  44. package/.claude/skills/httpclient/templates/csharp-nunit/.env.example +4 -0
  45. package/.claude/skills/httpclient/templates/csharp-nunit/Automation.csproj +7 -3
  46. package/.claude/skills/httpclient/templates/csharp-nunit/Config/Env.cs +62 -0
  47. package/.claude/skills/httpclient/templates/csharp-nunit/Config/Flags.cs +35 -0
  48. package/.claude/skills/httpclient/templates/csharp-nunit/Config/Paths.cs +22 -0
  49. package/.claude/skills/httpclient/templates/csharp-nunit/Fixtures/BaseTest.cs +22 -0
  50. package/.claude/skills/httpclient/templates/csharp-nunit/Resources/Desc/ProductsDesc.cs +22 -0
  51. package/.claude/skills/httpclient/templates/csharp-nunit/Resources/TestData/TestData.cs +61 -0
  52. package/.claude/skills/httpclient/templates/csharp-nunit/Resources/TestData/testData.json +9 -0
  53. package/.claude/skills/httpclient/templates/csharp-nunit/Services/ApiClient.cs +48 -0
  54. package/.claude/skills/httpclient/templates/csharp-nunit/Services/HealthApi.cs +11 -0
  55. package/.claude/skills/httpclient/templates/csharp-nunit/{Api → Services}/ProductsApi.cs +8 -5
  56. package/.claude/skills/httpclient/templates/csharp-nunit/Tests/Api/ProductsTests.cs +61 -0
  57. package/.claude/skills/httpclient/templates/csharp-nunit/Tests/Unit/UtilsTests.cs +40 -0
  58. package/.claude/skills/httpclient/templates/csharp-nunit/Utils/AutomationError.cs +15 -0
  59. package/.claude/skills/httpclient/templates/csharp-nunit/Utils/Dates.cs +18 -0
  60. package/.claude/skills/httpclient/templates/csharp-nunit/Utils/Log.cs +37 -0
  61. package/.claude/skills/httpclient/templates/csharp-nunit/Utils/RandomData.cs +26 -0
  62. package/.claude/skills/httpclient/templates/csharp-nunit/Utils/Redact.cs +22 -0
  63. package/.claude/skills/httpclient/templates/csharp-nunit/Utils/TestDescription.cs +55 -0
  64. package/.claude/skills/javascript/references/sources.md +1 -1
  65. package/.claude/skills/k6/SKILL.md +1 -1
  66. package/.claude/skills/k6/templates/README.md +5 -3
  67. package/.claude/skills/k6/templates/project/{data/cases.js → resources/desc/products.desc.js} +1 -1
  68. package/.claude/skills/k6/templates/project/resources/testData/testData.js +32 -0
  69. package/.claude/skills/k6/templates/project/{lib/config.js → src/config/env.js} +10 -5
  70. package/.claude/skills/k6/templates/project/{lib → src/services}/products-api.js +7 -5
  71. package/.claude/skills/k6/templates/project/{load → tests/load}/products.js +8 -8
  72. package/.claude/skills/karate/templates/README.md +4 -5
  73. package/.claude/skills/karate/templates/java-junit5/.env.example +2 -0
  74. package/.claude/skills/karate/templates/java-junit5/pom.xml +4 -0
  75. package/.claude/skills/karate/templates/java-junit5/src/test/java/{support → config}/EnvSettings.java +1 -1
  76. package/.claude/skills/karate/templates/java-junit5/src/test/java/karate-config.js +13 -6
  77. package/.claude/skills/karate/templates/java-junit5/src/test/java/logback-test.xml +1 -1
  78. package/.claude/skills/karate/templates/java-junit5/src/test/java/{api → tests}/ApiTest.java +7 -4
  79. package/.claude/skills/karate/templates/java-junit5/src/test/java/{api → tests/api}/health.feature +3 -3
  80. package/.claude/skills/karate/templates/java-junit5/src/test/java/tests/api/products.feature +29 -0
  81. package/.claude/skills/karate/templates/java-junit5/src/test/java/{support → utils}/MaskingLogModifier.java +1 -1
  82. package/.claude/skills/karate/templates/java-junit5/src/test/resources/testData/newProduct.js +7 -0
  83. package/.claude/skills/karate/templates/java-junit5/src/test/resources/testData/testData.json +6 -0
  84. package/.claude/skills/newman/templates/README.md +4 -5
  85. package/.claude/skills/newman/templates/collection/.env.example +2 -0
  86. package/.claude/skills/newman/templates/collection/collections/api.postman_collection.json +165 -145
  87. package/.claude/skills/newman/templates/collection/package.json +2 -1
  88. package/.claude/skills/newman/templates/collection/resources/desc/products.desc.json +53 -0
  89. package/.claude/skills/newman/templates/collection/resources/testData/testData.json +10 -0
  90. package/.claude/skills/newman/templates/collection/run.js +41 -31
  91. package/.claude/skills/newman/templates/collection/src/config/env.js +37 -0
  92. package/.claude/skills/orion/SKILL.md +9 -7
  93. package/.claude/skills/orion/references/assess-fix.md +34 -0
  94. package/.claude/skills/orion/references/capabilities.md +1 -1
  95. package/.claude/skills/orion/references/conversation.md +9 -8
  96. package/.claude/skills/orion/references/delivery-formats.md +1 -1
  97. package/.claude/skills/orion/references/modes.md +3 -1
  98. package/.claude/skills/orion/references/project-context-files.md +6 -1
  99. package/.claude/skills/orion/references/setup-card.md +12 -6
  100. package/.claude/skills/orion/references/status-lines.md +6 -2
  101. package/.claude/skills/orion/references/task-brief.md +1 -0
  102. package/.claude/skills/orion/references/work-branch.md +3 -1
  103. package/.claude/skills/orion/scripts/browser_setup.mjs +30 -15
  104. package/.claude/skills/orion/scripts/env_check.mjs +8 -3
  105. package/.claude/skills/orion/scripts/env_check.py +12 -5
  106. package/.claude/skills/orion/scripts/fix_plan.mjs +149 -0
  107. package/.claude/skills/orion/scripts/graph.mjs +400 -0
  108. package/.claude/skills/orion/scripts/lib/inside.mjs +31 -0
  109. package/.claude/skills/orion/scripts/lib/scan.mjs +357 -0
  110. package/.claude/skills/orion/scripts/parity_check.mjs +166 -0
  111. package/.claude/skills/orion/scripts/report_check.mjs +77 -0
  112. package/.claude/skills/orion/scripts/results_parse.mjs +203 -0
  113. package/.claude/skills/orion/scripts/reuse_check.mjs +251 -0
  114. package/.claude/skills/orion/scripts/run_state.mjs +171 -0
  115. package/.claude/skills/orion/scripts/suite_check.mjs +228 -0
  116. package/.claude/skills/orion/scripts/timing_profile.mjs +128 -0
  117. package/.claude/skills/orion/scripts/usage_report.mjs +315 -0
  118. package/.claude/skills/orion/templates/project-context/assessment.md +45 -0
  119. package/.claude/skills/orion/templates/project-context/defects.md +5 -0
  120. package/.claude/skills/orion/templates/project-context/report.md +45 -0
  121. package/.claude/skills/orion/templates/project-context/run.md +4 -1
  122. package/.claude/skills/orion/templates/project-context/test-case-map.md +5 -0
  123. package/.claude/skills/orion/templates/project-context/test-design.md +18 -0
  124. package/.claude/skills/pact/SKILL.md +2 -2
  125. package/.claude/skills/pact/templates/README.md +4 -2
  126. package/.claude/skills/pact/templates/project/package.json +2 -2
  127. package/.claude/skills/pact/templates/project/{data/cases.js → resources/desc/products.desc.js} +3 -3
  128. package/.claude/skills/pact/templates/project/resources/testData/testData.js +21 -0
  129. package/.claude/skills/pact/templates/project/src/config/env.js +32 -0
  130. package/.claude/skills/pact/templates/project/src/{products-client.js → services/products-client.js} +4 -2
  131. package/.claude/skills/pact/templates/project/tests/contract/products.contract.test.js +46 -0
  132. package/.claude/skills/pact/templates/project/{verify → tests/verify}/products.verify.js +7 -22
  133. package/.claude/skills/playwright/SKILL.md +6 -6
  134. package/.claude/skills/playwright/templates/README.md +29 -10
  135. package/.claude/skills/playwright/templates/ci/Jenkinsfile +1 -1
  136. package/.claude/skills/playwright/templates/ci/azure-pipelines.yml +1 -1
  137. package/.claude/skills/playwright/templates/ci/github-actions-javascript.yml +1 -1
  138. package/.claude/skills/playwright/templates/ci/github-actions.yml +1 -1
  139. package/.claude/skills/playwright/templates/ci/gitlab-ci.yml +1 -1
  140. package/.claude/skills/playwright/templates/dotnet/.env.example +7 -0
  141. package/.claude/skills/playwright/templates/dotnet/.runsettings +17 -0
  142. package/.claude/skills/playwright/templates/dotnet/Automation.csproj +8 -0
  143. package/.claude/skills/playwright/templates/dotnet/Config/Env.cs +89 -0
  144. package/.claude/skills/playwright/templates/dotnet/Config/Flags.cs +56 -0
  145. package/.claude/skills/playwright/templates/dotnet/Config/Paths.cs +31 -0
  146. package/.claude/skills/playwright/templates/dotnet/Fixtures/ApiBaseTest.cs +39 -0
  147. package/.claude/skills/playwright/templates/dotnet/Fixtures/BaseTest.cs +72 -0
  148. package/.claude/skills/playwright/templates/dotnet/PageObjects/BasePage.cs +59 -0
  149. package/.claude/skills/playwright/templates/dotnet/PageObjects/HomePage.cs +21 -0
  150. package/.claude/skills/playwright/templates/dotnet/PageObjects/LoginPage.cs +54 -0
  151. package/.claude/skills/playwright/templates/dotnet/PageObjects/ShellPage.cs +29 -0
  152. package/.claude/skills/playwright/templates/dotnet/Resources/Desc/SignInDesc.cs +23 -0
  153. package/.claude/skills/playwright/templates/dotnet/Resources/TestData/TestData.cs +74 -0
  154. package/.claude/skills/playwright/templates/dotnet/Resources/TestData/testData.json +19 -0
  155. package/.claude/skills/playwright/templates/dotnet/Services/ApiClient.cs +51 -0
  156. package/.claude/skills/playwright/templates/dotnet/Setup/AuthSetup.cs +63 -0
  157. package/.claude/skills/playwright/templates/dotnet/Tests/Api/SessionTests.cs +18 -0
  158. package/.claude/skills/playwright/templates/dotnet/Tests/Ui/SignInTests.cs +48 -0
  159. package/.claude/skills/playwright/templates/dotnet/Tests/Unit/UtilsTests.cs +40 -0
  160. package/.claude/skills/playwright/templates/dotnet/Utils/AutomationError.cs +15 -0
  161. package/.claude/skills/playwright/templates/dotnet/Utils/Dates.cs +18 -0
  162. package/.claude/skills/playwright/templates/dotnet/Utils/Log.cs +37 -0
  163. package/.claude/skills/playwright/templates/dotnet/Utils/RandomData.cs +26 -0
  164. package/.claude/skills/playwright/templates/dotnet/Utils/Redact.cs +22 -0
  165. package/.claude/skills/playwright/templates/dotnet/Utils/TestDescription.cs +55 -0
  166. package/.claude/skills/playwright/templates/dotnet/gitignore +6 -1
  167. package/.claude/skills/playwright/templates/javascript/.env.example +8 -0
  168. package/.claude/skills/playwright/templates/javascript/fixtures/index.js +83 -0
  169. package/.claude/skills/playwright/templates/javascript/fixtures/session.js +79 -0
  170. package/.claude/skills/playwright/templates/javascript/gitignore +7 -0
  171. package/.claude/skills/playwright/templates/javascript/jsconfig.json +11 -0
  172. package/.claude/skills/playwright/templates/javascript/package.json +7 -3
  173. package/.claude/skills/playwright/templates/javascript/pageObjects/basePage.js +58 -0
  174. package/.claude/skills/playwright/templates/javascript/pageObjects/homePage.js +19 -0
  175. package/.claude/skills/playwright/templates/javascript/pageObjects/loginPage.js +44 -0
  176. package/.claude/skills/playwright/templates/javascript/pageObjects/shellPage.js +26 -0
  177. package/.claude/skills/playwright/templates/javascript/playwright.config.js +42 -24
  178. package/.claude/skills/playwright/templates/javascript/reporters/summaryReporter.js +233 -0
  179. package/.claude/skills/playwright/templates/javascript/resources/desc/signIn.desc.js +33 -0
  180. package/.claude/skills/playwright/templates/javascript/resources/testData/testData.js +45 -0
  181. package/.claude/skills/playwright/templates/javascript/setup/auth.setup.js +17 -0
  182. package/.claude/skills/playwright/templates/javascript/setup/auth.teardown.js +16 -0
  183. package/.claude/skills/playwright/templates/javascript/src/config/env.js +79 -0
  184. package/.claude/skills/playwright/templates/javascript/src/config/flags.js +70 -0
  185. package/.claude/skills/playwright/templates/javascript/src/config/loadEnv.js +21 -0
  186. package/.claude/skills/playwright/templates/javascript/src/config/paths.js +22 -0
  187. package/.claude/skills/playwright/templates/javascript/src/services/apiClient.js +68 -0
  188. package/.claude/skills/playwright/templates/javascript/tests/api/session.spec.js +15 -0
  189. package/.claude/skills/playwright/templates/javascript/tests/ui/signIn.spec.js +35 -0
  190. package/.claude/skills/playwright/templates/javascript/tests/unit/summaryReporter.test.js +34 -0
  191. package/.claude/skills/playwright/templates/javascript/tests/unit/utils.test.js +31 -0
  192. package/.claude/skills/playwright/templates/javascript/utils/date.js +28 -0
  193. package/.claude/skills/playwright/templates/javascript/{src → utils}/errors.js +1 -0
  194. package/.claude/skills/playwright/templates/javascript/utils/formFill.js +29 -0
  195. package/.claude/skills/playwright/templates/javascript/utils/logger.js +33 -0
  196. package/.claude/skills/playwright/templates/javascript/utils/random.js +37 -0
  197. package/.claude/skills/playwright/templates/javascript/utils/redact.js +35 -0
  198. package/.claude/skills/playwright/templates/javascript/utils/titles.js +38 -0
  199. package/.claude/skills/playwright/templates/project/.env.example +8 -0
  200. package/.claude/skills/playwright/templates/project/fixtures/index.ts +84 -0
  201. package/.claude/skills/playwright/templates/project/fixtures/session.ts +76 -0
  202. package/.claude/skills/playwright/templates/project/gitignore +9 -2
  203. package/.claude/skills/playwright/templates/project/package.json +8 -6
  204. package/.claude/skills/playwright/templates/project/pageObjects/basePage.ts +53 -0
  205. package/.claude/skills/playwright/templates/project/pageObjects/homePage.ts +20 -0
  206. package/.claude/skills/playwright/templates/project/pageObjects/loginPage.ts +47 -0
  207. package/.claude/skills/playwright/templates/project/pageObjects/shellPage.ts +22 -0
  208. package/.claude/skills/playwright/templates/project/playwright.config.ts +46 -23
  209. package/.claude/skills/playwright/templates/project/reporters/summaryReporter.ts +241 -0
  210. package/.claude/skills/playwright/templates/project/resources/desc/signIn.desc.ts +32 -0
  211. package/.claude/skills/playwright/templates/project/resources/testData/testData.ts +42 -0
  212. package/.claude/skills/playwright/templates/project/setup/auth.setup.ts +16 -0
  213. package/.claude/skills/playwright/templates/project/setup/auth.teardown.ts +15 -0
  214. package/.claude/skills/playwright/templates/project/src/config/env.ts +81 -0
  215. package/.claude/skills/playwright/templates/project/src/config/flags.ts +70 -0
  216. package/.claude/skills/playwright/templates/project/src/config/loadEnv.ts +17 -0
  217. package/.claude/skills/playwright/templates/project/src/config/paths.ts +19 -0
  218. package/.claude/skills/playwright/templates/project/src/services/apiClient.ts +70 -0
  219. package/.claude/skills/playwright/templates/project/tests/api/session.spec.ts +14 -0
  220. package/.claude/skills/playwright/templates/project/tests/ui/signIn.spec.ts +34 -0
  221. package/.claude/skills/playwright/templates/project/tests/unit/summaryReporter.test.ts +33 -0
  222. package/.claude/skills/playwright/templates/project/tests/unit/utils.test.ts +30 -0
  223. package/.claude/skills/playwright/templates/project/tsconfig.json +3 -8
  224. package/.claude/skills/playwright/templates/project/utils/date.ts +25 -0
  225. package/.claude/skills/playwright/templates/project/utils/formFill.ts +27 -0
  226. package/.claude/skills/playwright/templates/project/utils/logger.ts +32 -0
  227. package/.claude/skills/playwright/templates/project/utils/random.ts +34 -0
  228. package/.claude/skills/playwright/templates/project/utils/redact.ts +32 -0
  229. package/.claude/skills/playwright/templates/project/utils/titles.ts +42 -0
  230. package/.claude/skills/playwright/templates/python/.env.example +8 -0
  231. package/.claude/skills/playwright/templates/python/conftest.py +91 -16
  232. package/.claude/skills/playwright/templates/python/gitignore +5 -0
  233. package/.claude/skills/playwright/templates/python/page_objects/__init__.py +1 -0
  234. package/.claude/skills/playwright/templates/python/page_objects/base_page.py +54 -0
  235. package/.claude/skills/playwright/templates/python/page_objects/home_page.py +22 -0
  236. package/.claude/skills/playwright/templates/python/page_objects/login_page.py +42 -0
  237. package/.claude/skills/playwright/templates/python/page_objects/shell_page.py +21 -0
  238. package/.claude/skills/playwright/templates/python/pytest.ini +5 -2
  239. package/.claude/skills/playwright/templates/python/requirements.txt +1 -0
  240. package/.claude/skills/playwright/templates/python/resources/__init__.py +1 -0
  241. package/.claude/skills/playwright/templates/python/resources/desc/__init__.py +1 -0
  242. package/.claude/skills/playwright/templates/python/resources/desc/sign_in_desc.py +27 -0
  243. package/.claude/skills/playwright/templates/python/resources/test_data/__init__.py +1 -0
  244. package/.claude/skills/playwright/templates/python/resources/test_data/test_data.py +41 -0
  245. package/.claude/skills/playwright/templates/python/setup/__init__.py +1 -0
  246. package/.claude/skills/playwright/templates/python/setup/auth.py +53 -0
  247. package/.claude/skills/playwright/templates/python/src/__init__.py +1 -0
  248. package/.claude/skills/playwright/templates/python/src/config/__init__.py +1 -0
  249. package/.claude/skills/playwright/templates/python/{framework/config.py → src/config/env.py} +24 -33
  250. package/.claude/skills/playwright/templates/python/src/config/flags.py +63 -0
  251. package/.claude/skills/playwright/templates/python/src/config/load_env.py +16 -0
  252. package/.claude/skills/playwright/templates/python/src/config/paths.py +25 -0
  253. package/.claude/skills/playwright/templates/python/src/services/__init__.py +1 -0
  254. package/.claude/skills/playwright/templates/python/src/services/api_client.py +60 -0
  255. package/.claude/skills/playwright/templates/python/tests/api/test_session.py +14 -0
  256. package/.claude/skills/playwright/templates/python/tests/ui/test_sign_in.py +36 -0
  257. package/.claude/skills/playwright/templates/python/tests/unit/test_utils.py +32 -0
  258. package/.claude/skills/playwright/templates/python/utils/__init__.py +1 -0
  259. package/.claude/skills/playwright/templates/python/utils/dates.py +23 -0
  260. package/.claude/skills/playwright/templates/python/{framework → utils}/errors.py +3 -2
  261. package/.claude/skills/playwright/templates/python/utils/form_fill.py +26 -0
  262. package/.claude/skills/playwright/templates/python/utils/logger.py +40 -0
  263. package/.claude/skills/playwright/templates/python/utils/markers.py +6 -0
  264. package/.claude/skills/playwright/templates/python/utils/random_data.py +35 -0
  265. package/.claude/skills/playwright/templates/python/utils/redact.py +30 -0
  266. package/.claude/skills/playwright/templates/python/utils/titles.py +53 -0
  267. package/.claude/skills/quality-checks/SKILL.md +11 -11
  268. package/.claude/skills/quality-checks/templates/README.md +14 -12
  269. package/.claude/skills/quality-checks/templates/playwright-js/pageObjects/scannedPage.js +21 -0
  270. package/.claude/skills/quality-checks/templates/playwright-js/resources/desc/quality.desc.js +63 -0
  271. package/.claude/skills/quality-checks/templates/playwright-js/resources/testData/qualityData.js +32 -0
  272. package/.claude/skills/quality-checks/templates/playwright-js/src/checks/accessibility.js +50 -0
  273. package/.claude/skills/quality-checks/templates/playwright-js/src/checks/pageHealth.js +38 -0
  274. package/.claude/skills/quality-checks/templates/playwright-js/src/checks/performance.js +21 -0
  275. package/.claude/skills/quality-checks/templates/playwright-js/src/services/graphqlClient.js +28 -0
  276. package/.claude/skills/quality-checks/templates/playwright-js/tests/api/graphql.spec.js +23 -0
  277. package/.claude/skills/quality-checks/templates/playwright-js/tests/ui/quality.spec.js +50 -0
  278. package/.claude/skills/quality-checks/templates/playwright-ts/pageObjects/scannedPage.ts +20 -0
  279. package/.claude/skills/quality-checks/templates/playwright-ts/resources/desc/quality.desc.ts +59 -0
  280. package/.claude/skills/quality-checks/templates/playwright-ts/{src/data/quality.data.ts → resources/testData/qualityData.ts} +3 -2
  281. package/.claude/skills/quality-checks/templates/playwright-ts/tests/api/graphql.spec.ts +22 -0
  282. package/.claude/skills/quality-checks/templates/playwright-ts/tests/ui/quality.spec.ts +49 -0
  283. package/.claude/skills/requests/templates/README.md +6 -7
  284. package/.claude/skills/requests/templates/python-pytest/.env.example +4 -0
  285. package/.claude/skills/requests/templates/python-pytest/conftest.py +24 -9
  286. package/.claude/skills/requests/templates/python-pytest/pytest.ini +6 -3
  287. package/.claude/skills/requests/templates/python-pytest/requirements.txt +1 -0
  288. package/.claude/skills/requests/templates/python-pytest/resources/__init__.py +1 -0
  289. package/.claude/skills/requests/templates/python-pytest/resources/desc/__init__.py +1 -0
  290. package/.claude/skills/requests/templates/python-pytest/resources/desc/products_desc.py +27 -0
  291. package/.claude/skills/requests/templates/python-pytest/resources/test_data/__init__.py +1 -0
  292. package/.claude/skills/requests/templates/python-pytest/resources/test_data/test_data.py +27 -0
  293. package/.claude/skills/requests/templates/python-pytest/src/__init__.py +1 -0
  294. package/.claude/skills/requests/templates/python-pytest/src/config/__init__.py +1 -0
  295. package/.claude/skills/requests/templates/python-pytest/src/config/env.py +39 -0
  296. package/.claude/skills/requests/templates/python-pytest/src/config/flags.py +35 -0
  297. package/.claude/skills/requests/templates/python-pytest/src/config/load_env.py +16 -0
  298. package/.claude/skills/requests/templates/python-pytest/src/config/paths.py +16 -0
  299. package/.claude/skills/requests/templates/python-pytest/src/services/__init__.py +1 -0
  300. package/.claude/skills/requests/templates/python-pytest/{api/client.py → src/services/api_client.py} +19 -10
  301. package/.claude/skills/requests/templates/python-pytest/{api → src/services}/products_api.py +3 -9
  302. package/.claude/skills/requests/templates/python-pytest/tests/api/test_products.py +35 -0
  303. package/.claude/skills/requests/templates/python-pytest/tests/unit/test_utils.py +32 -0
  304. package/.claude/skills/requests/templates/python-pytest/utils/__init__.py +1 -0
  305. package/.claude/skills/requests/templates/python-pytest/utils/dates.py +23 -0
  306. package/.claude/skills/{selenium/templates/python-pytest/framework → requests/templates/python-pytest/utils}/errors.py +4 -3
  307. package/.claude/skills/requests/templates/python-pytest/utils/logger.py +40 -0
  308. package/.claude/skills/requests/templates/python-pytest/utils/random_data.py +35 -0
  309. package/.claude/skills/requests/templates/python-pytest/utils/redact.py +30 -0
  310. package/.claude/skills/requests/templates/python-pytest/utils/titles.py +53 -0
  311. package/.claude/skills/requirement-analysis/SKILL.md +1 -1
  312. package/.claude/skills/rest-assured/SKILL.md +1 -1
  313. package/.claude/skills/rest-assured/templates/README.md +6 -7
  314. package/.claude/skills/rest-assured/templates/ci/github-actions.yml +5 -2
  315. package/.claude/skills/rest-assured/templates/java-testng/.env.example +3 -0
  316. package/.claude/skills/rest-assured/templates/java-testng/pom.xml +7 -0
  317. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/{api/ApiConfig.java → config/Env.java} +35 -22
  318. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/config/Flags.java +17 -0
  319. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/config/Paths.java +14 -0
  320. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/desc/ProductsDesc.java +26 -0
  321. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/fixtures/BaseTest.java +29 -0
  322. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/services/ApiSpec.java +31 -0
  323. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/services/HealthApi.java +17 -0
  324. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/{api → services}/ProductsApi.java +19 -14
  325. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/{data → testData}/ProductBuilder.java +4 -8
  326. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/testData/TestData.java +64 -0
  327. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/tests/api/ProductsTest.java +49 -0
  328. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/tests/unit/UtilsTest.java +34 -0
  329. 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
  330. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/Case.java +20 -0
  331. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/CaseTransformer.java +54 -0
  332. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/Dates.java +42 -0
  333. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/Log.java +45 -0
  334. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/MissingSettingError.java +13 -0
  335. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/RandomData.java +41 -0
  336. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/Redact.java +33 -0
  337. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/TestDescription.java +25 -0
  338. package/.claude/skills/rest-assured/templates/java-testng/src/test/resources/testData/testData.properties +14 -0
  339. package/.claude/skills/rest-assured/templates/java-testng/testng.xml +14 -0
  340. package/.claude/skills/selenium/SKILL.md +1 -1
  341. package/.claude/skills/selenium/templates/README.md +25 -13
  342. package/.claude/skills/selenium/templates/ci/github-actions-java.yml +5 -2
  343. package/.claude/skills/selenium/templates/csharp-nunit/.env.example +15 -0
  344. package/.claude/skills/selenium/templates/csharp-nunit/Automation.csproj +7 -0
  345. package/.claude/skills/selenium/templates/csharp-nunit/{Framework/Config.cs → Config/Env.cs} +33 -34
  346. package/.claude/skills/selenium/templates/csharp-nunit/Config/Flags.cs +39 -0
  347. package/.claude/skills/selenium/templates/csharp-nunit/Config/Paths.cs +31 -0
  348. package/.claude/skills/selenium/templates/csharp-nunit/{Framework → Driver}/DriverFactory.cs +16 -13
  349. package/.claude/skills/selenium/templates/csharp-nunit/Driver/DriverManager.cs +27 -0
  350. package/.claude/skills/selenium/templates/csharp-nunit/Fixtures/BaseTest.cs +56 -0
  351. package/.claude/skills/selenium/templates/csharp-nunit/{Pages → PageObjects}/BasePage.cs +40 -14
  352. package/.claude/skills/selenium/templates/csharp-nunit/PageObjects/HomePage.cs +21 -0
  353. package/.claude/skills/selenium/templates/csharp-nunit/PageObjects/LoginPage.cs +53 -0
  354. package/.claude/skills/selenium/templates/csharp-nunit/PageObjects/ShellPage.cs +22 -0
  355. package/.claude/skills/selenium/templates/csharp-nunit/Resources/Desc/SignInDesc.cs +23 -0
  356. package/.claude/skills/selenium/templates/csharp-nunit/Resources/TestData/TestData.cs +74 -0
  357. package/.claude/skills/selenium/templates/csharp-nunit/Resources/TestData/testData.json +14 -0
  358. package/.claude/skills/selenium/templates/csharp-nunit/Services/ApiClient.cs +71 -0
  359. package/.claude/skills/selenium/templates/csharp-nunit/Setup/AuthSetup.cs +104 -0
  360. package/.claude/skills/selenium/templates/csharp-nunit/Tests/Api/SessionTests.cs +23 -0
  361. package/.claude/skills/selenium/templates/csharp-nunit/Tests/Ui/SignInTests.cs +42 -0
  362. package/.claude/skills/selenium/templates/csharp-nunit/Tests/Unit/UtilsTests.cs +40 -0
  363. package/.claude/skills/selenium/templates/csharp-nunit/Utils/AutomationError.cs +15 -0
  364. package/.claude/skills/selenium/templates/csharp-nunit/Utils/Dates.cs +18 -0
  365. package/.claude/skills/selenium/templates/csharp-nunit/Utils/FormFill.cs +20 -0
  366. package/.claude/skills/selenium/templates/csharp-nunit/Utils/Log.cs +37 -0
  367. package/.claude/skills/selenium/templates/csharp-nunit/Utils/RandomData.cs +26 -0
  368. package/.claude/skills/selenium/templates/csharp-nunit/Utils/Redact.cs +22 -0
  369. package/.claude/skills/selenium/templates/csharp-nunit/Utils/TestDescription.cs +55 -0
  370. package/.claude/skills/selenium/templates/csharp-nunit/gitignore +6 -2
  371. package/.claude/skills/selenium/templates/java-testng/.env.example +12 -0
  372. package/.claude/skills/selenium/templates/java-testng/gitignore +5 -2
  373. package/.claude/skills/selenium/templates/java-testng/pom.xml +2 -0
  374. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/{framework/Config.java → config/Env.java} +45 -55
  375. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/config/Flags.java +50 -0
  376. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/config/Paths.java +20 -0
  377. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/desc/SignInDesc.java +30 -0
  378. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/{framework → driver}/DriverFactory.java +15 -12
  379. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/{framework → driver}/DriverManager.java +4 -7
  380. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/fixtures/BaseTest.java +87 -0
  381. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/{pages → pageObjects}/BasePage.java +38 -17
  382. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pageObjects/HomePage.java +32 -0
  383. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pageObjects/LoginPage.java +69 -0
  384. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pageObjects/ShellPage.java +34 -0
  385. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/services/ApiClient.java +93 -0
  386. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/setup/AuthSetup.java +125 -0
  387. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/testData/TestData.java +88 -0
  388. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/api/SessionTest.java +23 -0
  389. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/ui/SignInTest.java +46 -0
  390. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/unit/UtilsTest.java +34 -0
  391. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/AutomationError.java +18 -0
  392. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/Case.java +20 -0
  393. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/CaseTransformer.java +54 -0
  394. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/Dates.java +42 -0
  395. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/FormFill.java +25 -0
  396. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/Log.java +45 -0
  397. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/MissingSettingError.java +13 -0
  398. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/RandomData.java +41 -0
  399. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/Redact.java +33 -0
  400. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/TestDescription.java +25 -0
  401. package/.claude/skills/selenium/templates/java-testng/src/test/resources/testData/testData.properties +11 -0
  402. package/.claude/skills/selenium/templates/java-testng/testng.xml +15 -5
  403. package/.claude/skills/selenium/templates/python-pytest/.env.example +12 -0
  404. package/.claude/skills/selenium/templates/python-pytest/conftest.py +63 -12
  405. package/.claude/skills/selenium/templates/python-pytest/gitignore +7 -2
  406. package/.claude/skills/selenium/templates/python-pytest/page_objects/__init__.py +1 -0
  407. package/.claude/skills/selenium/templates/python-pytest/{pages → page_objects}/base_page.py +17 -20
  408. package/.claude/skills/selenium/templates/python-pytest/page_objects/home_page.py +17 -0
  409. package/.claude/skills/selenium/templates/python-pytest/{pages → page_objects}/login_page.py +12 -14
  410. package/.claude/skills/selenium/templates/python-pytest/page_objects/shell_page.py +16 -0
  411. package/.claude/skills/selenium/templates/python-pytest/pytest.ini +6 -2
  412. package/.claude/skills/selenium/templates/python-pytest/requirements.txt +1 -0
  413. package/.claude/skills/selenium/templates/python-pytest/resources/__init__.py +1 -0
  414. package/.claude/skills/selenium/templates/python-pytest/resources/desc/__init__.py +1 -0
  415. package/.claude/skills/selenium/templates/python-pytest/resources/desc/sign_in_desc.py +27 -0
  416. package/.claude/skills/selenium/templates/python-pytest/resources/test_data/__init__.py +1 -0
  417. package/.claude/skills/selenium/templates/python-pytest/resources/test_data/test_data.py +25 -0
  418. package/.claude/skills/selenium/templates/python-pytest/setup/__init__.py +1 -0
  419. package/.claude/skills/selenium/templates/python-pytest/setup/auth.py +60 -0
  420. package/.claude/skills/selenium/templates/python-pytest/src/__init__.py +1 -0
  421. package/.claude/skills/selenium/templates/python-pytest/src/config/__init__.py +1 -0
  422. package/.claude/skills/selenium/templates/python-pytest/src/config/env.py +68 -0
  423. package/.claude/skills/selenium/templates/python-pytest/src/config/flags.py +40 -0
  424. package/.claude/skills/selenium/templates/python-pytest/src/config/load_env.py +16 -0
  425. package/.claude/skills/selenium/templates/python-pytest/src/config/paths.py +25 -0
  426. package/.claude/skills/selenium/templates/python-pytest/src/driver/__init__.py +1 -0
  427. package/.claude/skills/selenium/templates/python-pytest/{framework → src/driver}/driver_factory.py +11 -18
  428. package/.claude/skills/selenium/templates/python-pytest/{framework → src/driver}/driver_manager.py +3 -3
  429. package/.claude/skills/selenium/templates/python-pytest/src/services/__init__.py +1 -0
  430. package/.claude/skills/selenium/templates/python-pytest/src/services/api_client.py +89 -0
  431. package/.claude/skills/selenium/templates/python-pytest/tests/api/test_session.py +11 -0
  432. package/.claude/skills/selenium/templates/python-pytest/tests/ui/test_sign_in.py +34 -0
  433. package/.claude/skills/selenium/templates/python-pytest/tests/unit/test_utils.py +32 -0
  434. package/.claude/skills/selenium/templates/python-pytest/utils/__init__.py +1 -0
  435. package/.claude/skills/selenium/templates/python-pytest/utils/dates.py +23 -0
  436. package/.claude/skills/selenium/templates/python-pytest/utils/errors.py +28 -0
  437. package/.claude/skills/selenium/templates/python-pytest/utils/form_fill.py +29 -0
  438. package/.claude/skills/selenium/templates/python-pytest/utils/logger.py +40 -0
  439. package/.claude/skills/selenium/templates/python-pytest/utils/markers.py +6 -0
  440. package/.claude/skills/selenium/templates/python-pytest/utils/random_data.py +35 -0
  441. package/.claude/skills/selenium/templates/python-pytest/utils/redact.py +30 -0
  442. package/.claude/skills/selenium/templates/python-pytest/utils/titles.py +53 -0
  443. package/.claude/skills/self-healing/SKILL.md +1 -1
  444. package/.claude/skills/test-design/SKILL.md +1 -1
  445. package/.claude/skills/ui-observation/SKILL.md +7 -6
  446. package/.claude/skills/ui-observation/references/login-methods.md +1 -1
  447. package/.claude-plugin/plugin.json +1 -1
  448. package/.cursor/commands/orion.md +1 -1
  449. package/.gemini/commands/orion.toml +2 -2
  450. package/.github/prompts/orion.prompt.md +2 -2
  451. package/.windsurf/workflows/orion.md +2 -2
  452. package/AGENTS.md +1 -1
  453. package/README.md +23 -3
  454. package/assets/architecture.svg +104 -0
  455. package/hosts/gemini-extension/gemini-extension.json +1 -1
  456. package/package.json +2 -1
  457. package/.claude/skills/appium/templates/project-java/src/test/java/automation/data/Cases.java +0 -37
  458. package/.claude/skills/appium/templates/project-java/src/test/java/automation/data/SignInData.java +0 -25
  459. package/.claude/skills/appium/templates/project-java/src/test/java/automation/flows/SignInFlow.java +0 -34
  460. package/.claude/skills/appium/templates/project-java/src/test/java/automation/framework/Account.java +0 -19
  461. package/.claude/skills/appium/templates/project-java/src/test/java/automation/screens/HomeScreen.java +0 -36
  462. package/.claude/skills/appium/templates/project-java/src/test/java/automation/screens/LoginScreen.java +0 -57
  463. package/.claude/skills/appium/templates/project-java/src/test/java/automation/tests/BaseTest.java +0 -33
  464. package/.claude/skills/appium/templates/project-java/src/test/java/automation/tests/SmokeTest.java +0 -17
  465. package/.claude/skills/httpclient/templates/csharp-nunit/Api/ApiClient.cs +0 -61
  466. package/.claude/skills/httpclient/templates/csharp-nunit/Api/ApiConfig.cs +0 -61
  467. package/.claude/skills/httpclient/templates/csharp-nunit/Api/ApiError.cs +0 -17
  468. package/.claude/skills/httpclient/templates/csharp-nunit/Data/Cases.cs +0 -41
  469. package/.claude/skills/httpclient/templates/csharp-nunit/Data/HealthData.cs +0 -11
  470. package/.claude/skills/httpclient/templates/csharp-nunit/Data/ProductBuilder.cs +0 -16
  471. package/.claude/skills/httpclient/templates/csharp-nunit/Data/ProductsData.cs +0 -17
  472. package/.claude/skills/httpclient/templates/csharp-nunit/Tests/HealthTests.cs +0 -18
  473. package/.claude/skills/httpclient/templates/csharp-nunit/Tests/ProductsTests.cs +0 -48
  474. package/.claude/skills/k6/templates/project/data/builders.js +0 -8
  475. package/.claude/skills/karate/templates/java-junit5/src/test/java/api/products.feature +0 -33
  476. package/.claude/skills/pact/templates/project/test/contract/products.contract.test.js +0 -45
  477. package/.claude/skills/playwright/templates/dotnet/Components/AccountMenu.cs +0 -23
  478. package/.claude/skills/playwright/templates/dotnet/Data/Cases.cs +0 -43
  479. package/.claude/skills/playwright/templates/dotnet/Data/SignInData.cs +0 -24
  480. package/.claude/skills/playwright/templates/dotnet/Flows/SignInFlow.cs +0 -51
  481. package/.claude/skills/playwright/templates/dotnet/Framework/AutomationError.cs +0 -17
  482. package/.claude/skills/playwright/templates/dotnet/Framework/Config.cs +0 -91
  483. package/.claude/skills/playwright/templates/dotnet/Pages/BasePage.cs +0 -57
  484. package/.claude/skills/playwright/templates/dotnet/Pages/HomePage.cs +0 -26
  485. package/.claude/skills/playwright/templates/dotnet/Pages/LoginPage.cs +0 -45
  486. package/.claude/skills/playwright/templates/dotnet/Tests/SmokeTests.cs +0 -47
  487. package/.claude/skills/playwright/templates/javascript/src/components/account-menu.component.js +0 -30
  488. package/.claude/skills/playwright/templates/javascript/src/config.js +0 -53
  489. package/.claude/skills/playwright/templates/javascript/src/data/accounts.js +0 -23
  490. package/.claude/skills/playwright/templates/javascript/src/data/cases.js +0 -49
  491. package/.claude/skills/playwright/templates/javascript/src/data/sign-in.data.js +0 -12
  492. package/.claude/skills/playwright/templates/javascript/src/flows/sign-in.flow.js +0 -53
  493. package/.claude/skills/playwright/templates/javascript/src/pages/base.page.js +0 -59
  494. package/.claude/skills/playwright/templates/javascript/src/pages/home.page.js +0 -31
  495. package/.claude/skills/playwright/templates/javascript/src/pages/login.page.js +0 -56
  496. package/.claude/skills/playwright/templates/javascript/tests/fixtures.js +0 -20
  497. package/.claude/skills/playwright/templates/javascript/tests/smoke.spec.js +0 -22
  498. package/.claude/skills/playwright/templates/project/src/components/account-menu.component.ts +0 -27
  499. package/.claude/skills/playwright/templates/project/src/config.ts +0 -56
  500. package/.claude/skills/playwright/templates/project/src/data/accounts.ts +0 -21
  501. package/.claude/skills/playwright/templates/project/src/data/cases.ts +0 -55
  502. package/.claude/skills/playwright/templates/project/src/data/sign-in.data.ts +0 -10
  503. package/.claude/skills/playwright/templates/project/src/flows/sign-in.flow.ts +0 -51
  504. package/.claude/skills/playwright/templates/project/src/pages/base.page.ts +0 -52
  505. package/.claude/skills/playwright/templates/project/src/pages/home.page.ts +0 -30
  506. package/.claude/skills/playwright/templates/project/src/pages/login.page.ts +0 -53
  507. package/.claude/skills/playwright/templates/project/tests/fixtures.ts +0 -25
  508. package/.claude/skills/playwright/templates/project/tests/smoke.spec.ts +0 -22
  509. package/.claude/skills/playwright/templates/python/components/__init__.py +0 -1
  510. package/.claude/skills/playwright/templates/python/components/account_menu.py +0 -22
  511. package/.claude/skills/playwright/templates/python/data/accounts.py +0 -14
  512. package/.claude/skills/playwright/templates/python/data/cases.py +0 -33
  513. package/.claude/skills/playwright/templates/python/data/sign_in_data.py +0 -9
  514. package/.claude/skills/playwright/templates/python/flows/sign_in.py +0 -63
  515. package/.claude/skills/playwright/templates/python/pages/base_page.py +0 -51
  516. package/.claude/skills/playwright/templates/python/pages/home_page.py +0 -21
  517. package/.claude/skills/playwright/templates/python/pages/login_page.py +0 -40
  518. package/.claude/skills/playwright/templates/python/tests/test_smoke.py +0 -26
  519. package/.claude/skills/quality-checks/templates/playwright-ts/src/pages/scanned.page.ts +0 -16
  520. package/.claude/skills/quality-checks/templates/playwright-ts/tests/quality.spec.ts +0 -58
  521. package/.claude/skills/requests/templates/python-pytest/api/config.py +0 -43
  522. package/.claude/skills/requests/templates/python-pytest/api/errors.py +0 -15
  523. package/.claude/skills/requests/templates/python-pytest/data/builders.py +0 -16
  524. package/.claude/skills/requests/templates/python-pytest/data/cases.py +0 -30
  525. package/.claude/skills/requests/templates/python-pytest/data/health_data.py +0 -6
  526. package/.claude/skills/requests/templates/python-pytest/data/products_data.py +0 -10
  527. package/.claude/skills/requests/templates/python-pytest/tests/test_health.py +0 -12
  528. package/.claude/skills/requests/templates/python-pytest/tests/test_products.py +0 -25
  529. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/api/ApiError.java +0 -18
  530. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/api/ApiSpec.java +0 -29
  531. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/api/HealthApi.java +0 -21
  532. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/data/Cases.java +0 -45
  533. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/data/HealthData.java +0 -12
  534. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/data/ProductsData.java +0 -16
  535. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/tests/HealthTest.java +0 -15
  536. package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/tests/ProductsTest.java +0 -37
  537. package/.claude/skills/selenium/templates/csharp-nunit/Components/AccountMenu.cs +0 -26
  538. package/.claude/skills/selenium/templates/csharp-nunit/Data/Cases.cs +0 -43
  539. package/.claude/skills/selenium/templates/csharp-nunit/Data/SignInData.cs +0 -24
  540. package/.claude/skills/selenium/templates/csharp-nunit/Flows/SignInFlow.cs +0 -51
  541. package/.claude/skills/selenium/templates/csharp-nunit/Framework/AutomationError.cs +0 -17
  542. package/.claude/skills/selenium/templates/csharp-nunit/Framework/DriverManager.cs +0 -26
  543. package/.claude/skills/selenium/templates/csharp-nunit/Pages/HomePage.cs +0 -28
  544. package/.claude/skills/selenium/templates/csharp-nunit/Pages/LoginPage.cs +0 -58
  545. package/.claude/skills/selenium/templates/csharp-nunit/Tests/BaseTest.cs +0 -22
  546. package/.claude/skills/selenium/templates/csharp-nunit/Tests/SmokeTests.cs +0 -37
  547. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/components/AccountMenu.java +0 -37
  548. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/data/Cases.java +0 -48
  549. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/data/SignInData.java +0 -36
  550. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/flows/SignInFlow.java +0 -60
  551. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/framework/Account.java +0 -19
  552. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pages/HomePage.java +0 -45
  553. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pages/LoginPage.java +0 -78
  554. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/BaseTest.java +0 -33
  555. package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/SmokeTest.java +0 -33
  556. package/.claude/skills/selenium/templates/python-pytest/components/__init__.py +0 -1
  557. package/.claude/skills/selenium/templates/python-pytest/components/account_menu.py +0 -19
  558. package/.claude/skills/selenium/templates/python-pytest/data/accounts.py +0 -14
  559. package/.claude/skills/selenium/templates/python-pytest/data/cases.py +0 -33
  560. package/.claude/skills/selenium/templates/python-pytest/data/sign_in_data.py +0 -9
  561. package/.claude/skills/selenium/templates/python-pytest/flows/__init__.py +0 -0
  562. package/.claude/skills/selenium/templates/python-pytest/flows/sign_in.py +0 -61
  563. package/.claude/skills/selenium/templates/python-pytest/framework/__init__.py +0 -0
  564. package/.claude/skills/selenium/templates/python-pytest/framework/config.py +0 -90
  565. package/.claude/skills/selenium/templates/python-pytest/pages/__init__.py +0 -0
  566. package/.claude/skills/selenium/templates/python-pytest/pages/home_page.py +0 -23
  567. package/.claude/skills/selenium/templates/python-pytest/tests/test_smoke.py +0 -25
  568. /package/.claude/skills/karate/templates/java-junit5/src/test/java/{api → tests/api}/delete-product.feature +0 -0
  569. /package/.claude/skills/playwright/templates/{python/data/__init__.py → dotnet/auth/.gitkeep} +0 -0
  570. /package/.claude/skills/playwright/templates/{python/flows/__init__.py → javascript/auth/.gitkeep} +0 -0
  571. /package/.claude/skills/playwright/templates/{python/framework/__init__.py → project/auth/.gitkeep} +0 -0
  572. /package/.claude/skills/playwright/templates/project/{src → utils}/errors.ts +0 -0
  573. /package/.claude/skills/playwright/templates/python/{pages/__init__.py → auth/.gitkeep} +0 -0
  574. /package/.claude/skills/quality-checks/templates/playwright-ts/src/checks/{page-health.ts → pageHealth.ts} +0 -0
  575. /package/.claude/skills/quality-checks/templates/playwright-ts/src/{api/graphql.ts → services/graphqlClient.ts} +0 -0
  576. /package/.claude/skills/{requests/templates/python-pytest/api/__init__.py → selenium/templates/csharp-nunit/auth/.gitkeep} +0 -0
  577. /package/.claude/skills/{requests/templates/python-pytest/data/__init__.py → selenium/templates/java-testng/auth/.gitkeep} +0 -0
  578. /package/.claude/skills/selenium/templates/python-pytest/{data/__init__.py → auth/.gitkeep} +0 -0
@@ -0,0 +1,149 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * The fix plan for `/orion fix A-<id>`: turns an assessment's findings into batches the user ticks, and keeps each
4
+ * batch's state so a fix run that stops (usage limit, "stop", a crash) resumes at the first unfinished batch.
5
+ *
6
+ * Usage (from the workspace root):
7
+ * node .claude/skills/orion/scripts/fix_plan.mjs make <assessment.md> [--out <fix-plan.md>]
8
+ * batches of ≤ 5 findings touching ≤ 8 files, findings of one file kept together, most severe first;
9
+ * every item starts unticked. Default out: fix-plan.md next to the assessment.
10
+ * node .claude/skills/orion/scripts/fix_plan.mjs tick <fix-plan.md> F-1 F-3 … tick the items the user chose
11
+ * node .claude/skills/orion/scripts/fix_plan.mjs untick <fix-plan.md> F-2 …
12
+ * node .claude/skills/orion/scripts/fix_plan.mjs next <fix-plan.md> the first batch with ticked items that isn't
13
+ * verified, reverted or skipped, as JSON (exit 1 when none is left)
14
+ * node .claude/skills/orion/scripts/fix_plan.mjs set <fix-plan.md> <batch n> <state> ["<note>"]
15
+ * state: pending · applied · verified · reverted · skipped
16
+ * node .claude/skills/orion/scripts/fix_plan.mjs summary <fix-plan.md>
17
+ * Each item says whether it needs the user's H8 (it changes what a test asserts or expects: U6, U8, U12, P15, or a
18
+ * proposed fix that names an assertion or expected value) and whether it needs a secret's variable name (U2).
19
+ * Each item lists the files its fix may change (`changes:`): the assessment's "Changes" column when it has one (e.g. a
20
+ * page object and the test an assertion moves into), else the files in its File:line cell. A batch's files are the
21
+ * union of its items' files; the implementer changes nothing else.
22
+ * Unticked items are never part of a batch the implementer gets. Exit code: 0 · 1 nothing found · 2 wrong arguments.
23
+ */
24
+ import fs from 'node:fs';
25
+ import path from 'node:path';
26
+ import { insideWorkspace } from './lib/inside.mjs';
27
+
28
+ const SEV = { critical: 0, blocking: 1, major: 2, minor: 3 };
29
+ const STATES = ['pending', 'applied', 'verified', 'reverted', 'skipped'];
30
+ const H8_RULES = new Set(['U6', 'U8', 'U12', 'P15']);
31
+ const MAX_FINDINGS = 5; const MAX_FILES = 8;
32
+
33
+ function die(code, msg) { console.log(msg); process.exit(code); }
34
+ const read = (f) => { try { return fs.readFileSync(f, 'utf8'); } catch { die(2, `can't read ${f}`); } return ''; };
35
+
36
+ /** File paths in a table cell ("a.ts:4,17 · b.ts:2", ".gitignore:1"), in order, without lines. */
37
+ const pathsIn = (cell) => [...new Set([...(cell || '').replace(/`/g, '').matchAll(/(?:^|[\s,(·;])((?:[\w@.-]+\/)*(?:[\w@-][\w@.-]*\.[A-Za-z]\w*|\.[\w-]+))(?=$|[\s:,)·;])/g)].map((m) => m[1]))];
38
+
39
+ /** Findings rows of an assessment: [{id, rule, severity, file, line, quote, by, effort, fix, risk}] */
40
+ function findings(text) {
41
+ const lines = text.split('\n');
42
+ const h = lines.findIndex((l) => /^\|\s*F\s*\|\s*Rule\s*\|/i.test(l));
43
+ if (h < 0) die(1, 'no findings table (| F | Rule | … |) in the assessment');
44
+ const cols = lines[h].split('|').slice(1, -1).map((c) => c.trim().toLowerCase());
45
+ const at = (name) => cols.findIndex((c) => c.startsWith(name));
46
+ const out = [];
47
+ for (let i = h + 2; i < lines.length && lines[i].startsWith('|'); i++) {
48
+ const c = lines[i].split('|').slice(1, -1).map((x) => x.trim());
49
+ if (!/^F-\d+$/.test(c[0])) continue;
50
+ const loc = (c[at('file')] || '').replace(/`/g, '').trim();
51
+ const inLoc = pathsIn(loc);
52
+ const file = inLoc[0] || loc;
53
+ const m = loc.slice(loc.indexOf(file) + file.length).match(/^:(\d+)/);
54
+ const ch = at('changes') >= 0 ? pathsIn(c[at('changes')]) : [];
55
+ out.push({ id: c[0], rule: c[at('rule')], severity: (c[at('severity')] || 'minor').toLowerCase(), file, line: m ? Number(m[1]) : null,
56
+ files: ch.length ? ch : (inLoc.length ? inLoc : [file]),
57
+ quote: c[at('quote')] || '', by: c[at('detected')] || '', effort: c[at('effort')] || '', fix: c[at('proposed')] || '', risk: c[at('parity')] || '' });
58
+ }
59
+ return out;
60
+ }
61
+
62
+ function needs(f) {
63
+ const n = [];
64
+ // Moving an assertion keeps what it checks (parity_check proves that); changing an expected value, a matcher or the
65
+ // assertion's strength changes what the test checks, which needs the user's H8.
66
+ if (H8_RULES.has(f.rule) || /\b(expected (value|text|status|count)|change (the |an )?(assertion|expected)|(weaker|stronger) assert\w*|matcher)\b/i.test(f.fix)) n.push('H8');
67
+ if (f.rule === 'U2') n.push('secret: the variable name in .env / CI');
68
+ return n;
69
+ }
70
+
71
+ function make(file, out) {
72
+ const fs_ = findings(read(file)).sort((a, b) => (SEV[a.severity] ?? 9) - (SEV[b.severity] ?? 9) || a.file.localeCompare(b.file) || (a.line || 0) - (b.line || 0));
73
+ if (!fs_.length) die(1, 'the assessment has no findings to fix');
74
+ // group by file, then pack files into batches
75
+ const byFile = new Map();
76
+ for (const f of fs_) { if (!byFile.has(f.file)) byFile.set(f.file, []); byFile.get(f.file).push(f); }
77
+ const batches = []; let cur = { items: [], files: new Set() };
78
+ for (const [file, items] of byFile) {
79
+ for (let k = 0; k < items.length; k += MAX_FINDINGS) {
80
+ const chunk = items.slice(k, k + MAX_FINDINGS);
81
+ if (cur.items.length + chunk.length > MAX_FINDINGS || (!cur.files.has(file) && cur.files.size >= MAX_FILES)) { batches.push(cur); cur = { items: [], files: new Set() }; }
82
+ const add = new Set(chunk.flatMap((f) => f.files));
83
+ if (cur.items.length && [...add].filter((x) => !cur.files.has(x)).length + cur.files.size > MAX_FILES) { batches.push(cur); cur = { items: [], files: new Set() }; }
84
+ cur.items.push(...chunk); for (const x of add) cur.files.add(x);
85
+ }
86
+ }
87
+ if (cur.items.length) batches.push(cur);
88
+ const id = path.basename(path.dirname(file));
89
+ const lines = [`# Fix plan ${id}`, '',
90
+ `From \`${path.basename(file)}\`. Tick the items to fix (reply with their ids, or put an x in the box); nothing unticked is touched. Each batch is applied on the local branch \`orion/fix-${id}\`, reviewed, run, and kept only if \`parity_check.mjs\` holds; otherwise it is reverted. Items marked H8 change what a test checks and need your explicit yes.`, ''];
91
+ batches.forEach((b, n) => {
92
+ lines.push(`## Batch ${n + 1} · state: pending`, `files: ${[...b.files].join(', ')}`, '');
93
+ for (const f of b.items) lines.push(`- [ ] ${f.id} · ${f.rule} ${f.severity} · ${f.file}${f.line ? `:${f.line}` : ''} · ${f.fix || '(fix to be proposed)'} · changes: ${f.files.join(', ')}${needs(f).length ? ` · needs ${needs(f).join(', ')}` : ''}`);
94
+ lines.push('');
95
+ });
96
+ const dest = insideWorkspace(out || path.join(path.dirname(file), 'fix-plan.md'), 'the fix plan');
97
+ fs.writeFileSync(dest, `${lines.join('\n')}\n`);
98
+ console.log(`fix plan: ${fs_.length} finding(s) in ${batches.length} batch(es) → ${dest}`);
99
+ }
100
+
101
+ function parse(text) {
102
+ const lines = text.split('\n'); const batches = [];
103
+ lines.forEach((l, i) => {
104
+ const b = l.match(/^## Batch (\d+) · state: (\w+)(.*)$/);
105
+ if (b) batches.push({ n: Number(b[1]), state: b[2], note: b[3].replace(/^\s*·\s*/, ''), line: i, items: [] });
106
+ const it = l.match(/^- \[( |x|X)\] (F-\d+) · (.*)$/);
107
+ if (it && batches.length) batches[batches.length - 1].items.push({ id: it[2], ticked: it[1] !== ' ', text: it[3], line: i });
108
+ });
109
+ return { lines, batches };
110
+ }
111
+
112
+ function main() {
113
+ const [cmd, file, ...rest] = process.argv.slice(2);
114
+ if (!cmd || !file) die(2, 'usage: fix_plan.mjs make|tick|untick|next|set|summary <file> …');
115
+ if (cmd === 'make') return make(file, rest[0] === '--out' ? insideWorkspace(rest[1], '--out') : null);
116
+ if (['tick', 'untick', 'set'].includes(cmd)) insideWorkspace(file, 'the fix plan');
117
+ const { lines, batches } = parse(read(file));
118
+ if (!batches.length) die(1, 'no batches in the fix plan');
119
+ if (cmd === 'tick' || cmd === 'untick') {
120
+ if (!rest.length) die(2, `${cmd} needs finding ids`);
121
+ const known = new Set(batches.flatMap((b) => b.items.map((i) => i.id)));
122
+ const unknown = rest.filter((id) => !known.has(id));
123
+ if (unknown.length) die(1, `not in the plan: ${unknown.join(', ')}`);
124
+ for (const b of batches) for (const it of b.items) if (rest.includes(it.id)) lines[it.line] = lines[it.line].replace(/^- \[[ xX]\]/, cmd === 'tick' ? '- [x]' : '- [ ]');
125
+ fs.writeFileSync(file, lines.join('\n'));
126
+ return console.log(`${cmd}ed ${rest.join(', ')}`);
127
+ }
128
+ if (cmd === 'set') {
129
+ const [n, state, ...note] = rest;
130
+ const b = batches.find((x) => x.n === Number(n));
131
+ if (!b || !STATES.includes(state)) die(2, `set <batch n> <${STATES.join('|')}> ["note"]`);
132
+ lines[b.line] = `## Batch ${b.n} · state: ${state}${note.length ? ` · ${note.join(' ').replace(/\n/g, ' ')}` : ''}`;
133
+ fs.writeFileSync(file, lines.join('\n'));
134
+ return console.log(`batch ${b.n}: ${state}`);
135
+ }
136
+ if (cmd === 'next') {
137
+ const b = batches.find((x) => x.items.some((i) => i.ticked) && !['verified', 'reverted', 'skipped'].includes(x.state));
138
+ if (!b) die(1, 'no batch left: every ticked item is verified, reverted or skipped');
139
+ return console.log(JSON.stringify({ batch: b.n, state: b.state, items: b.items.filter((i) => i.ticked).map((i) => ({ id: i.id, text: i.text })) }, null, 2));
140
+ }
141
+ if (cmd === 'summary') {
142
+ const t = batches.flatMap((b) => b.items).filter((i) => i.ticked).length;
143
+ for (const b of batches) console.log(`batch ${b.n}: ${b.state} · ticked ${b.items.filter((i) => i.ticked).length}/${b.items.length}${b.note ? ` · ${b.note}` : ''}`);
144
+ return console.log(`ticked ${t} of ${batches.flatMap((b) => b.items).length}`);
145
+ }
146
+ die(2, `unknown command ${cmd}`);
147
+ }
148
+
149
+ main();
@@ -0,0 +1,400 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * The Orion graph: story → acceptance criterion → test case → desc entry → test → page object → screen → result →
4
+ * defect, built by a script from files the run already has (no model call, no tokens). Agents read small slices of it
5
+ * instead of whole maps and suites; the reviewer and Gate 8 use its gap check.
6
+ *
7
+ * Usage (from the workspace root):
8
+ * node .claude/skills/orion/scripts/graph.mjs build [--suite <folder>] [--context project-context]
9
+ * node .claude/skills/orion/scripts/graph.mjs query (--story <KEY> | --page <file or name> | --test <file>) [--max-bytes 8000]
10
+ * node .claude/skills/orion/scripts/graph.mjs check [--story <KEY>]
11
+ * `--suite` defaults to the only `sut/<app>/` folder, else the workspace root. query and check rebuild first when any
12
+ * source file changed since the last build (a sha1 per file in manifest.json), so the graph is never stale.
13
+ *
14
+ * Sources: the suite (lib/scan.mjs: tests, page objects, fixtures and which files each test uses; desc files: case id,
15
+ * AC(s), story, title), project-context/test-designs/<story>/design.md (accepted cases, screens, status),
16
+ * ui-maps/*.md (screen key and page object per row), results/*.json (results_parse.mjs), defects.md.
17
+ * Writes project-context/graph/graph.json (sorted, no timestamps: the same inputs give the same bytes) and
18
+ * manifest.json. Every edge says where it came from and whether it is `confirmed` (an id, import or table row) or
19
+ * `inferred` (a name match).
20
+ * check reports: an AC with no test case, a case with no desc entry, a desc entry no test uses, an automated case with
21
+ * no result, a test linked to no case, a page object with no screen key. Exit code: 0 · 1 gaps (check) or nothing
22
+ * found (query) · 2 wrong arguments.
23
+ */
24
+ import fs from 'node:fs';
25
+ import { insideWorkspace } from './lib/inside.mjs';
26
+ import path from 'node:path';
27
+ import crypto from 'node:crypto';
28
+ import { scan } from './lib/scan.mjs';
29
+
30
+ const FORMAT = 'orion-graph/1';
31
+ const KEY = /\b(?!(?:TS|AC|HL|TC)-)([A-Z][A-Z0-9]+-\d+)\b/;
32
+
33
+ function args() {
34
+ const [cmd, ...rest] = process.argv.slice(2);
35
+ const o = { cmd };
36
+ for (let i = 0; i < rest.length; i++) {
37
+ if (!rest[i].startsWith('--')) usage();
38
+ o[rest[i].slice(2)] = rest[i + 1]; i++;
39
+ }
40
+ if (!['build', 'query', 'check'].includes(cmd)) usage();
41
+ o.context = o.context || 'project-context';
42
+ insideWorkspace(o.context, '--context');
43
+ if (!o.suite) {
44
+ const sut = fs.existsSync('sut') ? fs.readdirSync('sut', { withFileTypes: true }).filter((d) => d.isDirectory()) : [];
45
+ // A suite at the workspace root (an existing framework) wins over a stray sut/<app>/ folder beside it.
46
+ // Only test-runner configs count: an app repo's pom.xml or .sln beside a generated sut/<app>/ is not a suite.
47
+ const rootSuite = ['playwright.config.ts', 'playwright.config.js', 'playwright.config.mjs', 'cypress.config.js', 'cypress.config.ts',
48
+ 'wdio.conf.ts', 'wdio.conf.js', 'testng.xml', 'pytest.ini'].some((f) => fs.existsSync(f));
49
+ o.suite = !rootSuite && sut.length === 1 ? path.join('sut', sut[0].name) : '.';
50
+ }
51
+ return o;
52
+ }
53
+ function usage() {
54
+ console.log('usage: graph.mjs build [--suite DIR] | query (--story KEY | --page NAME | --test FILE) | check [--story KEY]');
55
+ process.exit(2);
56
+ }
57
+
58
+ const read = (f) => { try { return fs.readFileSync(f, 'utf8'); } catch { return null; } };
59
+ const list = (dir, rx) => (fs.existsSync(dir) ? fs.readdirSync(dir, { recursive: true }).map(String).filter((f) => rx.test(f)).map((f) => path.join(dir, f)) : []);
60
+ const rel = (f) => f.split(path.sep).join('/');
61
+
62
+ /** Markdown tables in a file: [{header:[...], rows:[[...]], line}] */
63
+ function tables(text) {
64
+ const out = []; const lines = text.split('\n');
65
+ for (let i = 0; i < lines.length - 1; i++) {
66
+ if (/^\|.*\|\s*$/.test(lines[i]) && /^\|[\s:|-]+\|\s*$/.test(lines[i + 1])) {
67
+ const cells = (l) => l.trim().replace(/^\||\|$/g, '').split('|').map((c) => c.trim());
68
+ const t = { header: cells(lines[i]).map((h) => h.toLowerCase()), rows: [], line: i + 1 };
69
+ let j = i + 2;
70
+ for (; j < lines.length && /^\|/.test(lines[j]); j++) t.rows.push({ cells: cells(lines[j]), line: j + 1 });
71
+ out.push(t); i = j;
72
+ }
73
+ }
74
+ return out;
75
+ }
76
+ const col = (t, rx) => t.header.findIndex((h) => rx.test(h));
77
+
78
+ /** Desc entries in a desc file: id, ACs, story, title, line. */
79
+ function descEntries(text) {
80
+ const lines = text.split('\n'); const starts = [];
81
+ lines.forEach((l, i) => {
82
+ const m = l.match(/(?:^|[\s{(,[])["']((?:TS|CT)-\d+)["']\s*(?:[:,\]]|\)?\s*:)/) || l.match(/new\s+(?:TestDescription|\w*Desc\w*)\(\s*"((?:TS|CT)-\d+)"/)
83
+ || l.match(/^\s*\w+\s*:\s*\{\s*id\s*:\s*['"]((?:TS|CT)-\d+)['"]/) || l.match(/^\s*id\s*:\s*['"]((?:TS|CT)-\d+)['"]/);
84
+ if (m && !starts.some((s) => s.id === m[1])) starts.push({ id: m[1], line: i + 1 });
85
+ });
86
+ return starts.map((s, k) => {
87
+ const body = lines.slice(s.line - 1, k + 1 < starts.length ? starts[k + 1].line - 1 : lines.length).join('\n');
88
+ const acs = [...new Set((body.match(/\bAC-\d+\b/g) || []))];
89
+ const story = (body.match(KEY) || [])[1] || null;
90
+ const title = (body.match(/title\s*[:=]\s*(['"])(.+?)\1/) || body.match(/"TS-\d+",\s*"AC-\d+",\s*"[^"]*",\s*"([^"]+)"/) || [])[2] ?? (body.match(/"TS-\d+",\s*"AC-\d+",\s*"[^"]*",\s*"([^"]+)"/) || [])[1] ?? null;
91
+ return { ...s, acs, story, title };
92
+ });
93
+ }
94
+
95
+ /** Test → case ids, per test function, from the lines that declare the test. */
96
+ function testCases(text, lang) {
97
+ const lines = text.split('\n'); const out = [];
98
+ const vars = {};
99
+ for (const m of text.matchAll(/(?:const|let|var)\s+(\w+)\s*=\s*\w+\[\s*['"](TS-\d+)['"]\s*\]/g)) vars[m[1]] = m[2];
100
+ lines.forEach((l, i) => {
101
+ let m;
102
+ if ((lang === 'js' || lang === 'ts') && (m = l.match(/\b(?:test|it|group)(?:\.(?!describe\b)\w+)?\(\s*(?:(['"`])(.+?)\1|titleOf\((\w+)\))/))) {
103
+ const key = (m[2] || '').match(/\w+\.((?:TS|CT)\d+)\b/);
104
+ const id = m[3] ? vars[m[3]] : key ? key[1].replace(/^(TS|CT)/, '$1-') : (m[2].match(/\b(?:TS|CT)-\d+\b/) || [])[0];
105
+ out.push({ name: m[2] || (id ? `${id} (title from desc)` : m[3]), line: i + 1, ids: id ? [id] : [] });
106
+ } else if (lang === 'py' && (m = l.match(/^\s*(?:async\s+)?def\s+(test_\w+)/))) {
107
+ const above = lines.slice(Math.max(0, i - 3), i).join(' ');
108
+ const ids = (above.match(/\bTS-\d+\b/g) || []).concat((m[1].match(/_ts(\d+)(?:_|$)/) || []).slice(1).map((n) => `TS-${n}`));
109
+ out.push({ name: m[1], line: i + 1, ids: [...new Set(ids)] });
110
+ } else if ((lang === 'java' || lang === 'cs') && (m = l.match(/public\s+(?:async\s+)?(?:void|Task)\s+(\w+)\s*\(/))) {
111
+ const above = lines.slice(Math.max(0, i - 4), i).join(' ');
112
+ if (!/@Test|\[Test|\[Fact|\[TestCase|@Case|\[Case/.test(above)) return;
113
+ out.push({ name: m[1], line: i + 1, ids: [...new Set(above.match(/\bTS-\d+\b/g) || [])] });
114
+ }
115
+ });
116
+ return out;
117
+ }
118
+
119
+ const LANG = (f) => (/\.m?tsx?$/.test(f) ? 'ts' : /\.m?jsx?$/.test(f) ? 'js' : /\.py$/.test(f) ? 'py' : /\.java$/.test(f) ? 'java' : /\.cs$/.test(f) ? 'cs' : null);
120
+
121
+ /** The source files the graph is built from, with their sha1 (the freshness manifest). */
122
+ function sources(o) {
123
+ const s = scan(o.suite);
124
+ const suiteFiles = [...new Set([...s.tests.map((t) => t.file), ...Object.values(s.files).flat(),
125
+ ...list(o.suite, /(^|[\\/])(desc|Desc)[\\/].+\.(m?[jt]s|py|java|cs|json)$/).map((f) => rel(path.relative(o.suite, f)))])]
126
+ .map((f) => rel(path.join(o.suite, f)));
127
+ const ctx = [...list(path.join(o.context, 'assessments'), /(assessment|fix-plan)\.md$/), ...list(path.join(o.context, 'test-designs'), /design\.md$/), ...list(path.join(o.context, 'ui-maps'), /\.md$/),
128
+ ...list(path.join(o.context, 'results'), /\.json$/), ...[path.join(o.context, 'defects.md')].filter((f) => fs.existsSync(f))].map(rel);
129
+ const files = [...new Set([...suiteFiles, ...ctx])].sort();
130
+ const manifest = {};
131
+ // The scripts that build the graph are sources too: an Orion upgrade rebuilds it.
132
+ for (const f of ['graph.mjs', 'lib/scan.mjs']) manifest[`(orion)/${f}`] = crypto.createHash('sha1').update(read(path.join(path.dirname(new URL(import.meta.url).pathname), f)) || '').digest('hex');
133
+ for (const f of files) { const t = read(f); if (t != null) manifest[f] = crypto.createHash('sha1').update(t).digest('hex'); }
134
+ return { scan: s, manifest };
135
+ }
136
+
137
+ function build(o, pre) {
138
+ const { scan: s, manifest } = pre || sources(o);
139
+ const nodes = new Map(); const edges = [];
140
+ const node = (id, type, attrs = {}) => { if (!nodes.has(id)) nodes.set(id, { id, type, ...attrs }); else Object.assign(nodes.get(id), attrs); return id; };
141
+ const edge = (from, to, type, tag, source) => edges.push({ from, to, type, tag, source });
142
+ const at = (f, line) => (line ? `${f}:${line}` : f);
143
+ const sfile = (f) => rel(path.join(o.suite, f));
144
+
145
+ // desc entries → story, AC, case
146
+ const caseIdsByFile = {};
147
+ for (const f of Object.keys(manifest).filter((x) => /(^|\/)(desc|Desc)\//.test(x) && LANG(x))) {
148
+ for (const d of descEntries(read(f))) {
149
+ const story = d.story || 'UNKNOWN';
150
+ const ts = node(`ts:${story}:${d.id}`, 'ts', { key: `${story}:${d.id}`, title: d.title, desc: at(f, d.line) });
151
+ node(`story:${story}`, 'story', { key: story });
152
+ for (const ac of d.acs.length ? d.acs : []) {
153
+ const a = node(`ac:${story}:${ac}`, 'ac', { key: `${story}:${ac}` });
154
+ edge(`story:${story}`, a, 'has', 'confirmed', at(f, d.line));
155
+ edge(a, ts, 'covered_by', 'confirmed', at(f, d.line));
156
+ }
157
+ (caseIdsByFile[f] ||= {})[d.id] = ts;
158
+ }
159
+ }
160
+ const caseById = (id) => Object.values(caseIdsByFile).map((m) => m[id]).filter(Boolean);
161
+
162
+ // design.md → cases (planned too), screens, status
163
+ for (const f of Object.keys(manifest).filter((x) => /design\.md$/.test(x))) {
164
+ const story = (f.match(/test-designs\/([^/]+)\//) || [])[1];
165
+ for (const t of tables(read(f))) {
166
+ const cTs = col(t, /^ts$|test case/); const cAc = col(t, /^ac/); const cSc = col(t, /screen/); const cSt = col(t, /status/);
167
+ if (cTs < 0 && cAc >= 0 && story) { // the acceptance criteria table: every AC, covered or not
168
+ for (const r of t.rows) for (const ac of (r.cells[cAc] || '').match(/AC-\d+/g) || []) {
169
+ edge(node(`story:${story}`, 'story', { key: story }), node(`ac:${story}:${ac}`, 'ac', { key: `${story}:${ac}`, text: r.cells[1] || undefined }), 'has', 'confirmed', at(f, r.line));
170
+ }
171
+ continue;
172
+ }
173
+ if (cTs < 0) continue;
174
+ for (const r of t.rows) {
175
+ const idm = (r.cells[cTs] || '').match(/(?:([A-Z][A-Z0-9]+-\d+):)?(TS-\d+)/);
176
+ if (!idm) continue;
177
+ const key = idm[1] || (r.cells[cTs].match(KEY) || [])[1] || story;
178
+ const ts = node(`ts:${key}:${idm[2]}`, 'ts', { key: `${key}:${idm[2]}`, status: cSt >= 0 ? r.cells[cSt] : undefined, design: at(f, r.line) });
179
+ node(`story:${key}`, 'story', { key });
180
+ for (const ac of (r.cells[cAc] || '').match(/AC-\d+/g) || []) {
181
+ const a = node(`ac:${key}:${ac}`, 'ac', { key: `${key}:${ac}` });
182
+ edge(`story:${key}`, a, 'has', 'confirmed', at(f, r.line));
183
+ edge(a, ts, 'covered_by', 'confirmed', at(f, r.line));
184
+ }
185
+ for (const sc of (cSc >= 0 ? r.cells[cSc] : '').split(/[,;]/).map((x) => x.trim()).filter((x) => x && x !== '—')) {
186
+ edge(ts, node(`screen:${sc}`, 'screen', { key: sc }), 'uses_screen', 'confirmed', at(f, r.line));
187
+ }
188
+ }
189
+ }
190
+ }
191
+
192
+ // tests, and what they use
193
+ const roleOf = {};
194
+ for (const [role, fl] of Object.entries(s.files)) for (const f of fl) roleOf[f] = role;
195
+ for (const t of s.tests) {
196
+ const f = sfile(t.file); const text = read(f) || '';
197
+ const decls = testCases(text, LANG(t.file));
198
+ for (const [k, tc] of decls.entries()) {
199
+ const near = text.split('\n').slice(Math.max(0, tc.line - 4), tc.line + 1).join(' ');
200
+ if (/(^|\/)(tests?\/unit|Tests\/Unit|unit)\//.test(t.file) || /framework check/i.test(near)) continue; // not story cases
201
+ const id = node(`test:${f}#${tc.name}`, 'test', { file: at(f, tc.line), name: tc.name });
202
+ for (const cid of tc.ids) {
203
+ const matches = caseById(cid);
204
+ for (const ts of matches) edge(ts, id, 'implemented_by', 'confirmed', at(f, tc.line));
205
+ if (!matches.length) edge(node(`ts:UNKNOWN:${cid}`, 'ts', { key: `UNKNOWN:${cid}` }), id, 'implemented_by', 'confirmed', at(f, tc.line));
206
+ }
207
+ const window = text.split('\n').slice(tc.line - 1, Math.min(tc.line + 15, k + 1 < decls.length ? decls[k + 1].line - 1 : Infinity)).join('\n').toLowerCase().replace(/_/g, '');
208
+ for (const p of s.files.pages) {
209
+ const stem = path.basename(p).replace(/\.\w+$/, '').toLowerCase().replace(/_/g, '');
210
+ if (!/^base/.test(stem) && new RegExp(`\\b${stem}\\b`).test(window)) edge(id, node(`page:${sfile(p)}`, 'page', { file: sfile(p) }), 'names_page', 'inferred', at(f, tc.line));
211
+ }
212
+ for (const e of s.edges.filter((x) => x.from === t.file)) {
213
+ const type = { page: 'page', fixture: 'fixture', helper: 'helper', service: 'service', data: 'data', config: 'config' }[e.to_role] || 'file';
214
+ edge(id, node(`${type}:${sfile(e.to)}`, type, { file: sfile(e.to) }), 'uses', e.tag, at(f, null));
215
+ }
216
+ }
217
+ }
218
+ // pages a fixture hands to tests (fixture → page), so tests reach pages through fixtures
219
+ for (const e of s.edges.filter((x) => roleOf[x.from] === 'fixtures' && x.to_role === 'page')) {
220
+ edge(node(`fixture:${sfile(e.from)}`, 'fixture', { file: sfile(e.from) }), node(`page:${sfile(e.to)}`, 'page', { file: sfile(e.to) }), 'uses', e.tag, sfile(e.from));
221
+ }
222
+ for (const p of s.files.pages) node(`page:${sfile(p)}`, 'page', { file: sfile(p) });
223
+
224
+ // UI maps → screen ↔ page object
225
+ for (const f of Object.keys(manifest).filter((x) => /ui-maps\/.+\.md$/.test(x))) {
226
+ for (const t of tables(read(f))) {
227
+ const cSc = col(t, /screen key/); const cPo = col(t, /page object/);
228
+ if (cSc < 0) continue;
229
+ for (const r of t.rows) {
230
+ const sc = r.cells[cSc]; if (!sc || sc === '—') continue;
231
+ const scr = node(`screen:${sc}`, 'screen', { key: sc, map: at(f, r.line) });
232
+ const po = cPo >= 0 ? (r.cells[cPo] || '').replace(/^\(Gate 5\)\s*/, '') : '';
233
+ const page = po && [...nodes.values()].find((n) => n.type === 'page' && path.basename(n.file).replace(/\.\w+$/, '').toLowerCase() === po.toLowerCase().replace(/\.\w+$/, ''));
234
+ if (page) edge(page.id, scr, 'models', 'confirmed', at(f, r.line));
235
+ }
236
+ }
237
+ }
238
+
239
+ // results → tests (file + case id or name)
240
+ for (const f of Object.keys(manifest).filter((x) => /results\/.+\.json$/.test(x))) {
241
+ let r; try { r = JSON.parse(read(f)); } catch { continue; }
242
+ for (const t of r.tests || []) {
243
+ const rid = node(`result:${r.run_id}#${t.file}#${t.title}`, 'result', { run: r.run_id, status: t.status, failure_sig: t.failure_sig || undefined, source: f });
244
+ const rfile = t.file.replace(/\\/g, '/').replace(/^\.\//, '');
245
+ const sameFile = (n) => { const f = n.file.split(':')[0]; return f.endsWith(`/${rfile}`) || f === rfile || path.basename(f) === path.basename(rfile) || path.basename(f).replace(/\.\w+$/, '') === rfile.split('.').pop(); };
246
+ const byId = (n) => t.test_id && edges.some((e) => e.to === n.id && e.type === 'implemented_by' && e.from.endsWith(`:${t.test_id}`));
247
+ const target = [...nodes.values()].find((n) => n.type === 'test' && sameFile(n) && (byId(n) || t.title.includes(n.name) || n.name.includes(t.title)));
248
+ if (target) edge(target.id, rid, 'produced', t.test_id ? 'confirmed' : 'inferred', f);
249
+ }
250
+ }
251
+
252
+ // assessments → findings on the files they name; a fixed or reverted state comes from the fix plan next to them
253
+ for (const f of Object.keys(manifest).filter((x) => /assessments\/[^/]+\/assessment\.md$/.test(x))) {
254
+ const aid = f.split('/').slice(-2)[0];
255
+ const plan = read(f.replace(/assessment\.md$/, 'fix-plan.md')) || '';
256
+ const stateOf = {};
257
+ let batch = null;
258
+ for (const l of plan.split('\n')) {
259
+ const b = l.match(/^## Batch \d+ · state: (\w+)/); if (b) batch = b[1];
260
+ const it = l.match(/^- \[([ xX])\] (F-\d+) /); if (it) stateOf[it[2]] = it[1] === ' ' ? 'open' : batch === 'verified' ? 'fixed' : batch === 'reverted' ? 'open (fix reverted)' : 'ticked';
261
+ }
262
+ for (const t of tables(read(f))) {
263
+ const cF = col(t, /^f$/); const cR = col(t, /^rule/); const cS = col(t, /^severity/); const cL = col(t, /^file/);
264
+ if (cF < 0 || cL < 0) continue;
265
+ for (const r of t.rows) {
266
+ const id = r.cells[cF]; if (!/^F-\d+$/.test(id || '')) continue;
267
+ const [file, line] = (r.cells[cL] || '').replace(/`/g, '').split(':');
268
+ const fid = node(`finding:${aid}:${id}`, 'finding', { key: `${aid}:${id}`, rule: r.cells[cR], severity: r.cells[cS], file: `${file}${line ? `:${line}` : ''}`, status: stateOf[id] || 'open' });
269
+ const full = rel(path.join(o.suite, file));
270
+ const target = [...nodes.values()].find((n) => ['page', 'fixture', 'helper', 'service', 'data', 'config', 'file'].includes(n.type) && n.file === full)
271
+ || [...nodes.values()].filter((n) => n.type === 'test' && n.file.split(':')[0] === full && Number(n.file.split(':')[1]) <= Number(line || 1e9))
272
+ .sort((a, b) => Number(b.file.split(':')[1]) - Number(a.file.split(':')[1]))[0];
273
+ edge(target ? target.id : node(`file:${full}`, 'file', { file: full }), fid, 'has_finding', 'confirmed', at(f, r.line));
274
+ }
275
+ }
276
+ }
277
+
278
+ // defects.md → result (by test file and failure signature)
279
+ const dpath = Object.keys(manifest).find((x) => /defects\.md$/.test(x));
280
+ if (dpath) for (const t of tables(read(dpath))) {
281
+ const cId = col(t, /^id$/); const cTest = col(t, /^test \(/); const cCase = col(t, /test case/);
282
+ for (const r of t.rows) {
283
+ const id = r.cells[cId]; if (!id) continue;
284
+ const d = node(`defect:${id}`, 'defect', { key: id, line: at(dpath, r.line) });
285
+ const tc = (r.cells[cCase] || '').match(/(?:([A-Z][A-Z0-9]+-\d+):)?(TS-\d+)/);
286
+ if (tc) for (const ts of caseById(tc[2])) edge(ts, d, 'failed_as', 'confirmed', at(dpath, r.line));
287
+ }
288
+ }
289
+
290
+ const g = { format: FORMAT, suite: rel(o.suite), nodes: [...nodes.values()].sort((a, b) => a.id.localeCompare(b.id)),
291
+ edges: dedupe(edges).sort((a, b) => `${a.from}${a.type}${a.to}`.localeCompare(`${b.from}${b.type}${b.to}`)) };
292
+ const dir = path.join(o.context, 'graph');
293
+ fs.mkdirSync(dir, { recursive: true });
294
+ fs.writeFileSync(path.join(dir, 'graph.json'), `${JSON.stringify(g, null, 1)}\n`);
295
+ fs.writeFileSync(path.join(dir, 'manifest.json'), `${JSON.stringify({ format: FORMAT, suite: rel(o.suite), files: manifest }, null, 1)}\n`);
296
+ const gi = path.join(dir, '.gitignore');
297
+ if (!fs.existsSync(gi)) fs.writeFileSync(gi, '# Derived from the suite and project-context; rebuilt by graph.mjs.\n*\n!.gitignore\n');
298
+ return g;
299
+ }
300
+ function dedupe(edges) { const seen = new Set(); return edges.filter((e) => { const k = `${e.from}|${e.type}|${e.to}`; if (seen.has(k)) return false; seen.add(k); return true; }); }
301
+
302
+ /** The graph, rebuilt first when any source changed since the last build. */
303
+ function fresh(o) {
304
+ const dir = path.join(o.context, 'graph');
305
+ const pre = sources(o);
306
+ let old = null; try { old = JSON.parse(read(path.join(dir, 'manifest.json'))); } catch { /* none yet */ }
307
+ const same = old && old.suite === rel(o.suite) && JSON.stringify(old.files) === JSON.stringify(pre.manifest);
308
+ if (same) { try { return { g: JSON.parse(read(path.join(dir, 'graph.json'))), rebuilt: false }; } catch { /* rebuild */ } }
309
+ return { g: build(o, pre), rebuilt: true };
310
+ }
311
+
312
+ function gaps(g, story) {
313
+ const out = [];
314
+ const from = (id, type) => g.edges.filter((e) => e.from === id && (!type || e.type === type));
315
+ const to = (id, type) => g.edges.filter((e) => e.to === id && (!type || e.type === type));
316
+ const inStory = (n) => !story || (n.key || '').startsWith(`${story}:`) || n.key === story;
317
+ for (const n of g.nodes.filter(inStory)) {
318
+ if (n.type === 'ac' && !from(n.id, 'covered_by').length) out.push(`${n.key}: no test case covers it`);
319
+ if (n.type === 'ts') {
320
+ const automated = from(n.id, 'implemented_by');
321
+ if (!n.desc && !/not automated/i.test(n.status || '')) out.push(`${n.key}: no desc entry${n.design ? ` (design ${n.design})` : ''}`);
322
+ if (n.desc && !automated.length) out.push(`${n.key}: desc entry ${n.desc} is used by no test`);
323
+ if (automated.length && g.nodes.some((x) => x.type === 'result') && !automated.some((e) => from(e.to, 'produced').length)) out.push(`${n.key}: automated but no result recorded`);
324
+ }
325
+ }
326
+ if (!story) {
327
+ for (const n of g.nodes.filter((x) => x.type === 'test')) if (!to(n.id, 'implemented_by').length) out.push(`${n.file}: test ${n.name} is linked to no test case`);
328
+ const hasMaps = g.nodes.some((x) => x.type === 'screen');
329
+ if (hasMaps) for (const n of g.nodes.filter((x) => x.type === 'page' && !/^base/i.test(path.basename(x.file)))) if (!from(n.id, 'models').length) out.push(`${n.file}: page object has no screen key in a UI map`);
330
+ }
331
+ return out;
332
+ }
333
+
334
+ /** A small Markdown slice for one story, page or test; never silently cut. */
335
+ function query(o, g) {
336
+ const by = new Map(g.nodes.map((n) => [n.id, n]));
337
+ const from = (id, type) => g.edges.filter((e) => e.from === id && (!type || e.type === type));
338
+ const to = (id, type) => g.edges.filter((e) => e.to === id && (!type || e.type === type));
339
+ const lines = [];
340
+ if (o.story) {
341
+ const acs = g.nodes.filter((n) => n.type === 'ac' && n.key.startsWith(`${o.story}:`));
342
+ const cases = g.nodes.filter((n) => n.type === 'ts' && n.key.startsWith(`${o.story}:`));
343
+ if (!acs.length && !cases.length) return null;
344
+ lines.push(`# Graph: ${o.story}`, '', '| Case | AC(s) | Status | Desc | Tests | Pages | Last result |', '|---|---|---|---|---|---|---|');
345
+ for (const c of cases) {
346
+ const ac = to(c.id, 'covered_by').map((e) => by.get(e.from).key.split(':')[1]).join(', ');
347
+ const tests = from(c.id, 'implemented_by').map((e) => by.get(e.to));
348
+ const named = tests.flatMap((t) => from(t.id, 'names_page').map((e) => e.to));
349
+ const pages = [...new Set((named.length ? named : tests.flatMap((t) => from(t.id, 'uses').flatMap((e) => (by.get(e.to).type === 'page' ? [e.to] : from(e.to, 'uses').map((x) => x.to)))))
350
+ .filter((p) => by.get(p)?.type === 'page').map((p) => path.basename(by.get(p).file)))];
351
+ const results = tests.flatMap((t) => from(t.id, 'produced').map((e) => by.get(e.to))).sort((a, b) => b.run.localeCompare(a.run));
352
+ lines.push(`| ${c.key.split(':')[1]} ${c.title ? `· ${c.title}` : ''} | ${ac || '—'} | ${c.status || (tests.length ? 'automated' : 'planned')} | ${c.desc || '—'} | ${tests.map((t) => t.file).join('<br>') || '—'} | ${pages.join(', ') || '—'} | ${results[0] ? `${results[0].status} (${results[0].run})` : '—'}${from(c.id, 'failed_as').map((e) => ` · ${by.get(e.to).key}`).join('')} |`);
353
+ }
354
+ const g2 = gaps(g, o.story);
355
+ lines.push('', `Gaps: ${g2.length ? '' : 'none'}`, ...g2.map((x) => `- ${x}`));
356
+ } else if (o.page) {
357
+ const p = g.nodes.find((n) => n.type === 'page' && (n.file === o.page || path.basename(n.file).replace(/\.\w+$/, '').toLowerCase() === o.page.toLowerCase()));
358
+ if (!p) return null;
359
+ const direct = to(p.id, 'names_page').map((e) => e.from);
360
+ const via = to(p.id, 'uses').map((e) => e.from);
361
+ const tests = g.nodes.filter((n) => n.type === 'test' && (direct.length ? direct.includes(n.id) : (via.includes(n.id) || from(n.id, 'uses').some((e) => via.includes(e.to)))));
362
+ lines.push(`# Graph: page ${p.file}`, '', `screens: ${from(p.id, 'models').map((e) => by.get(e.to).key).join(', ') || 'none recorded'}`, `tests that use it (${tests.length}):`, ...tests.map((t) => `- ${t.file} ${t.name} · cases ${to(t.id, 'implemented_by').map((e) => by.get(e.from).key).join(', ') || '—'}`));
363
+ const fs_ = from(p.id, 'has_finding').map((e) => by.get(e.to));
364
+ if (fs_.length) lines.push(`findings (${fs_.length}):`, ...fs_.map((f) => `- ${f.key} ${f.rule} ${f.severity} · ${f.file} · ${f.status}`));
365
+ } else if (o.test) {
366
+ const ts = g.nodes.filter((n) => n.type === 'test' && n.file.startsWith(o.test));
367
+ if (!ts.length) return null;
368
+ for (const t of ts) lines.push(`- ${t.file} ${t.name} · cases ${to(t.id, 'implemented_by').map((e) => by.get(e.from).key).join(', ') || '—'} · uses ${from(t.id, 'uses').map((e) => by.get(e.to).file).join(', ') || '—'}${from(t.id, 'has_finding').map((e) => ` · ${by.get(e.to).key} ${by.get(e.to).rule} (${by.get(e.to).status})`).join('')}`);
369
+ } else usage();
370
+ const max = Number(o['max-bytes'] || 8000);
371
+ let text = lines.join('\n');
372
+ if (Buffer.byteLength(text) > max) {
373
+ let kept = []; let n = 0;
374
+ for (const l of lines) { if (Buffer.byteLength([...kept, l].join('\n')) > max - 200) break; kept.push(l); n++; }
375
+ text = `${kept.join('\n')}\n\n… ${lines.length - n} more line(s) left out to stay under ${max} bytes: ask for one page (--page) or test file (--test), or raise --max-bytes.`;
376
+ }
377
+ return text;
378
+ }
379
+
380
+ function main() {
381
+ const o = args();
382
+ if (o.cmd === 'build') {
383
+ const g = build(o);
384
+ const count = (t) => g.nodes.filter((n) => n.type === t).length;
385
+ console.log(`graph: ${g.nodes.length} nodes (stories ${count('story')}, ACs ${count('ac')}, cases ${count('ts')}, tests ${count('test')}, pages ${count('page')}, screens ${count('screen')}, results ${count('result')}, findings ${count('finding')}), ${g.edges.length} edges → ${o.context}/graph/graph.json`);
386
+ return;
387
+ }
388
+ const { g, rebuilt } = fresh(o);
389
+ if (o.cmd === 'check') {
390
+ const out = gaps(g, o.story);
391
+ out.forEach((x) => console.log(x));
392
+ console.log(`graph check${o.story ? ` ${o.story}` : ''}: ${out.length} gap(s)${rebuilt ? ' (graph rebuilt: sources changed)' : ''}`);
393
+ process.exit(out.length ? 1 : 0);
394
+ }
395
+ const text = query(o, g);
396
+ if (text == null) { console.log('graph: nothing found for that query'); process.exit(1); }
397
+ console.log(text);
398
+ }
399
+
400
+ main();
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Keeps a script's writes inside the workspace. The scripts that call it run without a permission prompt (allow rules
3
+ * in .claude/settings.json), so a path an agent was talked into (`--out ~/.ssh/…`, `../../other-repo/…`) must not
4
+ * reach outside the folder the script runs in. Symlinks are resolved on the nearest existing parent, so a link inside
5
+ * the workspace that points outside is refused too.
6
+ */
7
+ import fs from 'node:fs';
8
+ import path from 'node:path';
9
+
10
+ /** The real path of `p`, resolving symlinks on its nearest existing ancestor. */
11
+ function realish(p) {
12
+ let cur = path.resolve(p); const rest = [];
13
+ while (!fs.existsSync(cur)) { rest.unshift(path.basename(cur)); const up = path.dirname(cur); if (up === cur) break; cur = up; }
14
+ return path.join(fs.realpathSync(cur), ...rest);
15
+ }
16
+
17
+ /**
18
+ * Exits 2 with a message when `p` resolves outside the current working directory; returns `p` otherwise.
19
+ * @param {string} p The path the script is about to write.
20
+ * @param {string} what What the path is, for the message (e.g. `--out`).
21
+ * @returns {string} The same path.
22
+ */
23
+ export function insideWorkspace(p, what) {
24
+ const root = fs.realpathSync(process.cwd());
25
+ const abs = realish(p);
26
+ if (abs !== root && !abs.startsWith(root + path.sep)) {
27
+ console.log(`refused: ${what} ${p} is outside the workspace (${root}); this script writes only inside it`);
28
+ process.exit(2);
29
+ }
30
+ return p;
31
+ }