microsoft/power-platform-skills / plugins/mobile-apps/skills/design-system
design-system
FlaggedCreates the Tamagui brand system for an Expo/React Native Power Apps mobile app, including design-system.md, tokens.ts, and an HTML gallery.
references/design-spec-extraction.md
View on GitHub# Design Spec Extraction (`--design-spec`)
Imports a pre-structured design specification file and converts it to our `brand/design-system.md` format. Highest-fidelity input mode — skips both the style picker (Sub-step 3) AND spec-writing (Sub-step 4).
## Supported formats
| Format | Detection marker | Parser |
|---|---|---|
| Our own `/design-system` output | `# ... — Design System` heading | Direct copy (~0 cost) |
| Tokens Studio JSON-in-markdown | `$type` / `$value` keys in JSON blocks | Schema-aware flatten |
| Style Dictionary `.json` | Top-level `color` / `spacing` / `typography` with `value` keys | Schema-validated parser |
| Storybook MDX | `.mdx` extension + `Meta` import or frontmatter | Frontmatter + table extraction |
| Figma Make / V0 / Lovable output | Known markers: `/* Generated by */` comments, specific heading patterns | Per-tool parser |
| Claude Design output | `## Design Tokens` or `## Color Palette` + `## Typography Scale` headings | Known-format parser |
| Generic markdown with tables | Palette/typography/component tables (pipe-delimited) | Deterministic table extraction |
## Pipeline
```
1. Read file (200 KB cap; .md / .mdx / .json accepted)
2. Auto-detect format via markers (table above)
3. Route to format-specific parser
4. Emit ## Design Direction block with provenance line
5. SKIP Sub-step 3 (style picker) AND Sub-step 4 (write spec)
6. Jump to Sub-step 5 (gallery render)
```
## Format-specific parsing
### Our own format (direct copy)
Look for: `# <AppName> — Design System` + `Generated:` line + `## Palette` table.
Action: Copy verbatim to `brand/design-system.md`. Add provenance: `source: <file> (native design-system format)`.
### Tokens Studio JSON
Structure:
```json
{
"color": {
"primary": { "$type": "color", "$value": "#0078D4" },
"background": { "$type": "color", "$value": "#FFFFFF" }
},
"typography": {
"heading": {
"$type": "typography",
"$value": { "fontFamily": "Inter", "fontSize": "24px", "fontWeight": "600" }
}
}
}
```
Parser: Schema-aware recursive flatten. Handle nested groups (`color.brand.primary.default`). Strip `$` prefix from type/value keys.
### Style Dictionary JSON
Structure:
```json
{
"color": {
"primary": { "value": "#0078D4" },
"background": { "value": "#FFFFFF" }
}
}
```
Parser: Simpler — `value` key at leaf nodes. Validate against Style Dictionary schema.
### Storybook MDX
Look for: `.mdx` extension, `import { Meta } from '@storybook/blocks'` or YAML frontmatter.
Parser: Extract frontmatter tokens + scan for markdown tables with color/typography/spacing data. Strip React component blocks (not useful for token extraction).
### Claude Design output
Look for: `## Design Tokens` or `## Color Palette` + `## Typography Scale` as section headers.
Parser: Known heading structure → deterministic table extraction from each section.
### Generic markdown
Fallback for unrecognized formats. Look for pipe-delimited tables containing:
- Color values (hex `#RRGGBB`, rgb(), hsl())
- Font specifications (family, size, weight)
- Spacing values (px, rem)
Parser: Deterministic table regex extraction. Sonnet assist ONLY if tables are ambiguous (e.g., no clear column headers).
## Output
Emits a complete `## Design Direction` block:
```markdown
## Design Direction
source: <file> (<detected format>)
## Palette
| Token | Hex | Usage |
...
## Typography
| Role | Family | Size | Weight | Line | Tracking |
...
## Components
(if extractable from source)
## Negatives
(if source includes constraints / forbidden patterns)
```
## Failure modes
| Condition | Action |
|---|---|
| File missing | STOP |
| Format unrecognized + no token tables | Fall back to `--brand-doc` Sonnet path with warning |
| Tokens Studio deeply nested `$type`/`$value` | Schema-aware flatten |
| Storybook MDX has React component blocks | Strip components, keep token tables |
| Figma Make output has placeholder hex (`#TBD`) | STOP — ask user to fill in |
| Spec contradicts itself (two different `palette.primary`) | Surface conflict, ask user |
| Non-color tokens we can't map (motion curves, elevation) | Capture in Negatives as "preserve from source" |
## Cost
~0-2k tokens (mostly deterministic; Sonnet only for unrecognized markdown structure).
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |