imugi-ai 1.0.0 → 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/README.md +56 -5
- package/dist/cli.js +628 -115
- package/dist/cli.js.map +1 -1
- package/package.json +12 -2
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
+
<img src="https://raw.githubusercontent.com/M00N7682/imugi/main/assets/hero.png" alt="imugi" width="200" />
|
|
4
|
+
|
|
3
5
|
# imugi
|
|
4
6
|
|
|
5
|
-
[](https://www.npmjs.com/package/imugi)
|
|
7
|
+
[](https://www.npmjs.com/package/imugi-ai)
|
|
6
8
|
[](https://github.com/M00N7682/imugi/stargazers)
|
|
7
9
|
[](https://opensource.org/licenses/MIT)
|
|
8
10
|
[](https://nodejs.org)
|
|
@@ -13,6 +15,10 @@
|
|
|
13
15
|
|
|
14
16
|
[Get Started](#quick-start) · [MCP Tools](#mcp-tools) · [Configuration](#configuration) · [Contributing](CONTRIBUTING.md)
|
|
15
17
|
|
|
18
|
+
<br />
|
|
19
|
+
|
|
20
|
+
<img src="https://raw.githubusercontent.com/M00N7682/imugi/main/assets/demo-visual.png" alt="imugi — Design to Code visual verification flow" width="820" />
|
|
21
|
+
|
|
16
22
|
</div>
|
|
17
23
|
|
|
18
24
|
---
|
|
@@ -45,10 +51,13 @@ imugi uses **SSIM** (Structural Similarity) + **pixelmatch** + **Claude Vision**
|
|
|
45
51
|
|
|
46
52
|
## Quick Start
|
|
47
53
|
|
|
48
|
-
### Step 1: Install
|
|
54
|
+
### Step 1: Install & Setup
|
|
49
55
|
|
|
50
56
|
```bash
|
|
51
|
-
npm install -g imugi
|
|
57
|
+
npm install -g imugi-ai
|
|
58
|
+
|
|
59
|
+
# One-click setup: installs Playwright browser, detects project, creates config
|
|
60
|
+
imugi init
|
|
52
61
|
```
|
|
53
62
|
|
|
54
63
|
### Step 2: Add to your AI tool
|
|
@@ -60,7 +69,7 @@ Add imugi as an MCP server in your Claude Code or Cursor config:
|
|
|
60
69
|
"mcpServers": {
|
|
61
70
|
"imugi": {
|
|
62
71
|
"command": "npx",
|
|
63
|
-
"args": ["-y", "imugi", "mcp"]
|
|
72
|
+
"args": ["-y", "imugi-ai", "mcp"]
|
|
64
73
|
}
|
|
65
74
|
}
|
|
66
75
|
}
|
|
@@ -78,11 +87,35 @@ That's it. imugi captures, compares, and patches until the output matches your d
|
|
|
78
87
|
|
|
79
88
|
---
|
|
80
89
|
|
|
90
|
+
## Example: Design to Code
|
|
91
|
+
|
|
92
|
+
A terminal-inspired hero section — designed in Pencil, implemented by imugi.
|
|
93
|
+
|
|
94
|
+
<div align="center">
|
|
95
|
+
<img src="https://raw.githubusercontent.com/M00N7682/imugi/main/assets/example-comparison.png" alt="imugi — design vs implementation comparison" width="820" />
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
> Dark mode terminal aesthetic with JetBrains Mono, `#10B981` green accent, nav bar, hero CTA, 4-step flow diagram, MCP tools grid, and footer — pixel-perfect match from design to code.
|
|
99
|
+
|
|
100
|
+
See the full example at [`examples/hero-section/`](examples/hero-section/).
|
|
101
|
+
|
|
102
|
+
### More Examples
|
|
103
|
+
|
|
104
|
+
| Example | Description |
|
|
105
|
+
|---------|-------------|
|
|
106
|
+
| [`hero-section/`](examples/hero-section/) | Terminal-inspired landing hero with flow diagram |
|
|
107
|
+
| [`login-page/`](examples/login-page/) | Split-panel login with social auth buttons |
|
|
108
|
+
| [`pricing-page/`](examples/pricing-page/) | 3-tier pricing cards (Starter / Pro / Enterprise) |
|
|
109
|
+
| [`dashboard/`](examples/dashboard/) | Analytics dashboard with sidebar, stats, and chart |
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
81
113
|
## Features
|
|
82
114
|
|
|
83
115
|
- **Visual Comparison Engine** — SSIM + pixel diff + Claude Vision scoring with heatmap output
|
|
84
116
|
- **Boulder Loop** — Iterative code improvement that keeps going until the design match threshold is met
|
|
85
117
|
- **MCP Server** — Drop-in integration with Claude Code, Cursor, or any MCP-compatible AI tool
|
|
118
|
+
- **Figma Integration** — Export Figma frames directly via URL, no manual export needed
|
|
86
119
|
- **Project Detection** — Auto-detects framework (React/Vue/Svelte), CSS method (Tailwind/modules/styled-components), language (TypeScript/JavaScript)
|
|
87
120
|
- **Interactive Agent** — Terminal UI with real-time iteration progress (powered by Ink)
|
|
88
121
|
- **Smart Patching** — Full regeneration for scores below 0.7, surgical patches for scores above 0.7
|
|
@@ -124,6 +157,21 @@ imugi generate ./design.png --output src/app/page.tsx
|
|
|
124
157
|
imugi compare ./design.png --screenshot ./current.png
|
|
125
158
|
```
|
|
126
159
|
|
|
160
|
+
### Figma Export
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# Export a Figma frame as PNG
|
|
164
|
+
imugi figma "https://www.figma.com/design/FILE_KEY/name?node-id=42-1234"
|
|
165
|
+
|
|
166
|
+
# Export at 3x scale with custom output path
|
|
167
|
+
imugi figma "https://www.figma.com/design/FILE_KEY/name?node-id=42-1234" -s 3 -o design.png
|
|
168
|
+
|
|
169
|
+
# Export and immediately compare against dev server
|
|
170
|
+
imugi figma "https://www.figma.com/design/FILE_KEY/name?node-id=42-1234" --compare
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Requires a Figma personal access token via `FIGMA_TOKEN` environment variable or `figma.token` in config.
|
|
174
|
+
|
|
127
175
|
---
|
|
128
176
|
|
|
129
177
|
## MCP Tools
|
|
@@ -133,6 +181,7 @@ imugi compare ./design.png --screenshot ./current.png
|
|
|
133
181
|
| `imugi_capture` | Screenshot a URL via headless Chromium |
|
|
134
182
|
| `imugi_compare` | Compare design vs screenshot — returns SSIM score, pixel diff, and heatmap |
|
|
135
183
|
| `imugi_analyze` | Analyze visual differences with actionable fix suggestions |
|
|
184
|
+
| `imugi_figma_export` | Export a Figma frame as PNG via URL or file key + node ID |
|
|
136
185
|
| `imugi_detect` | Detect project tech stack (framework, CSS, language) |
|
|
137
186
|
| `imugi_serve` | Start a dev server for the target project |
|
|
138
187
|
|
|
@@ -183,6 +232,7 @@ Create `imugi.config.json` in your project root:
|
|
|
183
232
|
| `IMUGI_THRESHOLD` | Similarity threshold (0.8–0.99) |
|
|
184
233
|
| `IMUGI_MAX_ITERATIONS` | Max iterations (1–50) |
|
|
185
234
|
| `IMUGI_PORT` | Dev server port |
|
|
235
|
+
| `FIGMA_TOKEN` | Figma personal access token (for `imugi figma` and `imugi_figma_export`) |
|
|
186
236
|
|
|
187
237
|
---
|
|
188
238
|
|
|
@@ -202,7 +252,8 @@ src/
|
|
|
202
252
|
│ ├── analyzer.ts # Diff classification + strategy
|
|
203
253
|
│ ├── renderer.ts # Playwright screenshot engine
|
|
204
254
|
│ ├── patcher.ts # Code generation + patching
|
|
205
|
-
│
|
|
255
|
+
│ ├── context.ts # Project tech stack detection
|
|
256
|
+
│ └── figma.ts # Figma URL parsing + API export
|
|
206
257
|
├── llm/
|
|
207
258
|
│ ├── client.ts # Anthropic SDK wrapper
|
|
208
259
|
│ └── prompts.ts # Prompt engineering
|