# CodedDesign for agents Cartoon React design system. Package: @kenselasie/codeddesign 0.1.5 Catalog: this repo. Public npm. Do not use GitHub Packages. ## Install npm install @kenselasie/codeddesign Peers: react@^19, react-dom@^19, @stylexjs/stylex@0.19.1 ## Skill Same SKILL.md for every coding agent (Cursor, Claude, Codex, and others). Copy it into codeddesign/SKILL.md under the agent's skills folder: - .agents/skills/codeddesign/ - .cursor/skills/codeddesign/ - .claude/skills/codeddesign/ - .codex/skills/codeddesign/ ## First render ```tsx import "@kenselasie/codeddesign/styles.css"; import { Button } from "@kenselasie/codeddesign"; ``` The consuming app does not need the StyleX compiler to render components. ## Theme ```tsx import * as stylex from "@stylexjs/stylex"; import { darkTheme, palettes } from "@kenselasie/codeddesign/theme";
{children}
{children}
import { markerPalettes, markerType, markerRadii, markerStroke, markerShadows } from "@kenselasie/codeddesign/theme";
{children}
import { edwaPalettes, edwaType, edwaRadii, edwaStroke, edwaShadows } from "@kenselasie/codeddesign/theme";
{children}
``` Worlds: codedcartoony, codedmarker, codededwadzi. CodedCartoony palettes: paper, nord, solarized, catppuccin. CodedMarker palettes: highlighter, magenta, cyan, amber. CodedEdwadzi palettes: coastal, coral, forest, sand. Each palette has light and dark. Fonts: Fredoka in codedcartoony; Archivo 900 in codedmarker; Fraunces in codededwadzi; Nunito in codedcartoony; Archivo in codedmarker; Inter + JetBrains Mono in codededwadzi. Ink #2a2438 on paper #fff7ef. Radii: s 10px, m 16px, l 22px, pill. Space: xxs 4, xs 8, s 12, m 16, l 24, xl 32, xxl 48. Shadows: codedcartoony: offset + blur (s1–s4). codedmarker: hard ink offset, no blur. codededwadzi: soft editorial blur.. Color roles: background, white, black, steel, concrete, blue, blueLight, blueDark, whale, whaleLight, whaleDark, smoke, smokeDark, smokeDarker, snow, snowDark, snowDarker, success, danger, dangerDark, warning, warningDark, green, greenLight, greenDark, turquoise, turquoiseLight, turquoiseDark, pink, pinkLight, pinkDark, onAccent, onPastel, well, onWell. Icon names: check, x, search, info, alert, chevron, chevronLeft, chevronRight, plus, minus, copy, calendar, paperclip, file, image, more, menu, terminal, globe, message, user, settings, home, grid, compass, wallet, help, logout, book, document, checkCircle, xCircle, upload, download, arrowUpRight, branch, spark, grip. ## System design Compose product UIs — social, dashboards, settings, onboarding — from tokens, atoms, molecules, and recipes. Surfaces below are the customization contract for humans and agents. ## Layers ### Tokens Color, type, space, radii, shadows. Remap with worlds and palettes from @kenselasie/codeddesign/theme. ### Atoms Single-purpose controls: Button, TextField, Icon, Tag, Avatar, Checkbox, Toggle, Link. ### Molecules Small compositions: Card + CardHeader, Item + ItemGroup, SearchInput, ToggleButton, Step, InputGroup. ### Recipes Copy-paste screens from @kenselasie/codeddesign/agent recipes. Prefer a recipe before inventing a layout. ### Product shells Full surfaces below. Pass data and callbacks as props. Swap tone with a world/palette, not CSS rewrites. ## Surfaces ### Split hero Split layout: configure on one side, live preview on the other. Mode chips drive fields and CTA copy. Compose: - Heading + Body - ToggleButton or Button selected for mode chips - TextField (and DatePicker when needed) - Button variant="primary" for the dynamic CTA - Link for secondary action - Card (or AspectRatio frame) for the preview pane - Sticker or Tag for a URL or status chip Customize: - modes: { label, value }[] for chips - fields: change with selected mode - ctaLabel: string built from inputs - preview: ReactNode — canvas, poster, or empty state - world/palette on the shell for global look Recipe id: `split-hero` ### Process steps Numbered process row of cards with title, description, and footer label. Compose: - Heading + Body for the section intro - Grid of Card with CardTitle + CardContent - Step for linear progress elsewhere; here prefer Card + large Title for the step number Customize: - steps: { number, title, description, footerLabel }[] - columns via Grid Recipe id: `process-steps` ### Activity dashboard Feature or stat cards plus a recent-activity list with avatars and status tags. Compose: - Heading + Body + feature Grid of Card - Button primary for CTA - Card with stats (Heading + Body — do not nest Card) - ItemGroup + Item for activity rows - Avatar + Tag for status Customize: - stats: { label, value, delta }[] - items: { name, meta, status, initials }[] - status → Tag status or Status component Recipe id: `activity-dashboard` ### Feature grid Section of value cards with icon, title, and short body. Compose: - Heading + Body - Grid of Card: Icon + CardTitle + CardContent Customize: - items: { title, description, icon }[] - 2–3 columns on desktop via Grid Recipe id: `feature-grid` ### Create account Centered auth form with account-type toggle, optional SSO, email fields, and primary submit. Compose: - Heading + Body with Link - ToggleButton for Personal / Team - Button default fullWidth for a generic SSO action - TextField stack + Checkbox - Button variant="primary" fullWidth Customize: - accountTypes via ToggleButton options - showSso: boolean - fields and validation stay on TextField Recipe id: `signup` ### Detail cards Two-column detail cards: about, key-value basics, checklist, media slot. Compose: - Heading - Grid of Card - About: CardTitle + Body - Basics: stacked Inline or Item rows for key/value - Checklist: Icon checkCircle / empty + Status - Media: CardTitle + AspectRatio frame for image or map slot Customize: - about: string - basics: { label, value }[] - checks: { label, detail?, done: boolean }[] - media: ReactNode slot Recipe id: `detail-cards` ### App shell Sidebar rail + top search + main page with tabs and empty state. Compose: - AppSidebar with brand, nav groups, create action, and sign out - SearchInput hideLabel shape="pill" in the header - Heading + Tabs - EmptyState when a tab has nothing Customize: - nav: AppSidebar items - tabs: value/label pairs - empty: title + description per tab Recipe id: `app-shell` ## Rules - Customize with props and children first. Do not copy component source into the app. - Change look globally with a world + palette from @kenselasie/codeddesign/theme, not one-off hex in screens. - Pick one world: codedcartoony, codedmarker, or codededwadzi. Do not mix. - Prefer an existing atom or molecule over custom HTML for buttons, fields, chips, tags, tables, and empty states. - ToggleButton is the segmented control (Personal / Team, modes as a compact group). For pill chips that look like tags, use Button selected or Tag. - SearchInput is fluid. In a header or rail: hideLabel and shape="pill". - Card has CardHeader, CardTitle, CardContent, CardActions — compose, do not nest Card inside Card. - Do not nest Form or MessageScroller inside Card. - Do not invent props. Read flattenReference() or package types. - Pass ReactNode slots (preview, media) instead of baking third-party widgets into the design system. ## Rules - Import styles.css once at the app root so Fredoka, Nunito, Archivo, Fraunces, Inter, JetBrains Mono, and tokens land. - Import components from @kenselasie/codeddesign. Do not copy source files into the app. - Pick one world. codedcartoony: Fredoka, Nunito, plush shadows. codedmarker: Archivo, hard ink shadows, neon blocks. codededwadzi: Fraunces, Inter, JetBrains Mono, soft teal/coral paper. Do not mix them or restyle toward shadcn/ui or Ant Design. - The consuming app does not need the StyleX compiler to render components. - Theme with stylex.props from @kenselasie/codeddesign/theme. codedcartoony palettes: paper, nord, solarized, catppuccin. codedmarker: highlighter, magenta, cyan, amber (+ markerType/radii/stroke/shadows). codededwadzi: coastal, coral, forest, sand (+ edwaType/radii/stroke/shadows). Worlds remap tokens only — do not hardcode one world’s chrome into shared components. - Prefer an existing component over custom HTML for buttons, fields, dialogs, tables, and chat. - Do not nest interactive controls inside links. - Do not nest Card, Form, or MessageScroller inside another card. - SearchInput is fluid. In a sidebar or toolbar use hideLabel and shape="pill". - Each export has a catalog page at /components/{id} with live display, recipe, and props. Compose from the package, not from scraping that page. - Do not invent APIs. If a prop is unknown, omit it or read flattenReference() / package types. - For product layouts, follow systemDesign surfaces (split hero, process steps, activity dashboard, feature grid, signup, detail cards, app shell). Customize with props and slots. ## Machine index ```ts import { agentGuide, recipes, components, reference, flattenReference, systemDesign, toSystemDesignMarkdown, toLlmsTxt, agentPrompt, } from "@kenselasie/codeddesign/agent"; ``` ## Recipes (copy these) ### Sign-in Email sign-in with a primary submit. ```tsx import { Form, TextField, Button, FormActions } from "@kenselasie/codeddesign";
``` ### Data table Sortable rows of string records. ```tsx import { DataTable } from "@kenselasie/codeddesign"; ``` ### Chat Assistant and user messages in a scroller. ```tsx import { Message, MessageScroller } from "@kenselasie/codeddesign"; How can I help you today? Show me the overview. ``` ### Empty A screen with nothing to show yet. ```tsx import { EmptyState, Button } from "@kenselasie/codeddesign"; Clear filters} /> ``` ### Saved Inline success or warning after an action. ```tsx import { Alert } from "@kenselasie/codeddesign"; Your changes are up to date. ``` ### Settings tabs Switch panels in a settings or account screen. ```tsx import { Tabs, TabList, Tab, TabPanel, Body } from "@kenselasie/codeddesign"; Account Billing Profile, password, and sessions. Invoices and payment methods. ``` ### Split hero Configure on one side, live preview on the other. Mode chips, fields, and a primary CTA. ```tsx import { Body, Button, Card, CardContent, CardHeader, CardTitle, Heading, Link, Stack, Sticker, TextField, ToggleButton, } from "@kenselasie/codeddesign"; const [mode, setMode] = useState("project"); Start something new. Name it, pick a mode, and see a live preview as you type. Browse templates preview My project Live preview slot — pass your content as children. ``` ### Process steps Numbered process cards with title, description, and a short footer label. ```tsx import { Body, Card, CardContent, CardTitle, Grid, Heading, Stack, Title } from "@kenselasie/codeddesign"; const steps = [ { number: "01", title: "Capture", description: "Collect the inputs you need.", footer: "INPUT" }, { number: "02", title: "Review", description: "Check, edit, and approve.", footer: "CHECK" }, { number: "03", title: "Share", description: "Invite the people who matter.", footer: "TEAM" }, { number: "04", title: "Ship", description: "Publish or hand off the result.", footer: "DONE" }, ]; From first draft to done. {steps.map((step) => ( {step.number} {step.title} {step.description} {step.footer} ))} ``` ### Activity dashboard Stat cards plus a recent-activity list with avatars and status tags. ```tsx import { Avatar, Body, Button, Card, CardContent, CardHeader, CardTitle, Grid, Heading, Item, ItemGroup, Stack, Tag, } from "@kenselasie/codeddesign"; This week at a glance. Active users People who opened the app in the last 7 days. Open tasks Work still waiting on a decision. Recent activity 128 sessions ↑ 12% vs last week 36 tasks done ↑ 8% } actions={Done} /> } actions={New} last /> ``` ### Feature grid Value cards with icon, title, and short description. ```tsx import { Card, CardContent, CardTitle, Grid, Heading, Icon, Stack } from "@kenselasie/codeddesign"; const features = [ { title: "Fast to ship", icon: "spark" as const, body: "Compose screens from recipes, not blank canvases." }, { title: "Clear by default", icon: "checkCircle" as const, body: "Readable type, honest empty states, obvious CTAs." }, { title: "One system", icon: "grip" as const, body: "Same controls for social, dashboards, and settings." }, ]; Why teams reach for it {features.map((item) => ( {item.title} {item.body} ))} ``` ### Create account Account-type toggle, optional SSO, email fields, primary submit. ```tsx import { Body, Button, Checkbox, Heading, Link, Stack, TextField, ToggleButton, } from "@kenselasie/codeddesign"; const [accountType, setAccountType] = useState("personal"); Create your account Already have one? Sign in Email me product updates ``` ### Detail cards About, key-value basics, checklist status, and a media or map slot. ```tsx import { Body, Card, CardContent, CardTitle, Grid, Heading, Icon, Inline, Stack, Status, } from "@kenselasie/codeddesign"; Details About Product design for teams that ship weekly. Checklist Email verified Done Two-factor auth Not yet The basics Timezone UTC Media Slot — pass an image, map, or embed as children. ``` ### App shell Grouped sidebar, primary create action, footer utilities, and a content pane. ```tsx import { AppSidebar } from "@kenselasie/codeddesign"; {}} /> ``` ### Forms Sign-in, profile, and invite forms composed from Form, fields, and actions. ```tsx import { Form, FormActions, FormRow, TextField, TextArea, Select, Switch, Checkbox, Button, } from "@kenselasie/codeddesign";