---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Meadow's rules for agents

Every path here starts at the app's root (with a src/ folder, put src/ before it); write imports ('@/…') as components.json aliases them.

Always loaded (also goop/meadow/AGENTS.md): never reread it. Before your first screen read only what the README's "Start here" names, in its order, then write that screen.

With Goop's tools connected, call goop_plan_page (a new app: goop_plan_app) before any file or command: it plans the page and says what your plan allows; write goop/plan.md from it alone.

"node goop/agent/lookup.mjs find <need>" names a part or recipe; "… part <a> <b>…" prints several in one call ("--full": all); skip any your files use or a recipe shows. Never open a source.

## Never break

- Import the theme's unit for every part it has; never redraw one by hand.
- Every colour, size, corner and type size comes from the look sheet or the theme's tokens; write no literal value.
- Where the theme has no unit or value, leave it out and say so; never invent one.
- Never change the theme's colours, corners, spacing, fonts or motion or restyle it to look "distinctive"; never edit tune.css or any other theme file.
- Every size, gap and inset is a whole pixel; only hairline borders and rings are 0.5 px.

## Before you write a page

Goop's plan file is plan.md in the folder that holds Goop's installed stylesheets (contract.css): src/goop/plan.md in an app with a src/ folder, else ./goop/plan.md beside package.json.

Without Goop's tools, first write the app's job and its objects (what each has: dates from and to, a stage, a parent, a booking slot) as the first two lines of goop/plan.md.

Then run "node goop/agent/start.mjs --app <type> --plan" (no type: the types), take the type whose line fits the job, and run it without --plan.

For a page no app type or screen recipe covers, before choosing its layout: read goop/meadow/agent/layout-chooser.md

Then a line a page in goop/plan.md: its job, role and arrangement from what the start printed (else the chooser), the product fact that picked it (Client: RecordPage profile, subject: person).

Pick by the product, never by the page before; where two arrangements fit a page equally, take the one the app uses least.

Every page starts from AppFrame ('@/components/goop/patterns/app-frame'): the navigation in its rail, the top bar in its panel's header, the page inside PageBody.

A page takes its widths from a layout component, never its own: AppFrame fills the window; PageBody, PageColumns or a template sets how wide the content is.

The one exception is a page shown before sign-in (signing in, a first-run setup): it skips AppFrame and centres its own column, a spacing token wide.

The app's index.html (beside package.json; Next.js writes its own) needs <meta name="viewport" content="width=device-width, initial-scale=1"> in <head>, or phones show pages shrunk.

A fresh Vite app's TypeScript lib is ES2020: no .at, replaceAll or formatRange unless the app raises "lib".

## Rules

- [compose.restyle] Compose, never restyle: add no class for what a part already sets (height, padding, colours: its page says which).
- [create.flow] Create a new item in place with CreateRow (title first, property chips), as ListPage's primaryAction or in a list; a Dialog is only for a short confirm.
- [depth.layers] A name previews in HoverCard, a row opens in RecordPeek, a record is a page; a delete asks in AlertDialog or a held DestructiveButton; what can be undone runs at once with toast.undo.
- [domain.chips] Options carry counts (TabsTrigger count); status and owner filters are Selects; a record's status and assignee are chips (shape="chip"), never plain words.
- [icon.glyph] An element slot (a mark) takes a pack icon: <Glyph icon="star" box={{ w: 14, h: 14 }} /> (12, 14 or 16) from '@/lib/goop/meadow/glyph'.
- [icon.names] An icon prop takes an icon's name (icon="plus"; "node goop/agent/lookup.mjs icons <word>" finds one), never an element; a name the theme lacks is a type error: pick the nearest.
- [ink.paired] Text on a coloured fill takes that fill's own -foreground token (bg-primary with text-primary-foreground); never pick an ink by eye.
- [list.keys] Keys are the parts' own, not your listeners: ListGroup createShortcut makes C create, RecordPeek steps by the arrows, CommandPalette (⌘K, Ctrl K) lists every place and create action.
- [list.pages] A table that can outgrow one screen (the user adds rows, or it starts with more than 25) ends in Pagination.
- [list.rows] Rows are the theme's Item in ItemGroup or a ListGroup: each row washes under the pointer by itself; never a row with its own hover fill.
- [list.shape] Pick the collection by the object: bookings a WeekBoard, a person's own week a WeekCalendar, a parent a TreeView, an order a SortableList, cards a CardGrid, columns a Table.
- [list.switch] A list read two ways (rows or a Table, rows or cards) gets view pills, a ToggleGroup, in ListPage's views; where a Table and another collection fit equally, open on the other.
- [locale.one] Pick the app's one locale (a BCP 47 tag) and currency (an ISO 4217 code, "EUR"); pass the same locale and currency to every part that takes them, and set <html lang> to it.
- [menu.context] A row, card, list item, file or event a person acts on opens ContextMenu on right-click with its "…" menu's actions (one list feeds both); text fields keep the browser's.
- [recipes.first] A part goes in its slot, never hand-nested; a help desk reply is Composer modes, a note ChatMessage variant="note".
- [record.edit] Values edit in place in Properties (a PropertyRow each, InlineEdit for words); history is a Timeline, talk a CommentThread; a person an Identity in a HoverCard, several an AvatarGroup.
- [settings.parts] Settings: an order a SortableList, a colour a ColorSwatchGroup, a limit a Slider, a unit an InputGroup, a key a CodeBlock, plans PlanCards, rare options an Accordion, a delete last.
- [states.every] Each list and panel has four states: SkeletonContainer while loading, Empty with a first action, a filtered-to-nothing line, an Alert with Retry on failure; the app's is a Banner.
- [tap.targets] On a touch screen a button is a 44 px tap target with no prop (another control where its page says so); your own row round a small control takes touch:min-h-control-touch.
- [toast.mount] Mount <Toaster /> once in the app's root (App.tsx or the root layout, beside the screens), never per page: toast() shows nothing without it.
- [ui.names] An outline card's content goes in CardContent, a tile's words in CardText; CardFooter is a grey line, not a bar; danger is DestructiveButton, icon-only IconButton.
- [width.steps] A width you set is a spacing step (w-N is N×4 px: w-40 160 px, w-64 256 px) or a size token (w-pane-xs 200 px, w-pane-sm 300 px).

Before making a component the theme lacks: read goop/meadow/agent/new-component.md

Import the theme's unit for every part it has; never redraw one by hand.
