[CCUBE-2223][XY] Add Flagship DS agent skills - #1458
ninjasheeps wants to merge 9 commits into
Conversation
There was a problem hiding this comment.
does skills support installing from a version? e.g. npx skills @lifesg/react-design-system@3
it would be cleaner to split v3 vs v4; I would imagine in newer versions when we start removing/adding components/props, the catalog and props should be updated separately for the new version without affecting the old
There was a problem hiding this comment.
ah ok you did mention it has to point to the full path. so it would need to be npx skills https://github.com/LifeSG/react-design-system/tree/pre-release/v3
alternatively we could provide a bin command like npx lifesg-react-design-system@3 skills that maps to the expected path
There was a problem hiding this comment.
continuing on this thread since we can support version specific skills
can we move v3 resources to a new PR targeting the pre-release/v3 branch? then flatten the resource folder structure and remove references to v3
991668a to
28c4fbd
Compare
…-props - Export stripPropsSection and insertPropsSection for testability - Guard main() behind require.main === module to prevent side effects on import - Add 12-test suite covering strip, insert, and idempotency scenarios Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| }, | ||
| "bin": { | ||
| "lifesg-react-design-system": "./codemods/run-codemod.js" | ||
| "lifesg-react-design-system": "./scripts/cli.js" |
There was a problem hiding this comment.
trouble you to update rollup.config.js to support the bin command
- line 116 can be updated to reflect the latest bin config:
bin: pkg.bin,
- skills and
script/cli.jsshould be bundled as well
can include it under the codemodBuildConfig copy plugin (there are some issues using libraryBuildConfig)
{ src: "scripts/cli.js", dest: "dist/scripts" },
{ src: "skills/*", dest: "dist/skills" },
There was a problem hiding this comment.
continuing on this thread since we can support version specific skills
can we move v3 resources to a new PR targeting the pre-release/v3 branch? then flatten the resource folder structure and remove references to v3
| ## Install | ||
|
|
||
| ```bash | ||
| pnpm add @lifesg/react-design-system @lifesg/react-icons styled-components @floating-ui/react @mui/icons-material @emotion/is-prop-valid |
There was a problem hiding this comment.
should we use npm as the default instead?
| } | ||
| ``` | ||
|
|
||
| `StyleSheetManager` with `isPropValid` stops styled-components forwarding DS-specific props (e.g. `weight`) to DOM elements. |
There was a problem hiding this comment.
DS V3 should properly handle transient props (if not, is a bug that should be fixed on the library), can avoid this step as a default. consumers should also be marking transient props for their own code
|
|
||
| Theme is an **imported object** — not a string. Available themes: `LifeSGTheme` · `BookingSGTheme` · `CCubeTheme` · `MyLegacyTheme` · `OneServiceTheme` · `PATheme` · `SupportGoWhereTheme` · `SGWDigitalLobbyTheme` · `IMDATheme` · `SPFTheme` · `SMGSTheme` · `A11yPlaygroundTheme` | ||
|
|
||
| For auto dark/light mode: swap `ThemeProvider` for `DSThemeProvider` (same import path). Force fixed mode: `LifeSGTheme.light` or `LifeSGTheme.dark`. |
There was a problem hiding this comment.
I interpret this as having same import path as ThemeProvider from styled-components. maybe just remove and let the agent figure it out
| | Using `SpacingValues` | This export does not exist | Use `Spacing` | | ||
| | Using `Theme` (named export) | This export does not exist | Use a named preset: `LifeSGTheme`, etc. | |
There was a problem hiding this comment.
does this need to be explicitly documented? 🥺
| `Breakpoint` can still be imported for JS conditional logic: | ||
|
|
||
| ```tsx | ||
| import { Breakpoint } from "@lifesg/react-design-system/theme"; | ||
|
|
||
| const isDesktop = window.innerWidth > Breakpoint["lg-min"]; | ||
| ``` |
There was a problem hiding this comment.
|
|
||
| ## Border Tokens | ||
|
|
||
| `Border` is a flat object of CSS variable strings. Import from `@lifesg/react-design-system/theme`. |
There was a problem hiding this comment.
| `Border` is a flat object of CSS variable strings. Import from `@lifesg/react-design-system/theme`. | |
| `Border` is a flat object of CSS variable strings. |
| <div style={{ border: `${Border["width-010"]} ${Border.solid} ${Colour.border}` }} /> | ||
| ``` | ||
|
|
||
| There is no `Border.Util` in v4 — compose border properties manually using the tokens above. |
There was a problem hiding this comment.
for dash style, use the DashedBorder https://github.com/LifeSG/react-design-system/wiki/Migrating-to-V4#border
There was a problem hiding this comment.
request: run prettier afterwards to standardise the table formatting and reduce noise in the unstaged files
Type of changes
Description of changes
fds-buildagent skill which allows consumers to build web pages/applications using FDSscripts/generate-skill-props.tsnpx skills add lifesg/react-design-systemChecklist