@sun-asterisk/sungen 2.7.0-beta.1 → 3.0.0-beta.72
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.
- package/README.md +1 -1
- package/dist/cli/commands/add.js +3 -3
- package/dist/cli/commands/add.js.map +1 -1
- package/dist/cli/commands/audit.d.ts +3 -0
- package/dist/cli/commands/audit.d.ts.map +1 -0
- package/dist/cli/commands/audit.js +134 -0
- package/dist/cli/commands/audit.js.map +1 -0
- package/dist/cli/commands/blindspot.d.ts +3 -0
- package/dist/cli/commands/blindspot.d.ts.map +1 -0
- package/dist/cli/commands/blindspot.js +58 -0
- package/dist/cli/commands/blindspot.js.map +1 -0
- package/dist/cli/commands/capability.d.ts +3 -0
- package/dist/cli/commands/capability.d.ts.map +1 -0
- package/dist/cli/commands/capability.js +196 -0
- package/dist/cli/commands/capability.js.map +1 -0
- package/dist/cli/commands/challenge.d.ts +3 -0
- package/dist/cli/commands/challenge.d.ts.map +1 -0
- package/dist/cli/commands/challenge.js +102 -0
- package/dist/cli/commands/challenge.js.map +1 -0
- package/dist/cli/commands/feedback.d.ts +3 -0
- package/dist/cli/commands/feedback.d.ts.map +1 -0
- package/dist/cli/commands/feedback.js +72 -0
- package/dist/cli/commands/feedback.js.map +1 -0
- package/dist/cli/commands/flow-check.d.ts +3 -0
- package/dist/cli/commands/flow-check.d.ts.map +1 -0
- package/dist/cli/commands/flow-check.js +136 -0
- package/dist/cli/commands/flow-check.js.map +1 -0
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +50 -2
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/commands/ledger.d.ts +3 -0
- package/dist/cli/commands/ledger.d.ts.map +1 -0
- package/dist/cli/commands/ledger.js +71 -0
- package/dist/cli/commands/ledger.js.map +1 -0
- package/dist/cli/commands/manifest.d.ts +3 -0
- package/dist/cli/commands/manifest.d.ts.map +1 -0
- package/dist/cli/commands/manifest.js +101 -0
- package/dist/cli/commands/manifest.js.map +1 -0
- package/dist/cli/commands/script-check.d.ts +3 -0
- package/dist/cli/commands/script-check.d.ts.map +1 -0
- package/dist/cli/commands/script-check.js +97 -0
- package/dist/cli/commands/script-check.js.map +1 -0
- package/dist/cli/commands/trace.d.ts +3 -0
- package/dist/cli/commands/trace.d.ts.map +1 -0
- package/dist/cli/commands/trace.js +110 -0
- package/dist/cli/commands/trace.js.map +1 -0
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +22 -9
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/index.js +20 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/generators/test-generator/adapters/adapter-interface.d.ts +1 -0
- package/dist/generators/test-generator/adapters/adapter-interface.d.ts.map +1 -1
- package/dist/generators/test-generator/adapters/adapter-registry.d.ts +13 -0
- package/dist/generators/test-generator/adapters/adapter-registry.d.ts.map +1 -1
- package/dist/generators/test-generator/adapters/adapter-registry.js +73 -1
- package/dist/generators/test-generator/adapters/adapter-registry.js.map +1 -1
- package/dist/generators/test-generator/adapters/index.d.ts +1 -1
- package/dist/generators/test-generator/adapters/index.d.ts.map +1 -1
- package/dist/generators/test-generator/adapters/index.js +5 -1
- package/dist/generators/test-generator/adapters/index.js.map +1 -1
- package/dist/generators/test-generator/adapters/playwright/templates/steps/actions/capture-variable.hbs +1 -0
- package/dist/generators/test-generator/adapters/playwright/templates/steps/assertions/all-contain-assertion.hbs +7 -0
- package/dist/generators/test-generator/adapters/playwright/templates/test-file.hbs +6 -0
- package/dist/generators/test-generator/code-generator.d.ts.map +1 -1
- package/dist/generators/test-generator/code-generator.js +6 -2
- package/dist/generators/test-generator/code-generator.js.map +1 -1
- package/dist/generators/test-generator/patterns/capture-patterns.d.ts +16 -0
- package/dist/generators/test-generator/patterns/capture-patterns.d.ts.map +1 -0
- package/dist/generators/test-generator/patterns/capture-patterns.js +54 -0
- package/dist/generators/test-generator/patterns/capture-patterns.js.map +1 -0
- package/dist/generators/test-generator/patterns/form-patterns.d.ts.map +1 -1
- package/dist/generators/test-generator/patterns/form-patterns.js +3 -1
- package/dist/generators/test-generator/patterns/form-patterns.js.map +1 -1
- package/dist/generators/test-generator/patterns/index.d.ts.map +1 -1
- package/dist/generators/test-generator/patterns/index.js +2 -0
- package/dist/generators/test-generator/patterns/index.js.map +1 -1
- package/dist/generators/test-generator/step-mapper.d.ts.map +1 -1
- package/dist/generators/test-generator/step-mapper.js +1 -0
- package/dist/generators/test-generator/step-mapper.js.map +1 -1
- package/dist/generators/test-generator/utils/data-resolver.d.ts +5 -0
- package/dist/generators/test-generator/utils/data-resolver.d.ts.map +1 -1
- package/dist/generators/test-generator/utils/data-resolver.js +17 -0
- package/dist/generators/test-generator/utils/data-resolver.js.map +1 -1
- package/dist/generators/test-generator/utils/runtime-data-transformer.d.ts.map +1 -1
- package/dist/generators/test-generator/utils/runtime-data-transformer.js +4 -0
- package/dist/generators/test-generator/utils/runtime-data-transformer.js.map +1 -1
- package/dist/generators/test-generator/utils/selector-resolver.d.ts.map +1 -1
- package/dist/generators/test-generator/utils/selector-resolver.js +12 -6
- package/dist/generators/test-generator/utils/selector-resolver.js.map +1 -1
- package/dist/harness/audit.d.ts +24 -0
- package/dist/harness/audit.d.ts.map +1 -0
- package/dist/harness/audit.js +115 -0
- package/dist/harness/audit.js.map +1 -0
- package/dist/harness/blindspot.d.ts +15 -0
- package/dist/harness/blindspot.d.ts.map +1 -0
- package/dist/harness/blindspot.js +85 -0
- package/dist/harness/blindspot.js.map +1 -0
- package/dist/harness/capability-plan.d.ts +49 -0
- package/dist/harness/capability-plan.d.ts.map +1 -0
- package/dist/harness/capability-plan.js +215 -0
- package/dist/harness/capability-plan.js.map +1 -0
- package/dist/harness/capability.d.ts +23 -0
- package/dist/harness/capability.d.ts.map +1 -0
- package/dist/harness/capability.js +98 -0
- package/dist/harness/capability.js.map +1 -0
- package/dist/harness/catalog/drivers.yaml +57 -0
- package/dist/harness/catalog/universal-viewpoints.yaml +114 -0
- package/dist/harness/challenge.d.ts +21 -0
- package/dist/harness/challenge.d.ts.map +1 -0
- package/dist/harness/challenge.js +151 -0
- package/dist/harness/challenge.js.map +1 -0
- package/dist/harness/feedback.d.ts +29 -0
- package/dist/harness/feedback.d.ts.map +1 -0
- package/dist/harness/feedback.js +106 -0
- package/dist/harness/feedback.js.map +1 -0
- package/dist/harness/flow-check.d.ts +23 -0
- package/dist/harness/flow-check.d.ts.map +1 -0
- package/dist/harness/flow-check.js +132 -0
- package/dist/harness/flow-check.js.map +1 -0
- package/dist/harness/flow-plan.d.ts +23 -0
- package/dist/harness/flow-plan.d.ts.map +1 -0
- package/dist/harness/flow-plan.js +166 -0
- package/dist/harness/flow-plan.js.map +1 -0
- package/dist/harness/intent.d.ts +11 -0
- package/dist/harness/intent.d.ts.map +1 -0
- package/dist/harness/intent.js +86 -0
- package/dist/harness/intent.js.map +1 -0
- package/dist/harness/ledger.d.ts +42 -0
- package/dist/harness/ledger.d.ts.map +1 -0
- package/dist/harness/ledger.js +171 -0
- package/dist/harness/ledger.js.map +1 -0
- package/dist/harness/manifest.d.ts +42 -0
- package/dist/harness/manifest.d.ts.map +1 -0
- package/dist/harness/manifest.js +209 -0
- package/dist/harness/manifest.js.map +1 -0
- package/dist/harness/parse.d.ts +22 -0
- package/dist/harness/parse.d.ts.map +1 -0
- package/dist/harness/parse.js +163 -0
- package/dist/harness/parse.js.map +1 -0
- package/dist/harness/script-check.d.ts +39 -0
- package/dist/harness/script-check.d.ts.map +1 -0
- package/dist/harness/script-check.js +251 -0
- package/dist/harness/script-check.js.map +1 -0
- package/dist/harness/secret-scan.d.ts +8 -0
- package/dist/harness/secret-scan.d.ts.map +1 -0
- package/dist/harness/secret-scan.js +88 -0
- package/dist/harness/secret-scan.js.map +1 -0
- package/dist/harness/sensors.d.ts +88 -0
- package/dist/harness/sensors.d.ts.map +1 -0
- package/dist/harness/sensors.js +232 -0
- package/dist/harness/sensors.js.map +1 -0
- package/dist/harness/trace.d.ts +31 -0
- package/dist/harness/trace.d.ts.map +1 -0
- package/dist/harness/trace.js +173 -0
- package/dist/harness/trace.js.map +1 -0
- package/dist/orchestrator/ai-rules-updater.d.ts +1 -0
- package/dist/orchestrator/ai-rules-updater.d.ts.map +1 -1
- package/dist/orchestrator/ai-rules-updater.js +55 -11
- package/dist/orchestrator/ai-rules-updater.js.map +1 -1
- package/dist/orchestrator/figma/spec-figma-renderer.d.ts +2 -2
- package/dist/orchestrator/figma/spec-figma-renderer.js +2 -2
- package/dist/orchestrator/figma/spec-figma-section-renderers.d.ts +1 -1
- package/dist/orchestrator/figma/spec-figma-section-renderers.js +1 -1
- package/dist/orchestrator/project-initializer.d.ts +5 -0
- package/dist/orchestrator/project-initializer.d.ts.map +1 -1
- package/dist/orchestrator/project-initializer.js +30 -6
- package/dist/orchestrator/project-initializer.js.map +1 -1
- package/dist/orchestrator/templates/ai-instructions/claude-agent-challenge.md +46 -0
- package/dist/orchestrator/templates/ai-instructions/claude-agent-discovery.md +32 -0
- package/dist/orchestrator/templates/ai-instructions/claude-agent-reviewer.md +37 -0
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-add-flow.md +3 -3
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-add-screen.md +5 -5
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-create-test.md +36 -12
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-design.md +12 -0
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-feedback.md +36 -0
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-review.md +27 -30
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-run-test.md +4 -1
- package/dist/orchestrator/templates/ai-instructions/claude-config.md +1 -4
- package/dist/orchestrator/templates/ai-instructions/claude-skill-capture-mode-figma-mcp.md +82 -0
- package/dist/orchestrator/templates/ai-instructions/{github-skill-sungen-figma-source.md → claude-skill-capture-mode-figma-pat.md} +14 -48
- package/dist/orchestrator/templates/ai-instructions/claude-skill-capture-mode-live.md +60 -0
- package/dist/orchestrator/templates/ai-instructions/claude-skill-capture-mode-local.md +38 -0
- package/dist/orchestrator/templates/ai-instructions/claude-skill-capture.md +35 -0
- package/dist/orchestrator/templates/ai-instructions/claude-skill-harness-audit.md +84 -0
- package/dist/orchestrator/templates/ai-instructions/claude-skill-tc-generation.md +40 -1
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-add-flow.md +3 -3
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-add-screen.md +4 -4
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-create-test.md +18 -10
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-design.md +13 -0
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-feedback.md +24 -0
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-review.md +20 -30
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-run-test.md +2 -1
- package/dist/orchestrator/templates/ai-instructions/copilot-config.md +1 -4
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-mcp.md +82 -0
- 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
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-live.md +60 -0
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-local.md +38 -0
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture.md +35 -0
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-harness-audit.md +84 -0
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix.md +1 -1
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +40 -1
- package/dist/orchestrator/templates/specs-test-data.ts +20 -6
- package/dist/tools/figma/figma-auth.d.ts +5 -2
- package/dist/tools/figma/figma-auth.d.ts.map +1 -1
- package/dist/tools/figma/figma-auth.js +19 -9
- package/dist/tools/figma/figma-auth.js.map +1 -1
- package/docs/orchestration-spec.md +267 -0
- package/package.json +12 -7
- package/src/cli/commands/add.ts +3 -3
- package/src/cli/commands/audit.ts +92 -0
- package/src/cli/commands/blindspot.ts +48 -0
- package/src/cli/commands/capability.ts +160 -0
- package/src/cli/commands/challenge.ts +55 -0
- package/src/cli/commands/feedback.ts +65 -0
- package/src/cli/commands/flow-check.ts +97 -0
- package/src/cli/commands/generate.ts +47 -2
- package/src/cli/commands/ledger.ts +61 -0
- package/src/cli/commands/manifest.ts +55 -0
- package/src/cli/commands/script-check.ts +50 -0
- package/src/cli/commands/trace.ts +60 -0
- package/src/cli/commands/update.ts +30 -10
- package/src/cli/index.ts +20 -0
- package/src/generators/test-generator/adapters/adapter-interface.ts +1 -0
- package/src/generators/test-generator/adapters/adapter-registry.ts +37 -0
- package/src/generators/test-generator/adapters/index.ts +4 -1
- package/src/generators/test-generator/adapters/playwright/templates/steps/actions/capture-variable.hbs +1 -0
- package/src/generators/test-generator/adapters/playwright/templates/steps/assertions/all-contain-assertion.hbs +7 -0
- package/src/generators/test-generator/adapters/playwright/templates/test-file.hbs +6 -0
- package/src/generators/test-generator/code-generator.ts +6 -2
- package/src/generators/test-generator/patterns/capture-patterns.ts +59 -0
- package/src/generators/test-generator/patterns/form-patterns.ts +3 -1
- package/src/generators/test-generator/patterns/index.ts +2 -0
- package/src/generators/test-generator/step-mapper.ts +1 -0
- package/src/generators/test-generator/utils/data-resolver.ts +20 -0
- package/src/generators/test-generator/utils/runtime-data-transformer.ts +8 -0
- package/src/generators/test-generator/utils/selector-resolver.ts +13 -6
- package/src/harness/audit.ts +112 -0
- package/src/harness/blindspot.ts +51 -0
- package/src/harness/capability-plan.ts +180 -0
- package/src/harness/capability.ts +75 -0
- package/src/harness/catalog/drivers.yaml +57 -0
- package/src/harness/catalog/universal-viewpoints.yaml +114 -0
- package/src/harness/challenge.ts +131 -0
- package/src/harness/feedback.ts +84 -0
- package/src/harness/flow-check.ts +99 -0
- package/src/harness/flow-plan.ts +135 -0
- package/src/harness/intent.ts +58 -0
- package/src/harness/ledger.ts +155 -0
- package/src/harness/manifest.ts +173 -0
- package/src/harness/parse.ts +145 -0
- package/src/harness/script-check.ts +222 -0
- package/src/harness/secret-scan.ts +51 -0
- package/src/harness/sensors.ts +279 -0
- package/src/harness/trace.ts +138 -0
- package/src/orchestrator/ai-rules-updater.ts +57 -10
- package/src/orchestrator/figma/spec-figma-renderer.ts +2 -2
- package/src/orchestrator/figma/spec-figma-section-renderers.ts +1 -1
- package/src/orchestrator/project-initializer.ts +33 -7
- package/src/orchestrator/templates/ai-instructions/claude-agent-challenge.md +46 -0
- package/src/orchestrator/templates/ai-instructions/claude-agent-discovery.md +32 -0
- package/src/orchestrator/templates/ai-instructions/claude-agent-reviewer.md +37 -0
- package/src/orchestrator/templates/ai-instructions/claude-cmd-add-flow.md +3 -3
- package/src/orchestrator/templates/ai-instructions/claude-cmd-add-screen.md +5 -5
- package/src/orchestrator/templates/ai-instructions/claude-cmd-create-test.md +36 -12
- package/src/orchestrator/templates/ai-instructions/claude-cmd-design.md +12 -0
- package/src/orchestrator/templates/ai-instructions/claude-cmd-feedback.md +36 -0
- package/src/orchestrator/templates/ai-instructions/claude-cmd-review.md +27 -30
- package/src/orchestrator/templates/ai-instructions/claude-cmd-run-test.md +4 -1
- package/src/orchestrator/templates/ai-instructions/claude-config.md +1 -4
- package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-figma-mcp.md +82 -0
- 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
- package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-live.md +60 -0
- package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-local.md +38 -0
- package/src/orchestrator/templates/ai-instructions/claude-skill-capture.md +35 -0
- package/src/orchestrator/templates/ai-instructions/claude-skill-harness-audit.md +84 -0
- package/src/orchestrator/templates/ai-instructions/claude-skill-tc-generation.md +40 -1
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-add-flow.md +3 -3
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-add-screen.md +4 -4
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-create-test.md +18 -10
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-design.md +13 -0
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-feedback.md +24 -0
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-review.md +20 -30
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-run-test.md +2 -1
- package/src/orchestrator/templates/ai-instructions/copilot-config.md +1 -4
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-mcp.md +82 -0
- 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
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-live.md +60 -0
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-local.md +38 -0
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture.md +35 -0
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-harness-audit.md +84 -0
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix.md +1 -1
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +40 -1
- package/src/orchestrator/templates/specs-test-data.ts +20 -6
- package/src/tools/figma/figma-auth.ts +20 -9
- package/dist/orchestrator/templates/ai-instructions/claude-skill-capture-figma.md +0 -142
- package/dist/orchestrator/templates/ai-instructions/claude-skill-capture-live.md +0 -112
- package/dist/orchestrator/templates/ai-instructions/claude-skill-capture-local.md +0 -73
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-figma.md +0 -142
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-live.md +0 -112
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-local.md +0 -73
- package/src/orchestrator/templates/ai-instructions/claude-skill-capture-figma.md +0 -142
- package/src/orchestrator/templates/ai-instructions/claude-skill-capture-live.md +0 -112
- package/src/orchestrator/templates/ai-instructions/claude-skill-capture-local.md +0 -73
- package/src/orchestrator/templates/ai-instructions/copilot-skill-figma-source.md +0 -151
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-figma.md +0 -142
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-live.md +0 -112
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-local.md +0 -73
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-figma-source.md +0 -151
|
@@ -48,9 +48,9 @@ Record the screen list — you will need it for:
|
|
|
48
48
|
### 2. Capture visual source
|
|
49
49
|
|
|
50
50
|
Ask: *"Pick a visual source for this flow's screens:"*
|
|
51
|
-
- **Figma designs** (Recommended for pre-launch) — invoke `sungen-capture
|
|
52
|
-
- **Live page scan** (dev/staging is up) — invoke `sungen-capture
|
|
53
|
-
- **Local images** — invoke `sungen-capture
|
|
51
|
+
- **Figma designs** (Recommended for pre-launch) — invoke `sungen-capture` skill (mode figma-mcp) for each screen
|
|
52
|
+
- **Live page scan** (dev/staging is up) — invoke `sungen-capture` skill (mode live) for each screen URL
|
|
53
|
+
- **Local images** — invoke `sungen-capture` skill (mode local) to load from `requirements/ui/`
|
|
54
54
|
- **Skip** — user will drop images manually into `requirements/ui/` later
|
|
55
55
|
|
|
56
56
|
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.
|
|
@@ -72,7 +72,7 @@ This CLI command automatically:
|
|
|
72
72
|
|
|
73
73
|
### 1a. Synthesize narrative sections (Figma branch only)
|
|
74
74
|
|
|
75
|
-
After `sungen add --figma` succeeds, the envelope of `spec_figma.md` is deterministic but the narrative below the `<!-- SYNTHESIS-BELOW -->` marker is empty. Invoke the `sungen-
|
|
75
|
+
After `sungen add --figma` succeeds, the envelope of `spec_figma.md` is deterministic but the narrative below the `<!-- SYNTHESIS-BELOW -->` marker is empty. Invoke the `sungen-capture` skill (mode figma-pat):
|
|
76
76
|
|
|
77
77
|
1. Read `qa/screens/${input:screen}/requirements/spec_figma.md` frontmatter for `file_key`, `node_id`, `figma_version_id`.
|
|
78
78
|
2. Read the cached raw node JSON at `.sungen/figma-cache/<file_key>/<figma_version_id>/<safe_node_id>-raw.json` (colons in node_id become underscores).
|
|
@@ -89,11 +89,11 @@ After `sungen add --figma` succeeds, the envelope of `spec_figma.md` is determin
|
|
|
89
89
|
|
|
90
90
|
**If Figma branch (Step 1) already downloaded PNGs** → visuals already exist. Offer:
|
|
91
91
|
- **1) Continue** — Figma visuals are enough (Recommended)
|
|
92
|
-
- **2) Also capture live page** — supplement Figma with real page scan (invoke `sungen-capture
|
|
92
|
+
- **2) Also capture live page** — supplement Figma with real page scan (invoke `sungen-capture` skill (mode live))
|
|
93
93
|
|
|
94
94
|
**If standard path (no --figma)** → go straight to source selection:
|
|
95
|
-
- **1) Figma design** (Recommended for pre-launch) — invoke `sungen-capture
|
|
96
|
-
- **2) Live page scan** (dev/staging is up) — invoke `sungen-capture
|
|
95
|
+
- **1) Figma design** (Recommended for pre-launch) — invoke `sungen-capture` skill (mode figma-mcp)
|
|
96
|
+
- **2) Live page scan** (dev/staging is up) — invoke `sungen-capture` skill (mode live)
|
|
97
97
|
- **3) Skip** — user will drop images manually into `requirements/ui/` later
|
|
98
98
|
|
|
99
99
|
Each capture skill writes outputs into `qa/screens/${input:screen}/requirements/ui/` and reports back. Do not inline capture logic here — delegate to the skill so behavior stays consistent with `/sungen-create-test`.
|
|
@@ -12,6 +12,8 @@ tools: [vscode, execute, read, agent, edit, search, web, browser, todo, 'playwri
|
|
|
12
12
|
|
|
13
13
|
You are a **Senior QA Engineer**. You structure test cases by viewpoint categories and translate UI into Gherkin test cases following the `sungen-gherkin-syntax` and `sungen-tc-generation` skills. **Tier 1 (critical+high) first** — expand coverage later. **Gherkin scenarios and test data only** — selectors are handled during `/sungen-run-test`.
|
|
14
14
|
|
|
15
|
+
**Quality is built in.** After generating, run a **harness loop**: `sungen audit` measures the output and you **repair the findings** until critical viewpoints are covered — the user does not ask for this. Use the `sungen-harness-audit` skill. (`/sungen-design` is an **alias** of this command.)
|
|
16
|
+
|
|
15
17
|
## Parameters
|
|
16
18
|
|
|
17
19
|
- **name** — ${input:name:screen or flow name (e.g., login, award-submission)}
|
|
@@ -44,35 +46,41 @@ You are a **Senior QA Engineer**. You structure test cases by viewpoint categori
|
|
|
44
46
|
**Auto-detect visual source** — do NOT ask the user to pick a source. Instead, check what already exists and use it:
|
|
45
47
|
1. If `spec_figma.md` exists → read it as Figma supplement (PAT flow already completed during `add-screen`). Do NOT call any `mcp__figma__*` tool.
|
|
46
48
|
2. If `ui/` has images (`.png`, `.jpg`, etc.) → read them for visual context (layout, element positions, states).
|
|
47
|
-
3. If neither exists → ask: *"No visual source found. Pick one:"*
|
|
48
|
-
- **1) Figma PAT** — ask for URL, run `sungen add --screen ${input:name} --figma '<url>'`, then
|
|
49
|
-
- **2) Figma MCP** —
|
|
50
|
-
- **3) Live page scan** —
|
|
49
|
+
3. If neither exists → ask: *"No visual source found. Pick one:"* — then invoke the **`sungen-capture`** skill with the matching **mode** (read only that mode's file):
|
|
50
|
+
- **1) Figma PAT** — ask for URL, run `sungen add --screen ${input:name} --figma '<url>'`, then `sungen-capture` **mode figma-pat**
|
|
51
|
+
- **2) Figma MCP** — `sungen-capture` **mode figma-mcp**
|
|
52
|
+
- **3) Live page scan** — `sungen-capture` **mode live**
|
|
51
53
|
- **4) Skip** — generate from spec.md only
|
|
52
54
|
|
|
55
|
+
(When `spec_figma.md` exists, that is also `sungen-capture` **mode figma-pat**; when `ui/` images exist, that is **mode local**.)
|
|
56
|
+
|
|
53
57
|
**Cross-check**: if both `spec.md` and visual sources exist, flag any discrepancies (missing fields, different labels) before moving on. When `spec_figma.md` is present, follow the Figma supplement rules in `sungen-tc-generation` skill (reading order, Text Inventory, conflict handling).
|
|
54
58
|
|
|
55
59
|
Summarize what you found in requirements and present to the user.
|
|
56
60
|
|
|
57
61
|
4. Follow the `sungen-tc-generation` skill for section identification, viewpoint generation, and output format. **For flows**, use the "Flow Test Generation" section in the skill. When requirements exist, use the "Requirements-Driven Generation" strategy. **For Tier 1**, apply the **Lightweight Guard** — verify required fields, validation rules, business rules, security checks, and key state transitions all have TCs after generation. **For Tier 2+**, **MUST** apply the full **Mapping Contract** — walk every `spec.md` section top-to-bottom and produce the indicated TCs per Table 1; handle `test-viewpoint.md` per Table 2. Do not silently skip sections. Present sections as a numbered list and let user pick.
|
|
58
62
|
5. Generate or update `.feature` + `test-data.yaml` following `sungen-gherkin-syntax` and `sungen-tc-generation` skills. **For flows**: use `[Screen:Element]` namespace format, namespace test-data by phase, add `@flow` tag.
|
|
59
|
-
|
|
63
|
+
5.5. **Quality gate & repair (harness — always run).** Per `sungen-harness-audit`: run `sungen audit --screen ${input:name}` (structural), THEN do an **independent semantic review inline** using the `sungen-reviewer` criteria (does each scenario's steps PROVE its title/viewpoint? observable Thens? business-critical assertion depth?). Merge both sets of issues; if gate FAILs / findings exist, repair (budget 3) and re-audit — GATE missing theme → generate it (cross-screen → write data assertions, tag `@manual`, comment `# Deferred to a flow`); DEPTH → add data assertions; BALANCE → add business-core first; TRACE → align VP ids. Never fake a pass.
|
|
64
|
+
5.6. **Record.** `sungen manifest --screen ${input:name}`. Ledger **each phase** (not just repair) — pick one `runId` at the start and pass it so `trace`/`ledger report` show THIS run, not a mix: `sungen ledger record --screen ${input:name} --run <runId> --step <discovery|viewpoint|gherkin|audit|repair:N> --ms <elapsed>`. On re-run, start with `sungen manifest --screen ${input:name} --diff` and only regenerate changed sections.
|
|
65
|
+
6. **Converge — show the trace.** Run `sungen trace --screen ${input:name}` and present: process map (phases + repair rounds), bottlenecks, **HUMAN-LOOP FOCUS** (@manual to verify), audit score + gate + residual gaps. Then offer next steps based on which tier was just generated:
|
|
66
|
+
|
|
67
|
+
> The harness gate + reviewer already ran above — `/sungen-review` is the independent checkpoint (hand/prompt-authored or pre-delivery), not a needed next step here.
|
|
68
|
+
|
|
69
|
+
**Optional — exploration mode (Loop 2).** The suite above is the deterministic official output. To push past "same output every time", offer the **challenge pass**: run `sungen challenge --screen ${input:name}` (deterministic structural critics), then apply the `sungen-challenge` criteria inline for semantic + novelty candidates. Advisory only — surfaces blind spots + ≤20% novelty candidates, never auto-merges. Record a confirmed recurring miss with `sungen blindspot add` so future runs don't repeat it.
|
|
60
70
|
|
|
61
71
|
**After Tier 1 generation:**
|
|
62
|
-
- **`/sungen-
|
|
63
|
-
- **`/sungen-run-test ${input:name}`** — Skip review, generate selectors and run tests now
|
|
72
|
+
- **`/sungen-run-test ${input:name}`** — Generate selectors and run tests now (Recommended)
|
|
64
73
|
- **`/sungen-create-test ${input:name}`** — Expand coverage: add @normal + @low scenarios (Tier 2)
|
|
65
74
|
- **Done for now** — I'll come back later
|
|
66
75
|
|
|
67
76
|
**After Tier 2 generation:**
|
|
68
77
|
- **`/sungen-create-test ${input:name}`** — Deep coverage: add BVA combos, cross-field validation, negative inputs, race conditions (Tier 3) (Recommended)
|
|
69
|
-
- **`/sungen-review ${input:name}`** — Review syntax, coverage, viewpoint quality
|
|
70
78
|
- **`/sungen-run-test ${input:name}`** — Generate selectors and run tests now
|
|
71
79
|
- **Done for now** — I'll come back later
|
|
72
80
|
|
|
73
81
|
**After Tier 3 or Full generation:**
|
|
74
|
-
- **`/sungen-
|
|
75
|
-
- **`/sungen-
|
|
82
|
+
- **`/sungen-run-test ${input:name}`** — Generate selectors and run tests now (Recommended)
|
|
83
|
+
- **`/sungen-create-test ${input:name}`** — Add more sections if the screen changed
|
|
76
84
|
- **Done for now** — I'll come back later
|
|
77
85
|
|
|
78
86
|
**No selectors.yaml** — selectors are generated during `/sungen-run-test`.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sungen-design
|
|
3
|
+
description: 'Alias of create-test. Generates test cases AND runs the quality harness (gate + repair). Kept for discoverability; create-test now does this by default.'
|
|
4
|
+
argument-hint: '[screen-name]'
|
|
5
|
+
agent: 'agent'
|
|
6
|
+
tools: [vscode, execute, read, agent, edit, search, web, browser, todo, 'playwright/*']
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## `/sungen-design` is an alias of `/sungen-create-test`
|
|
10
|
+
|
|
11
|
+
As of v3.0 the quality harness (discovery → viewpoint overview → generate → **`sungen audit` gate → repair loop** → manifest/ledger) is built into **`/sungen-create-test`** by default — no second command needed for quality.
|
|
12
|
+
|
|
13
|
+
**Do exactly what `/sungen-create-test <name>` does** — follow that command verbatim, including the mandatory harness gate & repair step and the `sungen-harness-audit` skill. This entry exists only to keep the `design` name discoverable.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sungen-feedback
|
|
3
|
+
description: 'Record QA feedback locally (test-design knowledge or product telemetry). Auto-attaches context and stores to .sungen/feedback/.'
|
|
4
|
+
argument-hint: '[message]'
|
|
5
|
+
agent: 'agent'
|
|
6
|
+
tools: [vscode, execute, read, search]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Role
|
|
10
|
+
Capture QA feedback and store it **locally** (no server) via `sungen feedback record`. Closes the learning loop inside the project; the harness can reuse it later.
|
|
11
|
+
|
|
12
|
+
## Steps
|
|
13
|
+
1. Read message from arguments (ask if empty).
|
|
14
|
+
2. **Classify**: `test-design` (viewpoint/scenario wrong/missing/duplicate/add), `product` (Sungen itself misbehaved), or `other`. Infer; confirm only if ambiguous.
|
|
15
|
+
3. **Auto-attach context** (don't make the user repeat): `--screen <name>` (current focus), `--target <ref>` (VP id / scenario / command / artifact), `--decision <accept|reject|edit|add|none>`, `--reason <text>`.
|
|
16
|
+
4. Run:
|
|
17
|
+
```bash
|
|
18
|
+
sungen feedback record --type <type> --screen <name> --target "<ref>" --decision <d> --message "<msg>" --reason "<why>"
|
|
19
|
+
```
|
|
20
|
+
5. Confirm what/where (`.sungen/feedback/feedback.jsonl`). It is **local**; cross-project sync is opt-in later.
|
|
21
|
+
6. If feedback implies an action (missing critical viewpoint), offer `sungen-design <name>` (regenerate with gate) or `sungen-add-flow` (cross-screen gap).
|
|
22
|
+
|
|
23
|
+
## Notes
|
|
24
|
+
- Never send anywhere — local file only. Keep `product` vs `test-design` distinct. View: `sungen feedback list`.
|
|
@@ -1,48 +1,38 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sungen-review
|
|
3
|
-
description: '
|
|
3
|
+
description: 'Independent quality checkpoint for test cases — runs the harness (audit gate + reviewer criteria + script-check) and presents one unified scorecard. Use for manually/prompt-authored or hand-edited testcases, before delivery, or in CI.'
|
|
4
4
|
argument-hint: '[screen-name]'
|
|
5
5
|
agent: 'agent'
|
|
6
|
-
tools: [vscode, read, edit, search, todo]
|
|
6
|
+
tools: [vscode, execute, read, edit, search, todo]
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
**Input**: Screen or flow name (e.g., `/sungen-review admin-users`).
|
|
10
10
|
|
|
11
11
|
## Role
|
|
12
12
|
|
|
13
|
-
You are
|
|
13
|
+
You are an **independent QA Reviewer** — you did not author these tests. You do **not** invent a parallel score; you run the **harness** and present its signals as a human scorecard. Skills: `sungen-tc-review` (presentation rubric), `sungen-viewpoint`, `sungen-gherkin-syntax`.
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## When this matters
|
|
16
16
|
|
|
17
|
-
- **
|
|
17
|
+
`/sungen-create-test` already runs the harness gate while generating, so you don't need to review right after it. Run `/sungen-review` when the harness did **not** run or you need an independent sign-off: hand/prompt-authored testcases, a hand-edited `.feature`, **before `/sungen-delivery`**, or in **CI**.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
## Parameters
|
|
20
|
+
- **name** — ${input:name:screen or flow name}
|
|
21
|
+
**Auto-detect context**: `qa/flows/<name>/` → flow, else `qa/screens/<name>/` → screen.
|
|
20
22
|
|
|
21
23
|
## Steps
|
|
22
24
|
|
|
23
|
-
1. **Enumerate
|
|
24
|
-
2. **
|
|
25
|
-
-
|
|
26
|
-
- Apply the
|
|
27
|
-
-
|
|
28
|
-
3. **
|
|
29
|
-
|
|
25
|
+
1. **Enumerate** `<base>/${input:name}/features/*.feature`. If none → `/sungen-create-test` first.
|
|
26
|
+
2. **Run the harness (source of truth) — no separate rubric:**
|
|
27
|
+
- `sungen audit --screen ${input:name}` → gate, business-weighted score, findings, gaps.
|
|
28
|
+
- Apply the **`sungen-reviewer` criteria inline** → semantic verdict (do steps prove the title? observable Then? business-critical depth? @manual justified?).
|
|
29
|
+
- `sungen script-check --screen ${input:name}` → spec is 1:1 with the Gherkin (flags hand-edit / stale drift; only if a spec exists).
|
|
30
|
+
3. **Unified scorecard** per feature, anchored on harness signals (the `sungen-tc-review` 7 dimensions are a presentation layer, not a competing score):
|
|
30
31
|
```
|
|
31
|
-
Feature
|
|
32
|
-
|
|
33
|
-
home.feature 88 PASS 0
|
|
34
|
-
home-modal.feature 64 CONDITIONAL 2
|
|
35
|
-
─────────────────────────────────────────────────────
|
|
36
|
-
Screen rollup (mean) 76 PASS
|
|
32
|
+
Feature Gate Score Reviewer Spec 1:1 Verdict
|
|
33
|
+
home.feature PASS 8.4/10 2 minor issues in-sync PASS
|
|
37
34
|
```
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
- "Unverified" = count of `@needs-live-verify` selectors (non-scoring). Show the full per-file report (dimension breakdown, recommendations, top issues) **only for files that are CONDITIONAL or FAIL**, or when the user asks for the deep report.
|
|
43
|
-
4. If any file is CONDITIONAL or FAIL and user confirms → update that file's test cases following `sungen-gherkin-syntax` and `sungen-tc-generation` skills, then re-review **only those files** (skip already-passing ones to save time).
|
|
44
|
-
5. After all files PASS (or user decides to proceed), offer next steps:
|
|
45
|
-
|
|
46
|
-
- **`/sungen-run-test ${input:name}`** — Generate selectors, compile, and run tests for **every feature** in this screen (Recommended)
|
|
47
|
-
- **`/sungen-create-test ${input:name}`** — Add more test cases before running
|
|
48
|
-
- **Done for now** — I'll come back later
|
|
35
|
+
PASS = gate PASS + reviewer clean + spec in-sync. Else CONDITIONAL/FAIL with findings + fixes. Score = audit score adjusted by unresolved reviewer issues — never contradicting the gate.
|
|
36
|
+
4. **Repair (on confirm)** — apply audit findings + reviewer fixes (use `remember`/`see all` per `sungen-harness-audit`), re-run step 2 on the affected file. On drift → `sungen generate` to resync (never hand-edit the spec).
|
|
37
|
+
5. **Trace + next** — `sungen trace --screen ${input:name}` (human-loop focus), then offer:
|
|
38
|
+
- **`/sungen-run-test ${input:name}`** (Recommended) · **`/sungen-delivery ${input:name}`** · **`/sungen-create-test ${input:name}`** · Done.
|
|
@@ -45,7 +45,7 @@ Skip when `--env` matches the base locale.
|
|
|
45
45
|
one browser_snapshot → cross-verify every [Reference] label vs snapshot name →
|
|
46
46
|
generate selectors.yaml (verified entries; explicit YAML for any label≠DOM-name mismatch)
|
|
47
47
|
NO → spec_figma.md exists in requirements/?
|
|
48
|
-
YES → provisional flow (sungen-figma-
|
|
48
|
+
YES → provisional flow (sungen-capture mode figma-pat + sungen-selector-fix skills):
|
|
49
49
|
1. Read filtered Figma node data from spec_figma.md (## Components + ## Text Inventory)
|
|
50
50
|
2. Apply selector priority from sungen-selector-fix § Step 3 (testid > role+name > label > placeholder > text > locator CSS last)
|
|
51
51
|
3. Write selectors.yaml — every provisional entry gets this comment on the line above:
|
|
@@ -83,6 +83,7 @@ Skip when `--env` matches the base locale.
|
|
|
83
83
|
6. **Phase 2 — Priority Wave**: Run all `@high` scenarios. Fix only failures from this wave. Max 2 attempts. Shared selectors fixed here cascade to later phases.
|
|
84
84
|
7. **Phase 3 — Full Run**: Run all tests. Fix only **new** failures (elements unique to `@normal`/`@low`). Max 1 attempt. Don't loop on low-priority failures.
|
|
85
85
|
8. **Phase 4 — Regression**: One final full run. Report results. No more fix loops.
|
|
86
|
+
9. **Integrity & trace (always run after the final run).** `sungen script-check --screen <name>` — verify the spec is a **1:1** of the Gherkin; if **DRIFT**, re-run `sungen generate --screen <name>` (never hand-edit the `.spec.ts` — auto-fix edits `selectors.yaml`). Then `sungen ledger record --screen <name> --step run --ms <elapsed>` and `sungen trace --screen <name>` to show the process map + bottlenecks + **HUMAN-LOOP FOCUS**.
|
|
86
87
|
|
|
87
88
|
## Playwright command guidelines
|
|
88
89
|
|
|
@@ -16,10 +16,7 @@ You generate 3 files for sungen — a Gherkin compiler that produces Playwright
|
|
|
16
16
|
| `sungen-selector-keys` | YAML key generation from `[Reference]` names, suffixes, lookup priority |
|
|
17
17
|
| `sungen-selector-fix` | Selector generation from live page, auto-fix strategy |
|
|
18
18
|
| `sungen-delivery` | Export Gherkin + Playwright results → CSV test case deliverable |
|
|
19
|
-
| `sungen-capture
|
|
20
|
-
| `sungen-capture-local` | Load existing UI assets (screenshots, mockups, Figma exports) from `requirements/ui/` |
|
|
21
|
-
| `sungen-capture-live` | Capture a live running page via Playwright MCP (snapshot + screenshot) |
|
|
22
|
-
| `sungen-figma-source` | Figma URL → spec_figma.md + ui/*.png + provisional selectors |
|
|
19
|
+
| `sungen-capture` | Acquire visual/design context — one skill, 4 modes: figma-mcp (Dev Mode MCP), figma-pat (URL → spec_figma.md), live (Playwright MCP scan), local (images in `requirements/ui/`) |
|
|
23
20
|
| `sungen-locale` | Bootstrap i18n — audit selectors, detect locale switch mechanism, generate test-data overlay |
|
|
24
21
|
|
|
25
22
|
## Workflow (7 AI commands)
|
package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-mcp.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Capture mode: figma-mcp
|
|
2
|
+
|
|
3
|
+
Pull **structured design data** (layout, typography, colors, component tree, design tokens) and a **PNG screenshot** from a Figma frame URL via the **Figma Dev Mode MCP**, so `sungen-tc-generation` can author Gherkin + test-data before a live domain exists. Use when the project is pre-launch or Figma is the source of truth and the live build lags the design.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- **Figma MCP server** (`https://mcp.figma.com/mcp`, HTTP transport) connected in `.mcp.json` — `sungen init` scaffolds this. On first use, Claude Code opens a browser for Figma OAuth. Official tools: `get_design_context`, `get_variable_defs`, `get_screenshot`.
|
|
8
|
+
- Figma account signed in with access to the file. **Dev/Full seats** get per-minute rate limits; **Starter/View seats** get monthly tool-call limits.
|
|
9
|
+
- A Figma URL with both **fileKey** and **nodeId**.
|
|
10
|
+
|
|
11
|
+
If the MCP is not connected, **do not fail silently** — tell the user:
|
|
12
|
+
> "Figma MCP not detected. Run `sungen init` to scaffold the config, or manually add `figma` with `url: https://mcp.figma.com/mcp` to `.mcp.json`. Then sign in when Claude Code prompts."
|
|
13
|
+
|
|
14
|
+
Then stop.
|
|
15
|
+
|
|
16
|
+
## Steps
|
|
17
|
+
|
|
18
|
+
### 1. Resolve Figma URL
|
|
19
|
+
|
|
20
|
+
Prefer in this order:
|
|
21
|
+
1. `Figma URL` field in `requirements/spec.md` (Overview section)
|
|
22
|
+
2. If empty/missing → `AskUserQuestion`: *"Paste the Figma frame URL"* (free text)
|
|
23
|
+
|
|
24
|
+
Accept any of these shapes:
|
|
25
|
+
```
|
|
26
|
+
https://www.figma.com/file/<fileKey>/<title>?node-id=<nodeId>
|
|
27
|
+
https://www.figma.com/design/<fileKey>/<title>?node-id=<nodeId>
|
|
28
|
+
https://www.figma.com/proto/<fileKey>/<title>?node-id=<nodeId>
|
|
29
|
+
```
|
|
30
|
+
Parse: `fileKey` = segment after `/file/`, `/design/`, or `/proto/`; `nodeId` = the `node-id` query param (pass `-` or `:` through as-is). If `node-id` is missing, ask the user to select a frame in Figma and copy the **frame URL** (not the file root).
|
|
31
|
+
|
|
32
|
+
### 2. Fetch design context
|
|
33
|
+
|
|
34
|
+
Call **both** in parallel:
|
|
35
|
+
```
|
|
36
|
+
get_design_context({ fileKey, nodeId })
|
|
37
|
+
get_variable_defs({ fileKey, nodeId })
|
|
38
|
+
```
|
|
39
|
+
`get_design_context` → layout, typography, colors, component structure, spacing. `get_variable_defs` → named design tokens.
|
|
40
|
+
|
|
41
|
+
### 3. Fetch screenshot
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
get_screenshot({ fileKey, nodeId })
|
|
45
|
+
```
|
|
46
|
+
Save the PNG to `requirements/ui/figma-<sanitized-nodeId>.png` (replace `:` and `-` with `_`, e.g. `42-15` → `figma-42_15.png`).
|
|
47
|
+
|
|
48
|
+
### 4. Write metadata dump
|
|
49
|
+
|
|
50
|
+
Combine design context + variables into `requirements/ui/figma-meta.md`:
|
|
51
|
+
```markdown
|
|
52
|
+
# Figma Capture — <nodeId>
|
|
53
|
+
**Source:** <full Figma URL>
|
|
54
|
+
**Captured:** <ISO date>
|
|
55
|
+
## Components
|
|
56
|
+
<component names + variants>
|
|
57
|
+
## Typography
|
|
58
|
+
<font families, sizes, weights, line heights>
|
|
59
|
+
## Colors
|
|
60
|
+
<color tokens + raw hex>
|
|
61
|
+
## Spacing & Layout
|
|
62
|
+
<spacing tokens, auto-layout specs>
|
|
63
|
+
## Text Content
|
|
64
|
+
<visible text strings — used by tc-generation to populate test-data>
|
|
65
|
+
```
|
|
66
|
+
Consumed by `sungen-tc-generation` as a secondary source alongside `spec.md`.
|
|
67
|
+
|
|
68
|
+
### 5. Report back
|
|
69
|
+
|
|
70
|
+
> Captured Figma frame `<nodeId>`: Components N · Text strings M · Design tokens K · Screenshot `requirements/ui/figma-<nodeId>.png` · Metadata `requirements/ui/figma-meta.md`
|
|
71
|
+
|
|
72
|
+
Then hand back to the calling command.
|
|
73
|
+
|
|
74
|
+
## Error handling
|
|
75
|
+
|
|
76
|
+
| Error | Action |
|
|
77
|
+
|---|---|
|
|
78
|
+
| MCP tool not available | Print setup instructions, stop, do not fall back silently |
|
|
79
|
+
| `fileKey` missing from URL | Ask user to paste a valid frame URL |
|
|
80
|
+
| `nodeId` missing from URL | Ask user to right-click a frame in Figma → *Copy link to selection* |
|
|
81
|
+
| `get_design_context` 403 | Ask user to check Dev Mode seat on that file |
|
|
82
|
+
| `get_screenshot` returns no image | Continue with metadata only; warn no PNG was captured |
|
|
@@ -1,18 +1,6 @@
|
|
|
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
|
-
---
|
|
1
|
+
# Capture mode: figma-pat
|
|
6
2
|
|
|
7
|
-
|
|
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
|
-
---
|
|
3
|
+
Figma URL → `spec_figma.md` envelope + LLM-synthesized narrative from cached raw node JSON. This mode is the active one when any of these is true: a sungen command was invoked with `--figma`, `requirements/spec_figma.md` exists, or the user says "generate from Figma".
|
|
16
4
|
|
|
17
5
|
## Prerequisites
|
|
18
6
|
|
|
@@ -22,8 +10,6 @@ Auto-load triggers (any one is sufficient):
|
|
|
22
10
|
|
|
23
11
|
**Never paste the PAT into any transcript, spec file, or commit.**
|
|
24
12
|
|
|
25
|
-
---
|
|
26
|
-
|
|
27
13
|
## Two-Layer Architecture
|
|
28
14
|
|
|
29
15
|
`spec_figma.md` has two layers separated by the `<!-- SYNTHESIS-BELOW -->` marker:
|
|
@@ -31,34 +17,27 @@ Auto-load triggers (any one is sufficient):
|
|
|
31
17
|
| Layer | Producer | Overwrite Rule |
|
|
32
18
|
|---|---|---|
|
|
33
19
|
| **Envelope** (above marker) | sungen CLI | Regenerated each `sungen figma` run — deterministic |
|
|
34
|
-
| **Narrative** (below marker) | This
|
|
20
|
+
| **Narrative** (below marker) | This mode (LLM) | Replaced on re-synthesis — everything from marker to EOF |
|
|
35
21
|
|
|
36
22
|
The envelope contains: YAML frontmatter, Frame metadata, Screenshots. The narrative is synthesized by YOU from the cached raw Figma node JSON.
|
|
37
23
|
|
|
38
|
-
---
|
|
39
|
-
|
|
40
24
|
## Inputs You Read
|
|
41
25
|
|
|
42
26
|
The scaffolder persists a raw (unfiltered) Figma node tree to:
|
|
43
|
-
|
|
44
27
|
```
|
|
45
28
|
.sungen/figma-cache/<fileKey>/<versionId>/<nodeId>-raw.json
|
|
46
29
|
```
|
|
47
|
-
|
|
48
30
|
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
31
|
|
|
50
|
-
---
|
|
51
|
-
|
|
52
32
|
## Synthesis Task
|
|
53
33
|
|
|
54
|
-
Append 7 narrative sections below `<!-- SYNTHESIS-BELOW -->`. Each
|
|
34
|
+
Append 7 narrative sections below `<!-- SYNTHESIS-BELOW -->`. Each is inferred from the raw node tree (names, types, `characters`, layout bounds, auto-layout direction, componentProperties):
|
|
55
35
|
|
|
56
36
|
### 1. Purpose
|
|
57
37
|
One paragraph. What screen is this? Primary user goal? Infer from frame name + top-level text + dominant CTA.
|
|
58
38
|
|
|
59
39
|
### 2. ASCII Layout
|
|
60
|
-
Rough spatial sketch using box characters. Reflect top-bottom / left-right ordering from absoluteBoundingBox. Keep under ~20 lines
|
|
61
|
-
|
|
40
|
+
Rough spatial sketch using box characters. Reflect top-bottom / left-right ordering from absoluteBoundingBox. Keep under ~20 lines:
|
|
62
41
|
```
|
|
63
42
|
┌──────────────────────────────────────┐
|
|
64
43
|
│ [Logo] [Sign In] │
|
|
@@ -72,55 +51,46 @@ Rough spatial sketch using box characters. Reflect top-bottom / left-right order
|
|
|
72
51
|
```
|
|
73
52
|
|
|
74
53
|
### 3. Regions
|
|
75
|
-
Bulleted list of
|
|
54
|
+
Bulleted list of major layout regions (header, sidebar, main, footer, modal…) with a one-line purpose each. Use auto-layout frames as region hints.
|
|
76
55
|
|
|
77
56
|
### 4. Actions
|
|
78
|
-
Every interactive element the user can trigger
|
|
79
|
-
|
|
57
|
+
Every interactive element the user can trigger (button, link, icon-button, menu-item, toggle…):
|
|
80
58
|
```
|
|
81
59
|
- **<Action name>** — <what it does> (source: <node name>)
|
|
82
60
|
```
|
|
83
61
|
|
|
84
62
|
### 5. Form Fields
|
|
85
|
-
Every input
|
|
86
|
-
|
|
63
|
+
Every input. Include label, type (text/email/password/select/checkbox/radio/textarea/date), required hint if inferable, placeholder:
|
|
87
64
|
```
|
|
88
65
|
| Label | Type | Required | Placeholder |
|
|
89
66
|
|---|---|---|---|
|
|
90
67
|
```
|
|
91
|
-
|
|
92
|
-
Omit entirely (write `_none_`) if no inputs exist.
|
|
68
|
+
Omit (write `_none_`) if no inputs exist.
|
|
93
69
|
|
|
94
70
|
### 6. Data Columns
|
|
95
|
-
If the screen shows a table
|
|
71
|
+
If the screen shows a table/list/card grid — enumerate the columns/fields per row. Otherwise `_none_`.
|
|
96
72
|
|
|
97
73
|
### 7. Navigation
|
|
98
|
-
Outgoing links, tab bars, breadcrumbs, back buttons — anything that moves
|
|
99
|
-
|
|
100
|
-
---
|
|
74
|
+
Outgoing links, tab bars, breadcrumbs, back buttons — anything that moves to another screen. Include explicit nav components and implicit CTAs that navigate.
|
|
101
75
|
|
|
102
76
|
## Synthesis Workflow
|
|
103
77
|
|
|
104
78
|
1. Read `requirements/spec_figma.md` — note `file_key`, `node_id`, `figma_version_id` from frontmatter
|
|
105
79
|
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
|
|
80
|
+
3. Traverse the tree. Collect names, types, `characters`, `componentProperties`, `absoluteBoundingBox`
|
|
107
81
|
4. Produce the 7 sections above
|
|
108
82
|
5. **Locate the insertion point** in `spec_figma.md`:
|
|
109
83
|
- **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
|
|
84
|
+
- **If the marker is NOT present** (older file or hand-edited) → locate the last non-empty line of the envelope (usually the end of `## Screenshots`), append a blank line, then the marker, another blank line, then the 7 sections. Do NOT delete any envelope content.
|
|
111
85
|
- **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
86
|
6. Preserve the envelope (frontmatter + Frame + Screenshots) byte-for-byte. Never touch content above the marker.
|
|
113
87
|
|
|
114
|
-
---
|
|
115
|
-
|
|
116
88
|
## Re-synthesis
|
|
117
89
|
|
|
118
90
|
- If the envelope's `figma_version_id` changed → envelope is fresh; re-run synthesis
|
|
119
|
-
- If only the narrative is stale
|
|
91
|
+
- If only the narrative is stale → truncate from marker to EOF and regenerate
|
|
120
92
|
- Never edit content ABOVE the marker — that is the scaffolder's territory
|
|
121
93
|
|
|
122
|
-
---
|
|
123
|
-
|
|
124
94
|
## Selector Heuristics (for downstream `run-test`)
|
|
125
95
|
|
|
126
96
|
During `run-test` Phase 0, provisional selectors can be seeded from the raw JSON:
|
|
@@ -135,15 +105,11 @@ During `run-test` Phase 0, provisional selectors can be seeded from the raw JSON
|
|
|
135
105
|
| Node name ends `Icon` | `role: img` + `name: "<accessible name>"` |
|
|
136
106
|
|
|
137
107
|
Every provisional entry MUST carry:
|
|
138
|
-
|
|
139
108
|
```
|
|
140
109
|
# @needs-live-verify source=figma node_id=<id>
|
|
141
110
|
```
|
|
142
|
-
|
|
143
111
|
Provisional selectors feed `selectors.yaml` as candidates. `run-test` Phase 0 verifies them against the live page and overwrites incorrect entries.
|
|
144
112
|
|
|
145
|
-
---
|
|
146
|
-
|
|
147
113
|
## Security
|
|
148
114
|
|
|
149
115
|
- Never include the PAT in `spec_figma.md`, selectors, test data, or any committed file
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Capture mode: live
|
|
2
|
+
|
|
3
|
+
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 tests grounded in the actual rendered UI. Handles auth gracefully: if the page redirects to login, ask the user to sign in manually rather than injecting cookies.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Playwright MCP connected.
|
|
8
|
+
- Dev/staging server reachable (or a public URL).
|
|
9
|
+
- `playwright.config.ts` exists at the project root (for `baseURL` fallback).
|
|
10
|
+
|
|
11
|
+
## Steps
|
|
12
|
+
|
|
13
|
+
### 1. Resolve target URL
|
|
14
|
+
|
|
15
|
+
1. `Live URL` field in `requirements/spec.md` (Overview section)
|
|
16
|
+
2. `baseURL` from `playwright.config.ts` + `URL Path` from `spec.md`
|
|
17
|
+
3. Neither → `AskUserQuestion`: *"Paste the full URL for the page to scan"*
|
|
18
|
+
|
|
19
|
+
### 2. Navigate
|
|
20
|
+
|
|
21
|
+
`browser_navigate` to the resolved URL.
|
|
22
|
+
|
|
23
|
+
### 3. Handle auth redirect
|
|
24
|
+
|
|
25
|
+
If the page redirects to a login route (URL contains `/login`, `/signin`, `/auth`, or content indicates a login screen):
|
|
26
|
+
1. Tell the user which login URL they landed on.
|
|
27
|
+
2. `AskUserQuestion`:
|
|
28
|
+
- **I'll log in manually** — wait for confirmation, then re-navigate to the target URL
|
|
29
|
+
- **Skip live scan** — switch to mode `local`
|
|
30
|
+
- **Cancel**
|
|
31
|
+
3. **Never** inject cookies or localStorage via `browser_evaluate` / `browser_run_code`. Auth belongs to the user.
|
|
32
|
+
|
|
33
|
+
### 4. Snapshot
|
|
34
|
+
|
|
35
|
+
Take **ONE** `browser_snapshot`. This accessibility tree is the primary AI context — roles, names, text, structure that tc-generation uses to identify sections and fields.
|
|
36
|
+
|
|
37
|
+
### 5. Screenshot (recommended)
|
|
38
|
+
|
|
39
|
+
Take **ONE** `browser_take_screenshot` with `fullPage: true`. Save to `requirements/ui/live-<timestamp>.png`, where `<timestamp>` is `YYYYMMDD-HHMM` local time (e.g. `live-20260421-1430.png`).
|
|
40
|
+
|
|
41
|
+
### 6a. Verify unauthenticated redirect target (flow capture only)
|
|
42
|
+
|
|
43
|
+
When capturing for a **flow** with security scenarios (e.g. "unauthenticated user cannot access X"):
|
|
44
|
+
1. Open a **fresh incognito/unauthenticated** context (no storage state).
|
|
45
|
+
2. `browser_navigate` to the protected route.
|
|
46
|
+
3. Record the **actual redirect URL** — do NOT assume `/login`; it may be `/register`, `/`, etc.
|
|
47
|
+
4. Report the redirect target: *"Unauthenticated access to `/dashboard` redirects to `/register`"*.
|
|
48
|
+
5. The caller must use the **actual redirect URL** in Gherkin assertions, never an assumed one.
|
|
49
|
+
|
|
50
|
+
Skip if the flow has no security scenarios or the user says to skip.
|
|
51
|
+
|
|
52
|
+
### 6. Detect discrepancies vs spec
|
|
53
|
+
|
|
54
|
+
If `spec.md` exists, cross-check the snapshot against spec sections: fields in spec but not in snapshot → *missing in UI*; elements in snapshot but not in spec → *missing in spec*. Report findings but **do not** auto-edit `spec.md`.
|
|
55
|
+
|
|
56
|
+
### 7. Report back
|
|
57
|
+
|
|
58
|
+
> Captured live page `<URL>`: Snapshot N interactive elements · Screenshot `requirements/ui/live-<timestamp>.png` · Discrepancies vs spec: <count or "none">
|
|
59
|
+
|
|
60
|
+
Hand back to the calling command. Scans **exactly one** page per invocation.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Capture mode: local
|
|
2
|
+
|
|
3
|
+
Use **pre-existing images** in `requirements/ui/` as visual context. No network, no MCP, no live site — works for any design tool (Figma export, Sketch, Penpot, Zeplin, hand-drawn, staging screenshots). This is the **baseline fallback**: if the live domain is down and Figma MCP isn't configured, this always works as long as the user drops images in the folder.
|
|
4
|
+
|
|
5
|
+
## Steps
|
|
6
|
+
|
|
7
|
+
### 1. List available images
|
|
8
|
+
|
|
9
|
+
Glob `requirements/ui/*.{png,jpg,jpeg,webp,gif}` and report count + filenames. Filter out metadata files (e.g. `figma-meta.md` written by mode figma-mcp) — those are read by `tc-generation` separately, not treated as images here.
|
|
10
|
+
|
|
11
|
+
### 2. Handle empty folder
|
|
12
|
+
|
|
13
|
+
If no images found:
|
|
14
|
+
1. Tell the user the folder is empty, with the full path so they can open it in Finder.
|
|
15
|
+
2. `AskUserQuestion`:
|
|
16
|
+
- **I'll drop images now** — wait for confirmation, then re-glob
|
|
17
|
+
- **Switch to Figma** — switch to mode `figma-mcp`
|
|
18
|
+
- **Switch to live page scan** — switch to mode `live`
|
|
19
|
+
- **Cancel** — abort create-test
|
|
20
|
+
3. If "drop images now", wait for confirmation (e.g. "done") then re-run step 1.
|
|
21
|
+
|
|
22
|
+
### 3. Read images for context
|
|
23
|
+
|
|
24
|
+
Use the `Read` tool on each image — Claude Code reads PNG/JPG/WebP directly as visual context. For large sets (>10 images), ask which are primary and which are states/variants to avoid loading too much at once.
|
|
25
|
+
|
|
26
|
+
### 4. Summarize
|
|
27
|
+
|
|
28
|
+
> Loaded N image(s) from `requirements/ui/`:
|
|
29
|
+
> - `<filename-1>` — <one-line description of what's visible>
|
|
30
|
+
> - `<filename-2>` — <one-line description>
|
|
31
|
+
|
|
32
|
+
Hand back to the calling command.
|
|
33
|
+
|
|
34
|
+
## File naming hints for users
|
|
35
|
+
|
|
36
|
+
Nudge users toward consistent filenames (don't enforce):
|
|
37
|
+
- `<section>-default.png` / `-error.png` / `-loading.png` / `-empty.png` — section states
|
|
38
|
+
- `full-page.png` / `viewport.png` — whole screen (auto-generated by `sungen add --capture`)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: sungen-capture
|
|
3
|
+
description: 'Acquire visual/design context for test generation from one of four sources (modes): figma-mcp, figma-pat, live, local. Auto-loaded by create-test/add-screen when a visual source is needed, or when --figma flag / spec_figma.md is present. Router skill — read only the mode file you need.'
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Bring **visual + design context** into test generation so `sungen-tc-generation` can author Gherkin + test-data grounded in the real UI. This is a **router**: pick exactly **one mode** for the run, then read only that mode's file. Do **not** read all four.
|
|
10
|
+
|
|
11
|
+
This skill never generates Gherkin or `selectors.yaml` — it only acquires context and reports back to the calling command.
|
|
12
|
+
|
|
13
|
+
## Pick the mode
|
|
14
|
+
|
|
15
|
+
| Mode | Read | Use when | Needs |
|
|
16
|
+
|---|---|---|---|
|
|
17
|
+
| **figma-mcp** | `mode-figma-mcp.md` | Pre-launch / Figma is source of truth, **Figma Dev Mode MCP** connected | Figma MCP + frame URL |
|
|
18
|
+
| **figma-pat** | `mode-figma-pat.md` | `--figma` flag was used, or `requirements/spec_figma.md` exists (synthesize narrative from cached raw node JSON) | `sungen figma auth` PAT |
|
|
19
|
+
| **live** | `mode-live.md` | App is running (dev/staging/prod read-only) and you want the actual rendered UI | Playwright MCP + reachable URL |
|
|
20
|
+
| **local** | `mode-local.md` | Images already dropped in `requirements/ui/` (any design tool, screenshots, mockups) — baseline fallback, no network | nothing |
|
|
21
|
+
|
|
22
|
+
### How the mode is chosen (when the caller didn't specify)
|
|
23
|
+
|
|
24
|
+
1. `requirements/spec_figma.md` exists → **figma-pat** (PAT flow already ran during `add-screen`).
|
|
25
|
+
2. `requirements/ui/` has images → **local**.
|
|
26
|
+
3. Neither → ask the user which source (figma-mcp / live / local), then load that one mode file.
|
|
27
|
+
|
|
28
|
+
Modes are **mutually exclusive per run**, but the user can run `create-test` again with a different mode to layer context. All modes write to `requirements/ui/` and report back.
|
|
29
|
+
|
|
30
|
+
## What this skill (any mode) does NOT do
|
|
31
|
+
|
|
32
|
+
- Does not generate Gherkin — that's `sungen-tc-generation`.
|
|
33
|
+
- Does not write `selectors.yaml` — that's `/sungen:run-test`.
|
|
34
|
+
- Does not inject auth/cookies — the user logs in manually (see `live`).
|
|
35
|
+
- Does not crawl or generate images.
|