mozaic-mcp-server 1.0.2 → 1.1.0
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/INSTALLATION.md +220 -147
- package/README.md +52 -61
- package/SKILLS.md +64 -44
- package/bin/install-skills.js +46 -0
- package/data/mozaic.db +0 -0
- package/dist/index.js +149 -0
- package/dist/index.js.map +1 -1
- package/package.json +10 -2
- package/skills/mozaic-css-utilities/scripts/get-utility.sh +77 -0
- package/skills/mozaic-css-utilities/scripts/list-utilities.sh +37 -0
- package/skills/mozaic-css-utilities/skill.md +11 -8
- package/skills/mozaic-design-tokens/scripts/get-tokens.sh +77 -0
- package/skills/mozaic-design-tokens/scripts/search-docs.sh +40 -0
- package/skills/mozaic-design-tokens/skill.md +18 -14
- package/skills/mozaic-icons/scripts/get-icon.sh +110 -0
- package/skills/mozaic-icons/scripts/search-icons.sh +54 -0
- package/skills/mozaic-icons/skill.md +13 -9
- package/skills/mozaic-react-builder/scripts/generate-component.sh +46 -0
- package/skills/mozaic-react-builder/scripts/get-component.sh +96 -0
- package/skills/mozaic-react-builder/scripts/get-install-info.sh +83 -0
- package/skills/mozaic-react-builder/scripts/list-components.sh +42 -0
- package/skills/mozaic-react-builder/skill.md +21 -17
- package/skills/mozaic-vue-builder/scripts/generate-component.sh +46 -0
- package/skills/mozaic-vue-builder/scripts/get-component.sh +113 -0
- package/skills/mozaic-vue-builder/scripts/get-install-info.sh +70 -0
- package/skills/mozaic-vue-builder/scripts/list-components.sh +42 -0
- package/skills/mozaic-vue-builder/skill.md +21 -16
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Get installation information for a React component
|
|
3
|
+
# Usage: ./get-install-info.sh <component-name> [package-manager]
|
|
4
|
+
|
|
5
|
+
COMPONENT_NAME="$1"
|
|
6
|
+
PACKAGE_MANAGER="${2:-pnpm}"
|
|
7
|
+
DB_PATH="${HOME}/.claude/mozaic.db"
|
|
8
|
+
|
|
9
|
+
if [ -z "$COMPONENT_NAME" ]; then
|
|
10
|
+
echo "Error: Component name required"
|
|
11
|
+
echo "Usage: $0 <component-name> [npm|yarn|pnpm]"
|
|
12
|
+
exit 1
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
if [ ! -f "$DB_PATH" ]; then
|
|
16
|
+
echo "Error: Database not found at $DB_PATH"
|
|
17
|
+
echo "Please run: npx mozaic-mcp-server install"
|
|
18
|
+
exit 1
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
# Verify component exists
|
|
22
|
+
COMPONENT_EXISTS=$(sqlite3 "$DB_PATH" "SELECT COUNT(*) FROM components WHERE name = '$COMPONENT_NAME' AND frameworks LIKE '%react%'")
|
|
23
|
+
|
|
24
|
+
if [ "$COMPONENT_EXISTS" = "0" ]; then
|
|
25
|
+
echo "Error: Component '$COMPONENT_NAME' not found"
|
|
26
|
+
exit 1
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
# Generate installation command based on package manager
|
|
30
|
+
case "$PACKAGE_MANAGER" in
|
|
31
|
+
npm)
|
|
32
|
+
INSTALL_CMD="npm install @mozaic-ds/react"
|
|
33
|
+
INSTALL_PEER="npm install react@^18.0.0 react-dom@^18.0.0"
|
|
34
|
+
INSTALL_DEV="npm install -D typescript @types/react @types/react-dom"
|
|
35
|
+
;;
|
|
36
|
+
yarn)
|
|
37
|
+
INSTALL_CMD="yarn add @mozaic-ds/react"
|
|
38
|
+
INSTALL_PEER="yarn add react@^18.0.0 react-dom@^18.0.0"
|
|
39
|
+
INSTALL_DEV="yarn add -D typescript @types/react @types/react-dom"
|
|
40
|
+
;;
|
|
41
|
+
pnpm)
|
|
42
|
+
INSTALL_CMD="pnpm add @mozaic-ds/react"
|
|
43
|
+
INSTALL_PEER="pnpm add react@^18.0.0 react-dom@^18.0.0"
|
|
44
|
+
INSTALL_DEV="pnpm add -D typescript @types/react @types/react-dom"
|
|
45
|
+
;;
|
|
46
|
+
*)
|
|
47
|
+
echo "Error: Invalid package manager. Use npm, yarn, or pnpm"
|
|
48
|
+
exit 1
|
|
49
|
+
;;
|
|
50
|
+
esac
|
|
51
|
+
|
|
52
|
+
# Output installation info as JSON
|
|
53
|
+
cat <<EOF
|
|
54
|
+
{
|
|
55
|
+
"component": "$COMPONENT_NAME",
|
|
56
|
+
"framework": "react",
|
|
57
|
+
"packageManager": "$PACKAGE_MANAGER",
|
|
58
|
+
"package": "@mozaic-ds/react",
|
|
59
|
+
"installCommand": "$INSTALL_CMD",
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"react": "^18.0.0",
|
|
62
|
+
"react-dom": "^18.0.0"
|
|
63
|
+
},
|
|
64
|
+
"installPeerCommand": "$INSTALL_PEER",
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"typescript": "latest",
|
|
67
|
+
"@types/react": "latest",
|
|
68
|
+
"@types/react-dom": "latest"
|
|
69
|
+
},
|
|
70
|
+
"installDevCommand": "$INSTALL_DEV",
|
|
71
|
+
"imports": {
|
|
72
|
+
"component": "import { ${COMPONENT_NAME} } from '@mozaic-ds/react'",
|
|
73
|
+
"styles": "import '@mozaic-ds/react/dist/styles.css'"
|
|
74
|
+
},
|
|
75
|
+
"tsconfig": {
|
|
76
|
+
"compilerOptions": {
|
|
77
|
+
"jsx": "react-jsx",
|
|
78
|
+
"esModuleInterop": true,
|
|
79
|
+
"strict": true
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
EOF
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# List React components by category
|
|
3
|
+
# Usage: ./list-components.sh [category]
|
|
4
|
+
# Categories: form, navigation, feedback, layout, data-display, action, all (default)
|
|
5
|
+
|
|
6
|
+
CATEGORY="${1:-all}"
|
|
7
|
+
DB_PATH="${HOME}/.claude/mozaic.db"
|
|
8
|
+
|
|
9
|
+
# Check if database exists
|
|
10
|
+
if [ ! -f "$DB_PATH" ]; then
|
|
11
|
+
echo "Error: Database not found at $DB_PATH"
|
|
12
|
+
echo "Please run: npx mozaic-mcp-server install"
|
|
13
|
+
exit 1
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
# Query components by category
|
|
17
|
+
if [ "$CATEGORY" = "all" ]; then
|
|
18
|
+
sqlite3 "$DB_PATH" <<EOF
|
|
19
|
+
.mode json
|
|
20
|
+
SELECT
|
|
21
|
+
name,
|
|
22
|
+
category,
|
|
23
|
+
description,
|
|
24
|
+
frameworks
|
|
25
|
+
FROM components
|
|
26
|
+
WHERE frameworks LIKE '%react%'
|
|
27
|
+
ORDER BY category, name;
|
|
28
|
+
EOF
|
|
29
|
+
else
|
|
30
|
+
sqlite3 "$DB_PATH" <<EOF
|
|
31
|
+
.mode json
|
|
32
|
+
SELECT
|
|
33
|
+
name,
|
|
34
|
+
category,
|
|
35
|
+
description,
|
|
36
|
+
frameworks
|
|
37
|
+
FROM components
|
|
38
|
+
WHERE frameworks LIKE '%react%'
|
|
39
|
+
AND category = '$CATEGORY'
|
|
40
|
+
ORDER BY name;
|
|
41
|
+
EOF
|
|
42
|
+
fi
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mozaic-react-builder
|
|
3
3
|
description: Interactive React/TSX component generator with Mozaic Design System. Helps discover, configure, and generate production-ready React components with TypeScript support, proper imports, and installation guidance.
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Bash
|
|
5
7
|
---
|
|
6
8
|
|
|
7
9
|
# Mozaic React Builder
|
|
@@ -16,13 +18,15 @@ An interactive assistant for building React applications with the Mozaic Design
|
|
|
16
18
|
4. **Installation Guidance**: Provide package manager commands and setup instructions
|
|
17
19
|
5. **Props Configuration**: Help configure component props with full type safety
|
|
18
20
|
|
|
19
|
-
##
|
|
21
|
+
## Shell Scripts Used
|
|
20
22
|
|
|
21
|
-
This skill uses the Mozaic
|
|
22
|
-
- `
|
|
23
|
-
- `
|
|
24
|
-
- `
|
|
25
|
-
- `
|
|
23
|
+
This skill uses shell scripts to query the local Mozaic database:
|
|
24
|
+
- `list-components.sh` - Browse available React components by category
|
|
25
|
+
- `get-component.sh` - Get detailed component information (props, events, TypeScript types)
|
|
26
|
+
- `generate-component.sh` - Generate React/TSX component code
|
|
27
|
+
- `get-install-info.sh` - Get installation commands and imports
|
|
28
|
+
|
|
29
|
+
Database location: `~/.claude/mozaic.db`
|
|
26
30
|
|
|
27
31
|
## When to Use This Skill
|
|
28
32
|
|
|
@@ -53,7 +57,7 @@ Common options:
|
|
|
53
57
|
|
|
54
58
|
### Step 2: Browse Available Components
|
|
55
59
|
|
|
56
|
-
Based on your answer, I'll use `
|
|
60
|
+
Based on your answer, I'll use the `list-components.sh` script to show relevant components.
|
|
57
61
|
|
|
58
62
|
**Example**:
|
|
59
63
|
```
|
|
@@ -68,7 +72,7 @@ For forms, Mozaic offers:
|
|
|
68
72
|
|
|
69
73
|
### Step 3: Component Details
|
|
70
74
|
|
|
71
|
-
I'll use `
|
|
75
|
+
I'll use the `get-component.sh` script to show:
|
|
72
76
|
- Available props with TypeScript types and defaults
|
|
73
77
|
- Events and callbacks
|
|
74
78
|
- Component examples
|
|
@@ -192,7 +196,7 @@ You can:
|
|
|
192
196
|
|
|
193
197
|
### Step 6: Generate Final Code
|
|
194
198
|
|
|
195
|
-
I'll use `
|
|
199
|
+
I'll use the `generate-component.sh` script to create complete code:
|
|
196
200
|
|
|
197
201
|
```tsx
|
|
198
202
|
import { useState, FormEvent } from 'react';
|
|
@@ -276,7 +280,7 @@ export function LoginForm() {
|
|
|
276
280
|
|
|
277
281
|
### Step 7: Installation Guidance
|
|
278
282
|
|
|
279
|
-
I'll use `
|
|
283
|
+
I'll use the `get-install-info.sh` script to provide:
|
|
280
284
|
|
|
281
285
|
**Package Manager Choice**:
|
|
282
286
|
- npm
|
|
@@ -544,9 +548,9 @@ function useFormState<T>(initialValues: T) {
|
|
|
544
548
|
### Issue: TypeScript errors with props
|
|
545
549
|
|
|
546
550
|
**Solution**: Check prop types
|
|
547
|
-
```
|
|
548
|
-
|
|
549
|
-
|
|
551
|
+
```bash
|
|
552
|
+
# Use get-component.sh to verify prop types
|
|
553
|
+
./scripts/get-component.sh TextInput
|
|
550
554
|
```
|
|
551
555
|
|
|
552
556
|
### Issue: Styles not applying
|
|
@@ -608,7 +612,7 @@ What fields do you need?
|
|
|
608
612
|
**Skill**:
|
|
609
613
|
Perfect! Here's a registration form with extended fields and TypeScript:
|
|
610
614
|
|
|
611
|
-
[Uses `
|
|
615
|
+
[Uses `list-components.sh` and `get-component.sh` scripts]
|
|
612
616
|
|
|
613
617
|
**Proposed Components**:
|
|
614
618
|
1. TextInput (Name)
|
|
@@ -631,7 +635,7 @@ interface RegistrationData {
|
|
|
631
635
|
}
|
|
632
636
|
```
|
|
633
637
|
|
|
634
|
-
[Uses `
|
|
638
|
+
[Uses `generate-component.sh` script]
|
|
635
639
|
|
|
636
640
|
Here's your complete registration form with TypeScript... [Generated code]
|
|
637
641
|
|
|
@@ -643,7 +647,7 @@ Would you like me to:
|
|
|
643
647
|
**User**: "Add installation instructions"
|
|
644
648
|
|
|
645
649
|
**Skill**:
|
|
646
|
-
[Uses `
|
|
650
|
+
[Uses `get-install-info.sh` script]
|
|
647
651
|
|
|
648
652
|
Here's how to install and set up...
|
|
649
653
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Generate Vue 3 component code
|
|
3
|
+
# Usage: ./generate-component.sh <component-name> [props-json]
|
|
4
|
+
|
|
5
|
+
COMPONENT_NAME="$1"
|
|
6
|
+
PROPS_JSON="${2:-{}}"
|
|
7
|
+
DB_PATH="${HOME}/.claude/mozaic.db"
|
|
8
|
+
|
|
9
|
+
if [ -z "$COMPONENT_NAME" ]; then
|
|
10
|
+
echo "Error: Component name required"
|
|
11
|
+
echo "Usage: $0 <component-name> [props-json]"
|
|
12
|
+
exit 1
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
if [ ! -f "$DB_PATH" ]; then
|
|
16
|
+
echo "Error: Database not found at $DB_PATH"
|
|
17
|
+
echo "Please run: npx mozaic-mcp-server install"
|
|
18
|
+
exit 1
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
# Get component template
|
|
22
|
+
TEMPLATE=$(sqlite3 "$DB_PATH" <<EOF
|
|
23
|
+
.mode list
|
|
24
|
+
SELECT template FROM components
|
|
25
|
+
WHERE name = '$COMPONENT_NAME'
|
|
26
|
+
AND frameworks LIKE '%vue%'
|
|
27
|
+
LIMIT 1;
|
|
28
|
+
EOF
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
if [ -z "$TEMPLATE" ]; then
|
|
32
|
+
echo "Error: Component '$COMPONENT_NAME' not found or has no template"
|
|
33
|
+
exit 1
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
# For now, return the basic template
|
|
37
|
+
# In a full implementation, this would merge props-json with the template
|
|
38
|
+
cat <<EOF
|
|
39
|
+
{
|
|
40
|
+
"component": "$COMPONENT_NAME",
|
|
41
|
+
"framework": "vue",
|
|
42
|
+
"code": $(echo "$TEMPLATE" | jq -Rs .),
|
|
43
|
+
"import": "import { M${COMPONENT_NAME} } from '@mozaic-ds/vue-3'",
|
|
44
|
+
"cssImport": "import '@mozaic-ds/vue-3/dist/style.css'"
|
|
45
|
+
}
|
|
46
|
+
EOF
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Get detailed information about a Vue component
|
|
3
|
+
# Usage: ./get-component.sh <component-name>
|
|
4
|
+
|
|
5
|
+
COMPONENT_NAME="$1"
|
|
6
|
+
DB_PATH="${HOME}/.claude/mozaic.db"
|
|
7
|
+
|
|
8
|
+
if [ -z "$COMPONENT_NAME" ]; then
|
|
9
|
+
echo "Error: Component name required"
|
|
10
|
+
echo "Usage: $0 <component-name>"
|
|
11
|
+
exit 1
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
if [ ! -f "$DB_PATH" ]; then
|
|
15
|
+
echo "Error: Database not found at $DB_PATH"
|
|
16
|
+
echo "Please run: npx mozaic-mcp-server install"
|
|
17
|
+
exit 1
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
# Get component basic info
|
|
21
|
+
COMPONENT_INFO=$(sqlite3 "$DB_PATH" <<EOF
|
|
22
|
+
.mode json
|
|
23
|
+
SELECT * FROM components
|
|
24
|
+
WHERE name = '$COMPONENT_NAME'
|
|
25
|
+
AND frameworks LIKE '%vue%'
|
|
26
|
+
LIMIT 1;
|
|
27
|
+
EOF
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
if [ "$COMPONENT_INFO" = "[]" ]; then
|
|
31
|
+
echo "Error: Component '$COMPONENT_NAME' not found"
|
|
32
|
+
exit 1
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
# Get component props
|
|
36
|
+
PROPS=$(sqlite3 "$DB_PATH" <<EOF
|
|
37
|
+
.mode json
|
|
38
|
+
SELECT
|
|
39
|
+
name,
|
|
40
|
+
type,
|
|
41
|
+
default_value,
|
|
42
|
+
required,
|
|
43
|
+
description
|
|
44
|
+
FROM component_props
|
|
45
|
+
WHERE component_id = (
|
|
46
|
+
SELECT id FROM components
|
|
47
|
+
WHERE name = '$COMPONENT_NAME'
|
|
48
|
+
AND frameworks LIKE '%vue%'
|
|
49
|
+
)
|
|
50
|
+
ORDER BY required DESC, name;
|
|
51
|
+
EOF
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
# Get component slots
|
|
55
|
+
SLOTS=$(sqlite3 "$DB_PATH" <<EOF
|
|
56
|
+
.mode json
|
|
57
|
+
SELECT
|
|
58
|
+
name,
|
|
59
|
+
description
|
|
60
|
+
FROM component_slots
|
|
61
|
+
WHERE component_id = (
|
|
62
|
+
SELECT id FROM components
|
|
63
|
+
WHERE name = '$COMPONENT_NAME'
|
|
64
|
+
AND frameworks LIKE '%vue%'
|
|
65
|
+
)
|
|
66
|
+
ORDER BY name;
|
|
67
|
+
EOF
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
# Get component events
|
|
71
|
+
EVENTS=$(sqlite3 "$DB_PATH" <<EOF
|
|
72
|
+
.mode json
|
|
73
|
+
SELECT
|
|
74
|
+
name,
|
|
75
|
+
payload,
|
|
76
|
+
description
|
|
77
|
+
FROM component_events
|
|
78
|
+
WHERE component_id = (
|
|
79
|
+
SELECT id FROM components
|
|
80
|
+
WHERE name = '$COMPONENT_NAME'
|
|
81
|
+
AND frameworks LIKE '%vue%'
|
|
82
|
+
)
|
|
83
|
+
ORDER BY name;
|
|
84
|
+
EOF
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
# Get component examples
|
|
88
|
+
EXAMPLES=$(sqlite3 "$DB_PATH" <<EOF
|
|
89
|
+
.mode json
|
|
90
|
+
SELECT
|
|
91
|
+
title,
|
|
92
|
+
code,
|
|
93
|
+
description
|
|
94
|
+
FROM component_examples
|
|
95
|
+
WHERE component_id = (
|
|
96
|
+
SELECT id FROM components
|
|
97
|
+
WHERE name = '$COMPONENT_NAME'
|
|
98
|
+
AND frameworks LIKE '%vue%'
|
|
99
|
+
)
|
|
100
|
+
ORDER BY id;
|
|
101
|
+
EOF
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
# Combine all information into a single JSON output
|
|
105
|
+
cat <<EOF
|
|
106
|
+
{
|
|
107
|
+
"component": $COMPONENT_INFO,
|
|
108
|
+
"props": $PROPS,
|
|
109
|
+
"slots": $SLOTS,
|
|
110
|
+
"events": $EVENTS,
|
|
111
|
+
"examples": $EXAMPLES
|
|
112
|
+
}
|
|
113
|
+
EOF
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Get installation information for a Vue component
|
|
3
|
+
# Usage: ./get-install-info.sh <component-name> [package-manager]
|
|
4
|
+
|
|
5
|
+
COMPONENT_NAME="$1"
|
|
6
|
+
PACKAGE_MANAGER="${2:-pnpm}"
|
|
7
|
+
DB_PATH="${HOME}/.claude/mozaic.db"
|
|
8
|
+
|
|
9
|
+
if [ -z "$COMPONENT_NAME" ]; then
|
|
10
|
+
echo "Error: Component name required"
|
|
11
|
+
echo "Usage: $0 <component-name> [npm|yarn|pnpm]"
|
|
12
|
+
exit 1
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
if [ ! -f "$DB_PATH" ]; then
|
|
16
|
+
echo "Error: Database not found at $DB_PATH"
|
|
17
|
+
echo "Please run: npx mozaic-mcp-server install"
|
|
18
|
+
exit 1
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
# Verify component exists
|
|
22
|
+
COMPONENT_EXISTS=$(sqlite3 "$DB_PATH" "SELECT COUNT(*) FROM components WHERE name = '$COMPONENT_NAME' AND frameworks LIKE '%vue%'")
|
|
23
|
+
|
|
24
|
+
if [ "$COMPONENT_EXISTS" = "0" ]; then
|
|
25
|
+
echo "Error: Component '$COMPONENT_NAME' not found"
|
|
26
|
+
exit 1
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
# Generate installation command based on package manager
|
|
30
|
+
case "$PACKAGE_MANAGER" in
|
|
31
|
+
npm)
|
|
32
|
+
INSTALL_CMD="npm install @mozaic-ds/vue-3"
|
|
33
|
+
INSTALL_PEER="npm install vue@^3.3.0"
|
|
34
|
+
;;
|
|
35
|
+
yarn)
|
|
36
|
+
INSTALL_CMD="yarn add @mozaic-ds/vue-3"
|
|
37
|
+
INSTALL_PEER="yarn add vue@^3.3.0"
|
|
38
|
+
;;
|
|
39
|
+
pnpm)
|
|
40
|
+
INSTALL_CMD="pnpm add @mozaic-ds/vue-3"
|
|
41
|
+
INSTALL_PEER="pnpm add vue@^3.3.0"
|
|
42
|
+
;;
|
|
43
|
+
*)
|
|
44
|
+
echo "Error: Invalid package manager. Use npm, yarn, or pnpm"
|
|
45
|
+
exit 1
|
|
46
|
+
;;
|
|
47
|
+
esac
|
|
48
|
+
|
|
49
|
+
# Output installation info as JSON
|
|
50
|
+
cat <<EOF
|
|
51
|
+
{
|
|
52
|
+
"component": "$COMPONENT_NAME",
|
|
53
|
+
"framework": "vue",
|
|
54
|
+
"packageManager": "$PACKAGE_MANAGER",
|
|
55
|
+
"package": "@mozaic-ds/vue-3",
|
|
56
|
+
"installCommand": "$INSTALL_CMD",
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"vue": "^3.3.0"
|
|
59
|
+
},
|
|
60
|
+
"installPeerCommand": "$INSTALL_PEER",
|
|
61
|
+
"imports": {
|
|
62
|
+
"component": "import { M${COMPONENT_NAME} } from '@mozaic-ds/vue-3'",
|
|
63
|
+
"styles": "import '@mozaic-ds/vue-3/dist/style.css'"
|
|
64
|
+
},
|
|
65
|
+
"quickStart": {
|
|
66
|
+
"globalRegistration": "import { createApp } from 'vue'\\nimport MozaicVue from '@mozaic-ds/vue-3'\\n\\nconst app = createApp(App)\\napp.use(MozaicVue)",
|
|
67
|
+
"componentRegistration": "import { M${COMPONENT_NAME} } from '@mozaic-ds/vue-3'\\nimport '@mozaic-ds/vue-3/dist/style.css'"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
EOF
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# List Vue components by category
|
|
3
|
+
# Usage: ./list-components.sh [category]
|
|
4
|
+
# Categories: form, navigation, feedback, layout, data-display, action, all (default)
|
|
5
|
+
|
|
6
|
+
CATEGORY="${1:-all}"
|
|
7
|
+
DB_PATH="${HOME}/.claude/mozaic.db"
|
|
8
|
+
|
|
9
|
+
# Check if database exists
|
|
10
|
+
if [ ! -f "$DB_PATH" ]; then
|
|
11
|
+
echo "Error: Database not found at $DB_PATH"
|
|
12
|
+
echo "Please run: npx mozaic-mcp-server install"
|
|
13
|
+
exit 1
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
# Query components by category
|
|
17
|
+
if [ "$CATEGORY" = "all" ]; then
|
|
18
|
+
sqlite3 "$DB_PATH" <<EOF
|
|
19
|
+
.mode json
|
|
20
|
+
SELECT
|
|
21
|
+
name,
|
|
22
|
+
category,
|
|
23
|
+
description,
|
|
24
|
+
frameworks
|
|
25
|
+
FROM components
|
|
26
|
+
WHERE frameworks LIKE '%vue%'
|
|
27
|
+
ORDER BY category, name;
|
|
28
|
+
EOF
|
|
29
|
+
else
|
|
30
|
+
sqlite3 "$DB_PATH" <<EOF
|
|
31
|
+
.mode json
|
|
32
|
+
SELECT
|
|
33
|
+
name,
|
|
34
|
+
category,
|
|
35
|
+
description,
|
|
36
|
+
frameworks
|
|
37
|
+
FROM components
|
|
38
|
+
WHERE frameworks LIKE '%vue%'
|
|
39
|
+
AND category = '$CATEGORY'
|
|
40
|
+
ORDER BY name;
|
|
41
|
+
EOF
|
|
42
|
+
fi
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mozaic-vue-builder
|
|
3
3
|
description: Interactive Vue 3 component generator with Mozaic Design System. Helps discover, configure, and generate production-ready Vue components with proper imports and installation guidance.
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Bash
|
|
5
7
|
---
|
|
6
8
|
|
|
7
9
|
# Mozaic Vue Builder
|
|
@@ -16,13 +18,15 @@ An interactive assistant for building Vue 3 applications with the Mozaic Design
|
|
|
16
18
|
4. **Installation Guidance**: Provide package manager commands and setup instructions
|
|
17
19
|
5. **Props Configuration**: Help configure component props with type safety
|
|
18
20
|
|
|
19
|
-
##
|
|
21
|
+
## Shell Scripts Used
|
|
20
22
|
|
|
21
|
-
This skill uses the Mozaic
|
|
22
|
-
- `
|
|
23
|
-
- `
|
|
24
|
-
- `
|
|
25
|
-
- `
|
|
23
|
+
This skill uses shell scripts to query the local Mozaic database:
|
|
24
|
+
- `list-components.sh` - Browse available Vue components by category
|
|
25
|
+
- `get-component.sh` - Get detailed component information (props, slots, events)
|
|
26
|
+
- `generate-component.sh` - Generate Vue 3 component code
|
|
27
|
+
- `get-install-info.sh` - Get installation commands and imports
|
|
28
|
+
|
|
29
|
+
Database location: `~/.claude/mozaic.db`
|
|
26
30
|
|
|
27
31
|
## When to Use This Skill
|
|
28
32
|
|
|
@@ -52,7 +56,7 @@ Common options:
|
|
|
52
56
|
|
|
53
57
|
### Step 2: Browse Available Components
|
|
54
58
|
|
|
55
|
-
Based on your answer, I'll use `
|
|
59
|
+
Based on your answer, I'll use the `list-components.sh` script to show relevant components.
|
|
56
60
|
|
|
57
61
|
**Example**:
|
|
58
62
|
```
|
|
@@ -67,7 +71,7 @@ For forms, Mozaic offers:
|
|
|
67
71
|
|
|
68
72
|
### Step 3: Component Details
|
|
69
73
|
|
|
70
|
-
I'll use `
|
|
74
|
+
I'll use the `get-component.sh` script to show:
|
|
71
75
|
- Available props with types and defaults
|
|
72
76
|
- Slots for customization
|
|
73
77
|
- Events you can listen to
|
|
@@ -141,7 +145,7 @@ You can:
|
|
|
141
145
|
|
|
142
146
|
### Step 6: Generate Final Code
|
|
143
147
|
|
|
144
|
-
I'll use `
|
|
148
|
+
I'll use the `generate-component.sh` script to create complete code:
|
|
145
149
|
|
|
146
150
|
```vue
|
|
147
151
|
<script setup>
|
|
@@ -203,7 +207,7 @@ form {
|
|
|
203
207
|
|
|
204
208
|
### Step 7: Installation Guidance
|
|
205
209
|
|
|
206
|
-
I'll use `
|
|
210
|
+
I'll use the `get-install-info.sh` script to provide:
|
|
207
211
|
|
|
208
212
|
**Package Manager Choice**:
|
|
209
213
|
- npm
|
|
@@ -410,8 +414,9 @@ pnpm add -D @types/node
|
|
|
410
414
|
### Issue: Props not working
|
|
411
415
|
|
|
412
416
|
**Solution**: Check prop names and types
|
|
413
|
-
```
|
|
414
|
-
|
|
417
|
+
```bash
|
|
418
|
+
# Use get-component.sh to verify props
|
|
419
|
+
./scripts/get-component.sh TextInput
|
|
415
420
|
```
|
|
416
421
|
|
|
417
422
|
### Issue: Styling conflicts
|
|
@@ -459,7 +464,7 @@ What fields do you need?
|
|
|
459
464
|
**Skill**:
|
|
460
465
|
Perfect! Here's a registration form with extended fields:
|
|
461
466
|
|
|
462
|
-
[Uses `
|
|
467
|
+
[Uses `list-components.sh` and `get-component.sh` scripts]
|
|
463
468
|
|
|
464
469
|
**Proposed Components**:
|
|
465
470
|
1. TextInput (Name)
|
|
@@ -470,7 +475,7 @@ Perfect! Here's a registration form with extended fields:
|
|
|
470
475
|
6. Checkbox (Terms agreement)
|
|
471
476
|
7. Button (Submit - theme="primary")
|
|
472
477
|
|
|
473
|
-
[Uses `
|
|
478
|
+
[Uses `generate-component.sh` script]
|
|
474
479
|
|
|
475
480
|
Here's your complete registration form... [Generated code]
|
|
476
481
|
|
|
@@ -482,7 +487,7 @@ Would you like me to:
|
|
|
482
487
|
**User**: "Add installation instructions"
|
|
483
488
|
|
|
484
489
|
**Skill**:
|
|
485
|
-
[Uses `
|
|
490
|
+
[Uses `get-install-info.sh` script]
|
|
486
491
|
|
|
487
492
|
Here's how to install and set up...
|
|
488
493
|
|