Browse AI

AI

Overview

AI coding assistants can use SGDS agent skills for clearer design system context. Here is how to set them up.

What are agent skills?

If you have ever asked an AI assistant to help you build something, you may have received code that almost works: wrong component names, made-up class names, or outdated patterns.

Agent skills help with that. They are a set of instruction files you install into your project. Compatible AI coding tools can read them for clearer SGDS context, including the right components, tokens, utilities, and patterns.

If you're unsure where to begin, start with sgds-workflow. It maps the full SGDS skill set and points you to the right skill for the task at hand.

Once installed, you can ask things like:

💬 "Build a sidebar dashboard layout using SGDS"
💬 "What spacing utility class should I use between these cards?"
💬 "How do I prevent a modal from closing when clicking the background?"

The assistant still needs human review, but it starts with SGDS-specific context instead of relying on generic web examples.

Use these skills with compatible AI coding tools that can read local agent skill files.

Installation

It takes one command. Run it in your project root:

npx skills add govtechsg/sgds-web-component

When prompted, select all SGDS skills from the list. This creates a local .agents/ folder that compatible AI coding tools can read from your project.

Available skills

Each skill covers a different area of SGDS. You do not need to remember what is in them. The assistant can read the relevant skill when the task calls for it.

SkillWhat it coverssgds-workflowStart here when unsure. Maps all SGDS agent skills, when to use them, and the order to read them in.sgds-getting-startedMandatory first step for new apps: font setup, CSS import order, component registration, and app layout.sgds-componentsAll 47 <sgds-*> web components, including attributes, slots, events, and framework integration (React 19+, React ≤18, Vue, Angular, Next.js).sgds-utilitiesAll sgds: Tailwind utility classes: grid, spacing, typography, colours, borders, and more.sgds-themingBrand colour overrides, dark mode setup, and font customisation. Read alongside components and utilities when needed.sgds-formsForm validation, constraint validation, FormData, and setInvalid.sgds-patternsTypography and content patterns for headings, display text, paragraphs, lists, and page text hierarchy.sgds-layoutsPage layout patterns that define content arrangement for public-facing pages and internal tools and dashboards.sgds-blocksReusable page sections such as hero sections, cards, feature blocks, statistics, filters, forms, and calls to action.sgds-templatesReady-made full-page layouts for common product flows such as dashboards, login pages, list pages, forms, and settings.sgds-data-visualisationCharts and dashboards using ECharts with the SGDS colour palette.sgds-writingSGDS writing guidance for clear, direct, and consistent documentation, UI copy, labels, and prompts.

Where do I start?

New project

Starting from scratch?

Work through these skills in order — each one builds on the last.

1sgds-getting-startedFonts, CSS, and component setup2sgds-components + sgds-utilitiesYour day-to-day building references3
sgds-pattern-page-templatessgds-pattern-block-templates
Assembling full pages and layout blocks
4sgds-formsWhenever a form is involved5sgds-data-visualisationOnly for charts or dashboards
Existing app

Already on SGDS v3?

Skip setup — jump to the skill that covers what you're building right now.

sgds-components

Building or modifying UI components

sgds-utilities

Spacing, layout, and helper classes

sgds-pattern-page-templates

Full-page layout work

sgds-pattern-block-templates

Self-contained UI blocks

sgds-forms

Any form-related work

sgds-data-visualisation

Charts or dashboards only

Not sure where to start? Ask your AI to read the sgds-workflow skill first — it will map out everything based on what you're building.

How it works

Skills are plain Markdown files written for AI assistants. The assistant reads them at query time. They do not add runtime code or dependencies to your product.

Each skill includes:

  • A quick decision guide — helps the AI pick the right component or token
  • An API summary — attributes, slots, and events in compact tables
  • Usage examples — real HTML the AI can produce and adapt
  • Rules for AI agents — explicit dos and don'ts to avoid common mistakes

Keeping skills up to date

After upgrading @govtechsg/sgds-web-component, refresh the SGDS skills installed in your project:

npx skills update --project -y

Singapore Government Design System

The Singapore Government Design System was developed to empower teams in creating fast, accessible and mobile-friendly digital services.

Past VersionsSGDS v1SGDS v2