@sun-asterisk/sungen 3.2.2 → 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 (355) 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/gate.d.ts +3 -0
  19. package/dist/cli/commands/gate.d.ts.map +1 -0
  20. package/dist/cli/commands/gate.js +83 -0
  21. package/dist/cli/commands/gate.js.map +1 -0
  22. package/dist/cli/commands/generate.d.ts.map +1 -1
  23. package/dist/cli/commands/generate.js +2 -1
  24. package/dist/cli/commands/generate.js.map +1 -1
  25. package/dist/cli/commands/init.d.ts.map +1 -1
  26. package/dist/cli/commands/init.js +32 -2
  27. package/dist/cli/commands/init.js.map +1 -1
  28. package/dist/cli/commands/journey.d.ts +3 -0
  29. package/dist/cli/commands/journey.d.ts.map +1 -0
  30. package/dist/cli/commands/journey.js +114 -0
  31. package/dist/cli/commands/journey.js.map +1 -0
  32. package/dist/cli/commands/update.d.ts.map +1 -1
  33. package/dist/cli/commands/update.js +10 -3
  34. package/dist/cli/commands/update.js.map +1 -1
  35. package/dist/cli/index.js +4 -0
  36. package/dist/cli/index.js.map +1 -1
  37. package/dist/dashboard/snapshot-builder.d.ts.map +1 -1
  38. package/dist/dashboard/snapshot-builder.js +10 -1
  39. package/dist/dashboard/snapshot-builder.js.map +1 -1
  40. package/dist/exporters/csv-exporter.d.ts.map +1 -1
  41. package/dist/exporters/csv-exporter.js +3 -1
  42. package/dist/exporters/csv-exporter.js.map +1 -1
  43. package/dist/exporters/json-exporter.js +3 -1
  44. package/dist/exporters/json-exporter.js.map +1 -1
  45. package/dist/exporters/mobile-app-id.d.ts +22 -0
  46. package/dist/exporters/mobile-app-id.d.ts.map +1 -0
  47. package/dist/exporters/mobile-app-id.js +37 -0
  48. package/dist/exporters/mobile-app-id.js.map +1 -0
  49. package/dist/exporters/spec-parser.d.ts.map +1 -1
  50. package/dist/exporters/spec-parser.js +6 -2
  51. package/dist/exporters/spec-parser.js.map +1 -1
  52. package/dist/generators/test-generator/adapters/adapter-interface.d.ts +3 -0
  53. package/dist/generators/test-generator/adapters/adapter-interface.d.ts.map +1 -1
  54. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/scroll-action.hbs +7 -4
  55. package/dist/generators/test-generator/adapters/appium/templates/steps/actions/toggle-action.hbs +20 -3
  56. package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/checked-assertion.hbs +4 -1
  57. package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/not-checked-assertion.hbs +4 -1
  58. package/dist/generators/test-generator/adapters/appium/templates/test-file.hbs +3 -0
  59. package/dist/generators/test-generator/code-generator.d.ts.map +1 -1
  60. package/dist/generators/test-generator/code-generator.js +48 -9
  61. package/dist/generators/test-generator/code-generator.js.map +1 -1
  62. package/dist/generators/test-generator/template-engine.d.ts +3 -0
  63. package/dist/generators/test-generator/template-engine.d.ts.map +1 -1
  64. package/dist/generators/test-generator/template-engine.js +11 -1
  65. package/dist/generators/test-generator/template-engine.js.map +1 -1
  66. package/dist/generators/test-generator/utils/selector-resolver.d.ts +11 -1
  67. package/dist/generators/test-generator/utils/selector-resolver.d.ts.map +1 -1
  68. package/dist/generators/test-generator/utils/selector-resolver.js +33 -0
  69. package/dist/generators/test-generator/utils/selector-resolver.js.map +1 -1
  70. package/dist/harness/audit.d.ts.map +1 -1
  71. package/dist/harness/audit.js +8 -1
  72. package/dist/harness/audit.js.map +1 -1
  73. package/dist/harness/catalog/universal-viewpoints.yaml +15 -0
  74. package/dist/harness/eval/skill-lint.d.ts +3 -3
  75. package/dist/harness/eval/skill-lint.d.ts.map +1 -1
  76. package/dist/harness/eval/skill-lint.js +88 -68
  77. package/dist/harness/eval/skill-lint.js.map +1 -1
  78. package/dist/harness/journey.d.ts +88 -0
  79. package/dist/harness/journey.d.ts.map +1 -0
  80. package/dist/harness/journey.js +414 -0
  81. package/dist/harness/journey.js.map +1 -0
  82. package/dist/harness/quality-gates.d.ts +13 -0
  83. package/dist/harness/quality-gates.d.ts.map +1 -1
  84. package/dist/harness/quality-gates.js +23 -0
  85. package/dist/harness/quality-gates.js.map +1 -1
  86. package/dist/harness/sensors.d.ts +1 -1
  87. package/dist/harness/sensors.d.ts.map +1 -1
  88. package/dist/harness/sensors.js +32 -9
  89. package/dist/harness/sensors.js.map +1 -1
  90. package/dist/orchestrator/ai-rules-updater.d.ts +11 -3
  91. package/dist/orchestrator/ai-rules-updater.d.ts.map +1 -1
  92. package/dist/orchestrator/ai-rules-updater.js +44 -180
  93. package/dist/orchestrator/ai-rules-updater.js.map +1 -1
  94. package/dist/orchestrator/ai-skills/adapters.d.ts +28 -0
  95. package/dist/orchestrator/ai-skills/adapters.d.ts.map +1 -0
  96. package/dist/orchestrator/ai-skills/adapters.js +34 -0
  97. package/dist/orchestrator/ai-skills/adapters.js.map +1 -0
  98. package/dist/orchestrator/ai-skills/build.d.ts +10 -0
  99. package/dist/orchestrator/ai-skills/build.d.ts.map +1 -0
  100. package/dist/orchestrator/ai-skills/build.js +128 -0
  101. package/dist/orchestrator/ai-skills/build.js.map +1 -0
  102. package/dist/orchestrator/ai-skills/cap-stripper.d.ts +27 -0
  103. package/dist/orchestrator/ai-skills/cap-stripper.d.ts.map +1 -0
  104. package/dist/orchestrator/ai-skills/cap-stripper.js +78 -0
  105. package/dist/orchestrator/ai-skills/cap-stripper.js.map +1 -0
  106. package/dist/orchestrator/ai-skills/commands.d.ts +22 -0
  107. package/dist/orchestrator/ai-skills/commands.d.ts.map +1 -0
  108. package/dist/orchestrator/ai-skills/commands.js +109 -0
  109. package/dist/orchestrator/ai-skills/commands.js.map +1 -0
  110. package/dist/orchestrator/ai-skills/generator.d.ts +23 -0
  111. package/dist/orchestrator/ai-skills/generator.d.ts.map +1 -0
  112. package/dist/orchestrator/ai-skills/generator.js +79 -0
  113. package/dist/orchestrator/ai-skills/generator.js.map +1 -0
  114. package/dist/orchestrator/ai-skills/golden-skills.test.d.ts +2 -0
  115. package/dist/orchestrator/ai-skills/golden-skills.test.d.ts.map +1 -0
  116. package/dist/orchestrator/ai-skills/golden-skills.test.js +183 -0
  117. package/dist/orchestrator/ai-skills/golden-skills.test.js.map +1 -0
  118. package/dist/orchestrator/ai-skills/resolve-assistants.d.ts +8 -0
  119. package/dist/orchestrator/ai-skills/resolve-assistants.d.ts.map +1 -0
  120. package/dist/orchestrator/ai-skills/resolve-assistants.js +28 -0
  121. package/dist/orchestrator/ai-skills/resolve-assistants.js.map +1 -0
  122. package/dist/orchestrator/ai-skills/writer.d.ts +15 -0
  123. package/dist/orchestrator/ai-skills/writer.d.ts.map +1 -0
  124. package/dist/orchestrator/ai-skills/writer.js +129 -0
  125. package/dist/orchestrator/ai-skills/writer.js.map +1 -0
  126. package/dist/orchestrator/flow-manager.d.ts +11 -0
  127. package/dist/orchestrator/flow-manager.d.ts.map +1 -1
  128. package/dist/orchestrator/flow-manager.js +147 -29
  129. package/dist/orchestrator/flow-manager.js.map +1 -1
  130. package/dist/orchestrator/mobile-runtime-scaffolder.d.ts +59 -0
  131. package/dist/orchestrator/mobile-runtime-scaffolder.d.ts.map +1 -0
  132. package/dist/orchestrator/mobile-runtime-scaffolder.js +298 -0
  133. package/dist/orchestrator/mobile-runtime-scaffolder.js.map +1 -0
  134. package/dist/orchestrator/project-initializer.d.ts +44 -7
  135. package/dist/orchestrator/project-initializer.d.ts.map +1 -1
  136. package/dist/orchestrator/project-initializer.js +147 -79
  137. package/dist/orchestrator/project-initializer.js.map +1 -1
  138. package/dist/orchestrator/screen-manager.d.ts +30 -0
  139. package/dist/orchestrator/screen-manager.d.ts.map +1 -1
  140. package/dist/orchestrator/screen-manager.js +205 -22
  141. package/dist/orchestrator/screen-manager.js.map +1 -1
  142. package/dist/orchestrator/templates/ai-src/README.md +58 -0
  143. package/dist/orchestrator/templates/{ai-instructions/claude-cmd-add-flow.md → ai-src/commands/add-flow.md} +63 -2
  144. package/dist/orchestrator/templates/{ai-instructions/claude-cmd-add-screen.md → ai-src/commands/add-screen.md} +171 -6
  145. package/dist/orchestrator/templates/{ai-instructions/claude-cmd-create-test.md → ai-src/commands/create-test.md} +118 -4
  146. package/{src/orchestrator/templates/ai-instructions/claude-cmd-dashboard.md → dist/orchestrator/templates/ai-src/commands/dashboard.md} +25 -3
  147. package/{src/orchestrator/templates/ai-instructions/claude-cmd-delivery.md → dist/orchestrator/templates/ai-src/commands/delivery.md} +67 -3
  148. package/dist/orchestrator/templates/ai-src/commands/design.md +29 -0
  149. package/{src/orchestrator/templates/ai-instructions/claude-cmd-feedback.md → dist/orchestrator/templates/ai-src/commands/feedback.md} +34 -3
  150. package/dist/orchestrator/templates/{ai-instructions/claude-cmd-locale.md → ai-src/commands/locale.md} +56 -4
  151. package/{src/orchestrator/templates/ai-instructions/claude-cmd-review.md → dist/orchestrator/templates/ai-src/commands/review.md} +57 -2
  152. package/{src/orchestrator/templates/ai-instructions/claude-cmd-run-test.md → dist/orchestrator/templates/ai-src/commands/run-test.md} +116 -5
  153. package/dist/orchestrator/templates/ai-src/config/codex.md +8 -0
  154. package/{src/orchestrator/templates/ai-instructions/claude-skill-capture-mobile.md → dist/orchestrator/templates/ai-src/skills/sungen-capture-mobile/SKILL.md} +11 -0
  155. package/dist/orchestrator/templates/{ai-instructions/github-skill-sungen-error-mapping.md → ai-src/skills/sungen-error-mapping/SKILL.md} +49 -9
  156. package/{src/orchestrator/templates/ai-instructions/claude-skill-harness-audit.md → dist/orchestrator/templates/ai-src/skills/sungen-harness-audit/SKILL.md} +5 -5
  157. package/{src/orchestrator/templates/ai-instructions/claude-skill-locale.md → dist/orchestrator/templates/ai-src/skills/sungen-locale/SKILL.md} +275 -3
  158. 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
  159. package/dist/orchestrator/templates/{ai-instructions/claude-skill-selector-fix-mobile.md → ai-src/skills/sungen-selector-fix-mobile/SKILL.md} +5 -0
  160. package/dist/orchestrator/templates/{ai-instructions/claude-skill-tc-generation.md → ai-src/skills/sungen-tc-generation/SKILL.md} +5 -0
  161. package/dist/orchestrator/templates/playwright.config.ts +7 -4
  162. package/package.json +3 -3
  163. package/src/capabilities/discover.ts +29 -3
  164. package/src/cli/commands/add-flow.ts +2 -0
  165. package/src/cli/commands/add.ts +4 -0
  166. package/src/cli/commands/capability.ts +64 -1
  167. package/src/cli/commands/delivery.ts +89 -2
  168. package/src/cli/commands/eval.ts +3 -3
  169. package/src/cli/commands/gate.ts +44 -0
  170. package/src/cli/commands/generate.ts +2 -1
  171. package/src/cli/commands/init.ts +50 -3
  172. package/src/cli/commands/journey.ts +72 -0
  173. package/src/cli/commands/update.ts +14 -4
  174. package/src/cli/index.ts +4 -0
  175. package/src/dashboard/snapshot-builder.ts +10 -1
  176. package/src/exporters/csv-exporter.ts +3 -1
  177. package/src/exporters/json-exporter.ts +3 -1
  178. package/src/exporters/mobile-app-id.ts +34 -0
  179. package/src/exporters/spec-parser.ts +6 -2
  180. package/src/generators/test-generator/adapters/adapter-interface.ts +3 -0
  181. package/src/generators/test-generator/adapters/appium/templates/steps/actions/scroll-action.hbs +7 -4
  182. package/src/generators/test-generator/adapters/appium/templates/steps/actions/toggle-action.hbs +20 -3
  183. package/src/generators/test-generator/adapters/appium/templates/steps/assertions/checked-assertion.hbs +4 -1
  184. package/src/generators/test-generator/adapters/appium/templates/steps/assertions/not-checked-assertion.hbs +4 -1
  185. package/src/generators/test-generator/adapters/appium/templates/test-file.hbs +3 -0
  186. package/src/generators/test-generator/code-generator.ts +49 -9
  187. package/src/generators/test-generator/template-engine.ts +14 -1
  188. package/src/generators/test-generator/utils/selector-resolver.ts +51 -1
  189. package/src/harness/audit.ts +9 -2
  190. package/src/harness/catalog/universal-viewpoints.yaml +15 -0
  191. package/src/harness/eval/skill-lint.ts +71 -60
  192. package/src/harness/journey.ts +434 -0
  193. package/src/harness/quality-gates.ts +20 -0
  194. package/src/harness/sensors.ts +25 -8
  195. package/src/orchestrator/ai-rules-updater.ts +35 -197
  196. package/src/orchestrator/ai-skills/adapters.ts +52 -0
  197. package/src/orchestrator/ai-skills/build.ts +103 -0
  198. package/src/orchestrator/ai-skills/cap-stripper.ts +85 -0
  199. package/src/orchestrator/ai-skills/commands.ts +112 -0
  200. package/src/orchestrator/ai-skills/generator.ts +47 -0
  201. package/src/orchestrator/ai-skills/golden-skills.test.ts +124 -0
  202. package/src/orchestrator/ai-skills/resolve-assistants.ts +18 -0
  203. package/src/orchestrator/ai-skills/writer.ts +92 -0
  204. package/src/orchestrator/flow-manager.ts +165 -29
  205. package/src/orchestrator/mobile-runtime-scaffolder.ts +277 -0
  206. package/src/orchestrator/project-initializer.ts +159 -86
  207. package/src/orchestrator/screen-manager.ts +237 -22
  208. package/src/orchestrator/templates/ai-src/README.md +58 -0
  209. package/src/orchestrator/templates/{ai-instructions/claude-cmd-add-flow.md → ai-src/commands/add-flow.md} +63 -2
  210. package/src/orchestrator/templates/{ai-instructions/claude-cmd-add-screen.md → ai-src/commands/add-screen.md} +171 -6
  211. package/src/orchestrator/templates/{ai-instructions/claude-cmd-create-test.md → ai-src/commands/create-test.md} +118 -4
  212. package/{dist/orchestrator/templates/ai-instructions/claude-cmd-dashboard.md → src/orchestrator/templates/ai-src/commands/dashboard.md} +25 -3
  213. package/{dist/orchestrator/templates/ai-instructions/claude-cmd-delivery.md → src/orchestrator/templates/ai-src/commands/delivery.md} +67 -3
  214. package/src/orchestrator/templates/ai-src/commands/design.md +29 -0
  215. package/{dist/orchestrator/templates/ai-instructions/claude-cmd-feedback.md → src/orchestrator/templates/ai-src/commands/feedback.md} +34 -3
  216. package/src/orchestrator/templates/{ai-instructions/claude-cmd-locale.md → ai-src/commands/locale.md} +56 -4
  217. package/{dist/orchestrator/templates/ai-instructions/claude-cmd-review.md → src/orchestrator/templates/ai-src/commands/review.md} +57 -2
  218. package/{dist/orchestrator/templates/ai-instructions/claude-cmd-run-test.md → src/orchestrator/templates/ai-src/commands/run-test.md} +116 -5
  219. package/src/orchestrator/templates/ai-src/config/codex.md +8 -0
  220. package/{dist/orchestrator/templates/ai-instructions/claude-skill-capture-mobile.md → src/orchestrator/templates/ai-src/skills/sungen-capture-mobile/SKILL.md} +11 -0
  221. package/{dist/orchestrator/templates/ai-instructions/claude-skill-error-mapping.md → src/orchestrator/templates/ai-src/skills/sungen-error-mapping/SKILL.md} +49 -9
  222. package/{dist/orchestrator/templates/ai-instructions/claude-skill-harness-audit.md → src/orchestrator/templates/ai-src/skills/sungen-harness-audit/SKILL.md} +5 -5
  223. package/{dist/orchestrator/templates/ai-instructions/claude-skill-locale.md → src/orchestrator/templates/ai-src/skills/sungen-locale/SKILL.md} +275 -3
  224. 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
  225. package/src/orchestrator/templates/{ai-instructions/claude-skill-selector-fix-mobile.md → ai-src/skills/sungen-selector-fix-mobile/SKILL.md} +5 -0
  226. package/src/orchestrator/templates/{ai-instructions/claude-skill-tc-generation.md → ai-src/skills/sungen-tc-generation/SKILL.md} +5 -0
  227. package/src/orchestrator/templates/playwright.config.ts +7 -4
  228. package/dist/orchestrator/templates/ai-instructions/claude-cmd-design.md +0 -12
  229. package/dist/orchestrator/templates/ai-instructions/claude-skill-selector-fix.md +0 -347
  230. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-add-flow.md +0 -86
  231. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-add-screen.md +0 -131
  232. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-create-test.md +0 -93
  233. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-dashboard.md +0 -65
  234. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-delivery.md +0 -83
  235. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-design.md +0 -13
  236. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-feedback.md +0 -24
  237. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-locale.md +0 -70
  238. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-review.md +0 -38
  239. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-run-test.md +0 -155
  240. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mobile.md +0 -184
  241. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-harness-audit.md +0 -85
  242. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-locale.md +0 -291
  243. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix-mobile.md +0 -316
  244. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-keys.md +0 -221
  245. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +0 -617
  246. package/src/orchestrator/templates/ai-instructions/claude-cmd-design.md +0 -12
  247. package/src/orchestrator/templates/ai-instructions/claude-skill-api-design.md +0 -62
  248. package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-figma-mcp.md +0 -82
  249. package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-figma-pat.md +0 -117
  250. package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-live.md +0 -60
  251. package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-local.md +0 -38
  252. package/src/orchestrator/templates/ai-instructions/claude-skill-capture.md +0 -35
  253. package/src/orchestrator/templates/ai-instructions/claude-skill-dashboard.md +0 -121
  254. package/src/orchestrator/templates/ai-instructions/claude-skill-delivery.md +0 -141
  255. package/src/orchestrator/templates/ai-instructions/claude-skill-error-mapping.md +0 -157
  256. package/src/orchestrator/templates/ai-instructions/claude-skill-gherkin-syntax.md +0 -446
  257. package/src/orchestrator/templates/ai-instructions/claude-skill-ingest-legacy.md +0 -79
  258. package/src/orchestrator/templates/ai-instructions/claude-skill-mobile-gestures.md +0 -109
  259. package/src/orchestrator/templates/ai-instructions/claude-skill-selector-fix.md +0 -347
  260. package/src/orchestrator/templates/ai-instructions/claude-skill-tc-review.md +0 -320
  261. package/src/orchestrator/templates/ai-instructions/claude-skill-test-design-techniques.md +0 -118
  262. package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint-group-a-data-entry.md +0 -203
  263. package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint-group-b-data-ops.md +0 -179
  264. package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint-group-c-data-explore.md +0 -233
  265. package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint-group-d-display.md +0 -226
  266. package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint-group-e-identity.md +0 -177
  267. package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint.md +0 -118
  268. package/src/orchestrator/templates/ai-instructions/copilot-cmd-add-flow.md +0 -86
  269. package/src/orchestrator/templates/ai-instructions/copilot-cmd-add-screen.md +0 -131
  270. package/src/orchestrator/templates/ai-instructions/copilot-cmd-create-test.md +0 -93
  271. package/src/orchestrator/templates/ai-instructions/copilot-cmd-dashboard.md +0 -65
  272. package/src/orchestrator/templates/ai-instructions/copilot-cmd-delivery.md +0 -83
  273. package/src/orchestrator/templates/ai-instructions/copilot-cmd-design.md +0 -13
  274. package/src/orchestrator/templates/ai-instructions/copilot-cmd-feedback.md +0 -24
  275. package/src/orchestrator/templates/ai-instructions/copilot-cmd-locale.md +0 -70
  276. package/src/orchestrator/templates/ai-instructions/copilot-cmd-review.md +0 -38
  277. package/src/orchestrator/templates/ai-instructions/copilot-cmd-run-test.md +0 -155
  278. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-api-design.md +0 -62
  279. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mobile.md +0 -184
  280. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-mcp.md +0 -82
  281. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-pat.md +0 -117
  282. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-live.md +0 -60
  283. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-local.md +0 -38
  284. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture.md +0 -35
  285. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-dashboard.md +0 -121
  286. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-delivery.md +0 -141
  287. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-error-mapping.md +0 -157
  288. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-gherkin-syntax.md +0 -446
  289. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-harness-audit.md +0 -85
  290. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-ingest-legacy.md +0 -79
  291. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-locale.md +0 -291
  292. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-mobile-gestures.md +0 -109
  293. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix-mobile.md +0 -316
  294. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-keys.md +0 -221
  295. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +0 -617
  296. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-tc-review.md +0 -320
  297. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-test-design-techniques.md +0 -118
  298. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-a-data-entry.md +0 -203
  299. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-b-data-ops.md +0 -179
  300. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-c-data-explore.md +0 -233
  301. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-d-display.md +0 -226
  302. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-e-identity.md +0 -177
  303. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint.md +0 -118
  304. /package/dist/orchestrator/templates/{ai-instructions/claude-agent-challenge.md → ai-src/agents/challenge.md} +0 -0
  305. /package/dist/orchestrator/templates/{ai-instructions/claude-agent-discovery.md → ai-src/agents/discovery.md} +0 -0
  306. /package/dist/orchestrator/templates/{ai-instructions/claude-agent-generator.md → ai-src/agents/generator.md} +0 -0
  307. /package/dist/orchestrator/templates/{ai-instructions/claude-agent-reviewer.md → ai-src/agents/reviewer.md} +0 -0
  308. /package/dist/orchestrator/templates/{ai-instructions/claude-config.md → ai-src/config/claude.md} +0 -0
  309. /package/dist/orchestrator/templates/{ai-instructions/copilot-config.md → ai-src/config/copilot.md} +0 -0
  310. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-api-design.md → ai-src/skills/sungen-api-design/SKILL.md} +0 -0
  311. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-capture.md → ai-src/skills/sungen-capture/SKILL.md} +0 -0
  312. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-capture-mode-figma-mcp.md → ai-src/skills/sungen-capture/mode-figma-mcp.md} +0 -0
  313. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-capture-mode-figma-pat.md → ai-src/skills/sungen-capture/mode-figma-pat.md} +0 -0
  314. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-capture-mode-live.md → ai-src/skills/sungen-capture/mode-live.md} +0 -0
  315. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-capture-mode-local.md → ai-src/skills/sungen-capture/mode-local.md} +0 -0
  316. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-dashboard.md → ai-src/skills/sungen-dashboard/SKILL.md} +0 -0
  317. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-delivery.md → ai-src/skills/sungen-delivery/SKILL.md} +0 -0
  318. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-gherkin-syntax.md → ai-src/skills/sungen-gherkin-syntax/SKILL.md} +0 -0
  319. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-ingest-legacy.md → ai-src/skills/sungen-ingest-legacy/SKILL.md} +0 -0
  320. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-mobile-gestures.md → ai-src/skills/sungen-mobile-gestures/SKILL.md} +0 -0
  321. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-selector-keys.md → ai-src/skills/sungen-selector-keys/SKILL.md} +0 -0
  322. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-tc-review.md → ai-src/skills/sungen-tc-review/SKILL.md} +0 -0
  323. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-test-design-techniques.md → ai-src/skills/sungen-test-design-techniques/SKILL.md} +0 -0
  324. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint.md → ai-src/skills/sungen-viewpoint/SKILL.md} +0 -0
  325. /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
  326. /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
  327. /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
  328. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint-group-d-display.md → ai-src/skills/sungen-viewpoint/group-d-display.md} +0 -0
  329. /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint-group-e-identity.md → ai-src/skills/sungen-viewpoint/group-e-identity.md} +0 -0
  330. /package/src/orchestrator/templates/{ai-instructions/claude-agent-challenge.md → ai-src/agents/challenge.md} +0 -0
  331. /package/src/orchestrator/templates/{ai-instructions/claude-agent-discovery.md → ai-src/agents/discovery.md} +0 -0
  332. /package/src/orchestrator/templates/{ai-instructions/claude-agent-generator.md → ai-src/agents/generator.md} +0 -0
  333. /package/src/orchestrator/templates/{ai-instructions/claude-agent-reviewer.md → ai-src/agents/reviewer.md} +0 -0
  334. /package/src/orchestrator/templates/{ai-instructions/claude-config.md → ai-src/config/claude.md} +0 -0
  335. /package/src/orchestrator/templates/{ai-instructions/copilot-config.md → ai-src/config/copilot.md} +0 -0
  336. /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
  337. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture.md → src/orchestrator/templates/ai-src/skills/sungen-capture/SKILL.md} +0 -0
  338. /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
  339. /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
  340. /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
  341. /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
  342. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-dashboard.md → src/orchestrator/templates/ai-src/skills/sungen-dashboard/SKILL.md} +0 -0
  343. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-delivery.md → src/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md} +0 -0
  344. /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
  345. /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
  346. /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
  347. /package/src/orchestrator/templates/{ai-instructions/claude-skill-selector-keys.md → ai-src/skills/sungen-selector-keys/SKILL.md} +0 -0
  348. /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
  349. /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
  350. /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint.md → src/orchestrator/templates/ai-src/skills/sungen-viewpoint/SKILL.md} +0 -0
  351. /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
  352. /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
  353. /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
  354. /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
  355. /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,17 +6,53 @@
6
6
  import * as fs from 'fs';
7
7
  import * as path from 'path';
8
8
  import { execSync } from 'child_process';
9
- import { AI_RULES_FILE_MAPPING } from './ai-rules-updater';
9
+ import { buildOutputs } from './ai-skills/build';
10
+ import { applyOutputs } from './ai-skills/writer';
11
+ import { AdapterKey } from './ai-skills/adapters';
12
+ import {
13
+ MobileInitOptions,
14
+ emitMobileRuntime,
15
+ writeMobileCapabilities,
16
+ installMobileDriver,
17
+ } from './mobile-runtime-scaffolder';
18
+
19
+ export { MobileInitOptions };
20
+
21
+ function sungenVersion(): string {
22
+ try { return require(path.join(__dirname, '..', '..', 'package.json')).version || '0.0.0'; }
23
+ catch { return '0.0.0'; }
24
+ }
10
25
 
11
26
  export class ProjectInitializer {
12
27
  private baseCwd: string;
13
28
  private cwd: string;
14
29
  private createdItems: string[] = [];
15
30
  private skippedItems: string[] = [];
31
+ private agents: AdapterKey[];
32
+ private force: boolean;
33
+ private mobile: MobileInitOptions;
16
34
 
17
- constructor(private baseUrl: string) {
35
+ constructor(private baseUrl: string, opts: { agents?: AdapterKey[]; force?: boolean; enabled?: boolean; mobileOnly?: boolean; appPackage?: string; appActivity?: string; appApk?: string; androidUdid?: string; iosBundleId?: string; iosDevice?: string; iosVersion?: string } = {}) {
18
36
  this.baseCwd = process.cwd();
19
37
  this.cwd = this.baseCwd;
38
+ this.agents = opts.agents && opts.agents.length ? opts.agents : (['claude'] as AdapterKey[]);
39
+ this.force = opts.force ?? false;
40
+ this.mobile = {
41
+ enabled: opts.enabled ?? false,
42
+ mobileOnly: opts.mobileOnly ?? false,
43
+ appPackage: opts.appPackage,
44
+ appActivity: opts.appActivity,
45
+ appApk: opts.appApk,
46
+ androidUdid: opts.androidUdid,
47
+ iosBundleId: opts.iosBundleId,
48
+ iosDevice: opts.iosDevice,
49
+ iosVersion: opts.iosVersion,
50
+ };
51
+ }
52
+
53
+ /** Mobile-only project: no Playwright/web scaffolding. */
54
+ private get mobileOnly(): boolean {
55
+ return !!this.mobile.mobileOnly;
20
56
  }
21
57
 
22
58
  /**
@@ -30,34 +66,41 @@ export class ProjectInitializer {
30
66
  this.createdItems = [];
31
67
  this.skippedItems = [];
32
68
 
33
- console.log('🚀 Initializing Sungen project...\n');
69
+ console.log(`🚀 Initializing Sungen ${this.mobileOnly ? 'mobile-only ' : ''}project...\n`);
34
70
 
35
71
  if (normalizedProjectName) {
36
72
  this.createProjectRoot(normalizedProjectName);
37
73
  }
38
74
 
39
- // Create directories
75
+ // Create directories (mobile-only skips the web Playwright storage dir)
40
76
  this.createDirectories();
41
77
 
42
78
  // Create qa/context.md for QA lead to fill project-wide context
43
79
  this.createContext();
44
80
 
45
- // Create qa/capabilities.yaml — the platform driver profile (default: web/Playwright)
81
+ // Create qa/capabilities.yaml — web default; mobile path uses writeMobileCapabilities
46
82
  this.createCapabilities();
47
83
 
48
- // Ensure package.json and install Playwright
84
+ // Ensure package.json and install deps (Playwright for web; skipped for mobile-only)
49
85
  await this.setupDependencies();
50
86
 
51
- // Create playwright config if doesn't exist
52
- this.createPlaywrightConfig();
87
+ // Web-only scaffolding skipped entirely for a mobile-only project
88
+ if (!this.mobileOnly) {
89
+ this.createPlaywrightConfig();
90
+ this.createSpecsBase();
91
+ }
53
92
 
54
- // Create tsconfig.json if doesn't exist
93
+ // Create tsconfig.json if doesn't exist (needed by both web + mobile)
55
94
  this.createTsConfig();
56
95
 
57
- // Create specs/base.ts for shared context and specs/test-data.ts for runtime data
58
- this.createSpecsBase();
96
+ // specs/test-data.ts (runtime YAML loader) — shared by BOTH web and mobile specs
59
97
  this.createSpecsTestData();
60
98
 
99
+ // Mobile harness (Appium/WebdriverIO) — when `--mobile` (a mobile-only project)
100
+ if (this.mobile.enabled) {
101
+ this.emitMobileHarness();
102
+ }
103
+
61
104
  // Create/update .gitignore
62
105
  this.updateGitignore();
63
106
 
@@ -90,17 +133,14 @@ export class ProjectInitializer {
90
133
  }
91
134
 
92
135
  /**
93
- * Create essential directories only
136
+ * Create essential directories only.
137
+ * Mobile-only: skips specs/storage (Playwright auth state); qa/screens + qa/flows still created
138
+ * (1-platform model — mobile uses the same tree as web, NOT a separate qa/mobile/ path).
94
139
  */
95
140
  private createDirectories(): void {
96
- const dirs = [
97
- 'qa',
98
- 'qa/screens',
99
- 'qa/flows',
100
- 'specs',
101
- 'specs/generated',
102
- 'specs/storage',
103
- ];
141
+ const dirs = this.mobileOnly
142
+ ? ['qa', 'qa/screens', 'qa/flows', 'specs', 'specs/generated']
143
+ : ['qa', 'qa/screens', 'qa/flows', 'specs', 'specs/generated', 'specs/storage'];
104
144
 
105
145
  for (const dir of dirs) {
106
146
  const fullPath = path.join(this.cwd, dir);
@@ -147,13 +187,17 @@ export class ProjectInitializer {
147
187
  }
148
188
 
149
189
  /**
150
- * Update .gitignore with Sungen-specific entries
190
+ * Update .gitignore with Sungen-specific entries.
191
+ * Mobile projects add .env.appium (device ids + machine paths) and specs/.auth-mobile/
192
+ * (Appium auth contract). Web projects add Playwright auth state + report dirs.
151
193
  */
152
194
  private updateGitignore(): void {
153
195
  const gitignorePath = path.join(this.cwd, '.gitignore');
154
196
  const sungenEntries = [
155
197
  '# Sungen generated files',
156
198
  'specs/.auth/', // session storage state = cookies/tokens (sensitive)
199
+ 'specs/.auth-mobile/', // mobile auth contract = credentials (sensitive)
200
+ '.env.appium', // local mobile-test env = machine paths + device/team ids (.example IS committed)
157
201
  'test-results/',
158
202
  'playwright-report/',
159
203
  '.playwright-mcp/',
@@ -199,7 +243,8 @@ export class ProjectInitializer {
199
243
  }
200
244
 
201
245
  /**
202
- * Create VS Code settings for Copilot auto-attach
246
+ * Create VS Code settings for Copilot auto-attach.
247
+ * Mobile-only: approves wdio + npx appium instead of npx playwright.
203
248
  */
204
249
  private createVSCodeSettings(): void {
205
250
  const settingsPath = path.join(this.cwd, '.vscode', 'settings.json');
@@ -214,7 +259,9 @@ export class ProjectInitializer {
214
259
  'github.copilot.chat.agent.runTasks': true,
215
260
  'chat.tools.terminal.autoApprove': {
216
261
  sungen: true,
217
- 'npx playwright': true,
262
+ ...(this.mobileOnly
263
+ ? { wdio: true, 'npx appium': true }
264
+ : { 'npx playwright': true }),
218
265
  },
219
266
  };
220
267
 
@@ -224,15 +271,14 @@ export class ProjectInitializer {
224
271
  this.skippedItems.push('.vscode/settings.json');
225
272
  }
226
273
 
227
- // .vscode/mcp.json (Copilot format) — safe-merge Playwright + Figma entries
274
+ // .vscode/mcp.json (Copilot format) — appium-mcp for mobile-only, Playwright MCP otherwise
228
275
  this.mergeMCPConfig(
229
276
  path.join(this.cwd, '.vscode', 'mcp.json'),
230
277
  'servers',
231
278
  {
232
- playwright: {
233
- command: 'npx',
234
- args: ['@playwright/mcp@latest'],
235
- },
279
+ ...(this.mobileOnly
280
+ ? { 'appium-mcp': { command: 'npx', args: ['-y', 'appium-mcp'] } }
281
+ : { playwright: { command: 'npx', args: ['@playwright/mcp@latest'] } }),
236
282
  figma: {
237
283
  type: 'http',
238
284
  url: 'https://mcp.figma.com/mcp',
@@ -243,18 +289,17 @@ export class ProjectInitializer {
243
289
  }
244
290
 
245
291
  /**
246
- * Create root .mcp.json for Claude Code — safe-merge Playwright + Figma entries
292
+ * Create root .mcp.json for Claude Code.
293
+ * Mobile-only: appium-mcp instead of Playwright MCP. Figma always included.
247
294
  */
248
295
  private createClaudeMCPConfig(): void {
249
296
  this.mergeMCPConfig(
250
297
  path.join(this.cwd, '.mcp.json'),
251
298
  'mcpServers',
252
299
  {
253
- playwright: {
254
- type: 'stdio',
255
- command: 'npx',
256
- args: ['@playwright/mcp@latest'],
257
- },
300
+ ...(this.mobileOnly
301
+ ? { 'appium-mcp': { type: 'stdio', command: 'npx', args: ['-y', 'appium-mcp'] } }
302
+ : { playwright: { type: 'stdio', command: 'npx', args: ['@playwright/mcp@latest'] } }),
258
303
  figma: {
259
304
  type: 'http',
260
305
  url: 'https://mcp.figma.com/mcp',
@@ -337,10 +382,18 @@ export class ProjectInitializer {
337
382
  if (projectName) {
338
383
  console.log(` ${stepIndex++}. cd ${projectName}`);
339
384
  }
340
- console.log(` ${stepIndex++}. Create your first screen: sungen add --screen <name> --path <url-path>`);
341
- console.log(` ${stepIndex++}. Use AI (Copilot/Claude) to generate Gherkin + selectors from the live page`);
342
- console.log(` ${stepIndex++}. Compile tests: sungen generate --screen <name>`);
343
- console.log(` ${stepIndex++}. Run tests: npx playwright test\n`);
385
+ if (this.mobileOnly) {
386
+ console.log(` ${stepIndex++}. Fill in .env.appium with your device/app details (see .env.appium.example)`);
387
+ console.log(` ${stepIndex++}. Create your first screen: sungen add --screen <name>`);
388
+ console.log(` ${stepIndex++}. Use AI (Copilot/Claude) to generate Gherkin + selectors from the live app`);
389
+ console.log(` ${stepIndex++}. Compile tests: sungen generate --screen <name>`);
390
+ console.log(` ${stepIndex++}. Run tests: npm run test:mobile\n`);
391
+ } else {
392
+ console.log(` ${stepIndex++}. Create your first screen: sungen add --screen <name> --path <url-path>`);
393
+ console.log(` ${stepIndex++}. Use AI (Copilot/Claude) to generate Gherkin + selectors from the live page`);
394
+ console.log(` ${stepIndex++}. Compile tests: sungen generate --screen <name>`);
395
+ console.log(` ${stepIndex++}. Run tests: npx playwright test\n`);
396
+ }
344
397
  }
345
398
 
346
399
  /**
@@ -348,28 +401,17 @@ export class ProjectInitializer {
348
401
  * Shares `AI_RULES_FILE_MAPPING` with `sungen update` so a newly added
349
402
  * skill / command template only needs to be registered once.
350
403
  */
404
+ /**
405
+ * Create AI rules files for the selected assistants from the single source (ai-src).
406
+ * Shares the generator (ai-skills/build) with `sungen update` so a skill is authored once.
407
+ */
351
408
  private createAIRules(): void {
352
- const aiTemplateDir = path.join(__dirname, 'templates', 'ai-instructions');
353
-
354
- for (const [templateFile, outputRelPath] of AI_RULES_FILE_MAPPING) {
355
- const outputPath = path.join(this.cwd, outputRelPath);
356
-
357
- if (fs.existsSync(outputPath)) {
358
- this.skippedItems.push(outputRelPath);
359
- continue;
360
- }
361
-
362
- const outputDir = path.dirname(outputPath);
363
- if (!fs.existsSync(outputDir)) {
364
- fs.mkdirSync(outputDir, { recursive: true });
365
- }
366
-
367
- const templatePath = path.join(aiTemplateDir, templateFile);
368
- const content = fs.readFileSync(templatePath, 'utf-8');
369
- fs.writeFileSync(outputPath, content, 'utf-8');
370
- this.createdItems.push(outputRelPath);
371
- }
372
-
409
+ // Single-source generator (decision 1A). Managed skill/command files are written;
410
+ // config files (CLAUDE.md/AGENTS.md/copilot-instructions) are skip-if-exists unless --force.
411
+ const outputs = buildOutputs(this.agents);
412
+ const r = applyOutputs(this.cwd, outputs, { version: sungenVersion(), force: this.force });
413
+ this.createdItems.push(...r.created);
414
+ this.skippedItems.push(...r.skippedConfig);
373
415
  }
374
416
 
375
417
  /**
@@ -390,8 +432,9 @@ export class ProjectInitializer {
390
432
  }
391
433
 
392
434
  /**
393
- * Create qa/capabilities.yaml — the platform driver profile (Phase 2a).
394
- * Defaults to `web` (Playwright). Mobile/API projects switch via `sungen capability add`.
435
+ * Create qa/capabilities.yaml — the platform driver profile.
436
+ * Web default: platform=web, enabled=[web].
437
+ * Mobile: platform=mobile, enabled=[mobile] (via writeMobileCapabilities from the scaffolder).
395
438
  */
396
439
  private createCapabilities(): void {
397
440
  const p = path.join(this.cwd, 'qa', 'capabilities.yaml');
@@ -399,13 +442,18 @@ export class ProjectInitializer {
399
442
  this.skippedItems.push('qa/capabilities.yaml');
400
443
  return;
401
444
  }
402
- const content =
403
- '# Sungen capability profile — which runtime/drivers this project uses.\n' +
404
- '# platform: the runtime adapter — web → Playwright, mobile → Appium.\n' +
405
- '# enabled: drivers turned on (add more via `sungen capability add <driver>`).\n\n' +
406
- 'platform: web\n' +
407
- 'enabled:\n - web\n';
408
- fs.writeFileSync(p, content, 'utf-8');
445
+
446
+ if (this.mobile.enabled) {
447
+ writeMobileCapabilities(this.cwd);
448
+ } else {
449
+ const content =
450
+ '# Sungen capability profile — which runtime/drivers this project uses.\n' +
451
+ '# platform: the runtime adapter — web → Playwright, mobile → Appium.\n' +
452
+ '# enabled: drivers turned on (add more via `sungen capability add <driver>`).\n\n' +
453
+ 'platform: web\n' +
454
+ 'enabled:\n - web\n';
455
+ fs.writeFileSync(p, content, 'utf-8');
456
+ }
409
457
  this.createdItems.push('qa/capabilities.yaml');
410
458
  }
411
459
 
@@ -451,6 +499,20 @@ export class ProjectInitializer {
451
499
  this.createdItems.push('specs/generated/test-data.ts');
452
500
  }
453
501
 
502
+ /**
503
+ * Delegate to mobile-runtime-scaffolder to emit Appium/WDIO harness files,
504
+ * then best-effort install @sungen/driver-mobile at lockstep version.
505
+ * Called only when `--mobile` is set.
506
+ */
507
+ private emitMobileHarness(): void {
508
+ const result = emitMobileRuntime(this.cwd, this.mobile);
509
+ this.createdItems.push(...result.created);
510
+ this.skippedItems.push(...result.skipped);
511
+
512
+ // Best-effort driver install — non-fatal so offline init still scaffolds.
513
+ installMobileDriver(this.cwd);
514
+ }
515
+
454
516
  /**
455
517
  * Read a template file from the templates directory
456
518
  */
@@ -476,8 +538,11 @@ export class ProjectInitializer {
476
538
  // Ensure standard scripts exist in package.json
477
539
  this.ensurePackageScripts(packageJsonPath);
478
540
 
479
- // Check which dependencies are missing
480
- const requiredDeps = ['@playwright/test', '@types/node', 'yaml'];
541
+ // Mobile-only drops @playwright/test (no web runner needed).
542
+ const requiredDeps = this.mobileOnly
543
+ ? ['@types/node', 'yaml']
544
+ : ['@playwright/test', '@types/node', 'yaml'];
545
+
481
546
  let missingDeps: string[] = requiredDeps;
482
547
  try {
483
548
  const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
@@ -489,15 +554,17 @@ export class ProjectInitializer {
489
554
 
490
555
  if (missingDeps.length === 0) {
491
556
  console.log('✓ All dependencies already installed\n');
492
- return;
557
+ } else {
558
+ console.log(`📦 Installing ${missingDeps.join(', ')}...\n`);
559
+ execSync(`npm install -D ${missingDeps.join(' ')}`, execOpts);
493
560
  }
494
561
 
495
- console.log(`📦 Installing ${missingDeps.join(', ')}...\n`);
496
- execSync(`npm install -D ${missingDeps.join(' ')}`, execOpts);
497
-
498
- console.log('\n🎭 Installing Chromium (default browser)...\n');
499
- execSync('npx playwright install --with-deps chromium', execOpts);
500
- console.log('\n💡 To install other browsers: npm run install:browsers -- firefox webkit\n');
562
+ // Chromium is only needed for the web (Playwright) runner — skip for mobile-only projects.
563
+ if (!this.mobileOnly) {
564
+ console.log('\n🎭 Installing Chromium (default browser)...\n');
565
+ execSync('npx playwright install --with-deps chromium', execOpts);
566
+ console.log('\n💡 To install other browsers: npm run install:browsers -- firefox webkit\n');
567
+ }
501
568
  }
502
569
 
503
570
  /**
@@ -516,15 +583,21 @@ export class ProjectInitializer {
516
583
  packageJson.scripts = {};
517
584
  }
518
585
 
519
- const standardScripts: Record<string, string> = {
520
- 'test': 'playwright test specs/generated/',
521
- 'test:headed': 'playwright test specs/generated/ --headed',
522
- 'test:debug': 'playwright test specs/generated/ --debug',
523
- 'test:ui': 'playwright test specs/generated/ --ui',
524
- 'report': 'playwright show-report',
525
- 'generate': 'sungen generate --all',
526
- 'install:browsers': 'npx playwright install',
527
- };
586
+ // Mobile-only projects get just the generate + mobile-run scripts (no Playwright web scripts).
587
+ const standardScripts: Record<string, string> = this.mobileOnly
588
+ ? {
589
+ 'generate': 'sungen generate --all',
590
+ 'test:mobile': 'wdio run wdio.conf.ts',
591
+ }
592
+ : {
593
+ 'test': 'playwright test specs/generated/',
594
+ 'test:headed': 'playwright test specs/generated/ --headed',
595
+ 'test:debug': 'playwright test specs/generated/ --debug',
596
+ 'test:ui': 'playwright test specs/generated/ --ui',
597
+ 'report': 'playwright show-report',
598
+ 'generate': 'sungen generate --all',
599
+ 'install:browsers': 'npx playwright install',
600
+ };
528
601
 
529
602
  let added = 0;
530
603
  for (const [name, command] of Object.entries(standardScripts)) {