@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
@@ -6,6 +6,7 @@
6
6
  import * as fs from 'fs';
7
7
  import * as path from 'path';
8
8
  import { chromium } from '@playwright/test';
9
+ import { readCapabilities } from '../harness/capability';
9
10
 
10
11
  export interface ScreenOptions {
11
12
  name: string;
@@ -13,6 +14,20 @@ export interface ScreenOptions {
13
14
  capture?: boolean;
14
15
  feature?: string;
15
16
  description?: string;
17
+ /**
18
+ * Optional per-OS tag emitter: 'android' | 'ios'. When set, the feature stub
19
+ * gets @platform:android or @platform:ios for OS-specific screens. Does NOT
20
+ * affect directory routing (always qa/screens/). Mobile project is detected via
21
+ * qa/capabilities.yaml, not this flag.
22
+ */
23
+ platform?: string;
24
+ /**
25
+ * Mobile navigation recipe (the in-app web-path analog). A `>`-separated list of nav steps
26
+ * that take the app from launch to THIS screen, e.g. "tap [My Page] tab > tap [Settings] row".
27
+ * Scaffolded into the feature's Background after the `Given User is on [Home] screen` anchor.
28
+ * Mobile-only; ignored (with a warning) for web projects. Omit when this IS the launcher screen.
29
+ */
30
+ reach?: string;
16
31
  }
17
32
 
18
33
  export class ScreenManager {
@@ -31,15 +46,31 @@ export class ScreenManager {
31
46
  // Validate screen name
32
47
  this.validateScreenName(options.name);
33
48
 
49
+ // Detect project platform from qa/capabilities.yaml (single source of truth)
50
+ const caps = readCapabilities(this.cwd);
51
+ const isMobile = caps.platform === 'mobile';
52
+
53
+ // --reach is mobile-only; warn and drop when the project is web
54
+ if (options.reach && !isMobile) {
55
+ console.warn(
56
+ `Warning: --reach is a mobile navigation recipe and is ignored for web projects ` +
57
+ `(web screens are addressed by their --path URL). Dropping it.`
58
+ );
59
+ options = { ...options, reach: undefined };
60
+ }
61
+
34
62
  // Normalize screen name for directory
35
63
  const screenName = this.normalizeScreenName(options.name);
64
+ // Always use qa/screens/ regardless of platform (1-platform model — no qa/mobile/ tree)
36
65
  const screenDir = path.join(this.screensDir, screenName);
37
66
 
38
- // Derive filename: --feature flag creates "<screen>-<feature>" name
67
+ // Derive filename: --feature flag creates "<screen>-<feature>" name.
68
+ // For mobile, `path` is the app entry (pkg/Activity), NOT a URL — never derive
69
+ // the filename from it; use the screen name instead.
39
70
  let filename: string;
40
71
  if (options.feature) {
41
72
  filename = `${screenName}-${this.normalizeScreenName(options.feature)}`;
42
- } else if (options.path) {
73
+ } else if (options.path && !isMobile) {
43
74
  filename = this.extractFilenameFromPath(options.path);
44
75
  } else {
45
76
  filename = screenName;
@@ -92,18 +123,25 @@ export class ScreenManager {
92
123
  const featureContent = this.generateFeatureTemplate(options, filename);
93
124
  fs.writeFileSync(featurePath, featureContent, 'utf-8');
94
125
 
95
- // Generate empty selector YAML (with page entry)
126
+ // Generate empty selector YAML. Web gets a `page` entry (the route); mobile
127
+ // selectors come from Appium MCP at run-test, so it's just a header comment.
96
128
  if (!fs.existsSync(selectorPath)) {
97
- const pagePath = options.path || `/${screenName}`;
98
- fs.writeFileSync(selectorPath, [
99
- `# ${options.name} Screen Selectors`,
100
- `# Fill via AI or manually`,
101
- ``,
102
- `${screenName}:`,
103
- ` type: 'page'`,
104
- ` value: '${pagePath}'`,
105
- ``,
106
- ].join('\n'), 'utf-8');
129
+ const selectorLines = isMobile
130
+ ? [
131
+ `# ${options.name} Screen Selectors (mobile)`,
132
+ `# Generated at /sungen:run-test via Appium MCP — accessibility-id preferred.`,
133
+ ``,
134
+ ]
135
+ : [
136
+ `# ${options.name} Screen Selectors`,
137
+ `# Fill via AI or manually`,
138
+ ``,
139
+ `${screenName}:`,
140
+ ` type: 'page'`,
141
+ ` value: '${options.path || `/${screenName}`}'`,
142
+ ``,
143
+ ];
144
+ fs.writeFileSync(selectorPath, selectorLines.join('\n'), 'utf-8');
107
145
  }
108
146
 
109
147
  // Generate empty test-data YAML
@@ -186,9 +224,9 @@ export class ScreenManager {
186
224
  ].join('\n'), 'utf-8');
187
225
  }
188
226
 
189
- // Auto-screenshot: capture page only when --capture is set (requires --path)
227
+ // Auto-screenshot: capture page only when --capture is set and not mobile (requires --path)
190
228
  // Use filename (not screenName) so each feature gets its own screenshots
191
- if (options.capture && options.path) {
229
+ if (options.capture && options.path && !isMobile) {
192
230
  await this.captureScreenshot(options.path, requirementsUiDir, filename);
193
231
  }
194
232
 
@@ -204,12 +242,21 @@ export class ScreenManager {
204
242
  }
205
243
  console.log('');
206
244
 
207
- console.log('Next steps:');
208
- console.log(` 1. Fill requirements/spec.md with screen spec (fields, validation, business rules)`);
209
- console.log(` Optionally add UI designs to requirements/ui/ (screenshots, mockups)`);
210
- console.log(` 2. Generate test cases: /sungen:create-test ${screenName} (or /sungen-create-test)`);
211
- console.log(` 3. Compile: sungen generate --screen ${screenName}`);
212
- console.log(` 4. Run: npx playwright test\n`);
245
+ if (isMobile) {
246
+ console.log('Next steps:');
247
+ console.log(` 1. Fill requirements/spec.md with screen spec (elements, actions, business rules)`);
248
+ console.log(` Use /sungen:add-screen with sungen-capture-mobile to scan via Appium MCP`);
249
+ console.log(` 2. Generate test cases: /sungen:create-test ${screenName}`);
250
+ console.log(` 3. Compile: sungen generate --screen ${screenName} --framework appium`);
251
+ console.log(` 4. Run: npm run test:mobile\n`);
252
+ } else {
253
+ console.log('Next steps:');
254
+ console.log(` 1. Fill requirements/spec.md with screen spec (fields, validation, business rules)`);
255
+ console.log(` Optionally add UI designs to requirements/ui/ (screenshots, mockups)`);
256
+ console.log(` 2. Generate test cases: /sungen:create-test ${screenName} (or /sungen-create-test)`);
257
+ console.log(` 3. Compile: sungen generate --screen ${screenName}`);
258
+ console.log(` 4. Run: npx playwright test\n`);
259
+ }
213
260
  }
214
261
 
215
262
  /**
@@ -291,6 +338,57 @@ export class ScreenManager {
291
338
  }
292
339
 
293
340
  private generateSpecTemplate(options: ScreenOptions, screenName: string): string {
341
+ const caps = readCapabilities(this.cwd);
342
+ const isMobile = caps.platform === 'mobile';
343
+
344
+ if (isMobile) {
345
+ const appEntry = options.path || this.readWdioAppEntry() || '<appPackage>';
346
+ return `# ${options.name} Screen Specification
347
+
348
+ ## Overview
349
+ - **App Entry:** ${appEntry}
350
+ - **Platform:** mobile (Android + iOS)
351
+ - **Auth Required:** no
352
+ - **Reach:** ${options.reach || '<!-- nav recipe: how to reach this screen from app launch, e.g. "tap [My Page] tab > tap [Settings] row" -->'}
353
+
354
+ ## Sections
355
+
356
+ ### Section: [Section Name]
357
+ - **Type:** list | card | form | modal | navigation | tab-bar
358
+ - **Description:** [Brief description of this section]
359
+
360
+ #### Elements
361
+ | Element | Type | Identifier | Notes |
362
+ |---------|------|------------|-------|
363
+ | [Element Name] | button | accessibility-id | [tap target, e.g., submits form] |
364
+
365
+ #### Actions
366
+ | Action | Element | Behavior |
367
+ |--------|---------|----------|
368
+ | [Action Name] | button | [What happens on tap] |
369
+
370
+ #### States
371
+ | State | Condition | Visual |
372
+ |-------|-----------|--------|
373
+ | Default | Screen load | [Default appearance] |
374
+ | Loading | After tap | [Loading indicator] |
375
+ | Error | Action fails | [Error appearance] |
376
+ | Success | Action complete | [Success behavior] |
377
+
378
+ ## Business Rules
379
+ <!-- Rules that affect test logic: limits, permissions, conditions -->
380
+ - [Rule 1]
381
+
382
+ ## Accessibility
383
+ <!-- Accessibility IDs, content-desc, aria-labels -->
384
+ - Accessibility IDs: [element: id]
385
+
386
+ ## Notes
387
+ <!-- Edge cases, known issues, environment-specific behavior -->
388
+ - [Note 1]
389
+ `;
390
+ }
391
+
294
392
  const pagePath = options.path || `/${screenName}`;
295
393
  return `# ${options.name} Screen Specification
296
394
 
@@ -348,9 +446,48 @@ export class ScreenManager {
348
446
 
349
447
  private generateFeatureTemplate(options: ScreenOptions, filename: string): string {
350
448
  const screenName = this.normalizeScreenName(options.name);
351
- const featurePath = options.path || `/${screenName}`;
352
449
  const description = options.description || `interact with the ${options.name} screen`;
353
450
 
451
+ const caps = readCapabilities(this.cwd);
452
+ const isMobile = caps.platform === 'mobile';
453
+
454
+ if (isMobile) {
455
+ // Determine platform tag: --platform android/ios emits a per-OS tag for OS-specific screens.
456
+ // Default (no --platform) = cross-platform, no OS-specific tag.
457
+ const platformTag =
458
+ options.platform === 'android' ? '@platform:android'
459
+ : options.platform === 'ios' ? '@platform:ios'
460
+ : '@platform:mobile';
461
+
462
+ // App entry: explicit --path → wdio.conf.ts default → placeholder.
463
+ const appEntry = options.path || this.readWdioAppEntry() || '<appPackage>';
464
+
465
+ // Navigation recipe (Background block)
466
+ const background = this.buildMobileBackground(options.reach);
467
+
468
+ return `${platformTag}
469
+ Feature: ${options.name} Screen
470
+
471
+ As a user
472
+ I want to ${description}
473
+ So that I can accomplish my tasks
474
+ Path: ${appEntry}
475
+
476
+ # Mobile (Appium) — selectors generated at /sungen:run-test via Appium MCP.
477
+ # Use accessibility-id selectors; assert text content with \`header with {{var}}\`
478
+ # (compiles to content-desc/label via toHaveAttribute). See sungen-mobile-gestures
479
+ # for swipe/long-press/scroll steps.
480
+
481
+ ${background}
482
+ @high
483
+ Scenario: Sample scenario for ${options.name}
484
+ When User tap [element]
485
+ Then User see [result] header with {{result_text}}
486
+ `;
487
+ }
488
+
489
+ // Web feature stub
490
+ const featurePath = options.path || `/${screenName}`;
354
491
  return `Feature: ${options.name} Screen
355
492
 
356
493
  As a user
@@ -367,4 +504,82 @@ export class ScreenManager {
367
504
  Then User see [result] text with {{success}}
368
505
  `;
369
506
  }
507
+
508
+ /**
509
+ * Read the default app entry (`<appPackage>/<appActivity>`) from the project's wdio.conf.ts so a
510
+ * mobile `add-screen` without `--path` scaffolds a real, runnable `Path:` matching the configured
511
+ * app instead of a `<placeholder>`. Supports both the env-default form
512
+ * (`APP_PACKAGE = process.env.APP_PACKAGE || '…'`) and the literal capability form
513
+ * (`'appium:appPackage': '…'`). Returns null when wdio.conf.ts is absent or unparseable.
514
+ */
515
+ private readWdioAppEntry(): string | null {
516
+ const wdioPath = path.join(this.cwd, 'wdio.conf.ts');
517
+ if (!fs.existsSync(wdioPath)) return null;
518
+ let src: string;
519
+ try {
520
+ src = fs.readFileSync(wdioPath, 'utf-8');
521
+ } catch {
522
+ return null;
523
+ }
524
+ const pick = (re: RegExp): string | undefined => src.match(re)?.[1]?.trim();
525
+ const pkg =
526
+ pick(/APP_PACKAGE\s*=\s*process\.env\.APP_PACKAGE\s*\|\|\s*['"]([^'"]+)['"]/) ??
527
+ pick(/['"]appium:appPackage['"]\s*:\s*['"]([^'"]+)['"]/);
528
+ if (!pkg) return null;
529
+ const activity =
530
+ pick(/APP_ACTIVITY\s*=\s*process\.env\.APP_ACTIVITY\s*\|\|\s*['"]([^'"]+)['"]/) ??
531
+ pick(/['"]appium:appActivity['"]\s*:\s*['"]([^'"]+)['"]/);
532
+ return activity ? `${pkg}/${activity}` : pkg;
533
+ }
534
+
535
+ /**
536
+ * Build the Background block for a mobile screen — the navigation recipe (in-app web-path
537
+ * analog). Line 1 is the `Given User is on [Home] screen` launcher/landing anchor; each step
538
+ * from `--reach` (a `>`-separated list) becomes a `When/And User <step>` nav line, taking the
539
+ * app from launch to THIS screen. capture-mobile replays these to land on the target screen
540
+ * before scanning. With no recipe, emit a guided stub (anchor + commented placeholder).
541
+ */
542
+ private buildMobileBackground(reach?: string): string {
543
+ // Normalize one nav segment to a bare step body ("tap [My Page] tab"): drop any leading
544
+ // Gherkin keyword and a leading "User " so we can re-emit "When/And User <body>" cleanly.
545
+ const normalizeStep = (raw: string): string =>
546
+ raw
547
+ .trim()
548
+ .replace(/^(given|when|and|then|but)\s+/i, '')
549
+ .replace(/^user\s+/i, '')
550
+ .trim();
551
+
552
+ const steps = (reach || '')
553
+ .split('>')
554
+ .map(normalizeStep)
555
+ .filter(Boolean);
556
+
557
+ if (steps.length === 0) {
558
+ // No recipe → guided stub. Keep the anchor (correct as-is when this IS the launcher
559
+ // screen); the comments tell create-test / capture-mobile how to fill the nav steps.
560
+ return [
561
+ ' Background:',
562
+ ' # Navigation recipe — how to reach THIS screen from app launch (the in-app',
563
+ ' # web-path analog). Line 1 is the launcher/landing screen the app opens on;',
564
+ ' # add a `When/And User tap [...]` per hop to reach this screen. capture-mobile',
565
+ ' # replays these so Appium lands here (not the launcher) before scanning. Leave',
566
+ ' # only the anchor if this IS the launcher screen. Prefill with',
567
+ ' # --reach "tap [Tab] > tap [Row]" at add-screen time.',
568
+ ' Given User is on [Home] screen',
569
+ ' # When User tap [<tab or button that leads to this screen>]',
570
+ '',
571
+ ].join('\n');
572
+ }
573
+
574
+ const navLines = steps.map(
575
+ (body, i) => ` ${i === 0 ? 'When' : 'And'} User ${body}`,
576
+ );
577
+ return [
578
+ ' Background:',
579
+ ' # Navigation recipe — replayed by capture-mobile to land on this screen before scanning.',
580
+ ' Given User is on [Home] screen',
581
+ ...navLines,
582
+ '',
583
+ ].join('\n');
584
+ }
370
585
  }
@@ -0,0 +1,58 @@
1
+ # ai-src — the SINGLE SOURCE for sungen's AI assistant assets
2
+
3
+ **Author skills, commands, and config HERE. Nothing else.** Do NOT create or edit a
4
+ `templates/ai-instructions/` folder — that per-assistant layout is retired. (A CI guardrail
5
+ in `golden-skills.test.ts` fails the build if it reappears.)
6
+
7
+ ## Layout
8
+ ```
9
+ ai-src/
10
+ ├── skills/<name>/SKILL.md # one skill (+ optional aux .md fragments, e.g. viewpoint groups)
11
+ ├── commands/<name>.md # one workflow command (structured frontmatter, see below)
12
+ └── config/{claude,copilot,codex}.md # per-assistant config (CLAUDE.md / copilot-instructions / AGENTS.md)
13
+ ```
14
+
15
+ ## How it ships
16
+ `sungen init` / `sungen update` call `ai-skills/build.ts` → `buildOutputs(adapters)`, which
17
+ renders each source file per assistant:
18
+
19
+ | Assistant | skill output | command output | config output |
20
+ |-----------|--------------|----------------|---------------|
21
+ | claude | `.claude/skills/<n>/SKILL.md` | `.claude/commands/sungen/<n>.md` | `CLAUDE.md` |
22
+ | copilot | `.github/skills/<n>/SKILL.md` | `.github/prompts/sungen-<n>.prompt.md` | `.github/copilot-instructions.md` |
23
+ | codex | `.agents/skills/<n>/SKILL.md` | `.agents/skills/sungen-<n>/SKILL.md` (commands become skills) | `AGENTS.md` |
24
+
25
+ `--assistant claude|copilot|codex|all` (repeatable, default `claude`) selects targets.
26
+
27
+ ## Per-assistant deltas — cap-fences
28
+ When one assistant needs different wording (e.g. Claude has parallel sub-agents, Copilot is
29
+ sequential), fence the delta. Claude is the **canonical** content; other adapters strip down.
30
+
31
+ ```
32
+ {{#cap parallel-subagents}}
33
+ ...kept only for adapters that HAVE the cap (claude)...
34
+ {{/cap}}
35
+ {{^cap parallel-subagents}}
36
+ ...kept only for adapters that LACK it (copilot, codex)...
37
+ {{/cap}}
38
+ ```
39
+ Valid cap tags live in `ai-skills/cap-stripper.ts` (`VALID_CAPS`). An unknown tag or an
40
+ unclosed fence FAILS the build — never a silent drop.
41
+
42
+ ## Command frontmatter
43
+ ```
44
+ ---
45
+ name: create-test # omit if Claude command had no name line
46
+ description: "<canonical Claude description>"
47
+ argument-hint: [screen-name] # verbatim Claude form
48
+ order: 20 # workflow step (advisory; parallel paths may share)
49
+ claude-tools: "Read, Grep, ..." # Claude allowed-tools (verbatim)
50
+ copilot-tools: "[vscode, ...]" # Copilot tools array
51
+ codex-trigger: "Run when the user asks to ..." # explicit Codex trigger (disambiguation)
52
+ ---
53
+ <body, may contain cap-fences>
54
+ ```
55
+
56
+ ## After editing
57
+ Run `npm test` (or `tsx src/orchestrator/ai-skills/golden-skills.test.ts`). If you
58
+ intentionally changed output, re-freeze fixtures: add `--update`, then review the diff.
@@ -1,36 +1,65 @@
1
1
  ---
2
2
  name: add-flow
3
- description: 'Add a new Sungen flow — scaffolds directories for E2E cross-screen testing, helps fill spec.md, and can capture visuals via the capture skills'
3
+ description: "Add a new Sungen flow — scaffolds directories for E2E cross-screen testing, helps fill spec.md, and can capture visuals via the capture skills"
4
4
  argument-hint: [flow-name] [--path <start-url>]
5
- allowed-tools: Read, Grep, Bash, Glob, Edit, Write, AskUserQuestion, mcp__playwright__browser_navigate, mcp__playwright__browser_take_screenshot, mcp__playwright__browser_snapshot, mcp__figma__get_design_context, mcp__figma__get_variable_defs, mcp__figma__get_screenshot
5
+ order: 10
6
+ claude-tools: "Read, Grep, Bash, Glob, Edit, Write, AskUserQuestion, mcp__playwright__browser_navigate, mcp__playwright__browser_take_screenshot, mcp__playwright__browser_snapshot, mcp__figma__get_design_context, mcp__figma__get_variable_defs, mcp__figma__get_screenshot"
7
+ copilot-tools: "[vscode, execute, read, agent, edit, search, todo]"
8
+ codex-trigger: "Run when the user asks to add a NEW cross-screen end-to-end flow. Step 1 (flow variant). Do NOT use for a single screen, creating test cases, or running tests."
6
9
  ---
10
+ {{^cap parallel-subagents}}
11
+ **Input**: Flow name and optional starting URL (e.g., `/sungen-add-flow award-submission --path /login`).
7
12
 
13
+ {{/cap}}
8
14
  You are adding a new Sungen flow for E2E cross-screen test generation.
9
15
 
10
16
  ## Parameters
11
17
 
18
+ {{#cap parallel-subagents}}
12
19
  Parse from `$ARGUMENTS`:
13
20
  - **flow** — flow name (e.g., `award-submission`, `user-onboarding`)
21
+ {{/cap}}
22
+ {{^cap parallel-subagents}}
23
+ - **flow** — ${input:flow:flow name (e.g., award-submission, user-onboarding)}
24
+ {{/cap}}
14
25
  - **--path \<url\>** — starting page URL path (default: `/login`)
15
26
  - **--description \<text\>** — flow description (optional)
16
27
 
28
+ {{#cap parallel-subagents}}
17
29
  If **flow** is missing, ask: "What is the flow name? (e.g., `award-submission`, `user-onboarding`)"
18
30
  If **path** is missing, ask: "What is the starting URL path? (e.g., `/login`)"
19
31
 
32
+ {{/cap}}
20
33
  ## Steps
21
34
 
22
35
  ### 1. Scaffold the flow
23
36
 
37
+ {{^cap parallel-subagents}}
38
+ Run with #tool:terminal:
39
+ {{/cap}}
24
40
  ```bash
41
+ {{#cap parallel-subagents}}
25
42
  sungen add-flow --flow <name> --path <path>
43
+ {{/cap}}
44
+ {{^cap parallel-subagents}}
45
+ sungen add-flow --flow ${input:flow} --path ${input:path}
46
+ {{/cap}}
26
47
  ```
27
48
 
28
49
  This creates:
29
50
  ```
51
+ {{#cap parallel-subagents}}
30
52
  qa/flows/<name>/
31
53
  ├── features/<name>.feature # Gherkin with @flow tag, Background, sample scenarios
32
54
  ├── selectors/<name>.yaml # Namespaced keys: "login:submit", "awards:submit"
33
55
  ├── test-data/<name>.yaml # Namespaced data: login.email, submission.nominee
56
+ {{/cap}}
57
+ {{^cap parallel-subagents}}
58
+ qa/flows/${input:flow}/
59
+ ├── features/${input:flow}.feature # Gherkin with @flow tag, Background, sample scenarios
60
+ ├── selectors/${input:flow}.yaml # Namespaced keys: "login:submit", "awards:submit"
61
+ ├── test-data/${input:flow}.yaml # Namespaced data: login.email, submission.nominee
62
+ {{/cap}}
34
63
  └── requirements/
35
64
  ├── spec.md # Flow specification
36
65
  └── ui/ # Screenshots, mockups
@@ -47,19 +76,39 @@ Record the screen list — you will need it for:
47
76
 
48
77
  ### 2. Capture visual source
49
78
 
79
+ {{#cap parallel-subagents}}
50
80
  Use `AskUserQuestion`: *"Pick a visual source for this flow's screens:"*
81
+ {{/cap}}
82
+ {{^cap parallel-subagents}}
83
+ Ask: *"Pick a visual source for this flow's screens:"*
84
+ {{/cap}}
51
85
  - **Figma designs** (Recommended for pre-launch) — invoke `sungen-capture` skill (mode figma-mcp) for each screen
52
86
  - **Live page scan** (dev/staging is up) — invoke `sungen-capture` skill (mode live) for each screen URL
53
87
  - **Local images** — invoke `sungen-capture` skill (mode local) to load from `requirements/ui/`
54
88
  - **Skip** — user will drop images manually into `requirements/ui/` later
55
89
 
90
+ {{#cap parallel-subagents}}
56
91
  Each capture skill writes outputs into `qa/flows/<name>/requirements/ui/` and reports back a summary. Do not inline capture logic here — always delegate to the skill so behavior stays consistent with `/sungen:create-test`.
92
+ {{/cap}}
93
+ {{^cap parallel-subagents}}
94
+ Each capture skill writes outputs into `qa/flows/${input:flow}/requirements/ui/` and reports back a summary. Do not inline capture logic here — always delegate to the skill.
95
+ {{/cap}}
57
96
 
58
97
  ### 3. Fill spec.md
59
98
 
99
+ {{#cap parallel-subagents}}
60
100
  Use `AskUserQuestion`: *"Fill `spec.md` now? (You can reference the captured visuals)"* — offer **Yes, fill now (Recommended)** / **Skip, fill later**.
101
+ {{/cap}}
102
+ {{^cap parallel-subagents}}
103
+ Ask: *"Fill `spec.md` now? (You can reference the captured visuals)"* — offer **Yes, fill now (Recommended)** / **Skip, fill later**.
104
+ {{/cap}}
61
105
 
106
+ {{#cap parallel-subagents}}
62
107
  If yes → open `qa/flows/<name>/requirements/spec.md` and help the user fill:
108
+ {{/cap}}
109
+ {{^cap parallel-subagents}}
110
+ If yes → open `qa/flows/${input:flow}/requirements/spec.md` and help the user fill:
111
+ {{/cap}}
63
112
  - **Screens list** — ordered list of screens with URL paths
64
113
  - **Flow steps** — what the user does at each screen
65
114
  - **Transitions** — what triggers navigation between screens
@@ -70,13 +119,25 @@ Reference the captured visuals from Step 2 to suggest field names, form elements
70
119
 
71
120
  ### 4. Next steps
72
121
 
122
+ {{#cap parallel-subagents}}
73
123
  Tell the user what was created, then use `AskUserQuestion` to offer next steps:
124
+ {{/cap}}
125
+ {{^cap parallel-subagents}}
126
+ Tell the user what was created and offer next steps:
127
+ {{/cap}}
74
128
 
129
+ {{#cap parallel-subagents}}
75
130
  - **`/sungen:create-test <name>`** — Create test scenarios for the flow (Recommended)
131
+ {{/cap}}
132
+ {{^cap parallel-subagents}}
133
+ - **`/sungen-create-test ${input:flow}`** — Generate test scenarios for the flow (Recommended)
134
+ {{/cap}}
76
135
  - **Done for now** — I'll come back later
77
136
 
137
+ {{#cap parallel-subagents}}
78
138
  If user picks `/sungen:create-test`, **you MUST use the Skill tool** to invoke it. Do NOT generate test cases yourself — the skill auto-loads `sungen-gherkin-syntax` and `sungen-tc-generation`.
79
139
 
140
+ {{/cap}}
80
141
  ## Key Rules
81
142
 
82
143
  - Flows are **independent** from screens — own selectors, own test-data