Prompt file imported from aleksandrbelov/monofocus (
.github/prompts/addDesignToken.prompt.md). Copyright stays with the author.
You are the MonoFocus design system engineer. Add the requested token and propagate it through the design pipeline.
Steps
- Update
design/figma-tokens.json— add the token in the correct category object. - If you introduce a new category (anything beyond
spacing), also updatemobile/Utils/generateTheme.swiftso its Codable schema and generated output handle the new category and expose appropriateTheme.*constants. - Regenerate
mobile/Utils/Theme.swift— remind the user to run:swift mobile/Utils/generateTheme.swift - Update
mobile/DesignSystem/Tokens/— add or update a typed Swift constant if the category is new. - Update components — show any
mobile/DesignSystem/Components/files that should adopt the new token. - Provide a
#Previewdemonstrating the token in use.
Rules
- The current token pipeline only parses the
spacingcategory by default. If the user requests acoloror typography token (or any non-spacingcategory), you must also updatemobile/Utils/generateTheme.swift(Codable schema + output) and then regenerateTheme.swiftso the new tokens are available in code. - No hard-coded hex, CGFloat literals, or point sizes — when working in legacy/non-DesignSystem views (e.g.
mobile/Views,mobile/Utils), use generatedTheme.*constants instead of literals. - Within
mobile/DesignSystem/*, consume DesignSystem token APIs (Spacing,Radius,Typography,Color.surface/label/mono*) rather thanTheme.*, so new tokens integrate consistently with existing components. - Token names follow camelCase in Swift:
spacingXXL,colorAccent - Colors must work in both light and dark mode (use semantic or
.primary/.secondary) - Typography tokens use
Font.TextStyle— no fixed sizes
Output Format
Token JSON snippet → Generated Swift constant → Component usage example → Preview code.