/community:fds-buildfrom community
Use when building with @lifesg/react-design-system v4. Covers composition rules, correct import patterns, token usage, and component discovery.
Ships in community. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are helping build web applications with @lifesg/react-design-system for government digital products.
npm install @lifesg/react-design-system @lifesg/react-icons @floating-ui/react
Do not install styled-components — v4 uses CSS Modules for custom styles.
Peer deps: react + react-dom (^17, ^18, or ^19).
If the project is new or missing setup — read ./resources/setup/setup.md for the full CSS/ThemeProvider/Vite walkthrough before writing any component code.
Wrap your app in ThemeProvider to apply the correct theme CSS variables and enable dark/light mode.
import { ThemeProvider } from "@lifesg/react-design-system/theme";
import "@lifesg/react-design-system/theme/styles/lifesg.css";
export default function App() {
return <ThemeProvider theme="lifesg">{/* your app */}</ThemeProvider>;
}
Theme is a string: "lifesg" · "bookingsg" · "ccube" · "mylegacy" · "oneservice" · "pa" · "supportgowhere" · "sgw-digital-lobby" · "careercompass" · "rbs" · "imda" · "spf" · "smgs" · "a11y-playground"
Dark/light mode: mode prop defaults to "auto" (OS preference). Override with mode="light" or mode="dark".
Always use subpath imports:
import { Button } from "@lifesg/react-design-system/button";
import { Form } from "@lifesg/react-design-system/form";
Every page must have Navbar at the top and Footer at the bottom.
import { Navbar } from "@lifesg/react-design-system/navbar";
import { Footer } from "@lifesg/react-design-system/footer";
<Navbar
resources={{ primary: { brandName: "MyService", logoSrc: "/logo.svg" } }}
items={{ desktop: [{ id: "home", children: "Home", href: "/" }] }}
/>;
{
/* page content */
}
<Footer />;
Tokens are plain CSS variable strings — use directly in CSS Modules or inline styles.
Prefer CSS Modules for layout and responsive styles:
/* Component.module.css */
.card {
background: var(--fds-colour-bg-strong);
padding: var(--fds-spacing-24);
border-radius: var(--fds-radius-md);
:global(body.fds-breakpoint-lg-min) & {
padding: var(--fds-spacing-32);
}
}
CSS Modules gotcha: always use
:global(body.fds-breakpoint-lg-min)— never:where(body.fds-breakpoint-lg-min). CSS Modules scopes every class selector it finds;:global()opts the breakpoint class out of scoping so it matches the runtime classThemeProvideradds todocument.body.
Inline styles work for simple one-off values:
import { Colour, Spacing } from "@lifesg/react-design-system/theme";
<div style={{ color: Colour.text, padding: Spacing["spacing-24"] }} />;
Responsive breakpoints use body class selectors added by ThemeProvider:
body.fds-breakpoint-lg-min — viewport ≥ lg (769px)body.fds-breakpoint-md-min — viewport ≥ md (481px)body.fds-breakpoint-xl-min — viewport ≥ xl (1201px)@lifesg/react-icons first — read ./resources/components/icon.md to discover available icon names.material-symbols as fallback only.Button not <button>, Form.Input not <input>Form.* fields: label always required; errorMessage only after validation fails; readOnly on review screens, not disabledpx values — always use Spacing tokensForm.* components import from @lifesg/react-design-system/formThis skill is self-contained — all resource files live under ./resources/ relative to this file. No npm install or external lookup needed.
Do not write component code without reading its resource file first.
| Task | What to read |
|---|---|
| New project / missing setup | ./resources/setup/setup.md |
| Find the right component | ./catalogue.md — search "Also known as" column by keyword |
| Use a component | ./resources/components/{name}.md |
| Grid system, breakpoints, column widths | ./resources/components/layout.md |
| Build a form page (single or multi-step) | ./resources/templates/form.md |
| Build a listing / search results page | ./resources/templates/listing.md |
| Handle loading / error / empty states | ./resources/patterns/states.md |
| Token question (Colour, Spacing, Radius, Typography) | ./resources/foundations/tokens.md |
| Spacing rhythm, visual hierarchy, card rules, settings page structure | ./resources/foundations/layout-composition-patterns.md |
Reading strategy: read catalogue.md once for discovery, then fetch only the specific component {name}.md files you need. Do not pre-load all component files.
| Symptom | Fix |
|---|---|
| No styles / wrong fonts | Read ./resources/setup/setup.md — main.css CDN link or theme CSS import is likely missing |
| Footer doesn't stick to bottom on short pages | Apply a className to ThemeProvider and target that selector with display: flex; flex-direction: column; flex: 1 |
| Responsive breakpoint rules don't fire | Using :where(body.fds-breakpoint-*) — replace with :global(body.fds-breakpoint-*) so CSS Modules doesn't scope the class |
| Theme CSS not loading | Vite resolves node_modules CSS automatically; other tools need CSS resolver config |
styled-components import error | Remove it — v4 uses CSS Modules; use className={styles.x} with a .module.css file |
RadioButton with children throws in React 19 | v4 RadioButton spreads all props (including children) onto <input> — React 19 rejects children on void elements. Wrap in <label> with text outside: <label><RadioButton .../> Label text</label> |
Next.js App Router: no #root element | Next.js renders into <body> directly. Replace #root { ... } with those styles on body, and #root > div with body > div. See setup.md Next.js section |
catalogue.md (opens in a new tab)evals/evals.json (opens in a new tab)resources/components/accordion.md (opens in a new tab)resources/components/alert.md (opens in a new tab)resources/components/animation.md (opens in a new tab)resources/components/avatar.md (opens in a new tab)resources/components/badge.md (opens in a new tab)resources/components/box-container.md (opens in a new tab)resources/components/breadcrumb.md (opens in a new tab)resources/components/button.md (opens in a new tab)resources/components/calendar.md (opens in a new tab)resources/components/card.md (opens in a new tab)resources/components/checkbox.md (opens in a new tab)resources/components/countdown-timer.md (opens in a new tab)resources/components/data-table.md (opens in a new tab)resources/components/date-navigator.md (opens in a new tab)resources/components/divider.md (opens in a new tab)resources/components/drawer.md (opens in a new tab)resources/components/error-display.md (opens in a new tab)resources/components/feedback-rating.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
7 skills in this plugin
/domain-modelingBuild and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR./draw-iodraw.io diagram creation, editing, and review. Use for .drawio XML editing, PNG conversion, layout adjustment, and AWS icon usage./grillingGrill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases./grill-meA relentless interview to sharpen a plan or design./grill-with-docsA relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go./test-manage-skillsAI-driven functional and security testing for manage-skills.sh. Executes mandatory test cases from the test plan, then runs exploratory tests for edge cases and attack vectors. Use when: testing manage-skills.sh, verifying security fixes, or validating the community skill management pipeline. Triggers on: "test manage-skills", "test the skill script", "run manage-skills tests", "verify manage-skills".npx claudepluginhub lifesg/ccube-agent-plugin-marketplace --plugin community