@sun-asterisk/sungen 3.2.2-beta.9 → 3.2.3-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/capabilities/discover.d.ts.map +1 -1
- package/dist/capabilities/discover.js +26 -3
- package/dist/capabilities/discover.js.map +1 -1
- package/dist/cli/commands/add-flow.d.ts.map +1 -1
- package/dist/cli/commands/add-flow.js +2 -0
- package/dist/cli/commands/add-flow.js.map +1 -1
- package/dist/cli/commands/add.d.ts.map +1 -1
- package/dist/cli/commands/add.js +4 -0
- package/dist/cli/commands/add.js.map +1 -1
- package/dist/cli/commands/capability.d.ts.map +1 -1
- package/dist/cli/commands/capability.js +61 -0
- package/dist/cli/commands/capability.js.map +1 -1
- package/dist/cli/commands/delivery.d.ts.map +1 -1
- package/dist/cli/commands/delivery.js +89 -2
- package/dist/cli/commands/delivery.js.map +1 -1
- package/dist/cli/commands/eval.js +3 -3
- package/dist/cli/commands/eval.js.map +1 -1
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +2 -1
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +32 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/journey.d.ts.map +1 -1
- package/dist/cli/commands/journey.js +24 -2
- package/dist/cli/commands/journey.js.map +1 -1
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +10 -3
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/dashboard/snapshot-builder.d.ts.map +1 -1
- package/dist/dashboard/snapshot-builder.js +10 -1
- package/dist/dashboard/snapshot-builder.js.map +1 -1
- package/dist/exporters/csv-exporter.d.ts.map +1 -1
- package/dist/exporters/csv-exporter.js +3 -1
- package/dist/exporters/csv-exporter.js.map +1 -1
- package/dist/exporters/json-exporter.js +3 -1
- package/dist/exporters/json-exporter.js.map +1 -1
- package/dist/exporters/mobile-app-id.d.ts +22 -0
- package/dist/exporters/mobile-app-id.d.ts.map +1 -0
- package/dist/exporters/mobile-app-id.js +37 -0
- package/dist/exporters/mobile-app-id.js.map +1 -0
- package/dist/exporters/spec-parser.d.ts.map +1 -1
- package/dist/exporters/spec-parser.js +6 -2
- package/dist/exporters/spec-parser.js.map +1 -1
- package/dist/generators/test-generator/adapters/adapter-interface.d.ts +3 -0
- package/dist/generators/test-generator/adapters/adapter-interface.d.ts.map +1 -1
- package/dist/generators/test-generator/adapters/appium/templates/steps/actions/scroll-action.hbs +7 -4
- package/dist/generators/test-generator/adapters/appium/templates/steps/actions/toggle-action.hbs +20 -3
- package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/checked-assertion.hbs +4 -1
- package/dist/generators/test-generator/adapters/appium/templates/steps/assertions/not-checked-assertion.hbs +4 -1
- package/dist/generators/test-generator/adapters/appium/templates/test-file.hbs +3 -0
- package/dist/generators/test-generator/code-generator.d.ts.map +1 -1
- package/dist/generators/test-generator/code-generator.js +48 -9
- package/dist/generators/test-generator/code-generator.js.map +1 -1
- package/dist/generators/test-generator/template-engine.d.ts +3 -0
- package/dist/generators/test-generator/template-engine.d.ts.map +1 -1
- package/dist/generators/test-generator/template-engine.js +11 -1
- package/dist/generators/test-generator/template-engine.js.map +1 -1
- package/dist/generators/test-generator/utils/selector-resolver.d.ts +11 -1
- package/dist/generators/test-generator/utils/selector-resolver.d.ts.map +1 -1
- package/dist/generators/test-generator/utils/selector-resolver.js +33 -0
- package/dist/generators/test-generator/utils/selector-resolver.js.map +1 -1
- package/dist/harness/audit.d.ts.map +1 -1
- package/dist/harness/audit.js +8 -1
- package/dist/harness/audit.js.map +1 -1
- package/dist/harness/catalog/universal-viewpoints.yaml +15 -0
- package/dist/harness/eval/skill-lint.d.ts +3 -3
- package/dist/harness/eval/skill-lint.d.ts.map +1 -1
- package/dist/harness/eval/skill-lint.js +88 -68
- package/dist/harness/eval/skill-lint.js.map +1 -1
- package/dist/harness/journey.d.ts +37 -1
- package/dist/harness/journey.d.ts.map +1 -1
- package/dist/harness/journey.js +146 -19
- package/dist/harness/journey.js.map +1 -1
- package/dist/harness/quality-gates.d.ts +13 -0
- package/dist/harness/quality-gates.d.ts.map +1 -1
- package/dist/harness/quality-gates.js +23 -0
- package/dist/harness/quality-gates.js.map +1 -1
- package/dist/harness/sensors.d.ts +1 -1
- package/dist/harness/sensors.d.ts.map +1 -1
- package/dist/harness/sensors.js +32 -9
- package/dist/harness/sensors.js.map +1 -1
- package/dist/orchestrator/ai-rules-updater.d.ts +11 -3
- package/dist/orchestrator/ai-rules-updater.d.ts.map +1 -1
- package/dist/orchestrator/ai-rules-updater.js +44 -180
- package/dist/orchestrator/ai-rules-updater.js.map +1 -1
- package/dist/orchestrator/ai-skills/adapters.d.ts +28 -0
- package/dist/orchestrator/ai-skills/adapters.d.ts.map +1 -0
- package/dist/orchestrator/ai-skills/adapters.js +34 -0
- package/dist/orchestrator/ai-skills/adapters.js.map +1 -0
- package/dist/orchestrator/ai-skills/build.d.ts +10 -0
- package/dist/orchestrator/ai-skills/build.d.ts.map +1 -0
- package/dist/orchestrator/ai-skills/build.js +128 -0
- package/dist/orchestrator/ai-skills/build.js.map +1 -0
- package/dist/orchestrator/ai-skills/cap-stripper.d.ts +27 -0
- package/dist/orchestrator/ai-skills/cap-stripper.d.ts.map +1 -0
- package/dist/orchestrator/ai-skills/cap-stripper.js +78 -0
- package/dist/orchestrator/ai-skills/cap-stripper.js.map +1 -0
- package/dist/orchestrator/ai-skills/commands.d.ts +22 -0
- package/dist/orchestrator/ai-skills/commands.d.ts.map +1 -0
- package/dist/orchestrator/ai-skills/commands.js +109 -0
- package/dist/orchestrator/ai-skills/commands.js.map +1 -0
- package/dist/orchestrator/ai-skills/generator.d.ts +23 -0
- package/dist/orchestrator/ai-skills/generator.d.ts.map +1 -0
- package/dist/orchestrator/ai-skills/generator.js +79 -0
- package/dist/orchestrator/ai-skills/generator.js.map +1 -0
- package/dist/orchestrator/ai-skills/golden-skills.test.d.ts +2 -0
- package/dist/orchestrator/ai-skills/golden-skills.test.d.ts.map +1 -0
- package/dist/orchestrator/ai-skills/golden-skills.test.js +183 -0
- package/dist/orchestrator/ai-skills/golden-skills.test.js.map +1 -0
- package/dist/orchestrator/ai-skills/resolve-assistants.d.ts +8 -0
- package/dist/orchestrator/ai-skills/resolve-assistants.d.ts.map +1 -0
- package/dist/orchestrator/ai-skills/resolve-assistants.js +28 -0
- package/dist/orchestrator/ai-skills/resolve-assistants.js.map +1 -0
- package/dist/orchestrator/ai-skills/writer.d.ts +15 -0
- package/dist/orchestrator/ai-skills/writer.d.ts.map +1 -0
- package/dist/orchestrator/ai-skills/writer.js +129 -0
- package/dist/orchestrator/ai-skills/writer.js.map +1 -0
- package/dist/orchestrator/flow-manager.d.ts +11 -0
- package/dist/orchestrator/flow-manager.d.ts.map +1 -1
- package/dist/orchestrator/flow-manager.js +147 -29
- package/dist/orchestrator/flow-manager.js.map +1 -1
- package/dist/orchestrator/mobile-runtime-scaffolder.d.ts +59 -0
- package/dist/orchestrator/mobile-runtime-scaffolder.d.ts.map +1 -0
- package/dist/orchestrator/mobile-runtime-scaffolder.js +298 -0
- package/dist/orchestrator/mobile-runtime-scaffolder.js.map +1 -0
- package/dist/orchestrator/project-initializer.d.ts +44 -7
- package/dist/orchestrator/project-initializer.d.ts.map +1 -1
- package/dist/orchestrator/project-initializer.js +147 -79
- package/dist/orchestrator/project-initializer.js.map +1 -1
- package/dist/orchestrator/screen-manager.d.ts +30 -0
- package/dist/orchestrator/screen-manager.d.ts.map +1 -1
- package/dist/orchestrator/screen-manager.js +205 -22
- package/dist/orchestrator/screen-manager.js.map +1 -1
- package/dist/orchestrator/templates/ai-src/README.md +58 -0
- package/dist/orchestrator/templates/{ai-instructions/claude-cmd-add-flow.md → ai-src/commands/add-flow.md} +63 -2
- package/dist/orchestrator/templates/{ai-instructions/claude-cmd-add-screen.md → ai-src/commands/add-screen.md} +171 -6
- package/dist/orchestrator/templates/{ai-instructions/claude-cmd-create-test.md → ai-src/commands/create-test.md} +118 -5
- package/{src/orchestrator/templates/ai-instructions/claude-cmd-dashboard.md → dist/orchestrator/templates/ai-src/commands/dashboard.md} +25 -3
- package/{src/orchestrator/templates/ai-instructions/claude-cmd-delivery.md → dist/orchestrator/templates/ai-src/commands/delivery.md} +67 -3
- package/dist/orchestrator/templates/ai-src/commands/design.md +29 -0
- package/{src/orchestrator/templates/ai-instructions/claude-cmd-feedback.md → dist/orchestrator/templates/ai-src/commands/feedback.md} +34 -3
- package/dist/orchestrator/templates/{ai-instructions/claude-cmd-locale.md → ai-src/commands/locale.md} +56 -4
- package/{src/orchestrator/templates/ai-instructions/claude-cmd-review.md → dist/orchestrator/templates/ai-src/commands/review.md} +57 -2
- package/dist/orchestrator/templates/{ai-instructions/claude-cmd-run-test.md → ai-src/commands/run-test.md} +116 -8
- package/dist/orchestrator/templates/ai-src/config/codex.md +8 -0
- package/{src/orchestrator/templates/ai-instructions/claude-skill-capture-mobile.md → dist/orchestrator/templates/ai-src/skills/sungen-capture-mobile/SKILL.md} +11 -0
- package/dist/orchestrator/templates/{ai-instructions/github-skill-sungen-error-mapping.md → ai-src/skills/sungen-error-mapping/SKILL.md} +31 -10
- package/{src/orchestrator/templates/ai-instructions/claude-skill-harness-audit.md → dist/orchestrator/templates/ai-src/skills/sungen-harness-audit/SKILL.md} +5 -5
- package/{src/orchestrator/templates/ai-instructions/claude-skill-locale.md → dist/orchestrator/templates/ai-src/skills/sungen-locale/SKILL.md} +275 -3
- package/{src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix.md → dist/orchestrator/templates/ai-src/skills/sungen-selector-fix/SKILL.md} +17 -0
- package/{src/orchestrator/templates/ai-instructions/claude-skill-selector-fix-mobile.md → dist/orchestrator/templates/ai-src/skills/sungen-selector-fix-mobile/SKILL.md} +5 -0
- package/dist/orchestrator/templates/{ai-instructions/claude-skill-tc-generation.md → ai-src/skills/sungen-tc-generation/SKILL.md} +5 -0
- package/dist/orchestrator/templates/playwright.config.ts +7 -4
- package/package.json +3 -3
- package/src/capabilities/discover.ts +29 -3
- package/src/cli/commands/add-flow.ts +2 -0
- package/src/cli/commands/add.ts +4 -0
- package/src/cli/commands/capability.ts +64 -1
- package/src/cli/commands/delivery.ts +89 -2
- package/src/cli/commands/eval.ts +3 -3
- package/src/cli/commands/generate.ts +2 -1
- package/src/cli/commands/init.ts +50 -3
- package/src/cli/commands/journey.ts +20 -3
- package/src/cli/commands/update.ts +14 -4
- package/src/dashboard/snapshot-builder.ts +10 -1
- package/src/exporters/csv-exporter.ts +3 -1
- package/src/exporters/json-exporter.ts +3 -1
- package/src/exporters/mobile-app-id.ts +34 -0
- package/src/exporters/spec-parser.ts +6 -2
- package/src/generators/test-generator/adapters/adapter-interface.ts +3 -0
- package/src/generators/test-generator/adapters/appium/templates/steps/actions/scroll-action.hbs +7 -4
- package/src/generators/test-generator/adapters/appium/templates/steps/actions/toggle-action.hbs +20 -3
- package/src/generators/test-generator/adapters/appium/templates/steps/assertions/checked-assertion.hbs +4 -1
- package/src/generators/test-generator/adapters/appium/templates/steps/assertions/not-checked-assertion.hbs +4 -1
- package/src/generators/test-generator/adapters/appium/templates/test-file.hbs +3 -0
- package/src/generators/test-generator/code-generator.ts +49 -9
- package/src/generators/test-generator/template-engine.ts +14 -1
- package/src/generators/test-generator/utils/selector-resolver.ts +51 -1
- package/src/harness/audit.ts +9 -2
- package/src/harness/catalog/universal-viewpoints.yaml +15 -0
- package/src/harness/eval/skill-lint.ts +71 -60
- package/src/harness/journey.ts +167 -19
- package/src/harness/quality-gates.ts +20 -0
- package/src/harness/sensors.ts +25 -8
- package/src/orchestrator/ai-rules-updater.ts +35 -197
- package/src/orchestrator/ai-skills/adapters.ts +52 -0
- package/src/orchestrator/ai-skills/build.ts +103 -0
- package/src/orchestrator/ai-skills/cap-stripper.ts +85 -0
- package/src/orchestrator/ai-skills/commands.ts +112 -0
- package/src/orchestrator/ai-skills/generator.ts +47 -0
- package/src/orchestrator/ai-skills/golden-skills.test.ts +124 -0
- package/src/orchestrator/ai-skills/resolve-assistants.ts +18 -0
- package/src/orchestrator/ai-skills/writer.ts +92 -0
- package/src/orchestrator/flow-manager.ts +165 -29
- package/src/orchestrator/mobile-runtime-scaffolder.ts +277 -0
- package/src/orchestrator/project-initializer.ts +159 -86
- package/src/orchestrator/screen-manager.ts +237 -22
- package/src/orchestrator/templates/ai-src/README.md +58 -0
- package/src/orchestrator/templates/{ai-instructions/claude-cmd-add-flow.md → ai-src/commands/add-flow.md} +63 -2
- package/src/orchestrator/templates/{ai-instructions/claude-cmd-add-screen.md → ai-src/commands/add-screen.md} +171 -6
- package/src/orchestrator/templates/{ai-instructions/claude-cmd-create-test.md → ai-src/commands/create-test.md} +118 -5
- package/{dist/orchestrator/templates/ai-instructions/claude-cmd-dashboard.md → src/orchestrator/templates/ai-src/commands/dashboard.md} +25 -3
- package/{dist/orchestrator/templates/ai-instructions/claude-cmd-delivery.md → src/orchestrator/templates/ai-src/commands/delivery.md} +67 -3
- package/src/orchestrator/templates/ai-src/commands/design.md +29 -0
- package/{dist/orchestrator/templates/ai-instructions/claude-cmd-feedback.md → src/orchestrator/templates/ai-src/commands/feedback.md} +34 -3
- package/src/orchestrator/templates/{ai-instructions/claude-cmd-locale.md → ai-src/commands/locale.md} +56 -4
- package/{dist/orchestrator/templates/ai-instructions/claude-cmd-review.md → src/orchestrator/templates/ai-src/commands/review.md} +57 -2
- package/src/orchestrator/templates/{ai-instructions/claude-cmd-run-test.md → ai-src/commands/run-test.md} +116 -8
- package/src/orchestrator/templates/ai-src/config/codex.md +8 -0
- package/{dist/orchestrator/templates/ai-instructions/claude-skill-capture-mobile.md → src/orchestrator/templates/ai-src/skills/sungen-capture-mobile/SKILL.md} +11 -0
- package/{dist/orchestrator/templates/ai-instructions/claude-skill-error-mapping.md → src/orchestrator/templates/ai-src/skills/sungen-error-mapping/SKILL.md} +31 -10
- package/{dist/orchestrator/templates/ai-instructions/claude-skill-harness-audit.md → src/orchestrator/templates/ai-src/skills/sungen-harness-audit/SKILL.md} +5 -5
- package/{dist/orchestrator/templates/ai-instructions/claude-skill-locale.md → src/orchestrator/templates/ai-src/skills/sungen-locale/SKILL.md} +275 -3
- package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix.md → src/orchestrator/templates/ai-src/skills/sungen-selector-fix/SKILL.md} +17 -0
- package/{dist/orchestrator/templates/ai-instructions/claude-skill-selector-fix-mobile.md → src/orchestrator/templates/ai-src/skills/sungen-selector-fix-mobile/SKILL.md} +5 -0
- package/src/orchestrator/templates/{ai-instructions/claude-skill-tc-generation.md → ai-src/skills/sungen-tc-generation/SKILL.md} +5 -0
- package/src/orchestrator/templates/playwright.config.ts +7 -4
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-design.md +0 -12
- package/dist/orchestrator/templates/ai-instructions/claude-skill-selector-fix.md +0 -347
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-add-flow.md +0 -86
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-add-screen.md +0 -131
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-create-test.md +0 -94
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-dashboard.md +0 -65
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-delivery.md +0 -83
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-design.md +0 -13
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-feedback.md +0 -24
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-locale.md +0 -70
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-review.md +0 -38
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-run-test.md +0 -158
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mobile.md +0 -184
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-harness-audit.md +0 -85
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-locale.md +0 -291
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix-mobile.md +0 -316
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-selector-keys.md +0 -221
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +0 -617
- package/src/orchestrator/templates/ai-instructions/claude-cmd-design.md +0 -12
- package/src/orchestrator/templates/ai-instructions/claude-skill-api-design.md +0 -62
- package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-figma-mcp.md +0 -82
- package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-figma-pat.md +0 -117
- package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-live.md +0 -60
- package/src/orchestrator/templates/ai-instructions/claude-skill-capture-mode-local.md +0 -38
- package/src/orchestrator/templates/ai-instructions/claude-skill-capture.md +0 -35
- package/src/orchestrator/templates/ai-instructions/claude-skill-dashboard.md +0 -121
- package/src/orchestrator/templates/ai-instructions/claude-skill-delivery.md +0 -141
- package/src/orchestrator/templates/ai-instructions/claude-skill-error-mapping.md +0 -176
- package/src/orchestrator/templates/ai-instructions/claude-skill-gherkin-syntax.md +0 -446
- package/src/orchestrator/templates/ai-instructions/claude-skill-ingest-legacy.md +0 -79
- package/src/orchestrator/templates/ai-instructions/claude-skill-mobile-gestures.md +0 -109
- package/src/orchestrator/templates/ai-instructions/claude-skill-selector-fix.md +0 -347
- package/src/orchestrator/templates/ai-instructions/claude-skill-tc-review.md +0 -320
- package/src/orchestrator/templates/ai-instructions/claude-skill-test-design-techniques.md +0 -118
- package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint-group-a-data-entry.md +0 -203
- package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint-group-b-data-ops.md +0 -179
- package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint-group-c-data-explore.md +0 -233
- package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint-group-d-display.md +0 -226
- package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint-group-e-identity.md +0 -177
- package/src/orchestrator/templates/ai-instructions/claude-skill-viewpoint.md +0 -118
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-add-flow.md +0 -86
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-add-screen.md +0 -131
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-create-test.md +0 -94
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-dashboard.md +0 -65
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-delivery.md +0 -83
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-design.md +0 -13
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-feedback.md +0 -24
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-locale.md +0 -70
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-review.md +0 -38
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-run-test.md +0 -158
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-api-design.md +0 -62
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mobile.md +0 -184
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-mcp.md +0 -82
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-pat.md +0 -117
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-live.md +0 -60
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-local.md +0 -38
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-capture.md +0 -35
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-dashboard.md +0 -121
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-delivery.md +0 -141
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-error-mapping.md +0 -176
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-gherkin-syntax.md +0 -446
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-harness-audit.md +0 -85
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-ingest-legacy.md +0 -79
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-locale.md +0 -291
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-mobile-gestures.md +0 -109
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-fix-mobile.md +0 -316
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-selector-keys.md +0 -221
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-tc-generation.md +0 -617
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-tc-review.md +0 -320
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-test-design-techniques.md +0 -118
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-a-data-entry.md +0 -203
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-b-data-ops.md +0 -179
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-c-data-explore.md +0 -233
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-d-display.md +0 -226
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-e-identity.md +0 -177
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint.md +0 -118
- /package/dist/orchestrator/templates/{ai-instructions/claude-agent-challenge.md → ai-src/agents/challenge.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-agent-discovery.md → ai-src/agents/discovery.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-agent-generator.md → ai-src/agents/generator.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-agent-reviewer.md → ai-src/agents/reviewer.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-config.md → ai-src/config/claude.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/copilot-config.md → ai-src/config/copilot.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-skill-api-design.md → ai-src/skills/sungen-api-design/SKILL.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-skill-capture.md → ai-src/skills/sungen-capture/SKILL.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-skill-capture-mode-figma-mcp.md → ai-src/skills/sungen-capture/mode-figma-mcp.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-skill-capture-mode-figma-pat.md → ai-src/skills/sungen-capture/mode-figma-pat.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-skill-capture-mode-live.md → ai-src/skills/sungen-capture/mode-live.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-skill-capture-mode-local.md → ai-src/skills/sungen-capture/mode-local.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-skill-dashboard.md → ai-src/skills/sungen-dashboard/SKILL.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-skill-delivery.md → ai-src/skills/sungen-delivery/SKILL.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-skill-gherkin-syntax.md → ai-src/skills/sungen-gherkin-syntax/SKILL.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-skill-ingest-legacy.md → ai-src/skills/sungen-ingest-legacy/SKILL.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-skill-mobile-gestures.md → ai-src/skills/sungen-mobile-gestures/SKILL.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-skill-selector-keys.md → ai-src/skills/sungen-selector-keys/SKILL.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-skill-tc-review.md → ai-src/skills/sungen-tc-review/SKILL.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-skill-test-design-techniques.md → ai-src/skills/sungen-test-design-techniques/SKILL.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint.md → ai-src/skills/sungen-viewpoint/SKILL.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint-group-a-data-entry.md → ai-src/skills/sungen-viewpoint/group-a-data-entry.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint-group-b-data-ops.md → ai-src/skills/sungen-viewpoint/group-b-data-ops.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint-group-c-data-explore.md → ai-src/skills/sungen-viewpoint/group-c-data-explore.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint-group-d-display.md → ai-src/skills/sungen-viewpoint/group-d-display.md} +0 -0
- /package/dist/orchestrator/templates/{ai-instructions/claude-skill-viewpoint-group-e-identity.md → ai-src/skills/sungen-viewpoint/group-e-identity.md} +0 -0
- /package/src/orchestrator/templates/{ai-instructions/claude-agent-challenge.md → ai-src/agents/challenge.md} +0 -0
- /package/src/orchestrator/templates/{ai-instructions/claude-agent-discovery.md → ai-src/agents/discovery.md} +0 -0
- /package/src/orchestrator/templates/{ai-instructions/claude-agent-generator.md → ai-src/agents/generator.md} +0 -0
- /package/src/orchestrator/templates/{ai-instructions/claude-agent-reviewer.md → ai-src/agents/reviewer.md} +0 -0
- /package/src/orchestrator/templates/{ai-instructions/claude-config.md → ai-src/config/claude.md} +0 -0
- /package/src/orchestrator/templates/{ai-instructions/copilot-config.md → ai-src/config/copilot.md} +0 -0
- /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-api-design.md → src/orchestrator/templates/ai-src/skills/sungen-api-design/SKILL.md} +0 -0
- /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture.md → src/orchestrator/templates/ai-src/skills/sungen-capture/SKILL.md} +0 -0
- /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-mcp.md → src/orchestrator/templates/ai-src/skills/sungen-capture/mode-figma-mcp.md} +0 -0
- /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-figma-pat.md → src/orchestrator/templates/ai-src/skills/sungen-capture/mode-figma-pat.md} +0 -0
- /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-live.md → src/orchestrator/templates/ai-src/skills/sungen-capture/mode-live.md} +0 -0
- /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-capture-mode-local.md → src/orchestrator/templates/ai-src/skills/sungen-capture/mode-local.md} +0 -0
- /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-dashboard.md → src/orchestrator/templates/ai-src/skills/sungen-dashboard/SKILL.md} +0 -0
- /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-delivery.md → src/orchestrator/templates/ai-src/skills/sungen-delivery/SKILL.md} +0 -0
- /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-gherkin-syntax.md → src/orchestrator/templates/ai-src/skills/sungen-gherkin-syntax/SKILL.md} +0 -0
- /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-ingest-legacy.md → src/orchestrator/templates/ai-src/skills/sungen-ingest-legacy/SKILL.md} +0 -0
- /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-mobile-gestures.md → src/orchestrator/templates/ai-src/skills/sungen-mobile-gestures/SKILL.md} +0 -0
- /package/src/orchestrator/templates/{ai-instructions/claude-skill-selector-keys.md → ai-src/skills/sungen-selector-keys/SKILL.md} +0 -0
- /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-tc-review.md → src/orchestrator/templates/ai-src/skills/sungen-tc-review/SKILL.md} +0 -0
- /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-test-design-techniques.md → src/orchestrator/templates/ai-src/skills/sungen-test-design-techniques/SKILL.md} +0 -0
- /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint.md → src/orchestrator/templates/ai-src/skills/sungen-viewpoint/SKILL.md} +0 -0
- /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-a-data-entry.md → src/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-a-data-entry.md} +0 -0
- /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-b-data-ops.md → src/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-b-data-ops.md} +0 -0
- /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-c-data-explore.md → src/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-c-data-explore.md} +0 -0
- /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-d-display.md → src/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-d-display.md} +0 -0
- /package/{dist/orchestrator/templates/ai-instructions/github-skill-sungen-viewpoint-group-e-identity.md → src/orchestrator/templates/ai-src/skills/sungen-viewpoint/group-e-identity.md} +0 -0
|
@@ -1,347 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: sungen-selector-fix
|
|
3
|
-
description: 'Selector fixing strategy — phased execution, priority-first diagnosis, targeted MCP exploration. Auto-loaded by run-test command.'
|
|
4
|
-
user-invocable: false
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Strategy: Phased Execution
|
|
8
|
-
|
|
9
|
-
Run tests in priority waves — catch fundamental issues early, fix critical paths first, let shared fixes cascade to lower-priority tests.
|
|
10
|
-
|
|
11
|
-
**Never run all tests blindly.** Always start with selector pre-generation, then a smoke check.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Phase 0: Pre-run Selector Generation (Playwright MCP)
|
|
16
|
-
|
|
17
|
-
**Before any `sungen generate` or test run**, populate `selectors.yaml` from the live page so tests don't fail on missing keys in Phase 1.
|
|
18
|
-
|
|
19
|
-
### When to run Phase 0
|
|
20
|
-
|
|
21
|
-
- `selectors.yaml` missing, empty, or contains only the page selector
|
|
22
|
-
- The `.feature` file has `[Reference]` keys without corresponding YAML entries and the referenced element can't be auto-inferred (see `sungen-selector-keys` § Auto-Infer)
|
|
23
|
-
- User explicitly re-scans after UI changes
|
|
24
|
-
|
|
25
|
-
If existing selectors already cover the feature file, **skip Phase 0** and go straight to compile + Phase 1.
|
|
26
|
-
|
|
27
|
-
### Flow Mode: Screen Selector Reference
|
|
28
|
-
|
|
29
|
-
When running Phase 0 for a **flow** (`qa/flows/<name>/`), check existing screen selectors first before snapshotting live pages. Screen selectors are already verified and proven — reuse them to save time and reduce errors.
|
|
30
|
-
|
|
31
|
-
**Steps (before the standard Phase 0 steps):**
|
|
32
|
-
|
|
33
|
-
1. **Parse screen references**: read the `.feature` file for `[Screen:Element]` references. Group by screen name (e.g., `Login`, `Awards`, `Dashboard`).
|
|
34
|
-
2. **For each referenced screen**, check `qa/screens/<screen>/selectors/<screen>.yaml`:
|
|
35
|
-
- **If exists** → copy matching entries to the flow's `selectors.yaml`, remapping keys to namespace format:
|
|
36
|
-
- Screen key `submit` with screen `login` → flow key `"login:submit"`
|
|
37
|
-
- Screen key `email-field` with screen `login` → flow key `"login:email-field"`
|
|
38
|
-
- Preserve the full selector definition (type, value, name, etc.)
|
|
39
|
-
- Mark these entries as **verified** (no `@needs-live-verify` comment needed)
|
|
40
|
-
- **If not found** → add this screen to the "needs live snapshot" list
|
|
41
|
-
3. **Elements not found in any screen selector** → also added to the "needs live snapshot" list
|
|
42
|
-
4. **If "needs live snapshot" list is empty** → Phase 0 screen-reference covered everything, skip to compile
|
|
43
|
-
5. **If "needs live snapshot" list is non-empty** → continue with the standard Phase 0 steps below, but only generate selectors for the missing elements (don't re-snapshot elements already copied from screens)
|
|
44
|
-
|
|
45
|
-
**Merge rule**: screen-referenced entries take priority over provisional (Figma-sourced) entries. If an element was previously generated from Figma with `@needs-live-verify`, the screen-verified entry replaces it.
|
|
46
|
-
|
|
47
|
-
**Important**: flow selectors remain private — they live in the flow's own YAML file. This is just initialization from screen data, not a runtime dependency.
|
|
48
|
-
|
|
49
|
-
### Steps
|
|
50
|
-
|
|
51
|
-
1. **Confirm with the user** via `AskUserQuestion`: *"Generate selectors from the live page via Playwright MCP now?"* — offer **Yes, scan live page** / **Skip (use existing selectors.yaml)** / **Cancel**.
|
|
52
|
-
2. **Collect references**: parse the `.feature` file for every `[Reference]` element + its type (e.g. `[Submit] button`, `[Email] field`). Deduplicate.
|
|
53
|
-
3. **Ensure page selector**: if missing, ask user for URL path and write it first.
|
|
54
|
-
4. **Navigate**:
|
|
55
|
-
- Read `baseURL` from `playwright.config.ts`.
|
|
56
|
-
- `browser_navigate` to the page URL.
|
|
57
|
-
- If redirected to login → run **Phase 0.5: Auth Persistence** first (see below), then re-navigate to the target page.
|
|
58
|
-
5. **Snapshot**: Wait for the page to fully load before snapshotting.
|
|
59
|
-
- Check if the page is still loading (spinner visible, skeleton placeholders, empty table with 0 rows). If so, use `browser_wait_for` to wait until content is rendered.
|
|
60
|
-
- Then take **ONE** `browser_snapshot`. All Phase 0 selectors come from this single snapshot.
|
|
61
|
-
6. **Generate YAML entries**:
|
|
62
|
-
- Keys: follow `sungen-selector-keys` (lowercase, Unicode preserved, `--type` / `--N` suffixes).
|
|
63
|
-
- Selector priority: follow the table in **Diagnosis & Fix § Step 3** (`testid` > `role`+name > `label` > `placeholder` > `text` > `locator` CSS last resort).
|
|
64
|
-
- Copy names **character-for-character** from the snapshot. Never infer from the Gherkin label.
|
|
65
|
-
- If an element is auto-inferable per `sungen-selector-keys` § Auto-Infer, **omit it** from YAML — keep the file minimal.
|
|
66
|
-
- **i18n sites**: if the site supports multiple languages, use `{{variable}}` in `name`/`value` fields instead of hardcoded text. Add corresponding `lbl_*` keys to `test-data.yaml` + locale overlay files (see `sungen-selector-keys` § i18n).
|
|
67
|
-
- **Selector quality rule**: the Playwright MCP accessibility tree snapshot gives you roles and accessible names directly — use them. Do NOT write XPath or class-based CSS selectors. Only write `type: locator` when no role/text/label/placeholder/testid is available, and restrict the CSS to `#id` or `[data-*]` / `[aria-*]` attribute selectors.
|
|
68
|
-
6b. **Cross-verify Gherkin labels vs snapshot** (prevents the #1 production failure):
|
|
69
|
-
- For **every** `[Reference]` in the `.feature` that will rely on auto-infer (not written to YAML), check the snapshot:
|
|
70
|
-
- `[X] button` — is there a button with accessible name **exactly** `X`?
|
|
71
|
-
- `[X] field` — does an input have placeholder **exactly** `X`? Does it even have a placeholder?
|
|
72
|
-
- `[X] heading` / `text` / `message` — is that text literally visible in the snapshot?
|
|
73
|
-
- If any mismatch → write an explicit YAML entry using the real DOM name. Do not leave a mismatch to be caught at runtime.
|
|
74
|
-
- **Typical mismatch cases**: Gherkin uses English label (`[Submit]`) but app displays Vietnamese (`"Gửi"`); placeholder is descriptive (`"Nhập email của bạn"`) not a bare field name (`"Email"`); button text includes an icon glyph before/after the word.
|
|
75
|
-
7. **Substring ambiguity check**: for each `role` + `name` selector, check if any other element in the snapshot has a name that **contains** this name as a substring (e.g., `"Đăng ký"` vs `"Đăng ký bằng Google"`). If yes → add `exact: true` to prevent strict mode violation at runtime.
|
|
76
|
-
8. **Merge, don't overwrite**: preserve the page selector and any user-authored entries in `selectors.yaml`. Only add missing keys.
|
|
77
|
-
9. **Show summary + confirm**: list the keys that will be added, ask the user to approve, then write the file.
|
|
78
|
-
10. **Compile**: **Screen**: `sungen generate --screen <screen>`. **Flow**: `sungen generate --flow <flow>`. Then proceed to Phase 1.
|
|
79
|
-
|
|
80
|
-
### Common Phase 0 pitfalls
|
|
81
|
-
|
|
82
|
-
- Writing keys inferred from the Gherkin label instead of the snapshot name → Phase 1 will fail with `No element found`.
|
|
83
|
-
- Skipping Phase 0.5 when an auth redirect happened → snapshot captures the login page, all selectors wrong.
|
|
84
|
-
- Taking snapshot while page is still loading (spinner visible, table empty) → selectors for dynamic content will be missing or wrong.
|
|
85
|
-
- Skipping step 6b for "simple" elements like buttons → silent mismatch between Gherkin label and DOM name fails at runtime.
|
|
86
|
-
- Using `browser_evaluate` alone to scrape cookies → misses httpOnly session cookies. Always use `browser_storage_state` (or the `browser_run_code` fallback).
|
|
87
|
-
- Writing XPath or class-based CSS selectors → breaks on DOM/style refactoring. Use role/testid/text/label/placeholder from the accessibility tree.
|
|
88
|
-
- Falling back to `locator: 'div.some-class > span'` when the element IS visible in the accessibility snapshot with a role + name → the snapshot gives you `getByRole` for free; use it.
|
|
89
|
-
- Overwriting user-authored selectors → always merge.
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
## Phase 0.5: Auth Persistence (MCP alternative to `sungen makeauth`)
|
|
94
|
-
|
|
95
|
-
Capture an authenticated session from the MCP browser into `specs/.auth/<role>.json` — the same path `sungen makeauth` writes to, which compiled tests already reference via `test.use({ storageState })` based on `@auth:<role>` tags. No `playwright.config.ts` edits needed. Run once per auth lifetime, not on every selector fix.
|
|
96
|
-
|
|
97
|
-
### When to run Phase 0.5
|
|
98
|
-
|
|
99
|
-
- Phase 0 navigation hit a login redirect and `specs/.auth/<role>.json` is missing or expired
|
|
100
|
-
- A scenario tagged `@auth:<role>` is about to run and its auth file is absent
|
|
101
|
-
- User asks to refresh auth
|
|
102
|
-
|
|
103
|
-
Skip if `specs/.auth/<role>.json` already exists and a probe navigation reaches an authenticated page without redirecting to login.
|
|
104
|
-
|
|
105
|
-
### Steps
|
|
106
|
-
|
|
107
|
-
1. **Resolve the role**:
|
|
108
|
-
- Look at the `.feature` file for `@auth:<role>` tags (feature-level or scenario-level). Pick the role for the scenario being run. If no tag exists, default to `user`.
|
|
109
|
-
- Target file: `specs/.auth/<role>.json`. Create `specs/.auth/` if missing.
|
|
110
|
-
- If the file already exists → use `AskUserQuestion` to confirm overwrite (mirrors the `(y/N)` prompt in `sungen makeauth`).
|
|
111
|
-
2. **Navigate to login**:
|
|
112
|
-
- Read `baseURL` from `playwright.config.ts` (fall back to `APP_BASE_URL` env, then `http://localhost:3000` — same resolution order as `sungen makeauth`).
|
|
113
|
-
- `browser_navigate` to `<baseURL>/login`. If the app uses a different login path, ask the user.
|
|
114
|
-
- If the URL doesn't stay on `/login` after load → user is already signed in. Skip step 3.
|
|
115
|
-
3. **Ask the user to log in manually** in the MCP browser (username, password, MFA, SSO — whatever the app needs). Never type credentials via `browser_type` or script the login. Wait for the user to confirm in chat that they're signed in.
|
|
116
|
-
4. **Verify login** — check the current URL or take a `browser_snapshot`; confirm the page is no longer on `/login`.
|
|
117
|
-
5. **Export storage state** (preferred → fallback):
|
|
118
|
-
- **Preferred** — `browser_storage_state` with `filename: "specs/.auth/<role>.json"` (native Playwright MCP tool; captures cookies including httpOnly + localStorage + sessionStorage via the Playwright context — same output format as `context.storageState({ path })` used by `sungen makeauth`).
|
|
119
|
-
- **Fallback** — if `browser_storage_state` isn't available in this MCP version, use `browser_run_code` to execute `await context.storageState({ path: 'specs/.auth/<role>.json' })`.
|
|
120
|
-
- **Do NOT** use `browser_evaluate` for auth export — it misses httpOnly cookies and session auth will fail silently.
|
|
121
|
-
6. **Gitignore** — ensure `specs/.auth/` (or `specs/.auth/*.json`) is in `.gitignore`. Add it if missing.
|
|
122
|
-
7. **Return to Phase 0 step 4** — re-`browser_navigate` to the target page; the session is now active.
|
|
123
|
-
|
|
124
|
-
### Phase 0.5 pitfalls
|
|
125
|
-
|
|
126
|
-
- Writing to a path other than `specs/.auth/<role>.json` → compiled tests won't find the file. Always match `sungen makeauth`'s convention.
|
|
127
|
-
- Committing `specs/.auth/*.json` → leaks a live session. Always gitignore.
|
|
128
|
-
- Scripting the login with `browser_type` → bypasses MFA/CAPTCHA and risks account lockout. Always manual.
|
|
129
|
-
- Running Phase 0.5 on every `run-test` invocation → unnecessary; reuse the file until tests start redirecting to login.
|
|
130
|
-
- Mismatch between `<role>` in the auth file and `@auth:<role>` tag → compiled tests reference a nonexistent file.
|
|
131
|
-
|
|
132
|
-
---
|
|
133
|
-
|
|
134
|
-
## Phase 1: Smoke Check (catch fundamentals)
|
|
135
|
-
|
|
136
|
-
Run **up to 5 scenarios** — pick the first `@high` scenarios in the feature file.
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
npx playwright test --grep "VP-.*-001|VP-.*-002|VP-.*-003|VP-.*-004|VP-.*-005" --reporter=line
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
**Purpose:** Detect broken fundamentals before running 50+ tests:
|
|
143
|
-
- Page selector wrong → ALL tests would fail (1 fix, not 50 diagnoses)
|
|
144
|
-
- Auth redirect → need `@no-auth` or user login
|
|
145
|
-
- Base `@steps:` scenario broken → all `@extend:` scenarios would fail
|
|
146
|
-
|
|
147
|
-
**If all 5 pass** → skip to Phase 2.
|
|
148
|
-
**If failures** → diagnose and fix (see Diagnosis & Fix below), then re-run smoke. Max 2 attempts here.
|
|
149
|
-
|
|
150
|
-
---
|
|
151
|
-
|
|
152
|
-
## Phase 2: Priority Wave (@high)
|
|
153
|
-
|
|
154
|
-
Run all `@high` scenarios:
|
|
155
|
-
|
|
156
|
-
```bash
|
|
157
|
-
npx playwright test --grep "@high" --reporter=line
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
If your Playwright config doesn't support tag grep, use scenario name grep from the feature file — collect VP IDs of `@high` scenarios.
|
|
161
|
-
|
|
162
|
-
**Fix only failures from this wave.** Most shared selectors (buttons, headings, navigation) get fixed here because critical/high scenarios exercise them.
|
|
163
|
-
|
|
164
|
-
Max 2 fix attempts in this phase.
|
|
165
|
-
|
|
166
|
-
---
|
|
167
|
-
|
|
168
|
-
## Phase 3: Full Run (@normal + @low)
|
|
169
|
-
|
|
170
|
-
Run remaining scenarios:
|
|
171
|
-
|
|
172
|
-
```bash
|
|
173
|
-
npx playwright test --reporter=line
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
Many selectors already fixed from Phase 2 (shared elements). Only diagnose **new** failures — selectors that only appear in lower-priority scenarios.
|
|
177
|
-
|
|
178
|
-
Max 1 fix attempt. If `@low` scenarios still fail after fix → **report and move on**, don't loop.
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
## Phase 4: Regression
|
|
183
|
-
|
|
184
|
-
One final full run to confirm all phases together:
|
|
185
|
-
|
|
186
|
-
```bash
|
|
187
|
-
npx playwright test --reporter=line
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
Report results. Do NOT enter another fix loop here.
|
|
191
|
-
|
|
192
|
-
---
|
|
193
|
-
|
|
194
|
-
## Diagnosis & Fix (used in each phase)
|
|
195
|
-
|
|
196
|
-
### Step 1: Parse Failures
|
|
197
|
-
|
|
198
|
-
| Error pattern | Root cause | Fix target |
|
|
199
|
-
|---|---|---|
|
|
200
|
-
| `No element found` / `strict mode violation` | Selector mismatch | `selectors.yaml` |
|
|
201
|
-
| `toBeVisible` timeout | Wrong name or missing element | `selectors.yaml` |
|
|
202
|
-
| `toHaveText` / `toHaveValue` mismatch | Wrong expected data | `test-data.yaml` |
|
|
203
|
-
| `page.goto` error | Wrong URL | page selector in `selectors.yaml` |
|
|
204
|
-
| `frame` error | Element inside iframe | add `frame` field |
|
|
205
|
-
|
|
206
|
-
**Group by root cause** — if 5 tests fail because `[Submit]` button has a different name, that's 1 fix, not 5.
|
|
207
|
-
|
|
208
|
-
**Check `test-results/` first** — Playwright captures failure screenshots automatically. Use these to diagnose before any MCP exploration.
|
|
209
|
-
|
|
210
|
-
### Step 2: Targeted MCP Exploration
|
|
211
|
-
|
|
212
|
-
Only when `test-results/` screenshots are insufficient:
|
|
213
|
-
|
|
214
|
-
1. Read `baseURL` from `playwright.config.ts`
|
|
215
|
-
2. `browser_navigate` to target page
|
|
216
|
-
3. If redirected to login → run **Phase 0.5: Auth Persistence**, then re-navigate
|
|
217
|
-
4. Take **ONE** `browser_snapshot` — fix all broken selectors from this single snapshot
|
|
218
|
-
|
|
219
|
-
Never use `browser_evaluate` to inject or read cookies (misses httpOnly). For auth, use Phase 0.5 or `sungen makeauth`.
|
|
220
|
-
|
|
221
|
-
### Step 3: Fix Broken Selectors
|
|
222
|
-
|
|
223
|
-
Selector priority (use first applicable):
|
|
224
|
-
|
|
225
|
-
| Priority | type | When |
|
|
226
|
-
|---|---|---|
|
|
227
|
-
| 1 | `testid` | `data-testid` or any stable test attribute exists |
|
|
228
|
-
| 2 | `role` + exact name | Interactive elements with an accessible name |
|
|
229
|
-
| 3 | `label` | Form field with a visible `<label>` |
|
|
230
|
-
| 4 | `placeholder` | Input/textarea with a placeholder attribute |
|
|
231
|
-
| 5 | `text` | Static visible text content |
|
|
232
|
-
| 6 | `locator` (CSS) | Last resort — `#id` or `[attr=value]` **only** (see restrictions below) |
|
|
233
|
-
|
|
234
|
-
> ⚠️ **Playwright best practice** ([source](https://playwright.dev/docs/best-practices#use-locators)): user-facing locators (`role`, `label`, `text`, `placeholder`, `testid`) are resilient to refactoring and far less likely to break. CSS class selectors and XPath break whenever a developer renames a class or restructures the DOM — even without changing the UI.
|
|
235
|
-
>
|
|
236
|
-
> **Never write these in `selectors.yaml`**:
|
|
237
|
-
> - XPath: `xpath=//div[@class='...']` or `//button[contains(@class,'btn')]`
|
|
238
|
-
> - Class-based CSS: `div.btn-primary`, `.modal-footer > .submit-btn`
|
|
239
|
-
> - Deep structural CSS: `div:nth-child(3) > ul > li > button`
|
|
240
|
-
>
|
|
241
|
-
> **Acceptable CSS (last resort only)**:
|
|
242
|
-
> - Stable `id`: `#submit-button` (only if the id is truly stable and not dynamic)
|
|
243
|
-
> - Data attributes: `[data-id="123"]`, `[aria-controls="menu"]`
|
|
244
|
-
> - Input type: `input[type="file"]` (when no testid/label exists)
|
|
245
|
-
|
|
246
|
-
**Exact name rule**: copy name character-for-character from snapshot. Never infer from Gherkin label.
|
|
247
|
-
|
|
248
|
-
Check for `data-testid` attributes if role-based matching fails:
|
|
249
|
-
```js
|
|
250
|
-
Array.from(document.querySelectorAll('[data-testid]'))
|
|
251
|
-
.map(e => ({ testid: e.dataset.testid, tag: e.tagName, text: e.textContent.trim().slice(0, 60) }))
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
Common fixes:
|
|
255
|
-
- Name mismatch → copy exact name from snapshot
|
|
256
|
-
- Multiple matches → add `nth` or `exact: true`
|
|
257
|
-
- Substring ambiguity (e.g., `"Submit"` matches `"Submit"` and `"Submit & Continue"`) → add `exact: true`
|
|
258
|
-
- No accessible name → use `testid`; only fall back to `locator` CSS as last resort
|
|
259
|
-
- Element in iframe → add `frame` field
|
|
260
|
-
- Dynamic content → use `testid` or `role` + `nth`
|
|
261
|
-
|
|
262
|
-
### Step 4: Recompile After Fix
|
|
263
|
-
|
|
264
|
-
Always recompile before re-running:
|
|
265
|
-
```bash
|
|
266
|
-
# Screen
|
|
267
|
-
sungen generate --screen <screen>
|
|
268
|
-
|
|
269
|
-
# Flow
|
|
270
|
-
sungen generate --flow <flow>
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
Then re-run only the current phase's failing tests, not all tests.
|
|
274
|
-
|
|
275
|
-
---
|
|
276
|
-
|
|
277
|
-
## Common Failure Patterns
|
|
278
|
-
|
|
279
|
-
Quick reference for the most frequent production failures:
|
|
280
|
-
|
|
281
|
-
| Symptom | Root cause | Fix |
|
|
282
|
-
|---------|-----------|-----|
|
|
283
|
-
| `No element found` on button/link/heading | Gherkin `[Reference]` label ≠ DOM accessible name (different language or text) | Write explicit YAML: `type: role, value: button, name: "<exact DOM name>"` |
|
|
284
|
-
| `No element found` on `[X] field` | Field has no placeholder, or placeholder ≠ X | Write explicit YAML: `type: label, value: "Actual label"` or `type: placeholder, value: "Actual placeholder"` |
|
|
285
|
-
| `No element found` on `[X] text` / `message` | Visible text differs from Gherkin label, or text is dynamic | Write explicit YAML or use `{{variable}}` for dynamic content |
|
|
286
|
-
| `strict mode violation` | Multiple elements match the same name/text | Add `exact: true` to YAML entry, or add `nth` |
|
|
287
|
-
| `toBeVisible` timeout on dynamic content | Snapshot was taken while page was still loading | Wait for spinner/skeleton to clear before snapshotting; add `browser_wait_for` |
|
|
288
|
-
| All tests fail with page navigate error | Page selector URL wrong or baseURL mismatch | Re-check `playwright.config.ts` `baseURL` and page selector `value` path |
|
|
289
|
-
| Auth redirect on every test | `specs/.auth/<role>.json` missing or expired | Run Phase 0.5 to capture fresh session |
|
|
290
|
-
| Table row assertions fail | `columns` config has wrong indices | Count column headers left-to-right (0-indexed) from snapshot |
|
|
291
|
-
| Wrong text assertions on locale page | Hardcoded Vietnamese/English text in YAML `name`/`value` | Use `{{lbl_*}}` variables with locale overlay files |
|
|
292
|
-
| Element inside iframe not found | `frame` field missing in YAML entry | Add `frame: "iframe[src*='...']"` to the selector entry |
|
|
293
|
-
| Selector breaks after UI redesign with no functional change | CSS class or XPath used — brittle to style refactoring | Rewrite with `role`/`testid`/`label`/`text` from accessibility snapshot |
|
|
294
|
-
|
|
295
|
-
---
|
|
296
|
-
|
|
297
|
-
## Table Selectors
|
|
298
|
-
|
|
299
|
-
For table patterns, add table selectors with `columns` config:
|
|
300
|
-
|
|
301
|
-
```yaml
|
|
302
|
-
users:
|
|
303
|
-
type: 'role'
|
|
304
|
-
value: 'table'
|
|
305
|
-
name: 'Users'
|
|
306
|
-
columns:
|
|
307
|
-
username:
|
|
308
|
-
index: 0
|
|
309
|
-
header: 'Username'
|
|
310
|
-
email:
|
|
311
|
-
index: 1
|
|
312
|
-
header: 'Email'
|
|
313
|
-
status:
|
|
314
|
-
index: 2
|
|
315
|
-
header: 'Status'
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
**How to build `columns`**: count column headers in snapshot (left to right, 0-indexed). Map each `[Col] column` reference from feature file to its index.
|
|
319
|
-
|
|
320
|
-
---
|
|
321
|
-
|
|
322
|
-
## Detail Screens with Dynamic IDs
|
|
323
|
-
|
|
324
|
-
For screens like `/admin/users/:id`:
|
|
325
|
-
1. Navigate to list page via MCP to find a real record ID
|
|
326
|
-
2. Hardcode the ID in page selector
|
|
327
|
-
|
|
328
|
-
```yaml
|
|
329
|
-
user detail:
|
|
330
|
-
type: 'page'
|
|
331
|
-
value: '/admin/users/de42d800-0f5a-490e-9dcf-344fedbd34a5'
|
|
332
|
-
```
|
|
333
|
-
|
|
334
|
-
---
|
|
335
|
-
|
|
336
|
-
## Attempt Budget Summary
|
|
337
|
-
|
|
338
|
-
| Phase | What runs | Max fix attempts | On failure after max |
|
|
339
|
-
|---|---|---|---|
|
|
340
|
-
| 0. Pre-gen | Playwright MCP snapshot → write selectors.yaml | 1 snapshot | Ask user — skip or retry navigation |
|
|
341
|
-
| 0.5. Auth | Manual login in MCP browser → `browser_storage_state` → `specs/.auth/<role>.json` | 1 login | Ask user — retry login or fall back to `sungen makeauth` |
|
|
342
|
-
| 1. Smoke | First 5 @high | 2 | Ask user — fundamentals broken |
|
|
343
|
-
| 2. Priority | All @high | 2 | Report failures, continue to Phase 3 |
|
|
344
|
-
| 3. Full | All tests | 1 | Report @low/@normal failures, continue |
|
|
345
|
-
| 4. Regression | All tests | 0 | Report final results |
|
|
346
|
-
|
|
347
|
-
**Total worst case: 5 fix attempts** (2+2+1), not unbounded loops. Phases 0 and 0.5 don't count toward fix budget.
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: sungen-add-flow
|
|
3
|
-
description: 'Add a new Sungen flow — scaffolds directories for E2E cross-screen testing, helps fill spec.md, and can capture visuals via the capture skills'
|
|
4
|
-
argument-hint: '[flow-name] [--path <start-url>]'
|
|
5
|
-
agent: 'agent'
|
|
6
|
-
tools: [vscode, execute, read, agent, edit, search, todo]
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
**Input**: Flow name and optional starting URL (e.g., `/sungen-add-flow award-submission --path /login`).
|
|
10
|
-
|
|
11
|
-
You are adding a new Sungen flow for E2E cross-screen test generation.
|
|
12
|
-
|
|
13
|
-
## Parameters
|
|
14
|
-
|
|
15
|
-
- **flow** — ${input:flow:flow name (e.g., award-submission, user-onboarding)}
|
|
16
|
-
- **--path \<url\>** — starting page URL path (default: `/login`)
|
|
17
|
-
- **--description \<text\>** — flow description (optional)
|
|
18
|
-
|
|
19
|
-
## Steps
|
|
20
|
-
|
|
21
|
-
### 1. Scaffold the flow
|
|
22
|
-
|
|
23
|
-
Run with #tool:terminal:
|
|
24
|
-
```bash
|
|
25
|
-
sungen add-flow --flow ${input:flow} --path ${input:path}
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
This creates:
|
|
29
|
-
```
|
|
30
|
-
qa/flows/${input:flow}/
|
|
31
|
-
├── features/${input:flow}.feature # Gherkin with @flow tag, Background, sample scenarios
|
|
32
|
-
├── selectors/${input:flow}.yaml # Namespaced keys: "login:submit", "awards:submit"
|
|
33
|
-
├── test-data/${input:flow}.yaml # Namespaced data: login.email, submission.nominee
|
|
34
|
-
└── requirements/
|
|
35
|
-
├── spec.md # Flow specification
|
|
36
|
-
└── ui/ # Screenshots, mockups
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### 1a. Identify the screens in the flow
|
|
40
|
-
|
|
41
|
-
Ask the user: "Which screens does this flow visit, in order? (e.g., login → dashboard → award-form → confirmation)"
|
|
42
|
-
|
|
43
|
-
Record the screen list — you will need it for:
|
|
44
|
-
- Filling `spec.md` (Step 3)
|
|
45
|
-
- Suggesting `[Screen:Element]` namespace prefixes
|
|
46
|
-
- Capturing visuals per screen (Step 2)
|
|
47
|
-
|
|
48
|
-
### 2. Capture visual source
|
|
49
|
-
|
|
50
|
-
Ask: *"Pick a visual source for this flow's screens:"*
|
|
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
|
-
- **Skip** — user will drop images manually into `requirements/ui/` later
|
|
55
|
-
|
|
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.
|
|
57
|
-
|
|
58
|
-
### 3. Fill spec.md
|
|
59
|
-
|
|
60
|
-
Ask: *"Fill `spec.md` now? (You can reference the captured visuals)"* — offer **Yes, fill now (Recommended)** / **Skip, fill later**.
|
|
61
|
-
|
|
62
|
-
If yes → open `qa/flows/${input:flow}/requirements/spec.md` and help the user fill:
|
|
63
|
-
- **Screens list** — ordered list of screens with URL paths
|
|
64
|
-
- **Flow steps** — what the user does at each screen
|
|
65
|
-
- **Transitions** — what triggers navigation between screens
|
|
66
|
-
- **Business rules** — cross-screen validation, state that persists
|
|
67
|
-
- **Test data** — what data is entered at each screen
|
|
68
|
-
|
|
69
|
-
Reference the captured visuals from Step 2 to suggest field names, form elements, and UI states.
|
|
70
|
-
|
|
71
|
-
### 4. Next steps
|
|
72
|
-
|
|
73
|
-
Tell the user what was created and offer next steps:
|
|
74
|
-
|
|
75
|
-
- **`/sungen-create-test ${input:flow}`** — Generate test scenarios for the flow (Recommended)
|
|
76
|
-
- **Done for now** — I'll come back later
|
|
77
|
-
|
|
78
|
-
## Key Rules
|
|
79
|
-
|
|
80
|
-
- Flows are **independent** from screens — own selectors, own test-data
|
|
81
|
-
- Selectors use `[Screen:Element]` namespace format with colon
|
|
82
|
-
- YAML keys must be **quoted** due to colon: `"login:submit":`
|
|
83
|
-
- Test data namespaced by phase: `login.email`, `submission.nominee`
|
|
84
|
-
- `@flow` tag required at feature level
|
|
85
|
-
- `Background:` should only contain the starting page navigation
|
|
86
|
-
- Each scenario = one phase of the journey
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: sungen-add-screen
|
|
3
|
-
description: 'Add a new Sungen screen or a sub-feature to an existing one — scaffolds directories, helps fill spec.md, and can auto-capture a live-page screenshot via Playwright MCP'
|
|
4
|
-
argument-hint: '[screen-name] [url-path] [--feature <name>] [--figma <url>]'
|
|
5
|
-
agent: 'agent'
|
|
6
|
-
tools: [vscode, execute, read, agent, edit, search, web, browser, todo, 'playwright/*']
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
**Input**: Screen name and URL path (e.g., `/sungen-add-screen login /login`).
|
|
10
|
-
Optionally include a Figma URL: `/sungen-add-screen login /login --figma https://www.figma.com/design/...`.
|
|
11
|
-
To add a sub-feature file to an existing screen: `/sungen-add-screen awards --feature modal`.
|
|
12
|
-
|
|
13
|
-
You are adding a new Sungen screen for test generation, or extending an existing screen with an additional `.feature` file (sub-feature).
|
|
14
|
-
|
|
15
|
-
## Parameters
|
|
16
|
-
|
|
17
|
-
- **screen** — ${input:screen:screen name (e.g., login, dashboard)}
|
|
18
|
-
- **path** — ${input:path:URL path (e.g., /login, /dashboard)} — optional when --figma is provided or when adding a sub-feature
|
|
19
|
-
- **`--feature <name>`** — sub-feature name to add to an existing screen (e.g., `modal`, `filter`, `create-flow`). Creates `<screen>-<feature>.feature` + matching `selectors/<screen>-<feature>.yaml` + `test-data/<screen>-<feature>.yaml` without touching the screen's other files. Use this when one screen has multiple `.feature` files.
|
|
20
|
-
- **`--figma <url>`** — Figma share URL (optional)
|
|
21
|
-
- **`--refresh`** — bypass Figma cache and re-fetch (optional, use with --figma)
|
|
22
|
-
- **`--scale <n>`** — PNG export scale factor, default 2 (optional)
|
|
23
|
-
- **`--hi-res`** — export at 4× scale, shorthand for --scale 4 (optional)
|
|
24
|
-
|
|
25
|
-
**Mode detection** — before invoking the CLI, check whether `qa/screens/<screen>/` already exists:
|
|
26
|
-
- Screen does NOT exist → fresh screen creation (need `--path` unless `--figma` provided)
|
|
27
|
-
- Screen exists AND `--feature <name>` provided → sub-feature mode (skip spec.md, only generate the 3 new files)
|
|
28
|
-
- Screen exists AND no `--feature` → ask the user whether they meant to add a sub-feature (offer `--feature <suggested-name>`) or refresh visuals only (with `--figma`)
|
|
29
|
-
|
|
30
|
-
## Steps
|
|
31
|
-
|
|
32
|
-
### 1. Scaffold the screen (or sub-feature)
|
|
33
|
-
|
|
34
|
-
**Standard path (no --figma, no --feature):**
|
|
35
|
-
|
|
36
|
-
Run with #tool:terminal:
|
|
37
|
-
```bash
|
|
38
|
-
sungen add --screen ${input:screen} --path ${input:path}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
**Sub-feature mode (`--feature <name>` provided):**
|
|
42
|
-
|
|
43
|
-
Run with #tool:terminal:
|
|
44
|
-
```bash
|
|
45
|
-
sungen add --screen ${input:screen} --feature <name> [--path ${input:path}]
|
|
46
|
-
# Generates qa/screens/${input:screen}/{features,selectors,test-data}/${input:screen}-<name>.{feature,yaml,yaml}
|
|
47
|
-
# Existing screen files (spec.md, awards.feature, …) are untouched.
|
|
48
|
-
# --path is optional — defaults to /${input:screen} when omitted.
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
**Figma branch (when --figma \<url\> is provided):**
|
|
52
|
-
|
|
53
|
-
Run with #tool:terminal:
|
|
54
|
-
```bash
|
|
55
|
-
sungen add --screen ${input:screen} --figma <figma-url> [--path ${input:path}] [--feature <name>] [--refresh] [--scale <n>]
|
|
56
|
-
# --feature can be combined with --figma when the new sub-feature has its own Figma frame.
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
This CLI command automatically:
|
|
60
|
-
1. Parses the Figma URL and fetches the design node.
|
|
61
|
-
2. Downloads frame + variant PNGs to `qa/screens/${input:screen}/requirements/ui/`.
|
|
62
|
-
3. Writes `qa/screens/${input:screen}/requirements/spec_figma.md` (auto-generated, always overwritten on re-run).
|
|
63
|
-
4. Creates `qa/screens/${input:screen}/requirements/spec.md` stub **only if the file does not already exist** — never overwrites existing human content.
|
|
64
|
-
|
|
65
|
-
**Important coexistence rules:**
|
|
66
|
-
- `--figma` and `--path` can be passed together.
|
|
67
|
-
- `spec.md` is the human-authored source of truth — never modify it automatically.
|
|
68
|
-
- `spec_figma.md` is auto-generated — tell the user to copy useful sections into `spec.md`.
|
|
69
|
-
- `--capture` (Playwright screenshot) and `--figma` can be used simultaneously.
|
|
70
|
-
|
|
71
|
-
**If Figma auth is missing**, guide the user to run `sungen figma auth set` and retry.
|
|
72
|
-
|
|
73
|
-
### 1a. Synthesize narrative sections (Figma branch only)
|
|
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-capture` skill (mode figma-pat):
|
|
76
|
-
|
|
77
|
-
1. Read `qa/screens/${input:screen}/requirements/spec_figma.md` frontmatter for `file_key`, `node_id`, `figma_version_id`.
|
|
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).
|
|
79
|
-
3. Follow the skill's 7-section template (Purpose / ASCII Layout / Regions / Actions / Form Fields / Data Columns / Navigation) and **replace** everything from the marker to EOF.
|
|
80
|
-
4. Preserve the envelope above the marker byte-for-byte.
|
|
81
|
-
|
|
82
|
-
**Review gate.** Before moving on, show the user the synthesized narrative and ask:
|
|
83
|
-
|
|
84
|
-
- **1) Approve** — narrative looks right, continue to Step 2
|
|
85
|
-
- **2) Edit** — user will tweak `spec_figma.md` now; wait for confirmation before continuing
|
|
86
|
-
- **3) Cancel** — abort; advise the user that `spec.md` was NOT modified and they can re-run `sungen add --figma --refresh` later
|
|
87
|
-
|
|
88
|
-
### 2. Capture visual source
|
|
89
|
-
|
|
90
|
-
**If Figma branch (Step 1) already downloaded PNGs** → visuals already exist. Offer:
|
|
91
|
-
- **1) Continue** — Figma visuals are enough (Recommended)
|
|
92
|
-
- **2) Also capture live page** — supplement Figma with real page scan (invoke `sungen-capture` skill (mode live))
|
|
93
|
-
|
|
94
|
-
**If standard path (no --figma)** → go straight to source selection:
|
|
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
|
-
- **3) Skip** — user will drop images manually into `requirements/ui/` later
|
|
98
|
-
|
|
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`.
|
|
100
|
-
|
|
101
|
-
### 3. Fill spec.md
|
|
102
|
-
|
|
103
|
-
**Skip this step when `--feature` was used** — the screen's existing `spec.md` is reused for all sub-features; only suggest the user append a new section for the sub-feature if useful (e.g. `## Modal — Confirm Withdrawal`).
|
|
104
|
-
|
|
105
|
-
For fresh screen creation, ask: *"Fill `spec.md` now? (You can reference the captured visuals)"* — offer **1) Yes, fill now (Recommended)** / **2) Skip, fill later**.
|
|
106
|
-
|
|
107
|
-
If yes → open `qa/screens/${input:screen}/requirements/spec.md` and help the user fill sections, fields, validation rules, business rules, and states. Reference the captured visuals from Step 2 to suggest field names, form elements, and UI states. Especially prompt for the optional **Figma URL** and **Live URL** fields in Overview — those unlock auto-capture without re-asking next run.
|
|
108
|
-
|
|
109
|
-
### 4. Next steps
|
|
110
|
-
|
|
111
|
-
Tell the user what was created. When `--feature` was used, list the 3 new files explicitly (`features/${input:screen}-<name>.feature`, `selectors/${input:screen}-<name>.yaml`, `test-data/${input:screen}-<name>.yaml`) and remind that `/sungen-create-test` currently operates at the screen level — it will see both the parent feature and the new sub-feature and ask which one to update.
|
|
112
|
-
|
|
113
|
-
Then offer next steps:
|
|
114
|
-
|
|
115
|
-
- **`/sungen-create-test ${input:screen}`** — Create test cases from requirements/designs (Recommended)
|
|
116
|
-
- **Done for now** — I'll come back later
|
|
117
|
-
|
|
118
|
-
## CLI Reference
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
sungen add --screen <name>
|
|
122
|
-
[-p, --path <path>] URL route (e.g., /awards). Required for capture; defaults to /<screen> when omitted.
|
|
123
|
-
[-f, --feature <name>] Add a sub-feature .feature file to an existing screen.
|
|
124
|
-
Output filename = <screen>-<feature>.{feature,yaml,yaml}.
|
|
125
|
-
[-c, --capture] Auto-capture a live screenshot to requirements/ui/ (needs --path).
|
|
126
|
-
[-d, --description <text>] Screen description (used in spec.md stub).
|
|
127
|
-
[--figma <url>] Figma share URL — generates spec_figma.md + ui/*.png.
|
|
128
|
-
[--refresh] Bypass Figma cache (use with --figma).
|
|
129
|
-
[--scale <n>] PNG export scale (default 2).
|
|
130
|
-
[--hi-res] Shorthand for --scale 4.
|
|
131
|
-
```
|