docs: strengthen RAC convention guidance in AGENTS.md#1929
Conversation
🦋 Changeset detectedLatest commit: 96dfe51 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
https://react-aria.adobe.com/getting-started#working-with-ai also has things that might be useful for folks contributing to Launchpad!
|
|
||
| - **Use existing LaunchPad components and packages** (`@launchpad-ui/components`, `@launchpad-ui/icons`, etc.). Never create a custom component when a LaunchPad equivalent exists. | ||
| - **React Aria Components is the foundation.** Wrap and theme RAC primitives; do not reimplement keyboard/ARIA/focus behavior. The sanctioned escape hatches are `defaultProps`, slots, `useContextProps`, and render-props composition — see https://react-aria.adobe.com/customization. (`docs/adr-008-component-foundation.md`) | ||
| - **React Aria Components is the foundation.** Wrap and theme RAC primitives; do not reimplement keyboard/ARIA/focus behavior. The sanctioned escape hatches are `defaultProps`, slots, `useContextProps`, and render-props composition — see https://react-aria.adobe.com/customization. **Follow RAC's API conventions, not only its behavior:** when adding a prop, variant, or composition pattern, mirror the names and shapes RAC — and its reference implementation, [React Spectrum](https://react-spectrum.adobe.com) — already use (e.g. `description`/`errorMessage` for helper and validation text, `isDisabled`/`isInvalid` booleans, slot-based composition) rather than inventing new ones. Deviate only with a reason noted in the PR. (`docs/adr-008-component-foundation.md`) |
There was a problem hiding this comment.
Not sure how much this matters ultimately, but RAC added markdown versions of all their pages, accessible by appending .md to any URL, like https://react-aria.adobe.com/customization.md.
Again, not that I've measured anything here, but if the agent actually does decide to go read the docs, the markdown version would eat up fewer tokens, so you may want to use that version for links here.
There was a problem hiding this comment.
I saw that! They've also got a 'copy for LLM' button that also copies a docs page as markdown. Great idea, I will add this to our Jira backlog.
Summary
Tightens the Component standards section of
AGENTS.mdso agents proactively follow and reference React Aria Components (RAC) when designing components — addressing a gap where the existing guidance covered only behavior ("don't reimplement keyboard/ARIA/focus"), not API shape or design-time reference.Two edits:
description/errorMessage,isDisabled/isInvalid, slot-based composition) rather than inventing new ones. Deviate only with a documented reason.Both additions are phrased as tool-agnostic repo convention (no tool- or assistant-specific wording), since
AGENTS.mdis the cross-tool source of truth read by multiple agents and contributors.Context: this came out of investigating
description-prop drift between the React components and the Figma library (tracked in DSYS-194). The guidance change is the durable, general fix; the component-level work is separate.Docs-only change to a root file (no package touched) — included an empty changeset so the changeset gate passes without a version bump.
Screenshots (if appropriate)
N/A — documentation only.
Testing approaches
pnpx @changesets/cli status --since=main→ exit 0 (no packages bumped; gate satisfied).Note
Low Risk
Documentation and an empty changeset only; no runtime, API, or package code changes.
Overview
Strengthens Component standards in
AGENTS.mdso guidance covers API shape as well as accessibility behavior.The existing React Aria Components is the foundation bullet now requires mirroring RAC and React Spectrum prop names and composition patterns (e.g.
description/errorMessage,isDisabled/isInvalid, slots) instead of inventing alternatives, with deviations documented in the PR.A new bullet Consult React Aria when exploring a new problem makes RAC/React Spectrum docs the default design reference before blank-slate or external patterns, explicitly tying that to avoiding API drift with the Figma library.
Adds an empty changeset (no package bumps) so the changeset gate passes for this docs-only root-file change.
Reviewed by Cursor Bugbot for commit 96dfe51. Bugbot is set up for automated code reviews on this repo. Configure here.