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
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mozaic-css-utilities
|
|
3
3
|
description: Mozaic CSS utility classes and layout systems expert. Master Flexy grid, Container, Margin, Padding, Ratio, and Scroll utilities for responsive layouts without writing custom CSS.
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Bash
|
|
5
7
|
---
|
|
6
8
|
|
|
7
9
|
# Mozaic CSS Utilities
|
|
@@ -17,12 +19,13 @@ An expert assistant for working with Mozaic CSS-only utility classes. These util
|
|
|
17
19
|
5. **Aspect Ratios**: Maintain element ratios with Ratio utility
|
|
18
20
|
6. **Scroll Behavior**: Control scrolling with Scroll utility
|
|
19
21
|
|
|
20
|
-
##
|
|
22
|
+
## Shell Scripts Used
|
|
21
23
|
|
|
22
|
-
This skill uses the Mozaic
|
|
23
|
-
- `
|
|
24
|
-
- `
|
|
25
|
-
|
|
24
|
+
This skill uses shell scripts to query the local Mozaic database:
|
|
25
|
+
- `list-utilities.sh` - Browse CSS utilities by category (layout, utility, all)
|
|
26
|
+
- `get-utility.sh` - Get detailed utility class documentation with examples
|
|
27
|
+
|
|
28
|
+
Database location: `~/.claude/mozaic.db`
|
|
26
29
|
|
|
27
30
|
## When to Use This Skill
|
|
28
31
|
|
|
@@ -67,7 +70,7 @@ Options:
|
|
|
67
70
|
|
|
68
71
|
### Step 2: Get Utility Details
|
|
69
72
|
|
|
70
|
-
I'll use `
|
|
73
|
+
I'll use the `list-utilities.sh` and `get-utility.sh` scripts to show:
|
|
71
74
|
- Available CSS classes
|
|
72
75
|
- Responsive modifiers
|
|
73
76
|
- Usage examples
|
|
@@ -599,7 +602,7 @@ Do you want:
|
|
|
599
602
|
**Skill**:
|
|
600
603
|
Perfect! Here's your responsive product grid:
|
|
601
604
|
|
|
602
|
-
[Uses `
|
|
605
|
+
[Uses `get-utility.sh flexy` script]
|
|
603
606
|
|
|
604
607
|
```html
|
|
605
608
|
<div class="container">
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Get design tokens by category and format
|
|
3
|
+
# Usage: ./get-tokens.sh <category> [format]
|
|
4
|
+
# Categories: colors, typography, spacing, shadows, borders, screens, grid, all
|
|
5
|
+
# Formats: json (default), scss, css, js
|
|
6
|
+
|
|
7
|
+
CATEGORY="$1"
|
|
8
|
+
FORMAT="${2:-json}"
|
|
9
|
+
DB_PATH="${HOME}/.claude/mozaic.db"
|
|
10
|
+
|
|
11
|
+
if [ -z "$CATEGORY" ]; then
|
|
12
|
+
echo "Error: Category required"
|
|
13
|
+
echo "Usage: $0 <colors|typography|spacing|shadows|borders|screens|grid|all> [json|scss|css|js]"
|
|
14
|
+
exit 1
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
if [ ! -f "$DB_PATH" ]; then
|
|
18
|
+
echo "Error: Database not found at $DB_PATH"
|
|
19
|
+
echo "Please run: npx mozaic-mcp-server install"
|
|
20
|
+
exit 1
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
# Query tokens by category
|
|
24
|
+
if [ "$CATEGORY" = "all" ]; then
|
|
25
|
+
TOKENS=$(sqlite3 "$DB_PATH" <<EOF
|
|
26
|
+
.mode json
|
|
27
|
+
SELECT
|
|
28
|
+
category,
|
|
29
|
+
name,
|
|
30
|
+
value_raw as value,
|
|
31
|
+
description
|
|
32
|
+
FROM tokens
|
|
33
|
+
ORDER BY category, name;
|
|
34
|
+
EOF
|
|
35
|
+
)
|
|
36
|
+
else
|
|
37
|
+
TOKENS=$(sqlite3 "$DB_PATH" <<EOF
|
|
38
|
+
.mode json
|
|
39
|
+
SELECT
|
|
40
|
+
category,
|
|
41
|
+
name,
|
|
42
|
+
value_raw as value,
|
|
43
|
+
description
|
|
44
|
+
FROM tokens
|
|
45
|
+
WHERE category = '$CATEGORY'
|
|
46
|
+
ORDER BY name;
|
|
47
|
+
EOF
|
|
48
|
+
)
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
# Convert to requested format
|
|
52
|
+
case "$FORMAT" in
|
|
53
|
+
json)
|
|
54
|
+
echo "$TOKENS"
|
|
55
|
+
;;
|
|
56
|
+
|
|
57
|
+
scss)
|
|
58
|
+
echo "$TOKENS" | jq -r '.[] | "$\(.name): \(.value);"'
|
|
59
|
+
;;
|
|
60
|
+
|
|
61
|
+
css)
|
|
62
|
+
echo ":root {"
|
|
63
|
+
echo "$TOKENS" | jq -r '.[] | " --\(.name): \(.value);"'
|
|
64
|
+
echo "}"
|
|
65
|
+
;;
|
|
66
|
+
|
|
67
|
+
js)
|
|
68
|
+
echo "export const tokens = {"
|
|
69
|
+
echo "$TOKENS" | jq -r 'group_by(.category) | .[] | " \(.[0].category): {" + ([.[] | " \"\(.name)\": \"\(.value)\""] | join(",\n")) + "\n },"'
|
|
70
|
+
echo "};"
|
|
71
|
+
;;
|
|
72
|
+
|
|
73
|
+
*)
|
|
74
|
+
echo "Error: Invalid format. Use json, scss, css, or js"
|
|
75
|
+
exit 1
|
|
76
|
+
;;
|
|
77
|
+
esac
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Search Mozaic documentation for styling guidance
|
|
3
|
+
# Usage: ./search-docs.sh <query> [limit]
|
|
4
|
+
|
|
5
|
+
QUERY="$1"
|
|
6
|
+
LIMIT="${2:-5}"
|
|
7
|
+
DB_PATH="${HOME}/.claude/mozaic.db"
|
|
8
|
+
|
|
9
|
+
if [ -z "$QUERY" ]; then
|
|
10
|
+
echo "Error: Search query required"
|
|
11
|
+
echo "Usage: $0 <query> [limit]"
|
|
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
|
+
# Search documentation entries
|
|
22
|
+
sqlite3 "$DB_PATH" <<EOF
|
|
23
|
+
.mode json
|
|
24
|
+
SELECT
|
|
25
|
+
title,
|
|
26
|
+
content,
|
|
27
|
+
category,
|
|
28
|
+
url
|
|
29
|
+
FROM documentation
|
|
30
|
+
WHERE title LIKE '%$QUERY%'
|
|
31
|
+
OR content LIKE '%$QUERY%'
|
|
32
|
+
OR category LIKE '%$QUERY%'
|
|
33
|
+
ORDER BY
|
|
34
|
+
CASE
|
|
35
|
+
WHEN title LIKE '%$QUERY%' THEN 1
|
|
36
|
+
WHEN category LIKE '%$QUERY%' THEN 2
|
|
37
|
+
ELSE 3
|
|
38
|
+
END
|
|
39
|
+
LIMIT $LIMIT;
|
|
40
|
+
EOF
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mozaic-design-tokens
|
|
3
3
|
description: Mozaic Design System tokens and styling expert. Access design tokens (colors, typography, spacing, shadows, borders, breakpoints, grid) in multiple formats (JSON, SCSS, CSS, JS) and search documentation for styling guidance.
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Bash
|
|
5
7
|
---
|
|
6
8
|
|
|
7
9
|
# Mozaic Design Tokens
|
|
@@ -16,11 +18,13 @@ An expert assistant for working with Mozaic Design System tokens and styling. Th
|
|
|
16
18
|
4. **Responsive Design**: Work with breakpoints and responsive patterns
|
|
17
19
|
5. **Consistent Styling**: Ensure design system consistency across your app
|
|
18
20
|
|
|
19
|
-
##
|
|
21
|
+
## Shell Scripts Used
|
|
20
22
|
|
|
21
|
-
This skill uses the Mozaic
|
|
22
|
-
- `
|
|
23
|
-
- `
|
|
23
|
+
This skill uses shell scripts to query the local Mozaic database:
|
|
24
|
+
- `get-tokens.sh` - Get design tokens by category and format (JSON, SCSS, CSS, JS)
|
|
25
|
+
- `search-docs.sh` - Search Mozaic documentation for styling guidance
|
|
26
|
+
|
|
27
|
+
Database location: `~/.claude/mozaic.db`
|
|
24
28
|
|
|
25
29
|
## When to Use This Skill
|
|
26
30
|
|
|
@@ -105,7 +109,7 @@ Options:
|
|
|
105
109
|
|
|
106
110
|
### Step 3: Browse and Select
|
|
107
111
|
|
|
108
|
-
I'll use `
|
|
112
|
+
I'll use the `get-tokens.sh` script to show available tokens.
|
|
109
113
|
|
|
110
114
|
**Example - Colors in SCSS format**:
|
|
111
115
|
```scss
|
|
@@ -155,7 +159,7 @@ I'll provide examples for your chosen format:
|
|
|
155
159
|
**User**: "What are the brand colors?"
|
|
156
160
|
|
|
157
161
|
**Workflow**:
|
|
158
|
-
1. Use `
|
|
162
|
+
1. Use `get-tokens.sh colors json` to retrieve color tokens
|
|
159
163
|
2. Show brand color palette
|
|
160
164
|
3. Provide usage examples
|
|
161
165
|
4. Suggest semantic color alternatives
|
|
@@ -179,7 +183,7 @@ I'll provide examples for your chosen format:
|
|
|
179
183
|
**User**: "What font sizes should I use?"
|
|
180
184
|
|
|
181
185
|
**Workflow**:
|
|
182
|
-
1. Use `
|
|
186
|
+
1. Use `get-tokens.sh typography scss` to retrieve typography tokens
|
|
183
187
|
2. Show type scale with line heights
|
|
184
188
|
3. Provide semantic naming (heading, body, caption)
|
|
185
189
|
4. Show usage examples
|
|
@@ -205,7 +209,7 @@ $line-height-relaxed: 1.75;
|
|
|
205
209
|
**User**: "How do I use consistent spacing?"
|
|
206
210
|
|
|
207
211
|
**Workflow**:
|
|
208
|
-
1. Use `
|
|
212
|
+
1. Use `get-tokens.sh spacing css` to retrieve spacing tokens
|
|
209
213
|
2. Explain magic unit system (4px base)
|
|
210
214
|
3. Show spacing scale
|
|
211
215
|
4. Provide component examples
|
|
@@ -234,7 +238,7 @@ $line-height-relaxed: 1.75;
|
|
|
234
238
|
**User**: "What are the responsive breakpoints?"
|
|
235
239
|
|
|
236
240
|
**Workflow**:
|
|
237
|
-
1. Use `
|
|
241
|
+
1. Use `get-tokens.sh screens scss` to retrieve breakpoint tokens
|
|
238
242
|
2. Show breakpoint values
|
|
239
243
|
3. Provide media query examples
|
|
240
244
|
4. Suggest mobile-first approach
|
|
@@ -264,7 +268,7 @@ $screen-2xl: 1920px; // Wide desktop
|
|
|
264
268
|
**User**: "How do I add elevation to a card?"
|
|
265
269
|
|
|
266
270
|
**Workflow**:
|
|
267
|
-
1. Use `
|
|
271
|
+
1. Use `get-tokens.sh shadows css` to retrieve shadow tokens
|
|
268
272
|
2. Show elevation levels
|
|
269
273
|
3. Explain when to use each level
|
|
270
274
|
4. Provide component examples
|
|
@@ -296,7 +300,7 @@ $screen-2xl: 1920px; // Wide desktop
|
|
|
296
300
|
**User**: "How does the grid system work?"
|
|
297
301
|
|
|
298
302
|
**Workflow**:
|
|
299
|
-
1. Use `
|
|
303
|
+
1. Use `get-tokens.sh grid scss` to retrieve grid tokens
|
|
300
304
|
2. Show grid configuration
|
|
301
305
|
3. Explain gutter system
|
|
302
306
|
4. Provide layout examples
|
|
@@ -508,7 +512,7 @@ export const tokens = {
|
|
|
508
512
|
|
|
509
513
|
## Documentation Search
|
|
510
514
|
|
|
511
|
-
Use `
|
|
515
|
+
Use the `search-docs.sh` script to find:
|
|
512
516
|
- Color usage guidelines
|
|
513
517
|
- Typography best practices
|
|
514
518
|
- Spacing system rules
|
|
@@ -566,7 +570,7 @@ Perfect! What format do you prefer?
|
|
|
566
570
|
**User**: "A - CSS"
|
|
567
571
|
|
|
568
572
|
**Skill**:
|
|
569
|
-
[Uses `
|
|
573
|
+
[Uses `get-tokens.sh` script for colors, spacing, shadows]
|
|
570
574
|
|
|
571
575
|
Here are the tokens for your card component:
|
|
572
576
|
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Get specific icon with SVG markup and framework code
|
|
3
|
+
# Usage: ./get-icon.sh <icon-name> [format]
|
|
4
|
+
# Formats: svg, react, vue, all (default)
|
|
5
|
+
|
|
6
|
+
ICON_NAME="$1"
|
|
7
|
+
FORMAT="${2:-all}"
|
|
8
|
+
DB_PATH="${HOME}/.claude/mozaic.db"
|
|
9
|
+
|
|
10
|
+
if [ -z "$ICON_NAME" ]; then
|
|
11
|
+
echo "Error: Icon name required"
|
|
12
|
+
echo "Usage: $0 <icon-name> [svg|react|vue|all]"
|
|
13
|
+
exit 1
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
if [ ! -f "$DB_PATH" ]; then
|
|
17
|
+
echo "Error: Database not found at $DB_PATH"
|
|
18
|
+
echo "Please run: npx mozaic-mcp-server install"
|
|
19
|
+
exit 1
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
# Get icon info
|
|
23
|
+
ICON_INFO=$(sqlite3 "$DB_PATH" <<EOF
|
|
24
|
+
.mode json
|
|
25
|
+
SELECT
|
|
26
|
+
name,
|
|
27
|
+
icon_name,
|
|
28
|
+
type,
|
|
29
|
+
size,
|
|
30
|
+
view_box,
|
|
31
|
+
paths
|
|
32
|
+
FROM icons
|
|
33
|
+
WHERE name = '$ICON_NAME'
|
|
34
|
+
LIMIT 1;
|
|
35
|
+
EOF
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
if [ "$ICON_INFO" = "[]" ]; then
|
|
39
|
+
echo "Error: Icon '$ICON_NAME' not found"
|
|
40
|
+
exit 1
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
# Extract icon details
|
|
44
|
+
VIEW_BOX=$(echo "$ICON_INFO" | jq -r '.[0].view_box')
|
|
45
|
+
PATHS=$(echo "$ICON_INFO" | jq -r '.[0].paths')
|
|
46
|
+
ICON_SIZE=$(echo "$ICON_INFO" | jq -r '.[0].size')
|
|
47
|
+
|
|
48
|
+
# Generate code based on format
|
|
49
|
+
case "$FORMAT" in
|
|
50
|
+
svg)
|
|
51
|
+
cat <<EOF
|
|
52
|
+
{
|
|
53
|
+
"icon": $ICON_INFO,
|
|
54
|
+
"viewBox": "$VIEW_BOX",
|
|
55
|
+
"size": $ICON_SIZE,
|
|
56
|
+
"paths": $PATHS
|
|
57
|
+
}
|
|
58
|
+
EOF
|
|
59
|
+
;;
|
|
60
|
+
|
|
61
|
+
react)
|
|
62
|
+
cat <<EOF
|
|
63
|
+
{
|
|
64
|
+
"icon": $ICON_INFO,
|
|
65
|
+
"import": "import { Icon$ICON_NAME } from '@mozaic-ds/icons/react'",
|
|
66
|
+
"usage": "<Icon$ICON_NAME />",
|
|
67
|
+
"withProps": "<Icon$ICON_NAME size={32} color=\"currentColor\" aria-label=\"Icon description\" />",
|
|
68
|
+
"viewBox": "$VIEW_BOX"
|
|
69
|
+
}
|
|
70
|
+
EOF
|
|
71
|
+
;;
|
|
72
|
+
|
|
73
|
+
vue)
|
|
74
|
+
cat <<EOF
|
|
75
|
+
{
|
|
76
|
+
"icon": $ICON_INFO,
|
|
77
|
+
"import": "import { Icon$ICON_NAME } from '@mozaic-ds/icons/vue'",
|
|
78
|
+
"usage": "<Icon$ICON_NAME />",
|
|
79
|
+
"withProps": "<Icon$ICON_NAME :size=\"32\" color=\"currentColor\" aria-label=\"Icon description\" />",
|
|
80
|
+
"viewBox": "$VIEW_BOX"
|
|
81
|
+
}
|
|
82
|
+
EOF
|
|
83
|
+
;;
|
|
84
|
+
|
|
85
|
+
all)
|
|
86
|
+
cat <<EOF
|
|
87
|
+
{
|
|
88
|
+
"icon": $ICON_INFO,
|
|
89
|
+
"viewBox": "$VIEW_BOX",
|
|
90
|
+
"size": $ICON_SIZE,
|
|
91
|
+
"paths": $PATHS,
|
|
92
|
+
"react": {
|
|
93
|
+
"import": "import { Icon$ICON_NAME } from '@mozaic-ds/icons/react'",
|
|
94
|
+
"usage": "<Icon$ICON_NAME />",
|
|
95
|
+
"withProps": "<Icon$ICON_NAME size={32} color=\"currentColor\" aria-label=\"Icon description\" />"
|
|
96
|
+
},
|
|
97
|
+
"vue": {
|
|
98
|
+
"import": "import { Icon$ICON_NAME } from '@mozaic-ds/icons/vue'",
|
|
99
|
+
"usage": "<Icon$ICON_NAME />",
|
|
100
|
+
"withProps": "<Icon$ICON_NAME :size=\"32\" color=\"currentColor\" aria-label=\"Icon description\" />"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
EOF
|
|
104
|
+
;;
|
|
105
|
+
|
|
106
|
+
*)
|
|
107
|
+
echo "Error: Invalid format. Use svg, react, vue, or all"
|
|
108
|
+
exit 1
|
|
109
|
+
;;
|
|
110
|
+
esac
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Search Mozaic icons by name, type, or size
|
|
3
|
+
# Usage: ./search-icons.sh <query> [type] [size] [limit]
|
|
4
|
+
|
|
5
|
+
QUERY="$1"
|
|
6
|
+
TYPE="$2"
|
|
7
|
+
SIZE="$3"
|
|
8
|
+
LIMIT="${4:-20}"
|
|
9
|
+
DB_PATH="${HOME}/.claude/mozaic.db"
|
|
10
|
+
|
|
11
|
+
if [ -z "$QUERY" ]; then
|
|
12
|
+
echo "Error: Search query required"
|
|
13
|
+
echo "Usage: $0 <query> [type] [size] [limit]"
|
|
14
|
+
exit 1
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
if [ ! -f "$DB_PATH" ]; then
|
|
18
|
+
echo "Error: Database not found at $DB_PATH"
|
|
19
|
+
echo "Please run: npx mozaic-mcp-server install"
|
|
20
|
+
exit 1
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
# Build WHERE clause
|
|
24
|
+
WHERE_CLAUSE="name LIKE '%$QUERY%'"
|
|
25
|
+
|
|
26
|
+
if [ -n "$TYPE" ]; then
|
|
27
|
+
WHERE_CLAUSE="$WHERE_CLAUSE AND type = '$TYPE'"
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
if [ -n "$SIZE" ]; then
|
|
31
|
+
WHERE_CLAUSE="$WHERE_CLAUSE AND size = $SIZE"
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
# Search icons
|
|
35
|
+
sqlite3 "$DB_PATH" <<EOF
|
|
36
|
+
.mode json
|
|
37
|
+
SELECT
|
|
38
|
+
name,
|
|
39
|
+
icon_name,
|
|
40
|
+
type,
|
|
41
|
+
size,
|
|
42
|
+
view_box
|
|
43
|
+
FROM icons
|
|
44
|
+
WHERE $WHERE_CLAUSE
|
|
45
|
+
ORDER BY
|
|
46
|
+
CASE
|
|
47
|
+
WHEN name LIKE '$QUERY%' THEN 1
|
|
48
|
+
WHEN name LIKE '%$QUERY' THEN 2
|
|
49
|
+
ELSE 3
|
|
50
|
+
END,
|
|
51
|
+
type,
|
|
52
|
+
size
|
|
53
|
+
LIMIT $LIMIT;
|
|
54
|
+
EOF
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mozaic-icons
|
|
3
3
|
description: Mozaic icon search and integration for Vue & React. Search icons by name or type, view multiple sizes (16, 24, 32, 48, 64), and generate framework-specific code with proper imports.
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Bash
|
|
5
7
|
---
|
|
6
8
|
|
|
7
9
|
# Mozaic Icons
|
|
@@ -17,11 +19,13 @@ An expert assistant for discovering and integrating Mozaic Design System icons.
|
|
|
17
19
|
5. **Generate Code**: Create framework-specific code (Vue or React) with proper imports
|
|
18
20
|
6. **Get SVG**: Access raw SVG markup for custom usage
|
|
19
21
|
|
|
20
|
-
##
|
|
22
|
+
## Shell Scripts Used
|
|
21
23
|
|
|
22
|
-
This skill uses the Mozaic
|
|
23
|
-
- `
|
|
24
|
-
- `
|
|
24
|
+
This skill uses shell scripts to query the local Mozaic database:
|
|
25
|
+
- `search-icons.sh` - Search icons by name, type, or size (1,473 icons)
|
|
26
|
+
- `get-icon.sh` - Get specific icon with SVG and framework code (Vue/React)
|
|
27
|
+
|
|
28
|
+
Database location: `~/.claude/mozaic.db`
|
|
25
29
|
|
|
26
30
|
## When to Use This Skill
|
|
27
31
|
|
|
@@ -113,7 +117,7 @@ You can describe:
|
|
|
113
117
|
|
|
114
118
|
### Step 2: Search and Filter
|
|
115
119
|
|
|
116
|
-
I'll use `
|
|
120
|
+
I'll use the `search-icons.sh` script with optional filters:
|
|
117
121
|
|
|
118
122
|
**Filters**:
|
|
119
123
|
- By name/keyword
|
|
@@ -162,7 +166,7 @@ You choose:
|
|
|
162
166
|
|
|
163
167
|
### Step 5: Generate Code
|
|
164
168
|
|
|
165
|
-
I'll use `
|
|
169
|
+
I'll use the `get-icon.sh` script to provide:
|
|
166
170
|
- Import statements
|
|
167
171
|
- Component usage
|
|
168
172
|
- Props and customization
|
|
@@ -563,7 +567,7 @@ This skill works well with:
|
|
|
563
567
|
**Skill**:
|
|
564
568
|
I'll help you find a shopping cart icon!
|
|
565
569
|
|
|
566
|
-
[Uses `
|
|
570
|
+
[Uses `search-icons.sh cart` script]
|
|
567
571
|
|
|
568
572
|
Found 3 shopping cart icons:
|
|
569
573
|
|
|
@@ -592,7 +596,7 @@ Perfect! Which framework?
|
|
|
592
596
|
**User**: "B - React"
|
|
593
597
|
|
|
594
598
|
**Skill**:
|
|
595
|
-
[Uses `
|
|
599
|
+
[Uses `get-icon.sh Cart24 react` script]
|
|
596
600
|
|
|
597
601
|
Here's your shopping cart button with icon:
|
|
598
602
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Generate React/TSX 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 '%react%'
|
|
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": "react",
|
|
42
|
+
"code": $(echo "$TEMPLATE" | jq -Rs .),
|
|
43
|
+
"import": "import { ${COMPONENT_NAME} } from '@mozaic-ds/react'",
|
|
44
|
+
"cssImport": "import '@mozaic-ds/react/dist/styles.css'"
|
|
45
|
+
}
|
|
46
|
+
EOF
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Get detailed information about a React 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 '%react%'
|
|
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 '%react%'
|
|
49
|
+
)
|
|
50
|
+
ORDER BY required DESC, name;
|
|
51
|
+
EOF
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
# Get component events
|
|
55
|
+
EVENTS=$(sqlite3 "$DB_PATH" <<EOF
|
|
56
|
+
.mode json
|
|
57
|
+
SELECT
|
|
58
|
+
name,
|
|
59
|
+
payload,
|
|
60
|
+
description
|
|
61
|
+
FROM component_events
|
|
62
|
+
WHERE component_id = (
|
|
63
|
+
SELECT id FROM components
|
|
64
|
+
WHERE name = '$COMPONENT_NAME'
|
|
65
|
+
AND frameworks LIKE '%react%'
|
|
66
|
+
)
|
|
67
|
+
ORDER BY name;
|
|
68
|
+
EOF
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
# Get component examples
|
|
72
|
+
EXAMPLES=$(sqlite3 "$DB_PATH" <<EOF
|
|
73
|
+
.mode json
|
|
74
|
+
SELECT
|
|
75
|
+
title,
|
|
76
|
+
code,
|
|
77
|
+
description
|
|
78
|
+
FROM component_examples
|
|
79
|
+
WHERE component_id = (
|
|
80
|
+
SELECT id FROM components
|
|
81
|
+
WHERE name = '$COMPONENT_NAME'
|
|
82
|
+
AND frameworks LIKE '%react%'
|
|
83
|
+
)
|
|
84
|
+
ORDER BY id;
|
|
85
|
+
EOF
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
# Combine all information into a single JSON output
|
|
89
|
+
cat <<EOF
|
|
90
|
+
{
|
|
91
|
+
"component": $COMPONENT_INFO,
|
|
92
|
+
"props": $PROPS,
|
|
93
|
+
"events": $EVENTS,
|
|
94
|
+
"examples": $EXAMPLES
|
|
95
|
+
}
|
|
96
|
+
EOF
|