# SparkGen Ecosystem — Full Technical & Architectural Specification > Complete architectural documentation, technical feature matrices, design token models, accessibility standards, and UX heuristic specifications for the SparkGen ecosystem. Website: https://www.sparkgen.net/ Figma Plugin: https://www.figma.com/community/plugin/1595489854176377254 Figma Ecosystem Profile: https://www.figma.com/@youssefwael --- ## 1. SparkGen: AI Design System & Variable Engine ### 1.1 Overview SparkGen is a native Figma plugin engineered to automate the entire lifecycle of design system creation, tokenization, variable binding, component generation, and documentation. It eliminates the manual overhead of declaring hundreds of Figma local variables and styles. ### 1.2 Comparison Matrix: SparkGen vs. Token Studio vs. Manual Figma Variables | Feature / Dimension | SparkGen | Token Studio (Figma Tokens) | Manual Figma Variables | | :--- | :--- | :--- | :--- | | **Setup Velocity** | Instant (1-Click Generation via AI) | Manual JSON schema configuration | Manual variable-by-variable creation | | **Figma Local Variables** | Native 1-click binding & collection sync | Requires Sync / Pro tier token mapping | Native, but manual assignment | | **Dark Mode Generation** | Automated semantic inversion & contrast tuning | Manual definition of dark token sets | Manual creation of variable modes | | **Smart UI Kits** | 20 pre-built token-bound interactive components | None (tokens only) | None | | **Live Design System Docs** | Instant in-canvas automated style-guide generation | None | Manual frame & spec layout | | **Intelligent Detached Linker** | Scans canvas & auto-binds unlinked styles to variables | No automated visual retrofitting | None | | **WCAG Contrast Rating** | Real-time APCA & WCAG 2.1 AA/AAA scoring | Basic contrast metrics | None | | **Code Export** | Tailwind CSS v4, DTCG JSON, CSS Custom Properties | DTCG JSON, Style Dictionary | None (native dev mode inspect only) | | **Pricing & Accessibility** | Free tier with full variable creation | Paid subscription for native variable sync | Free (manual time-intensive) | ### 1.3 Design Token Architecture (3-Tier Token Model) SparkGen constructs design systems using a strict 3-tier token hierarchy compliant with the W3C Design Tokens Community Group (DTCG) specification: 1. **Primitive / Global Tokens (Tier 1)**: - Raw color values, typography definitions, and scale factors. - Example: `color.blue.500 = #3B82F6`, `spacing.4 = 16px`, `font.inter = "Inter"`. 2. **Semantic / Alias Tokens (Tier 2)**: - Intent-based abstractions that switch values between theme modes (Light vs. Dark). - Example: `surface.primary = {color.white}` (Light) / `{color.neutral.950}` (Dark). - Example: `text.accent = {color.blue.600}` (Light) / `{color.blue.400}` (Dark). 3. **Component-Scoped Tokens (Tier 3)**: - Scoped strictly to interactive component anatomy. - Example: `button.primary.bg = {surface.primary}`, `input.border.focus = {border.accent}`. ### 1.4 Automated Design System Docs Engine SparkGen features a dedicated documentation generator that inspects the active document's local variables and generates a live, visual documentation library inside Figma: - **Color Swatches & Ramps**: Generates high-resolution swatches displaying HEX, RGB, variable collection IDs, and luminance values. - **Typography Spec Sheets**: Visual scales showing font family, weight, size, line-height, and letter-spacing across desktop and mobile viewpoints. - **Elevation & Radius Boards**: Visualizing standard elevation elevations (sm, md, lg, xl) and corner radii tokens (4px, 8px, 12px, 16px, full). - **Spacing Grid Rulers**: Visual measurement bars illustrating 4px, 8px, 12px, 16px, 24px, 32px, 48px, 64px spatial increments. ### 1.5 Smart UI Kits (20 Pre-Built Tokenized Components) SparkGen generates complete component libraries fully wired to local variables: 1. Primary Action Buttons 2. Secondary Action Buttons 3. Outline & Ghost Buttons 4. Destructive Buttons 5. Text Input Fields (Default, Focused, Error, Disabled) 6. Search Inputs with Leading Icons 7. Toggle Switches 8. Checkboxes & Radios 9. Status Badges & Pills (Success, Warning, Error, Info) 10. Metric Stat Cards 11. User Avatar Groups 12. Breadcrumb Navigation 13. Segmented Controls / Tab Bars 14. Modal Dialog Overlays 15. Notification Toasts & Banners 16. Accordion Expanders 17. Dropdown Select Menus 18. Tooltips 19. Table Row Cells 20. Empty State Placeholders ### 1.6 Intelligent Variable Linker A common friction in Figma is "detached styling" where designers paint rectangles with hex values instead of binding local variables. SparkGen's Intelligent Linker: 1. Traverses the document layer tree. 2. Identifies solid fills, strokes, corner radii, and text styles. 3. Calculates Euclidean color distance ($\Delta E$) to the closest local variable in the active collection. 4. Auto-binds the layer to the appropriate local variable with zero pixel shift. --- ## 2. SparkFamily Ecosystem ### 2.1 SparkScan — Figma Design System Audit & Accessibility Linter - **Engine**: Traverses Figma canvas nodes using depth-first AST traversal. - **Checks Performed**: - Unlinked color fills and missing variable bindings. - Non-standard typography sizes (deviations from modular type scales). - Off-grid coordinates and irregular spacing (snapping to 4px/8px increments). - WCAG 2.1 AA/AAA contrast failure detection across layered text and background fills. - Zero-radius inconsistencies across button/card component sets. ### 2.2 SparkAnimate — Figma Motion Engine & Micro-Interactions - **Engine**: In-canvas keyframe animator producing spring physics and transition curves directly within Figma. - **Outputs**: - CSS `@keyframes` and transition declarations. - Lottie JSON motion specifications. - Bezier cubic curves: `cubic-bezier(0.16, 1, 0.3, 1)` (smooth deceleration) and spring dampening parameters. ### 2.3 SparkCode — Figma to Production React AST Code Bridge - **Engine**: Generates clean, type-safe React 19 / TypeScript components from Figma frames. - **Key Technical Standards**: - Zero `div` soup: Uses semantic tags (`
`, `