Skip to content

Commit cd58dca

Browse files
committed
feat(v12): chat REPL + permalinks + gallery + spec + distribution prep
The "best in the game" release: takes designlang from one-shot extractor to iterative + shareable + standardized + distributed. ITERATIVE — designlang chat - src/chat.js: REPL over a live extraction. Heuristic-only router parses natural-ish English ("make it brutalist", "primary #ff4800", "sharpen radii", "dark mode") into structured operations on the design object. Re-derives DTCG / Tailwind / CSS vars / DESIGN.md on `save`. Loads from URL or existing *-design-tokens.json. - bin: new `chat <target>` subcommand. ~360 lines, zero new deps. SHAREABLE — permalinks - website/lib/cache.js: getCachedByHash + listRecent helpers over the existing Blob cache (24h TTL), no new infra. - website/lib/build-files.js: shared file-builder used by both /api/extract (streaming) and /x/[hash] (permalink page). - website/app/x/[hash]/page.js + PermalinkViewer.js: every cached extraction is now a stable URL. Stat strip + Copy permalink CTA + the same 12-tab ResultViewer. - /api/extract emits a `permalink` event up front; HeroExtractor rewrites the URL bar via history.replaceState so refresh-and-share works mid-stream. - website/app/gallery/page.js: public directory of recent extractions, palette-strip cards, relative timestamps, intent + material + library signals. ISR-cached every 10 min. STANDARDIZED — DESIGN.md spec - website/app/spec/page.js: formal spec doc. Eight canonical sections, YAML front-matter schema, reference implementation pointer, CC BY 4.0 license, credit to design-extractor.com for pioneering the format. - website/public/badge.svg: embeddable Verified badge (paper + ink + accent). - Sitemap + robots updated with /spec, /gallery. DISTRIBUTED — submission playbook - marketplace/SUBMISSION-PLAYBOOK.md: ordered list of 6 marketplaces with click-time estimates and review-queue waits. - marketplace/{figma,cursor,vscode,claude-code-skill,raycast,chrome}-listing.md: pre-written listing copy, manifests, screenshot briefs, tweet drafts for each. Click "submit" tomorrow morning; nothing left to write. Home nav: Gallery + Spec links added; v11 → v12 label. Tests: 317/317 pass.
1 parent 72f563e commit cd58dca

20 files changed

Lines changed: 1387 additions & 95 deletions

bin/design-extract.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,21 @@ program
10851085
}
10861086
});
10871087

1088+
// ── Chat — REPL over a live extraction (v12) ──────────────
1089+
program
1090+
.command('chat <target>')
1091+
.description('Interactive REPL over an extraction. <target> is either a URL or a path to an existing *-design-tokens.json file.')
1092+
.option('-o, --out <dir>', 'output directory for `save`', './chat-output')
1093+
.action(async (target, opts) => {
1094+
try {
1095+
const { runChat } = await import('../src/chat.js');
1096+
await runChat(target, opts);
1097+
} catch (err) {
1098+
console.error(chalk.red(`\n ${err.message}\n`));
1099+
process.exit(1);
1100+
}
1101+
});
1102+
10881103
// ── Replay — record a short WebM of motion from a URL ─────
10891104
program
10901105
.command('replay <url>')

marketplace/SUBMISSION-PLAYBOOK.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# designlang — Distribution Submission Playbook
2+
3+
Submit each marketplace below. All listing copy + manifests are pre-written.
4+
Review queues take 1–7 days; this playbook is everything you need to click "submit".
5+
6+
---
7+
8+
## 1. Figma Community (`figma-plugin/`)
9+
10+
**Goal:** publicly listed in the Figma Community plugin store.
11+
12+
**Steps:**
13+
1. Open Figma Desktop → Community → Publish a plugin.
14+
2. Upload from local: `figma-plugin/`.
15+
3. Use the title, tagline, description, tags, and cover-image brief from `marketplace/figma-listing.md`.
16+
4. Screenshots: take 4 from the live extraction studio.
17+
5. Submit. Review queue: 3–7 days.
18+
19+
---
20+
21+
## 2. Cursor — Custom Tool listing
22+
23+
**Goal:** Cursor users can `Cmd+Shift+P → designlang: Extract` from any URL.
24+
25+
**Steps:**
26+
1. Read `marketplace/cursor-listing.md`.
27+
2. The provided `mcp.json` snippet is what users paste into `~/.cursor/mcp.json`.
28+
3. We don't submit to Cursor's marketplace directly (no formal review process yet);
29+
the MCP integration is documented and self-served. Promotion = blog post + tweet.
30+
31+
---
32+
33+
## 3. VS Code Marketplace (`vscode-extension/`)
34+
35+
**Goal:** publicly listed at marketplace.visualstudio.com/items?itemName=designlang.
36+
37+
**Steps:**
38+
1. Install `vsce` once: `npm install -g @vscode/vsce`.
39+
2. From `vscode-extension/`: `vsce package` → produces `.vsix`.
40+
3. Create publisher account: <https://marketplace.visualstudio.com/manage>.
41+
4. `vsce publish` (or upload the `.vsix` via the dashboard).
42+
5. Use the listing copy from `marketplace/vscode-listing.md`.
43+
6. Review queue: ~24h.
44+
45+
---
46+
47+
## 4. Claude Code Skill registry
48+
49+
**Goal:** designlang appears in the official Claude Code skills list.
50+
51+
**Steps:**
52+
1. Read `marketplace/claude-code-skill.md` — it contains the SKILL.md the registry expects.
53+
2. The SKILL.md is already emitted by `designlang <url> --emit-agent-rules` at
54+
`.claude/skills/designlang/SKILL.md`. We submit a copy at the project root for discovery.
55+
3. Open a PR against <https://github.com/anthropics/claude-code-skills> (or the
56+
then-current registry repo) — title: "Add: designlang skill".
57+
58+
---
59+
60+
## 5. Raycast Store (`raycast-extension/`)
61+
62+
**Goal:** designlang as a one-keystroke Raycast command.
63+
64+
**Steps:**
65+
1. Read `marketplace/raycast-listing.md`.
66+
2. From `raycast-extension/`: follow Raycast's contribution guide
67+
<https://developers.raycast.com/basics/publish-an-extension>.
68+
3. PR to <https://github.com/raycast/extensions>.
69+
4. Review queue: 5–14 days.
70+
71+
---
72+
73+
## 6. Chrome Web Store (`chrome-extension/`)
74+
75+
**Goal:** one-click extract from any tab via the Chrome toolbar.
76+
77+
**Steps:**
78+
1. Read `marketplace/chrome-listing.md`.
79+
2. Zip `chrome-extension/`: `cd chrome-extension && zip -r ../designlang-chrome.zip .`.
80+
3. Upload at <https://chrome.google.com/webstore/devconsole>. ($5 one-time dev fee.)
81+
4. Review queue: 1–3 days.
82+
83+
---
84+
85+
## Sequencing
86+
87+
Do them in this order — easiest payoff first, most setup last:
88+
1. **Cursor MCP** (no review, just docs + tweet — ship today).
89+
2. **Chrome Web Store** ($5 fee, 1–3 day review — submit today).
90+
3. **VS Code Marketplace** (free, ~24h review — submit today).
91+
4. **Figma Community** (free, 3–7 day review — submit today).
92+
5. **Claude Code Skills registry** (PR-based, async — submit this week).
93+
6. **Raycast Store** (PR-based, 5–14 day review — submit this week).
94+
95+
Total click-time across all six: ~90 minutes. The wall-clock for everything to be live: ~2 weeks.

marketplace/chrome-listing.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Chrome Web Store — designlang extension
2+
3+
## Name
4+
5+
designlang — Extract design system from this tab
6+
7+
## Summary (max 132 chars)
8+
9+
One click to extract any website's design system: tokens, typography, spacing, components, voice. $0, no account, MIT.
10+
11+
## Description (long)
12+
13+
designlang lives in your Chrome toolbar. Click the icon on any tab; the active URL is sent to designlang.app, which runs a Playwright extraction and opens the result inline as tabs (DESIGN.md, DTCG tokens, Tailwind, CSS variables, Figma variables, and 7 more).
14+
15+
Permissions:
16+
`activeTab` — read the URL of the current tab. Nothing else.
17+
18+
Use cases:
19+
• Read a competitor's design tokens in 5 seconds
20+
• Pull a Tailwind config off any production site
21+
• Generate a DESIGN.md for AI coding agents (Claude Code, Cursor, Windsurf)
22+
• One-click copy hex / radius / shadow values
23+
• Import a Figma Variable collection from any URL
24+
25+
Open source: https://github.com/Manavarya09/design-extract
26+
27+
## Category
28+
29+
Developer Tools
30+
31+
## Languages
32+
33+
English
34+
35+
## Screenshots (4 — 1280x800)
36+
37+
1. Browser tab on a real site (e.g. Stripe), with the designlang toolbar icon highlighted.
38+
2. The same tab after clicking — designlang.app opens with extraction in progress (token paint streaming).
39+
3. The result viewer with the DESIGN.md tab active, source code visible, copy/download buttons.
40+
4. The result viewer on the Tailwind config tab, showing extracted palette + scale.
41+
42+
## Submission
43+
44+
ZIP the `chrome-extension/` directory, upload at <https://chrome.google.com/webstore/devconsole>.
45+
$5 one-time developer fee.

marketplace/claude-code-skill.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Claude Code Skills registry — designlang
2+
3+
## Skill name
4+
5+
designlang
6+
7+
## SKILL.md (the file the registry expects)
8+
9+
```markdown
10+
---
11+
name: designlang
12+
description: Reverse-engineer any website into a complete design system. Outputs DTCG W3C tokens, motion, anatomy, voice, page intent, material language, plus a single agent-native DESIGN.md and a one-command Next.js clone. Use when the user wants to extract, mirror, or compare design tokens against a live URL.
13+
when_to_use: |
14+
Use this skill when the user wants to:
15+
- Extract design tokens, palette, typography, or shadows from a public website
16+
- Generate a DESIGN.md for an existing site (agent-native single-file artifact)
17+
- Clone a website's design as a runnable Next.js starter
18+
- Compare local tokens against a deployed site (drift detection)
19+
- Import a website's tokens into Figma, Tailwind, iOS, Android, Flutter, or WordPress
20+
arguments:
21+
- name: url
22+
description: Public URL of the site to extract from.
23+
required: true
24+
---
25+
26+
# designlang skill
27+
28+
`npx designlang <url>` runs a Playwright extraction and writes ~25 files
29+
(DTCG tokens, Tailwind, CSS vars, Figma vars, motion, anatomy, voice,
30+
intent, material, library detection, prompt pack for v0/Lovable/Cursor,
31+
plus the single-file `DESIGN.md`).
32+
33+
Sub-commands:
34+
- `designlang clone <url>` — generates a working Next.js repo from the extraction
35+
- `designlang ci <url> --tokens ./tokens.json` — drift bot, writes a PR-comment markdown
36+
- `designlang studio` — local web studio over the latest extraction
37+
- `designlang chat <url>` — REPL with mutations (sharpen / soften / dark / brutalist / glass / swap-color / swap-font)
38+
- `designlang mcp` — stdio MCP server
39+
40+
For agent rules and ready-to-paste prompts, run with `--emit-agent-rules` or read
41+
the `*-prompts/` directory.
42+
43+
The full spec for `DESIGN.md` is at <https://designlang.app/spec>.
44+
```
45+
46+
## Submission flow
47+
48+
1. Fork <https://github.com/anthropics/claude-code> (or the then-current registry repo).
49+
2. Add `skills/designlang/SKILL.md` with the content above.
50+
3. PR title: `Add: designlang skill`.
51+
4. PR body: link to <https://designlang.app>, describe the surface, mention 1.6k stars + 5K npm downloads.
52+
5. Tag the PR with `skill` and `community`.

marketplace/cursor-listing.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Cursor — designlang MCP integration
2+
3+
## What it gives the user
4+
5+
Inside Cursor (and Windsurf, and Claude Desktop), `designlang` exposes the **last extraction** as a live MCP resource. Cursor can read tokens, regions, components, and CSS health without re-extracting, and call MCP tools to refine the design (`designlang chat` ops are wired here).
6+
7+
## Install (paste into `~/.cursor/mcp.json`)
8+
9+
```json
10+
{
11+
"mcpServers": {
12+
"designlang": {
13+
"command": "npx",
14+
"args": ["-y", "designlang", "mcp", "--output-dir", "./design-extract-output"]
15+
}
16+
}
17+
}
18+
```
19+
20+
## What Cursor sees
21+
22+
Resources:
23+
- `designlang://latest/tokens` — DTCG W3C token tree of the most recent extraction
24+
- `designlang://latest/regions` — semantic region map (nav, hero, pricing, …)
25+
- `designlang://latest/components` — component clusters with variant/size/state
26+
- `designlang://latest/css-health` — specificity graph + unused-CSS report
27+
- `designlang://latest/design-md` — the agent-native single-file artifact
28+
29+
Tools:
30+
- `designlang_extract` — paste a URL, get tokens
31+
- `designlang_chat` — apply mutations (sharpen / soften / dark / brutalist / glass / swap-color / swap-font)
32+
- `designlang_clone` — generate a working Next.js repo from a URL
33+
- `designlang_drift` — compare local tokens against a live URL
34+
35+
## Tweet thread for launch
36+
37+
```
38+
1/ Cursor + designlang. Paste any URL inside Cursor and it reads the live design system as MCP resources.
39+
40+
`~/.cursor/mcp.json`:
41+
{
42+
"mcpServers": {
43+
"designlang": {
44+
"command": "npx",
45+
"args": ["-y", "designlang", "mcp"]
46+
}
47+
}
48+
}
49+
50+
2/ Then ask: "Refactor my <Button> to match stripe.com's design language" — Cursor reads designlang://latest/tokens and rewrites against the real palette, radii, shadows, voice.
51+
52+
3/ It also exposes `designlang_chat` as a tool. "Make it brutalist" → tokens regenerate. "Swap primary to #ff4800" → updated. Then ask Cursor to apply the new tokens to your repo.
53+
54+
4/ $0. MIT. https://designlang.app
55+
```

marketplace/figma-listing.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Figma Community — designlang plugin listing
2+
3+
## Title
4+
5+
designlang — Import any website's design system
6+
7+
## Tagline (max 100 chars)
8+
9+
Paste a URL, get a Figma Variable collection — colors, typography, spacing — pulled live from any site.
10+
11+
## Description (max 1000 chars)
12+
13+
designlang reverse-engineers any website into a complete design system and imports it directly into Figma as a Variable collection.
14+
15+
Paste a URL or paste an exported `*-figma-variables.json` from the [designlang CLI](https://www.npmjs.com/package/designlang). The plugin creates a fresh VariableCollection (or updates an existing one), maps every primitive, semantic, and composite token, and supports multi-mode payloads (light/dark) automatically.
16+
17+
What you get:
18+
• Colors with proper roles (primary, secondary, accent, background, foreground, neutrals)
19+
• Typography variables (sans, mono, body size, heading scale)
20+
• Spacing scale (with detected base unit)
21+
• Radii (xs/sm/md/lg/xl/full)
22+
• Shadows (kept as raw strings — Figma doesn't natively type box-shadow)
23+
24+
Free, MIT-licensed, no account. The whole system also runs as a CLI: `npx designlang <url>`.
25+
26+
## Tags (pick up to 12)
27+
28+
design-system, design-tokens, design-extractor, dtcg, figma-variables, color-palette, typography, tokens, brand, design-system-import, w3c, ai-coding-agents
29+
30+
## Cover-image brief
31+
32+
Layout: paper background (#f3f1ea), single orange accent (#ff4800).
33+
Hero: "designlang" in Fraunces, 96px, with the `d` mark to the left.
34+
Below: a 5-swatch palette strip showing primary / secondary / accent / fg / bg.
35+
Right side: a tiny mock Figma Variable panel showing 6 imported variables.
36+
37+
## Screenshots (4)
38+
39+
1. Plugin UI on plugin run — "Paste URL or upload .json" state.
40+
2. Mid-import — token list streaming in.
41+
3. Figma side panel showing the imported VariableCollection with 24 colors expanded.
42+
4. After import — a frame using the imported variables (button + card mock).
43+
44+
## Support email
45+
46+
[your email]
47+
48+
## Source code link
49+
50+
https://github.com/Manavarya09/design-extract/tree/main/figma-plugin

marketplace/raycast-listing.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Raycast Store — designlang extension
2+
3+
## Title
4+
5+
designlang — Extract a website's design system
6+
7+
## Subtitle
8+
9+
Paste any URL, get DTCG tokens / DESIGN.md / Tailwind config in one keystroke.
10+
11+
## Description
12+
13+
Designlang reverse-engineers any website into a complete design system, all from inside Raycast.
14+
15+
Triggers a Playwright extraction (or pulls from cache), then opens the result in your default browser as a shareable permalink at `designlang.app/x/<hash>`. Paste the URL, hit ⌘ Enter, see the design system within 5 seconds.
16+
17+
What you get every time:
18+
• A shareable permalink (works on every device, no account)
19+
• A single-file DESIGN.md for AI coding agents
20+
• 12 file formats: DTCG tokens, Tailwind config, CSS variables, Figma variables, shadcn theme, React/Vue/Svelte themes, iOS SwiftUI, Android Compose, Flutter, WordPress block theme
21+
22+
Free, MIT, no signup.
23+
24+
## Categories
25+
26+
Developer Tools, Productivity
27+
28+
## Keywords
29+
30+
design, tokens, design-system, css, tailwind, figma, dtcg, ai
31+
32+
## Author
33+
34+
Manav Arya Singh (@manavarya09)
35+
36+
## Submission
37+
38+
PR to https://github.com/raycast/extensions with the contents of `raycast-extension/`.

0 commit comments

Comments
 (0)