Use this workflow when you need to refactor existing pages, replace custom UI with SGDS components, or migrate an interface towards SGDS standards.
- Share the relevant page, component, or codebase context with the AI coding tool.
- Ask it to check the SGDS setup, including CSS import order, utility CSS processing, and component registration.
- Replace custom UI with SGDS components where appropriate, and use
sgds: utility classes for styling. - Use
sgds-forms for form validation and sgds-data-visualisation if the page includes charts. - Preserve existing routes, data handling, and behaviour unless the migration requires a change.
- Build and test the updated page before review.
If you are upgrading an existing app, work incrementally. Change one component or section at a time.
Start with this prompt:
Example prompt Copy
I want to migrate my app to SGDS v3 incrementally.
Then build on it with these strategies:
1
Always plan before you change
Ask the agent to analyse your codebase first and produce a migration plan before touching any code:
Example prompt Copy
Analyse my codebase and generate a migration plan to SGDS v3 before making any changes.
2
Swap components one at a time
Tell the agent to replace existing UI components with their SGDS equivalents, one by one:
Example prompt Copy
Replace the existing button component with <sgds-button>. Do not change anything else.
3
Replace foundational styles
Ask the agent to swap your old design system's typography, spacing, and colour foundations with SGDS v3:
Example prompt Copy
Replace the old foundation styles (typography, spacing, colours) with SGDS v3 equivalents.
4
Suggest utility replacements
Request the agent to recommend the appropriate SGDS semantic CSS utility tokens to replace existing styles:
Example prompt Copy
Look at the components and recommend the appropriate SGDS semantic CSS utility tokens to replace existing styles, including inline styles, CSS classes, or old utility classes.
Putting it all together
Use this prompt when you want the agent to review a page and migrate it safely:
Example prompt Copy
Review this existing form page and migrate it to SGDS. Check the SGDS setup, replace custom inputs, buttons, alerts, and layout styles with SGDS web components and utilities where appropriate, and keep the current validation behaviour unless it conflicts with SGDS guidance.