[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M735KPX96VACHGMM6WNVMETQ":3,"skill-same:01M735KPX96VACHGMM6WNVMETQ":58},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":6,"ownerHtmlUrl":34,"ownerBlogUrl":35,"ownerDescription":36,"updatedAt":37,"install":38,"resources":51},"01M735KPX96VACHGMM6WNVMETQ","prototype",null,"Use when the design reaches a web application: write its prototype (prototype.json + prototype.tsx), a clickable, checked app on the data model and the roles that the reviewer uses before anything is built. A coding run that builds a web-application reads its references\u002Fimplementing.md.","wso2\u002Flabs-agentic-engineer","wso2","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F533043?v=4","01M6CDAFS40T9Y86DYXWE0NJES","WSO2","01M735EE4N2PP2ZR56AX7DNPNP",24,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fprototype\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: prototype\ndescription: \"Use when the design reaches a web application: write its prototype (prototype.json + prototype.tsx), a clickable, checked app on the data model and the roles that the reviewer uses before anything is built. A coding run that builds a web-application reads its references\u002Fimplementing.md.\"\nmetadata:\n  aep:\n    kind: platform\n    audience: [design, coding]\n---\n\n# Prototype\n\nA coding run that builds a web-application reads `references\u002Fimplementing.md`.\nThe rest of this file is how the design agent writes a prototype.\n\nA prototype is the reviewable picture of a `web-application` before it is\nbuilt: its screens, navigation, roles, flows and display states, filled with\nmock data, running in a sandbox inside the review page. It is the web\napplication's artifact in the design. The `design` flow writes it after the\ndata model and the roles, and before the API contracts, which then serve its\nscreens. The business reviewer uses it and comments on it, and the build\nmakes what it shows.\n\nThe screens are a React module written against a fixed kit of components\n(`@wso2\u002Fprototype-kit`). You compose screens from the kit; you do not build\ncomponents, style anything, or reach outside the frame.\n\n## Inputs\n\nRead these before writing anything:\n\n- `specs\u002Fdesign\u002Fdesign.cell`: every `component … web-application` line is one\n  prototype to write. No web-application means there is nothing to do: say so\n  and stop. When the turn names components, write only those.\n- `specs\u002Fdesign\u002Fdomain-model.md`: the records. Each entity that a screen shows\n  or changes is a collection in the mock data, and its fields are the\n  entity's attributes (see **Mock data**).\n- `specs\u002Fdesign\u002Fsecurity.json`: the roles. When the file exists, each\n  prototype role's `id` is a role's `name` from it, **copied verbatim** (same\n  case, same spelling), and its `name` is a short human label for that role.\n  Include exactly the roles that use this application. Each role's\n  `description` says what the role does and what it never sees: show each role\n  only the screens, controls and records that its description allows. Without\n  the file, take the roles from the PRD's actors and give them short\n  kebab-case ids.\n- The web application's `design.json`: `stories` lists the stories it serves.\n- The requirements of those stories: each feature's file,\n  `specs\u002Frequirements\u002Ffeatures\u002FF\u003Cn>-\u003Cslug>.md`, with its stories (`F\u003Cn>.\u003Cm>`)\n  and its Decisions, the `*assumed*` lines included; `product-wide.md` for the\n  items that apply to it; and `prd.md`'s Actors, for the people your records\n  are about. Every story the application serves gets at least one screen. Set\n  a story aside only when the product gives it no view (sign-in through the\n  platform's SSO, a machine-facing endpoint), and name it in your closing.\n- A sketch or mockup the user attached: the layout brief. Refine it; do not\n  reinvent it. Where it and the stories disagree, the stories' scope wins and\n  the sketch's layout intent survives inside it.\n- `specs\u002Fdesign\u002Fcomponents\u002F\u003Ccomponent>\u002Fprototype.json` and `prototype.tsx` if\n  they already exist: you are revising them, not starting over (see **Stable\n  ids**).\n\n## Output\n\nTwo files per web-application, in `specs\u002Fdesign\u002Fcomponents\u002F\u003Ccomponent>\u002F`,\nwhere `\u003Ccomponent>` is the web-application's name in the cell:\n\n1. **`prototype.json`, the manifest**: the roles, display states, screens and\n   flows the reviewer picks from. Write it **first**.\n2. **`prototype.tsx`, the screens**: one React component per manifest screen,\n   exported with `defineApp`. It is checked against the manifest already\n   written.\n\nWrite a new file with ONE `addFile` of the whole file. Revise an existing one\nwith `editFile` edits: the file is already in front of you, and an edit costs\nwhat it changes. Never write a partial file to finish later.\n\nEach write of `prototype.tsx` is type-checked alone. A change to a record type\nand its uses (a field that you add, rename or remove) cannot go in as one edit\nper line: the first edit leaves the other uses wrong, and the check refuses\nit (`TYPE_ERROR`, one finding for each wrong line). Write such a change, or\nany other change to many lines, in one write: `removeFile`, then ONE `addFile`\nof the whole corrected file, with each id as it was.\n\nThis step writes only these two files. A screen can need a record, a field or\na role that the data model or `security.json` does not have. Then change that\nfile first (it comes earlier in the design), and write the screen after it.\nDo not change a requirement here: the design's gap check writes the\nrequirements.\n\nEvery write is checked as it lands: the manifest's shape and references, the\nsource's static rules, then a render of every screen for every role that reaches\nit in every display state. A refusal lists every finding with its code and\nwhere (a JSON path in the manifest, a line in the source, or the screen, role\nand state that failed to draw). Fix all of them and retry once. The codes are\nlisted at the end of **The kit**.\n\n## The manifest\n\nPlain JSON, schema version 3. Every object is closed: a key not shown here is\nrefused.\n\n```json\n{\n  \"schemaVersion\": 3,\n  \"name\": \"Expense approvals\",\n  \"entryScreen\": \"screen.queue\",\n  \"roles\": [{ \"id\": \"Approver\", \"name\": \"Approver\" }],\n  \"states\": [\n    { \"id\": \"state.default\", \"name\": \"Default\" },\n    { \"id\": \"state.empty\", \"name\": \"Nothing to show\" },\n    { \"id\": \"state.validation-error\", \"name\": \"Validation errors\" },\n    { \"id\": \"state.failed\", \"name\": \"Expense feed failed\" }\n  ],\n  \"screens\": [\n    { \"id\": \"screen.queue\", \"name\": \"Approval queue\", \"roleIds\": [\"Approver\"] },\n    { \"id\": \"screen.detail\", \"name\": \"Expense detail\", \"roleIds\": [\"Approver\"] },\n    { \"id\": \"screen.account\", \"name\": \"Account\", \"roleIds\": [\"Approver\"] },\n    { \"id\": \"screen.signed-out\", \"name\": \"Signed out\", \"roleIds\": [\"Approver\"] }\n  ],\n  \"flows\": [\n    { \"id\": \"flow.approve\", \"name\": \"Approve an expense\", \"roleId\": \"Approver\",\n      \"screenIds\": [\"screen.queue\", \"screen.detail\"] }\n  ]\n}\n```\n\n- `roles`, `states` and `screens` have at least one entry; their ids and the\n  flows' ids share one namespace and are unique together. `entryScreen` is the\n  screen the prototype opens on. `name` is the application's name.\n- A screen's `roleIds` are the roles that reach it. A flow is one role's walk\n  through screens that role reaches, in order, for one story. Give each story\n  that has a view a flow, named for what the actor does (\"Submit a claim\").\n- The app shell's screens, an account screen and a signed-out screen, go to\n  **every** role: every user has them.\n- A settings screen exists only for the settings that the requirements name\n  (a notification choice, a default that a user picks). It goes to the roles\n  that set them, and it holds those settings and nothing else. When the\n  requirements name no setting, write no settings screen. Never invent a\n  preference (a digest email, a Slack alert, a compact view) to fill one.\n- `states` always starts with a default state (`state.default`); add one per\n  presentation a reviewer must see:\n  - `state.empty` wherever a list can be empty.\n  - Wherever the product can refuse or fail what a screen does, the states\n    that the refusal or the failure produces. A form that a requirement limits\n    (a required receipt, a cap) shows its validation errors in\n    `state.validation-error`: its Fields' `error` and a ValidationSummary.\n    A screen whose data or action can fail (an outside service it needs, a\n    save) gets `state.failed`: an error Alert saying what failed and what the\n    user can do. A step that can be slow (an outside service, a long-running\n    job) gets `state.delayed`: an info or warning Alert saying the result is on\n    its way.\n  A prototype with only default and empty states hides the presentations a\n  reviewer most needs to judge.\n\n## The screens\n\n```tsx\nimport { useState, type ReactNode } from \"react\";\nimport {\n  Alert, AppShell, Button, Detail, Dialog, EmptyState, Field, Form, Heading, Screen, Section, Stat,\n  StatGroup, Table, defineApp, useCollection, useDisplayState, useNav, useParams,\n} from \"@wso2\u002Fprototype-kit\";\n\ninterface Expense { id: string; employee: string; amount: string; status: string }\n\nconst expenses: Expense[] = [\n  { id: \"1042\", employee: \"Maya Fernando\", amount: \"$148.20\", status: \"Awaiting approval\" },\n  { id: \"1039\", employee: \"Ravi Perera\", amount: \"$62.00\", status: \"Awaiting approval\" },\n  { id: \"1031\", employee: \"Ana Silva\", amount: \"$310.00\", status: \"Approved\" },\n];\n\nconst user = { name: \"Ravi Perera\", email: \"ravi@acme.example\" };\n\nfunction Shell({ children }: { children: ReactNode }) {\n  return (\n    \u003CAppShell\n      id=\"shell\"\n      user={user}\n      nav={[{ id: \"nav.queue\", label: \"Approval queue\", to: \"screen.queue\" }]}\n      account=\"screen.account\"\n      signOut=\"screen.signed-out\"\n    >\n      {children}\n    \u003C\u002FAppShell>\n  );\n}\n\nfunction Queue() {\n  const state = useDisplayState();\n  const all = useCollection\u003CExpense>(\"expenses\");\n  const waiting = state === \"state.empty\" ? [] : all.items.filter((e) => e.status === \"Awaiting approval\");\n  const approved = all.items.filter((e) => e.status === \"Approved\").length;\n  return (\n    \u003CShell>\n      \u003CHeading id=\"heading.queue\" text=\"Approval queue\" \u002F>\n      {state === \"state.failed\" && (\n        \u003CAlert id=\"alert.feed-failed\" tone=\"error\" title=\"Expense feed unavailable\" text=\"Amounts may be stale. Refresh in a few minutes.\" \u002F>\n      )}\n      \u003CStatGroup>\n        \u003CStat id=\"stat.waiting\" label=\"Awaiting you\" value={String(waiting.length)} hint=\"claims to decide\" icon=\"Inbox\" tone=\"warning\" \u002F>\n        \u003CStat id=\"stat.approved\" label=\"Approved\" value={String(approved)} hint=\"this month\" icon=\"CircleCheck\" tone=\"success\" \u002F>\n      \u003C\u002FStatGroup>\n      \u003CSection id=\"section.expenses\" title=\"Expenses\" count={waiting.length} subtitle=\"Oldest first. Open a claim to reject it with a reason.\">\n        \u003CTable\n          id=\"table.expenses\"\n          columns={[\"Employee\", { label: \"Amount\", kind: \"number\" }, { label: \"Status\", kind: \"status\" }]}\n          rows={waiting.map((e) => ({\n            id: `expense.${e.id}`,\n            cells: [e.employee, e.amount],\n            status: { text: e.status, tone: \"warning\" },\n            to: \"screen.detail\",\n            params: { expense: e.id },\n            actions: [{ id: `expense.${e.id}.approve`, label: \"Approve\", onPress: () => all.update(e.id, { status: \"Approved\" }) }],\n          }))}\n          empty={\u003CEmptyState id=\"empty.queue\" title=\"Nothing to approve\" text=\"New claims appear here.\" \u002F>}\n        \u002F>\n      \u003C\u002FSection>\n    \u003C\u002FShell>\n  );\n}\n\nfunction ExpenseDetail() {\n  const { expense: id } = useParams();\n  const state = useDisplayState();\n  const navigate = useNav();\n  const all = useCollection\u003CExpense>(\"expenses\");\n  const [rejecting, setRejecting] = useState(false);\n  const expense = (id ? all.get(id) : undefined) ?? all.items[0]!;\n  const decide = (status: string) => {\n    all.update(expense.id, { status });\n    navigate.go(\"screen.queue\");\n  };\n  return (\n    \u003CShell>\n      \u003CHeading id=\"heading.detail\" text={`Expense ${expense.id}`} \u002F>\n      \u003CDetail\n        id=\"detail.expense\"\n        fields={[\n          { label: \"Employee\", value: expense.employee },\n          { label: \"Amount\", value: expense.amount },\n        ]}\n      \u002F>\n      \u003CButton id=\"btn.approve\" label=\"Approve\" emphasis=\"primary\" onPress={() => decide(\"Approved\")} \u002F>\n      \u003CButton id=\"btn.reject\" label=\"Reject\" emphasis=\"danger\" onPress={() => setRejecting(true)} \u002F>\n      \u003CDialog id=\"dialog.reject\" title={`Reject expense ${expense.id}`} open={rejecting} onClose={() => setRejecting(false)}>\n        \u003CForm\n          id=\"form.reject\"\n          onSubmit={() => decide(\"Rejected\")}\n          actions={\u003CButton id=\"btn.reject.confirm\" label=\"Reject\" emphasis=\"danger\" submit \u002F>}\n        >\n          \u003CField\n            id=\"field.reason\"\n            label=\"Reason\"\n            type=\"textarea\"\n            required\n            error={state === \"state.validation-error\" ? \"Give the employee a reason\" : undefined}\n          \u002F>\n        \u003C\u002FForm>\n      \u003C\u002FDialog>\n    \u003C\u002FShell>\n  );\n}\n\nfunction Account() {\n  return (\n    \u003CShell>\n      \u003CHeading id=\"heading.account\" text=\"Account\" \u002F>\n      \u003CDetail id=\"detail.account\" fields={[{ label: \"Name\", value: user.name }, { label: \"Email\", value: user.email }]} \u002F>\n    \u003C\u002FShell>\n  );\n}\n\nfunction SignedOut() {\n  return (\n    \u003CScreen>\n      \u003CHeading id=\"heading.signed-out\" text=\"You are signed out\" \u002F>\n      \u003CButton id=\"btn.sign-in\" label=\"Sign in\" emphasis=\"primary\" to=\"screen.queue\" \u002F>\n    \u003C\u002FScreen>\n  );\n}\n\nexport default defineApp({\n  screens: {\n    \"screen.queue\": Queue,\n    \"screen.detail\": ExpenseDetail,\n    \"screen.account\": Account,\n    \"screen.signed-out\": SignedOut,\n  },\n  data: { expenses },\n});\n```\n\n- **One component per manifest screen**, keyed by the screen's id in\n  `defineApp({ screens })`: exactly the manifest's screens, no more, no less.\n- **Every screen sits in the app shell.** Write one `\u003CAppShell>` in a small\n  local component (`Shell` above) and make it every screen's root: it draws\n  the product's header, the signed-in user and the user menu (Account,\n  Settings, Sign out) and the side navigation. Its `account` and `signOut`\n  are screens you write: an account screen with the user's details, and a\n  signed-out screen. Only that signed-out screen, outside the product, has a\n  bare `\u003CScreen>` as its root, with a way to sign back in. Give `settings`\n  only when the prototype has a settings screen (see the manifest rules):\n  without it, the user menu has no Settings entry.\n  The shell's `menu` adds the application's own user-menu entries (a profile,\n  billing) before Sign out. A reviewer points at an entry by\n  opening the menu in Preview, then switching to Annotate.\n- **One shell serves every role.** A navigation entry is drawn only for the\n  roles that reach its screen. Give `user` the person each role signs in as\n  (pick by `useRole()` when roles differ); the header shows the viewing role's\n  name beside them.\n- **Read the review through the hooks.** `useDisplayState()` is the display\n  state the reviewer chose and `useRole()` the role they view as: branch on\n  them to show an error, an empty list, a role's own controls. Show a control\n  only to the roles that reach where it leads: a `to` a role cannot follow is\n  refused.\n- **Navigate with `to`** on a Button, Link, table row, row action or breadcrumb (with\n  `params` the target reads through `useParams()`); `useNav().go(...)` inside\n  an `onPress` for a navigation that follows an action. Every screen must\n  also draw **without** params (the reviewer can open any screen from the\n  pickers), so fall back to the first record.\n- **Overlays are the screen's own state**: `const [open, setOpen] =\n  useState(false)` and `\u003CDialog open={open} onClose={() => setOpen(false)}>`.\n  Tabs and Steppers keep their own position, or take `active` and `onChange`\n  when a button moves them (a wizard's Next).\n- **Forms submit through the kit.** A `\u003CForm onSubmit>` with a `\u003CButton submit>`\n  validates its Fields (`required`, `pattern`) and then calls `onSubmit` with\n  their values keyed by `name` (default: the Field's id). A Field with no\n  `value` holds what is typed into it; give it `defaultValue` to start filled.\n- **The mock data is `defineApp({ data })`.** An array of records that each have\n  a string `id` is a collection: read it with `useCollection(name)` and change\n  it with `create`, `update` and `remove`, so the next screen shows the result.\n  Anything else is a single value for `useValue(key)`. The change lives in\n  memory until the reviewer presses Reset data; nothing is sent anywhere.\n\nWhat a prototype may not use is refused as it lands: imports other than `react`\nand `@wso2\u002Fprototype-kit`; raw HTML elements (`\u003Cdiv>`, `\u003Ctable>`, `\u003Cimg>`, …),\nbecause every element is a kit component; the page, storage, network and\ncode-generation APIs (`window`, `document`, `fetch`, `eval`, …); and anything\nnondeterministic (`Math.random()`, `Date.now()`, `new Date()` with no argument;\nuse `useToday()` for today's date). Styles do not exist: the theme draws every\ncomponent, and a component takes no `className` or `style`.\n\n### What the reviewer sees\n\nThe review renderer draws only what the screen component renders: kit\ncomponents, inside the chrome its `\u003CAppShell>` draws (the header with the\nproduct's name and the signed-in user, the user menu with Account, Settings\nwhen the shell names a settings screen, and Sign out, the side navigation).\nA bare `\u003CScreen>` is drawn with no chrome at all.\n\nNothing else is drawn automatically: no notification bell, search, theme\ntoggle, help menu or footer, whatever the built application's shell will\ncarry. If a reviewer asks for such chrome, model it in the kit: a navigation\nentry, or a Button or Link in the screen's content (a Heading's `actions` for\nthe top right) whose `to` is the screen it leads to or whose `onPress` opens a\nDrawer (a notification list) or a Dialog (a confirmation). Only if what they\nask for is outside the kit, say so in your reply and name the limitation.\nNever tell a reviewer the platform draws something the screen does not render.\n\n### The Oxygen look\n\nThe reviewer sees the prototype in the Oxygen theme, the look of WSO2 products,\nso a prototype should read as an Oxygen screen. The host applies the theme: the\nsource never imports one, never styles anything, and never names Oxygen. Your\npart is composing screens the way an Oxygen application composes them:\n\n- **Page anatomy.** A screen is the `\u003CAppShell>` holding a `\u003CHeading>` (the\n  page title, with page-wide action Buttons in `actions`), then the content in\n  the order a user works through it: headline numbers as one `\u003CStatGroup>` of\n  `\u003CStat>`s, then a `\u003CSection>` per part of the page (a list, a form, a\n  record), with `\u003CFilters>` and the `\u003CTable>` inside it, and `\u003CDetail>`,\n  `\u003CForm>` and `\u003CTimeline>` for a single record. A sub-page opens with\n  `\u003CBreadcrumbs>` back to its list.\n- **Stats in a group.** Put a screen's `\u003CStat>`s in one `\u003CStatGroup>`, never a\n  `\u003CStack direction=\"row\">` or `\u003CGrid>`: the group gives them one width. Give\n  each a `hint` that gives the number its scale (\"of 20 left this year\",\n  \"claims to decide\") and an `icon` from the kit's list that names what it\n  counts; `tone` colours the icon when the number needs attention.\n- **Sections own their actions.** A `\u003CSection>` titles a part of the page,\n  with `count` for the records it lists and `subtitle` for one line on what it\n  holds. An action that adds to or acts on that part sits in the Section's\n  `actions` (New request above the requests), not under the table and not in\n  the page Heading.\n- **One primary action per screen.** `emphasis=\"primary\"` marks the screen's\n  main action and nothing else; destructive actions are `\"danger\"`.\n- **Status is a chip, not prose.** A record's status is the table's status\n  column (`{ label: \"Status\", kind: \"status\" }` in `columns`, and each row's\n  `status: { text, tone }`) or a `\u003CBadge>`: `success`, `warning`, `error`,\n  `info`, `default`. Put the column where it reads best; the row's `cells` fill\n  the other columns in order. Callouts are `\u003CAlert>`s with a tone.\n- **Row actions are buttons, not cells.** What a user does to one record\n  without opening it (Cancel, Approve) is the row's `actions`, each with an id\n  built from the row's (`` `${rowId}.cancel` ``), a `label`, and `to` or\n  `onPress` like a Button (`emphasis: \"danger\"` for a destructive one). They\n  draw in a trailing column (behind one menu past two) and pressing one never\n  presses the row, so the row can still open the record. Never write an\n  action's label into a cell. Figures are `{ label, kind: \"number\" }` columns.\n- **Navigation is the shell's side rail**, one entry per top-level screen.\n  Account and Settings live in the user menu, not the rail.\n- **Records, not cards.** Show a list of records as a `\u003CTable>` whose rows\n  open the record; use `\u003CSplit>` for a record next to its activity.\n- **Forms are short and labelled.** One `\u003CForm>` per task, a `\u003CField>` per\n  input with a plain label, `required` where the API requires it, errors in\n  the Field's `error` and a `\u003CValidationSummary>` for the whole form.\n\nWhen the organization names a design system, its skill is loaded beside this\none and is the full account of how an enterprise screen is composed (a listing\npage's header, filters and table, a form's layout and actions). Read it for the\narrangement and build each screen that way from the kit; with none loaded, use\nthe rules above. Its setup, packages and code are the build's concern,\nnot this flow's: the kit's components are the only vocabulary here.\n\n## The kit\n\nNothing else exists: no markup, styles, scripts, charts, file upload or custom\ncomponent. Express a screen in these components or leave the part out.\n\n\u003C!-- kit:start -->\nA prototype is `prototype.json` (the manifest) and `prototype.tsx`, which imports only `react` and `@wso2\u002Fprototype-kit`. Every component with an `id` is an element a reviewer can point at: give each a stable id, unique on its screen.\n\n### Module\n\n#### `defineApp(definition: PrototypeAppDefinition): PrototypeApp`\n\nDeclare the prototype: `export default defineApp({ screens, data })`.\n\n#### `PrototypeAppDefinition`\n\n- `screens: Record\u003Cstring, ComponentType>` — One component per manifest screen, keyed by the screen's id.\n- `data?: Record\u003Cstring, unknown>` — The mock data the screens share, as JSON literals. An array of records that each have a string `id` is a collection (`useCollection(name)`); anything else is a single value (`useValue(key)`). Changes live until Reset data (or a reload without `--persist`).\n\n### View hooks\n\n#### `useNav(): KitNav`\n\n#### `KitNav`\n\n- `screen: string` — The screen shown.\n- `go: (screenId: string, params?: Record\u003Cstring, string>) => void` — Go to a screen, optionally with params the target reads with `useParams`.\n\n#### `useParams(): Readonly\u003CRecord\u003Cstring, string>>`\n\nThe params the navigation to this screen carried. Empty when the reviewer opened the screen from the preview's pickers, so every screen must render without them (fall back to the first record).\n\n#### `useRole(): string`\n\nThe id of the role the reviewer is viewing as.\n\n#### `useDisplayState(): string`\n\nThe id of the display state the reviewer chose (e.g. empty, loading, error).\n\n### Data hooks\n\n#### `useCollection\u003CT extends { id: string; }>(name: string): Collection\u003CT>`\n\nThe collection `name` from `defineApp({ data })`: an array of records that each have a string `id`.\n\n#### `Collection`\n\nA collection of mock records, and the ways to change it for every screen.\n\n- `items: readonly T[]` — The records, in insertion order.\n- `get: (id: string) => T | undefined`\n- `create: (record: Omit\u003CT, \"id\">) => string` — Adds a record and returns its new id, `${name}-${n}` with `n` past the highest number in use.\n- `update: (id: string, patch: Partial\u003COmit\u003CT, \"id\">>) => void`\n- `remove: (id: string) => void`\n\n#### `useValue\u003CT>(key: string): [T, (next: T | ((previous: T) => T)) => void]`\n\nThe single value `key` from `defineApp({ data })`, and a setter shared by every screen.\n\n#### `useToday(): string`\n\nToday's date, fixed (`PROTOTYPE_TODAY`): a prototype never reads the clock.\n\n#### `PROTOTYPE_TODAY` = `\"2026-01-15\"`\n\nThe fixed date every prototype treats as today (ISO `YYYY-MM-DD`).\n\n### Layout\n\n#### `\u003CAppShell>`\n\nThe root of a screen inside the product's chrome: header, user menu and side navigation. Use `\u003CScreen>` for a screen outside it (signed out).\n\n- `id: string` — The shell's id; its user menu's elements are `\u003Cid>.user`, `\u003Cid>.account`, `\u003Cid>.settings` (with `settings`) and `\u003Cid>.sign-out`.\n- `product?: string` — The product's name in the header; prototype.json's `name` by default.\n- `user: AppShellUser` — The signed-in user the header shows.\n- `nav: NavigationItem[]` — The side navigation's entries.\n- `account: string` — The screen the user menu's Account entry opens.\n- `settings?: string` — The screen the user menu's Settings entry opens. Leave it out when the application has nothing to set: the menu then has no Settings entry.\n- `signOut: string` — The screen Sign out leads to: a signed-out screen, drawn on a bare `\u003CScreen>`.\n- `menu?: NavigationItem[]` — More user-menu entries (a profile, billing), drawn after Account (and Settings) and before Sign out.\n- `children?: ReactNode` — The screen's content.\n\n#### `AppShellUser`\n\n- `name: string`\n- `email?: string` — Shown under the name in the user menu.\n- `role?: string` — The role beside the name; the viewing role's name in prototype.json by default, so a role switch shows in the header.\n\n#### `\u003CScreen>`\n\nThe root of a screen outside the app shell (signed out, a landing page): its content, and navigation if any.\n\n- `nav?: ReactNode` — Navigation for an app drawn without `\u003CAppShell>`: one `\u003CNavigation>`, usually shared by every screen.\n- `children?: ReactNode`\n\n#### `\u003CSection>`\n\nA titled part of a screen — a table, a form, a group of stats — with the actions that belong to it.\n\n- `id: string`\n- `title: string`\n- `subtitle?: string` — One line under the title: what the section holds or why.\n- `count?: number` — How many records the section lists, shown beside the title.\n- `actions?: ReactNode` — The section's own Buttons (\"New request\" above the requests it adds to).\n- `children?: ReactNode`\n\n#### `\u003CStack>`\n\nChildren in a column (default) or a wrapping row.\n\n- `direction?: \"row\" | \"column\"`\n- `children?: ReactNode`\n\n#### `\u003CGrid>`\n\nChildren in 1–6 equal columns.\n\n- `columns: number` — 1–6 equal columns (one column on a narrow window).\n- `children?: ReactNode`\n\n#### `\u003CSplit>`\n\nTwo panes side by side (stacked on a narrow window).\n\n- `left: ReactNode`\n- `right: ReactNode`\n- `ratio?: number` — The left pane's share of 12 columns (default 6).\n\n#### `\u003CDetail>`\n\nA read-only record: label\u002Fvalue pairs.\n\n- `id: string`\n- `title?: string`\n- `fields: DetailField[]`\n\n#### `DetailField`\n\n- `label: string`\n- `value: string`\n\n### Navigation\n\n#### `\u003CNavigation>`\n\nNavigation for an app drawn on `\u003CScreen nav>` (`\u003CAppShell nav>` draws its own). Its items are what a reviewer points at.\n\n- `id: string`\n- `layout: \"side\" | \"top\"`\n- `items: NavigationItem[]`\n\n#### `NavigationItem`\n\n- `id: string`\n- `label: string`\n- `to: string` — The screen the entry opens; it shows as active there.\n\n#### `\u003CBreadcrumbs>`\n\nA trail back to where the reviewer came from.\n\n- `id: string`\n- `items: BreadcrumbItem[]` — The trail, root first.\n\n#### `BreadcrumbItem`\n\n- `id: string`\n- `label: string`\n- `to?: string` — Where the crumb leads; the last crumb is the current page and takes none.\n- `params?: Record\u003Cstring, string>`\n\n#### `\u003CTabs>`\n\nTabbed panels. Each tab header is an element a reviewer can point at (its `id`); the Tabs itself is layout.\n\n- `id: string`\n- `tabs: Panel[]`\n- `active?: string` — The open tab, when the screen controls it; the first tab otherwise.\n- `onChange?: ((tabId: string) => void)`\n\n#### `\u003CStepper>`\n\nA multi-step wizard. Each step header is an element a reviewer can point at (its `id`).\n\n- `id: string`\n- `steps: Panel[]`\n- `active?: string` — The current step, when the screen controls it (a Next button); the first step otherwise.\n- `onChange?: ((stepId: string) => void)`\n\n#### `Panel`\n\n- `id: string`\n- `label: string`\n- `content: ReactNode`\n\n### Content\n\n#### `\u003CHeading>`\n\nA page or section title, with the actions beside it.\n\n- `id: string`\n- `text: string`\n- `level?: \"page\" | \"section\"` — `page` (default) for a screen's title; `section` titles a part of it. Prefer `\u003CSection>` for a part with its own actions or records.\n- `actions?: ReactNode` — Buttons and Links beside the heading.\n\n#### `\u003CText>`\n\nA paragraph of body text.\n\n- `id: string`\n- `text: string`\n- `tone?: \"primary\" | \"secondary\"` — `secondary` (default) for body copy, `primary` for emphasis.\n\n#### `\u003CBadge>`\n\nA status chip.\n\n- `id: string`\n- `label: string`\n- `tone?: Tone`\n\n#### `\u003CStat>`\n\nA headline number with its label. Put a screen's stats side by side in a `\u003CStatGroup>`.\n\n- `id: string`\n- `label: string`\n- `value: string`\n- `hint?: string` — A short line under the value that gives it scale or context: \"of 20 days\", \"3 due this week\".\n- `icon?: StatIcon` — An icon beside the label.\n- `tone?: Tone` — Colours the icon (`default` is the theme's primary).\n\n#### `StatIcon` = `\"Activity\" | \"Bell\" | \"Briefcase\" | \"Bug\" | \"Building2\" | \"Calendar\" | \"CalendarCheck\" | \"CalendarClock\" | \"CalendarDays\" | \"ChartColumn\" | \"CircleCheck\" | \"CircleX\" | \"ClipboardList\" | \"Clock\" | \"Cloud\" | \"Cpu\" | \"CreditCard\" | \"Database\" | \"DollarSign\" | \"FileText\" | \"Gauge\" | \"Globe\" | \"HeartPulse\" | \"Hourglass\" | \"Inbox\" | \"Layers\" | \"ListChecks\" | \"Lock\" | \"Mail\" | \"MessageSquare\" | \"Package\" | \"Plane\" | \"Receipt\" | \"Rocket\" | \"Server\" | \"Shield\" | \"ShoppingCart\" | \"Star\" | \"Tag\" | \"Ticket\" | \"Timer\" | \"TrendingDown\" | \"TrendingUp\" | \"TriangleAlert\" | \"Truck\" | \"User\" | \"UserCheck\" | \"Users\" | \"Wallet\" | \"Zap\"`\n\nThe icons a `\u003CStat>` may show, named as in WSO2's Oxygen icon set (Lucide's names). A theme draws each or none; an unknown name fails the check.\n\n#### `\u003CStatGroup>`\n\nA row of `\u003CStat>`s at equal widths, wrapping on a narrow window.\n\n- `children?: ReactNode` — The `\u003CStat>`s, in reading order.\n\n#### `\u003CAlert>`\n\nA callout: info, success, warning or error.\n\n- `id: string`\n- `tone: Tone`\n- `title?: string`\n- `text: string`\n\n#### `\u003CEmptyState>`\n\nWhat a list shows when there is nothing in it.\n\n- `id: string`\n- `title: string`\n- `text: string`\n- `actions?: ReactNode` — The Buttons that start something.\n\n#### `\u003CButton>`\n\nA button. Give it `to` to navigate, `onPress` to do anything else, `submit` to submit its form.\n\n- `id: string`\n- `label: string`\n- `emphasis?: \"primary\" | \"danger\"` — `primary` for the screen's main action, `danger` for a destructive one; outlined otherwise.\n- `disabled?: boolean`\n- `submit?: boolean` — Submits the enclosing `\u003CForm>` (which validates its fields, then calls its `onSubmit`).\n- `to?: string` — Navigate to this screen when pressed. Prefer it to `onPress` for plain navigation: the checks verify it.\n- `params?: Record\u003Cstring, string>` — The params `to` carries, read on the target with `useParams`.\n- `onPress?: (() => void)` — Run when pressed: change mock data, open a dialog, navigate conditionally.\n\n#### `\u003CLink>`\n\nAn inline link; presses like a Button.\n\n- `id: string`\n- `label: string`\n- `to?: string` — Navigate to this screen when pressed. Prefer it to `onPress` for plain navigation: the checks verify it.\n- `params?: Record\u003Cstring, string>` — The params `to` carries, read on the target with `useParams`.\n- `onPress?: (() => void)` — Run when pressed: change mock data, open a dialog, navigate conditionally.\n\n#### `Tone` = `\"default\" | \"info\" | \"success\" | \"warning\" | \"error\"`\n\n#### `Pressable`\n\n- `to?: string` — Navigate to this screen when pressed. Prefer it to `onPress` for plain navigation: the checks verify it.\n- `params?: Record\u003Cstring, string>` — The params `to` carries, read on the target with `useParams`.\n- `onPress?: (() => void)` — Run when pressed: change mock data, open a dialog, navigate conditionally.\n\n### Forms\n\n#### `\u003CForm>`\n\nA form card: its Fields, then its action Buttons. Validates on submit.\n\n- `id: string`\n- `title?: string`\n- `children?: ReactNode` — Its Fields.\n- `actions?: ReactNode` — Its Buttons, under the fields; a `\u003CButton submit>` submits.\n- `onSubmit?: ((values: Record\u003Cstring, string>) => void)` — Called with every field's value, keyed by name, when a submit passes validation.\n\n#### `\u003CField>`\n\nOne input. It holds what is typed into it; inside a Form, the Form validates and submits it.\n\n- `id: string`\n- `label: string`\n- `name?: string` — The key of its value in the enclosing Form's `onSubmit` values (default: its id).\n- `type?: FieldType`\n- `value?: string` — Controls the field: it shows this; with `onChange` it is editable, without it read-only.\n- `defaultValue?: string` — The starting value of a field that holds its own (no `value`). A switch is `on` or `off`.\n- `options?: string[]` — A select's choices.\n- `error?: string` — A problem to show regardless of validation (e.g. in a validation-error display state).\n- `required?: boolean`\n- `pattern?: string` — A regular expression the whole value must match when it is not empty.\n- `patternMessage?: string` — What a value that does not match `pattern` shows.\n- `placeholder?: string`\n- `onChange?: ((value: string) => void)`\n\n#### `FieldType` = `\"number\" | \"text\" | \"select\" | \"date\" | \"textarea\" | \"switch\"`\n\n#### `\u003CFilters>`\n\nA filter bar above a list.\n\n- `id: string`\n- `children?: ReactNode` — Its Fields, laid out compactly in a row.\n\n#### `\u003CValidationSummary>`\n\nThe problems a failed submit shows, for a display state that shows them without a submit.\n\n- `id: string`\n- `issues: string[]`\n\n### Data\n\n#### `\u003CTable>`\n\nA table of records.\n\n- `id: string`\n- `title?: string`\n- `columns: (string | TableColumn)[]`\n- `rows: TableRow[]`\n- `onRowPress?: ((rowId: string) => void)` — Run when a row is pressed, with its id; a row with neither this nor `to` is only highlighted.\n- `empty?: ReactNode` — What an empty table shows instead (an `\u003CEmptyState>`).\n\n#### `TableColumn`\n\n- `label: string`\n- `kind?: \"number\" | \"text\" | \"status\"` — `text` (default); `number` aligns figures to the right; `status` shows each row's `status` as a badge (one per table). A plain string is a `text` column.\n\n#### `TableRow`\n\n- `id: string` — The row's element id: unique on the screen (prefix it with the table's).\n- `cells: string[]` — One per `text` or `number` column, in column order; the status column takes `status`.\n- `status?: TableStatus` — The badge in the table's status column.\n- `actions?: TableAction[]` — What can be done to this record, drawn as buttons in a trailing column; pressing one does not press the row.\n- `tone?: Tone` — Colours the last cell as a status, in a table without a status column. Prefer `status`.\n- `to?: string` — Open this screen when the row is pressed.\n- `params?: Record\u003Cstring, string>`\n\n#### `TableStatus`\n\n- `text: string`\n- `tone: Tone`\n\n#### `TableAction`\n\n- `id: string` — The action's element id: unique on the screen (prefix it with the row's).\n- `label: string`\n- `emphasis?: \"danger\"` — `danger` for a destructive action.\n- `to?: string` — Navigate to this screen when pressed. Prefer it to `onPress` for plain navigation: the checks verify it.\n- `params?: Record\u003Cstring, string>` — The params `to` carries, read on the target with `useParams`.\n- `onPress?: (() => void)` — Run when pressed: change mock data, open a dialog, navigate conditionally.\n\n#### `\u003CTimeline>`\n\nAn activity history.\n\n- `id: string`\n- `title?: string`\n- `entries: TimelineEntry[]` — Newest first.\n\n#### `TimelineEntry`\n\n- `when: string`\n- `who: string`\n- `text: string`\n\n### Overlays\n\n#### `\u003CDialog>`\n\nA modal.\n\n- `id: string`\n- `title: string`\n- `open: boolean`\n- `onClose: () => void`\n- `children?: ReactNode`\n- `actions?: ReactNode` — Its Buttons, at the bottom.\n\n#### `\u003CDrawer>`\n\nA side panel.\n\n- `id: string`\n- `title: string`\n- `open: boolean`\n- `onClose: () => void`\n- `children?: ReactNode`\n\n### Finding codes\n\n`prototype check --json` prints `{ ok, findings: [{ code, file, location, message }] }` and exits 1 when there are findings.\n\n| Code | Meaning |\n|---|---|\n| `MISSING_FILE` | prototype.json or prototype.tsx is not in the folder. |\n| `SCHEMA_VIOLATION` | prototype.json is not JSON, or does not have the manifest's shape. |\n| `UNSUPPORTED_VERSION` | prototype.json's schemaVersion is not 3. |\n| `DUPLICATE_ID` | A role, state, screen or flow id repeats another; the four share one namespace. |\n| `UNKNOWN_REFERENCE` | A manifest reference names nothing, or a flow step its role cannot reach. |\n| `SYNTAX_ERROR` | prototype.tsx does not parse. |\n| `FORBIDDEN_IMPORT` | An import other than react and @wso2\u002Fprototype-kit, a dynamic import(), or require. |\n| `FORBIDDEN_API` | A browser, network, storage, code-generation or nondeterministic API. |\n| `FORBIDDEN_ELEMENT` | A raw HTML element; screens are drawn with kit components only. |\n| `SOURCE_TOO_LARGE` | prototype.tsx is over the size cap. |\n| `NO_APP` | prototype.tsx does not `export default defineApp({ screens, data })`. |\n| `SCREEN_MISMATCH` | defineApp's screens are not exactly the manifest's screens. |\n| `UNKNOWN_NAV_TARGET` | A `to` or `go()` names a screen that does not exist, or one the viewing role cannot reach. |\n| `TYPE_ERROR` | prototype.tsx does not type-check: it reads a property, prop or name its types do not have, or passes a value of the wrong type. |\n| `RENDER_FAILED` | The module, or a screen for some role and display state, throws or runs too long. |\n| `DUPLICATE_ELEMENT_ID` | Two elements on one screen share an id. |\n\u003C!-- kit:end -->\n\n## Mock data\n\nRecords are part of the source and never generated at render time, so write\nthem out in full:\n\n- **Shaped by the data model.** Each collection in `defineApp({ data })` is\n  an entity of `domain-model.md`, and each record has that entity's\n  attributes. Columns, detail fields and form fields are those attributes, in\n  words a user reads (`submittedAt` becomes \"Submitted\"). A value has the type\n  the model gives it: an enum value is one of its values, an amount reads as\n  an amount. A relation shows as the related record's name, not its id. Type\n  the records after the entity (`interface Expense { … }`).\n- **Realistic.** Plausible names, amounts, dates and statuses for the domain;\n  never `foo`, `test`, `Lorem ipsum` or `Item 1`.\n- **Deterministic.** The same design gives the same records: fixed values, no\n  randomness, no \"today\" other than `useToday()`. A row's id is derived from the\n  record (`expense.1042`).\n- Enough rows to read as real (three to six), and a state in which a list is\n  empty when the story has one.\n\n## Stable ids\n\nManifest ids and element ids (the `id` of every kit component) are identities,\nlabels are not: a reviewer's annotations point at element ids, and shared\nlinks name screens, flows and states, so:\n\n- Name them `\u003Ckind>.\u003Cslug>` from what the thing is (`screen.queue`,\n  `btn.approve`, `field.amount`), except role ids, which are `security.json`'s\n  names. An element id is unique on its screen; a row's id is prefixed with\n  its table's kind (`expense.1042`).\n- **Revising an existing prototype keeps every key and id whose thing still\n  exists.** Rename labels freely; change an id only when its thing is removed\n  or genuinely becomes something else.\n- **Regenerating a prototype that has review comments** (`\u002Fprototype` on a\n  reviewed design) is a revision like any other: edits, ids kept. Leave\n  `specs\u002Fdesign\u002Freview.json` as it is. Its comments stay open for Address\n  comments, and the file's Checked mark clears by itself when the prototype\n  changes.\n\n## Closing\n\nWhen a prototype passes its checks, report it in one chat line: its screen\ncount and flow count, then each story you set aside and anything from the\ndesign you could not show, with the reason.\n","# Prototype\n\nA coding run that builds a web-application reads `references\u002Fimplementing.md`.\nThe rest of this file is how the design agent writes a prototype.\n\nA prototype is the reviewable picture of a `web-application` before it is\nbuilt: its screens, navigation, roles, flows and display states, filled with\nmock data, running in a sandbox inside the review page. It is the web\napplication's artifact in the design. The `design` flow writes it after the\ndata model and the roles, and before the API contracts, which then serve its\nscreens. The business reviewer uses it and comments on it, and the build\nmakes what it shows.\n\nThe screens are a React module written against a fixed kit of components\n(`@wso2\u002Fprototype-kit`). You compose screens from the kit; you do not build\ncomponents, style anything, or reach outside the frame.\n\n## Inputs\n\nRead these before writing anything:\n\n- `specs\u002Fdesign\u002Fdesign.cell`: every `component … web-application` line is one\n  prototype to write. No web-application means there is nothing to do: say so\n  and stop. When the turn names components, write only those.\n- `specs\u002Fdesign\u002Fdomain-model.md`: the records. Each entity that a screen shows\n  or changes is a collection in the mock data, and its fields are the\n  entity's attributes (see **Mock data**).\n- `specs\u002Fdesign\u002Fsecurity.json`: the roles. When the file exists, each\n  prototype role's `id` is a role's `name` from it, **copied verbatim** (same\n  case, same spelling), and its `name` is a short human label for that role.\n  Include exactly the roles that use this application. Each role's\n  `description` says what the role does and what it never sees: show each role\n  only the screens, controls and records that its description allows. Without\n  the file, take the roles from the PRD's actors and give them short\n  kebab-case ids.\n- The web application's `design.json`: `stories` lists the stories it serves.\n- The requirements of those stories: each feature's file,\n  `specs\u002Frequirements\u002Ffeatures\u002FF\u003Cn>-\u003Cslug>.md`, with its stories (`F\u003Cn>.\u003Cm>`)\n  and its Decisions, the `*assumed*` lines included; `product-wide.md` for the\n  items that apply to it; and `prd.md`'s Actors, for the people your records\n  are about. Every story the application serves gets at least one screen. Set\n  a story aside only when the product gives it no view (sign-in through the\n  platform's SSO, a machine-facing endpoint), and name it in your closing.\n- A sketch or mockup the user attached: the layout brief. Refine it; do not\n  reinvent it. Where it and the stories disagree, the stories' scope wins and\n  the sketch's layout intent survives inside it.\n- `specs\u002Fdesign\u002Fcomponents\u002F\u003Ccomponent>\u002Fprototype.json` and `prototype.tsx` if\n  they already exist: you are revising them, not starting over (see **Stable\n  ids**).\n\n## Output\n\nTwo files per web-application, in `specs\u002Fdesign\u002Fcomponents\u002F\u003Ccomponent>\u002F`,\nwhere `\u003Ccomponent>` is the web-application's name in the cell:\n\n1. **`prototype.json`, the manifest**: the roles, display states, screens and\n   flows the reviewer picks from. Write it **first**.\n2. **`prototype.tsx`, the screens**: one React component per manifest screen,\n   exported with `defineApp`. It is checked against the manifest already\n   written.\n\nWrite a new file with ONE `addFile` of the whole file. Revise an existing one\nwith `editFile` edits: the file is already in front of you, and an edit costs\nwhat it changes. Never write a partial file to finish later.\n\nEach write of `prototype.tsx` is type-checked alone. A change to a record type\nand its uses (a field that you add, rename or remove) cannot go in as one edit\nper line: the first edit leaves the other uses wrong, and the check refuses\nit (`TYPE_ERROR`, one finding for each wrong line). Write such a change, or\nany other change to many lines, in one write: `removeFile`, then ONE `addFile`\nof the whole corrected file, with each id as it was.\n\nThis step writes only these two files. A screen can need a record, a field or\na role that the data model or `security.json` does not have. Then change that\nfile first (it comes earlier in the design), and write the screen after it.\nDo not change a requirement here: the design's gap check writes the\nrequirements.\n\nEvery write is checked as it lands: the manifest's shape and references, the\nsource's static rules, then a render of every screen for every role that reaches\nit in every display state. A refusal lists every finding with its code and\nwhere (a JSON path in the manifest, a line in the source, or the screen, role\nand state that failed to draw). Fix all of them and retry once. The codes are\nlisted at the end of **The kit**.\n\n## The manifest\n\nPlain JSON, schema version 3. Every object is closed: a key not shown here is\nrefused.\n\n```json\n{\n  \"schemaVersion\": 3,\n  \"name\": \"Expense approvals\",\n  \"entryScreen\": \"screen.queue\",\n  \"roles\": [{ \"id\": \"Approver\", \"name\": \"Approver\" }],\n  \"states\": [\n    { \"id\": \"state.default\", \"name\": \"Default\" },\n    { \"id\": \"state.empty\", \"name\": \"Nothing to show\" },\n    { \"id\": \"state.validation-error\", \"name\": \"Validation errors\" },\n    { \"id\": \"state.failed\", \"name\": \"Expense feed failed\" }\n  ],\n  \"screens\": [\n    { \"id\": \"screen.queue\", \"name\": \"Approval queue\", \"roleIds\": [\"Approver\"] },\n    { \"id\": \"screen.detail\", \"name\": \"Expense detail\", \"roleIds\": [\"Approver\"] },\n    { \"id\": \"screen.account\", \"name\": \"Account\", \"roleIds\": [\"Approver\"] },\n    { \"id\": \"screen.signed-out\", \"name\": \"Signed out\", \"roleIds\": [\"Approver\"] }\n  ],\n  \"flows\": [\n    { \"id\": \"flow.approve\", \"name\": \"Approve an expense\", \"roleId\": \"Approver\",\n      \"screenIds\": [\"screen.queue\", \"screen.detail\"] }\n  ]\n}\n```\n\n- `roles`, `states` and `screens` have at least one entry; their ids and the\n  flows' ids share one namespace and are unique together. `entryScreen` is the\n  screen the prototype opens on. `name` is the application's name.\n- A screen's `roleIds` are the roles that reach it. A flow is one role's walk\n  through screens that role reaches, in order, for one story. Give each story\n  that has a view a flow, named for what the actor does (\"Submit a claim\").\n- The app shell's screens, an account screen and a signed-out screen, go to\n  **every** role: every user has them.\n- A settings screen exists only for the settings that the requirements name\n  (a notification choice, a default that a user picks). It goes to the roles\n  that set them, and it holds those settings and nothing else. When the\n  requirements name no setting, write no settings screen. Never invent a\n  preference (a digest email, a Slack alert, a compact view) to fill one.\n- `states` always starts with a default state (`state.default`); add one per\n  presentation a reviewer must see:\n  - `state.empty` wherever a list can be empty.\n  - Wherever the product can refuse or fail what a screen does, the states\n    that the refusal or the failure produces. A form that a requirement limits\n    (a required receipt, a cap) shows its validation errors in\n    `state.validation-error`: its Fields' `error` and a ValidationSummary.\n    A screen whose data or action can fail (an outside service it needs, a\n    save) gets `state.failed`: an error Alert saying what failed and what the\n    user can do. A step that can be slow (an outside service, a long-running\n    job) gets `state.delayed`: an info or warning Alert saying the result is on\n    its way.\n  A prototype with only default and empty states hides the presentations a\n  reviewer most needs to judge.\n\n## The screens\n\n```tsx\nimport { useState, type ReactNode } from \"react\";\nimport {\n  Alert, AppShell, Button, Detail, Dialog, EmptyState, Field, Form, Heading, Screen, Section, Stat,\n  StatGroup, Table, defineApp, useCollection, useDisplayState, useNav, useParams,\n} from \"@wso2\u002Fprototype-kit\";\n\ninterface Expense { id: string; employee: string; amount: string; status: string }\n\nconst expenses: Expense[] = [\n  { id: \"1042\", employee: \"Maya Fernando\", amount: \"$148.20\", status: \"Awaiting approval\" },\n  { id: \"1039\", employee: \"Ravi Perera\", amount: \"$62.00\", status: \"Awaiting approval\" },\n  { id: \"1031\", employee: \"Ana Silva\", amount: \"$310.00\", status: \"Approved\" },\n];\n\nconst user = { name: \"Ravi Perera\", email: \"ravi@acme.example\" };\n\nfunction Shell({ children }: { children: ReactNode }) {\n  return (\n    \u003CAppShell\n      id=\"shell\"\n      user={user}\n      nav={[{ id: \"nav.queue\", label: \"Approval queue\", to: \"screen.queue\" }]}\n      account=\"screen.account\"\n      signOut=\"screen.signed-out\"\n    >\n      {children}\n    \u003C\u002FAppShell>\n  );\n}\n\nfunction Queue() {\n  const state = useDisplayState();\n  const all = useCollection\u003CExpense>(\"expenses\");\n  const waiting = state === \"state.empty\" ? [] : all.items.filter((e) => e.status === \"Awaiting approval\");\n  const approved = all.items.filter((e) => e.status === \"Approved\").length;\n  return (\n    \u003CShell>\n      \u003CHeading id=\"heading.queue\" text=\"Approval queue\" \u002F>\n      {state === \"state.failed\" && (\n        \u003CAlert id=\"alert.feed-failed\" tone=\"error\" title=\"Expense feed unavailable\" text=\"Amounts may be stale. Refresh in a few minutes.\" \u002F>\n      )}\n      \u003CStatGroup>\n        \u003CStat id=\"stat.waiting\" label=\"Awaiting you\" value={String(waiting.length)} hint=\"claims to decide\" icon=\"Inbox\" tone=\"warning\" \u002F>\n        \u003CStat id=\"stat.approved\" label=\"Approved\" value={String(approved)} hint=\"this month\" icon=\"CircleCheck\" tone=\"success\" \u002F>\n      \u003C\u002FStatGroup>\n      \u003CSection id=\"section.expenses\" title=\"Expenses\" count={waiting.length} subtitle=\"Oldest first. Open a claim to reject it with a reason.\">\n        \u003CTable\n          id=\"table.expenses\"\n          columns={[\"Employee\", { label: \"Amount\", kind: \"number\" }, { label: \"Status\", kind: \"status\" }]}\n          rows={waiting.map((e) => ({\n            id: `expense.${e.id}`,\n            cells: [e.employee, e.amount],\n            status: { text: e.status, tone: \"warning\" },\n            to: \"screen.detail\",\n            params: { expense: e.id },\n            actions: [{ id: `expense.${e.id}.approve`, label: \"Approve\", onPress: () => all.update(e.id, { status: \"Approved\" }) }],\n          }))}\n          empty={\u003CEmptyState id=\"empty.queue\" title=\"Nothing to approve\" text=\"New claims appear here.\" \u002F>}\n        \u002F>\n      \u003C\u002FSection>\n    \u003C\u002FShell>\n  );\n}\n\nfunction ExpenseDetail() {\n  const { expense: id } = useParams();\n  const state = useDisplayState();\n  const navigate = useNav();\n  const all = useCollection\u003CExpense>(\"expenses\");\n  const [rejecting, setRejecting] = useState(false);\n  const expense = (id ? all.get(id) : undefined) ?? all.items[0]!;\n  const decide = (status: string) => {\n    all.update(expense.id, { status });\n    navigate.go(\"screen.queue\");\n  };\n  return (\n    \u003CShell>\n      \u003CHeading id=\"heading.detail\" text={`Expense ${expense.id}`} \u002F>\n      \u003CDetail\n        id=\"detail.expense\"\n        fields={[\n          { label: \"Employee\", value: expense.employee },\n          { label: \"Amount\", value: expense.amount },\n        ]}\n      \u002F>\n      \u003CButton id=\"btn.approve\" label=\"Approve\" emphasis=\"primary\" onPress={() => decide(\"Approved\")} \u002F>\n      \u003CButton id=\"btn.reject\" label=\"Reject\" emphasis=\"danger\" onPress={() => setRejecting(true)} \u002F>\n      \u003CDialog id=\"dialog.reject\" title={`Reject expense ${expense.id}`} open={rejecting} onClose={() => setRejecting(false)}>\n        \u003CForm\n          id=\"form.reject\"\n          onSubmit={() => decide(\"Rejected\")}\n          actions={\u003CButton id=\"btn.reject.confirm\" label=\"Reject\" emphasis=\"danger\" submit \u002F>}\n        >\n          \u003CField\n            id=\"field.reason\"\n            label=\"Reason\"\n            type=\"textarea\"\n            required\n            error={state === \"state.validation-error\" ? \"Give the employee a reason\" : undefined}\n          \u002F>\n        \u003C\u002FForm>\n      \u003C\u002FDialog>\n    \u003C\u002FShell>\n  );\n}\n\nfunction Account() {\n  return (\n    \u003CShell>\n      \u003CHeading id=\"heading.account\" text=\"Account\" \u002F>\n      \u003CDetail id=\"detail.account\" fields={[{ label: \"Name\", value: user.name }, { label: \"Email\", value: user.email }]} \u002F>\n    \u003C\u002FShell>\n  );\n}\n\nfunction SignedOut() {\n  return (\n    \u003CScreen>\n      \u003CHeading id=\"heading.signed-out\" text=\"You are signed out\" \u002F>\n      \u003CButton id=\"btn.sign-in\" label=\"Sign in\" emphasis=\"primary\" to=\"screen.queue\" \u002F>\n    \u003C\u002FScreen>\n  );\n}\n\nexport default defineApp({\n  screens: {\n    \"screen.queue\": Queue,\n    \"screen.detail\": ExpenseDetail,\n    \"screen.account\": Account,\n    \"screen.signed-out\": SignedOut,\n  },\n  data: { expenses },\n});\n```\n\n- **One component per manifest screen**, keyed by the screen's id in\n  `defineApp({ screens })`: exactly the manifest's screens, no more, no less.\n- **Every screen sits in the app shell.** Write one `\u003CAppShell>` in a small\n  local component (`Shell` above) and make it every screen's root: it draws\n  the product's header, the signed-in user and the user menu (Account,\n  Settings, Sign out) and the side navigation. Its `account` and `signOut`\n  are screens you write: an account screen with the user's details, and a\n  signed-out screen. Only that signed-out screen, outside the product, has a\n  bare `\u003CScreen>` as its root, with a way to sign back in. Give `settings`\n  only when the prototype has a settings screen (see the manifest rules):\n  without it, the user menu has no Settings entry.\n  The shell's `menu` adds the application's own user-menu entries (a profile,\n  billing) before Sign out. A reviewer points at an entry by\n  opening the menu in Preview, then switching to Annotate.\n- **One shell serves every role.** A navigation entry is drawn only for the\n  roles that reach its screen. Give `user` the person each role signs in as\n  (pick by `useRole()` when roles differ); the header shows the viewing role's\n  name beside them.\n- **Read the review through the hooks.** `useDisplayState()` is the display\n  state the reviewer chose and `useRole()` the role they view as: branch on\n  them to show an error, an empty list, a role's own controls. Show a control\n  only to the roles that reach where it leads: a `to` a role cannot follow is\n  refused.\n- **Navigate with `to`** on a Button, Link, table row, row action or breadcrumb (with\n  `params` the target reads through `useParams()`); `useNav().go(...)` inside\n  an `onPress` for a navigation that follows an action. Every screen must\n  also draw **without** params (the reviewer can open any screen from the\n  pickers), so fall back to the first record.\n- **Overlays are the screen's own state**: `const [open, setOpen] =\n  useState(false)` and `\u003CDialog open={open} onClose={() => setOpen(false)}>`.\n  Tabs and Steppers keep their own position, or take `active` and `onChange`\n  when a button moves them (a wizard's Next).\n- **Forms submit through the kit.** A `\u003CForm onSubmit>` with a `\u003CButton submit>`\n  validates its Fields (`required`, `pattern`) and then calls `onSubmit` with\n  their values keyed by `name` (default: the Field's id). A Field with no\n  `value` holds what is typed into it; give it `defaultValue` to start filled.\n- **The mock data is `defineApp({ data })`.** An array of records that each have\n  a string `id` is a collection: read it with `useCollection(name)` and change\n  it with `create`, `update` and `remove`, so the next screen shows the result.\n  Anything else is a single value for `useValue(key)`. The change lives in\n  memory until the reviewer presses Reset data; nothing is sent anywhere.\n\nWhat a prototype may not use is refused as it lands: imports other than `react`\nand `@wso2\u002Fprototype-kit`; raw HTML elements (`\u003Cdiv>`, `\u003Ctable>`, `\u003Cimg>`, …),\nbecause every element is a kit component; the page, storage, network and\ncode-generation APIs (`window`, `document`, `fetch`, `eval`, …); and anything\nnondeterministic (`Math.random()`, `Date.now()`, `new Date()` with no argument;\nuse `useToday()` for today's date). Styles do not exist: the theme draws every\ncomponent, and a component takes no `className` or `style`.\n\n### What the reviewer sees\n\nThe review renderer draws only what the screen component renders: kit\ncomponents, inside the chrome its `\u003CAppShell>` draws (the header with the\nproduct's name and the signed-in user, the user menu with Account, Settings\nwhen the shell names a settings screen, and Sign out, the side navigation).\nA bare `\u003CScreen>` is drawn with no chrome at all.\n\nNothing else is drawn automatically: no notification bell, search, theme\ntoggle, help menu or footer, whatever the built application's shell will\ncarry. If a reviewer asks for such chrome, model it in the kit: a navigation\nentry, or a Button or Link in the screen's content (a Heading's `actions` for\nthe top right) whose `to` is the screen it leads to or whose `onPress` opens a\nDrawer (a notification list) or a Dialog (a confirmation). Only if what they\nask for is outside the kit, say so in your reply and name the limitation.\nNever tell a reviewer the platform draws something the screen does not render.\n\n### The Oxygen look\n\nThe reviewer sees the prototype in the Oxygen theme, the look of WSO2 products,\nso a prototype should read as an Oxygen screen. The host applies the theme: the\nsource never imports one, never styles anything, and never names Oxygen. Your\npart is composing screens the way an Oxygen application composes them:\n\n- **Page anatomy.** A screen is the `\u003CAppShell>` holding a `\u003CHeading>` (the\n  page title, with page-wide action Buttons in `actions`), then the content in\n  the order a user works through it: headline numbers as one `\u003CStatGroup>` of\n  `\u003CStat>`s, then a `\u003CSection>` per part of the page (a list, a form, a\n  record), with `\u003CFilters>` and the `\u003CTable>` inside it, and `\u003CDetail>`,\n  `\u003CForm>` and `\u003CTimeline>` for a single record. A sub-page opens with\n  `\u003CBreadcrumbs>` back to its list.\n- **Stats in a group.** Put a screen's `\u003CStat>`s in one `\u003CStatGroup>`, never a\n  `\u003CStack direction=\"row\">` or `\u003CGrid>`: the group gives them one width. Give\n  each a `hint` that gives the number its scale (\"of 20 left this year\",\n  \"claims to decide\") and an `icon` from the kit's list that names what it\n  counts; `tone` colours the icon when the number needs attention.\n- **Sections own their actions.** A `\u003CSection>` titles a part of the page,\n  with `count` for the records it lists and `subtitle` for one line on what it\n  holds. An action that adds to or acts on that part sits in the Section's\n  `actions` (New request above the requests), not under the table and not in\n  the page Heading.\n- **One primary action per screen.** `emphasis=\"primary\"` marks the screen's\n  main action and nothing else; destructive actions are `\"danger\"`.\n- **Status is a chip, not prose.** A record's status is the table's status\n  column (`{ label: \"Status\", kind: \"status\" }` in `columns`, and each row's\n  `status: { text, tone }`) or a `\u003CBadge>`: `success`, `warning`, `error`,\n  `info`, `default`. Put the column where it reads best; the row's `cells` fill\n  the other columns in order. Callouts are `\u003CAlert>`s with a tone.\n- **Row actions are buttons, not cells.** What a user does to one record\n  without opening it (Cancel, Approve) is the row's `actions`, each with an id\n  built from the row's (`` `${rowId}.cancel` ``), a `label`, and `to` or\n  `onPress` like a Button (`emphasis: \"danger\"` for a destructive one). They\n  draw in a trailing column (behind one menu past two) and pressing one never\n  presses the row, so the row can still open the record. Never write an\n  action's label into a cell. Figures are `{ label, kind: \"number\" }` columns.\n- **Navigation is the shell's side rail**, one entry per top-level screen.\n  Account and Settings live in the user menu, not the rail.\n- **Records, not cards.** Show a list of records as a `\u003CTable>` whose rows\n  open the record; use `\u003CSplit>` for a record next to its activity.\n- **Forms are short and labelled.** One `\u003CForm>` per task, a `\u003CField>` per\n  input with a plain label, `required` where the API requires it, errors in\n  the Field's `error` and a `\u003CValidationSummary>` for the whole form.\n\nWhen the organization names a design system, its skill is loaded beside this\none and is the full account of how an enterprise screen is composed (a listing\npage's header, filters and table, a form's layout and actions). Read it for the\narrangement and build each screen that way from the kit; with none loaded, use\nthe rules above. Its setup, packages and code are the build's concern,\nnot this flow's: the kit's components are the only vocabulary here.\n\n## The kit\n\nNothing else exists: no markup, styles, scripts, charts, file upload or custom\ncomponent. Express a screen in these components or leave the part out.\n\n\u003C!-- kit:start -->\nA prototype is `prototype.json` (the manifest) and `prototype.tsx`, which imports only `react` and `@wso2\u002Fprototype-kit`. Every component with an `id` is an element a reviewer can point at: give each a stable id, unique on its screen.\n\n### Module\n\n#### `defineApp(definition: PrototypeAppDefinition): PrototypeApp`\n\nDeclare the prototype: `export default defineApp({ screens, data })`.\n\n#### `PrototypeAppDefinition`\n\n- `screens: Record\u003Cstring, ComponentType>` — One component per manifest screen, keyed by the screen's id.\n- `data?: Record\u003Cstring, unknown>` — The mock data the screens share, as JSON literals. An array of records that each have a string `id` is a collection (`useCollection(name)`); anything else is a single value (`useValue(key)`). Changes live until Reset data (or a reload without `--persist`).\n\n### View hooks\n\n#### `useNav(): KitNav`\n\n#### `KitNav`\n\n- `screen: string` — The screen shown.\n- `go: (screenId: string, params?: Record\u003Cstring, string>) => void` — Go to a screen, optionally with params the target reads with `useParams`.\n\n#### `useParams(): Readonly\u003CRecord\u003Cstring, string>>`\n\nThe params the navigation to this screen carried. Empty when the reviewer opened the screen from the preview's pickers, so every screen must render without them (fall back to the first record).\n\n#### `useRole(): string`\n\nThe id of the role the reviewer is viewing as.\n\n#### `useDisplayState(): string`\n\nThe id of the display state the reviewer chose (e.g. empty, loading, error).\n\n### Data hooks\n\n#### `useCollection\u003CT extends { id: string; }>(name: string): Collection\u003CT>`\n\nThe collection `name` from `defineApp({ data })`: an array of records that each have a string `id`.\n\n#### `Collection`\n\nA collection of mock records, and the ways to change it for every screen.\n\n- `items: readonly T[]` — The records, in insertion order.\n- `get: (id: string) => T | undefined`\n- `create: (record: Omit\u003CT, \"id\">) => string` — Adds a record and returns its new id, `${name}-${n}` with `n` past the highest number in use.\n- `update: (id: string, patch: Partial\u003COmit\u003CT, \"id\">>) => void`\n- `remove: (id: string) => void`\n\n#### `useValue\u003CT>(key: string): [T, (next: T | ((previous: T) => T)) => void]`\n\nThe single value `key` from `defineApp({ data })`, and a setter shared by every screen.\n\n#### `useToday(): string`\n\nToday's date, fixed (`PROTOTYPE_TODAY`): a prototype never reads the clock.\n\n#### `PROTOTYPE_TODAY` = `\"2026-01-15\"`\n\nThe fixed date every prototype treats as today (ISO `YYYY-MM-DD`).\n\n### Layout\n\n#### `\u003CAppShell>`\n\nThe root of a screen inside the product's chrome: header, user menu and side navigation. Use `\u003CScreen>` for a screen outside it (signed out).\n\n- `id: string` — The shell's id; its user menu's elements are `\u003Cid>.user`, `\u003Cid>.account`, `\u003Cid>.settings` (with `settings`) and `\u003Cid>.sign-out`.\n- `product?: string` — The product's name in the header; prototype.json's `name` by default.\n- `user: AppShellUser` — The signed-in user the header shows.\n- `nav: NavigationItem[]` — The side navigation's entries.\n- `account: string` — The screen the user menu's Account entry opens.\n- `settings?: string` — The screen the user menu's Settings entry opens. Leave it out when the application has nothing to set: the menu then has no Settings entry.\n- `signOut: string` — The screen Sign out leads to: a signed-out screen, drawn on a bare `\u003CScreen>`.\n- `menu?: NavigationItem[]` — More user-menu entries (a profile, billing), drawn after Account (and Settings) and before Sign out.\n- `children?: ReactNode` — The screen's content.\n\n#### `AppShellUser`\n\n- `name: string`\n- `email?: string` — Shown under the name in the user menu.\n- `role?: string` — The role beside the name; the viewing role's name in prototype.json by default, so a role switch shows in the header.\n\n#### `\u003CScreen>`\n\nThe root of a screen outside the app shell (signed out, a landing page): its content, and navigation if any.\n\n- `nav?: ReactNode` — Navigation for an app drawn without `\u003CAppShell>`: one `\u003CNavigation>`, usually shared by every screen.\n- `children?: ReactNode`\n\n#### `\u003CSection>`\n\nA titled part of a screen — a table, a form, a group of stats — with the actions that belong to it.\n\n- `id: string`\n- `title: string`\n- `subtitle?: string` — One line under the title: what the section holds or why.\n- `count?: number` — How many records the section lists, shown beside the title.\n- `actions?: ReactNode` — The section's own Buttons (\"New request\" above the requests it adds to).\n- `children?: ReactNode`\n\n#### `\u003CStack>`\n\nChildren in a column (default) or a wrapping row.\n\n- `direction?: \"row\" | \"column\"`\n- `children?: ReactNode`\n\n#### `\u003CGrid>`\n\nChildren in 1–6 equal columns.\n\n- `columns: number` — 1–6 equal columns (one column on a narrow window).\n- `children?: ReactNode`\n\n#### `\u003CSplit>`\n\nTwo panes side by side (stacked on a narrow window).\n\n- `left: ReactNode`\n- `right: ReactNode`\n- `ratio?: number` — The left pane's share of 12 columns (default 6).\n\n#### `\u003CDetail>`\n\nA read-only record: label\u002Fvalue pairs.\n\n- `id: string`\n- `title?: string`\n- `fields: DetailField[]`\n\n#### `DetailField`\n\n- `label: string`\n- `value: string`\n\n### Navigation\n\n#### `\u003CNavigation>`\n\nNavigation for an app drawn on `\u003CScreen nav>` (`\u003CAppShell nav>` draws its own). Its items are what a reviewer points at.\n\n- `id: string`\n- `layout: \"side\" | \"top\"`\n- `items: NavigationItem[]`\n\n#### `NavigationItem`\n\n- `id: string`\n- `label: string`\n- `to: string` — The screen the entry opens; it shows as active there.\n\n#### `\u003CBreadcrumbs>`\n\nA trail back to where the reviewer came from.\n\n- `id: string`\n- `items: BreadcrumbItem[]` — The trail, root first.\n\n#### `BreadcrumbItem`\n\n- `id: string`\n- `label: string`\n- `to?: string` — Where the crumb leads; the last crumb is the current page and takes none.\n- `params?: Record\u003Cstring, string>`\n\n#### `\u003CTabs>`\n\nTabbed panels. Each tab header is an element a reviewer can point at (its `id`); the Tabs itself is layout.\n\n- `id: string`\n- `tabs: Panel[]`\n- `active?: string` — The open tab, when the screen controls it; the first tab otherwise.\n- `onChange?: ((tabId: string) => void)`\n\n#### `\u003CStepper>`\n\nA multi-step wizard. Each step header is an element a reviewer can point at (its `id`).\n\n- `id: string`\n- `steps: Panel[]`\n- `active?: string` — The current step, when the screen controls it (a Next button); the first step otherwise.\n- `onChange?: ((stepId: string) => void)`\n\n#### `Panel`\n\n- `id: string`\n- `label: string`\n- `content: ReactNode`\n\n### Content\n\n#### `\u003CHeading>`\n\nA page or section title, with the actions beside it.\n\n- `id: string`\n- `text: string`\n- `level?: \"page\" | \"section\"` — `page` (default) for a screen's title; `section` titles a part of it. Prefer `\u003CSection>` for a part with its own actions or records.\n- `actions?: ReactNode` — Buttons and Links beside the heading.\n\n#### `\u003CText>`\n\nA paragraph of body text.\n\n- `id: string`\n- `text: string`\n- `tone?: \"primary\" | \"secondary\"` — `secondary` (default) for body copy, `primary` for emphasis.\n\n#### `\u003CBadge>`\n\nA status chip.\n\n- `id: string`\n- `label: string`\n- `tone?: Tone`\n\n#### `\u003CStat>`\n\nA headline number with its label. Put a screen's stats side by side in a `\u003CStatGroup>`.\n\n- `id: string`\n- `label: string`\n- `value: string`\n- `hint?: string` — A short line under the value that gives it scale or context: \"of 20 days\", \"3 due this week\".\n- `icon?: StatIcon` — An icon beside the label.\n- `tone?: Tone` — Colours the icon (`default` is the theme's primary).\n\n#### `StatIcon` = `\"Activity\" | \"Bell\" | \"Briefcase\" | \"Bug\" | \"Building2\" | \"Calendar\" | \"CalendarCheck\" | \"CalendarClock\" | \"CalendarDays\" | \"ChartColumn\" | \"CircleCheck\" | \"CircleX\" | \"ClipboardList\" | \"Clock\" | \"Cloud\" | \"Cpu\" | \"CreditCard\" | \"Database\" | \"DollarSign\" | \"FileText\" | \"Gauge\" | \"Globe\" | \"HeartPulse\" | \"Hourglass\" | \"Inbox\" | \"Layers\" | \"ListChecks\" | \"Lock\" | \"Mail\" | \"MessageSquare\" | \"Package\" | \"Plane\" | \"Receipt\" | \"Rocket\" | \"Server\" | \"Shield\" | \"ShoppingCart\" | \"Star\" | \"Tag\" | \"Ticket\" | \"Timer\" | \"TrendingDown\" | \"TrendingUp\" | \"TriangleAlert\" | \"Truck\" | \"User\" | \"UserCheck\" | \"Users\" | \"Wallet\" | \"Zap\"`\n\nThe icons a `\u003CStat>` may show, named as in WSO2's Oxygen icon set (Lucide's names). A theme draws each or none; an unknown name fails the check.\n\n#### `\u003CStatGroup>`\n\nA row of `\u003CStat>`s at equal widths, wrapping on a narrow window.\n\n- `children?: ReactNode` — The `\u003CStat>`s, in reading order.\n\n#### `\u003CAlert>`\n\nA callout: info, success, warning or error.\n\n- `id: string`\n- `tone: Tone`\n- `title?: string`\n- `text: string`\n\n#### `\u003CEmptyState>`\n\nWhat a list shows when there is nothing in it.\n\n- `id: string`\n- `title: string`\n- `text: string`\n- `actions?: ReactNode` — The Buttons that start something.\n\n#### `\u003CButton>`\n\nA button. Give it `to` to navigate, `onPress` to do anything else, `submit` to submit its form.\n\n- `id: string`\n- `label: string`\n- `emphasis?: \"primary\" | \"danger\"` — `primary` for the screen's main action, `danger` for a destructive one; outlined otherwise.\n- `disabled?: boolean`\n- `submit?: boolean` — Submits the enclosing `\u003CForm>` (which validates its fields, then calls its `onSubmit`).\n- `to?: string` — Navigate to this screen when pressed. Prefer it to `onPress` for plain navigation: the checks verify it.\n- `params?: Record\u003Cstring, string>` — The params `to` carries, read on the target with `useParams`.\n- `onPress?: (() => void)` — Run when pressed: change mock data, open a dialog, navigate conditionally.\n\n#### `\u003CLink>`\n\nAn inline link; presses like a Button.\n\n- `id: string`\n- `label: string`\n- `to?: string` — Navigate to this screen when pressed. Prefer it to `onPress` for plain navigation: the checks verify it.\n- `params?: Record\u003Cstring, string>` — The params `to` carries, read on the target with `useParams`.\n- `onPress?: (() => void)` — Run when pressed: change mock data, open a dialog, navigate conditionally.\n\n#### `Tone` = `\"default\" | \"info\" | \"success\" | \"warning\" | \"error\"`\n\n#### `Pressable`\n\n- `to?: string` — Navigate to this screen when pressed. Prefer it to `onPress` for plain navigation: the checks verify it.\n- `params?: Record\u003Cstring, string>` — The params `to` carries, read on the target with `useParams`.\n- `onPress?: (() => void)` — Run when pressed: change mock data, open a dialog, navigate conditionally.\n\n### Forms\n\n#### `\u003CForm>`\n\nA form card: its Fields, then its action Buttons. Validates on submit.\n\n- `id: string`\n- `title?: string`\n- `children?: ReactNode` — Its Fields.\n- `actions?: ReactNode` — Its Buttons, under the fields; a `\u003CButton submit>` submits.\n- `onSubmit?: ((values: Record\u003Cstring, string>) => void)` — Called with every field's value, keyed by name, when a submit passes validation.\n\n#### `\u003CField>`\n\nOne input. It holds what is typed into it; inside a Form, the Form validates and submits it.\n\n- `id: string`\n- `label: string`\n- `name?: string` — The key of its value in the enclosing Form's `onSubmit` values (default: its id).\n- `type?: FieldType`\n- `value?: string` — Controls the field: it shows this; with `onChange` it is editable, without it read-only.\n- `defaultValue?: string` — The starting value of a field that holds its own (no `value`). A switch is `on` or `off`.\n- `options?: string[]` — A select's choices.\n- `error?: string` — A problem to show regardless of validation (e.g. in a validation-error display state).\n- `required?: boolean`\n- `pattern?: string` — A regular expression the whole value must match when it is not empty.\n- `patternMessage?: string` — What a value that does not match `pattern` shows.\n- `placeholder?: string`\n- `onChange?: ((value: string) => void)`\n\n#### `FieldType` = `\"number\" | \"text\" | \"select\" | \"date\" | \"textarea\" | \"switch\"`\n\n#### `\u003CFilters>`\n\nA filter bar above a list.\n\n- `id: string`\n- `children?: ReactNode` — Its Fields, laid out compactly in a row.\n\n#### `\u003CValidationSummary>`\n\nThe problems a failed submit shows, for a display state that shows them without a submit.\n\n- `id: string`\n- `issues: string[]`\n\n### Data\n\n#### `\u003CTable>`\n\nA table of records.\n\n- `id: string`\n- `title?: string`\n- `columns: (string | TableColumn)[]`\n- `rows: TableRow[]`\n- `onRowPress?: ((rowId: string) => void)` — Run when a row is pressed, with its id; a row with neither this nor `to` is only highlighted.\n- `empty?: ReactNode` — What an empty table shows instead (an `\u003CEmptyState>`).\n\n#### `TableColumn`\n\n- `label: string`\n- `kind?: \"number\" | \"text\" | \"status\"` — `text` (default); `number` aligns figures to the right; `status` shows each row's `status` as a badge (one per table). A plain string is a `text` column.\n\n#### `TableRow`\n\n- `id: string` — The row's element id: unique on the screen (prefix it with the table's).\n- `cells: string[]` — One per `text` or `number` column, in column order; the status column takes `status`.\n- `status?: TableStatus` — The badge in the table's status column.\n- `actions?: TableAction[]` — What can be done to this record, drawn as buttons in a trailing column; pressing one does not press the row.\n- `tone?: Tone` — Colours the last cell as a status, in a table without a status column. Prefer `status`.\n- `to?: string` — Open this screen when the row is pressed.\n- `params?: Record\u003Cstring, string>`\n\n#### `TableStatus`\n\n- `text: string`\n- `tone: Tone`\n\n#### `TableAction`\n\n- `id: string` — The action's element id: unique on the screen (prefix it with the row's).\n- `label: string`\n- `emphasis?: \"danger\"` — `danger` for a destructive action.\n- `to?: string` — Navigate to this screen when pressed. Prefer it to `onPress` for plain navigation: the checks verify it.\n- `params?: Record\u003Cstring, string>` — The params `to` carries, read on the target with `useParams`.\n- `onPress?: (() => void)` — Run when pressed: change mock data, open a dialog, navigate conditionally.\n\n#### `\u003CTimeline>`\n\nAn activity history.\n\n- `id: string`\n- `title?: string`\n- `entries: TimelineEntry[]` — Newest first.\n\n#### `TimelineEntry`\n\n- `when: string`\n- `who: string`\n- `text: string`\n\n### Overlays\n\n#### `\u003CDialog>`\n\nA modal.\n\n- `id: string`\n- `title: string`\n- `open: boolean`\n- `onClose: () => void`\n- `children?: ReactNode`\n- `actions?: ReactNode` — Its Buttons, at the bottom.\n\n#### `\u003CDrawer>`\n\nA side panel.\n\n- `id: string`\n- `title: string`\n- `open: boolean`\n- `onClose: () => void`\n- `children?: ReactNode`\n\n### Finding codes\n\n`prototype check --json` prints `{ ok, findings: [{ code, file, location, message }] }` and exits 1 when there are findings.\n\n| Code | Meaning |\n|---|---|\n| `MISSING_FILE` | prototype.json or prototype.tsx is not in the folder. |\n| `SCHEMA_VIOLATION` | prototype.json is not JSON, or does not have the manifest's shape. |\n| `UNSUPPORTED_VERSION` | prototype.json's schemaVersion is not 3. |\n| `DUPLICATE_ID` | A role, state, screen or flow id repeats another; the four share one namespace. |\n| `UNKNOWN_REFERENCE` | A manifest reference names nothing, or a flow step its role cannot reach. |\n| `SYNTAX_ERROR` | prototype.tsx does not parse. |\n| `FORBIDDEN_IMPORT` | An import other than react and @wso2\u002Fprototype-kit, a dynamic import(), or require. |\n| `FORBIDDEN_API` | A browser, network, storage, code-generation or nondeterministic API. |\n| `FORBIDDEN_ELEMENT` | A raw HTML element; screens are drawn with kit components only. |\n| `SOURCE_TOO_LARGE` | prototype.tsx is over the size cap. |\n| `NO_APP` | prototype.tsx does not `export default defineApp({ screens, data })`. |\n| `SCREEN_MISMATCH` | defineApp's screens are not exactly the manifest's screens. |\n| `UNKNOWN_NAV_TARGET` | A `to` or `go()` names a screen that does not exist, or one the viewing role cannot reach. |\n| `TYPE_ERROR` | prototype.tsx does not type-check: it reads a property, prop or name its types do not have, or passes a value of the wrong type. |\n| `RENDER_FAILED` | The module, or a screen for some role and display state, throws or runs too long. |\n| `DUPLICATE_ELEMENT_ID` | Two elements on one screen share an id. |\n\u003C!-- kit:end -->\n\n## Mock data\n\nRecords are part of the source and never generated at render time, so write\nthem out in full:\n\n- **Shaped by the data model.** Each collection in `defineApp({ data })` is\n  an entity of `domain-model.md`, and each record has that entity's\n  attributes. Columns, detail fields and form fields are those attributes, in\n  words a user reads (`submittedAt` becomes \"Submitted\"). A value has the type\n  the model gives it: an enum value is one of its values, an amount reads as\n  an amount. A relation shows as the related record's name, not its id. Type\n  the records after the entity (`interface Expense { … }`).\n- **Realistic.** Plausible names, amounts, dates and statuses for the domain;\n  never `foo`, `test`, `Lorem ipsum` or `Item 1`.\n- **Deterministic.** The same design gives the same records: fixed values, no\n  randomness, no \"today\" other than `useToday()`. A row's id is derived from the\n  record (`expense.1042`).\n- Enough rows to read as real (three to six), and a state in which a list is\n  empty when the story has one.\n\n## Stable ids\n\nManifest ids and element ids (the `id` of every kit component) are identities,\nlabels are not: a reviewer's annotations point at element ids, and shared\nlinks name screens, flows and states, so:\n\n- Name them `\u003Ckind>.\u003Cslug>` from what the thing is (`screen.queue`,\n  `btn.approve`, `field.amount`), except role ids, which are `security.json`'s\n  names. An element id is unique on its screen; a row's id is prefixed with\n  its table's kind (`expense.1042`).\n- **Revising an existing prototype keeps every key and id whose thing still\n  exists.** Rename labels freely; change an id only when its thing is removed\n  or genuinely becomes something else.\n- **Regenerating a prototype that has review comments** (`\u002Fprototype` on a\n  reviewed design) is a revision like any other: edits, ids kept. Leave\n  `specs\u002Fdesign\u002Freview.json` as it is. Its comments stay open for Address\n  comments, and the file's Checked mark clears by itself when the prototype\n  changes.\n\n## Closing\n\nWhen a prototype passes its checks, report it in one chat line: its screen\ncount and flow count, then each story you set aside and anything from the\ndesign you could not show, with the reason.\n",{"name":5,"metadata":24,"description":7},{"aep":25},{"kind":26,"audience":27},"platform",[28,29],"design","coding","main","e3b5fc8668f26761380b2d4965719f2d8f2eb246","skills\u002Fprototype","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer","https:\u002F\u002Fgithub.com\u002Fwso2","https:\u002F\u002Fwso2.com","Welcome to the WSO2 source code! For info on working with the WSO2 repositories and contributing code, click the link below.","2026-11-11 15:36:27",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add wso2\u002Flabs-agentic-engineer --skill prototype",{"tool":44,"command":45},"bunx","bunx skills add wso2\u002Flabs-agentic-engineer --skill prototype",{"tool":47,"command":48},"pnpm","pnpm dlx skills add wso2\u002Flabs-agentic-engineer --skill prototype","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fprototype\u002FSKILL.md",true,[52],{"path":53,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Fimplementing.md","REFERENCE","参考文档",9901,"https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fprototype\u002Freferences\u002Fimplementing.md",[59,66,73,80,87,94],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M735MP9NFFRPS260G9D16JQX","validation-task","Load when working a VALIDATION task dispatched by WSO2 Labs Agentic Engineer — judging a deployed version against its acceptance criteria.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fvalidation-task\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M735MJ8ZMRZR20A57TMF7R9Q","thunder-authentication","Apply when a component sits on the project's sign-in — a SPA whose users authenticate through the auth platform-resource dependency, or a protected backend those signed-in users call.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fthunder-authentication\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M735MFQMY8DY1EM7JKS784D3","task-planning","Use when planning a version's build from a design — the plan turn that writes the build's checklist with planBuild, one item per feature the version carries in build order, after a Foundation item when the version needs one.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Ftask-planning\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M735MCJQ4EVH7G4ZFMC682Y4","start","Use when kicking off a project from its idea — the product pass that agrees the feature list and writes the product page, the product-wide page and a stub per feature — or re-running \u002Fstart on a project that already has requirements.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fstart\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M735M9R050KT3H34PVXN2MKK","security-design","Write specs\u002Fdesign\u002Fsecurity.json when a design has sign-in, permissions, roles or test users — the permission catalog every API operation is gated on.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fsecurity-design\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M735M60CTW4S7XMS6XCX9A7Y","resolve-dependency","Use for taking one external dependency from open to resolved — `\u002Fresolve-dependency \u003Cname> [answer]` names it and may carry the provider the user chose; `\u002Fresolve-dependencies` walks every open one in turn. Ask which provider (their suggestions as options; never choose for them), get its interface on disk (found, uploaded from the card, or assumed under the authorization the card records), then derive the config keys.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fresolve-dependency\u002FSKILL.md",[],[]]