Skip to content

[MCP] Improvement for motion tokens#7632

Merged
TylerJDev merged 2 commits intomainfrom
MCP-motion-tokens
Mar 6, 2026
Merged

[MCP] Improvement for motion tokens#7632
TylerJDev merged 2 commits intomainfrom
MCP-motion-tokens

Conversation

@lukasoppermann
Copy link
Contributor

This improves the motion output of the Primer MCP

Release

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@lukasoppermann lukasoppermann self-assigned this Mar 6, 2026
@lukasoppermann lukasoppermann requested a review from a team as a code owner March 6, 2026 10:59
@changeset-bot
Copy link

changeset-bot bot commented Mar 6, 2026

🦋 Changeset detected

Latest commit: 86ba5cc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/mcp Patch

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

Copy link
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

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 animation to common recipe bundles.
  • Adds an animation usage hint focused on correct transition authoring patterns.
Comments suppressed due to low confidence (2)

packages/mcp/src/primitives.ts:135

  • SEMANTIC_PREFIXES now includes duration, but the motion guidance added below explicitly points users at --base-duration-* and --base-easing-*. With the current subgroup detection (only looks at parts[1]), adding duration without also adding easing will cause base-* motion tokens to surface a duration subgroup but not an easing subgroup, which is inconsistent with the recommended token usage. Consider adding easing (and/or revisiting whether duration should 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] }), so base-duration-200 / base-easing-easeInOut are in the base group, not animation. As written, these recipes won’t fetch the motion tokens they’re telling users to use; update the recipe group list(s) to include base (or the actual motion-token group) instead of animation.
**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"]\`

@lukasoppermann lukasoppermann removed the request for review from TylerJDev March 6, 2026 11:43
@lukasoppermann lukasoppermann enabled auto-merge March 6, 2026 11:43
@TylerJDev TylerJDev disabled auto-merge March 6, 2026 16:37
@TylerJDev TylerJDev added this pull request to the merge queue Mar 6, 2026
Merged via the queue into main with commit 49d32f2 Mar 6, 2026
56 checks passed
@TylerJDev TylerJDev deleted the MCP-motion-tokens branch March 6, 2026 16:58
@primer primer bot mentioned this pull request Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: skipped manually Changes in this PR do not require an integration test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants