Skip to content

chore: add connect-component-to-figma Claude Code skill#2385

Draft
frankensteinke wants to merge 2 commits into
developfrom
chore/add-figma-connect-skill
Draft

chore: add connect-component-to-figma Claude Code skill#2385
frankensteinke wants to merge 2 commits into
developfrom
chore/add-figma-connect-skill

Conversation

@frankensteinke

Copy link
Copy Markdown
Contributor

Summary

  • Adds .claude/skills/connect-component-to-figma/SKILL.md — a Claude Code skill that captures the conventions and gotchas from the batch 1–5 Figma Code Connect rollout.
  • The skill walks Claude through adding a .figma.tsx file for a Cauldron component: confirming the Figma node id, verifying the React API, writing the file, and validating with npm run figma:parse.
  • Content is distilled from existing .figma.tsx examples in packages/react/src/components/ and the parent issue's checklist — no rules invented.

Related to #2373.

Test plan

  • Reviewer checks the skill content reflects current conventions in the existing .figma.tsx files.
  • Verify npm run figma:parse is the correct validation command (tsconfig.json excludes *.figma.tsx, so tsc does not validate these files).
  • Optional: install the skill locally (cp -r .claude/skills/connect-component-to-figma ~/.claude/skills/) and use it to add a .figma.tsx for a not-yet-connected component to sanity-check the workflow end-to-end.

Captures the conventions and gotchas from the batch 1-5 Figma Code
Connect rollout (#2373) as an installable skill, so future
.figma.tsx additions follow the same patterns without re-deriving them
from the existing examples.
Pin the skill's intended model in frontmatter as a signal of intent —
the task is mechanical enough that Opus is overkill. The harness may
not act on this field today, but it documents what to run the skill
on.
@aws-amplify-us-east-1

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-2385.d15792l1n26ww3.amplifyapp.com

@frankensteinke frankensteinke marked this pull request as ready for review May 14, 2026 13:49
@frankensteinke frankensteinke requested a review from a team as a code owner May 14, 2026 13:49
Copilot AI review requested due to automatic review settings May 14, 2026 13:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 Claude Code skill document to guide contributors through connecting Cauldron React components to Figma via Code Connect, capturing rollout conventions/gotchas referenced in issue #2373.

Changes:

  • Introduces a new .claude/skills/connect-component-to-figma/SKILL.md skill with a template, workflow, conventions, and troubleshooting guidance for authoring .figma.tsx mappings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +47 to +52
4. **Lint + parse**:
```bash
npx eslint packages/react/src/components/<Component>/<Component>.figma.tsx
cd packages/react && npm run figma:parse
```
`.figma.tsx` is excluded from `tsconfig.json`, so `tsc` won't see it — `figma connect parse` is the real validator.
Comment on lines +66 to +72
| Figma type | Code Connect call | Notes |
| ---------------------------------------- | ----------------------------------------------------------------------- | ---------------------------------------------------- |
| VARIANT (enum, incl. `"True"/"False"`) | `figma.enum('Name', { True: true })` | Pseudo-booleans are VARIANTs, not BOOLEANs. |
| BOOLEAN (real toggle) | `figma.boolean('Name', { true: X, false: undefined })` | Use `undefined` for "off" so the prop drops. |
| Text layer | `figma.textContent('Label')` | Layer name, not property name. |
| Nested instance prop (e.g. `_Icon Type`) | `figma.nestedProps('_Icon Type', { name: figma.string('Icon') })` | See IconButton/Icon for the pattern. |
| Multiple Figma variants → one component | Multiple `figma.connect(C, URL, { variant: { Type: 'X' }, ... })` calls | E.g. ActionMenu with Button vs Icon Button triggers. |
};
```
- **Inverted booleans matter.** ExpandCollapsePanel maps `Collapsed=False` to `open=true` (the React prop is the opposite of the Figma variant). Read the React prop semantics before mapping.
- **Tooltip placement has no React default** — every Figma `Direction` value must map, even `Right`, otherwise the snippet renders without `placement` and floating-ui picks.
@frankensteinke frankensteinke marked this pull request as draft May 18, 2026 09:55
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been open for 30 days with no activity. If no further activity occurs, it will be closed in 14 days.

@github-actions github-actions Bot added the stale When a PR or Issue has been flagged due to inactivity label Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale When a PR or Issue has been flagged due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants