@sun-asterisk/sungen 2.7.0-beta.0 → 3.0.0-beta.71

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 (256) hide show
  1. package/README.md +1 -1
  2. package/dist/cli/commands/add.js +3 -3
  3. package/dist/cli/commands/add.js.map +1 -1
  4. package/dist/cli/commands/audit.d.ts +3 -0
  5. package/dist/cli/commands/audit.d.ts.map +1 -0
  6. package/dist/cli/commands/audit.js +134 -0
  7. package/dist/cli/commands/audit.js.map +1 -0
  8. package/dist/cli/commands/blindspot.d.ts +3 -0
  9. package/dist/cli/commands/blindspot.d.ts.map +1 -0
  10. package/dist/cli/commands/blindspot.js +58 -0
  11. package/dist/cli/commands/blindspot.js.map +1 -0
  12. package/dist/cli/commands/challenge.d.ts +3 -0
  13. package/dist/cli/commands/challenge.d.ts.map +1 -0
  14. package/dist/cli/commands/challenge.js +102 -0
  15. package/dist/cli/commands/challenge.js.map +1 -0
  16. package/dist/cli/commands/feedback.d.ts +3 -0
  17. package/dist/cli/commands/feedback.d.ts.map +1 -0
  18. package/dist/cli/commands/feedback.js +72 -0
  19. package/dist/cli/commands/feedback.js.map +1 -0
  20. package/dist/cli/commands/generate.d.ts.map +1 -1
  21. package/dist/cli/commands/generate.js +22 -0
  22. package/dist/cli/commands/generate.js.map +1 -1
  23. package/dist/cli/commands/ledger.d.ts +3 -0
  24. package/dist/cli/commands/ledger.d.ts.map +1 -0
  25. package/dist/cli/commands/ledger.js +71 -0
  26. package/dist/cli/commands/ledger.js.map +1 -0
  27. package/dist/cli/commands/manifest.d.ts +3 -0
  28. package/dist/cli/commands/manifest.d.ts.map +1 -0
  29. package/dist/cli/commands/manifest.js +101 -0
  30. package/dist/cli/commands/manifest.js.map +1 -0
  31. package/dist/cli/commands/script-check.d.ts +3 -0
  32. package/dist/cli/commands/script-check.d.ts.map +1 -0
  33. package/dist/cli/commands/script-check.js +97 -0
  34. package/dist/cli/commands/script-check.js.map +1 -0
  35. package/dist/cli/commands/trace.d.ts +3 -0
  36. package/dist/cli/commands/trace.d.ts.map +1 -0
  37. package/dist/cli/commands/trace.js +110 -0
  38. package/dist/cli/commands/trace.js.map +1 -0
  39. package/dist/cli/commands/update.d.ts.map +1 -1
  40. package/dist/cli/commands/update.js +22 -9
  41. package/dist/cli/commands/update.js.map +1 -1
  42. package/dist/cli/index.js +16 -0
  43. package/dist/cli/index.js.map +1 -1
  44. package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/capture-variable.hbs +1 -0
  45. package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/all-contain-assertion.hbs +7 -0
  46. package/dist/generators/test-generator/patterns/capture-patterns.d.ts +16 -0
  47. package/dist/generators/test-generator/patterns/capture-patterns.d.ts.map +1 -0
  48. package/dist/generators/test-generator/patterns/capture-patterns.js +54 -0
  49. package/dist/generators/test-generator/patterns/capture-patterns.js.map +1 -0
  50. package/dist/generators/test-generator/patterns/index.d.ts.map +1 -1
  51. package/dist/generators/test-generator/patterns/index.js +2 -0
  52. package/dist/generators/test-generator/patterns/index.js.map +1 -1
  53. package/dist/generators/test-generator/step-mapper.d.ts.map +1 -1
  54. package/dist/generators/test-generator/step-mapper.js +1 -0
  55. package/dist/generators/test-generator/step-mapper.js.map +1 -1
  56. package/dist/generators/test-generator/utils/data-resolver.d.ts +5 -0
  57. package/dist/generators/test-generator/utils/data-resolver.d.ts.map +1 -1
  58. package/dist/generators/test-generator/utils/data-resolver.js +17 -0
  59. package/dist/generators/test-generator/utils/data-resolver.js.map +1 -1
  60. package/dist/harness/audit.d.ts +24 -0
  61. package/dist/harness/audit.d.ts.map +1 -0
  62. package/dist/harness/audit.js +115 -0
  63. package/dist/harness/audit.js.map +1 -0
  64. package/dist/harness/blindspot.d.ts +15 -0
  65. package/dist/harness/blindspot.d.ts.map +1 -0
  66. package/dist/harness/blindspot.js +85 -0
  67. package/dist/harness/blindspot.js.map +1 -0
  68. package/dist/harness/catalog/universal-viewpoints.yaml +114 -0
  69. package/dist/harness/challenge.d.ts +21 -0
  70. package/dist/harness/challenge.d.ts.map +1 -0
  71. package/dist/harness/challenge.js +151 -0
  72. package/dist/harness/challenge.js.map +1 -0
  73. package/dist/harness/feedback.d.ts +29 -0
  74. package/dist/harness/feedback.d.ts.map +1 -0
  75. package/dist/harness/feedback.js +106 -0
  76. package/dist/harness/feedback.js.map +1 -0
  77. package/dist/harness/intent.d.ts +11 -0
  78. package/dist/harness/intent.d.ts.map +1 -0
  79. package/dist/harness/intent.js +86 -0
  80. package/dist/harness/intent.js.map +1 -0
  81. package/dist/harness/ledger.d.ts +42 -0
  82. package/dist/harness/ledger.d.ts.map +1 -0
  83. package/dist/harness/ledger.js +171 -0
  84. package/dist/harness/ledger.js.map +1 -0
  85. package/dist/harness/manifest.d.ts +42 -0
  86. package/dist/harness/manifest.d.ts.map +1 -0
  87. package/dist/harness/manifest.js +209 -0
  88. package/dist/harness/manifest.js.map +1 -0
  89. package/dist/harness/parse.d.ts +22 -0
  90. package/dist/harness/parse.d.ts.map +1 -0
  91. package/dist/harness/parse.js +163 -0
  92. package/dist/harness/parse.js.map +1 -0
  93. package/dist/harness/script-check.d.ts +16 -0
  94. package/dist/harness/script-check.d.ts.map +1 -0
  95. package/dist/harness/script-check.js +169 -0
  96. package/dist/harness/script-check.js.map +1 -0
  97. package/dist/harness/secret-scan.d.ts +8 -0
  98. package/dist/harness/secret-scan.d.ts.map +1 -0
  99. package/dist/harness/secret-scan.js +88 -0
  100. package/dist/harness/secret-scan.js.map +1 -0
  101. package/dist/harness/sensors.d.ts +88 -0
  102. package/dist/harness/sensors.d.ts.map +1 -0
  103. package/dist/harness/sensors.js +232 -0
  104. package/dist/harness/sensors.js.map +1 -0
  105. package/dist/harness/trace.d.ts +31 -0
  106. package/dist/harness/trace.d.ts.map +1 -0
  107. package/dist/harness/trace.js +173 -0
  108. package/dist/harness/trace.js.map +1 -0
  109. package/dist/orchestrator/ai-rules-updater.d.ts +1 -0
  110. package/dist/orchestrator/ai-rules-updater.d.ts.map +1 -1
  111. package/dist/orchestrator/ai-rules-updater.js +55 -11
  112. package/dist/orchestrator/ai-rules-updater.js.map +1 -1
  113. package/dist/orchestrator/figma/spec-figma-renderer.d.ts +2 -2
  114. package/dist/orchestrator/figma/spec-figma-renderer.js +2 -2
  115. package/dist/orchestrator/figma/spec-figma-section-renderers.d.ts +1 -1
  116. package/dist/orchestrator/figma/spec-figma-section-renderers.js +1 -1
  117. package/dist/orchestrator/project-initializer.d.ts +5 -0
  118. package/dist/orchestrator/project-initializer.d.ts.map +1 -1
  119. package/dist/orchestrator/project-initializer.js +26 -6
  120. package/dist/orchestrator/project-initializer.js.map +1 -1
  121. package/dist/orchestrator/templates/ai-instructions/claude-agent-challenge.md +46 -0
  122. package/dist/orchestrator/templates/ai-instructions/claude-agent-discovery.md +32 -0
  123. package/dist/orchestrator/templates/ai-instructions/claude-agent-reviewer.md +37 -0
  124. package/dist/orchestrator/templates/ai-instructions/claude-cmd-add-flow.md +3 -3
  125. package/dist/orchestrator/templates/ai-instructions/claude-cmd-add-screen.md +5 -5
  126. package/dist/orchestrator/templates/ai-instructions/claude-cmd-create-test.md +45 -13
  127. package/dist/orchestrator/templates/ai-instructions/claude-cmd-design.md +12 -0
  128. package/dist/orchestrator/templates/ai-instructions/claude-cmd-feedback.md +36 -0
  129. package/dist/orchestrator/templates/ai-instructions/claude-cmd-review.md +27 -30
  130. package/dist/orchestrator/templates/ai-instructions/claude-cmd-run-test.md +8 -3
  131. package/dist/orchestrator/templates/ai-instructions/claude-config.md +1 -4
  132. package/dist/orchestrator/templates/ai-instructions/claude-skill-capture-mode-figma-mcp.md +82 -0
  133. package/dist/orchestrator/templates/ai-instructions/{github-skill-sungen-figma-source.md → claude-skill-capture-mode-figma-pat.md} +14 -48
  134. package/dist/orchestrator/templates/ai-instructions/claude-skill-capture-mode-live.md +60 -0
  135. package/dist/orchestrator/templates/ai-instructions/claude-skill-capture-mode-local.md +38 -0
  136. package/dist/orchestrator/templates/ai-instructions/claude-skill-capture.md +35 -0
  137. package/dist/orchestrator/templates/ai-instructions/claude-skill-harness-audit.md +84 -0
  138. package/dist/orchestrator/templates/ai-instructions/claude-skill-selector-fix.md +57 -11
  139. package/dist/orchestrator/templates/ai-instructions/claude-skill-selector-keys.md +41 -31
  140. package/dist/orchestrator/templates/ai-instructions/claude-skill-tc-generation.md +53 -1
  141. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-add-flow.md +3 -3
  142. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-add-screen.md +4 -4
  143. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-create-test.md +27 -11
  144. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-design.md +13 -0
  145. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-feedback.md +24 -0
  146. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-review.md +20 -30
  147. package/dist/orchestrator/templates/ai-instructions/copilot-cmd-run-test.md +6 -3
  148. package/dist/orchestrator/templates/ai-instructions/copilot-config.md +1 -4
  149. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-mcp.md +82 -0
  150. package/{src/orchestrator/templates/ai-instructions/claude-skill-figma-source.md → dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-pat.md} +14 -48
  151. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-live.md +60 -0
  152. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-local.md +38 -0
  153. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture.md +35 -0
  154. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-harness-audit.md +84 -0
  155. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix.md +62 -16
  156. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-keys.md +41 -31
  157. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +40 -1
  158. package/dist/orchestrator/templates/qa-context.md +90 -0
  159. package/dist/orchestrator/templates/readme.md +16 -13
  160. package/dist/orchestrator/templates/specs-test-data.ts +9 -0
  161. package/dist/tools/figma/figma-auth.d.ts +5 -2
  162. package/dist/tools/figma/figma-auth.d.ts.map +1 -1
  163. package/dist/tools/figma/figma-auth.js +19 -9
  164. package/dist/tools/figma/figma-auth.js.map +1 -1
  165. package/docs/orchestration-spec.md +267 -0
  166. package/package.json +10 -6
  167. package/src/cli/commands/add.ts +3 -3
  168. package/src/cli/commands/audit.ts +92 -0
  169. package/src/cli/commands/blindspot.ts +48 -0
  170. package/src/cli/commands/challenge.ts +55 -0
  171. package/src/cli/commands/feedback.ts +65 -0
  172. package/src/cli/commands/generate.ts +19 -0
  173. package/src/cli/commands/ledger.ts +61 -0
  174. package/src/cli/commands/manifest.ts +55 -0
  175. package/src/cli/commands/script-check.ts +50 -0
  176. package/src/cli/commands/trace.ts +60 -0
  177. package/src/cli/commands/update.ts +30 -10
  178. package/src/cli/index.ts +16 -0
  179. package/src/generators/test-generator/adapters/playwright/templates/steps/actions/capture-variable.hbs +1 -0
  180. package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/all-contain-assertion.hbs +7 -0
  181. package/src/generators/test-generator/patterns/capture-patterns.ts +59 -0
  182. package/src/generators/test-generator/patterns/index.ts +2 -0
  183. package/src/generators/test-generator/step-mapper.ts +1 -0
  184. package/src/generators/test-generator/utils/data-resolver.ts +20 -0
  185. package/src/harness/audit.ts +112 -0
  186. package/src/harness/blindspot.ts +51 -0
  187. package/src/harness/catalog/universal-viewpoints.yaml +114 -0
  188. package/src/harness/challenge.ts +131 -0
  189. package/src/harness/feedback.ts +84 -0
  190. package/src/harness/intent.ts +58 -0
  191. package/src/harness/ledger.ts +155 -0
  192. package/src/harness/manifest.ts +173 -0
  193. package/src/harness/parse.ts +145 -0
  194. package/src/harness/script-check.ts +149 -0
  195. package/src/harness/secret-scan.ts +51 -0
  196. package/src/harness/sensors.ts +279 -0
  197. package/src/harness/trace.ts +138 -0
  198. package/src/orchestrator/ai-rules-updater.ts +57 -10
  199. package/src/orchestrator/figma/spec-figma-renderer.ts +2 -2
  200. package/src/orchestrator/figma/spec-figma-section-renderers.ts +1 -1
  201. package/src/orchestrator/project-initializer.ts +30 -7
  202. package/src/orchestrator/templates/ai-instructions/claude-agent-challenge.md +46 -0
  203. package/src/orchestrator/templates/ai-instructions/claude-agent-discovery.md +32 -0
  204. package/src/orchestrator/templates/ai-instructions/claude-agent-reviewer.md +37 -0
  205. package/src/orchestrator/templates/ai-instructions/claude-cmd-add-flow.md +3 -3
  206. package/src/orchestrator/templates/ai-instructions/claude-cmd-add-screen.md +5 -5
  207. package/src/orchestrator/templates/ai-instructions/claude-cmd-create-test.md +45 -13
  208. package/src/orchestrator/templates/ai-instructions/claude-cmd-design.md +12 -0
  209. package/src/orchestrator/templates/ai-instructions/claude-cmd-feedback.md +36 -0
  210. package/src/orchestrator/templates/ai-instructions/claude-cmd-review.md +27 -30
  211. package/src/orchestrator/templates/ai-instructions/claude-cmd-run-test.md +8 -3
  212. package/src/orchestrator/templates/ai-instructions/claude-config.md +1 -4
  213. package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-figma-mcp.md +82 -0
  214. package/{dist/orchestrator/templates/ai-instructions/copilot-skill-figma-source.md → src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-figma-pat.md} +14 -48
  215. package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-live.md +60 -0
  216. package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-local.md +38 -0
  217. package/src/orchestrator/templates/ai-instructions/claude-skill-capture.md +35 -0
  218. package/src/orchestrator/templates/ai-instructions/claude-skill-harness-audit.md +84 -0
  219. package/src/orchestrator/templates/ai-instructions/claude-skill-selector-fix.md +57 -11
  220. package/src/orchestrator/templates/ai-instructions/claude-skill-selector-keys.md +41 -31
  221. package/src/orchestrator/templates/ai-instructions/claude-skill-tc-generation.md +53 -1
  222. package/src/orchestrator/templates/ai-instructions/copilot-cmd-add-flow.md +3 -3
  223. package/src/orchestrator/templates/ai-instructions/copilot-cmd-add-screen.md +4 -4
  224. package/src/orchestrator/templates/ai-instructions/copilot-cmd-create-test.md +27 -11
  225. package/src/orchestrator/templates/ai-instructions/copilot-cmd-design.md +13 -0
  226. package/src/orchestrator/templates/ai-instructions/copilot-cmd-feedback.md +24 -0
  227. package/src/orchestrator/templates/ai-instructions/copilot-cmd-review.md +20 -30
  228. package/src/orchestrator/templates/ai-instructions/copilot-cmd-run-test.md +6 -3
  229. package/src/orchestrator/templates/ai-instructions/copilot-config.md +1 -4
  230. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-mcp.md +82 -0
  231. package/{dist/orchestrator/templates/ai-instructions/claude-skill-figma-source.md → src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-pat.md} +14 -48
  232. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-live.md +60 -0
  233. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-local.md +38 -0
  234. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture.md +35 -0
  235. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-harness-audit.md +84 -0
  236. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix.md +62 -16
  237. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-keys.md +41 -31
  238. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +40 -1
  239. package/src/orchestrator/templates/qa-context.md +90 -0
  240. package/src/orchestrator/templates/readme.md +16 -13
  241. package/src/orchestrator/templates/specs-test-data.ts +9 -0
  242. package/src/tools/figma/figma-auth.ts +20 -9
  243. package/dist/orchestrator/templates/ai-instructions/claude-skill-capture-figma.md +0 -142
  244. package/dist/orchestrator/templates/ai-instructions/claude-skill-capture-live.md +0 -112
  245. package/dist/orchestrator/templates/ai-instructions/claude-skill-capture-local.md +0 -73
  246. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-figma.md +0 -142
  247. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-live.md +0 -112
  248. package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-local.md +0 -73
  249. package/src/orchestrator/templates/ai-instructions/claude-skill-capture-figma.md +0 -142
  250. package/src/orchestrator/templates/ai-instructions/claude-skill-capture-live.md +0 -112
  251. package/src/orchestrator/templates/ai-instructions/claude-skill-capture-local.md +0 -73
  252. package/src/orchestrator/templates/ai-instructions/copilot-skill-figma-source.md +0 -151
  253. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-figma.md +0 -142
  254. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-live.md +0 -112
  255. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-local.md +0 -73
  256. package/src/orchestrator/templates/ai-instructions/github-skill-sungen-figma-source.md +0 -151
@@ -1,112 +0,0 @@
1
- ---
2
- name: sungen-capture-live
3
- description: 'Capture a live running page via Playwright MCP — snapshot + screenshot for visual context. Auto-loaded by create-test when user picks Live page scan.'
4
- user-invocable: false
5
- ---
6
-
7
- ## Purpose
8
-
9
- Navigate a running application, take **one accessibility snapshot** and **one screenshot**, and save them as visual context for test generation. Use when the app is live (dev, staging, or production with read-only access) and you want the tests grounded in the actual rendered UI.
10
-
11
- This skill handles auth gracefully: if the page redirects to login, it asks the user to sign in manually rather than injecting cookies.
12
-
13
- ---
14
-
15
- ## Prerequisites
16
-
17
- - Playwright MCP connected.
18
- - Dev/staging server reachable (or a public URL).
19
- - `playwright.config.ts` exists at the project root (for `baseURL` fallback).
20
-
21
- ---
22
-
23
- ## Steps
24
-
25
- ### 1. Resolve target URL
26
-
27
- Resolve in this order:
28
-
29
- 1. `Live URL` field in `qa/screens/<screen>/requirements/spec.md` (Overview section)
30
- 2. `baseURL` from `playwright.config.ts` + `URL Path` from `spec.md`
31
- 3. If neither works → ask the user: *"Paste the full URL for the page to scan"*
32
-
33
- ### 2. Navigate
34
-
35
- `browser_navigate` to the resolved URL.
36
-
37
- ### 3. Handle auth redirect
38
-
39
- If the page redirects to a login route (URL contains `/login`, `/signin`, `/auth`, or the page title/content indicates a login screen):
40
-
41
- 1. Tell the user which login URL they landed on.
42
- 2. Ask the user:
43
- - **1) I'll log in manually** — wait for user confirmation, then re-navigate to the target URL
44
- - **2) Skip live scan** — tell caller to invoke `sungen-capture-local` instead
45
- - **3) Cancel**
46
- 3. **Never** inject cookies or localStorage via `browser_evaluate` or `browser_run_code`. Auth belongs to the user.
47
-
48
- ### 4. Snapshot
49
-
50
- Take **ONE** `browser_snapshot`. This accessibility tree is the primary AI context — it contains roles, names, text, and structure that the tc-generation skill uses to identify sections and fields.
51
-
52
- ### 5. Screenshot (optional but recommended)
53
-
54
- Take **ONE** `browser_take_screenshot` with `fullPage: true`. Save to:
55
-
56
- ```
57
- qa/screens/<screen>/requirements/ui/live-<timestamp>.png
58
- ```
59
-
60
- Where `<timestamp>` is `YYYYMMDD-HHMM` in local time (e.g. `live-20260421-1430.png`).
61
-
62
- This gives users a visual record they can reference later without re-scanning.
63
-
64
- ### 6a. Verify unauthenticated redirect target (flow capture only)
65
-
66
- When capturing for a **flow** that includes security scenarios (e.g., "unauthenticated user cannot access X"):
67
-
68
- 1. Open a **fresh incognito/unauthenticated** browser context (no storage state).
69
- 2. `browser_navigate` to the protected route (e.g., `/dashboard`).
70
- 3. Record the **actual redirect URL** — do NOT assume it goes to `/login`. The app may redirect to `/register`, `/`, or any other route.
71
- 4. Report the redirect target to the caller: *"Unauthenticated access to `/dashboard` redirects to `/register`"*.
72
- 5. The caller must use the **actual redirect URL** in Gherkin assertions (e.g., `Then User is on [Register] page`), never an assumed one.
73
-
74
- Skip this step if the flow has no security scenarios or the user explicitly says to skip.
75
-
76
- ### 6. Detect discrepancies vs spec
77
-
78
- If `spec.md` exists, briefly cross-check the snapshot against spec sections:
79
-
80
- - Fields listed in spec but not in snapshot → flag as *missing in UI*
81
- - Elements visible in snapshot but not in spec → flag as *missing in spec*
82
-
83
- Report findings but **do not** auto-edit `spec.md` — let the user decide.
84
-
85
- ### 7. Report back
86
-
87
- > Captured live page `<URL>`:
88
- > - Snapshot: <N> interactive elements detected
89
- > - Screenshot: `requirements/ui/live-<timestamp>.png`
90
- > - Discrepancies vs spec: <count, or "none">
91
-
92
- Hand back to the calling command.
93
-
94
- ---
95
-
96
- ## What this skill does NOT do
97
-
98
- - Does not run tests
99
- - Does not generate `selectors.yaml` (that's `/sungen-run-test`)
100
- - Does not inject auth state (user logs in manually)
101
- - Does not crawl — scans **exactly one** page per invocation
102
- - Does not generate Gherkin — that's `sungen-tc-generation`
103
-
104
- ---
105
-
106
- ## Relationship to other capture skills
107
-
108
- - `sungen-capture-figma` — design source of truth (pre-launch)
109
- - `sungen-capture-local` — any image the user dropped in `requirements/ui/`
110
- - `sungen-capture-live` — this skill, verifies/supplements against the running app
111
-
112
- All three write to `requirements/ui/` and report back to the caller. They are mutually exclusive per create-test run, but a user can run create-test multiple times with different sources to layer context.
@@ -1,73 +0,0 @@
1
- ---
2
- name: sungen-capture-local
3
- description: 'Load existing UI assets (screenshots, Figma exports, hand-drawn mockups) from requirements/ui/. Auto-loaded by create-test when user picks UI images as the visual source.'
4
- user-invocable: false
5
- ---
6
-
7
- ## Purpose
8
-
9
- Use **pre-existing images** in `qa/screens/<screen>/requirements/ui/` as visual context for test generation. No network, no MCP, no live site required — works for any design tool (Figma export, Sketch, Penpot, Zeplin, hand-drawn, screenshots of a staging env).
10
-
11
- This is the **baseline fallback**: if live domain is down and Figma MCP isn't configured, this always works as long as the user drops images in the folder.
12
-
13
- ---
14
-
15
- ## Steps
16
-
17
- ### 1. List available images
18
-
19
- Glob `qa/screens/<screen>/requirements/ui/*.{png,jpg,jpeg,webp,gif}` and report count + filenames.
20
-
21
- Filter out metadata files (e.g. `figma-meta.md` written by `sungen-capture-figma`) — those are read by `tc-generation` separately, not treated as images here.
22
-
23
- ### 2. Handle empty folder
24
-
25
- If no images found:
26
-
27
- 1. Tell the user the folder is empty, with the full path so they can navigate there in their file manager.
28
- 2. Ask the user to pick:
29
- - **1) I'll drop images now** — wait for user to confirm, then re-glob
30
- - **2) Switch to Figma URL** — tell caller to invoke `sungen-capture-figma` instead
31
- - **3) Switch to live page scan** — tell caller to invoke `sungen-capture-live` instead
32
- - **4) Cancel** — abort create-test
33
- 3. If user picks "drop images now", wait for their confirmation message (e.g. "done") then re-run step 1.
34
-
35
- ### 3. Read images for context
36
-
37
- Use the `read` tool on each image file — the assistant can read PNG/JPG/WebP directly as visual context.
38
-
39
- For large sets (>10 images), ask the user which are primary and which are states/variants, to avoid loading too much visual context at once.
40
-
41
- ### 4. Summarize
42
-
43
- Output a short summary:
44
-
45
- > Loaded N image(s) from `qa/screens/<screen>/requirements/ui/`:
46
- > - `<filename-1>` — <one-line description of what's visible>
47
- > - `<filename-2>` — <one-line description>
48
- > ...
49
-
50
- Hand back to the calling command.
51
-
52
- ---
53
-
54
- ## File naming hints for users
55
-
56
- When this skill reports back, nudge users toward consistent filenames so future runs are self-documenting:
57
-
58
- - `<section>-default.png` — baseline state of a section
59
- - `<section>-error.png` — error state
60
- - `<section>-loading.png` — loading state
61
- - `<section>-empty.png` — empty state
62
- - `full-page.png` / `viewport.png` — whole screen (auto-generated by `sungen add --capture`)
63
-
64
- Don't enforce — just suggest if filenames are ambiguous.
65
-
66
- ---
67
-
68
- ## What this skill does NOT do
69
-
70
- - Does not download images from external URLs
71
- - Does not generate images (no AI image generation)
72
- - Does not modify existing images (no crop/resize)
73
- - Does not generate Gherkin — that's `sungen-tc-generation`
@@ -1,151 +0,0 @@
1
- ---
2
- name: sungen-figma-source
3
- description: 'Figma URL → spec_figma.md envelope + LLM-synthesized narrative from cached raw node JSON. Auto-loaded when --figma flag present or spec_figma.md exists.'
4
- user-invocable: false
5
- ---
6
-
7
- ## When This Skill Loads
8
-
9
- Auto-load triggers (any one is sufficient):
10
-
11
- - Any sungen AI command invoked with `--figma` flag
12
- - `requirements/spec_figma.md` exists in the screen directory
13
- - User mentions a Figma URL or says "generate from Figma"
14
-
15
- ---
16
-
17
- ## Prerequisites
18
-
19
- - [ ] `sungen figma auth check` succeeds — PAT is stored and valid
20
- - [ ] Figma file URL is available (shared file or frame link)
21
- - [ ] If auth missing → run `sungen figma auth set` and follow the walkthrough
22
-
23
- **Never paste the PAT into any transcript, spec file, or commit.**
24
-
25
- ---
26
-
27
- ## Two-Layer Architecture
28
-
29
- `spec_figma.md` has two layers separated by the `<!-- SYNTHESIS-BELOW -->` marker:
30
-
31
- | Layer | Producer | Overwrite Rule |
32
- |---|---|---|
33
- | **Envelope** (above marker) | sungen CLI | Regenerated each `sungen figma` run — deterministic |
34
- | **Narrative** (below marker) | This skill (LLM) | Replaced on re-synthesis — everything from marker to EOF |
35
-
36
- The envelope contains: YAML frontmatter, Frame metadata, Screenshots. The narrative is synthesized by YOU from the cached raw Figma node JSON.
37
-
38
- ---
39
-
40
- ## Inputs You Read
41
-
42
- The scaffolder persists a raw (unfiltered) Figma node tree to:
43
-
44
- ```
45
- .sungen/figma-cache/<fileKey>/<versionId>/<nodeId>-raw.json
46
- ```
47
-
48
- Read this file + the envelope frontmatter of `requirements/spec_figma.md` + any PNGs under `requirements/ui/`. You MUST NOT call the Figma REST API directly — the PAT is not available to you.
49
-
50
- ---
51
-
52
- ## Synthesis Task
53
-
54
- Append 7 narrative sections below `<!-- SYNTHESIS-BELOW -->`. Each section is inferred from the raw node tree (names, types, `characters`, layout bounds, auto-layout direction, componentProperties):
55
-
56
- ### 1. Purpose
57
- One paragraph. What screen is this? Primary user goal? Infer from frame name + top-level text + dominant CTA.
58
-
59
- ### 2. ASCII Layout
60
- Rough spatial sketch using box characters. Reflect top-bottom / left-right ordering from absoluteBoundingBox. Keep under ~20 lines. Example:
61
-
62
- ```
63
- ┌──────────────────────────────────────┐
64
- │ [Logo] [Sign In] │
65
- ├──────────────────────────────────────┤
66
- │ Welcome back │
67
- │ ┌────────────────────────────────┐ │
68
- │ │ email@example.com │ │
69
- │ └────────────────────────────────┘ │
70
- │ [ Continue ] │
71
- └──────────────────────────────────────┘
72
- ```
73
-
74
- ### 3. Regions
75
- Bulleted list of the major layout regions (header, sidebar, main, footer, modal, etc.) with a one-line purpose each. Use auto-layout frames as region hints.
76
-
77
- ### 4. Actions
78
- Every interactive element the user can trigger. Derive from nodes whose name/type suggests a button, link, icon-button, menu-item, toggle, etc. Format:
79
-
80
- ```
81
- - **<Action name>** — <what it does> (source: <node name>)
82
- ```
83
-
84
- ### 5. Form Fields
85
- Every input the user can fill. Include label, type (text/email/password/select/checkbox/radio/textarea/date), required hint if inferable, and placeholder.
86
-
87
- ```
88
- | Label | Type | Required | Placeholder |
89
- |---|---|---|---|
90
- ```
91
-
92
- Omit entirely (write `_none_`) if no inputs exist.
93
-
94
- ### 6. Data Columns
95
- If the screen shows a table, list, or card grid — enumerate the columns/fields displayed per row. Otherwise write `_none_`.
96
-
97
- ### 7. Navigation
98
- Outgoing links, tab bars, breadcrumbs, back buttons — anything that moves the user to another screen. Include both explicit navigation components and implicit CTAs that navigate.
99
-
100
- ---
101
-
102
- ## Synthesis Workflow
103
-
104
- 1. Read `requirements/spec_figma.md` — note `file_key`, `node_id`, `figma_version_id` from frontmatter
105
- 2. Read `.sungen/figma-cache/<file_key>/<figma_version_id>/<safe_node_id>-raw.json` (colons in node_id become underscores)
106
- 3. Traverse the tree. Collect: names, types, `characters`, `componentProperties`, `absoluteBoundingBox`
107
- 4. Produce the 7 sections above
108
- 5. **Locate the insertion point** in `spec_figma.md`:
109
- - **If `<!-- SYNTHESIS-BELOW -->` is present** → replace everything from the marker (inclusive) to EOF with: the marker line, a blank line, then the 7 sections.
110
- - **If the marker is NOT present** (older `spec_figma.md` pre-envelope-refactor, or hand-edited file) → locate the last non-empty line of the envelope (usually the end of `## Screenshots`), append a blank line, then write the marker, another blank line, then the 7 sections. Do NOT delete any existing envelope content.
111
- - **If the file is missing entirely** → advise the user to re-run `sungen add --screen <screen> --figma <url> --refresh` to regenerate the envelope first. Do not fabricate one.
112
- 6. Preserve the envelope (frontmatter + Frame + Screenshots) byte-for-byte. Never touch content above the marker.
113
-
114
- ---
115
-
116
- ## Re-synthesis
117
-
118
- - If the envelope's `figma_version_id` changed → envelope is fresh; re-run synthesis
119
- - If only the narrative is stale (user wants a rewrite) → truncate from marker to EOF and regenerate
120
- - Never edit content ABOVE the marker — that is the scaffolder's territory
121
-
122
- ---
123
-
124
- ## Selector Heuristics (for downstream `run-test`)
125
-
126
- During `run-test` Phase 0, provisional selectors can be seeded from the raw JSON:
127
-
128
- | Figma Signal | Provisional YAML Entry |
129
- |---|---|
130
- | Node name ends `Button`, has text | `role: button` + `name: "<text>"` |
131
- | Node name ends `Input`/`Field` | `placeholder: "<placeholder text>"` |
132
- | Node name ends `Link`, has text | `role: link` + `name: "<text>"` |
133
- | componentProperties has `data-testid` | `testid: <value>` |
134
- | Plain text leaf (outside interactive) | `text: "<content>"` |
135
- | Node name ends `Icon` | `role: img` + `name: "<accessible name>"` |
136
-
137
- Every provisional entry MUST carry:
138
-
139
- ```
140
- # @needs-live-verify source=figma node_id=<id>
141
- ```
142
-
143
- Provisional selectors feed `selectors.yaml` as candidates. `run-test` Phase 0 verifies them against the live page and overwrites incorrect entries.
144
-
145
- ---
146
-
147
- ## Security
148
-
149
- - Never include the PAT in `spec_figma.md`, selectors, test data, or any committed file
150
- - Never log or echo the PAT in terminal output
151
- - Read only from `.sungen/figma-cache/` and screen directories — never from `.env`