From d7de178510f17e5a062607e7eb882b4da6c98353 Mon Sep 17 00:00:00 2001 From: rmojica-godaddy Date: Tue, 20 Oct 2026 10:37:06 -0500 Subject: [PATCH 1/4] feat(skills): add antares-builder consumer skill --- .agents/skills/antares-builder/SKILL.md | 44 ++++ .../antares-builder/references/charts.md | 129 ++++++++++ .../references/component-decision-tree.md | 72 ++++++ .../references/composition-patterns.md | 224 ++++++++++++++++++ .../references/layout-and-styling.md | 53 +++++ .../antares-builder/references/setup.md | 47 ++++ .claude/skills/antares-builder | 1 + 7 files changed, 570 insertions(+) create mode 100644 .agents/skills/antares-builder/SKILL.md create mode 100644 .agents/skills/antares-builder/references/charts.md create mode 100644 .agents/skills/antares-builder/references/component-decision-tree.md create mode 100644 .agents/skills/antares-builder/references/composition-patterns.md create mode 100644 .agents/skills/antares-builder/references/layout-and-styling.md create mode 100644 .agents/skills/antares-builder/references/setup.md create mode 120000 .claude/skills/antares-builder diff --git a/.agents/skills/antares-builder/SKILL.md b/.agents/skills/antares-builder/SKILL.md new file mode 100644 index 0000000000..9fdb4afdf0 --- /dev/null +++ b/.agents/skills/antares-builder/SKILL.md @@ -0,0 +1,44 @@ +--- +name: antares-builder +description: Build, adapt, or review React interfaces with @godaddy/antares. Use for component selection and composition, forms, accessible interactions, responsive layouts, charts, and consumer setup. Do not use for authoring the Antares library itself. +--- + +# Antares Builder + +Build consumer UI with the public `@godaddy/antares` API. Choose the interaction before its appearance. Many components use React Aria Components (RAC); Antares's own exports, props and slots define the consumer contract. + +Follow the steps relevant to the request. Load only the reference sections needed for the selected feature. + +## Step 1 — Read the project context + +Inspect `package.json`, the lockfile, framework configuration and neighboring UI. Identify the Antares version, package manager, routing, form library, CSS conventions and locale. Preserve those conventions when adapting existing UI. + +Check the installed package's public exports/types before using an unfamiliar API. Follow [API and documentation discovery](references/setup.md#resolve-the-installed-api-and-documentation) for commands, official sources and mismatches; a consumer may not have the library's source checkout. Adapt these references to that installed API. For installation, imports, CSS failures or server/client boundaries, read the relevant setup sections. + +Use public root or subpath imports. Do not derive Antares APIs from another design system or import `#components/*`, `dist` files or transitive internals. + +## Step 2 — Choose the component by behavior + +Identify the action, value, navigation or information the user needs. Read the relevant branch of the [component decision tree](references/component-decision-tree.md) when choosing a component or comparing alternatives. If Antares has no matching export, use the application's established solution or semantic HTML and explain the gap. + +## Step 3 — Arrange and style the interface + +For page structure, responsive behavior, typography, icons or sizing, read [layout and styling](references/layout-and-styling.md). Prefer Antares's existing variants and layout primitives. Responsive changes use the application's CSS media/container queries; Antares has no breakpoint prop syntax or mandatory provider. + +## Step 4 — Compose the selected components + +Read the relevant [composition patterns](references/composition-patterns.md) for slots and state, collections, disclosures, tabs, overlays, files or feedback. For any chart implementation or customization, read [charts](references/charts.md). Include the required children and wire controlled callbacks. A RAC base provides behavior but does not render missing Antares parts. + +## Step 5 — Build complete forms + +For form UI, follow [fields and validation](references/composition-patterns.md#fields-and-validation), then the selection, date or file sections as needed. Field roots own validation and relationships; `Input` and `TextArea` are controls within them. Integrate with the application's submission and error handling rather than introducing a second form architecture. + +## Step 6 — Supply the accessibility the app owns + +Provide visible field labels, names for icon-only controls and collections, suitable heading levels and image alternatives. Preserve the selected component's keyboard model, focus indicator and DOM semantics. For dialogs, follow the title, dismissal and focus contracts in [modal layers](references/composition-patterns.md#modal-layers). Check locale/RTL when the feature depends on direction or date/number formatting. + +## Step 7 — Verify and deliver + +Use the consumer project's task runner for appropriate type, lint, build and meaningful interaction checks. Verify labels, validation, overlay focus/return, loading/empty states and narrow layouts for the changed feature. Advice-only requests need focused API inspection rather than unrelated tasks. + +For implementation, deliver runnable code with real imports and data flow, then briefly explain the component choices and any gap. For review, report actionable findings and minimal fixes. diff --git a/.agents/skills/antares-builder/references/charts.md b/.agents/skills/antares-builder/references/charts.md new file mode 100644 index 0000000000..9a32c9abc5 --- /dev/null +++ b/.agents/skills/antares-builder/references/charts.md @@ -0,0 +1,129 @@ +# Charts + +Read this for any chart implementation, conversion or customization. Check the installed chart props before adapting these patterns. Import `BarChart`, `LineChart`, `DonutChart` and `GaugeChart` from the package root or `@godaddy/antares/Chart`. `Chart` is a public subpath, not a generic chart component. Bar/Line/Donut use Visx; Gauge uses Antares SVG. Do not import internal legends, tooltips or Visx modules as Antares public API. + +## BarChart: categorical comparisons + +Pass a `series` array of `{ id, name, data }`. The default point shape is `{ x, y }`; custom point shapes need `xAccessor` and `yAccessor`. Multiple series produce grouped bars. Use stable series IDs across filtering/reordering. + +Vertical bars use X for categories and Y for values. Horizontal bars reverse that relationship: X must return the numeric value and Y the category. Changing only `orientation` while keeping vertical accessors is insufficient. + +```tsx +import { BarChart } from '@godaddy/antares/Chart'; + +type RegionalRevenuePoint = { region: string; revenue: number }; + +export function RegionalRevenue() { + return ( + + series={[{ + id: 'revenue', + name: 'Revenue', + data: [{ region: 'North America', revenue: 12000 }, { region: 'Europe', revenue: 9000 }] + }]} + orientation="horizontal" + xAccessor={(point) => point.revenue} + yAccessor={(point) => point.region} + xAxisTitle="Revenue (USD)" + yAxisTitle="Region" + height={280} + aria-label="Revenue by region" + desc="North America: 12,000 US dollars. Europe: 9,000 US dollars." + /> + ); +} +``` + +Use `xDomain`/`yDomain` for explicit category order or numeric bounds, matching the orientation. Keep comparison charts on consistent scales. Axis controls include labels, tick formatting, tick counts, baselines and gridlines. Series support palette `colorIndex`, per-category `categoryColors` and `opacity`; preserve meaningful labels alongside color. + +## LineChart: continuous and time trends + +Pass series with points in intended X order. Use `xType="time"` for Date values, `"linear"` for numeric X, or `"band"` for discrete labels. Custom data requires both accessors. Preserve missing observations as `y: null` rather than inventing zeros. Use `xTitle`/`yTitle`; these differ from BarChart's `xAxisTitle`/`yAxisTitle`. + +```tsx +import { LineChart } from '@godaddy/antares/Chart'; + +export function MonthlyRevenue() { + return ( + + ); +} +``` + +Check `xDomain`/`yDomain`, tick formatting/values and `xZero`/`yZero` when the scale matters. Zero is inappropriate for log/time scales. Series accept `colorIndex` and `variant="solid" | "dashed" | "dotted"`; do not copy BarChart's category color API onto lines. + +## DonutChart: parts of a whole + +Pass `data` containing `{ id, name, value }`, with numeric non-negative values, and a required center `label`; `subLabel` is optional. This is not the Bar/Line `series` API. Prefer a small set of categories that actually form a whole. + +```tsx +import { DonutChart } from '@godaddy/antares/Chart'; + +export function TrafficSources() { + return ( + + ); +} +``` + +`legend` accepts `"bottom"` or `"right"`; `formatValue` formats slice values. Zero/negative slices are omitted from the ring. Handle an empty/all-zero total explicitly. `smallSliceThreshold` groups adjacent small slices in hover feedback; it does not aggregate or rewrite the application's dataset. + +## GaugeChart: one value on a known scale + +Provide numeric `value`, visible `label` and an accessible name. Continuous mode uses 0–100. Segmented mode uses 0–`segments`; `segments` must be a finite positive integer or the component throws. Values are clamped, so keep the displayed label consistent with the intended scale. + +```tsx +import { GaugeChart } from '@godaddy/antares/Chart'; + +export function HealthScore() { + return ( + + ); +} +``` + +Omit `segments` for continuous mode. Normalize a different measurement range in application code rather than inventing min/max props. `rangeLabel` requires both min/max display labels; it does not change the numeric scale. Use `labelType="text"` for a short textual center label. Gauge exposes meter semantics; task completion belongs to ProgressBar/CircularProgress. + +## Dimensions, legends and tooltips + +Bar/Line measure their container and accept numeric `width`/`height`; ensure usable non-zero dimensions before diagnosing absent data. They scroll when their minimum plot size exceeds available space, with behavior depending on orientation. Avoid adding a competing scroll/axis system. Donut/Gauge size from container width; constrain their parent or max width to suit the layout. Test the actual dashboard cell at narrow widths. + +Bar/Line use `legendPosition="top" | "bottom" | null`; the default shows a bottom legend for multiple series. Their `tooltipValueFormatter` receives a datum, not a numeric value alone. Custom `renderTooltip` payloads differ: use the public `BarChartTooltipRenderProps`/`BarChartTooltipSeries` or `LineChartTooltipRenderProps` types. Do not replace built-in tooltip behavior unless the product needs custom content. + +## Accessibility and data states + +Supply `aria-label` and meaningful series/category/unit labels. Bar/Line also accept `desc`. Make the essential values or takeaway available in nearby text or a semantic table when users need them; do not rely on pointer tooltips or color alone. Verify actual keyboard/assistive behavior instead of assuming every Visx graphic inherits RAC collection behavior. Use the application's locale for dates, numbers and currencies, and check RTL layouts when applicable. + +Handle loading, no data, single-point/single-slice data, missing values, long labels and large datasets according to the product. Validate finite values/accessors and domain coverage. Preserve missing versus zero semantics; avoid rendering an empty frame as if it were a valid result. Do not change the library's component internals to solve a consumer data-formatting issue. diff --git a/.agents/skills/antares-builder/references/component-decision-tree.md b/.agents/skills/antares-builder/references/component-decision-tree.md new file mode 100644 index 0000000000..f0ed4aab08 --- /dev/null +++ b/.agents/skills/antares-builder/references/component-decision-tree.md @@ -0,0 +1,72 @@ +# Component decision tree + +Use this when the user has not named a component, when alternatives overlap, or when replacing custom UI. Choose the interaction first. Follow the linked patterns for anatomy, state and required children. + +## 1. Is the user entering or selecting a value? + +For field composition, read [fields and validation](composition-patterns.md#fields-and-validation). + +- Short text, email, search or password → `TextField` with `Input`. +- Multiline text → `TextField` with `TextArea`. +- Exact number, currency or stepper → `NumberField`; bounded continuous adjustment → `RangeField`. +- Independent boolean or agreement → `Checkbox`; related independent options → `CheckboxGroup`. +- Immediate on/off setting → `Switch`; one answer among visible form options → `RadioGroup` with `Radio`. +- Popup form selection → `Select`; an always-visible selectable collection → `ListBox`. For autocomplete/free-text filtering, see the API gaps below. +- Compact exclusive view/mode → `SegmentedController`; contextual pressed actions such as Bold/Italic → `ToggleButtonGroup` with `ToggleButton`. +- Selectable/removable pills → `ChipGroup`; a standalone pill action → `ChipButton`. See [collections](composition-patterns.md#collections-and-actions). +- Date grid always visible → `Calendar` or `RangeCalendar`; compact field opening a grid → `DatePicker` or `DateRangePicker`. See [dates](composition-patterns.md#dates-and-locale). +- Browse for files → `FileTrigger`; drag/drop target → `DropZone`. The app handles validation/upload. See [file input](composition-patterns.md#file-input). + +## 2. Is this an action or navigation? + +- Perform an action → `Button`; navigate with button styling → `LinkButton`. +- Dismiss an overlay → `CloseButton`; enhance an existing visual child with press behavior → `Pressable`. +- Choose a command from an action list → `MenuTrigger` with `Menu`; use a Popover for a general interactive form. +- Static/linked content surface → `Card`; selectable/action card collection → `CardGroup`. + +Read [actions and slots](composition-patterns.md#actions-slots-and-state) or [collections](composition-patterns.md#collections-and-actions) for these structures. Ordinary inline links use semantic anchors or the application's router link. + +## 3. Is content revealed, switched or layered? + +- Reveal one section in place → `Collapsible`; coordinate related sections → `Accordion`. +- Expand a rail/panel within page flow → `InlineDrawer`. +- Replace peer panels in one view → `Tabs`. +- Communicate wizard stages → `ProgressSteps` with `ProgressStep`. +- Move through a dataset's pages → `Pagination`; decorative page omissions → `PaginationDots`. +- Browse sequential gallery/feature panels → `Carousel`. + +See [disclosure and tabs](composition-patterns.md#disclosure-and-tabs) and [progress, pagination and feedback](composition-patterns.md#progress-pagination-and-feedback). + +For layered content, read [modal layers](composition-patterns.md#modal-layers): + +- Non-interactive hover/focus help → `TooltipTrigger` with `Tooltip`. +- Anchored interactive content → `PopoverTrigger` with `Popover`. +- Blocking centered task/confirmation → `ModalTrigger` with `Modal`. +- Modal edge panel or bottom sheet → `DrawerTrigger` with `Drawer`. + +## 4. Is this information, feedback or data? + +- In-page live message → `Alert`; field validation → `FieldError` inside its field. +- Static status/category → `Tag`; selection/removal belongs to Chip. +- Operation progress → `ProgressBar` or compact `CircularProgress`; a numeric input belongs to RangeField. +- Text-first KPI/trend → `MetricsLockup`. +- Category comparison → `BarChart`; continuous/time trend → `LineChart`; few parts of a whole → `DonutChart`; one measure against a scale → `GaugeChart`. + +Read [charts](charts.md) for chart data/accessors, dimensions, axes, legends and accessibility; read [progress, pagination and feedback](composition-patterns.md#progress-pagination-and-feedback) for feedback and navigation contracts. + +For content presentation, read [layout and styling](layout-and-styling.md): + +- Body/secondary copy → `Text`/`Detail`; semantic title → `Heading`; coordinated eyebrow/title/body → `TextLockup`. +- Person/entity identity → `Avatar`; image → `Image`; Antares SVG → `Icon`. + +## 5. How should it be arranged? + +Read [layout and styling](layout-and-styling.md) for composition and responsive rules. + +- One-dimensional row/column → `Flex`; two-dimensional placement → `Grid`; surface/semantic wrapper → `Box`. +- Interior regions → `Header`, `Content`, `Footer`, `ButtonGroup`, `Group`, `CornerActions`. +- Consistent adopted component size → optional `SizeProvider`. + +## API gaps + +Do not infer Antares exports such as `Combobox`, `Table`, `Toast`, `Skeleton`, `EmptyState`, `NativeSelect`, `Link`, `Breadcrumb`, `Sidebar` or `FileUpload` from other libraries. Check the installed export map first. When a required component is unavailable, use semantic HTML or the application's established solution. A separate RAC dependency is an option when its API and styling fit the requirement; it does not create an Antares export. For empty states, Antares typography, media, actions and layout can form a suitable composition. diff --git a/.agents/skills/antares-builder/references/composition-patterns.md b/.agents/skills/antares-builder/references/composition-patterns.md new file mode 100644 index 0000000000..b257ba6576 --- /dev/null +++ b/.agents/skills/antares-builder/references/composition-patterns.md @@ -0,0 +1,224 @@ +# Antares composition patterns + +Read only the sections relevant to the task. These shapes are verified against the package's component READMEs and examples. Use the consumer's installed types for detailed props and adapt data and handlers to the product. RAC conventions explain behavior but do not replace Antares's explicit children and slots. + +## Actions, slots and state + +`Button` uses RAC button behavior; `LinkButton` uses link behavior. `Pressable` adds press/focus/hover behavior to exactly one child that forwards its ref and DOM/ARIA props, without rendering a wrapper. Prefer the semantic Button/LinkButton when they fit. Name icon-only controls on the control itself. + +Parents publish behavior and presentation through slots. Keep field triggers as `Button slot="trigger"`, steppers as `slot="decrement"`/`slot="increment"`, and dismissal as `slot="close"`. Slot names are parent-specific. `ButtonContext` is an advanced defaults API; ordinary compositions do not require a custom provider. Button omits RAC's `isPending` prop; use application-owned pending state and supported disabled/content props. + +Match the actual state model: field `value`/`onChange`, collection `selectedKeys`/`onSelectionChange`, boolean `isSelected`/`onChange`, and disclosure `isExpanded`/`onExpandedChange` are not interchangeable. Use defaults for uncontrolled state, or update state from the controlled callback; do not combine both modes accidentally. + +## Fields and validation + +`TextField` and `NumberField` provide the field relationship, while children provide visible parts. The field's `isInvalid` state controls whether `FieldError` renders. Use `Text slot="description"` for persistent help. + +Set `name` for native form submission and use supported root props such as `isRequired`, `isDisabled` and `isInvalid`. Keep the application's form/validation library and connect its state to the exact Antares value/change API. Place controls in a semantic form and choose submit/reset button types deliberately. The following field fragments assume `emailError` comes from that validation state. + +```tsx +import { Button, FieldError, Group, Input, Label, NumberField, Text, TextArea, TextField } from '@godaddy/antares'; + + + + + We'll send receipts here. + {emailError} +; + + + +