design-pact 0.2.1 → 0.3.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 +17 -1
- package/SKILL.md +17 -5
- package/dist/cli.js +712 -33
- package/package.json +2 -3
- package/web/404.html +1 -1
- package/web/__next.__PAGE__.txt +4 -4
- package/web/__next._full.txt +12 -12
- package/web/__next._head.txt +4 -4
- package/web/__next._index.txt +4 -4
- package/web/__next._tree.txt +2 -2
- package/web/_next/static/chunks/06~f4cvc3b8e~.js +5 -0
- package/web/_next/static/chunks/0dbhjjzl8qfwv.js +1 -0
- package/web/_next/static/chunks/0ge~kyq7lzl~5.js +187 -0
- package/web/_next/static/chunks/0ht900cau6_ur.js +31 -0
- package/web/_next/static/chunks/0nn9jq1cov9ax.css +3 -0
- package/web/_next/static/chunks/0pe3f11zk1rcv.js +1 -0
- package/web/_next/static/chunks/{turbopack-0y3s-y83i3.06.js → turbopack-0jm8qs4dffmjl.js} +1 -1
- package/web/_not-found/__next._full.txt +10 -10
- package/web/_not-found/__next._head.txt +4 -4
- package/web/_not-found/__next._index.txt +4 -4
- package/web/_not-found/__next._not-found.__PAGE__.txt +2 -2
- package/web/_not-found/__next._not-found.txt +3 -3
- package/web/_not-found/__next._tree.txt +2 -2
- package/web/_not-found.html +1 -1
- package/web/_not-found.txt +10 -10
- package/web/index.html +1 -1
- package/web/index.txt +12 -12
- package/web/_next/static/chunks/0-l9p_pd2v836.js +0 -5
- package/web/_next/static/chunks/012lv2-viu5_..js +0 -187
- package/web/_next/static/chunks/0rp7qr3afex.u.js +0 -31
- package/web/_next/static/chunks/0uyeui9y_zv_0.css +0 -3
- package/web/_next/static/chunks/0x72peuimhbw-.js +0 -1
- package/web/_next/static/chunks/15356_01bt_3u.js +0 -1
- /package/web/_next/static/{PuB4TNuzsXn-CMEz1oKNJ → tIX_HvPOULd9j1yucL1Pb}/_buildManifest.js +0 -0
- /package/web/_next/static/{PuB4TNuzsXn-CMEz1oKNJ → tIX_HvPOULd9j1yucL1Pb}/_clientMiddlewareManifest.js +0 -0
- /package/web/_next/static/{PuB4TNuzsXn-CMEz1oKNJ → tIX_HvPOULd9j1yucL1Pb}/_ssgManifest.js +0 -0
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ for when you want the tokens as committed project files.
|
|
|
10
10
|
|
|
11
11
|
## Install the skill (recommended)
|
|
12
12
|
|
|
13
|
-
Get the `design-
|
|
13
|
+
Get the `design-pact` skill into your agent with the open
|
|
14
14
|
[`skills`](https://github.com/vercel-labs/skills) CLI — one command, works
|
|
15
15
|
across Claude Code / Cursor / Codex:
|
|
16
16
|
|
|
@@ -38,6 +38,9 @@ npx design-pact inspect design.md
|
|
|
38
38
|
|
|
39
39
|
# Audit source files: find color literals outside the contract
|
|
40
40
|
npx design-pact check design.md src/ app/
|
|
41
|
+
|
|
42
|
+
# Derive a draft design.md from an existing codebase
|
|
43
|
+
npx design-pact import src/ [--out design.md] [--force]
|
|
41
44
|
```
|
|
42
45
|
|
|
43
46
|
### `check` — enforce the contract
|
|
@@ -49,6 +52,19 @@ into CI or an agent loop: the agent generates UI against `design.md`, runs
|
|
|
49
52
|
`check`, and fixes anything flagged. `node_modules` / build output are skipped
|
|
50
53
|
automatically; whitelist intentional exceptions with `--allow "#hex,#hex"`.
|
|
51
54
|
|
|
55
|
+
### `import` — adopt design-pact in an existing project
|
|
56
|
+
|
|
57
|
+
`import` scans tailwind configs, CSS custom properties, and raw color usage,
|
|
58
|
+
then assigns the six roles: colors from variables literally named
|
|
59
|
+
background/primary/border/… win outright; the rest are filled by OKLCH
|
|
60
|
+
heuristics (lightness, chroma, hue distance, contrast) and every assignment is
|
|
61
|
+
labeled `named` / `heuristic` / `derived` in the summary so you know what to
|
|
62
|
+
review. Radius, spacing, body font, and base size are detected when declared.
|
|
63
|
+
The output is a complete design.md — dark face and status colors derived the
|
|
64
|
+
same way the studio does it — and the command prints a studio URL to eyeball
|
|
65
|
+
the palette before you commit to it. A dark codebase is handled correctly: it
|
|
66
|
+
becomes the `@media (prefers-color-scheme: dark)` face.
|
|
67
|
+
|
|
52
68
|
Outputs:
|
|
53
69
|
|
|
54
70
|
| Format | File | Source |
|
package/SKILL.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: design-
|
|
2
|
+
name: design-pact
|
|
3
3
|
description: >-
|
|
4
4
|
Establish and apply the project's design system. Invoke at the start of UI
|
|
5
5
|
work, or whenever the user says "use my design system", "apply my tokens",
|
|
@@ -7,7 +7,7 @@ description: >-
|
|
|
7
7
|
build/restyle UI. The skill first looks for a design.md in the repo:
|
|
8
8
|
if present it generates UI against it; if absent it clarifies the product
|
|
9
9
|
direction, YOU (the agent) propose 2–3 palettes, and it opens the
|
|
10
|
-
design-
|
|
10
|
+
design-pact studio where the user picks one visually and tunes it into a full
|
|
11
11
|
design system to export. All AI runs on the agent's own compute — the web app has no AI and
|
|
12
12
|
no backend.
|
|
13
13
|
---
|
|
@@ -15,7 +15,7 @@ description: >-
|
|
|
15
15
|
# Design system
|
|
16
16
|
|
|
17
17
|
The project's design system lives in a single file — `design.md` at the
|
|
18
|
-
repo root — exported from the design-
|
|
18
|
+
repo root — exported from the design-pact studio. It carries the canonical
|
|
19
19
|
color / type / spacing / radius / shadow / motion tokens plus a copy-verbatim
|
|
20
20
|
`:root` contract. That one file is the source of truth; you do not need the web
|
|
21
21
|
app or network access once it exists.
|
|
@@ -30,7 +30,7 @@ Look for `design.md`, in order:
|
|
|
30
30
|
1. A path the user gave you.
|
|
31
31
|
2. `design.md` at the repo root.
|
|
32
32
|
3. Search the repo for the file's frontmatter marker:
|
|
33
|
-
`rg -l "^design-
|
|
33
|
+
`rg -l "^design-pact:" --type md`.
|
|
34
34
|
|
|
35
35
|
Then branch:
|
|
36
36
|
|
|
@@ -41,6 +41,18 @@ Then branch:
|
|
|
41
41
|
|
|
42
42
|
## Create — no design.md yet
|
|
43
43
|
|
|
44
|
+
**If the project already has real styling** (a tailwind config, CSS custom
|
|
45
|
+
properties, an established look), offer to derive the draft from it instead of
|
|
46
|
+
inventing palettes:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npx design-pact import <src-dirs> --out design.md
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Show the user the printed summary + studio link to confirm the mapping, then
|
|
53
|
+
continue to **Apply**. Only fall through to palette proposal when the project
|
|
54
|
+
is greenfield or the user wants a fresh direction.
|
|
55
|
+
|
|
44
56
|
There's no design system yet. The division of labor: **you (the agent) do the
|
|
45
57
|
creative part — clarify direction and propose 2–3 palettes; the web app does
|
|
46
58
|
the deterministic part — render each palette so the user picks one visually,
|
|
@@ -157,7 +169,7 @@ can still switch in the top-right). Omit it and the app falls back to the
|
|
|
157
169
|
browser language. Only matters on the user's first visit; after that their
|
|
158
170
|
own choice is remembered.
|
|
159
171
|
|
|
160
|
-
Full URL: `http://localhost:3000/?<query>` (`
|
|
172
|
+
Full URL: `http://localhost:3000/?<query>` (`DESIGN_PACT_URL` defaults to
|
|
161
173
|
`http://localhost:3000`; use a hosted URL if the user has one and skip the CLI).
|
|
162
174
|
|
|
163
175
|
**Do these IN ORDER. Step 1 always happens — even if 2 fails, the printed URL is
|