Skip to content

feat: add Agent Skill for S1 to S2 migration#9778

Open
reidbarber wants to merge 27 commits intomainfrom
s1-to-s2-upgrade-skill
Open

feat: add Agent Skill for S1 to S2 migration#9778
reidbarber wants to merge 27 commits intomainfrom
s1-to-s2-upgrade-skill

Conversation

@reidbarber
Copy link
Member

@reidbarber reidbarber commented Mar 11, 2026

This PR adds an Agent Skill that helps users upgrade from v3 to S2. TLDR is that it tells the agent how to effectively run the codemods, then fix everything the codemod couldn't fix automatically.

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Install the skill:

npx skills add https://d1pzu54gtk2aed.cloudfront.net/pr/a6bd663c7cd981040ac06cb98f21741b0d519d95/ --skill react-spectrum-v3-to-s2-migration

and invoke it when upgrading your project.

Important

The skill mentions running the codemod with "--agent". This has not been released yet, so you may need to manually update the skill to point to a nightly release, which does include it: https://www.npmjs.com/package/@react-spectrum/codemods?activeTab=versions.
Example: Replace npx @react-spectrum/codemods s1-to-s2 --agent with npx @react-spectrum/codemods@3.0.0-nightly-7ba11ce33-260324 s1-to-s2 --agent

🧢 Your Project:

@rspbot
Copy link

rspbot commented Mar 11, 2026

Base automatically changed from codemod-fixes to main March 17, 2026 22:20
@reidbarber reidbarber changed the title [WIP]: add Agent Skill for S1 to S2 migration feat: add Agent Skill for S1 to S2 migration Mar 18, 2026
@rspbot
Copy link

rspbot commented Mar 18, 2026

@rspbot
Copy link

rspbot commented Mar 23, 2026

@rspbot
Copy link

rspbot commented Mar 23, 2026


## App and Provider setup

- Full-page apps usually add `import '@react-spectrum/s2/page.css';` at the entrypoint and no longer need a mandatory root Provider just to supply `theme={defaultTheme}`.
Copy link
Member

Choose a reason for hiding this comment

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

i thought we changed it so that the S2 Provider was always needed in order to load the font? originally it was optional but i thought it sorta became mandatory

Copy link
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

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

Still reading through these, but in general how were these guides created? Were they common pitfalls you found when using the codemod/sourced from internal discussions/etc?

Ideas on keeping these up to date as we make other changes that introduce additional complexities to a S1 to S2 migration? Does this work well with version differences/variences (both S1 and S2)?

@reidbarber
Copy link
Member Author

in general how were these guides created?

I started with a base skill, then tried it out in several real repos. I then got an agent to analyze the agent's actions during those migrations. I integrated the feedback from that back into the skill.

Ideas on keeping these up to date as we make other changes that introduce additional complexities to a S1 to S2 migration?

I don't anticipate this will need much maintenance. If we keep updating the codemod when needed, that should cover most things, but we can always update these skills and they'll be live in the next docs release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants