justskill-design 0.0.1 → 3.2.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.
Files changed (67) hide show
  1. package/README.en.md +235 -0
  2. package/README.md +184 -11
  3. package/SKILL.md +435 -0
  4. package/canvas/app.mjs +2870 -0
  5. package/canvas/groups.mjs +204 -0
  6. package/canvas/index.html +141 -0
  7. package/canvas/styles.css +1032 -0
  8. package/canvas/tree.mjs +249 -0
  9. package/cordis.patch.yml +8 -0
  10. package/design.mjs +172 -0
  11. package/docs/dsh-workbench.png +0 -0
  12. package/dsh/client.js +864 -0
  13. package/dsh/index.js +354 -0
  14. package/dsh/scan.js +139 -0
  15. package/dsh/skill.js +41 -0
  16. package/lib/base-css.mjs +92 -0
  17. package/lib/detect.mjs +123 -0
  18. package/lib/diagnostics.mjs +382 -0
  19. package/lib/export-html.mjs +309 -0
  20. package/lib/export-svg.mjs +111 -0
  21. package/lib/fragment.mjs +702 -0
  22. package/lib/geometry.mjs +827 -0
  23. package/lib/icons.mjs +106 -0
  24. package/lib/levenshtein.mjs +133 -0
  25. package/lib/node/cli.mjs +387 -0
  26. package/lib/node/export-svg.mjs +75 -0
  27. package/lib/node/fs.mjs +309 -0
  28. package/lib/node/op-json.mjs +75 -0
  29. package/lib/node/raster-run.mjs +115 -0
  30. package/lib/node/server.mjs +1264 -0
  31. package/lib/node/static.mjs +206 -0
  32. package/lib/node/verbs/add.mjs +220 -0
  33. package/lib/node/verbs/export.mjs +161 -0
  34. package/lib/node/verbs/format.mjs +106 -0
  35. package/lib/node/verbs/import.mjs +126 -0
  36. package/lib/node/verbs/ls.mjs +98 -0
  37. package/lib/node/verbs/migrate.mjs +236 -0
  38. package/lib/node/verbs/move.mjs +76 -0
  39. package/lib/node/verbs/new.mjs +284 -0
  40. package/lib/node/verbs/remove.mjs +41 -0
  41. package/lib/node/verbs/rename.mjs +87 -0
  42. package/lib/node/verbs/serve.mjs +164 -0
  43. package/lib/node/verbs/set.mjs +150 -0
  44. package/lib/node/verbs/show.mjs +122 -0
  45. package/lib/node/verbs/tokens.mjs +167 -0
  46. package/lib/node/verbs/validate.mjs +130 -0
  47. package/lib/node/write-verbs.mjs +215 -0
  48. package/lib/normalize.mjs +288 -0
  49. package/lib/ops.mjs +2063 -0
  50. package/lib/parse.mjs +997 -0
  51. package/lib/raster.mjs +186 -0
  52. package/lib/readers/pen.mjs +1684 -0
  53. package/lib/receipt.mjs +203 -0
  54. package/lib/render.mjs +503 -0
  55. package/lib/serialize.mjs +441 -0
  56. package/lib/spans.mjs +177 -0
  57. package/lib/svg-path.mjs +483 -0
  58. package/lib/table.mjs +1047 -0
  59. package/lib/tokens.mjs +295 -0
  60. package/lib/validate.mjs +929 -0
  61. package/package.json +68 -6
  62. package/references/cookbook.md +156 -0
  63. package/references/images.md +171 -0
  64. package/references/product-flow.md +408 -0
  65. package/references/schema.md +90 -0
  66. package/references/styling.md +181 -0
  67. package/scripts/install.mjs +95 -0
package/README.en.md ADDED
@@ -0,0 +1,235 @@
1
+ <div align="center">
2
+
3
+ # JustSkill Design
4
+
5
+ English · [简体中文](README.md)
6
+
7
+ [![tests](https://github.com/justskill-ai/justskill-design/actions/workflows/test.yml/badge.svg)](https://github.com/justskill-ai/justskill-design/actions/workflows/test.yml)
8
+ [![license: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
9
+
10
+ **Design, just a skill.**
11
+
12
+ **A new paradigm for design software.**
13
+
14
+ No MCP server. No app. No account. No cloud. Collaboration happens in git —
15
+ there is one Skill, and one HTML file.
16
+
17
+ **What it is.** A design tool that lives in your repository, not in a design app.
18
+ Your agent runs the skill, designs the screens, and leaves one HTML file behind.
19
+ You review those screens on a local canvas, approve them, and the validated file
20
+ becomes the spec the code is written against.<br>
21
+ You never draw — the agent draws, you judge.
22
+
23
+ </div>
24
+
25
+ **How to use it.**
26
+
27
+ **1. Hand it to your agent.**
28
+ ```text
29
+ Run `npx skills use "https://github.com/justskill-ai/justskill-design" --skill "justskill-design"` and follow the printed instructions.
30
+ ```
31
+
32
+ **2. Say what you want.** A new product:
33
+ ```text
34
+ I want to build a note-taking app: it records the small things from each day that are worth remembering, and how I felt at the time. A calendar shows my mood as a weather chart.
35
+ ```
36
+
37
+ An existing app whose UI still looks AI-generated:
38
+ ```text
39
+ Read the current program, its product design and its philosophy. Put together a design style that belongs to this product, then use the justskill-design skill to produce a design file. Once I approve the screens, refactor the UI to match.
40
+ ```
41
+
42
+ **3. Review and approve.** The agent opens the canvas as it designs. Select an
43
+ element, press ⌘C, paste the copied pointer into the agent chat, and say what to
44
+ change; the agent applies one operation per change. When the screens are right,
45
+ approve them, and it implements them in your stack.
46
+
47
+ ![justSkill in motion: a prompt is copied into the agent, the agent designs the screens, then you open the canvas and review them](docs/justskill-demo.gif)
48
+
49
+ [Watch the full 30-second demo (MP4)](docs/justskill-demo.mp4)
50
+
51
+ ## What lives in your repo
52
+
53
+ Two things are versioned: the tool and the design.
54
+
55
+ | In your repository | What it is | Why that matters |
56
+ |---|---|---|
57
+ | **The Skill** | the design canvas | it versions with your code; the agent opens it when needed, and nothing is installed or left running |
58
+ | **The HTML** | the design artifact | it opens without this tool, diffs as text, and can be sent anywhere |
59
+
60
+ The design is not a document trapped inside an app. It is a valid, self-contained
61
+ HTML file: open it in any browser and the screens are there. That is what makes
62
+ it a file you can `git diff`, review in a pull request, and hand to someone
63
+ offline — no renderer, no account, no export step.
64
+
65
+ ## A new software paradigm
66
+
67
+ This is not a faster way to draw in a design app. It is a different shape of
68
+ design software.
69
+
70
+ **AI-native.** The agent does the designing. You do not open a canvas until there
71
+ is something to review, and you never drag a rectangle to express an idea.
72
+
73
+ **Agent-driven, human-approved.** The machine does the work; you keep the
74
+ judgment. Approve a screen, point at an element, send it back — the agent applies
75
+ the change as one operation and shows the receipt.
76
+
77
+ **Software as a skill.** The tool is a directory the agent reads, opened on
78
+ demand and put down when the work is done — 随用随开. No install, no account, no
79
+ cloud copy, no version of the tool drifting away from the design it produced.
80
+
81
+ **Evolvable.** The tool is source, not a binary. An agent can read the CLI, the
82
+ format and the canvas, then change them for this project — something no app can
83
+ offer. One base, endless variants: that is the new meaning of AI-native here.
84
+
85
+ **The design is an artifact, not a session.** It lives in your repository, next
86
+ to the code, and the validated file is the spec that code is reviewed against.
87
+
88
+ **Open source by nature.** The tool is a directory, the artifact is a file, and
89
+ there is nothing to rent — no seat, no cloud, no format to lock. So it is MIT,
90
+ free, and fully open source. Giving the tool away is not a sacrifice: it is how
91
+ the artifact comes to belong to everyone.
92
+
93
+ I wrote the longer argument — what design software becomes when it stops being an
94
+ app — in [Design software after the app](docs/paradigm.md).
95
+
96
+ ### How it compares with other design tools
97
+
98
+ The question is not which tool has more features. It is where the design lives,
99
+ who can edit it, and whether the machine that wrote it can be told it is wrong.
100
+
101
+ | | JustSkill Design | Figma · Penpot · Sketch | Pencil (pen.dev) | AI app builders (v0, Lovable, Bolt) | Agent writing HTML/CSS by hand |
102
+ |---|---|---|---|---|---|
103
+ | **The design is** | one self-contained HTML file with inline styles and `data-id` on every element | a document in that tool's format, inside that tool (app or cloud) | a `.pen` file — an open JSON schema agents can read, drawn in its app | a running app; the design is a side effect of the code | the same kind of HTML file, with no structure the tool understands |
104
+ | **How the agent works on it** | reads and writes the file itself, through the CLI or the canvas | through a plugin, Dev Mode/MCP server, or screenshots of the canvas | an on-canvas agent, MCP, or the CLI; it is agent-first by design | prompt in, code out; the design is regenerated rather than edited | writes the file directly |
105
+ | **Can it be refused before you look?** | yes — closed property set, canonical form, diagnostics that name the fix | no; the design language accepts what the canvas accepts | the schema is open and there is a CLI, but the format is not built around refusing a bad declaration; you still find out on the canvas | usually no; the browser is the first check | no |
106
+ | **Lives in git, diffs like code** | yes, one file, readable diffs | not as a file you commit; visual history only | the `.pen` file commits, but the diff is a design document's JSON, not a page's markup | code yes, design intent no | yes, usually noisy |
107
+ | **How a human reviews it** | local canvas: layer tree, inspector, zoom, page names | the app itself, with comments and live multiplayer | the app: canvas, layers, components, effects, share link | browse the built app | open the file in a browser |
108
+ | **Setup** | a skill directory; no account, no server, no install | account + app, often an MCP server for agent access | app + account, then MCP or CLI for agents | account + cloud project | nothing |
109
+ | **Evolvable** | yes — the tool is source in your repo: an agent can read it and change the CLI, the format or the canvas for this project | plugins and APIs around a closed core; the app itself is not yours to change | the `.pen` schema is open, but the editor is not in your repo; you extend it through MCP and the CLI, not by forking it | you get the generated app, not the builder; the tool is not yours | fully yours, but there is no tool to evolve — you would be writing one |
110
+
111
+ [Pencil](https://www.pen.dev) is the nearest neighbour: it also treats the file as the
112
+ interface and lets agents write the document. The difference is where the
113
+ artifact lands — its `.pen` file is a design document for its app, while this
114
+ project's artifact is an HTML file that opens anywhere. The two meet in the
115
+ middle: `node design.mjs import pen` turns a `.pen` file into this format, which
116
+ is how the 26-artboard example was made.
117
+
118
+ Where this is the wrong tool:
119
+
120
+ - You want components, variants, prototyping, shaders or live multiplayer review.
121
+ Figma, Penpot and Pencil are better at being a design tool.
122
+ - You want a running app without a design step. An AI app builder is the right
123
+ shape.
124
+ - The screen needs the full CSS toolbox — motion, effects, a component system,
125
+ responsive breakpoints — rather than a set of app screens. The scope is
126
+ deliberate; see `docs/how-it-works.md#scope`.
127
+ - You do not work with an AI agent. This is a skill for an agent, not a
128
+ standalone editor.
129
+
130
+ ## What it can design
131
+
132
+ Four design files in `examples/`, one format, and no image files in the
133
+ repository: every picture is a gradient, an inline SVG, or a URL from the
134
+ checked photo catalogue.
135
+
136
+ | | |
137
+ |---|---|
138
+ | <img src="docs/case-desk.png" width="460" alt="A desktop content board: five kanban columns of cards on a paper canvas, with a serif title and floating pills"><br><br>**A desktop product.** Six pages — an inspiration board, a five-column content board, a calendar, an analytics screen, and a style library. Tilted cards, a dot grid, glass toolbars, an area chart drawn as one SVG. [`examples/dsh-media-desk.html`](examples/dsh-media-desk.html) | <img src="docs/case-alarm.png" width="460" alt="Six alarm app screens in a row: alarm list, time picker, ringing screen, bedtime, timer, settings"><br><br>**A six-screen app.** The alarm list, the editor with a wheel picker, the ringing screen, bedtime, the timer, settings. Hand-written page by page through `add` and `set`, with the canvas open. [`examples/alarm.html`](examples/alarm.html) |
139
+ | <img src="docs/canvas-miniprogram.png" width="460" alt="26 imported artboards laid out on the canvas"><br><br>**A 26-artboard import.** A real 705 KB `.pen` file: 26 artboards, 239 references inlined, 140 overrides applied, one named loss. [`examples/miniprogram.html`](examples/miniprogram.html) | <img src="docs/case-design.png" width="160" alt="The smallest design file: a header, a hero, two stat cards and a list"><br><br>**The smallest design.** One page, 22 elements: the shortest file that is still a real, valid, exportable design. [`examples/design.html`](examples/design.html) |
140
+
141
+ Open one the way a person looks at a design:
142
+
143
+ ```sh
144
+ node design.mjs serve examples/alarm.html
145
+ ```
146
+
147
+ ## Get started
148
+
149
+ The one-liner at the top works for the current session. To install it once for
150
+ every session:
151
+
152
+ ```sh
153
+ npx skills add "https://github.com/justskill-ai/justskill-design" --skill "justskill-design" -g -y
154
+ ```
155
+
156
+ That copies the skill into `~/.agents/skills/justskill-design` and links it into
157
+ the agent directories the CLI manages; `npx skills update` keeps it current. The
158
+ skill needs about 1 MB (`SKILL.md`, `references/`, `design.mjs`, `lib/`,
159
+ `canvas/`); the demo video and screenshots are for people, and a copied install
160
+ can drop them to free about 5 MB — the agent will offer to.
161
+
162
+ ## Use it inside DeepSeek Harness
163
+
164
+ This repository is also a DSH (DeepSeek Harness) plugin. Installing it:
165
+
166
+ - registers the skill in DSH automatically — no symlink into `~/.agents/skills`
167
+ - adds **JustSkill** to the left sidebar: a workbench listing design files across workspaces
168
+ - clicking a design file creates a **new session in that file's workspace**, opens it, and
169
+ opens a **Canvas tab in the right sidebar**: chat on the left, live canvas on the right
170
+ - the agent opens or focuses that tab by calling the `justskill_canvas` tool; in DSH it
171
+ does not run `serve` or open a browser
172
+ - with no file selected, the Canvas tab lists the **current workspace** design files; picking one opens it in that tab
173
+
174
+ Install from npm:
175
+
176
+ ```sh
177
+ dsh plugin --profile web add justskill-design
178
+ ```
179
+
180
+ Or straight from GitHub (no npm needed):
181
+
182
+ ```sh
183
+ dsh plugin --profile web add github:justskill-ai/justskill-design
184
+ ```
185
+
186
+ For local development, link the checkout:
187
+
188
+ ```sh
189
+ dsh plugin --profile web add link:"/path/to/justskill-design"
190
+ ```
191
+
192
+ Then enable it on the DSH Plugins page and restart. Desktop uses the same package
193
+ from its own plugin page. The plain `npx skills add` route above still works — the
194
+ skill and the plugin are one piece of code.
195
+
196
+ ![The JustSkill Design workbench: a left-sidebar entry opens a design-file browser grouped by workspace](docs/dsh-workbench.png)
197
+
198
+ ## Technical details
199
+
200
+ The README stops here on purpose. The format, the commands, the canvas, the
201
+ write path and the test numbers are documented where they belong:
202
+
203
+ | Document | What it answers |
204
+ |---|---|
205
+ | `SKILL.md` | What the agent reads on every trigger: when to use this, the format, the refusals, the writing rules. |
206
+ | `docs/paradigm.md` | The longer argument: software as a skill, design software after the app, evolvability, and the nine-stage loop. |
207
+ | `docs/how-it-works.md` | Why the design file is HTML, the format in one screen, every command, the canvas, the write funnel, the receipt, the scope, what runs at run time, and installing from the checkout. |
208
+ | `docs/quality.md` | What the test suite pins, and the measurements taken today. |
209
+ | `docs/format-v3.md` | The frozen contract: element model, canonical form, diagnostic codes, module boundaries. |
210
+ | `references/styling.md` | Every allowed property and its value grammar. |
211
+ | `references/schema.md` | The element contract, generated from the format table. |
212
+ | `references/images.md` | The verified photo catalogue. |
213
+ | `references/product-flow.md` | The software-development playbook, stage by stage: from idea to code. |
214
+
215
+ The three product documents have Chinese editions in [`docs/zh/`](docs/zh/README.md);
216
+ `docs/format-v3.md` and the generated `references/` stay English on purpose.
217
+
218
+ ## Credits
219
+
220
+ `examples/dsh-media-desk.html` recreates the interface of
221
+ [dsh-media-desk](https://github.com/woniuniuniu/dsh-media-desk), a DeepSeek
222
+ Harness plugin for media workflows.
223
+
224
+ `test/fixtures/real/open-design-components.html` is a copy of a fixture from
225
+ [OpenDesign](https://github.com/nexu-io/open-design) (Apache-2.0), kept as a
226
+ real-world parse case.
227
+
228
+ The photographs in `references/images.md` and `examples/miniprogram.pen` come
229
+ from [Unsplash](https://unsplash.com) and are used under the
230
+ [Unsplash License](https://unsplash.com/license).
231
+
232
+ ## License
233
+
234
+ MIT — see [LICENSE](LICENSE). The OpenDesign fixture and the Unsplash
235
+ photographs are third-party material under their own licenses, credited above.
package/README.md CHANGED
@@ -1,14 +1,187 @@
1
- # justskill-design (name reserved)
1
+ <div align="center">
2
2
 
3
- This npm name is reserved for **justSkill** — design web pages as a validated
4
- HTML file with inline CSS, then tune them on a local canvas.
3
+ # JustSkill Design
5
4
 
6
- - Repository: https://github.com/justskill-ai/justskill-design
7
- - Install:
8
- ```sh
9
- git clone https://github.com/justskill-ai/justskill-design.git ~/Developer/justskill-design
10
- node ~/Developer/justskill-design/scripts/install.mjs
11
- ```
5
+ [English](README.en.md) · 简体中文
12
6
 
13
- Nothing is published under this name yet. The CLI may move to it later; until
14
- then, install the skill from the repository above.
7
+ [![tests](https://github.com/justskill-ai/justskill-design/actions/workflows/test.yml/badge.svg)](https://github.com/justskill-ai/justskill-design/actions/workflows/test.yml)
8
+ [![license: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
9
+
10
+ **Design, just a skill.**
11
+
12
+ **设计软件新范式。**
13
+
14
+ 没有 MCP,没有 APP,没有账号,没有云端。协作发生在 git 里——只有一个 Skill 和一张 HTML。
15
+
16
+ **它是什么。** 一个活在代码仓库里、而不是活在设计软件里的设计工具。你的 agent 运行这个 skill,设计页面,最后留下一张 HTML 文件;你在本地画布上评审、确认,校验通过的文件就是写代码时的规格。<br>
17
+ 你不画图——agent 画,你判断。
18
+
19
+ </div>
20
+
21
+ **怎么用。**
22
+
23
+ **1. 把它交给你的 agent。**
24
+ ```text
25
+ Run `npx skills use "https://github.com/justskill-ai/justskill-design" --skill "justskill-design"` and follow the printed instructions.
26
+ ```
27
+
28
+ **2. 说你要什么。** 做一个新产品:
29
+ ```text
30
+ 我想做一个笔记 App:记录我每天值得被记住的事情,以及当时的心情。可以有个日历展示我的心情晴雨表。
31
+ ```
32
+
33
+ 改一个已有产品,去掉 UI 的“AI 味”:
34
+ ```text
35
+ 读取一下当前程序的产品设计、理念,帮我整理一份属于这个程序的设计风格,并使用 justskill-design 出一份设计稿。等我确认设计稿效果后,按照设计重构 UI。
36
+ ```
37
+
38
+ **3. 评审、确认。** agent 一边设计一边打开画布。选中一个元素,按 ⌘C,把复制出来的指针粘贴回对话,说要改什么;agent 一次只应用一个操作。页面都对了就确认,它会在你的技术栈里把设计实现成代码。
39
+
40
+ ![justSkill 动起来的样子:把一段提示词复制给 agent,agent 设计页面,然后你打开画布检查确认](docs/justskill-demo-zh.gif)
41
+
42
+ [看完整的 30 秒演示(MP4)](docs/justskill-demo-zh.mp4)
43
+
44
+ ## 你的仓库里有什么
45
+
46
+ 被版本化的有两样:工具和设计。
47
+
48
+ | 在你的仓库里 | 它是什么 | 为什么重要 |
49
+ |---|---|---|
50
+ | **Skill** | 设计画布 | 它和你的代码一起版本化;agent 需要时打开它,没有东西被安装、也没有进程常驻 |
51
+ | **HTML** | 设计产物 | 它不依赖这个工具就能打开、能当文本 diff、能发给任何人 |
52
+
53
+ 设计不是被关在某个 app 里的文档,而是一张合法、自包含的 HTML 文件:用任何浏览器打开,页面就在那里。所以它能被 `git diff`、能在 pull request 里评审、能离线交给别人——不需要渲染器,不需要账号,也不需要“导出”这一步。
54
+
55
+ ## 一种软件新范式
56
+
57
+ 它不是“更快的设计 app”,而是另一种形状的设计软件。
58
+
59
+ **AI 原生。** 设计由 agent 完成。没有东西可评审之前,你根本不用打开画布;你也不用拖一个矩形来表达想法。
60
+
61
+ **Agent 驱动,人来审批。** 机器干活,判断留给人。通过一页、指一个元素、退回去改——agent 把改动作为一个操作应用,并给你看回执。
62
+
63
+ **软件 Skill 化。** 工具是 agent 读取的一个目录,需要时打开、做完就放下——随用随开。没有安装、没有账号、没有云端副本,也不存在“工具的版本和它产出的设计对不上”。
64
+
65
+ **可进化。** 工具是源码,不是二进制。agent 能读 CLI、读格式、读画布,再按这个项目的需要去改它们——这是 app 给不了的。同一个基座,长出无穷的变化:这才是这里「AI 原生」的新含义。
66
+
67
+ **设计是产物,不是一次会话。** 它就在你的仓库里、挨着代码;校验通过的那份文件,就是评审代码时对照的规格。
68
+
69
+ **它天生开源。** 工具是目录、产物是文件,就没有东西可以出租——没有席位、没有云端、没有锁得住的格式。所以它 MIT、不收费、全开源。让利不是牺牲:工具交出去,产物才真正属于每个人。
70
+
71
+ 更长的论证——当设计软件不再是一个 app,它变成了什么——写在[《App 之后的设计软件》](docs/zh/paradigm.md)里([英文原文](docs/paradigm.md))。
72
+
73
+ ### 和其他设计软件比
74
+
75
+ 真正的问题不是“谁的功能更多”,而是:设计活在哪里、谁能改它、写下它的那台机器能不能被明确告知“这里写错了”。
76
+
77
+ | | JustSkill Design | Figma · Penpot · Sketch | Pencil(pen.dev) | AI 应用生成器(v0、Lovable、Bolt) | Agent 直接手写 HTML/CSS |
78
+ |---|---|---|---|---|---|
79
+ | **设计是什么** | 一张自包含的 HTML 文件,内联样式,每个元素都有 `data-id` | 该工具格式的文档,活在该工具里(app 或云端) | 一个 `.pen` 文件——开放的 JSON schema,agent 能直接读写,但要在它的 app 里画 | 一个能跑的应用;设计是代码的副产品 | 同样是 HTML 文件,但没有工具能理解的结构 |
80
+ | **agent 怎么改它** | 直接读写文件,走 CLI 或画布 | 走插件、Dev Mode/MCP server,或者对着画布截图 | 画布内 agent、MCP 或 CLI;它从设计上就是 agent-first | 提示词进、代码出;设计是被重新生成,而不是被编辑 | 直接写文件 |
81
+ | **你查看之前能否被拒绝** | 能——封闭的属性集合、规范形式、指出修复方式的诊断 | 不能;设计语言接受画布接受的写法 | schema 开放、也有 CLI,但格式本身不围绕「拒绝一条坏声明」设计;对错仍然在画布上见 | 通常不能;浏览器是第一个检查 | 不能 |
82
+ | **进 git、像代码一样 diff** | 能,一个文件,diff 可读 | 不能作为你提交的文件;只有可视化历史 | `.pen` 文件可以提交,但 diff 是一份设计文档的 JSON,不是一页页面的标记 | 代码可以,设计意图不行 | 可以,但通常很吵 |
83
+ | **人怎么评审** | 本地画布:图层树、检查器、缩放、页名 | 工具本身,配评论和实时协作 | 在它的 app 里:画布、图层、组件、特效、分享链接 | 浏览构建出来的应用 | 浏览器打开文件 |
84
+ | **安装成本** | 一个 skill 目录;无账号、无 server、无安装 | 账号 + app,agent 接进来往往还要 MCP server | app + 账号,agent 再走 MCP 或 CLI | 账号 + 云项目 | 无 |
85
+ | **可进化性** | 能——工具就是你仓库里的源码:agent 能读它,按这个项目改 CLI、改格式、改画布 | 插件和 API 围着一个封闭内核;app 本身不是你能改的 | `.pen` schema 开放,但编辑器源码不在你仓库里;扩展靠 MCP 和 CLI,不是靠 fork 编辑器 | 拿到的是生成出来的应用,不是生成器;工具不属于你 | 完全属于你,但这里没有工具可以进化——你得自己写一个 |
86
+
87
+ [Pencil](https://www.pen.dev)(pen.dev)是这里最接近的邻居:它同样把文件当接口,也允许 agent 直接写文档。区别在产物落在哪里——它的 `.pen` 是交给它的 app 的设计文档,而这个项目的产物是一张在任何地方都能打开的 HTML。两者在中间接上:`node design.mjs import pen` 把 `.pen` 转成这个格式,26 画板的那个案例就是这么来的。
88
+
89
+ 这些情况下它不是对的工具:
90
+
91
+ - 你要组件、变体、原型、shader 或实时多人评审——Figma、Penpot 和 Pencil 更擅长做设计工具。
92
+ - 你要跳过设计步骤、直接拿到能跑的应用——AI 应用生成器才是对的形状。
93
+ - 这个页面需要完整的 CSS 工具箱——动效、特效、组件系统、响应式断点——而不是一组 App 页面。范围是故意收窄的,见 `docs/zh/how-it-works.md#范围`。
94
+ - 你不和 AI agent 一起工作。这是给 agent 的 skill,不是独立编辑器。
95
+
96
+ ## 能设计到什么程度
97
+
98
+ `examples/` 里四个设计文件,同一个格式,仓库里没有任何图片文件:画面要么是渐变、要么是内联 SVG,要么是经过校验的图片清单里的 URL。
99
+
100
+ | | |
101
+ |---|---|
102
+ | <img src="docs/case-desk.png" width="460" alt="一个桌面端内容看板:纸面画布上五列卡片,衬线标题和浮动胶囊"><br><br>**一个桌面产品。** 六页——灵感板、五列内容看板、日历、数据复盘页、风格库。倾斜卡片、点阵画布、毛玻璃工具条、一整张 SVG 面积图。[`examples/dsh-media-desk.html`](examples/dsh-media-desk.html) | <img src="docs/case-alarm.png" width="460" alt="六屏闹钟 App:闹钟列表、时间选择器、响铃页、就寝、计时器、设置"><br><br>**一个六屏 App。** 闹钟列表、带滚轮选择器的编辑器、响铃页、就寝、计时器、设置。用 `add` 和 `set` 一页页手写,画布一直开着。[`examples/alarm.html`](examples/alarm.html) |
103
+ | <img src="docs/canvas-miniprogram.png" width="460" alt="26 个导入的画板铺在画布上"><br><br>**一次 26 个画板的导入。** 一个真实的 705 KB `.pen` 文件:26 个画板,239 个引用被内联,140 个覆盖被应用,一处被明确记录的丢失。[`examples/miniprogram.html`](examples/miniprogram.html) | <img src="docs/case-design.png" width="160" alt="最小的设计文件:一个 header、一个 hero、两张数据卡和一个列表"><br><br>**最小的设计。** 一页、22 个元素:还称得上是真实、合法、可导出设计的最短文件。[`examples/design.html`](examples/design.html) |
104
+
105
+ 像一个人看设计那样打开它:
106
+
107
+ ```sh
108
+ node design.mjs serve examples/alarm.html
109
+ ```
110
+
111
+ ## 开始用
112
+
113
+ 最上面那行提示词在当前会话里就能用。要在每个会话里都有,装一次:
114
+
115
+ ```sh
116
+ npx skills add "https://github.com/justskill-ai/justskill-design" --skill "justskill-design" -g -y
117
+ ```
118
+
119
+ 它会把 skill 复制到 `~/.agents/skills/justskill-design`,再链接进 CLI 管理的
120
+ agent 目录;`npx skills update` 负责更新。skill 本身只要约 1 MB(`SKILL.md`、
121
+ `references/`、`design.mjs`、`lib/`、`canvas/`);演示视频和截图是给人看的,复制安装
122
+ 的话可以删掉腾出约 10 MB——agent 会主动提出。
123
+
124
+ ## 在 DeepSeek Harness 里用
125
+
126
+ 这个仓库同时是一个 DSH(DeepSeek Harness)插件。装上以后:
127
+
128
+ - **skill 自动注册**进 DSH,不用再软链到 `~/.agents/skills`
129
+ - 左侧栏多一个 **JustSkill**:打开「JustSkill Design 工作台」,按工作区列出所有设计文件
130
+ - 点一个设计文件:在它所属的工作区**新建会话**,自动切换到该会话,并在**右侧栏**打开 Canvas tab;聊天在左、画布在右,agent 的修改实时刷新
131
+ - Agent 要打开画布时会调用 `justskill_canvas` 工具,在右侧栏打开/聚焦 Canvas tab;DSH 下不会再跑 `serve` 或弹浏览器
132
+ - 右栏 Canvas tab 没有指定文件时,会列出**当前工作区**的设计文件,点一个就在该 tab 内打开
133
+
134
+ 推荐从 npm 安装:
135
+
136
+ ```sh
137
+ dsh plugin --profile web add justskill-design
138
+ ```
139
+
140
+ 也可以直接从 GitHub 安装(不需要 npm):
141
+
142
+ ```sh
143
+ dsh plugin --profile web add github:justskill-ai/justskill-design
144
+ ```
145
+
146
+ 本地开发用 checkout:
147
+
148
+ ```sh
149
+ dsh plugin --profile web add link:"/path/to/justskill-design"
150
+ ```
151
+
152
+ 然后在 DSH 的 Plugins 页启用并重启。Desktop 用同一个包,在桌面端的插件页安装即可;
153
+ 不想装插件也可以继续用上面的 `npx skills add`——skill 和插件是同一份代码。
154
+
155
+ ![JustSkill Design 工作台:左侧栏入口打开中央文件浏览器,按工作区列出设计文件](docs/dsh-workbench.png)
156
+
157
+ ## 技术细节
158
+
159
+ README 到这里就停了,是有意的。格式、命令、画布、写入路径和测试数据,都写在它们该在的地方:
160
+
161
+ | 文档 | 回答什么 |
162
+ |---|---|
163
+ | `SKILL.md` | agent 每次被触发时读的内容:什么时候用、格式、拒绝规则、写作规则。 |
164
+ | `docs/zh/paradigm.md` | 更长的论证:软件 Skill 化、app 之后的设计软件、可进化性,以及九阶段循环。 |
165
+ | `docs/zh/how-it-works.md` | 为什么设计文件是 HTML、一屏看懂格式、所有命令、画布、写入漏斗、回执、范围,运行时到底需要什么,以及从 checkout 安装。 |
166
+ | `docs/zh/quality.md` | 测试套件固定了哪些不变量,以及今天量到的数据。 |
167
+ | `docs/format-v3.md` | 冻结的契约:元素模型、规范形式、诊断码、模块边界。 |
168
+ | `references/styling.md` | 每个允许的属性及其取值语法。 |
169
+ | `references/schema.md` | 元素契约,由格式表生成。 |
170
+ | `references/images.md` | 经过校验的图片清单。 |
171
+ | `references/product-flow.md` | 软件开发的分阶段剧本:从想法到代码。 |
172
+
173
+ `docs/format-v3.md` 和 `references/*.md` 保持英文(冻结的契约、生成的文件);其余中文文档见 [docs/zh/](docs/zh/README.md)。
174
+
175
+ ## 致谢
176
+
177
+ `examples/dsh-media-desk.html` 复刻的是
178
+ [dsh-media-desk](https://github.com/woniuniuniu/dsh-media-desk) 的界面——一个
179
+ DeepSeek Harness 的自媒体工作台插件。
180
+
181
+ `test/fixtures/real/open-design-components.html` 是 [OpenDesign](https://github.com/nexu-io/open-design)(Apache-2.0)里一个 fixture 的副本,保留作为真实世界的解析用例。
182
+
183
+ `references/images.md` 里的照片和 `examples/miniprogram.pen` 来自 [Unsplash](https://unsplash.com),按 [Unsplash License](https://unsplash.com/license) 使用。
184
+
185
+ ## 许可证
186
+
187
+ MIT——见 [LICENSE](LICENSE)。OpenDesign 的 fixture 和 Unsplash 的照片是第三方材料,遵循它们自己的许可证,已在上文注明。