vite-plugin-specter 0.6.0 → 0.7.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 +77 -41
- package/dist/client.js +335 -15
- package/dist/extension-chrome/content.js +335 -15
- package/dist/extension-chrome/manifest.json +1 -1
- package/dist/extension-firefox/content.js +335 -15
- package/dist/extension-firefox/manifest.json +1 -1
- package/dist/index.cjs +335 -15
- package/dist/index.js +335 -15
- package/extension/content.js +335 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Specter
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Point at any element on your dev site. Mark what to change — with exact values and a source anchor — and hand it to your AI.**
|
|
4
4
|
|
|
5
|
-
Specter is a Vite plugin that
|
|
5
|
+
Specter is a Vite plugin that overlays an element inspector on your dev server. Hover any element to see its styles, component name, and spacing; measure gaps Figma-style; mark elements as **Specs** with a plain-language note; then copy them all to your AI assistant — each one carries the exact current values and a greppable source anchor, so there's no "which element?" and no "what's the current value?". Optionally, push your Specs straight into Claude Code with `/spectify`. Specter is automatically stripped from production builds.
|
|
6
6
|
|
|
7
7
|
## Requirements
|
|
8
8
|
|
|
@@ -46,51 +46,84 @@ If you ever need Specter gone entirely, remove `specter()` from the Vite config
|
|
|
46
46
|
|
|
47
47
|
### Toggle on/off
|
|
48
48
|
|
|
49
|
-
Press **Ctrl+Option+Z** to
|
|
49
|
+
Press **Ctrl+Option+Z** to activate Specter. A small zap icon appears at the bottom-left. Press again (or **Esc**) to hide it — your Specs are kept and reappear when you reactivate.
|
|
50
50
|
|
|
51
|
-
###
|
|
51
|
+
### Three modes
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
Specter has three modes; switching mode only changes *what's shown on screen* — you can mark a Spec in any of them.
|
|
54
|
+
|
|
55
|
+
| Mode | Enter | Shows |
|
|
56
|
+
|------|-------|-------|
|
|
57
|
+
| **Properties** (default) | — | Styles tooltip on hover |
|
|
58
|
+
| **Measure** | tap **Option** | Figma-style spacing to neighbors |
|
|
59
|
+
| **Comment** | **C** | Just an outline — for clean design review |
|
|
60
|
+
|
|
61
|
+
### Inspect an element (Properties mode)
|
|
62
|
+
|
|
63
|
+
**Hover** any element. A tooltip shows:
|
|
54
64
|
|
|
55
65
|
- HTML tag + React/Vue component name + dimensions
|
|
56
66
|
- Text content (truncated)
|
|
57
67
|
- Font: family, weight, size, line-height
|
|
58
|
-
- Color (with hex) and background
|
|
68
|
+
- Color (with hex) and background — flagged `(hover)` if the value comes from a `:hover` rule
|
|
59
69
|
- Padding, margin, border-radius (if non-zero)
|
|
60
70
|
- Display + gap + flex direction
|
|
61
71
|
|
|
62
|
-
###
|
|
72
|
+
### Measure spacing (Measure mode)
|
|
73
|
+
|
|
74
|
+
Tap **Option** to switch to Measure mode. Hover any element to see distances to its surrounding neighbors. Press **M** while hovering to **pin** that element, then hover another to measure the gap or inset between the two; **M** again unpins. Tap **Option** again to return to Properties.
|
|
63
75
|
|
|
64
|
-
|
|
76
|
+
### Mark a Spec (and optionally annotate)
|
|
65
77
|
|
|
66
|
-
|
|
78
|
+
Press **P** while hovering an element to mark it as a **Spec**. A note box opens on the element — type the change you want ("reduce width to 320", "tighten padding to 8px") and press **Enter**, or just leave it empty for a plain mark. Numbered badges appear on each marked element. Mark as many as you like across the page.
|
|
67
79
|
|
|
68
|
-
|
|
80
|
+
### Comment mode
|
|
69
81
|
|
|
70
|
-
|
|
82
|
+
Press **C** for Comment mode: the props/measure overlays hide and you get just a hover outline — good for talking through a design without visual noise. Specs still capture full properties underneath, so a Comment-mode Spec copies exactly like any other.
|
|
71
83
|
|
|
72
|
-
|
|
84
|
+
### Specs side panel
|
|
73
85
|
|
|
74
|
-
|
|
86
|
+
Press **L** to open the Specs review panel. It lists every Spec; hover a row to scroll to and highlight its element; edit or delete notes inline. Specs survive a reload (saved to `localStorage` per URL).
|
|
75
87
|
|
|
76
|
-
|
|
88
|
+
### Copy to your AI
|
|
77
89
|
|
|
78
|
-
|
|
90
|
+
Press **Cmd+C**:
|
|
79
91
|
|
|
80
|
-
|
|
92
|
+
- **With Specs marked** → copies **all** of them at once. Each block leads with your `✏️ CHANGE:` note (if any).
|
|
93
|
+
- **With nothing marked** → copies the hovered element's properties (or, in Measure mode, the measurement).
|
|
81
94
|
|
|
82
|
-
|
|
95
|
+
The copied format is lean and AI-ready — the current values plus a `find:` line that anchors the element in your source (test-id → id → aria-label → unique text → class → CSS path), so the assistant greps straight to the code:
|
|
83
96
|
|
|
84
97
|
```
|
|
85
|
-
[Specter 1/
|
|
86
|
-
✏️ CHANGE:
|
|
87
|
-
<button
|
|
88
|
-
|
|
89
|
-
padding: 12px 20px
|
|
90
|
-
|
|
98
|
+
[Specter 1/2]
|
|
99
|
+
✏️ CHANGE: tighten the vertical padding to 8px
|
|
100
|
+
<button> .btn-primary "Book a demo" 200×48
|
|
101
|
+
find: .btn-primary
|
|
102
|
+
font: Inter 600 14/20 · color: #fff · bg: #4f46e5 · padding: 12px 20px · radius: 10px · display: inline-flex
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
[Specter 2/2]
|
|
107
|
+
✏️ CHANGE: make this text darker — it fails contrast
|
|
108
|
+
<p> .hero-sub "Analytics that…" 560×57
|
|
109
|
+
find: .hero-sub
|
|
110
|
+
font: Inter 400 19/28.5 · color: #c7cbd1
|
|
91
111
|
```
|
|
92
112
|
|
|
93
|
-
|
|
113
|
+
Paste into Claude, Cursor, or any AI assistant — the instructions travel with the elements, so there's nothing left to explain.
|
|
114
|
+
|
|
115
|
+
## Share comments with another person
|
|
116
|
+
|
|
117
|
+
Specs aren't only for your AI — you can send them to a **person**. Mark comments on a page, open the Specs panel (**L**), and click **Share**. Specter copies a link; whoever opens it — on the same page, with Specter installed — sees your comments re-anchored on the exact same elements.
|
|
118
|
+
|
|
119
|
+
- **Comments only.** Only your notes and how to re-find each element travel — never the CSS properties or measurements. You're sharing feedback, not internals.
|
|
120
|
+
- **Same page, same element.** Comments re-anchor by a source locator, not screen coordinates. If the page changed so an element is gone or different, that comment shows as **MISSING** in the panel (with the reason) instead of landing on the wrong spot.
|
|
121
|
+
- **A link, or a file.** Small reviews copy as a normal link (`…/pricing#spx=…`) you paste into Slack or a message — the link is both the destination and the payload, so it opens the right page automatically. A large batch (or a page that uses `#`-routing) downloads a `comments.specter.json` file to send instead; use the **Import** button to open one you receive.
|
|
122
|
+
- **Zero backend.** The comments travel inside the link or file itself — no accounts, no server. One-way (no threads).
|
|
123
|
+
|
|
124
|
+
**Both people need Specter (v0.7+).** This is where the **browser extension** shines: it works on any deployed or staging URL, so two people looking at the same prototype can trade feedback without a shared dev server. A share link opened without Specter just shows the normal page — nothing breaks.
|
|
125
|
+
|
|
126
|
+
> Specter also ships as a **browser extension** for Chrome and Firefox, which runs on *any* website (no Vite required). The Share Comments flow above is designed for it. See the [GitHub repo](https://github.com/setugk/vite-plugin-specter) for links.
|
|
94
127
|
|
|
95
128
|
## Shortcut reference
|
|
96
129
|
|
|
@@ -98,36 +131,39 @@ So when you paste into your AI assistant, it already knows both *what* to change
|
|
|
98
131
|
|--------|----------|
|
|
99
132
|
| Toggle Specter | **Ctrl+Option+Z** |
|
|
100
133
|
| Inspect element | Hover (while active) |
|
|
101
|
-
|
|
|
102
|
-
|
|
|
103
|
-
|
|
|
104
|
-
|
|
|
105
|
-
|
|
|
106
|
-
|
|
|
107
|
-
|
|
|
134
|
+
| Mark a Spec (+ optional note) | **P** |
|
|
135
|
+
| Copy (all Specs, or hovered element) | **Cmd+C** |
|
|
136
|
+
| Measure mode (toggle) | **Option** (tap) |
|
|
137
|
+
| Pin / unpin for measuring | **M** (in Measure mode) |
|
|
138
|
+
| Comment mode (toggle) | **C** |
|
|
139
|
+
| Specs panel (toggle) | **L** |
|
|
140
|
+
| Close panel / hide Specter | **Esc** |
|
|
141
|
+
|
|
142
|
+
## Optional: push Specs straight to Claude Code (`/spectify`)
|
|
108
143
|
|
|
109
|
-
|
|
144
|
+
Instead of copy-paste, Specter can auto-sync your Specs to a local bridge that Claude Code reads on demand. Enable it in your Vite config:
|
|
145
|
+
|
|
146
|
+
```ts
|
|
147
|
+
specter({ claudeBridge: true })
|
|
148
|
+
```
|
|
110
149
|
|
|
111
|
-
1.
|
|
112
|
-
2. Hover the element you want to change
|
|
113
|
-
3. Either press **Cmd+C** to copy its properties, or press **N** to annotate the exact change you want first
|
|
114
|
-
4. Repeat **N** on every element you want to change, then **Cmd+C** once to copy them all
|
|
115
|
-
5. Paste into your AI assistant's chat — the instructions travel with the elements, so there's nothing left to explain
|
|
150
|
+
With it on, every Spec you mark auto-syncs (watch for the sync dot in the panel) to a local bridge at `http://127.0.0.1:8787`. Run the bridge (`node node_modules/vite-plugin-specter/mcp-bridge/server.mjs`, or register it in your project's `.mcp.json` so your IDE launches it), then in Claude Code run **`/spectify`** — it pulls whatever's currently synced and implements it. See [`mcp-bridge/`](https://github.com/setugk/vite-plugin-specter/tree/main/mcp-bridge) for setup. One bridge can serve several projects; `/spectify <port>` scopes to one.
|
|
116
151
|
|
|
117
|
-
|
|
152
|
+
`claudeBridge` is **off by default** — the shipped plugin never opens a connection unless you enable it.
|
|
118
153
|
|
|
119
154
|
## Configuration
|
|
120
155
|
|
|
121
156
|
```ts
|
|
122
|
-
specter()
|
|
123
|
-
specter({ shortcuts: { activate: 'ctrl+shift+i' } })
|
|
157
|
+
specter() // defaults
|
|
158
|
+
specter({ shortcuts: { activate: 'ctrl+shift+i' } }) // custom activate shortcut
|
|
159
|
+
specter({ claudeBridge: true }) // enable the Claude Code bridge
|
|
124
160
|
```
|
|
125
161
|
|
|
126
162
|
The `activate` shortcut accepts any combination of `ctrl`, `alt`, `shift`, `meta`/`cmd`, and a key. Default is `ctrl+alt+z`.
|
|
127
163
|
|
|
128
164
|
## Optional: `data-style` attribute
|
|
129
165
|
|
|
130
|
-
Tag elements with `data-style="keyName"` to
|
|
166
|
+
Tag elements with `data-style="keyName"` to surface the style-object key in the inspector and the copied output:
|
|
131
167
|
|
|
132
168
|
```jsx
|
|
133
169
|
<h1 data-style="pageTitle">Welcome</h1>
|