Merged
Conversation
Extracts tokens and components from Optics source repo. Generates optics-data.ts with 29 real components. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Helper to get token dependencies for components. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replaces 152 bloated entries with actual components: - 26 from Storybook (Accordion through Tooltip) - 3 layout utilities (Stack, Cluster, Split) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add npm run sync-data command - Add @rolemodel/optics and ts-node as dev deps Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document the two most common AI mistakes: - Not pairing background/text colors - Writing custom CSS instead of using existing components Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add missing cssVar property to generated tokens. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
9af31e7 to
8fa02de
Compare
Jeremy-Walton
approved these changes
Feb 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why?
The optics-data.ts file was manually maintained. When Optics updates, someone has to manually update token lists and add new components. This PR adds an automated sync script that extracts data directly from the Optics source repo.
What Changed
Add
scripts/sync-optics-data.ts- Automated script that extracts tokens and components from Optics. Requires local Optics repo at ../optics. Reads Storybook MDX for component metadata, validates against actual CSS.Add scripts/tsconfig.json - TypeScript config for scripts folder.
Add src/utils/component-tokens.ts - Helper to get token dependencies for a component.
Regenerate src/optics-data.ts - Now has 29 components (was ~24):
Added: ContentHeader, Divider, SegmentedControl, Stack, Cluster, Split
Tooltip now properly included (data-attribute based)
Update src/resources/00-system-overview.md - Document color pairing rule and "use existing components" guidance.
Clean up src/tools/theme-generator.ts - Remove unused functions.
Update package.json - Add npm run sync-data, add dev dependencies.
How to use
Development/
├── optics/ ← Clone github.com/RoleModel/optics here
└── optics-mcp/
Then run:
npm run sync-data