From 5d44974c8a13345ba179cba2a03361ba8ed94a59 Mon Sep 17 00:00:00 2001 From: DaveDev Date: Fri, 10 Apr 2026 09:14:02 +0800 Subject: [PATCH 1/3] feature add vue skill --- vue-components/README.md | 44 ++++++++++++ vue-components/SKILL.md | 61 ++++++++++++++++ .../examples/gold-standard-card.vue | 62 +++++++++++++++++ vue-components/package.json | 16 +++++ .../resources/architecture-checklist.md | 21 ++++++ .../resources/component-template.vue | 18 +++++ vue-components/resources/style-guide.json | 27 ++++++++ vue-components/scripts/fetch-stitch.sh | 30 ++++++++ vue-components/scripts/validate.js | 69 +++++++++++++++++++ 9 files changed, 348 insertions(+) create mode 100644 vue-components/README.md create mode 100644 vue-components/SKILL.md create mode 100644 vue-components/examples/gold-standard-card.vue create mode 100644 vue-components/package.json create mode 100644 vue-components/resources/architecture-checklist.md create mode 100644 vue-components/resources/component-template.vue create mode 100644 vue-components/resources/style-guide.json create mode 100644 vue-components/scripts/fetch-stitch.sh create mode 100644 vue-components/scripts/validate.js diff --git a/vue-components/README.md b/vue-components/README.md new file mode 100644 index 0000000..33da662 --- /dev/null +++ b/vue-components/README.md @@ -0,0 +1,44 @@ +# vue:components + +Converts Stitch designs into modular **Vue 3** Single File Components using the Composition API (` + + diff --git a/vue-components/package.json b/vue-components/package.json new file mode 100644 index 0000000..359477d --- /dev/null +++ b/vue-components/package.json @@ -0,0 +1,16 @@ +{ + "name": "vue-components", + "version": "1.0.0", + "description": "Design-to-code prompt to Vue 3 Composition API components for Stitch MCP", + "type": "module", + "scripts": { + "validate": "node scripts/validate.js", + "fetch": "bash scripts/fetch-stitch.sh" + }, + "dependencies": { + "@vue/compiler-sfc": "^3.4.0" + }, + "engines": { + "node": ">=18.0.0" + } +} diff --git a/vue-components/resources/architecture-checklist.md b/vue-components/resources/architecture-checklist.md new file mode 100644 index 0000000..0a2411b --- /dev/null +++ b/vue-components/resources/architecture-checklist.md @@ -0,0 +1,21 @@ +# Architecture Quality Gate + +### Structural integrity +- [ ] Logic extracted to composables in `src/composables/` (prefixed with `use`). +- [ ] No monolithic files; strictly Atomic/Composite modularity. +- [ ] All static text/URLs moved to `src/data/mockData.ts`. + +### Type safety and syntax +- [ ] Props declared with `defineProps()` (typed generic, not runtime object). +- [ ] `withDefaults` used when any prop has a default value. +- [ ] Emits declared with `defineEmits<{ ... }>()` if the component emits events. +- [ ] File is syntactically valid Vue SFC (no parse errors). +- [ ] Placeholders from templates (e.g., `StitchComponent`) have been replaced with actual names. + +### Reactivity +- [ ] Props accessed via `props.x`, not destructured directly. +- [ ] Derived state uses `computed()`, not local `ref` copies of props. + +### Styling and theming +- [ ] Dark mode (`dark:`) applied to all color classes. +- [ ] No hardcoded hex values in template — use theme-mapped Tailwind classes. diff --git a/vue-components/resources/component-template.vue b/vue-components/resources/component-template.vue new file mode 100644 index 0000000..b28178c --- /dev/null +++ b/vue-components/resources/component-template.vue @@ -0,0 +1,18 @@ + + + diff --git a/vue-components/resources/style-guide.json b/vue-components/resources/style-guide.json new file mode 100644 index 0000000..4cc0a52 --- /dev/null +++ b/vue-components/resources/style-guide.json @@ -0,0 +1,27 @@ +{ + "theme": { + "colors": { + "primary": "#19e66f", + "background": { + "light": "#f6f8f7", + "dark": "#112118", + "elevated": "#1A1A1A" + }, + "accent": { + "purple": "#8A2BE2", + "lavender": "#D0A9F5" + } + }, + "typography": { + "display": [ + "Space Grotesk", + "sans-serif" + ], + "icons": "Material Symbols Outlined" + }, + "spacing": { + "header-h": "72px", + "container-max": "960px" + } + } +} diff --git a/vue-components/scripts/fetch-stitch.sh b/vue-components/scripts/fetch-stitch.sh new file mode 100644 index 0000000..4472144 --- /dev/null +++ b/vue-components/scripts/fetch-stitch.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +URL=$1 +OUTPUT=$2 +if [ -z "$URL" ] || [ -z "$OUTPUT" ]; then + echo "Usage: $0 " + exit 1 +fi +echo "Initiating high-reliability fetch for Stitch HTML..." +curl -L -f -sS --connect-timeout 10 --compressed "$URL" -o "$OUTPUT" +if [ $? -eq 0 ]; then + echo "✅ Successfully retrieved HTML at: $OUTPUT" + exit 0 +else + echo "❌ Error: Failed to retrieve content. Check TLS/SNI or URL expiration." + exit 1 +fi diff --git a/vue-components/scripts/validate.js b/vue-components/scripts/validate.js new file mode 100644 index 0000000..07abcb3 --- /dev/null +++ b/vue-components/scripts/validate.js @@ -0,0 +1,69 @@ +/** + * Vue 3 SFC Validator + * Checks that a .vue component follows the skill's architectural rules: + * - Has a typed defineProps() declaration + * - Contains no hardcoded hex color values in the template + */ + +import { parse } from '@vue/compiler-sfc' +import fs from 'node:fs' +import path from 'node:path' + +const HEX_COLOR_REGEX = /#[0-9A-Fa-f]{6}/g + +async function validateComponent(filePath) { + if (!filePath) { + console.error('Usage: node scripts/validate.js ') + process.exit(1) + } + + const source = fs.readFileSync(filePath, 'utf-8') + const filename = path.basename(filePath) + + const { descriptor, errors } = parse(source, { filename }) + + if (errors.length > 0) { + console.error('❌ PARSE ERROR:', errors[0].message) + process.exit(1) + } + + const scriptContent = + descriptor.scriptSetup?.content ?? descriptor.script?.content ?? '' + const templateContent = descriptor.template?.content ?? '' + + // Check for typed defineProps + const hasDefineProps = /defineProps\s* m[0], + ) + + console.log('🔍 Scanning Vue SFC...') + console.log(`--- Validation for: ${filename} ---`) + + if (hasDefineProps) { + console.log('✅ defineProps() declaration found.') + } else { + console.error( + "❌ MISSING: Typed defineProps (use defineProps() pattern).", + ) + } + + if (hexMatches.length === 0) { + console.log('✅ No hardcoded hex values found in template.') + } else { + console.error(`❌ STYLE: Found ${hexMatches.length} hardcoded hex codes.`) + hexMatches.forEach((hex) => console.error(` - ${hex}`)) + } + + if (hasDefineProps && hexMatches.length === 0) { + console.log('\n✨ COMPONENT VALID.') + process.exit(0) + } else { + console.error('\n🚫 VALIDATION FAILED.') + process.exit(1) + } +} + +validateComponent(process.argv[2]) From ea81ad6882868b1eda0d750c6df08e5b5192443a Mon Sep 17 00:00:00 2001 From: DaveDev Date: Fri, 10 Apr 2026 09:27:42 +0800 Subject: [PATCH 2/3] fix/folders --- {vue-components => skills/vue-components}/README.md | 0 {vue-components => skills/vue-components}/SKILL.md | 0 .../vue-components}/examples/gold-standard-card.vue | 0 {vue-components => skills/vue-components}/package.json | 0 .../vue-components}/resources/architecture-checklist.md | 0 .../vue-components}/resources/component-template.vue | 0 .../vue-components}/resources/style-guide.json | 0 {vue-components => skills/vue-components}/scripts/fetch-stitch.sh | 0 {vue-components => skills/vue-components}/scripts/validate.js | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename {vue-components => skills/vue-components}/README.md (100%) rename {vue-components => skills/vue-components}/SKILL.md (100%) rename {vue-components => skills/vue-components}/examples/gold-standard-card.vue (100%) rename {vue-components => skills/vue-components}/package.json (100%) rename {vue-components => skills/vue-components}/resources/architecture-checklist.md (100%) rename {vue-components => skills/vue-components}/resources/component-template.vue (100%) rename {vue-components => skills/vue-components}/resources/style-guide.json (100%) rename {vue-components => skills/vue-components}/scripts/fetch-stitch.sh (100%) rename {vue-components => skills/vue-components}/scripts/validate.js (100%) diff --git a/vue-components/README.md b/skills/vue-components/README.md similarity index 100% rename from vue-components/README.md rename to skills/vue-components/README.md diff --git a/vue-components/SKILL.md b/skills/vue-components/SKILL.md similarity index 100% rename from vue-components/SKILL.md rename to skills/vue-components/SKILL.md diff --git a/vue-components/examples/gold-standard-card.vue b/skills/vue-components/examples/gold-standard-card.vue similarity index 100% rename from vue-components/examples/gold-standard-card.vue rename to skills/vue-components/examples/gold-standard-card.vue diff --git a/vue-components/package.json b/skills/vue-components/package.json similarity index 100% rename from vue-components/package.json rename to skills/vue-components/package.json diff --git a/vue-components/resources/architecture-checklist.md b/skills/vue-components/resources/architecture-checklist.md similarity index 100% rename from vue-components/resources/architecture-checklist.md rename to skills/vue-components/resources/architecture-checklist.md diff --git a/vue-components/resources/component-template.vue b/skills/vue-components/resources/component-template.vue similarity index 100% rename from vue-components/resources/component-template.vue rename to skills/vue-components/resources/component-template.vue diff --git a/vue-components/resources/style-guide.json b/skills/vue-components/resources/style-guide.json similarity index 100% rename from vue-components/resources/style-guide.json rename to skills/vue-components/resources/style-guide.json diff --git a/vue-components/scripts/fetch-stitch.sh b/skills/vue-components/scripts/fetch-stitch.sh similarity index 100% rename from vue-components/scripts/fetch-stitch.sh rename to skills/vue-components/scripts/fetch-stitch.sh diff --git a/vue-components/scripts/validate.js b/skills/vue-components/scripts/validate.js similarity index 100% rename from vue-components/scripts/validate.js rename to skills/vue-components/scripts/validate.js From a17746a0f2ee46eb1bead99db814c099db6f86e4 Mon Sep 17 00:00:00 2001 From: DaveDev Date: Fri, 10 Apr 2026 10:27:01 +0800 Subject: [PATCH 3/3] add text for readme --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index fedfd8a..47ac64c 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,13 @@ Converts Stitch screens to React component systems with automated validation and npx skills add google-labs-code/stitch-skills --skill react:components --global ``` +### vue-components +Converts Stitch screens to Vue component systems with automated validation and design token consistency. + +```bash +npx skills add google-labs-code/stitch-skills --skill vue:components --global +``` + ### remotion Generates walkthrough videos from Stitch projects using Remotion with smooth transitions, zooming, and text overlays to showcase app screens professionally.