@autono/open-pages 0.7.0 → 0.8.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/dist/cli/bin.js CHANGED
@@ -11,7 +11,7 @@ import { createHash } from "node:crypto";
11
11
  import * as readline$1 from "node:readline";
12
12
  import { stripVTControlCharacters } from "node:util";
13
13
  //#region src/cli/preflight.ts
14
- const PAGES_URL = "https://pages.openpages.sh/quickstart";
14
+ const DOCS_URL = "https://docs.openpages.sh/quickstart";
15
15
  const VITE_CONSUMERS = ["@vitejs/plugin-react", "@tailwindcss/vite"];
16
16
  const DEPENDENCY_FIELDS = [
17
17
  "dependencies",
@@ -116,7 +116,7 @@ function formatViteMismatch(mismatch, { cwd = process.cwd(), packageManager = "n
116
116
  ` ${chalk.dim("$")} ${chalk.cyan(cmd)}`,
117
117
  ""
118
118
  ];
119
- const footer = `${chalk.dim("Pages")} ${chalk.cyan.underline(PAGES_URL)}`;
119
+ const footer = `${chalk.dim("Docs")} ${chalk.cyan.underline(DOCS_URL)}`;
120
120
  if (!declaration) return [
121
121
  chalk.bold("Conflicting vite versions in node_modules"),
122
122
  "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autono/open-pages",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Runtime and CLI for open-pages — live preview of React and HTML pages, click-to-comment inspector, and static export.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -56,6 +56,7 @@ Your job: read those markers, perform the described edits, and delete the marker
56
56
  - After all edits, re-read the file and confirm the only remaining markers are ones you reported as skipped.
57
57
  - Confirm the edited JSX is well-formed (balanced tags, no dangling attributes) and that changed `className` strings are literal Tailwind utilities. If the project's `package.json` has typecheck/lint scripts, run them with the project's package manager; scaffolded projects ship neither TypeScript nor a linter — there, rely on the running dev server (or the `build` script) to surface compile errors. Fix any errors you introduced.
58
58
  - For layout changes, mentally check the Mobile viewport (390px): did the edit introduce a fixed width or a grid with no stacking fallback?
59
+ - When a comment changed interactive elements, forms, motion, or layout, run the `web-design-guidelines` skill on the page and fix any regression it reports before you report.
59
60
 
60
61
  7. **Report.**
61
62
  - Summarise: `N applied, M skipped` plus a one-line description of each change (including the page id).
@@ -94,7 +94,11 @@ Read the **`page-authoring`** skill before writing — file contract, `@/ui/*` c
94
94
 
95
95
  ## Step 7 — Self-review
96
96
 
97
- Run the checklist in `page-authoring` ("Self-review before finishing"): every button/input/card/dialog/tab is a `@/ui` component, colors are tokens, nothing under `ui/` changed. Check all three viewports.
97
+ Run the checklist in `page-authoring` ("Self-review before finishing"): every button/input/card/dialog/tab is a `@/ui` component, colors are tokens, nothing under `ui/` changed. Check all three viewports. Pay particular attention to the CTA and motion items: one label per intent, no wrapped button text at desktop, every animation answers "what does this communicate?".
98
+
99
+ ## Step 7b — Guidelines review
100
+
101
+ Run the `web-design-guidelines` skill on `pages/<id>/` (it fetches Vercel's current Web Interface Guidelines and reports `file:line` findings). Fix what it finds in the page files, re-run until clean or until only findings you can justify remain, and mention any you left in the hand-off.
98
102
 
99
103
  ## Step 8 — Hand off to the user
100
104
 
@@ -25,6 +25,7 @@ A theme can be derived from any combination of:
25
25
  - **Image references / brand guidelines** — paths or URLs to screenshots, mood boards, logo files, a brand PDF. You will translate them into OKLCH tokens.
26
26
  - **Free-text description** — prose describing the desired palette, weight, feel.
27
27
  - **An existing page** — `pages/<id>/index.tsx` whose look should become reusable.
28
+ - **A `DESIGN.md`** — a design-system document in the Google-spec shape (YAML frontmatter, then Overview, Colors, Typography, Layout, Elevation, Shapes, Components, Do's and Don'ts). [designmd.supply](https://designmd.supply) generates one from any public domain, so "match our brand" is: run the site through it, drop the file at `themes/<id>.design.md` (or paste the path), and ask for a theme.
28
29
 
29
30
  If the user's original message already specifies the inputs unambiguously, skip the question and proceed. Otherwise call `AskUserQuestion` (multi-select) so they can pick one or more sources, and ask follow-ups (paths, preset code, page id, prose) only as needed.
30
31
 
@@ -34,6 +35,7 @@ If the user's original message already specifies the inputs unambiguously, skip
34
35
  - **Images**: read each path with the `Read` tool (it accepts images). Note dominant colors (write them as hex, then convert to OKLCH), type family feel, corner radius, surface treatment (flat vs. cards vs. borders), light or dark default, and chrome (nav style, footer).
35
36
  - **Text**: extract explicit values (hex codes, font names, "rounded", "sharp", "dense") and resolve vague language into concrete decisions before writing.
36
37
  - **Existing page**: read `pages/<id>/index.tsx` (and `components/`) and pull any raw palette classes or hex values into token roles (the page's `bg-[#0b0b10]` root → `--background`; its CTA fill → `--primary`; its card border → `--border`), plus fonts and radius.
38
+ - **`DESIGN.md`**: read it and map sections onto tokens — **Colors** gives `--background`/`--foreground`, `--primary`, `--secondary`, `--accent`, `--muted`, `--destructive` (primary = the brand's main action color, not its logo color, when they differ); **Typography** gives `--font-sans` / `--font-heading` and the type-scale feel; **Shapes** gives `--radius`; **Elevation** decides flat vs. card-with-shadow treatment in the component notes; **Layout** informs container widths and density in the demo; **Components** and **Do's and Don'ts** become the "Components in this theme" guidance. Colors may arrive as hex, `rgb()`, `hsl()`, `oklch()`, or CSS named colors — parse each by its own syntax, then convert to OKLCH. A single light palette is normal; derive the `.dark` block from it (invert lightness, keep hue and chroma) and say so in the `.md`.
37
39
 
38
40
  Every color ends up as `oklch(L C H)` — the same format as `styles/globals.css`. When inputs disagree (images use blue but the description says green), ask the user which to honor.
39
41
 
@@ -187,7 +187,10 @@ A theme is `themes/<id>.md` (direction and component notes) + `themes/<id>.css`
187
187
  - [ ] One coherent type scale across the page; contrast holds on dark sections.
188
188
  - [ ] Designed repeats are explicit component instances; data lists are a `.map` over a typed const.
189
189
  - [ ] No `window`/`document` access at module top level; effects clean up.
190
+ - [ ] One label per CTA intent across the page ("Get started" in the nav, hero, and footer — not "Get started" / "Sign up free" / "Try it"), and no primary button label wraps at desktop width.
191
+ - [ ] Every animation is motivated: it shows hierarchy, sequence, feedback, or a state change. If you cannot say which in one sentence, remove it. `motion-safe:` / `motion-reduce:` variants respect the user's preference.
190
192
  - [ ] Nothing outside `pages/<id>/` was edited.
193
+ - [ ] Ran the `web-design-guidelines` skill on the page and resolved or justified its findings.
191
194
 
192
195
  ## Anti-patterns
193
196
 
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: web-design-guidelines
3
+ description: Review page code against Vercel's Web Interface Guidelines — accessibility, focus and keyboard handling, forms, motion, layout, typography, and performance. Use when asked to "review my page", "check accessibility", "audit the design", "review UX", or as the review pass at the end of `create-page` and `apply-comments`.
4
+ metadata:
5
+ author: vercel
6
+ version: "1.0.0"
7
+ argument-hint: <page-id or file-or-pattern>
8
+ ---
9
+
10
+ # Web Interface Guidelines
11
+
12
+ Review page files for compliance with Vercel's [Web Interface Guidelines](https://github.com/vercel-labs/web-interface-guidelines) (MIT). Vendored from the [vercel-labs/agent-skills](https://github.com/vercel-labs/agent-skills) `web-design-guidelines` skill and scoped to an open-pages workspace.
13
+
14
+ ## How it works
15
+
16
+ 1. Fetch the latest guidelines from the source URL below.
17
+ 2. Read the files to review.
18
+ 3. Check them against every rule in the fetched guidelines.
19
+ 4. Report findings in the terse `file:line` format the guidelines specify.
20
+
21
+ ## Guidelines source
22
+
23
+ Fetch fresh guidelines before each review:
24
+
25
+ ```
26
+ https://raw.githubusercontent.com/vercel-labs/web-interface-guidelines/main/command.md
27
+ ```
28
+
29
+ Use WebFetch to retrieve the latest rules. The fetched content contains all the rules and the output format. If the fetch fails (offline, blocked), say so and fall back to the self-review checklist in the `page-authoring` skill instead of guessing at rules.
30
+
31
+ ## What to review
32
+
33
+ - Given a page id, review the page's entry (`pages/<id>/index.tsx` or `pages/<id>/index.html`), everything under `pages/<id>/components/`, and any `styles.css`, `style.css`, or `main.js` beside the entry.
34
+ - Given a file or glob, review those files.
35
+ - Given nothing, resolve the current page with the `current-page` skill; if that yields nothing, ask which page to review.
36
+
37
+ Never review or report on files under `ui/`, `lib/`, `hooks/`, or `styles/`. Those are the shared shadcn set and are not edited for one page; a finding there is a `create-theme` or upstream matter, not a page fix.
38
+
39
+ ## Applying findings
40
+
41
+ Report first. When the user asks you to fix, or the review runs inside `create-page` or `apply-comments`, apply the fixes to the page files only, following the `page-authoring` skill: keep `@/ui/*` components, keep semantic tokens, keep the type scale. Do not add dependencies to satisfy a rule.
@@ -14,7 +14,7 @@ import {
14
14
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
15
15
  import { useNavigate, useParams } from 'react-router-dom';
16
16
  import { toast } from 'sonner';
17
- import { Button } from '~/components/ui/button';
17
+ import { Button, buttonVariants } from '~/components/ui/button';
18
18
  import { readLastHomeLocation } from '~/lib/last-home-location';
19
19
  import { cn } from '~/lib/utils';
20
20
  import { type FrameMessage, frameUrl, isFrameMessage, type WorkspaceMessage } from '../lib/frame';
@@ -253,17 +253,22 @@ export function PageView() {
253
253
  Inspect
254
254
  </Button>
255
255
  )}
256
- <Button
257
- variant="outline"
258
- size="sm"
259
- disabled={!known}
260
- render={<a href={src} target="_blank" rel="noreferrer" />}
256
+ <a
257
+ href={known ? src : undefined}
258
+ target="_blank"
259
+ rel="noreferrer"
261
260
  aria-label="Open page in a new tab"
261
+ aria-disabled={!known || undefined}
262
+ tabIndex={known ? undefined : -1}
262
263
  title="Open the page by itself in a new tab"
264
+ className={cn(
265
+ buttonVariants({ variant: 'outline', size: 'sm' }),
266
+ !known && 'pointer-events-none opacity-50',
267
+ )}
263
268
  >
264
269
  <ExternalLink className="size-4" />
265
270
  Open
266
- </Button>
271
+ </a>
267
272
  </div>
268
273
  </header>
269
274
  )}