token-workflow

Coordinate SGDS design tokens across root.css, day/night mappings, and utility.css.

18|10|Updated Aug 30, 2022
One-click install
npx skills add https://github.com/GovTechSG/sgds-web-component --skill token-workflow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: token-workflow
Source: https://github.com/GovTechSG/sgds-web-component/tree/main/.github/skills/token-workflow
Command: npx skills add https://github.com/GovTechSG/sgds-web-component --skill token-workflow

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Maintains SGDS design token architecture across three layers (primitive tokens in root.css, semantic mappings in day.css/night.css, and Tailwind utilities in utility.css). Use when adding/modifying design tokens, creating new utilities, updating Storybook documentation, or ensuring token consistency across theme files. IMPORTANT - whenever new tokens are requested, ALWAYS complete all three deliverables - (1) utility.css mapping, (2) playground HTML demo in playground/utility/, (3) Storybook story in stories/utilities/. Never do just one without the others.

Core Features & Use Cases

  • Enforces a three-layer token architecture: primitives, semantics, and utilities.
  • Guarantees delivery of all three artifacts for token requests: utility.css mapping, playground demo, and Storybook story.
  • Guides cross-team token work and documentation consistency across themes.

Quick Start

Follow the token workflow to add or modify tokens by updating all three layers and creating corresponding playground and Storybook entries.

Frequently Asked Questions about token-workflow

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add new SGDS design tokens across CSS and Tailwind layers?

To add new SGDS design tokens, update primitive tokens in root.css, map semantic values in day.css/night.css, and create Tailwind utilities in utility.css. This three-layer token architecture ensures consistency across themes and utility classes.

What is the design token workflow for maintaining theme consistency?

The design token workflow coordinates primitives, semantic mappings, and Tailwind utilities across three CSS layers. It enforces triple deliverables—utility.css mappings, playground HTML demos, and Storybook stories—to guarantee documentation and implementation alignment.

Do I need to update Storybook when modifying Tailwind utility classes?

Yes, modifying Tailwind utility classes requires updating Storybook stories. The token workflow mandates three deliverables for any token change: utility.css mapping, playground HTML demo in playground/utility/, and Storybook story in stories/utilities/.

Can I use this token workflow to create day and night theme mappings?

Yes, the token workflow supports day and night semantic mappings through day.css and night.css files. It coordinates these semantic mappings with primitive root.css tokens and Tailwind utility.css classes to maintain theme consistency.

What happens if I only update utility.css without creating a playground demo?

Updating utility.css alone breaks the token workflow contract. Every token request must complete all three deliverables—utility.css mapping, playground HTML demo, and Storybook story—to ensure cross-team token work and documentation consistency across themes.

When should I use a three-layer design token architecture instead of plain CSS variables?

Use a three-layer token architecture when managing design systems that span primitive tokens, semantic theme mappings, and Tailwind utilities. It ensures consistency across day/night themes and enforces documentation deliverables that plain CSS variables cannot coordinate.