@sun-asterisk/sungen 3.2.2-beta.9 → 3.2.3-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/dist/capabilities/discover.d.ts.map +1 -1
  2. package/dist/capabilities/discover.js +26 -3
  3. package/dist/capabilities/discover.js.map +1 -1
  4. package/dist/cli/commands/add-flow.d.ts.map +1 -1
  5. package/dist/cli/commands/add-flow.js +2 -0
  6. package/dist/cli/commands/add-flow.js.map +1 -1
  7. package/dist/cli/commands/add.d.ts.map +1 -1
  8. package/dist/cli/commands/add.js +4 -0
  9. package/dist/cli/commands/add.js.map +1 -1
  10. package/dist/cli/commands/capability.d.ts.map +1 -1
  11. package/dist/cli/commands/capability.js +61 -0
  12. package/dist/cli/commands/capability.js.map +1 -1
  13. package/dist/cli/commands/delivery.d.ts.map +1 -1
  14. package/dist/cli/commands/delivery.js +89 -2
  15. package/dist/cli/commands/delivery.js.map +1 -1
  16. package/dist/cli/commands/eval.js +3 -3
  17. package/dist/cli/commands/eval.js.map +1 -1
  18. package/dist/cli/commands/generate.d.ts.map +1 -1
  19. package/dist/cli/commands/generate.js +2 -1
  20. package/dist/cli/commands/generate.js.map +1 -1
  21. package/dist/cli/commands/init.d.ts.map +1 -1
  22. package/dist/cli/commands/init.js +32 -2
  23. package/dist/cli/commands/init.js.map +1 -1
  24. package/dist/cli/commands/journey.d.ts.map +1 -1
  25. package/dist/cli/commands/journey.js +24 -2
  26. package/dist/cli/commands/journey.js.map +1 -1
  27. package/dist/cli/commands/update.d.ts.map +1 -1
  28. package/dist/cli/commands/update.js +10 -3
  29. package/dist/cli/commands/update.js.map +1 -1
  30. package/dist/dashboard/snapshot-builder.d.ts.map +1 -1
  31. package/dist/dashboard/snapshot-builder.js +10 -1
  32. package/dist/dashboard/snapshot-builder.js.map +1 -1
  33. package/dist/exporters/csv-exporter.d.ts.map +1 -1
  34. package/dist/exporters/csv-exporter.js +3 -1
  35. package/dist/exporters/csv-exporter.js.map +1 -1
  36. package/dist/exporters/json-exporter.js +3 -1
  37. package/dist/exporters/json-exporter.js.map +1 -1
  38. package/dist/exporters/mobile-app-id.d.ts +22 -0
  39. package/dist/exporters/mobile-app-id.d.ts.map +1 -0
  40. package/dist/exporters/mobile-app-id.js +37 -0
  41. package/dist/exporters/mobile-app-id.js.map +1 -0
  42. package/dist/exporters/spec-parser.d.ts.map +1 -1
  43. package/dist/exporters/spec-parser.js +6 -2
  44. package/dist/exporters/spec-parser.js.map +1 -1
  45. package/dist/generators/test-generator/adapters/adapter-interface.d.ts +3 -0
  46. package/dist/generators/test-generator/adapters/adapter-interface.d.ts.map +1 -1
  47. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/scroll-action.hbs +7 -4
  48. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/toggle-action.hbs +20 -3
  49. package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/checked-assertion.hbs +4 -1
  50. package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/not-checked-assertion.hbs +4 -1
  51. package/dist/generators/test-generator/adapters/appium/templates/test-file.hbs +3 -0
  52. package/dist/generators/test-generator/code-generator.d.ts.map +1 -1
  53. package/dist/generators/test-generator/code-generator.js +48 -9
  54. package/dist/generators/test-generator/code-generator.js.map +1 -1
  55. package/dist/generators/test-generator/template-engine.d.ts +3 -0
  56. package/dist/generators/test-generator/template-engine.d.ts.map +1 -1
  57. package/dist/generators/test-generator/template-engine.js +11 -1
  58. package/dist/generators/test-generator/template-engine.js.map +1 -1
  59. package/dist/generators/test-generator/utils/selector-resolver.d.ts +11 -1
  60. package/dist/generators/test-generator/utils/selector-resolver.d.ts.map +1 -1
  61. package/dist/generators/test-generator/utils/selector-resolver.js +33 -0
  62. package/dist/generators/test-generator/utils/selector-resolver.js.map +1 -1
  63. package/dist/harness/audit.d.ts.map +1 -1
  64. package/dist/harness/audit.js +8 -1
  65. package/dist/harness/audit.js.map +1 -1
  66. package/dist/harness/catalog/universal-viewpoints.yaml +15 -0
  67. package/dist/harness/eval/skill-lint.d.ts +3 -3
  68. package/dist/harness/eval/skill-lint.d.ts.map +1 -1
  69. package/dist/harness/eval/skill-lint.js +88 -68
  70. package/dist/harness/eval/skill-lint.js.map +1 -1
  71. package/dist/harness/journey.d.ts +37 -1
  72. package/dist/harness/journey.d.ts.map +1 -1
  73. package/dist/harness/journey.js +146 -19
  74. package/dist/harness/journey.js.map +1 -1
  75. package/dist/harness/quality-gates.d.ts +13 -0
  76. package/dist/harness/quality-gates.d.ts.map +1 -1
  77. package/dist/harness/quality-gates.js +23 -0
  78. package/dist/harness/quality-gates.js.map +1 -1
  79. package/dist/harness/sensors.d.ts +1 -1
  80. package/dist/harness/sensors.d.ts.map +1 -1
  81. package/dist/harness/sensors.js +32 -9
  82. package/dist/harness/sensors.js.map +1 -1
  83. package/dist/orchestrator/ai-rules-updater.d.ts +11 -3
  84. package/dist/orchestrator/ai-rules-updater.d.ts.map +1 -1
  85. package/dist/orchestrator/ai-rules-updater.js +44 -180
  86. package/dist/orchestrator/ai-rules-updater.js.map +1 -1
  87. package/dist/orchestrator/ai-skills/adapters.d.ts +28 -0
  88. package/dist/orchestrator/ai-skills/adapters.d.ts.map +1 -0
  89. package/dist/orchestrator/ai-skills/adapters.js +34 -0
  90. package/dist/orchestrator/ai-skills/adapters.js.map +1 -0
  91. package/dist/orchestrator/ai-skills/build.d.ts +10 -0
  92. package/dist/orchestrator/ai-skills/build.d.ts.map +1 -0
  93. package/dist/orchestrator/ai-skills/build.js +128 -0
  94. package/dist/orchestrator/ai-skills/build.js.map +1 -0
  95. package/dist/orchestrator/ai-skills/cap-stripper.d.ts +27 -0
  96. package/dist/orchestrator/ai-skills/cap-stripper.d.ts.map +1 -0
  97. package/dist/orchestrator/ai-skills/cap-stripper.js +78 -0
  98. package/dist/orchestrator/ai-skills/cap-stripper.js.map +1 -0
  99. package/dist/orchestrator/ai-skills/commands.d.ts +22 -0
  100. package/dist/orchestrator/ai-skills/commands.d.ts.map +1 -0
  101. package/dist/orchestrator/ai-skills/commands.js +109 -0
  102. package/dist/orchestrator/ai-skills/commands.js.map +1 -0
  103. package/dist/orchestrator/ai-skills/generator.d.ts +23 -0
  104. package/dist/orchestrator/ai-skills/generator.d.ts.map +1 -0
  105. package/dist/orchestrator/ai-skills/generator.js +79 -0
  106. package/dist/orchestrator/ai-skills/generator.js.map +1 -0
  107. package/dist/orchestrator/ai-skills/golden-skills.test.d.ts +2 -0
  108. package/dist/orchestrator/ai-skills/golden-skills.test.d.ts.map +1 -0
  109. package/dist/orchestrator/ai-skills/golden-skills.test.js +183 -0
  110. package/dist/orchestrator/ai-skills/golden-skills.test.js.map +1 -0
  111. package/dist/orchestrator/ai-skills/resolve-assistants.d.ts +8 -0
  112. package/dist/orchestrator/ai-skills/resolve-assistants.d.ts.map +1 -0
  113. package/dist/orchestrator/ai-skills/resolve-assistants.js +28 -0
  114. package/dist/orchestrator/ai-skills/resolve-assistants.js.map +1 -0
  115. package/dist/orchestrator/ai-skills/writer.d.ts +15 -0
  116. package/dist/orchestrator/ai-skills/writer.d.ts.map +1 -0
  117. package/dist/orchestrator/ai-skills/writer.js +129 -0
  118. package/dist/orchestrator/ai-skills/writer.js.map +1 -0
  119. package/dist/orchestrator/flow-manager.d.ts +11 -0
  120. package/dist/orchestrator/flow-manager.d.ts.map +1 -1
  121. package/dist/orchestrator/flow-manager.js +147 -29
  122. package/dist/orchestrator/flow-manager.js.map +1 -1
  123. package/dist/orchestrator/mobile-runtime-scaffolder.d.ts +59 -0
  124. package/dist/orchestrator/mobile-runtime-scaffolder.d.ts.map +1 -0
  125. package/dist/orchestrator/mobile-runtime-scaffolder.js +298 -0
  126. package/dist/orchestrator/mobile-runtime-scaffolder.js.map +1 -0
  127. package/dist/orchestrator/project-initializer.d.ts +44 -7
  128. package/dist/orchestrator/project-initializer.d.ts.map +1 -1
  129. package/dist/orchestrator/project-initializer.js +147 -79
  130. package/dist/orchestrator/project-initializer.js.map +1 -1
  131. package/dist/orchestrator/screen-manager.d.ts +30 -0
  132. package/dist/orchestrator/screen-manager.d.ts.map +1 -1
  133. package/dist/orchestrator/screen-manager.js +205 -22
  134. package/dist/orchestrator/screen-manager.js.map +1 -1
  135. package/dist/orchestrator/templates/ai-src/README.md +58 -0
  136. package/dist/orchestrator/templates/{ai-instructions/claude-cmd-add-flow.md → ai-src/commands/add-flow.md} +63 -2
  137. package/dist/orchestrator/templates/{ai-instructions/claude-cmd-add-screen.md → ai-src/commands/add-screen.md} +171 -6
  138. package/dist/orchestrator/templates/{ai-instructions/claude-cmd-create-test.md → ai-src/commands/create-test.md} +118 -5
  139. package/{src/orchestrator/templates/ai-instructions/claude-cmd-dashboard.md → dist/orchestrator/templates/ai-src/commands/dashboard.md} +25 -3
  140. package/{src/orchestrator/templates/ai-instructions/claude-cmd-delivery.md → dist/orchestrator/templates/ai-src/commands/delivery.md} +67 -3
  141. package/dist/orchestrator/templates/ai-src/commands/design.md +29 -0
  142. package/{src/orchestrator/templates/ai-instructions/claude-cmd-feedback.md → dist/orchestrator/templates/ai-src/commands/feedback.md} +34 -3
  143. package/dist/orchestrator/templates/{ai-instructions/claude-cmd-locale.md → ai-src/commands/locale.md} +56 -4
  144. package/{src/orchestrator/templates/ai-instructions/claude-cmd-review.md → dist/orchestrator/templates/ai-src/commands/review.md} +57 -2
  145. package/dist/orchestrator/templates/{ai-instructions/claude-cmd-run-test.md → ai-src/commands/run-test.md} +116 -8
  146. package/dist/orchestrator/templates/ai-src/config/codex.md +8 -0
  147. package/{src/orchestrator/templates/ai-instructions/claude-skill-capture-mobile.md → dist/orchestrator/templates/ai-src/skills/sungen-capture-mobile/SKILL.md} +11 -0
  148. package/dist/orchestrator/templates/{ai-instructions/github-skill-sungen-error-mapping.md → ai-src/skills/sungen-error-mapping/SKILL.md} +31 -10
  149. package/{src/orchestrator/templates/ai-instructions/claude-skill-harness-audit.md → dist/orchestrator/templates/ai-src/skills/sungen-harness-audit/SKILL.md} +5 -5
  150. package/{src/orchestrator/templates/ai-instructions/claude-skill-locale.md → dist/orchestrator/templates/ai-src/skills/sungen-locale/SKILL.md} +275 -3
  151. package/{src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix.md → dist/orchestrator/templates/ai-src/skills/sungen-selector-fix/SKILL.md} +17 -0
  152. package/{src/orchestrator/templates/ai-instructions/claude-skill-selector-fix-mobile.md → dist/orchestrator/templates/ai-src/skills/sungen-selector-fix-mobile/SKILL.md} +5 -0
  153. package/dist/orchestrator/templates/{ai-instructions/claude-skill-tc-generation.md → ai-src/skills/sungen-tc-generation/SKILL.md} +5 -0
  154. package/dist/orchestrator/templates/playwright.config.ts +7 -4
  155. package/package.json +3 -3
  156. package/src/capabilities/discover.ts +29 -3
  157. package/src/cli/commands/add-flow.ts +2 -0
  158. package/src/cli/commands/add.ts +4 -0
  159. package/src/cli/commands/capability.ts +64 -1
  160. package/src/cli/commands/delivery.ts +89 -2
  161. package/src/cli/commands/eval.ts +3 -3
  162. package/src/cli/commands/generate.ts +2 -1
  163. package/src/cli/commands/init.ts +50 -3
  164. package/src/cli/commands/journey.ts +20 -3
  165. package/src/cli/commands/update.ts +14 -4
  166. package/src/dashboard/snapshot-builder.ts +10 -1
  167. package/src/exporters/csv-exporter.ts +3 -1
  168. package/src/exporters/json-exporter.ts +3 -1
  169. package/src/exporters/mobile-app-id.ts +34 -0
  170. package/src/exporters/spec-parser.ts +6 -2
  171. package/src/generators/test-generator/adapters/adapter-interface.ts +3 -0
  172. package/src/generators/test-generator/adapters/appium/templates/steps/actions/scroll-action.hbs +7 -4
  173. package/src/generators/test-generator/adapters/appium/templates/steps/actions/toggle-action.hbs +20 -3
  174. package/src/generators/test-generator/adapters/appium/templates/steps/assertions/checked-assertion.hbs +4 -1
  175. package/src/generators/test-generator/adapters/appium/templates/steps/assertions/not-checked-assertion.hbs +4 -1
  176. package/src/generators/test-generator/adapters/appium/templates/test-file.hbs +3 -0
  177. package/src/generators/test-generator/code-generator.ts +49 -9
  178. package/src/generators/test-generator/template-engine.ts +14 -1
  179. package/src/generators/test-generator/utils/selector-resolver.ts +51 -1
  180. package/src/harness/audit.ts +9 -2
  181. package/src/harness/catalog/universal-viewpoints.yaml +15 -0
  182. package/src/harness/eval/skill-lint.ts +71 -60
  183. package/src/harness/journey.ts +167 -19
  184. package/src/harness/quality-gates.ts +20 -0
  185. package/src/harness/sensors.ts +25 -8
  186. package/src/orchestrator/ai-rules-updater.ts +35 -197
  187. package/src/orchestrator/ai-skills/adapters.ts +52 -0
  188. package/src/orchestrator/ai-skills/build.ts +103 -0
  189. package/src/orchestrator/ai-skills/cap-stripper.ts +85 -0
  190. package/src/orchestrator/ai-skills/commands.ts +112 -0
  191. package/src/orchestrator/ai-skills/generator.ts +47 -0
  192. package/src/orchestrator/ai-skills/golden-skills.test.ts +124 -0
  193. package/src/orchestrator/ai-skills/resolve-assistants.ts +18 -0
  194. package/src/orchestrator/ai-skills/writer.ts +92 -0
  195. package/src/orchestrator/flow-manager.ts +165 -29
  196. package/src/orchestrator/mobile-runtime-scaffolder.ts +277 -0
  197. package/src/orchestrator/project-initializer.ts +159 -86
  198. package/src/orchestrator/screen-manager.ts +237 -22
  199. package/src/orchestrator/templates/ai-src/README.md +58 -0
  200. package/src/orchestrator/templates/{ai-instructions/claude-cmd-add-flow.md → ai-src/commands/add-flow.md} +63 -2
  201. package/src/orchestrator/templates/{ai-instructions/claude-cmd-add-screen.md → ai-src/commands/add-screen.md} +171 -6
  202. package/src/orchestrator/templates/{ai-instructions/claude-cmd-create-test.md → ai-src/commands/create-test.md} +118 -5
  203. package/{dist/orchestrator/templates/ai-instructions/claude-cmd-dashboard.md → src/orchestrator/templates/ai-src/commands/dashboard.md} +25 -3
  204. package/{dist/orchestrator/templates/ai-instructions/claude-cmd-delivery.md → src/orchestrator/templates/ai-src/commands/delivery.md} +67 -3
  205. package/src/orchestrator/templates/ai-src/commands/design.md +29 -0
  206. package/{dist/orchestrator/templates/ai-instructions/claude-cmd-feedback.md → src/orchestrator/templates/ai-src/commands/feedback.md} +34 -3
  207. package/src/orchestrator/templates/{ai-instructions/claude-cmd-locale.md → ai-src/commands/locale.md} +56 -4
  208. package/{dist/orchestrator/templates/ai-instructions/claude-cmd-review.md → src/orchestrator/templates/ai-src/commands/review.md} +57 -2
  209. package/src/orchestrator/templates/{ai-instructions/claude-cmd-run-test.md → ai-src/commands/run-test.md} +116 -8
  210. package/src/orchestrator/templates/ai-src/config/codex.md +8 -0
  211. package/{dist/orchestrator/templates/ai-instructions/claude-skill-capture-mobile.md → src/orchestrator/templates/ai-src/skills/sungen-capture-mobile/SKILL.md} +11 -0
  212. package/{dist/orchestrator/templates/ai-instructions/claude-skill-error-mapping.md → src/orchestrator/templates/ai-src/skills/sungen-error-mapping/SKILL.md} +31 -10
  213. package/{dist/orchestrator/templates/ai-instructions/claude-skill-harness-audit.md → src/orchestrator/templates/ai-src/skills/sungen-harness-audit/SKILL.md} +5 -5
  214. package/{dist/orchestrator/templates/ai-instructions/claude-skill-locale.md → src/orchestrator/templates/ai-src/skills/sungen-locale/SKILL.md} +275 -3
  215. package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix.md → src/orchestrator/templates/ai-src/skills/sungen-selector-fix/SKILL.md} +17 -0
  216. package/{dist/orchestrator/templates/ai-instructions/claude-skill-selector-fix-mobile.md → src/orchestrator/templates/ai-src/skills/sungen-selector-fix-mobile/SKILL.md} +5 -0
  217. package/src/orchestrator/templates/{ai-instructions/claude-skill-tc-generation.md → ai-src/skills/sungen-tc-generation/SKILL.md} +5 -0
  218. package/src/orchestrator/templates/playwright.config.ts +7 -4
  219. package/dist/orchestrator/templates/ai-instructions/claude-cmd-design.md +0 -12
  220. package/dist/orchestrator/templates/ai-instructions/claude-skill-selector-fix.md +0 -347
  221. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-add-flow.md +0 -86
  222. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-add-screen.md +0 -131
  223. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-create-test.md +0 -94
  224. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-dashboard.md +0 -65
  225. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-delivery.md +0 -83
  226. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-design.md +0 -13
  227. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-feedback.md +0 -24
  228. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-locale.md +0 -70
  229. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-review.md +0 -38
  230. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-run-test.md +0 -158
  231. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mobile.md +0 -184
  232. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-harness-audit.md +0 -85
  233. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-locale.md +0 -291
  234. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix-mobile.md +0 -316
  235. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-keys.md +0 -221
  236. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +0 -617
  237. package/src/orchestrator/templates/ai-instructions/claude-cmd-design.md +0 -12
  238. package/src/orchestrator/templates/ai-instructions/claude-skill-api-design.md +0 -62
  239. package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-figma-mcp.md +0 -82
  240. package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-figma-pat.md +0 -117
  241. package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-live.md +0 -60
  242. package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-local.md +0 -38
  243. package/src/orchestrator/templates/ai-instructions/claude-skill-capture.md +0 -35
  244. package/src/orchestrator/templates/ai-instructions/claude-skill-dashboard.md +0 -121
  245. package/src/orchestrator/templates/ai-instructions/claude-skill-delivery.md +0 -141
  246. package/src/orchestrator/templates/ai-instructions/claude-skill-error-mapping.md +0 -176
  247. package/src/orchestrator/templates/ai-instructions/claude-skill-gherkin-syntax.md +0 -446
  248. package/src/orchestrator/templates/ai-instructions/claude-skill-ingest-legacy.md +0 -79
  249. package/src/orchestrator/templates/ai-instructions/claude-skill-mobile-gestures.md +0 -109
  250. package/src/orchestrator/templates/ai-instructions/claude-skill-selector-fix.md +0 -347
  251. package/src/orchestrator/templates/ai-instructions/claude-skill-tc-review.md +0 -320
  252. package/src/orchestrator/templates/ai-instructions/claude-skill-test-design-techniques.md +0 -118
  253. package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint-group-a-data-entry.md +0 -203
  254. package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint-group-b-data-ops.md +0 -179
  255. package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint-group-c-data-explore.md +0 -233
  256. package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint-group-d-display.md +0 -226
  257. package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint-group-e-identity.md +0 -177
  258. package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint.md +0 -118
  259. package/src/orchestrator/templates/ai-instructions/copilot-cmd-add-flow.md +0 -86
  260. package/src/orchestrator/templates/ai-instructions/copilot-cmd-add-screen.md +0 -131
  261. package/src/orchestrator/templates/ai-instructions/copilot-cmd-create-test.md +0 -94
  262. package/src/orchestrator/templates/ai-instructions/copilot-cmd-dashboard.md +0 -65
  263. package/src/orchestrator/templates/ai-instructions/copilot-cmd-delivery.md +0 -83
  264. package/src/orchestrator/templates/ai-instructions/copilot-cmd-design.md +0 -13
  265. package/src/orchestrator/templates/ai-instructions/copilot-cmd-feedback.md +0 -24
  266. package/src/orchestrator/templates/ai-instructions/copilot-cmd-locale.md +0 -70
  267. package/src/orchestrator/templates/ai-instructions/copilot-cmd-review.md +0 -38
  268. package/src/orchestrator/templates/ai-instructions/copilot-cmd-run-test.md +0 -158
  269. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-api-design.md +0 -62
  270. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mobile.md +0 -184
  271. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-mcp.md +0 -82
  272. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-pat.md +0 -117
  273. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-live.md +0 -60
  274. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-local.md +0 -38
  275. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture.md +0 -35
  276. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-dashboard.md +0 -121
  277. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-delivery.md +0 -141
  278. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-error-mapping.md +0 -176
  279. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-gherkin-syntax.md +0 -446
  280. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-harness-audit.md +0 -85
  281. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-ingest-legacy.md +0 -79
  282. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-locale.md +0 -291
  283. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-mobile-gestures.md +0 -109
  284. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix-mobile.md +0 -316
  285. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-keys.md +0 -221
  286. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +0 -617
  287. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-tc-review.md +0 -320
  288. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-test-design-techniques.md +0 -118
  289. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-a-data-entry.md +0 -203
  290. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-b-data-ops.md +0 -179
  291. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-c-data-explore.md +0 -233
  292. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-d-display.md +0 -226
  293. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-e-identity.md +0 -177
  294. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint.md +0 -118
  295. /package/dist/orchestrator/templates/{ai-instructions/claude-agent-challenge.md → ai-src/agents/challenge.md} +0 -0
  296. /package/dist/orchestrator/templates/{ai-instructions/claude-agent-discovery.md → ai-src/agents/discovery.md} +0 -0
  297. /package/dist/orchestrator/templates/{ai-instructions/claude-agent-generator.md → ai-src/agents/generator.md} +0 -0
  298. /package/dist/orchestrator/templates/{ai-instructions/claude-agent-reviewer.md → ai-src/agents/reviewer.md} +0 -0
  299. /package/dist/orchestrator/templates/{ai-instructions/claude-config.md → ai-src/config/claude.md} +0 -0
  300. /package/dist/orchestrator/templates/{ai-instructions/copilot-config.md → ai-src/config/copilot.md} +0 -0
  301. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-api-design.md → ai-src/skills/sungen-api-design/SKILL.md} +0 -0
  302. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-capture.md → ai-src/skills/sungen-capture/SKILL.md} +0 -0
  303. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-capture-mode-figma-mcp.md → ai-src/skills/sungen-capture/mode-figma-mcp.md} +0 -0
  304. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-capture-mode-figma-pat.md → ai-src/skills/sungen-capture/mode-figma-pat.md} +0 -0
  305. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-capture-mode-live.md → ai-src/skills/sungen-capture/mode-live.md} +0 -0
  306. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-capture-mode-local.md → ai-src/skills/sungen-capture/mode-local.md} +0 -0
  307. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-dashboard.md → ai-src/skills/sungen-dashboard/SKILL.md} +0 -0
  308. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-delivery.md → ai-src/skills/sungen-delivery/SKILL.md} +0 -0
  309. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-gherkin-syntax.md → ai-src/skills/sungen-gherkin-syntax/SKILL.md} +0 -0
  310. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-ingest-legacy.md → ai-src/skills/sungen-ingest-legacy/SKILL.md} +0 -0
  311. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-mobile-gestures.md → ai-src/skills/sungen-mobile-gestures/SKILL.md} +0 -0
  312. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-selector-keys.md → ai-src/skills/sungen-selector-keys/SKILL.md} +0 -0
  313. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-tc-review.md → ai-src/skills/sungen-tc-review/SKILL.md} +0 -0
  314. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-test-design-techniques.md → ai-src/skills/sungen-test-design-techniques/SKILL.md} +0 -0
  315. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint.md → ai-src/skills/sungen-viewpoint/SKILL.md} +0 -0
  316. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint-group-a-data-entry.md → ai-src/skills/sungen-viewpoint/group-a-data-entry.md} +0 -0
  317. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint-group-b-data-ops.md → ai-src/skills/sungen-viewpoint/group-b-data-ops.md} +0 -0
  318. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint-group-c-data-explore.md → ai-src/skills/sungen-viewpoint/group-c-data-explore.md} +0 -0
  319. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint-group-d-display.md → ai-src/skills/sungen-viewpoint/group-d-display.md} +0 -0
  320. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint-group-e-identity.md → ai-src/skills/sungen-viewpoint/group-e-identity.md} +0 -0
  321. /package/src/orchestrator/templates/{ai-instructions/claude-agent-challenge.md → ai-src/agents/challenge.md} +0 -0
  322. /package/src/orchestrator/templates/{ai-instructions/claude-agent-discovery.md → ai-src/agents/discovery.md} +0 -0
  323. /package/src/orchestrator/templates/{ai-instructions/claude-agent-generator.md → ai-src/agents/generator.md} +0 -0
  324. /package/src/orchestrator/templates/{ai-instructions/claude-agent-reviewer.md → ai-src/agents/reviewer.md} +0 -0
  325. /package/src/orchestrator/templates/{ai-instructions/claude-config.md → ai-src/config/claude.md} +0 -0
  326. /package/src/orchestrator/templates/{ai-instructions/copilot-config.md → ai-src/config/copilot.md} +0 -0
  327. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-api-design.md → src/orchestrator/templates/ai-src/skills/sungen-api-design/SKILL.md} +0 -0
  328. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture.md → src/orchestrator/templates/ai-src/skills/sungen-capture/SKILL.md} +0 -0
  329. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-mcp.md → src/orchestrator/templates/ai-src/skills/sungen-capture/mode-figma-mcp.md} +0 -0
  330. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-pat.md → src/orchestrator/templates/ai-src/skills/sungen-capture/mode-figma-pat.md} +0 -0
  331. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-live.md → src/orchestrator/templates/ai-src/skills/sungen-capture/mode-live.md} +0 -0
  332. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-local.md → src/orchestrator/templates/ai-src/skills/sungen-capture/mode-local.md} +0 -0
  333. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-dashboard.md → src/orchestrator/templates/ai-src/skills/sungen-dashboard/SKILL.md} +0 -0
  334. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-delivery.md → src/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md} +0 -0
  335. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-gherkin-syntax.md → src/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md} +0 -0
  336. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-ingest-legacy.md → src/orchestrator/templates/ai-src/skills/sungen-ingest-legacy/SKILL.md} +0 -0
  337. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-mobile-gestures.md → src/orchestrator/templates/ai-src/skills/sungen-mobile-gestures/SKILL.md} +0 -0
  338. /package/src/orchestrator/templates/{ai-instructions/claude-skill-selector-keys.md → ai-src/skills/sungen-selector-keys/SKILL.md} +0 -0
  339. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-tc-review.md → src/orchestrator/templates/ai-src/skills/sungen-tc-review/SKILL.md} +0 -0
  340. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-test-design-techniques.md → src/orchestrator/templates/ai-src/skills/sungen-test-design-techniques/SKILL.md} +0 -0
  341. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint.md → src/orchestrator/templates/ai-src/skills/sungen-viewpoint/SKILL.md} +0 -0
  342. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-a-data-entry.md → src/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-a-data-entry.md} +0 -0
  343. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-b-data-ops.md → src/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-b-data-ops.md} +0 -0
  344. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-c-data-explore.md → src/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-c-data-explore.md} +0 -0
  345. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-d-display.md → src/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-d-display.md} +0 -0
  346. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-e-identity.md → src/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-e-identity.md} +0 -0
@@ -1,41 +1,106 @@
1
1
  ---
2
2
  name: run-test
3
- description: 'Generate selectors + auth state via Playwright MCP, compile, and run Playwright tests — auto-fixes selectors on failure'
4
- argument-hint: "[screen-name] [--env <locale>]"
5
- allowed-tools: Read, Grep, Bash, Glob, Edit, Write, AskUserQuestion, mcp__playwright__browser_navigate, mcp__playwright__browser_snapshot, mcp__playwright__browser_take_screenshot, mcp__playwright__browser_wait_for, mcp__playwright__browser_evaluate, mcp__playwright__browser_run_code, mcp__playwright__browser_storage_state, mcp__playwright__browser_set_storage_state
3
+ description: "Generate selectors + auth state (Playwright MCP for web / Appium MCP for mobile), compile, and run tests — auto-fixes selectors on failure"
4
+ argument-hint: "[screen-name] [--env <locale>] [--ios|--android|--both]"
5
+ order: 40
6
+ claude-tools: "Read, Grep, Bash, Glob, Edit, Write, AskUserQuestion, mcp__playwright__browser_navigate, mcp__playwright__browser_snapshot, mcp__playwright__browser_take_screenshot, mcp__playwright__browser_wait_for, mcp__playwright__browser_evaluate, mcp__playwright__browser_run_code, mcp__playwright__browser_storage_state, mcp__playwright__browser_set_storage_state, mcp__appium-mcp__select_device, mcp__appium-mcp__appium_session_management, mcp__appium-mcp__generate_locators, mcp__appium-mcp__appium_get_page_source, mcp__appium-mcp__appium_find_element, mcp__appium-mcp__appium_gesture, mcp__appium-mcp__appium_screenshot, mcp__appium-mcp__appium_set_value"
7
+ copilot-tools: "[read, execute, edit, vscode/askQuestions, playwright/*, appium/*]"
8
+ codex-trigger: "Run when the user asks to RUN, execute, or compile tests, generate selectors.yaml, or run tests. Step 4. Do NOT use for authoring/creating new test cases."
6
9
  ---
7
-
8
10
  ## Role
9
11
 
10
- You are a **Senior Developer**. Use `sungen-selector-fix`, `sungen-selector-keys`, and `sungen-error-mapping` skills.
11
-
12
- > **Source of truth — the live page is NOT the oracle; `.feature`/`test-data`/`spec.md` are.** Auto-fix is for **selector-resolution** failures (wrong locator fix `selectors.yaml`). An **assertion-value** failure where the app contradicts the spec is a **CANDIDATE BUG report it, let it FAIL** — never loosen the rule, weaken the assertion, edit the expected value/`.feature`, or hand-edit the generated `.spec.ts` to make it pass. See `sungen-error-mapping` § "Source of truth". (A `password > 8` test that fails on 6 chars is a bug to report, not a `>= 6` edit.)
12
+ You are a **Senior Developer**.
13
+ - **Web screens/flows** → use `sungen-selector-fix`, `sungen-selector-keys`, and `sungen-error-mapping` skills (Playwright MCP + `npx playwright test`).
14
+ - **Mobile screens** (`platform: mobile` in `qa/capabilities.yaml`) → use `sungen-selector-fix-mobile`, `sungen-capture-mobile`, `sungen-mobile-gestures`, `sungen-selector-keys` (Appium MCP + `npm run test:mobile`).
15
+
16
+ ## Platform detection (do this FIRST)
17
+
18
+ Read `qa/capabilities.yaml` and check the `platform` field.
19
+
20
+ - If `platform: mobile` → switch to the **mobile path** (below).
21
+ - If `platform: web` or field absent → follow the **web path** (all steps below, unchanged).
22
+
23
+ ### Mobile path
24
+
25
+ When `platform: mobile`:
26
+
27
+ - **Selectors**: use **Appium MCP** (`select_device` → `appium_session_management(create)` → `generate_locators`), per the `sungen-selector-fix-mobile` skill. Also load `sungen-capture-mobile` and `sungen-mobile-gestures`.
28
+ - **Auth**: web Phase 0.5 (`storageState`) does not exist on mobile. When the feature has `@auth:<role>`, check `specs/.auth-mobile/<role>.json`; if missing, run the guided auth-contract builder (Phase 0.5 in `sungen-selector-fix-mobile`) BEFORE Phase 1.
29
+ - **Compile**: `[ -x ./bin/sungen.js ] && ./bin/sungen.js generate --screen <name> --framework appium || npx sungen generate --screen <name> --framework appium`
30
+ - **OS selection**: parse the target OS from `$ARGUMENTS` — `--ios`, `--android`, or `--both`
31
+ (alias: `--platform <android|ios|both>`) → set `MOBILE_PLATFORM=<value>`. Default to `android` when no flag is given.
32
+ - **Run**: WebdriverIO, not Playwright. Scope one spec with `SUNGEN_SPECS`; prefix the parsed `MOBILE_PLATFORM`:
33
+ ```bash
34
+ # Android (default — no flag, or --android)
35
+ SUNGEN_SPECS='./specs/generated/<name>/<name>.spec.ts' npm run test:mobile
36
+ # iOS only (--ios)
37
+ SUNGEN_SPECS='./specs/generated/<name>/<name>.spec.ts' MOBILE_PLATFORM=ios npm run test:mobile
38
+ # both OSes (--both)
39
+ SUNGEN_SPECS='./specs/generated/<name>/<name>.spec.ts' MOBILE_PLATFORM=both npm run test:mobile
40
+ ```
41
+ `wdio.conf.ts` auto-selects `@wdio/globals` specs and auto-starts Appium. iOS needs a booted Simulator and `IOS_BUNDLE_ID`/`IOS_UDID` env vars.
42
+ - **Results**: the wdio reporter writes `<name>-test-result.<android|ios>[.<env>].json` — one file per capability, so a both-OS run keeps both outcomes.
43
+ - **Skip** the "Playwright command guidelines" section below — it applies to web only.
44
+ - The phased waves (smoke → priority → full → regression), attempt budgets, and next-steps mirror the web flow — follow the `sungen-selector-fix-mobile` skill for the mobile equivalents.
45
+
46
+ Stop here for mobile — do not continue to the web path.
47
+
48
+ > ⛔ **Source of truth — the live page/device is NOT the oracle; `.feature`/`test-data`/`spec.md` are.** Auto-fix is for **selector-resolution** failures (wrong locator → fix `selectors.yaml`). An **assertion-value** failure where the app contradicts the spec is a **CANDIDATE BUG → report it, let it FAIL** — never loosen the rule, weaken the assertion, edit the expected value/`.feature`, or hand-edit the generated `.spec.ts` to make it pass. See `sungen-error-mapping` § "Source of truth".
49
+
50
+ > ⛔ **The `.feature` Gherkin is QA-approved and FROZEN.** During auto-fix you may write
51
+ > **only** `selectors.yaml`, `test-data.yaml` (and other `*.yaml` data), plus the **one narrow
52
+ > `.feature` edit** allowed: the **element-type token** on a `[Reference]` (e.g. `field`→`textbox`,
53
+ > `button`→`link` — selector resolution, not test logic). You must **NOT** change the Gherkin's
54
+ > content or logic: no rewriting/adding/removing steps, no `wait for` steps, no changed expected
55
+ > values, no weakened assertions. A failure that would need any of those is a **CANDIDATE BUG /
56
+ > QA finding → report it, let it FAIL** (it may be a real bug). The live page is NOT the oracle;
57
+ > never hand-edit the generated `.spec.ts` either. See `sungen-error-mapping` § "HARD RULE".
58
+ > (A `password > 8` test that fails on 6 chars is a bug to report, not a `>= 6` edit.)
13
59
 
14
60
  ## Parameters
15
61
 
16
62
  Parse from `$ARGUMENTS`:
17
63
  - **name** — screen or flow name. If missing, ask the user.
18
64
  - **`--env <locale>`** — optional. Sets `SUNGEN_ENV=<locale>` for the test run so the runtime test-data resolver merges `<name>.<locale>.yaml` over the base, and `playwright.config.ts` writes results to `<name>-test-result.<locale>.json`. Accept `--locale <locale>` as an alias.
65
+ - **`--ios`**, **`--android`**, **`--both`** (mobile only) — optional. Sets `MOBILE_PLATFORM` for the test run. Default: `android` if not specified. Parsed into `MOBILE_PLATFORM=<value>` and used in WebdriverIO test runs.
19
66
 
20
67
  If `--env` is passed but no value follows, ask the user which locale to use.
21
68
 
69
+ {{#cap parallel-subagents}}
22
70
  **`--env <locale>` pre-flight**: when `--env` is passed AND the matching overlay file doesn't exist yet (`test-data/<feature>.<locale>.yaml` missing), tests will silently fall back to base locale values — the run will execute but won't actually exercise the locale. Before kicking off Phase 0.5, check:
71
+ {{/cap}}
72
+ {{^cap parallel-subagents}}
73
+ **`--env <locale>` pre-flight**: when `--env` is passed AND the matching overlay file doesn't exist yet (`test-data/<feature>.<locale>.yaml` missing), tests will silently fall back to base locale — the run will execute but won't actually exercise the locale. Before Phase 0.5, check:
74
+ {{/cap}}
23
75
 
24
76
  ```bash
25
77
  ls qa/<screens|flows>/<name>/test-data/*.<locale>.yaml 2>/dev/null | wc -l
26
78
  ```
27
79
 
80
+ {{#cap parallel-subagents}}
28
81
  If the count is 0 → use `AskUserQuestion` to offer:
29
82
  - **Run `/sungen:locale <name> <locale>` first** (Recommended) — bootstrap the overlay before running tests
30
83
  - **Continue anyway** — run with empty overlay (tests will assert base-locale text, will likely fail on a real locale page)
84
+ {{/cap}}
85
+ {{^cap parallel-subagents}}
86
+ Count 0 → offer the user:
87
+ - **Run `/sungen-locale <name> <locale>` first** (Recommended) — bootstrap the overlay
88
+ - **Continue anyway** — tests will likely fail on a real locale page
89
+ {{/cap}}
31
90
  - **Cancel**
32
91
 
92
+ {{#cap parallel-subagents}}
33
93
  Skip this pre-flight when `--env` matches the base locale (no overlay needed in that case).
94
+ {{/cap}}
95
+ {{^cap parallel-subagents}}
96
+ Skip when `--env` matches the base locale.
97
+ {{/cap}}
34
98
 
35
99
  **Auto-detect context**: check if `qa/api/<name>/` or `qa/api/flows/<name>/` exists → **API unit mode** (below). Else if `qa/flows/<name>/` → flow mode (base path: `qa/flows/<name>/`). Else `qa/screens/<name>/` → screen mode (base path: `qa/screens/<name>/`).
36
100
 
37
101
  ## API unit mode (driver-api) — no selectors
38
102
 
103
+ {{#cap parallel-subagents}}
39
104
  If the unit is **api-first**, skip every selector/capture phase (an API test has no DOM). Instead:
40
105
 
41
106
  1. **Resolve the datasource** — ensure the `kind: api` datasource's `base_url` + auth are wired in `qa/datasources.yaml` + `.env.qa` (the `${X_URL}` key from `sungen api init`). A `production` datasource is refused unless `SUNGEN_ALLOW_PROD=1`.
@@ -49,6 +114,15 @@ If the unit is **api-first**, skip every selector/capture phase (an API test has
49
114
  - **400 "parameter missing" / body ignored** → the endpoint wants a form body, not JSON → set `encoding: form` (or `multipart`) on the catalog entry, re-`generate --area`. Don't mark the scenario `@manual`.
50
115
  - **flaky** → enforce self-cleaning flows, per-row isolation (`@cases`), `@concurrent` caps.
51
116
  5. **Integrity + trace** — `sungen script-check --area <name>` (verify the spec is a 1:1 of the Gherkin; on DRIFT re-`generate --area`, never hand-edit) and `sungen trace --area <name>` (process map + HUMAN-LOOP FOCUS). Then report + offer next steps.
117
+ {{/cap}}
118
+ {{^cap parallel-subagents}}
119
+ If the unit is **api-first**, skip every selector/capture phase (an API test has no DOM):
120
+ 1. **Resolve the datasource** — `base_url` + auth wired in `qa/datasources.yaml` + `.env.qa` (`${X_URL}` from `sungen api init`); a `production` datasource is refused unless `SUNGEN_ALLOW_PROD=1`.
121
+ 2. **Compile**: `npx sungen generate --area <name>` → `specs/generated/api/<name>/`.
122
+ 3. **Run**: `npx playwright test specs/generated/api/<name>/<name>.spec.ts`.
123
+ 4. **Auto-fix** (use `sungen-error-mapping`): 401/403 → `@hybrid`+`@auth` or `Bearer :token` header (`sungen makeauth`); base_url unresolved → set `${X_URL}`; missing param → trace `{{var}}` to test-data/a prior `@api` response; `expect.status` mismatch → reconcile against `apis.yaml` (re-`generate --area`, never hand-edit the spec); **400 "parameter missing" / body ignored → set `encoding: form` (or `multipart`) on the catalog entry, don't mark @manual**; flaky → self-clean + `@concurrent` caps.
124
+ 5. **Integrity + trace** — `sungen script-check --area <name>` (1:1; on DRIFT re-`generate --area`, never hand-edit the spec) + `sungen trace --area <name>` (process map + HUMAN-LOOP FOCUS). Report + offer next steps.
125
+ {{/cap}}
52
126
 
53
127
  ## Pre-run (phased — per `sungen-selector-fix` skill)
54
128
 
@@ -101,11 +175,17 @@ If the unit is **api-first**, skip every selector/capture phase (an API test has
101
175
  6. **Phase 2 — Priority Wave**: Run all `@high` scenarios. Fix only failures from this wave. Max 2 attempts. Shared selectors fixed here cascade to later phases.
102
176
  7. **Phase 3 — Full Run**: Run all tests. Fix only **new** failures (elements unique to `@normal`/`@low`). Max 1 attempt. Don't loop on low-priority failures.
103
177
  8. **Phase 4 — Regression**: One final full run. Report results. No more fix loops.
178
+ 9. **Phase 8 — Serial-cascade risk check** (#414): If any scenario has many steps, a skipped test may cause downstream steps to be incorrectly skipped due to the serial-cascade sensor detecting false "not reached" conditions. When you see "test skipped" messages during Phase 3–4 runs, check if the skipped scenario is a **blockers-exist** dependency in the test ledger (`sungen ledger query --screen <name>`). If the scenario had high step count and cascade fired, offer: *"Scenarios with deep steps can trigger serial-cascade skipping. Consider parallelizing this spec with `@concurrent` tags or breaking into smaller scenarios. See `sungen-selector-fix` § Phase 8."* Let the user decide whether to refactor (do not auto-apply parallelization).
179
+ {{#cap parallel-subagents}}
104
180
  9. **Integrity check & trace (always run after the final run).**
105
181
  - `sungen script-check --screen <name>` — verify the generated spec is a **1:1** of the Gherkin (every non-@manual scenario ↔ one `test()`, no drift). If it reports **DRIFT** (spec hand-edited or stale), re-run `sungen generate --screen <name>` so the spec matches the feature, then re-run — **never hand-edit the generated spec** (auto-fix must edit `selectors.yaml`, not the `.spec.ts`).
106
182
  - `sungen ledger record --screen <name> --step run --ms <elapsed>` (record this run), then `sungen trace --screen <name>` — show the process map + bottlenecks + **HUMAN-LOOP FOCUS** (the @manual scenarios the QA must verify) to the user.
107
- - **Phase gate (boundary — do NOT skip).** `sungen gate --screen <name> --phase run` (exit 2 = HALT): the run-boundary obligations (incl. automation) must be **satisfied or explicitly waived**. On **HALT**, classify per `sungen-error-mapping` § Source of truth (#387): a **selector-resolution** failure → fix `selectors.yaml` + re-run; an **assertion-vs-spec** failure → **report it as a candidate bug / leave it FAIL** (never weaken the assertion or edit the expected to pass); a genuinely-accepted gap → `sungen journey --screen <name> --waive <OB> --reason "..."`. Do **not** declare the run "done" past a HALT without a fix, a reported bug, or a reasoned waiver.
108
183
  10. **Capability-pending offer (consent-gated).** If `sungen audit --screen <name>` reports `AUTOMATION-READY-PENDING` (or the run shows `@requires:<cap>` tests skipped "requires …"), these are **automation-ready** scenarios waiting on an opt-in driver. Use `AskUserQuestion` to offer: *"N scenario(s) are automation-ready — enable `<cap>` to run them? (`sungen capability add <cap>`)"*. **Only on the user's yes** run `sungen capability add <cap>` then re-run those specs; on no, leave them skipped (they are NOT failures and NOT manual). **Never auto-install.**
184
+ {{/cap}}
185
+ {{^cap parallel-subagents}}
186
+ 9. **Integrity & trace (always run after the final run).** `sungen script-check --screen <name>` — verify the spec is a **1:1** of the Gherkin; if **DRIFT**, re-run `sungen generate --screen <name>` (never hand-edit the `.spec.ts` — auto-fix edits `selectors.yaml`). Then `sungen ledger record --screen <name> --step run --ms <elapsed>` and `sungen trace --screen <name>` to show the process map + bottlenecks + **HUMAN-LOOP FOCUS**.
187
+ 10. **Capability-pending offer (consent-gated).** If `sungen audit` reports `AUTOMATION-READY-PENDING` (or `@requires:<cap>` tests are skipped "requires …"), offer: *"N scenario(s) are automation-ready — enable `<cap>` to run them? (`sungen capability add <cap>`)"*. Only on the user's yes, run `sungen capability add <cap>` + re-run; on no, leave skipped (not failures, not manual). **Never auto-install.**
188
+ {{/cap}}
109
189
 
110
190
  ## Playwright command guidelines
111
191
 
@@ -132,7 +212,9 @@ for spec in specs/generated/<name>/*.spec.ts; do
132
212
  PLAYWRIGHT_JSON_OUTPUT_NAME="specs/generated/<name>/${base}-test-result.json" \
133
213
  npx playwright test "$spec"
134
214
  done
215
+ {{#cap parallel-subagents}}
135
216
  # → writes <basename>-test-result.vi.json for each feature
217
+ {{/cap}}
136
218
 
137
219
  # ✅ Flow
138
220
  PLAYWRIGHT_JSON_OUTPUT_NAME=specs/generated/flows/<name>/<name>-test-result.json \
@@ -143,26 +225,52 @@ PLAYWRIGHT_JSON_OUTPUT_NAME=specs/generated/flows/<name>/<name>-test-result.json
143
225
 
144
226
  ```bash
145
227
  # ❌ Wrong — --reporter flag disables the config's JSON reporter
228
+ {{#cap parallel-subagents}}
146
229
  npx playwright test specs/generated/<screen>/<screen>.spec.ts --reporter=list
230
+ {{/cap}}
231
+ {{^cap parallel-subagents}}
232
+ npx playwright test specs/generated/<name>/<name>.spec.ts --reporter=list
233
+ {{/cap}}
147
234
 
148
235
  # ❌ Wrong — no env var → writes to default test-results/results.json
149
236
  # (overwritten on every screen run, loses per-screen tracking)
237
+ {{#cap parallel-subagents}}
150
238
  npx playwright test specs/generated/<screen>/<screen>.spec.ts
239
+ {{/cap}}
240
+ {{^cap parallel-subagents}}
241
+ npx playwright test specs/generated/<name>/<name>.spec.ts
242
+ {{/cap}}
151
243
  ```
152
244
 
153
245
  If you want to filter scenarios, use `-g "<pattern>"` instead of a reporter override.
154
246
 
247
+ {{#cap parallel-subagents}}
155
248
  `sungen delivery` reads per-feature `<basename>-test-result[.env].json` files (one per feature in the screen) and writes one CSV/XLSX per feature (e.g. `home-testcases.csv` + `home-modal-testcases.csv`). When `--env <locale>` was used here, run delivery with the same locale (`/sungen:delivery <name> --env <locale>`) so it picks the matching `*-test-result.<locale>.json` files and produces `*-testcases.<locale>.csv` / `.xlsx`.
249
+ {{/cap}}
250
+ {{^cap parallel-subagents}}
251
+ `sungen delivery` reads per-feature `<basename>-test-result[.env].json` files (one per feature in the screen) and writes one CSV/XLSX per feature (e.g. `home-testcases.csv` + `home-modal-testcases.csv`). When `--env <locale>` was used here, run delivery with the same locale (`/sungen-delivery <name> --env <locale>`) so it picks the matching `*-test-result.<locale>.json` files and produces `*-testcases.<locale>.csv` / `.xlsx`.
252
+ {{/cap}}
156
253
 
157
254
  ## Next steps
158
255
 
159
256
  After showing results, use `AskUserQuestion` to offer next steps:
160
257
 
161
258
  If all tests **passed**:
259
+ {{#cap parallel-subagents}}
162
260
  - **`/sungen:create-test <screen>`** — Add more test cases (Recommended)
261
+ {{/cap}}
262
+ {{^cap parallel-subagents}}
263
+ - **`/sungen-create-test <name>`** — Add more test cases (Recommended)
264
+ {{/cap}}
163
265
  - **Done** — All tests passed, I'm finished
164
266
 
165
267
  If tests **failed** (after retries):
268
+ {{#cap parallel-subagents}}
166
269
  - **`/sungen:run-test <screen>`** — Re-run after manual fixes
167
270
  - **`/sungen:create-test <screen>`** — Revise test cases
271
+ {{/cap}}
272
+ {{^cap parallel-subagents}}
273
+ - **`/sungen-run-test <name>`** — Re-run after manual fixes
274
+ - **`/sungen-create-test <name>`** — Revise test cases
275
+ {{/cap}}
168
276
  - **Done for now** — I'll fix manually later
@@ -0,0 +1,8 @@
1
+ # AGENTS.md — sungen
2
+
3
+ This project uses **sungen** (Gherkin → Playwright test compiler). Its workflow and
4
+ reference skills are installed under `.agents/skills/sungen-*`. Codex auto-discovers them;
5
+ pick a workflow step with `/skills` or `$sungen-create-test`, or just describe the task
6
+ (e.g. "create a test for the login screen") and the matching skill triggers by description.
7
+
8
+ Workflow order: add-screen → create-test → review → run-test → delivery.
@@ -30,7 +30,12 @@ Resolve in this order:
30
30
  1. `Path:` line in the feature / `App ID` in `spec.md` → split into `appPackage` + `appActivity`.
31
31
  A dual-id Path (`<pkg>/<activity> | <iosBundleId>`) → take the part for the OS you are exploring
32
32
  (left of `|` = Android pkg/activity, right = iOS bundle id).
33
+ {{#cap parallel-subagents}}
33
34
  2. If missing → `AskUserQuestion`: *"What is the appPackage/appActivity (Android) or bundleId (iOS)?"*
35
+ {{/cap}}
36
+ {{^cap parallel-subagents}}
37
+ 2. If missing → ask the user: *"What is the appPackage/appActivity (Android) or bundleId (iOS)?"*
38
+ {{/cap}}
34
39
  3. **Navigation recipe** — read the feature's `Background:` (the in-app web-path analog). Line 1
35
40
  `Given User is on [Home] screen` is the launcher/landing screen the app opens on; each following
36
41
  `When/And User tap [...]` (or gesture) is one hop toward the target screen. You will **replay**
@@ -80,8 +85,14 @@ After the LAST step you are on the target screen — capture HERE (steps 5–6).
80
85
  screen.** Screenshot where you are and report: *"recipe step N: [Label] not found — fix the
81
86
  Background nav path."* Fail loud (run-test would fail at the same step anyway).
82
87
  - **No recipe yet** (guided-stub Background, but the target is NOT the launcher) ⇒ drive to the
88
+ {{#cap parallel-subagents}}
83
89
  screen interactively off the live tree (if unsure which control leads there, `AskUserQuestion`),
84
90
  then **report the exact nav steps you took** so create-test/add-screen can write them into the
91
+ {{/cap}}
92
+ {{^cap parallel-subagents}}
93
+ screen interactively off the live tree (if unsure which control leads there, ask the user), then
94
+ **report the exact nav steps you took** so create-test/add-screen can write them into the
95
+ {{/cap}}
85
96
  Background. Do **not** edit the `.feature` yourself — Gherkin authorship stays with those commands.
86
97
 
87
98
  ### 5. Capture the locator tree (primary AI context)
@@ -21,14 +21,35 @@ Then choose the fix from the patterns below.
21
21
 
22
22
  ---
23
23
 
24
+ ## ⛔⛔ HARD RULE — the `.feature` (Gherkin) is FROZEN during run-test
25
+
26
+ The Gherkin test cases have been **reviewed and approved by QA**. During the run-test auto-fix
27
+ loop you **MUST NOT change their content or logic**. Concretely, you may write only:
28
+
29
+ - ✅ `selectors.yaml` — locators (the normal auto-fix)
30
+ - ✅ `test-data.yaml` and other `*.yaml` data files
31
+ - ✅ **ONE narrow `.feature` edit:** the **element-type token** on a `[Reference]`
32
+ (e.g. `[Email] field` → `[Email] textbox`, `button` → `link`). This is selector resolution,
33
+ not test logic. NEVER touch the reference name, the step keyword, the expected value, the
34
+ assertion, or the scenario structure.
35
+
36
+ **Forbidden in `.feature` (all of these are content/logic — report, don't edit):**
37
+ adding/removing/rewriting steps, adding `wait for` steps, changing expected values or rules,
38
+ weakening assertions, "fixing" an unknown step pattern, adding table-scope steps. If a failure
39
+ needs any of these, it is a **finding for QA** — surface it in the run summary and let the test
40
+ **FAIL**. A failing test may be a **real bug**; do not edit the QA-approved Gherkin to make it pass.
41
+
24
42
  ## ⛔ Source of truth — classify EVERY failure before you "fix" it
25
43
 
26
44
  `.feature` + `test-data.yaml` + `spec.md` are the **oracle**. The **live page is NOT** — it may be the thing that's broken. A failing test is not automatically a test to "make pass". Classify first:
27
45
 
28
46
  - **Selector-resolution failure** (element not found / wrong locator / strict-mode / wrong element type) → the test looked in the wrong place. **Fix the locator in `selectors.yaml`** (re-snapshot, copy the exact accessible name). Legit auto-fix.
29
- - **Assertion-value failure** (element FOUND, but observed value ≠ expected) → STOP and ask: *is the TEST wrong, or is the APP wrong?*
30
- - Expected value/rule is wrong **relative to `spec.md`** (typo, stale test-data) → fix `test-data.yaml`/`.feature` so it matches the **spec** never the live page.
31
- - App behaviour contradicts `spec.md` (spec says X, app shows Y) **CANDIDATE BUG**. **Report it** (let the test FAIL / surface to the QA in the run summary). **NEVER** change the expected value, loosen the rule, weaken the assertion (`toHaveText`→`toContainText` to dodge a mismatch), edit `.feature`, or edit the generated `.spec.ts` to make it pass.
47
+ - **Assertion-value failure** (element FOUND, but observed value ≠ expected) → STOP and ask the decisive question: ***does `spec.md` PIN this exact value?***
48
+ - **Spec PINS the value and live contradicts it** (spec mandates X, app shows Y) → **CANDIDATE BUG**. **Report it** (let the test FAIL). **NEVER** change the expected, loosen the rule, weaken the assertion (`toHaveText`→`toContainText`), shrink a boundary (`>8`→`>=6`), or edit `.feature`/`.spec.ts` to pass.
49
+ - **Spec does NOT pin the exact string, and your expected was your own transcription/guess** (whitespace, casing, punctuation, or a label the spec only *describes* narratively) while the live value is the legitimate, spec-consistent truth **accuracy fix (allowed):** set `test-data.yaml`/`.feature` to the **real** value — *not* weakening, the claim is unchanged. (e.g. hero `<h1>` renders `AutomationExercise`; spec says "the Automation Exercise logo" but pins no string → fix `hero_title` to `"AutomationExercise"`, don't leave it failing.)
50
+ - Expected is wrong **relative to a value `spec.md` DOES state** (typo vs the spec) → fix to the **spec** value, never the live page.
51
+
52
+ > **Accuracy fix vs weakening — the line:** an *accuracy fix* matches a spec-consistent reality the spec didn't pin (cosmetic, meaning preserved). *Weakening* changes the **oracle** to dodge a real discrepancy. **If the spec pins it, or you're unsure → treat as a bug and leave it failing.**
32
53
 
33
54
  > **Cardinal sin (do NOT do this):** a `password > 8 chars` rule fails on a 6-char input → "fix" it to `>= 6` so the test passes. The logic is now meaningless. A failing assertion is a **finding**, not a chore.
34
55
 
@@ -44,7 +65,7 @@ Then choose the fix from the patterns below.
44
65
  2. **Element not found** — wrong name/type/value in selectors.yaml. Re-snapshot, copy exact name
45
66
  3. **Multiple matches** — add `nth`, `exact: true`, or `scope` to narrow down
46
67
  4. **Wrong assertion** — `toHaveText` vs `toHaveValue` mismatch, wrong expected data
47
- 5. **Timing** — SPA not loaded, async content. Add `wait for` step in .feature
68
+ 5. **Timing** — SPA not loaded, async content. Prefer tuning waits/caching in `specs/base.ts` (see Performance section). Do NOT add a `wait for` step to `.feature` — if the test genuinely needs a wait step, **report it** as a Gherkin gap for QA; the auto-fix loop must not edit the approved Gherkin.
48
69
 
49
70
  ---
50
71
 
@@ -66,7 +87,7 @@ Then choose the fix from the patterns below.
66
87
 
67
88
  | Error | Diagnosis | Fix (only if the TEST was wrong per spec) |
68
89
  |---|---|---|
69
- | toHaveText mismatch | Expected text differs from actual | If the test's expected was wrong per spec → fix value in test-data. If element is input type → change Gherkin type to `field`/`textarea` (triggers `toHaveValue`). If the app value contradicts spec → **report as bug**. |
90
+ | toHaveText mismatch | Expected text differs from actual | If the test's expected was wrong per spec → fix value in **test-data** (not `.feature`). If element is an input → change only the **element-type token** in `.feature` (e.g. `field`/`textarea`, the allowed selector-type edit). If the app value contradicts spec → **report as bug, let it FAIL**. |
70
91
  | toHaveValue mismatch | Expected value differs from actual | Fix value in test-data |
71
92
  | toContainText mismatch | Partial text not found | Fix expected partial text in test-data |
72
93
  | toBeVisible timeout | Element exists but hidden, or name wrong | Check: is element conditionally visible? Wrong name? Inside dialog? |
@@ -79,7 +100,7 @@ Sungen picks assertion based on element type:
79
100
  - **Text** (everything else: `message`, `heading`, `label`, `row`) → `toHaveText()`
80
101
  - **Partial** (`contains` keyword) → `toContainText()`
81
102
 
82
- If `toHaveText` fails on an input → the Gherkin step has wrong target type. Fix: change type in `.feature`.
103
+ If `toHaveText` fails on an input → the Gherkin step has the wrong target type. Fix: change **only the element-type token** in `.feature` (e.g. `[Email] message` → `[Email] field`). This is the one permitted `.feature` edit — do not change the reference name, value, or anything else.
83
104
 
84
105
  ---
85
106
 
@@ -87,7 +108,7 @@ If `toHaveText` fails on an input → the Gherkin step has wrong target type. Fi
87
108
 
88
109
  | Error | Diagnosis | Fix |
89
110
  |---|---|---|
90
- | `tableRow is not defined` | Column assertion without preceding row scope step | Add `User see [Ref] row in [Table] table with {{v}}` before `User see [Col] column with {{v}}` |
111
+ | `tableRow is not defined` | Column assertion without preceding row scope step | The Gherkin is missing a row-scope step this is a **QA authoring gap report it, let it FAIL**. Do NOT add the step during run-test (the Gherkin is frozen). |
91
112
  | `toHaveText` on cell fails (with columns) | Wrong column index in `columns` config | Re-count columns in snapshot (0-indexed). Fix `index` in selectors.yaml |
92
113
  | `toBeVisible` on cell fails (no columns) | `filter({ hasText })` didn't match | Check exact cell text in snapshot. Fix value in test-data |
93
114
  | Row filter matches 0 rows | Filter text doesn't match any row content | Re-snapshot → find actual row text. Fix filter value in test-data |
@@ -103,7 +124,7 @@ If `toHaveText` fails on an input → the Gherkin step has wrong target type. Fi
103
124
  | Redirect to login page | Auth expired. Ask user to log in manually via MCP browser |
104
125
  | `storageState` file not found | Ask user to log in manually via MCP browser, then save storage state |
105
126
  | Most tests timeout on first step | Auth expired — ask user to re-authenticate via MCP browser |
106
- | Page shows home instead of target | SPA + expired auth. Re-authenticate + add `wait for` step |
127
+ | Page shows home instead of target | SPA + expired auth. Re-authenticate via MCP browser. (If a wait is genuinely needed, tune `specs/base.ts` — do NOT add a `wait for` step to the frozen `.feature`.) |
107
128
 
108
129
  **Never use `sungen makeauth`.** Always let the user log in manually via the MCP browser.
109
130
 
@@ -113,7 +134,7 @@ If `toHaveText` fails on an input → the Gherkin step has wrong target type. Fi
113
134
 
114
135
  | Error | Fix |
115
136
  |---|---|
116
- | Unknown step pattern | Rewrite step to match `sungen-gherkin-syntax` patterns |
137
+ | Unknown step pattern | The Gherkin uses a step the compiler doesn't recognize — a **QA authoring issue → report it, let it FAIL**. Do NOT rewrite the step during run-test (the Gherkin is frozen; fix belongs in create-test/review). |
117
138
  | Missing selector | Add key to `selectors.yaml` |
118
139
  | Missing variable | Add key to `test-data.yaml` |
119
140
  | Invalid selector type | Use: role/testid/placeholder/label/text/locator/page/upload/frame |
@@ -124,7 +145,7 @@ If `toHaveText` fails on an input → the Gherkin step has wrong target type. Fi
124
145
 
125
146
  | Error | Diagnosis | Fix |
126
147
  |---|---|---|
127
- | Navigation timeout between screens | Cross-screen transition takes too long or URL mismatch | Add explicit `wait for page` step between screen transitions in `.feature`. Verify target URL path |
148
+ | Navigation timeout between screens | Cross-screen transition takes too long or URL mismatch | Verify the target URL path; tune navigation waits in `specs/base.ts`. Do NOT add a `wait for page` step to `.feature` if the flow genuinely needs one, **report it** as a Gherkin gap for QA. |
128
149
  | Selector `"screen:element"` not found | Namespace key missing or wrong format | Ensure colon-namespaced key in `selectors.yaml` is **quoted**: `"login:submit":`. Check screen prefix matches `[Screen:Element]` ref in Gherkin |
129
150
  | Test data `screen.key` undefined | Phase namespace mismatch | Verify `test-data.yaml` uses dot-namespaced keys: `login.email`, `submission.nominee`. Keys must match `{{screen.key}}` refs in `.feature` |
130
151
  | State lost between screens | Auth/session expired during multi-screen flow | Ensure all screens in the flow share the same `@auth:role` tag. Check if the app invalidates sessions on navigation |
@@ -71,15 +71,15 @@ Use these when repairing GATE/DEPTH findings for the hard viewpoints (cart/detai
71
71
  ## Discovery / fallback tree (when input is limited)
72
72
 
73
73
  ```
74
- spec.md đủ tốt? → YES: Spec-first
74
+ spec.md good enough? → YES: Spec-first
75
75
  │ NO
76
- source code có? → YES: Source-first (mine behavior từ code)
76
+ source code available? → YES: Source-first (mine behavior from code)
77
77
  │ NO
78
- testcase tương tự?→ YES: History-first
78
+ similar legacy testcases? → YES: History-first
79
79
  │ NO
80
- domain rủi ro+defect?→ YES: Defect-first
80
+ risky domain + defects? → YES: Defect-first
81
81
  │ NO
82
- hỏi QA; QA chưa phản hồi → OUTPUT kèm ASSUMPTION LIST ràng (không stall)
82
+ ask QA; if QA hasn't responded → OUTPUT with an explicit ASSUMPTION LIST (do not stall)
83
83
  ```
84
84
 
85
85
  See `docs/orchestration-spec.md` for the full flow and `docs/spec/sungen_refactor_spec.md` for the design rationale.