Conversation
🦋 Changeset detectedLatest commit: 86ba5cc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Primer MCP design-token guidance to better incorporate motion/transition tokens, aiming to improve how the MCP instructs consumers to apply motion consistently using design tokens.
Changes:
- Expands semantic group prefix handling to include motion-related prefixes.
- Strengthens the generated “Design Token Specifications” guidance around transitions (duration/easing tokens) and adds
animationto common recipe bundles. - Adds an
animationusage hint focused on correct transition authoring patterns.
Comments suppressed due to low confidence (2)
packages/mcp/src/primitives.ts:135
SEMANTIC_PREFIXESnow includesduration, but the motion guidance added below explicitly points users at--base-duration-*and--base-easing-*. With the current subgroup detection (only looks atparts[1]), addingdurationwithout also addingeasingwill causebase-*motion tokens to surface adurationsubgroup but not aneasingsubgroup, which is inconsistent with the recommended token usage. Consider addingeasing(and/or revisiting whetherdurationshould be treated as a semantic subgroup here).
// Semantic group prefixes that apply to any element
const SEMANTIC_PREFIXES = [
'bgColor',
'fgColor',
'border',
'borderColor',
'shadow',
'focus',
'color',
'animation',
'duration',
]
packages/mcp/src/primitives.ts:465
- The recipes now instruct using
get_token_group_bundle([... , "animation"]), but the motion tokens referenced in this same guide are--base-duration-*/--base-easing-*. With the current implementation, token grouping is derived from the first segment of the token name (getGroupFromName(name) { return name.split('-')[0] }), sobase-duration-200/base-easing-easeInOutare in thebasegroup, notanimation. As written, these recipes won’t fetch the motion tokens they’re telling users to use; update the recipe group list(s) to includebase(or the actual motion-token group) instead ofanimation.
**Strategy**: STOP property-by-property searching. Use \`get_token_group_bundle\` for these common patterns:
- **Forms**: \`["control", "focus", "outline", "text", "borderRadius", "stack", "animation"]\`
- **Modals/Cards**: \`["overlay", "shadow", "outline", "borderRadius", "bgColor", "stack", "animation"]\`
- **Tables/Lists**: \`["stack", "borderColor", "text", "bgColor", "control"]\`
- **Nav/Sidebars**: \`["control", "text", "accent", "stack", "focus", "animation"]\`
siddharthkp
approved these changes
Mar 6, 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.
This improves the motion output of the Primer MCP
Release
Testing & Reviewing
Merge checklist