@su-record/vibe 2.6.5 → 2.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -25
- package/commands/vibe.utils.md +0 -41
- package/hooks/scripts/gemini-ui-gen.js +1 -13
- package/package.json +1 -1
- package/agents/ui-syncer.md +0 -359
package/README.md
CHANGED
|
@@ -44,7 +44,6 @@ vibe init
|
|
|
44
44
|
| `/vibe.analyze` | Code analysis |
|
|
45
45
|
| `/vibe.reason "problem"` | Systematic reasoning |
|
|
46
46
|
| `/vibe.utils --ui` | UI preview (Gemini image / ASCII fallback) |
|
|
47
|
-
| `/vibe.utils --ui-sync` | Sync design files to code (v2.6.3) |
|
|
48
47
|
| `/vibe.utils --e2e` | E2E testing, diagrams, etc. |
|
|
49
48
|
|
|
50
49
|
## Workflow
|
|
@@ -213,9 +212,7 @@ await generateChangelog('feature-name');
|
|
|
213
212
|
- Automatic changelog generation
|
|
214
213
|
- Baseline tagging for releases
|
|
215
214
|
|
|
216
|
-
## UI
|
|
217
|
-
|
|
218
|
-
### UI Preview (`--ui`)
|
|
215
|
+
## UI Preview (`--ui`)
|
|
219
216
|
|
|
220
217
|
Generate UI previews from text description or design folder:
|
|
221
218
|
|
|
@@ -230,27 +227,6 @@ Generate UI previews from text description or design folder:
|
|
|
230
227
|
- **Gemini disabled**: ASCII art fallback
|
|
231
228
|
- Supports: HTML, PNG, JPG, CSS, JSON, SVG, MD
|
|
232
229
|
|
|
233
|
-
### Design-to-Code Sync (`--ui-sync`)
|
|
234
|
-
|
|
235
|
-
Sync design files to existing UI code:
|
|
236
|
-
|
|
237
|
-
```bash
|
|
238
|
-
/vibe.utils --ui-sync ./design/ui/
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
**Workflow:**
|
|
242
|
-
|
|
243
|
-
1. Read all design files (HTML, images, CSS, tokens)
|
|
244
|
-
2. Extract design specs (colors, typography, spacing)
|
|
245
|
-
3. Compare with existing code
|
|
246
|
-
4. Generate update plan
|
|
247
|
-
5. Apply changes (with confirmation)
|
|
248
|
-
|
|
249
|
-
**Mode:**
|
|
250
|
-
|
|
251
|
-
- **Gemini enabled**: Gemini generates code from design
|
|
252
|
-
- **Gemini disabled**: Claude handles analysis and generation
|
|
253
|
-
|
|
254
230
|
## Multi-model Orchestration
|
|
255
231
|
|
|
256
232
|
**Hook-based automatic routing** - Keywords in your prompt trigger the right LLM automatically:
|
package/commands/vibe.utils.md
CHANGED
|
@@ -11,7 +11,6 @@ Collection of utility tools. Use with options.
|
|
|
11
11
|
|
|
12
12
|
```
|
|
13
13
|
/vibe.utils --ui "description" # UI ASCII preview
|
|
14
|
-
/vibe.utils --ui-sync ./design/ # Sync UI code with design files
|
|
15
14
|
/vibe.utils --diagram # Architecture diagram
|
|
16
15
|
/vibe.utils --diagram --er # ERD diagram
|
|
17
16
|
/vibe.utils --diagram --flow # Flowchart
|
|
@@ -64,46 +63,6 @@ Generate UI preview from description or design folder.
|
|
|
64
63
|
|
|
65
64
|
---
|
|
66
65
|
|
|
67
|
-
## --ui-sync (Design to Code Sync)
|
|
68
|
-
|
|
69
|
-
Read and follow `agents/ui-syncer.md` for design-to-code synchronization.
|
|
70
|
-
|
|
71
|
-
Analyze design files (HTML, images, CSS, tokens) and update existing UI code to match.
|
|
72
|
-
|
|
73
|
-
**What it does:**
|
|
74
|
-
|
|
75
|
-
1. Read ALL design files (including images)
|
|
76
|
-
2. Extract design specs (colors, typography, spacing, components)
|
|
77
|
-
3. Compare with existing code
|
|
78
|
-
4. Generate update plan
|
|
79
|
-
5. Apply changes (with confirmation)
|
|
80
|
-
|
|
81
|
-
**Supported file formats:**
|
|
82
|
-
|
|
83
|
-
- `*.html` - Structure, layout, classes
|
|
84
|
-
- `*.png` / `*.jpg` / `*.webp` - Visual reference (Claude reads images)
|
|
85
|
-
- `*.json` - Design tokens, theme config
|
|
86
|
-
- `*.css` / `*.scss` - Variables, colors, spacing
|
|
87
|
-
- `*.md` - Design guidelines
|
|
88
|
-
- `*.svg` - Icons, vectors
|
|
89
|
-
|
|
90
|
-
**Example:**
|
|
91
|
-
|
|
92
|
-
```
|
|
93
|
-
/vibe.utils --ui-sync ./design/ui/
|
|
94
|
-
/vibe.utils --ui-sync ./mockups/dashboard/
|
|
95
|
-
/vibe.utils --ui-sync ./design/homepage.html
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
**Output:**
|
|
99
|
-
|
|
100
|
-
- Diff report (design vs code)
|
|
101
|
-
- List of changes to apply
|
|
102
|
-
- Confirmation prompt
|
|
103
|
-
- Files modified
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
66
|
## --diagram (Diagram Generation)
|
|
108
67
|
|
|
109
68
|
Read and follow `agents/diagrammer.md` for diagram generation.
|
|
@@ -31,11 +31,6 @@ async function getGeminiApi() {
|
|
|
31
31
|
return geminiApi;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
async function getGeminiStatus() {
|
|
35
|
-
const api = await getGeminiApi();
|
|
36
|
-
return api.vibeGeminiStatus ? await api.vibeGeminiStatus() : null;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
34
|
async function askGemini(prompt) {
|
|
40
35
|
const api = await getGeminiApi();
|
|
41
36
|
return api.ask(prompt, { model: 'gemini-3-flash', maxTokens: 8192, temperature: 0.3 });
|
|
@@ -244,14 +239,7 @@ Options:
|
|
|
244
239
|
}
|
|
245
240
|
}
|
|
246
241
|
|
|
247
|
-
|
|
248
|
-
const status = await getGeminiStatus();
|
|
249
|
-
if (!status) {
|
|
250
|
-
console.error('❌ Gemini credentials not found. Run: vibe gemini auth');
|
|
251
|
-
process.exit(1);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
console.log(`🤖 Gemini UI Generator (${status.type}${status.email ? `: ${status.email}` : ''})`);
|
|
242
|
+
console.log(`🤖 Gemini UI Generator`);
|
|
255
243
|
console.log(`📦 Framework: ${options.framework}`);
|
|
256
244
|
|
|
257
245
|
try {
|
package/package.json
CHANGED
package/agents/ui-syncer.md
DELETED
|
@@ -1,359 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Sync UI code with design files (Gemini or Claude)
|
|
3
|
-
argument-hint: "design folder path"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# /vibe.ui-sync
|
|
7
|
-
|
|
8
|
-
Analyze design files and update existing UI code to match.
|
|
9
|
-
|
|
10
|
-
- **Gemini enabled**: Gemini analyzes designs and generates code
|
|
11
|
-
- **Gemini disabled**: Claude handles directly
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
/vibe.utils --ui-sync ./design/ui/
|
|
17
|
-
/vibe.utils --ui-sync ./mockups/
|
|
18
|
-
/vibe.utils --ui-sync ./design/homepage.html
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Process
|
|
22
|
-
|
|
23
|
-
### 0. Check Gemini Status
|
|
24
|
-
|
|
25
|
-
**FIRST: Check if Gemini is available.**
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
vibe gemini status
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Or check: `~/.config/vibe/gemini.json` or `~/.config/vibe/gemini-apikey.json`
|
|
32
|
-
|
|
33
|
-
- **Gemini available** → Use Gemini for code generation (Step 1A)
|
|
34
|
-
- **Gemini NOT available** → Claude handles directly (Step 1B)
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## Path A: Gemini Enabled
|
|
39
|
-
|
|
40
|
-
### 1A. Collect ALL Design Files
|
|
41
|
-
|
|
42
|
-
Scan folder and collect all files to send to Gemini:
|
|
43
|
-
|
|
44
|
-
| Format | What to Collect |
|
|
45
|
-
| ------ | --------------- |
|
|
46
|
-
| `*.html` | Full HTML content |
|
|
47
|
-
| `*.png` / `*.jpg` / `*.webp` | Image as base64 |
|
|
48
|
-
| `*.json` | Design tokens, theme config |
|
|
49
|
-
| `*.css` / `*.scss` | Style variables |
|
|
50
|
-
| `*.md` | Design guidelines |
|
|
51
|
-
| `*.svg` | Vector content |
|
|
52
|
-
|
|
53
|
-
### 2A. Send to Gemini
|
|
54
|
-
|
|
55
|
-
Use the Gemini UI Generator script:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
node hooks/scripts/gemini-ui-gen.js \
|
|
59
|
-
--design-folder ./design/ui/ \
|
|
60
|
-
--framework react \
|
|
61
|
-
--output ./src/components
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
**Or call Gemini API directly with all files:**
|
|
65
|
-
|
|
66
|
-
```javascript
|
|
67
|
-
// Prepare multipart content
|
|
68
|
-
const parts = [
|
|
69
|
-
// Images as inline data
|
|
70
|
-
{ inlineData: { mimeType: "image/png", data: imageBase64 } },
|
|
71
|
-
// HTML/CSS/JSON as text
|
|
72
|
-
{ text: `HTML Mockup:\n${htmlContent}` },
|
|
73
|
-
{ text: `CSS Styles:\n${cssContent}` },
|
|
74
|
-
{ text: `Design Tokens:\n${jsonContent}` },
|
|
75
|
-
// Prompt
|
|
76
|
-
{ text: `
|
|
77
|
-
Analyze these design files and generate production-ready React components.
|
|
78
|
-
|
|
79
|
-
Requirements:
|
|
80
|
-
1. Match the visual design exactly
|
|
81
|
-
2. Use Tailwind CSS
|
|
82
|
-
3. TypeScript with proper types
|
|
83
|
-
4. Responsive and accessible
|
|
84
|
-
|
|
85
|
-
Output complete component code.
|
|
86
|
-
` }
|
|
87
|
-
];
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### 3A. Apply Gemini's Output
|
|
91
|
-
|
|
92
|
-
1. Parse Gemini's code output
|
|
93
|
-
2. Extract component files
|
|
94
|
-
3. Compare with existing code
|
|
95
|
-
4. Show diff to user
|
|
96
|
-
5. Apply with confirmation
|
|
97
|
-
|
|
98
|
-
---
|
|
99
|
-
|
|
100
|
-
## Path B: Gemini NOT Available (Claude Fallback)
|
|
101
|
-
|
|
102
|
-
### 1B. Read ALL Design Files
|
|
103
|
-
|
|
104
|
-
**MANDATORY: Read every file in the design folder.**
|
|
105
|
-
|
|
106
|
-
| Format | What to Extract |
|
|
107
|
-
| ------ | --------------- |
|
|
108
|
-
| `*.html` | Structure, components, layout, classes |
|
|
109
|
-
| `*.png` / `*.jpg` / `*.webp` | Visual layout, colors, spacing, typography |
|
|
110
|
-
| `*.json` | Design tokens, theme config, component props |
|
|
111
|
-
| `*.css` / `*.scss` | Variables, colors, spacing, typography |
|
|
112
|
-
| `*.md` | Design guidelines, component specs |
|
|
113
|
-
| `*.svg` | Icons, vector assets |
|
|
114
|
-
|
|
115
|
-
**Reading order:**
|
|
116
|
-
|
|
117
|
-
1. `*.md` files first (design specs/guidelines)
|
|
118
|
-
2. `*.html` files (structure reference)
|
|
119
|
-
3. `*.png` / `*.jpg` images (visual reference - use Read tool)
|
|
120
|
-
4. `*.json` (design tokens)
|
|
121
|
-
5. `*.css` / `*.scss` (styles)
|
|
122
|
-
|
|
123
|
-
**CRITICAL:** Do NOT skip any file. Read images with the Read tool.
|
|
124
|
-
|
|
125
|
-
### 2B. Analyze Design Intent (Claude)
|
|
126
|
-
|
|
127
|
-
From all design files, extract:
|
|
128
|
-
|
|
129
|
-
**Layout:**
|
|
130
|
-
- Page structure (header, sidebar, main, footer)
|
|
131
|
-
- Grid system (columns, gaps)
|
|
132
|
-
- Responsive breakpoints
|
|
133
|
-
|
|
134
|
-
**Components:**
|
|
135
|
-
- Component hierarchy
|
|
136
|
-
- Component names and types
|
|
137
|
-
- Props and variants
|
|
138
|
-
|
|
139
|
-
**Styling:**
|
|
140
|
-
- Color palette (primary, secondary, accent, background, text)
|
|
141
|
-
- Typography (font family, sizes, weights)
|
|
142
|
-
- Spacing system (padding, margin, gaps)
|
|
143
|
-
- Border radius, shadows
|
|
144
|
-
- Dark/light theme support
|
|
145
|
-
|
|
146
|
-
### 3B. Generate Code (Claude)
|
|
147
|
-
|
|
148
|
-
Claude generates the code directly based on analysis.
|
|
149
|
-
|
|
150
|
-
---
|
|
151
|
-
|
|
152
|
-
## Common Steps (Both Paths)
|
|
153
|
-
|
|
154
|
-
### 4. Find Existing UI Code
|
|
155
|
-
|
|
156
|
-
Search for existing UI implementation:
|
|
157
|
-
|
|
158
|
-
```
|
|
159
|
-
src/components/
|
|
160
|
-
src/pages/
|
|
161
|
-
src/views/
|
|
162
|
-
src/ui/
|
|
163
|
-
app/components/
|
|
164
|
-
app/(routes)/
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
Detect framework:
|
|
168
|
-
- React: `*.tsx`, `*.jsx`
|
|
169
|
-
- Vue: `*.vue`
|
|
170
|
-
- Svelte: `*.svelte`
|
|
171
|
-
- Angular: `*.component.ts`
|
|
172
|
-
|
|
173
|
-
### 5. Compare Design vs Code
|
|
174
|
-
|
|
175
|
-
Create a diff report:
|
|
176
|
-
|
|
177
|
-
| Aspect | Design | Current Code | Action |
|
|
178
|
-
| ------ | ------ | ------------ | ------ |
|
|
179
|
-
| Colors | #2F6BFF | #3B82F6 | Update |
|
|
180
|
-
| Font | Inter | system-ui | Update |
|
|
181
|
-
| Border radius | 12px | 8px | Update |
|
|
182
|
-
| Component X | Exists | Missing | Create |
|
|
183
|
-
|
|
184
|
-
### 6. Generate Update Plan
|
|
185
|
-
|
|
186
|
-
List all changes needed:
|
|
187
|
-
|
|
188
|
-
**Style Updates:**
|
|
189
|
-
```css
|
|
190
|
-
/* Before */
|
|
191
|
-
--primary: #3B82F6;
|
|
192
|
-
--radius: 8px;
|
|
193
|
-
|
|
194
|
-
/* After */
|
|
195
|
-
--primary: #2F6BFF;
|
|
196
|
-
--radius: 12px;
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
**Component Updates:**
|
|
200
|
-
```tsx
|
|
201
|
-
// Before: Missing hover state
|
|
202
|
-
<Button>Click</Button>
|
|
203
|
-
|
|
204
|
-
// After: Add hover state from design
|
|
205
|
-
<Button className="hover:bg-primary-600">Click</Button>
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
**New Components:**
|
|
209
|
-
- List components that exist in design but not in code
|
|
210
|
-
|
|
211
|
-
### 7. Execute Updates
|
|
212
|
-
|
|
213
|
-
**Ask user before making changes:**
|
|
214
|
-
|
|
215
|
-
```
|
|
216
|
-
Found 12 differences between design and code:
|
|
217
|
-
- 3 color updates
|
|
218
|
-
- 2 spacing changes
|
|
219
|
-
- 1 new component
|
|
220
|
-
- 6 style adjustments
|
|
221
|
-
|
|
222
|
-
Proceed with updates? [Y/n]
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
**Apply changes:**
|
|
226
|
-
|
|
227
|
-
1. Update CSS/SCSS variables
|
|
228
|
-
2. Update Tailwind config (if applicable)
|
|
229
|
-
3. Update component styles
|
|
230
|
-
4. Create new components (if needed)
|
|
231
|
-
5. Update imports
|
|
232
|
-
|
|
233
|
-
### 8. Verify Changes
|
|
234
|
-
|
|
235
|
-
After updates:
|
|
236
|
-
|
|
237
|
-
1. Run build to check for errors
|
|
238
|
-
2. Show before/after comparison
|
|
239
|
-
3. List all files modified
|
|
240
|
-
|
|
241
|
-
## Output Format
|
|
242
|
-
|
|
243
|
-
```
|
|
244
|
-
📂 Design Analysis: ./design/ui/
|
|
245
|
-
🤖 Mode: Gemini (or Claude fallback)
|
|
246
|
-
|
|
247
|
-
Files Read:
|
|
248
|
-
✓ homepage.html (structure)
|
|
249
|
-
✓ homepage.png (visual)
|
|
250
|
-
✓ tokens.json (design tokens)
|
|
251
|
-
✓ styles.css (variables)
|
|
252
|
-
|
|
253
|
-
Design Specs Extracted:
|
|
254
|
-
Colors: #2F6BFF (primary), #1E293B (text), #F8FAFC (bg)
|
|
255
|
-
Typography: Inter, 14px base, 1.5 line-height
|
|
256
|
-
Spacing: 4px base unit
|
|
257
|
-
Border Radius: 12px (cards), 8px (buttons)
|
|
258
|
-
|
|
259
|
-
Differences Found: 8
|
|
260
|
-
|
|
261
|
-
| File | Change | Status |
|
|
262
|
-
|------|--------|--------|
|
|
263
|
-
| tailwind.config.js | Update primary color | ⏳ Pending |
|
|
264
|
-
| src/components/Button.tsx | Add hover state | ⏳ Pending |
|
|
265
|
-
| src/styles/globals.css | Update CSS variables | ⏳ Pending |
|
|
266
|
-
|
|
267
|
-
Apply changes? [Y/n]
|
|
268
|
-
|
|
269
|
-
✅ Updated 3 files
|
|
270
|
-
- tailwind.config.js
|
|
271
|
-
- src/components/Button.tsx
|
|
272
|
-
- src/styles/globals.css
|
|
273
|
-
|
|
274
|
-
Next: Run `npm run build` to verify
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
## Example (with Gemini)
|
|
278
|
-
|
|
279
|
-
```
|
|
280
|
-
User: /vibe.utils --ui-sync ./design/dashboard/
|
|
281
|
-
|
|
282
|
-
Claude: Checking Gemini status...
|
|
283
|
-
✅ Gemini: OAuth authenticated (user@example.com)
|
|
284
|
-
|
|
285
|
-
📂 Collecting design files...
|
|
286
|
-
- dashboard.html
|
|
287
|
-
- dashboard-dark.png
|
|
288
|
-
- dashboard-light.png
|
|
289
|
-
- tokens.json
|
|
290
|
-
- components.md
|
|
291
|
-
|
|
292
|
-
🤖 Sending to Gemini for analysis...
|
|
293
|
-
|
|
294
|
-
Gemini Response:
|
|
295
|
-
Layout: Header + Sidebar + 3-column main
|
|
296
|
-
Theme: Dark (#0F172A bg, #F8FAFC text)
|
|
297
|
-
Components: Header, Sidebar, StatCard, DataTable
|
|
298
|
-
|
|
299
|
-
Generated code:
|
|
300
|
-
- Header.tsx (64 lines)
|
|
301
|
-
- Sidebar.tsx (45 lines)
|
|
302
|
-
- StatCard.tsx (32 lines)
|
|
303
|
-
- DataTable.tsx (78 lines)
|
|
304
|
-
|
|
305
|
-
🔍 Comparing with existing code...
|
|
306
|
-
|
|
307
|
-
Found: src/pages/Dashboard.tsx
|
|
308
|
-
Found: src/components/StatCard.tsx
|
|
309
|
-
Missing: src/components/DataTable.tsx
|
|
310
|
-
|
|
311
|
-
Differences:
|
|
312
|
-
1. StatCard border-radius: design=16px, code=8px
|
|
313
|
-
2. Sidebar width: design=240px, code=200px
|
|
314
|
-
3. Primary color: design=#6366F1, code=#3B82F6
|
|
315
|
-
4. DataTable component: missing
|
|
316
|
-
|
|
317
|
-
Apply 3 updates + create 1 component? [Y/n]
|
|
318
|
-
```
|
|
319
|
-
|
|
320
|
-
## Example (Claude Fallback)
|
|
321
|
-
|
|
322
|
-
```
|
|
323
|
-
User: /vibe.utils --ui-sync ./design/dashboard/
|
|
324
|
-
|
|
325
|
-
Claude: Checking Gemini status...
|
|
326
|
-
⚠️ Gemini not configured. Using Claude fallback.
|
|
327
|
-
|
|
328
|
-
📂 Reading design files...
|
|
329
|
-
|
|
330
|
-
Reading dashboard.html...
|
|
331
|
-
[Extracts: header, sidebar, 3-column grid]
|
|
332
|
-
|
|
333
|
-
Reading dashboard-dark.png...
|
|
334
|
-
[Analyzes: dark theme colors, spacing]
|
|
335
|
-
|
|
336
|
-
Reading tokens.json...
|
|
337
|
-
[Extracts: color palette, spacing scale]
|
|
338
|
-
|
|
339
|
-
📊 Design Analysis Complete (Claude):
|
|
340
|
-
|
|
341
|
-
Layout: Header + Sidebar + 3-column main
|
|
342
|
-
Theme: Dark (#0F172A bg, #F8FAFC text)
|
|
343
|
-
|
|
344
|
-
🔍 Comparing with existing code...
|
|
345
|
-
...
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
## Notes
|
|
349
|
-
|
|
350
|
-
- Always check Gemini status first
|
|
351
|
-
- Gemini handles image analysis better than Claude for visual matching
|
|
352
|
-
- Claude fallback works but may be less accurate for complex visuals
|
|
353
|
-
- Always read ALL files including images
|
|
354
|
-
- Ask for confirmation before making changes
|
|
355
|
-
- Preserve existing functionality while updating styles
|
|
356
|
-
|
|
357
|
-
---
|
|
358
|
-
|
|
359
|
-
ARGUMENTS: $ARGUMENTS
|