diff --git a/.picasso/rules.md b/.picasso/rules.md new file mode 100644 index 0000000000..e24f9382a6 --- /dev/null +++ b/.picasso/rules.md @@ -0,0 +1,82 @@ +# Picasso UI Kit — agent rules (v2) + +Rules for AI agents writing application code that **consumes** Toptal's Picasso +design system (`@toptal/picasso*`). This file stays small on purpose: it carries +the stable, high-value rules inline and points to the hosted, always-current +docs for everything else. + +## Documentation lookup (fetch on demand) + +Component docs are **hosted** — do not vendor them into the repo. Before using an +unfamiliar Picasso component, fetch the docs on demand: + +1. Fetch the index: — every + component and tutorial is linked as an absolute URL with a one-line summary. +2. From the index, fetch the specific component page you need, e.g. + (props, + variants, examples). +3. For layout, forms, spacing, or SSR questions, fetch the relevant guide from + the index's **Tutorials** section. + +Fetch only what the task needs. If your runtime cannot reach the network, fetch +the index plus the specific component pages once and cache them for the session — +still preferred over committing the whole tree. + +## Package imports + +| Package | Import for | Example | +| -------------------------------- | ----------------------------------- | -------------------------------------------------------------------- | +| `@toptal/picasso` | UI components and icons | `import { Button, Container, Modal, More16 } from '@toptal/picasso'` | +| `@toptal/picasso/utils` | utilities, hooks, spacing constants | `import { useNotifications } from '@toptal/picasso/utils'` | +| `@toptal/picasso-forms` | Final Form-based form components | `import { Form, Input, Select } from '@toptal/picasso-forms'` | +| `@toptal/picasso-provider` | root provider only | `import Picasso from '@toptal/picasso-provider'` | +| `@toptal/picasso-tailwind-merge` | merging Tailwind classes | `import { twMerge } from '@toptal/picasso-tailwind-merge'` | + +Import from package barrels, never deep paths. + +## Mandatory rules + +1. **Use Picasso components, not raw HTML, for UI** — no raw `