Skip to content

feat: add f0-design-buddy skill with design rules and contribution docs#3762

Draft
eliseo-juan wants to merge 2 commits intomainfrom
feat/f0-design-buddy
Draft

feat: add f0-design-buddy skill with design rules and contribution docs#3762
eliseo-juan wants to merge 2 commits intomainfrom
feat/f0-design-buddy

Conversation

@eliseo-juan
Copy link
Copy Markdown
Contributor

Summary

  • New skill: .skills/f0-design-buddy/SKILL.md — a collaborative design companion that helps designers and developers iterate on UI ideas, challenge designs against F0 rules, and decide whether something belongs in F0 or should stay local. 4-phase workflow: Discovery → Gatekeeping → Brainstorming → Challenge.
  • New Storybook page: packages/react/docs/design-rules.mdx — documents all F0 design rules (color tokens, typography, spacing, border radius, shadows, accessibility, composability, naming, maturity, responsiveness) as a Foundations page.
  • Rewritten contribution guide: packages/react/docs/contributions.mdx — expanded from 82 lines to a comprehensive guide with validation checklist, triage decisions, collaboration phases, quality standards, and FAQ.
  • Sidebar ordering: Added design-rules to the foundationOrder array in preview.tsx.

How it works

The SKILL.md defines agent behavior (phases, anti-patterns, decision trees). It references the two MDX files as canonical source of truth — so both humans (via Storybook) and AI agents (via file reads) use the same design rules and contribution process.

Checklist

  • No code changes to components
  • Pre-commit hooks pass (format, lint, cycle-deps, commit-msg)
  • Documentation-only change — quality gate skip applies per AGENTS.md

- Add .skills/f0-design-buddy/SKILL.md: collaborative design companion
  with 4-phase workflow (Discovery, Gatekeeping, Brainstorming, Challenge)
- Add packages/react/docs/design-rules.mdx: F0 design rules as a
  Storybook Foundations page (color, spacing, typography, a11y, etc.)
- Rewrite packages/react/docs/contributions.mdx: expanded contribution
  process with validation checklist, triage, collaboration phases, and FAQ
- Update preview.tsx: add design-rules to foundation sidebar ordering
Copilot AI review requested due to automatic review settings March 25, 2026 17:23
@github-actions github-actions bot added feat react Changes affect packages/react labels Mar 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

✅ No New Circular Dependencies

No new circular dependencies detected. Current count: 0

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

📦 Alpha Package Version Published

Use pnpm i github:factorialco/f0#npm/alpha-pr-3762 to install the package

Use pnpm i github:factorialco/f0#361936a1514171d7ffa79a5608b18daf1fc625fd to install this specific commit

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

🔍 Visual review for your branch is published 🔍

Here are the links to:

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

Coverage Report for packages/react

Status Category Percentage Covered / Total
🔵 Lines 44.46% 10513 / 23641
🔵 Statements 43.77% 10834 / 24748
🔵 Functions 36.6% 2386 / 6519
🔵 Branches 35.94% 6706 / 18654
File CoverageNo changed files found.
Generated in workflow #12224 for commit 4bf4302 by the Vitest Coverage Report Action

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “design buddy” skill and expands Storybook documentation so designers/devs can reference a canonical set of F0 design rules and an updated contribution process.

Changes:

  • Added a new Foundations docs page documenting F0 design rules.
  • Rewrote the contributions guide into a more complete process/checklist + standards reference.
  • Updated Storybook sidebar ordering and introduced a new .skills/f0-design-buddy skill.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
packages/react/docs/design-rules.mdx New “Foundations/Design rules” MDX page intended as canonical rules for tokens, a11y, composability, naming, etc.
packages/react/docs/contributions.mdx Expanded contribution guide with validation checklist, triage, collaboration flow, standards, and FAQ.
packages/react/.storybook/preview.tsx Added design-rules to foundationOrder for Foundations sidebar ordering.
.skills/f0-design-buddy/SKILL.md New skill defining a 4-phase workflow for design iteration and rule-based challenge.

Comment on lines +50 to +61
| `text-xs` | 0.6875rem (11px) | 1rem (16px) | — |
| `text-sm` | 0.8125rem (13px) | 1.25rem (20px) | — |
| `text-base` | 0.875rem (14px) | 1.25rem (20px) | — |
| `text-lg` | 1rem (16px) | 1.5rem (24px) | — |
| `text-xl` | 1.125rem (18px) | 1.5rem (24px) | -0.02em |
| `text-2xl` | 1.5rem (24px) | 2rem (32px) | -0.02em |

### Rules

- Use the existing type scale — do not add custom `fontSize` values
- Pair text size with the correct semantic color (`f1-foreground`, `f1-foreground-secondary`)
- Larger headings (`xl`, `2xl`) have negative letter-spacing baked in — do not override
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The typography scale table doesn't match the actual Tailwind theme values in packages/core/tailwind.ts (e.g., text-xs/text-sm/text-xl/text-2xl sizes and line-heights differ, and the config includes 3xl/4xl). Since this page is meant to be canonical, please align the table (and any tracking/letter-spacing notes) with the real theme.fontSize definitions.

Suggested change
| `text-xs` | 0.6875rem (11px) | 1rem (16px) ||
| `text-sm` | 0.8125rem (13px) | 1.25rem (20px) ||
| `text-base` | 0.875rem (14px) | 1.25rem (20px) ||
| `text-lg` | 1rem (16px) | 1.5rem (24px) ||
| `text-xl` | 1.125rem (18px) | 1.5rem (24px) | -0.02em |
| `text-2xl` | 1.5rem (24px) | 2rem (32px) | -0.02em |
### Rules
- Use the existing type scale — do not add custom `fontSize` values
- Pair text size with the correct semantic color (`f1-foreground`, `f1-foreground-secondary`)
- Larger headings (`xl`, `2xl`) have negative letter-spacing baked in — do not override
| `text-xs` | 0.75rem (12px) | 1rem (16px) ||
| `text-sm` | 0.875rem (14px) | 1.25rem (20px) ||
| `text-base` | 1rem (16px) | 1.5rem (24px) ||
| `text-lg` | 1.125rem (18px) | 1.75rem (28px) ||
| `text-xl` | 1.25rem (20px) | 1.75rem (28px) ||
| `text-2xl` | 1.5rem (24px) | 2rem (32px) ||
| `text-3xl` | 1.875rem (30px) | 2.25rem (36px) ||
| `text-4xl` | 2.25rem (36px) | 2.5rem (40px) ||
### Rules
- Use the existing type scale — do not add custom `fontSize` values
- Pair text size with the correct semantic color (`f1-foreground`, `f1-foreground-secondary`)
- Do not override letter-spacing unless you have a strong typographic reason

Copilot uses AI. Check for mistakes.
Comment on lines +131 to +137
| Token | Effect | Use |
| ------------- | ---------------------- | ---------------------------- |
| `shadow` | 2px blur, 4% opacity | Subtle elevation (cards) |
| `shadow-md` | 4px blur, 8% opacity | Medium elevation (dropdowns) |
| `shadow-lg` | 8px blur, 12% opacity | High elevation (modals) |
| `shadow-xl` | 12px blur, 16% opacity | Maximum elevation (popovers) |
| `shadow-none` | No shadow | Flat elements |
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shadows table descriptions (blur amounts) don't match the actual Tailwind boxShadow tokens in packages/core/tailwind.ts (e.g., shadow is 0 2px 20px ... /0.04, shadow-lg is 0 8px 30px ... /0.12, etc.). Please update the “Effect” column to reflect the real offsets/blur and opacities so consumers don't implement the wrong elevation.

Suggested change
| Token | Effect | Use |
| ------------- | ---------------------- | ---------------------------- |
| `shadow` | 2px blur, 4% opacity | Subtle elevation (cards) |
| `shadow-md` | 4px blur, 8% opacity | Medium elevation (dropdowns) |
| `shadow-lg` | 8px blur, 12% opacity | High elevation (modals) |
| `shadow-xl` | 12px blur, 16% opacity | Maximum elevation (popovers) |
| `shadow-none` | No shadow | Flat elements |
| Token | Effect | Use |
| ------------- | ------------------------------------------------------------- | ---------------------------- |
| `shadow` | y-offset 2px, blur 20px, 4% opacity (`0 2px 20px ... / 0.04`) | Subtle elevation (cards) |
| `shadow-md` | Medium elevation between `shadow` and `shadow-lg` as defined in Tailwind config | Medium elevation (dropdowns) |
| `shadow-lg` | y-offset 8px, blur 30px, 12% opacity (`0 8px 30px ... / 0.12`)| High elevation (modals) |
| `shadow-xl` | Strongest elevation, with larger offsets/blur and opacity than `shadow-lg` | Maximum elevation (popovers) |
| `shadow-none` | No shadow (`0 0 0 ... / 0` opacity) | Flat elements |

Copilot uses AI. Check for mistakes.

- Components should do one thing well — avoid "god components" with dozens of props
- Use composition over configuration: prefer `children` and slots over boolean flags
- Never expose `className` as a public prop — it breaks encapsulation
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rule says to never expose className as a public prop, but some public APIs currently do (e.g. F0FormPropsWithSingleSchema.className in packages/react/src/components/F0Form/types.ts). Either soften/clarify this rule as guidance for new components (and mention legacy exceptions), or align the existing APIs so the documentation stays truthful.

Suggested change
- Never expose `className` as a public prop — it breaks encapsulation
- For new components, avoid exposing `className` as a public prop — it breaks encapsulation
- Existing public components that already expose `className` are legacy exceptions and should not be used as a pattern for new APIs

Copilot uses AI. Check for mistakes.
Comment on lines 195 to 199
"borders",
"shadows",
"icons",
"design-rules",
]
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This foundationOrder block is only reached when the earlier foundations detection logic matches (it checks for foundations/ and then does split("/")). Story IDs/links in this repo look hyphenated (e.g. foundations-design-rules--docs), so the foundations sub-sorting likely never runs and foundationOrder (including design-rules) won't affect sidebar ordering. Consider basing the foundations detection/splitting on title (which includes Foundations/...) or adjusting the parsing to match the actual Storybook IDs.

Copilot uses AI. Check for mistakes.
- Add Storybook URL conventions and proactive linking behavior to f0-design-buddy skill
- Add designer-first language rule to skill
- Refactor design-rules.mdx to reference token source files instead of duplicating values
- Add golden rule: never create new tokens without F0 core team decision
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat react Changes affect packages/react

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants