@pen.dev/cli 0.2.8

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 (94) hide show
  1. package/LICENSE +66 -0
  2. package/README.md +369 -0
  3. package/SKILL.md +175 -0
  4. package/dist/all-Bd-ariyL.mjs +2 -0
  5. package/dist/anthropic-messages-D9L1s6pn.mjs +40 -0
  6. package/dist/anthropic-messages-OUY8OJj7.mjs +40 -0
  7. package/dist/azure-openai-responses-DJKVhgL-.mjs +2 -0
  8. package/dist/azure-openai-responses-DSoXDHyP.mjs +2 -0
  9. package/dist/browserAll-CGZu5S9C.mjs +2 -0
  10. package/dist/completionchunk-BaC49qbM.mjs +28 -0
  11. package/dist/completionchunk-c1fsGiUK.mjs +2 -0
  12. package/dist/diagnostics-hlO-DFfk.mjs +2 -0
  13. package/dist/dist-BMO4tFTj.mjs +1576 -0
  14. package/dist/dist-BupqiQep.mjs +10 -0
  15. package/dist/dist-CCiXmKIu.mjs +10 -0
  16. package/dist/dist-Dq7S86ex.mjs +4 -0
  17. package/dist/emscripten-module.browser-F76W5DM6-3XbeCXXF.mjs +5147 -0
  18. package/dist/emscripten-module.browser-XIKQQPVU-JPkxo8p_.mjs +2160 -0
  19. package/dist/error-body-D-jnPxbB.mjs +2 -0
  20. package/dist/esm-D7vjDQPJ.mjs +2 -0
  21. package/dist/esm-DZA7B0U9.mjs +25 -0
  22. package/dist/ffi-D6Fxg1d3.mjs +2 -0
  23. package/dist/ffi-u92ceo2s.mjs +2 -0
  24. package/dist/from-BRY6g9CG.mjs +15 -0
  25. package/dist/from-Bra_AO5N.mjs +15 -0
  26. package/dist/github-copilot-headers-ByQsj8SR.mjs +2 -0
  27. package/dist/github-copilot-headers-C4gA1Pjv.mjs +2 -0
  28. package/dist/google-generative-ai-BqfOLKon.mjs +2 -0
  29. package/dist/google-generative-ai-CZCmY9Gg.mjs +2 -0
  30. package/dist/google-shared-TkwodIGJ.mjs +318 -0
  31. package/dist/google-shared-YCDndJGN.mjs +318 -0
  32. package/dist/google-vertex-COsje8-Z.mjs +2 -0
  33. package/dist/google-vertex-Cz5Ddo09.mjs +2 -0
  34. package/dist/hash-BFdQp5Bn.mjs +2 -0
  35. package/dist/hash-DFXd8wf4.mjs +2 -0
  36. package/dist/headers-BkXFKypW.mjs +2 -0
  37. package/dist/headers-DtjIrAKV.mjs +2 -0
  38. package/dist/html-DwPxy9Y2.mjs +26 -0
  39. package/dist/index.mjs +8 -0
  40. package/dist/init-BaeOBiNV.mjs +2 -0
  41. package/dist/json-parse-BEWPMC87.mjs +4 -0
  42. package/dist/json-parse-qcO5FIDw.mjs +4 -0
  43. package/dist/mistral-conversations-DIR6EyvH.mjs +8 -0
  44. package/dist/mistral-conversations-JED5QLUZ.mjs +10 -0
  45. package/dist/models-CtsqYGxn.mjs +2 -0
  46. package/dist/models-DVeZ-5Ql.mjs +2 -0
  47. package/dist/module-ES6BEMUI-DGywGVC7.mjs +2 -0
  48. package/dist/module-asyncify-2EFITU5U-BU2CORSO.mjs +2 -0
  49. package/dist/multipart-parser-4wzMiNnD.mjs +3 -0
  50. package/dist/multipart-parser-CYJPmLQW.mjs +3 -0
  51. package/dist/node_modules/@highagency/pencil-wasm/enums.gen.d.ts +247 -0
  52. package/dist/node_modules/@highagency/pencil-wasm/package.json +26 -0
  53. package/dist/node_modules/@highagency/pencil-wasm/pencil.d.ts +769 -0
  54. package/dist/node_modules/@highagency/pencil-wasm/pencil.js +1 -0
  55. package/dist/node_modules/@highagency/pencil-wasm/pencil.wasm +0 -0
  56. package/dist/openai-CJ1JzbCY.mjs +17 -0
  57. package/dist/openai-Cv91uXJB.mjs +17 -0
  58. package/dist/openai-codex-responses-Cq8yFwfN.mjs +8 -0
  59. package/dist/openai-codex-responses-CzFfnGCe.mjs +8 -0
  60. package/dist/openai-completions-DT4sdoVc.mjs +6 -0
  61. package/dist/openai-completions-iO6yRDuR.mjs +6 -0
  62. package/dist/openai-prompt-cache-CjAED4AP.mjs +2 -0
  63. package/dist/openai-prompt-cache-tVxLccHG.mjs +2 -0
  64. package/dist/openai-responses-Cr3SvtkS.mjs +2 -0
  65. package/dist/openai-responses-Dtr2Vk2j.mjs +2 -0
  66. package/dist/openai-responses-shared-BLDoTd9K.mjs +13 -0
  67. package/dist/openai-responses-shared-C4PQs_0V.mjs +11 -0
  68. package/dist/openrouter-images-Dk-x2ke6.mjs +2 -0
  69. package/dist/openrouter-images-NEnwWNeg.mjs +2 -0
  70. package/dist/otel-BIqiVgiM.mjs +4 -0
  71. package/dist/otel-BbTSxAZp.mjs +4 -0
  72. package/dist/out/data/halo.lib.pen +4728 -0
  73. package/dist/out/data/lunaris.lib.pen +5980 -0
  74. package/dist/out/data/nitro.lib.pen +4923 -0
  75. package/dist/out/data/shadcn.lib.pen +5596 -0
  76. package/dist/out/mcp-server-darwin-arm64 +0 -0
  77. package/dist/out/mcp-server-darwin-x64 +0 -0
  78. package/dist/out/mcp-server-linux-arm64 +0 -0
  79. package/dist/out/mcp-server-linux-x64 +0 -0
  80. package/dist/out/mcp-server-windows-arm64.exe +0 -0
  81. package/dist/out/mcp-server-windows-x64.exe +0 -0
  82. package/dist/photon_rs-D_fXqzJa.mjs +2 -0
  83. package/dist/provider-env-D0o9FEJi.mjs +2 -0
  84. package/dist/provider-env-DTh1Xe-B.mjs +2 -0
  85. package/dist/sanitize-unicode-B5GgPEiu.mjs +2 -0
  86. package/dist/sanitize-unicode-DVHYNBlY.mjs +2 -0
  87. package/dist/src-Bk9f60_P.mjs +4 -0
  88. package/dist/src-CbkJodKR.mjs +4 -0
  89. package/dist/standalone-BGhJUGyg.mjs +30 -0
  90. package/dist/transform-messages-DSEUXL48.mjs +2 -0
  91. package/dist/transform-messages-j96k5V_T.mjs +2 -0
  92. package/dist/validate-response-CezyBuEO.mjs +3 -0
  93. package/dist/webworkerAll-Dy6-Qx-T.mjs +2 -0
  94. package/package.json +69 -0
package/LICENSE ADDED
@@ -0,0 +1,66 @@
1
+ Pencil CLI — Proprietary Software License
2
+
3
+ Copyright (c) 2026 High Agency, Inc. All rights reserved.
4
+
5
+ This software and associated documentation files (the "Software") are the
6
+ proprietary property of High Agency, Inc. ("Licensor").
7
+
8
+ 1. LICENSE GRANT
9
+
10
+ Subject to the terms of this License, Licensor grants you a limited,
11
+ non-exclusive, non-transferable, non-sublicensable, revocable license to
12
+ install and use the Software solely in connection with the Pencil platform
13
+ and services provided by Licensor.
14
+
15
+ 2. RESTRICTIONS
16
+
17
+ You may not, and may not permit others to:
18
+
19
+ (a) modify, adapt, translate, or create derivative works of the Software;
20
+ (b) reverse engineer, decompile, disassemble, or otherwise attempt to
21
+ derive the source code of the Software;
22
+ (c) redistribute, sublicense, lease, rent, loan, or otherwise transfer
23
+ the Software to any third party;
24
+ (d) use the Software to build or operate a product or service that
25
+ competes with Pencil or the Licensor's offerings;
26
+ (e) remove or alter any proprietary notices, labels, or marks on the
27
+ Software.
28
+
29
+ 3. OWNERSHIP
30
+
31
+ The Software is licensed, not sold. Licensor retains all right, title,
32
+ and interest in and to the Software, including all intellectual property
33
+ rights therein.
34
+
35
+ 4. TERMINATION
36
+
37
+ This License is effective until terminated. It will terminate automatically
38
+ if you fail to comply with any of its terms. Licensor may also terminate
39
+ this License at any time for any reason. Upon termination you must cease
40
+ all use of the Software and destroy all copies.
41
+
42
+ 5. DISCLAIMER OF WARRANTIES
43
+
44
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
45
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
46
+ FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. LICENSOR DOES NOT
47
+ WARRANT THAT THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE.
48
+
49
+ 6. LIMITATION OF LIABILITY
50
+
51
+ IN NO EVENT SHALL LICENSOR BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
52
+ SPECIAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR ANY LOSS OF PROFITS OR
53
+ REVENUE, WHETHER INCURRED DIRECTLY OR INDIRECTLY, ARISING OUT OF YOUR
54
+ USE OF OR INABILITY TO USE THE SOFTWARE, EVEN IF LICENSOR HAS BEEN
55
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
56
+
57
+ 7. GENERAL
58
+
59
+ This License constitutes the entire agreement between you and Licensor
60
+ regarding the Software and supersedes all prior agreements. This License
61
+ shall be governed by and construed in accordance with the laws of the
62
+ State of Delaware, United States, without regard to its conflict of law
63
+ provisions. If any provision of this License is held to be unenforceable,
64
+ the remaining provisions shall remain in full force and effect.
65
+
66
+ For questions about this License, contact: hq@pencil.dev
package/README.md ADDED
@@ -0,0 +1,369 @@
1
+ # pen.dev CLI (formerly Pencil CLI)
2
+
3
+ Command-line interface for [pen.dev](https://pen.dev) — create and edit `.pen` design files from the terminal. Run the AI agent with a prompt, call MCP tools directly in an interactive shell, batch-process multiple designs, or export to PNG/JPEG/WEBP/PDF. Built on the same editor engine as the desktop app and IDE extension, with full headless rendering, AI image generation, and stock photo support.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g @pen.dev/cli
9
+ # or
10
+ pnpm add -g @pen.dev/cli
11
+ # or
12
+ yarn global add @pen.dev/cli
13
+ ```
14
+
15
+ ## Authentication
16
+
17
+ The CLI requires authentication before running agent operations. There are two methods:
18
+
19
+ ### Sign Up
20
+
21
+ ```bash
22
+ pen signup --email you@example.com --username johndoe --name "John Doe"
23
+ ```
24
+
25
+ Creates a new account. You'll receive a verification email — click the link, then log in.
26
+
27
+ ### Interactive Login
28
+
29
+ ```bash
30
+ pen login
31
+ ```
32
+
33
+ This starts an interactive session where you choose your login method (email + password or email + OTP code). On success the session token is stored in `~/.pencil/session-cli.json`.
34
+
35
+ ### Non-Interactive Login
36
+
37
+ ```bash
38
+ # Step 1: Request an OTP code
39
+ pen login --email you@example.com
40
+
41
+ # Step 2: Log in with the code from your email
42
+ pen login --email you@example.com --code 123456
43
+ ```
44
+
45
+ When flags are provided the interactive prompts are skipped, useful for scripting and CI.
46
+
47
+ ### CLI Key (for CI/CD)
48
+
49
+ Set the `PEN_CLI_KEY` environment variable. CLI keys are scoped to an organization and can be created/revoked in the **Developer Keys** section of your organization settings on the pen.dev web app.
50
+
51
+ ```bash
52
+ PEN_CLI_KEY=pencil_cli_... pen --out design.pen --prompt "Create a form" --agent claude
53
+ ```
54
+
55
+ The CLI key always takes precedence over a stored session token.
56
+
57
+ ### Checking Status
58
+
59
+ ```bash
60
+ pen status
61
+ ```
62
+
63
+ Displays the current authentication method, verifies the session with the backend, and shows account details (email, name, organization for CLI keys).
64
+
65
+ ## Quick Start
66
+
67
+ ```bash
68
+ # Log in first
69
+ pen login
70
+
71
+ # Create a new design from scratch
72
+ pen --out design.pen --prompt "Create a login page with email and password fields" --agent claude
73
+
74
+ # Modify an existing design
75
+ pen --in existing.pen --out modified.pen --prompt "Add a blue submit button" --agent claude
76
+
77
+ # Start an interactive shell (in headless mode)
78
+ pen interactive -o design.pen
79
+
80
+ # Start an interactive shell (connect to a running pen.dev app)
81
+ pen interactive -a desktop -i design.pen
82
+
83
+ # List available models
84
+ pen --list-models --agent claude
85
+ ```
86
+
87
+ ## Usage
88
+
89
+ ```
90
+ pen [command] [options]
91
+
92
+ Commands:
93
+ signup Create a new account (flags required, see below)
94
+ login Log in interactively (email + password or OTP)
95
+ status Check authentication status
96
+ version Show CLI version
97
+ interactive Start an interactive tool shell (see below)
98
+
99
+ Options:
100
+ --in, -i <path> Input .pen file (optional, starts with empty canvas if omitted)
101
+ --out, -o <path> Output .pen file path (required unless --export is used)
102
+ --prompt, -p <text> Prompt for the AI agent (required)
103
+ --prompt-file, -f <path> Attach a file to send with the prompt (repeatable). Images (png, jpeg, gif, webp) or text files; paths are not the prompt text itself.
104
+ --agent <type> Agent to use when --model is omitted: claude, codex, gemini (default: claude)
105
+ --model, -m <id> Model to use; agent is inferred from the model id
106
+ --custom, -c Use custom Claude model config (e.g. AWS Bedrock, Vertex AI)
107
+ --list-models List available models and exit
108
+ --tasks, -t <path> JSON tasks file for batch operations
109
+ --workspace, -w <path> Workspace folder path to run the agent in
110
+ --export, -e <path> Export an image of the final result
111
+ --export-scale <n> Export scale factor (default: 1)
112
+ --export-type <type> Export format: png, jpeg, webp, pdf (default: png)
113
+ --verbose-mcp Log full MCP tool error details to the console
114
+ --help, -h Show help message
115
+ ```
116
+
117
+ ## Interactive Mode
118
+
119
+ The interactive shell lets you call MCP tools directly on `.pen` files — useful for scripting, debugging, and agentic workflows that need fine-grained control over design operations.
120
+
121
+ ```
122
+ pen interactive [options]
123
+
124
+ Options:
125
+ --app, -a <name> Connect to a running pen.dev app (e.g. desktop, vscode)
126
+ --in, -i <path> Input .pen file (optional, empty canvas if omitted)
127
+ --out, -o <path> Output .pen file (required in headless mode)
128
+ --help, -h Show detailed tool reference. Important for agentic workflows, so agents can learn the tool.
129
+ ```
130
+
131
+ ### Modes
132
+
133
+ **App mode** — connects to a running pen.dev desktop or extension. Changes are applied live.
134
+
135
+ ```bash
136
+ pen interactive -a desktop -i my-design.pen
137
+ ```
138
+
139
+ **Headless mode** — spins up a local editor without a GUI. Use `save()` to write to `--out`.
140
+
141
+ ```bash
142
+ # New empty canvas saved to the output file
143
+ pen interactive -o output.pen
144
+
145
+ # Edit an existing file
146
+ pen interactive -i input.pen -o output.pen
147
+ ```
148
+
149
+ ### Shell commands
150
+
151
+ ```
152
+ tool_name({ key: value }) Call an MCP tool
153
+ save() Save the document to disk (headless) or app
154
+ exit() Exit the shell
155
+ ```
156
+
157
+ ### Getting started
158
+
159
+ Begin with `get_editor_state` to load the schema and understand the document:
160
+
161
+ ```
162
+ pen > get_editor_state({ include_schema: true })
163
+ pen > batch_get() # list top-level nodes
164
+ pen > batch_get({ patterns: [{ reusable: true }] }) # find components
165
+ ```
166
+
167
+ ### Example
168
+
169
+ ```
170
+ pen > get_editor_state({ include_schema: true })
171
+ pen > get_guidelines()
172
+ pen > get_guidelines({ category: "guide", name: "Landing Page" })
173
+ pen > batch_design({ input: 'rect=Insert(document,{type:"rectangle",name:"Foo",x:10,y:10,width:300,height:200,fill:"#E5484D"})' })
174
+ pen > get_screenshot({ nodeId: "hero" })
175
+ pen > save()
176
+ pen > exit()
177
+ ```
178
+
179
+ Run `pen interactive --help` for the full tool reference with parameter types and descriptions.
180
+
181
+ ## Available Models
182
+
183
+ ```bash
184
+ pen --list-models --agent claude|gemini|codex
185
+ ```
186
+
187
+ ## Environment Variables
188
+
189
+ | Variable | Description |
190
+ |----------|-------------|
191
+ | `PEN_CLI_KEY` | CLI API key for CI/CD (takes precedence over stored session) |
192
+ | `PEN_AGENT_API_KEY` | API key for the selected agent. |
193
+ | `ANTHROPIC_API_KEY` | Anthropic API key for Claude agents. Ignored for Codex and Gemini. |
194
+ | `PEN_API_BASE` | Backend API base URL (default: `https://api.pen.dev`) |
195
+ | `DEBUG` | Enable debug logging |
196
+
197
+ Further environment variables and agent config can be set in `settings.json`
198
+ as well.
199
+
200
+ ## Supported Operations
201
+
202
+ The CLI supports the following MCP tools with full feature parity to the desktop app:
203
+
204
+ ### Design Operations
205
+
206
+ | Tool | Description |
207
+ |------|-------------|
208
+ | `batch_design` | Insert, Update, Delete, Move, Copy, Replace, SetVariables, Generate, FindEmptySpace |
209
+ | `batch_get` | Search and read nodes by pattern or ID |
210
+ | `get_variables` | Read design variables |
211
+ | `get_editor_state` | Get document metadata and structure |
212
+ | `snapshot_layout` | Get document structure with computed bounds |
213
+
214
+ ### Visual Operations (headless rendering via CanvasKit)
215
+
216
+ | Tool | Description |
217
+ |------|-------------|
218
+ | `get_screenshot` | Render a node to PNG image |
219
+ | `export_nodes` | Export nodes to images in PNG/JPEG/WEBP/PDF formats |
220
+
221
+ ### Image Generation
222
+
223
+ The `batch_design` `Generate()` operation supports both AI-generated and stock images. Generated images are saved to an `images/` directory alongside the output `.pen` file.
224
+
225
+ | Type | Description |
226
+ |------|-------------|
227
+ | `G(nodeId, "ai", prompt)` | AI-generated image from a text prompt |
228
+ | `G(nodeId, "stock", keywords)` | Stock photo from Unsplash |
229
+
230
+ ### Guidelines
231
+
232
+ | Tool | Description |
233
+ |------|-------------|
234
+ | `get_guidelines` | Load guides and styles for working with .pen files |
235
+
236
+ ## Examples
237
+
238
+ ### Create a Login Page
239
+
240
+ ```bash
241
+ pen --out login.pen --agent claude --prompt "Create a modern login page with:
242
+ - Email input field
243
+ - Password input field
244
+ - 'Sign In' button
245
+ - 'Forgot password?' link
246
+ - Social login options (Google, GitHub)"
247
+ ```
248
+
249
+ ### Add Components to Existing Design
250
+
251
+ ```bash
252
+ pen --in dashboard.pen --out dashboard-v2.pen --agent gemini --prompt "Add a sidebar navigation with:
253
+ - Dashboard link (active)
254
+ - Users link
255
+ - Settings link
256
+ - Logout button at bottom"
257
+ ```
258
+
259
+ ### Create a Component Library
260
+
261
+ ```bash
262
+ pen --out components.pen --agent codex --prompt "Create a component library with:
263
+ - Primary, secondary, and ghost button variants
264
+ - Text input with label and error state
265
+ - Card component with header and content
266
+ - Badge component in success, warning, error colors"
267
+ ```
268
+
269
+ ### Using a Specific Model
270
+
271
+ Use `--model` to select a different Claude model:
272
+
273
+ ```bash
274
+ # Use Claude Opus for complex tasks requiring highest capability
275
+ pen --out complex-app.pen \
276
+ --model claude-opus-4-6 \
277
+ --prompt "Create a complete e-commerce product page with image gallery,
278
+ reviews section, related products, and add-to-cart functionality"
279
+
280
+ # Use Claude Haiku for simple, fast tasks
281
+ pen --out simple.pen \
282
+ --model claude-haiku-4-5 \
283
+ --prompt "Create a simple 404 error page"
284
+ ```
285
+
286
+ ### CI/CD Usage
287
+
288
+ ```bash
289
+ # Authenticate with a CLI key
290
+ export PEN_CLI_KEY=pencil_cli_...
291
+ export PEN_AGENT_API_KEY=sk-...
292
+
293
+ # Generate designs in a pipeline
294
+ pen --out onboarding.pen --prompt "Create a 3-step onboarding flow" --agent claude
295
+ ```
296
+
297
+ ### Verbose MCP Error Logging
298
+
299
+ Use `--verbose-mcp` to show full MCP tool error details (including stack traces where available) in the CLI output when a tool fails:
300
+
301
+ ```bash
302
+ pen --out debug.pen \
303
+ --agent claude \
304
+ --prompt "Create a simple layout" \
305
+ --verbose-mcp
306
+ ```
307
+
308
+ ### Batch Processing with Tasks File
309
+
310
+ Use `--tasks` to process multiple designs from a JSON tasks file:
311
+
312
+ ```bash
313
+ pen --tasks batch-tasks.json --agent claude
314
+ ```
315
+
316
+ Example `batch-tasks.json`:
317
+
318
+ ```json
319
+ {
320
+ "tasks": [
321
+ {
322
+ "out": "landing-page.pen",
323
+ "prompt": "Create a SaaS landing page with hero, features, and pricing sections"
324
+ },
325
+ {
326
+ "in": "existing-app.pen",
327
+ "out": "existing-app-v2.pen",
328
+ "prompt": "Add a dark mode toggle to the header"
329
+ },
330
+ {
331
+ "out": "mobile-menu.pen",
332
+ "model": "claude-haiku-4-5",
333
+ "prompt": "Create a mobile hamburger menu component"
334
+ },
335
+ {
336
+ "out": "from-reference.pen",
337
+ "prompt": "Match the layout and palette of the attached reference",
338
+ "promptFiles": ["./assets/reference.png"]
339
+ }
340
+ ]
341
+ }
342
+ ```
343
+
344
+ Each task in the array supports the same options as CLI arguments:
345
+ - `in` - Input file (optional)
346
+ - `out` - Output file (required)
347
+ - `prompt` - AI prompt (required)
348
+ - `model` - Model override (optional)
349
+ - `promptFiles` - Array of attachment paths (optional). Relative paths are resolved from the directory that contains the tasks JSON file.
350
+
351
+ ## Limitations
352
+
353
+ The CLI is designed for headless operation and has some limitations compared to the desktop app:
354
+
355
+ - **No real-time preview** - Changes are saved to file, not displayed interactively
356
+ - **No interactive UI features** - No selection, zoom, or pan controls
357
+ - **No library browsing** - Cannot browse or import from `.pen` libraries
358
+
359
+ ## Token Storage
360
+
361
+ | File | Purpose |
362
+ |------|---------|
363
+ | `~/.pencil/session-cli.json` | Stored session token from `pen login` |
364
+
365
+ The CLI uses a separate session file from the desktop app (`~/.pencil/session-desktop.json`) so the backend can distinguish which client is in use.
366
+
367
+ ## License
368
+
369
+ Proprietary — see LICENSE file. © High Agency, Inc.
package/SKILL.md ADDED
@@ -0,0 +1,175 @@
1
+ ---
2
+ name: pen-design
3
+ description: >
4
+ Create high-quality visual designs — websites, app screens, dashboards, slides, marketing materials, social media graphics — using the pen.dev CLI tool. Use this skill whenever the user wants to create, generate, or visualize any kind of UI design, mockup, wireframe, layout, webpage, app screen, presentation slide, poster, banner, or marketing asset. Also use it when the user says things like "design me a...", "make a visual for...", "create a mockup of...", "what would X look like?", or wants to turn an idea into a visual. Even if the user doesn't mention "pen.dev" or "design tool" explicitly — if they want something visual created, this is the skill to use.
5
+ ---
6
+
7
+ # pen.dev Design
8
+
9
+ Create professional visual designs from natural language descriptions using the pen.dev CLI. pen.dev is a headless design tool that generates `.pen` files (a structured JSON design format) and can export them as images.
10
+
11
+ ## Setup
12
+
13
+ Before designing, make sure the pen.dev CLI is available.
14
+
15
+ ### Check installation
16
+
17
+ ```bash
18
+ which pen || npx pen version
19
+ ```
20
+
21
+ If `pen` is not found, install it:
22
+
23
+ ```bash
24
+ npm install -g @pen.dev/cli
25
+ ```
26
+
27
+ If global install fails due to permissions, install locally instead:
28
+
29
+ ```bash
30
+ npm install @pen.dev/cli
31
+ ```
32
+
33
+ Then run it via `npx pen` (or `./node_modules/.bin/pen`) instead of `pen`.
34
+ You can learn about the available commands via the `pen --help` command.
35
+
36
+ ### Authentication
37
+
38
+ #### pen.dev user
39
+
40
+ To use the CLI, an authenticated user logged in to pen.dev is required. First, check
41
+ the current user configuration on the machine with the `pen status` command.
42
+
43
+ If not logged in, there are the following options:
44
+
45
+ - use `pen signup --email you@example.com --username johndoe --name "John Doe"` command, to create a new user.
46
+ - use `pen login --email you@example.com [--code abc123]` to authenticate an existing or newly created user.
47
+ - optionally, the `PEN_CLI_KEY` env var can also be used for authentication if its set in your session.
48
+
49
+ #### Claude Code agent
50
+
51
+ The CLI needs auth to run its AI agent for which Claude Code is required. For that
52
+ there needs to be an authenticated Claude Code user set in the system configuration
53
+ either via env var or a user subscription.
54
+
55
+ If none of these are available, tell the user what options they have and help them set one up.
56
+
57
+ ### Staying up to date
58
+
59
+ This skill stays in sync with the **pen.dev CLI npm package** (`@pen.dev/cli`). The published package includes `SKILL.md` at its root; the package version is the skill version.
60
+
61
+ **Check for a newer CLI / skill**
62
+
63
+ - Latest version on the registry: `npm view @pen.dev/cli version`
64
+ - Installed CLI: `pen version`, or `npm list -g @pen.dev/cli` (global) / `npm list @pen.dev/cli` (project)
65
+
66
+ **Upgrade the CLI**, then refresh your copied skill file (agents do not auto-update skill files you placed in config folders):
67
+
68
+ ```bash
69
+ npm install -g @pen.dev/cli
70
+ ```
71
+
72
+ **Where to copy the skill from after installing**
73
+
74
+ - From a dependency tree: `node_modules/@pen.dev/cli/SKILL.md` (path is the same for global and local installs; resolve from your project root or global `node_modules` prefix).
75
+
76
+ **Fetch the same file without cloning the repo** (mirrors the npm tarball; optional third-party CDNs):
77
+
78
+ - `https://unpkg.com/@pen.dev/cli@latest/SKILL.md`
79
+ - `https://cdn.jsdelivr.net/npm/@pen.dev/cli@latest/SKILL.md`
80
+
81
+ Use `@latest` for the newest publish, or pin (e.g. `@0.2.4`) for a reproducible snapshot.
82
+
83
+ **If you don’t know where skills live on this machine**
84
+
85
+ Agents don’t always get the skills directory from context. When the path isn’t obvious:
86
+
87
+ - **Ask the user** where their agent or IDE loads skills from, or where they want this skill installed.
88
+ - **Check the product’s docs** for “skills”, “agent skills”, or “plugins” — paths differ by tool and version.
89
+ - You can still **use the skill content without installing**: fetch or open the **`SKILL.md` URL above** (unpkg/jsDelivr) in the session so guidance applies even when the on-disk path is unknown. For a persistent install, copy the fetched file into the path the user or docs specify.
90
+
91
+ **Typical skill locations** (confirm with your tool’s current docs — layouts change):
92
+
93
+ | Environment | Where to put `SKILL.md` |
94
+ |-------------|-------------------------|
95
+ | **Cursor** | Project: `.cursor/skills/pen-design/SKILL.md`; user-level: under `~/.cursor/skills/` |
96
+ | **Claude Code** | Often `.claude/skills/pen-design/SKILL.md` or user-level under `~/.claude/` |
97
+ | **OpenClaw** | Often `~/.openclaw/skills/`, workspace `.agents/skills/`, or paths in [OpenClaw skills docs](https://docs.openclaw.ai/skills/) — verify for the user’s setup |
98
+ | **Other agents (Codex, etc.)** | Use the directory your product uses for skills or prompts |
99
+
100
+ Example (adjust the destination path to match your agent):
101
+
102
+ ```bash
103
+ curl -fsSL "https://unpkg.com/@pen.dev/cli@latest/SKILL.md" -o .cursor/skills/pen-design/SKILL.md
104
+ ```
105
+
106
+ **When to check for an update**
107
+
108
+ - **Early in the session**, before the first pen.dev design run (compare `npm view @pen.dev/cli version` to the installed CLI), so you aren’t following stale instructions.
109
+ - **Again** if the user says they upgraded the CLI, or if behavior doesn’t match this doc (flags, auth, timing).
110
+ - **Not** before every single command — once per session is enough unless something changed or errors suggest a version mismatch.
111
+
112
+ ## Creating a Design
113
+
114
+ The core command:
115
+
116
+ ```bash
117
+ pen --out <output.pen> --prompt "<design description>" --export <output.png> --export-scale 2
118
+ ```
119
+
120
+ Key flags:
121
+ - `--out, -o` — where to save the `.pen` file (required)
122
+ - `--prompt, -p` — what to design (required)
123
+ - `--prompt-file, -f` — attach an image or text file to send with the prompt (repeatable). Same idea as attaching reference images in the pen.dev editor chat; not for loading the prompt text from a file.
124
+ - `--export, -e` — export an image of the result
125
+ - `--export-scale` — image resolution multiplier (use 2 for crisp output)
126
+ - `--export-type` — format: `png` (default), `jpeg`, `webp`, `pdf`
127
+ - `--in, -i` — start from an existing `.pen` file (for iteration)
128
+ - `--model, -m` — Claude model to use (defaults to Opus)
129
+
130
+ ### Passing the Prompt
131
+
132
+ Pass the user's request directly as the prompt — do not expand, or add detail beyond what the user actually said. The pen.dev CLI has its own AI designer agent that handles creative decisions like layout structure, color palettes, typography, spacing, and content. Adding your own design specifics on top of the user's request will conflict with the CLI agent's own judgment and produce worse results.
133
+
134
+ If the user says "make me a landing page for a coffee shop", the prompt should be exactly that — not a paragraph with hero sections, color palettes, and font choices you invented.
135
+
136
+ ### Timing Expectations
137
+
138
+ Design generation is not instant — the CLI runs an AI agent that plans the layout, creates each element, and validates the result visually. Expect:
139
+
140
+ - **Simple designs** (a card, a single component): 1-2 minutes
141
+ - **Medium designs** (an app screen, a landing page section): 2-3 minutes
142
+ - **Complex designs** (full landing page, detailed dashboard): 3-5+ minutes
143
+
144
+ Let the user know upfront that generation will take a few minutes so they're not left wondering. Use a generous timeout (at least 600000ms / 10 minutes) when running the command.
145
+
146
+ ### Showing the Result
147
+
148
+ After the command completes, read the exported image to show it to the user:
149
+
150
+ ```bash
151
+ # The command exports to the path you specified
152
+ pen --out design.pen --prompt "..." --export design.png --export-scale 2
153
+ ```
154
+
155
+ Then use the Read tool on the exported PNG — it will render visually since you're a multimodal model.
156
+
157
+ Always show the image to the user after creating it. This is the whole point — they want to see the visual.
158
+
159
+ ## Iterating on a Design
160
+
161
+ When the user wants changes to an existing design, use the `--in` flag to load the previous `.pen` file:
162
+
163
+ ```bash
164
+ pen --in design.pen --out design-v2.pen --prompt "Make the header larger and change the accent color to green" --export design-v2.png --export-scale 2
165
+ ```
166
+
167
+ The agent will read the existing design and apply modifications rather than starting from scratch.
168
+
169
+ For quick successive iterations, keep a consistent naming pattern:
170
+ - `design.pen` → `design-v2.pen` → `design-v3.pen`
171
+ - Or use a single file: `--in design.pen --out design.pen` (overwrites)
172
+
173
+ ## Working Directory
174
+
175
+ Save design files in the user's current working directory or a subdirectory like `designs/`. Don't use temp directories — the user will want to find and iterate on these files later.