@thanhnguyxn/pixelcraft 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +20 -0
- package/.antigravity-plugin/plugin.json +32 -0
- package/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +22 -0
- package/.codex-plugin/plugin.json +45 -0
- package/.cursor-plugin/marketplace.json +17 -0
- package/.cursor-plugin/plugin.json +27 -0
- package/.devin-plugin/plugin.json +21 -0
- package/.github/plugin/marketplace.json +34 -0
- package/CHANGELOG.md +159 -0
- package/GEMINI.md +1 -0
- package/LICENSE +21 -0
- package/README.md +264 -2
- package/SECURITY.md +28 -0
- package/assets/README.md +28 -0
- package/assets/pixelcraft-logo-128.png +0 -0
- package/assets/pixelcraft-logo-256.png +0 -0
- package/assets/pixelcraft-logo-512.png +0 -0
- package/bin/pixelcraft.mjs +852 -0
- package/docs/ARCHITECTURE.md +105 -0
- package/docs/DESIGN-RATIONALE.md +191 -0
- package/docs/INSTALL.md +221 -0
- package/evals/README.md +37 -0
- package/evals/fixtures/3d-web-engineering.json +69 -0
- package/evals/fixtures/README.md +36 -0
- package/evals/fixtures/acceptance-checklist-rule03-gate.json +43 -0
- package/evals/fixtures/ai-ui-libraries.json +53 -0
- package/evals/fixtures/audio-visual-accessibility.json +69 -0
- package/evals/fixtures/auth-and-checkout-ui.json +53 -0
- package/evals/fixtures/brandkit-identity-governance.json +48 -0
- package/evals/fixtures/build-and-architecture.json +53 -0
- package/evals/fixtures/canvas-and-node-editors.json +53 -0
- package/evals/fixtures/chat-ai-exfiltration-ime-hitl-gate.json +43 -0
- package/evals/fixtures/completion-gate-scan-until-clean.json +44 -0
- package/evals/fixtures/component-systems.json +53 -0
- package/evals/fixtures/component-testing.json +53 -0
- package/evals/fixtures/constrained-voice-and-tv.json +43 -0
- package/evals/fixtures/creative-code-rendering.json +69 -0
- package/evals/fixtures/creative-reference-evidence.json +67 -0
- package/evals/fixtures/data-app-python-marimo.json +49 -0
- package/evals/fixtures/desktop-cpp-juce-audio.json +49 -0
- package/evals/fixtures/desktop-csharp-avalonia.json +49 -0
- package/evals/fixtures/desktop-native-workspace.json +48 -0
- package/evals/fixtures/desktop-python-anti-tkinter.json +49 -0
- package/evals/fixtures/direction-prototype-complexity.json +29 -0
- package/evals/fixtures/document-prepress-pdfx4-tounicode.json +43 -0
- package/evals/fixtures/document-rust-typst-invoice.json +49 -0
- package/evals/fixtures/document-typst-and-print-css.json +43 -0
- package/evals/fixtures/email-mjml-dark-mode.json +49 -0
- package/evals/fixtures/email-outlook-and-plaintext.json +43 -0
- package/evals/fixtures/enterprise-data-ui.json +53 -0
- package/evals/fixtures/extended-tui-toolkits.json +53 -0
- package/evals/fixtures/extensions-mv3-and-vscode.json +43 -0
- package/evals/fixtures/file-upload-media-ui.json +53 -0
- package/evals/fixtures/finish-gate-anti-slop.json +30 -0
- package/evals/fixtures/forms-accessibility-negative.json +29 -0
- package/evals/fixtures/forms-validation.json +53 -0
- package/evals/fixtures/game-go-ebitengine.json +49 -0
- package/evals/fixtures/game-godot-gdscript.json +49 -0
- package/evals/fixtures/game-ui-hud-and-engines.json +43 -0
- package/evals/fixtures/handoff-fidelity-tolerance.json +29 -0
- package/evals/fixtures/i18n-engineering.json +53 -0
- package/evals/fixtures/local-first-sync.json +53 -0
- package/evals/fixtures/lynxjs.json +53 -0
- package/evals/fixtures/maizzle-email.json +53 -0
- package/evals/fixtures/maps-geospatial.json +53 -0
- package/evals/fixtures/media-og-and-video-export.json +43 -0
- package/evals/fixtures/media-players.json +53 -0
- package/evals/fixtures/mobile-compose-16kb-foldable-store-gate.json +44 -0
- package/evals/fixtures/mobile-elixir-liveview-native.json +49 -0
- package/evals/fixtures/mobile-flutter-dynamic-type.json +49 -0
- package/evals/fixtures/mobile-harmonyos-arkui.json +49 -0
- package/evals/fixtures/mobile-jetpack-compose.json +49 -0
- package/evals/fixtures/mobile-swiftui-ios.json +49 -0
- package/evals/fixtures/motion-engineering.json +69 -0
- package/evals/fixtures/pdfjs-and-pptx.json +53 -0
- package/evals/fixtures/plan-brownfield-evidence.json +28 -0
- package/evals/fixtures/plan-discovery-interview.json +31 -0
- package/evals/fixtures/plan-grill-me-brainstorm-gate.json +49 -0
- package/evals/fixtures/reactive-data-apps.json +53 -0
- package/evals/fixtures/review-evidence-audit.json +43 -0
- package/evals/fixtures/rich-text-and-code-editors.json +53 -0
- package/evals/fixtures/scrollytelling-resilience.json +70 -0
- package/evals/fixtures/spatial-xr-comfort-and-platforms.json +43 -0
- package/evals/fixtures/state-architecture.json +53 -0
- package/evals/fixtures/styling-ecosystem.json +53 -0
- package/evals/fixtures/token-tooling.json +53 -0
- package/evals/fixtures/tui-go-bubbletea.json +49 -0
- package/evals/fixtures/tui-rust-ratatui-grapheme-paste-teardown.json +44 -0
- package/evals/fixtures/tui-rust-ratatui.json +49 -0
- package/evals/fixtures/ux-state-matrix-and-i18n.json +43 -0
- package/evals/fixtures/visual-qa-task-evidence.json +29 -0
- package/evals/fixtures/web-3d-engines.json +53 -0
- package/evals/fixtures/web-php-laravel-filament.json +49 -0
- package/evals/fixtures/web-ruby-viewcomponent-phlex.json +49 -0
- package/evals/fixtures/workflow-checkpoints.json +30 -0
- package/evals/pixelcraft-accessibility.md +74 -0
- package/evals/pixelcraft-brandkit.md +58 -0
- package/evals/pixelcraft-chat-ui.md +55 -0
- package/evals/pixelcraft-constrained.md +55 -0
- package/evals/pixelcraft-craft.md +76 -0
- package/evals/pixelcraft-data-apps.md +55 -0
- package/evals/pixelcraft-dataviz.md +59 -0
- package/evals/pixelcraft-desktop.md +55 -0
- package/evals/pixelcraft-direction.md +77 -0
- package/evals/pixelcraft-document.md +55 -0
- package/evals/pixelcraft-email.md +55 -0
- package/evals/pixelcraft-extensions.md +55 -0
- package/evals/pixelcraft-game-ui.md +59 -0
- package/evals/pixelcraft-handoff.md +57 -0
- package/evals/pixelcraft-media.md +55 -0
- package/evals/pixelcraft-mobile.md +59 -0
- package/evals/pixelcraft-patterns.md +73 -0
- package/evals/pixelcraft-plan.md +127 -0
- package/evals/pixelcraft-review.md +63 -0
- package/evals/pixelcraft-spatial.md +55 -0
- package/evals/pixelcraft-tokens.md +57 -0
- package/evals/pixelcraft-tui.md +55 -0
- package/evals/pixelcraft-ux.md +59 -0
- package/evals/pixelcraft-visual-qa.md +86 -0
- package/evals/pixelcraft-web.md +89 -0
- package/evals/pixelcraft.md +70 -0
- package/gemini-extension.json +6 -0
- package/install.ps1 +341 -0
- package/install.sh +512 -0
- package/package.json +91 -4
- package/plugin.json +29 -0
- package/scripts/build-adapters.mjs +288 -0
- package/scripts/build-release-archives.mjs +61 -0
- package/scripts/build-skill-zips.mjs +94 -0
- package/scripts/run-evals.mjs +397 -0
- package/scripts/sync-docs.mjs +381 -0
- package/scripts/test-build-adapters.mjs +61 -0
- package/scripts/test-cross-platform-qa.mjs +359 -0
- package/scripts/test-distribution.mjs +203 -0
- package/scripts/test-export-tokens.mjs +361 -0
- package/scripts/test-finish-gate.mjs +271 -0
- package/scripts/test-installers.mjs +216 -0
- package/scripts/test-release-archives.mjs +42 -0
- package/scripts/test-shoot.mjs +87 -0
- package/scripts/test-slop-scan.mjs +416 -0
- package/scripts/test-style-inventory.mjs +234 -0
- package/scripts/test-sync-docs.mjs +140 -0
- package/scripts/test-validate-skills.mjs +195 -0
- package/scripts/validate-skills.mjs +658 -0
- package/skills/pixelcraft/SKILL.md +155 -0
- package/skills/pixelcraft/references/design-brief.md +75 -0
- package/skills/pixelcraft/references/floor.md +90 -0
- package/skills/pixelcraft/references/report-template.md +49 -0
- package/skills/pixelcraft/references/stack-detection.md +226 -0
- package/skills/pixelcraft/references/surface-acceptance.md +52 -0
- package/skills/pixelcraft/references/workflow-checkpoints.md +71 -0
- package/skills/pixelcraft-accessibility/SKILL.md +54 -0
- package/skills/pixelcraft-accessibility/references/apg-patterns.md +64 -0
- package/skills/pixelcraft-accessibility/references/motion-canvas.md +57 -0
- package/skills/pixelcraft-accessibility/references/platforms.md +86 -0
- package/skills/pixelcraft-accessibility/references/verification.md +64 -0
- package/skills/pixelcraft-accessibility/references/wcag22-checks.md +99 -0
- package/skills/pixelcraft-brandkit/SKILL.md +127 -0
- package/skills/pixelcraft-brandkit/references/asset-pipeline.md +165 -0
- package/skills/pixelcraft-brandkit/references/brand-governance.md +82 -0
- package/skills/pixelcraft-brandkit/references/layouts.md +88 -0
- package/skills/pixelcraft-brandkit/references/logo-concepting.md +83 -0
- package/skills/pixelcraft-brandkit/references/logo-methods.md +97 -0
- package/skills/pixelcraft-brandkit/references/pixel-art-logos.md +82 -0
- package/skills/pixelcraft-brandkit/references/prompt-template.md +87 -0
- package/skills/pixelcraft-brandkit/references/qa-checklist.md +93 -0
- package/skills/pixelcraft-brandkit/references/visual-modes.md +123 -0
- package/skills/pixelcraft-chat-ui/SKILL.md +57 -0
- package/skills/pixelcraft-chat-ui/references/agentic-workspace.md +66 -0
- package/skills/pixelcraft-chat-ui/references/ai-ui-libraries.md +259 -0
- package/skills/pixelcraft-chat-ui/references/conversation-design.md +84 -0
- package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +77 -0
- package/skills/pixelcraft-chat-ui/references/slack-discord.md +80 -0
- package/skills/pixelcraft-constrained/SKILL.md +52 -0
- package/skills/pixelcraft-constrained/references/specialized-hardware.md +90 -0
- package/skills/pixelcraft-constrained/references/tv-wearables.md +134 -0
- package/skills/pixelcraft-constrained/references/voice-ui.md +104 -0
- package/skills/pixelcraft-craft/SKILL.md +58 -0
- package/skills/pixelcraft-craft/references/color.md +125 -0
- package/skills/pixelcraft-craft/references/imagery-icons.md +37 -0
- package/skills/pixelcraft-craft/references/layout-quality.md +65 -0
- package/skills/pixelcraft-craft/references/layout.md +73 -0
- package/skills/pixelcraft-craft/references/motion.md +163 -0
- package/skills/pixelcraft-craft/references/typography.md +110 -0
- package/skills/pixelcraft-data-apps/SKILL.md +86 -0
- package/skills/pixelcraft-data-apps/references/ai-and-internal-data-apps.md +147 -0
- package/skills/pixelcraft-data-apps/references/dash.md +109 -0
- package/skills/pixelcraft-data-apps/references/evidence.md +90 -0
- package/skills/pixelcraft-data-apps/references/gradio.md +103 -0
- package/skills/pixelcraft-data-apps/references/julia-genie.md +89 -0
- package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +91 -0
- package/skills/pixelcraft-data-apps/references/nicegui.md +102 -0
- package/skills/pixelcraft-data-apps/references/observable-framework.md +105 -0
- package/skills/pixelcraft-data-apps/references/panel.md +99 -0
- package/skills/pixelcraft-data-apps/references/r-shiny.md +124 -0
- package/skills/pixelcraft-data-apps/references/reactive-data-apps.md +186 -0
- package/skills/pixelcraft-data-apps/references/reflex.md +116 -0
- package/skills/pixelcraft-data-apps/references/shiny.md +110 -0
- package/skills/pixelcraft-data-apps/references/streamlit.md +113 -0
- package/skills/pixelcraft-dataviz/SKILL.md +60 -0
- package/skills/pixelcraft-dataviz/references/chart-choice.md +55 -0
- package/skills/pixelcraft-dataviz/references/color-accessibility.md +112 -0
- package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +107 -0
- package/skills/pixelcraft-dataviz/references/libraries.md +176 -0
- package/skills/pixelcraft-dataviz/references/maps-geospatial.md +159 -0
- package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +92 -0
- package/skills/pixelcraft-desktop/SKILL.md +93 -0
- package/skills/pixelcraft-desktop/references/appkit.md +92 -0
- package/skills/pixelcraft-desktop/references/avalonia.md +95 -0
- package/skills/pixelcraft-desktop/references/cpp-gui.md +129 -0
- package/skills/pixelcraft-desktop/references/electron.md +96 -0
- package/skills/pixelcraft-desktop/references/go-gui.md +83 -0
- package/skills/pixelcraft-desktop/references/gtk.md +97 -0
- package/skills/pixelcraft-desktop/references/javafx-swing.md +81 -0
- package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +88 -0
- package/skills/pixelcraft-desktop/references/rust-gui.md +83 -0
- package/skills/pixelcraft-desktop/references/tauri.md +110 -0
- package/skills/pixelcraft-desktop/references/uno-platform.md +71 -0
- package/skills/pixelcraft-desktop/references/winui-wpf.md +98 -0
- package/skills/pixelcraft-desktop/references/working-context.md +84 -0
- package/skills/pixelcraft-direction/SKILL.md +120 -0
- package/skills/pixelcraft-direction/references/composition-library.md +84 -0
- package/skills/pixelcraft-direction/references/creative-brainstorming.md +72 -0
- package/skills/pixelcraft-direction/references/direction-card.md +64 -0
- package/skills/pixelcraft-direction/references/direction-scoring.md +76 -0
- package/skills/pixelcraft-direction/references/motion-identity.md +67 -0
- package/skills/pixelcraft-direction/references/movements.md +71 -0
- package/skills/pixelcraft-direction/references/reference-analysis.md +37 -0
- package/skills/pixelcraft-direction/references/repetition-history.md +75 -0
- package/skills/pixelcraft-direction/references/slop-fingerprints.md +83 -0
- package/skills/pixelcraft-direction/references/wildcards.md +47 -0
- package/skills/pixelcraft-document/SKILL.md +58 -0
- package/skills/pixelcraft-document/references/archetypes.md +106 -0
- package/skills/pixelcraft-document/references/pdf-tools.md +314 -0
- package/skills/pixelcraft-document/references/pdfjs-and-pptx.md +114 -0
- package/skills/pixelcraft-document/references/print-css.md +187 -0
- package/skills/pixelcraft-document/references/slides.md +198 -0
- package/skills/pixelcraft-email/SKILL.md +80 -0
- package/skills/pixelcraft-email/references/client-quirks.md +113 -0
- package/skills/pixelcraft-email/references/html-tables.md +114 -0
- package/skills/pixelcraft-email/references/maizzle.md +54 -0
- package/skills/pixelcraft-email/references/mjml.md +54 -0
- package/skills/pixelcraft-email/references/react-email.md +95 -0
- package/skills/pixelcraft-extensions/SKILL.md +56 -0
- package/skills/pixelcraft-extensions/references/browser-extensions.md +105 -0
- package/skills/pixelcraft-extensions/references/figma-office.md +106 -0
- package/skills/pixelcraft-extensions/references/ide-and-saas-plugins.md +125 -0
- package/skills/pixelcraft-extensions/references/raycast.md +98 -0
- package/skills/pixelcraft-extensions/references/vscode-webviews.md +100 -0
- package/skills/pixelcraft-game-ui/SKILL.md +80 -0
- package/skills/pixelcraft-game-ui/references/bevy.md +90 -0
- package/skills/pixelcraft-game-ui/references/godot.md +130 -0
- package/skills/pixelcraft-game-ui/references/hud-principles.md +67 -0
- package/skills/pixelcraft-game-ui/references/love2d.md +77 -0
- package/skills/pixelcraft-game-ui/references/monogame.md +68 -0
- package/skills/pixelcraft-game-ui/references/unity-ugui.md +109 -0
- package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +107 -0
- package/skills/pixelcraft-game-ui/references/unreal-umg.md +80 -0
- package/skills/pixelcraft-game-ui/references/web-and-middleware-game-ui.md +122 -0
- package/skills/pixelcraft-handoff/SKILL.md +50 -0
- package/skills/pixelcraft-handoff/references/design-translation.md +134 -0
- package/skills/pixelcraft-handoff/references/fidelity-tolerance.md +78 -0
- package/skills/pixelcraft-handoff/references/motion-handoff.md +54 -0
- package/skills/pixelcraft-media/SKILL.md +49 -0
- package/skills/pixelcraft-media/references/banners-video.md +130 -0
- package/skills/pixelcraft-media/references/og-generation.md +154 -0
- package/skills/pixelcraft-media/references/social-cards.md +71 -0
- package/skills/pixelcraft-mobile/SKILL.md +86 -0
- package/skills/pixelcraft-mobile/references/dotnet-maui.md +91 -0
- package/skills/pixelcraft-mobile/references/flet.md +80 -0
- package/skills/pixelcraft-mobile/references/flutter.md +113 -0
- package/skills/pixelcraft-mobile/references/harmonyos-and-emerging-mobile.md +121 -0
- package/skills/pixelcraft-mobile/references/ionic-capacitor.md +87 -0
- package/skills/pixelcraft-mobile/references/jetpack-compose.md +129 -0
- package/skills/pixelcraft-mobile/references/kivy.md +82 -0
- package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +86 -0
- package/skills/pixelcraft-mobile/references/lynxjs.md +110 -0
- package/skills/pixelcraft-mobile/references/nativescript-and-skip.md +91 -0
- package/skills/pixelcraft-mobile/references/react-native-expo.md +106 -0
- package/skills/pixelcraft-mobile/references/swiftui.md +200 -0
- package/skills/pixelcraft-mobile/references/tactile-interactions.md +55 -0
- package/skills/pixelcraft-mobile/references/task-state-composition.md +85 -0
- package/skills/pixelcraft-mobile/references/uikit.md +92 -0
- package/skills/pixelcraft-patterns/SKILL.md +75 -0
- package/skills/pixelcraft-patterns/references/accessibility-resilience.md +29 -0
- package/skills/pixelcraft-patterns/references/ai-and-offline-patterns.md +54 -0
- package/skills/pixelcraft-patterns/references/auth-onboarding.md +44 -0
- package/skills/pixelcraft-patterns/references/billing-paywalls.md +40 -0
- package/skills/pixelcraft-patterns/references/command-workspace.md +56 -0
- package/skills/pixelcraft-patterns/references/commerce.md +47 -0
- package/skills/pixelcraft-patterns/references/communication.md +45 -0
- package/skills/pixelcraft-patterns/references/creative-tools.md +42 -0
- package/skills/pixelcraft-patterns/references/creative-web-composition.md +38 -0
- package/skills/pixelcraft-patterns/references/dashboard-admin.md +35 -0
- package/skills/pixelcraft-patterns/references/history-diff-undo.md +50 -0
- package/skills/pixelcraft-patterns/references/marketing.md +44 -0
- package/skills/pixelcraft-patterns/references/multi-tenant-rbac.md +47 -0
- package/skills/pixelcraft-patterns/references/narrative-systems.md +42 -0
- package/skills/pixelcraft-patterns/references/notifications-activity.md +57 -0
- package/skills/pixelcraft-patterns/references/pattern-selection.md +80 -0
- package/skills/pixelcraft-patterns/references/scheduling-kanban.md +47 -0
- package/skills/pixelcraft-patterns/references/scroll-implementation.md +37 -0
- package/skills/pixelcraft-patterns/references/search-filtering.md +42 -0
- package/skills/pixelcraft-patterns/references/settings.md +51 -0
- package/skills/pixelcraft-patterns/references/tables-crud.md +43 -0
- package/skills/pixelcraft-plan/SKILL.md +103 -0
- package/skills/pixelcraft-plan/references/design-input.md +69 -0
- package/skills/pixelcraft-plan/references/discovery-interview.md +110 -0
- package/skills/pixelcraft-plan/references/grill-me-protocol.md +63 -0
- package/skills/pixelcraft-plan/references/plan-template.md +134 -0
- package/skills/pixelcraft-plan/references/repo-discovery.md +49 -0
- package/skills/pixelcraft-plan/references/stack-freshness.md +67 -0
- package/skills/pixelcraft-plan/references/stack-selection.md +98 -0
- package/skills/pixelcraft-review/SKILL.md +86 -0
- package/skills/pixelcraft-review/references/audit-report.md +69 -0
- package/skills/pixelcraft-review/references/critique-protocol.md +89 -0
- package/skills/pixelcraft-review/references/heuristics.md +63 -0
- package/skills/pixelcraft-review/references/personas.md +53 -0
- package/skills/pixelcraft-review/references/polish.md +78 -0
- package/skills/pixelcraft-review/scripts/check-acceptance.mjs +619 -0
- package/skills/pixelcraft-review/scripts/fixtures/brand-critique-waivers.json +14 -0
- package/skills/pixelcraft-review/scripts/fixtures/brand-critique.css +18 -0
- package/skills/pixelcraft-review/scripts/fixtures/clean.html +43 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-after-block.css +4 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-at-rules.css +17 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-comments.css +10 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-html-quote-leak.html +12 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-invalid-replacements.css +27 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-longhand-removal.css +34 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-nested-rules.css +19 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-not-visible-skip.css +8 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-outline-shorthands.css +11 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-and-border.css +15 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-last-wins.css +19 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-valid-replacements-extended.css +29 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-visible-no-replacement.css +3 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-visible-valid-replacements.css +9 -0
- package/skills/pixelcraft-review/scripts/fixtures/slop.html +28 -0
- package/skills/pixelcraft-review/scripts/slop-scan.mjs +1233 -0
- package/skills/pixelcraft-spatial/SKILL.md +51 -0
- package/skills/pixelcraft-spatial/references/comfort-accessibility.md +39 -0
- package/skills/pixelcraft-spatial/references/platforms.md +147 -0
- package/skills/pixelcraft-tokens/SKILL.md +60 -0
- package/skills/pixelcraft-tokens/assets/tokens.example.json +71 -0
- package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +47 -0
- package/skills/pixelcraft-tokens/references/adoption.md +55 -0
- package/skills/pixelcraft-tokens/references/format.md +84 -0
- package/skills/pixelcraft-tokens/references/governance.md +80 -0
- package/skills/pixelcraft-tokens/references/state-tokens.md +62 -0
- package/skills/pixelcraft-tokens/references/theme-presets.md +122 -0
- package/skills/pixelcraft-tokens/references/token-tooling.md +119 -0
- package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +847 -0
- package/skills/pixelcraft-tui/SKILL.md +76 -0
- package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +79 -0
- package/skills/pixelcraft-tui/references/extended-tui-toolkits.md +127 -0
- package/skills/pixelcraft-tui/references/ink.md +109 -0
- package/skills/pixelcraft-tui/references/ratatui.md +102 -0
- package/skills/pixelcraft-tui/references/rich.md +82 -0
- package/skills/pixelcraft-tui/references/terminal-protocols.md +80 -0
- package/skills/pixelcraft-tui/references/textual.md +108 -0
- package/skills/pixelcraft-ux/SKILL.md +56 -0
- package/skills/pixelcraft-ux/references/cognitive-walkthrough.md +70 -0
- package/skills/pixelcraft-ux/references/feedback-performance.md +50 -0
- package/skills/pixelcraft-ux/references/flows-ia.md +44 -0
- package/skills/pixelcraft-ux/references/forms.md +151 -0
- package/skills/pixelcraft-ux/references/i18n.md +221 -0
- package/skills/pixelcraft-ux/references/laws.md +39 -0
- package/skills/pixelcraft-ux/references/locale-test-matrix.md +60 -0
- package/skills/pixelcraft-ux/references/state-matrix.md +53 -0
- package/skills/pixelcraft-ux/references/usability-testing.md +84 -0
- package/skills/pixelcraft-ux/references/ux-writing.md +44 -0
- package/skills/pixelcraft-visual-qa/SKILL.md +96 -0
- package/skills/pixelcraft-visual-qa/references/baseline-governance.md +70 -0
- package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +59 -0
- package/skills/pixelcraft-visual-qa/references/capture-document.md +70 -0
- package/skills/pixelcraft-visual-qa/references/capture-email.md +38 -0
- package/skills/pixelcraft-visual-qa/references/capture-mobile.md +50 -0
- package/skills/pixelcraft-visual-qa/references/capture-terminal.md +35 -0
- package/skills/pixelcraft-visual-qa/references/critique-rubric.md +71 -0
- package/skills/pixelcraft-visual-qa/references/finish-gate.md +35 -0
- package/skills/pixelcraft-visual-qa/references/measured-craft.md +30 -0
- package/skills/pixelcraft-visual-qa/references/motion-capture.md +63 -0
- package/skills/pixelcraft-visual-qa/references/performance-budgets.md +78 -0
- package/skills/pixelcraft-visual-qa/references/realtime-graphics.md +55 -0
- package/skills/pixelcraft-visual-qa/references/task-verification.md +81 -0
- package/skills/pixelcraft-visual-qa/scripts/check-contrast.mjs +442 -0
- package/skills/pixelcraft-visual-qa/scripts/check-email.mjs +397 -0
- package/skills/pixelcraft-visual-qa/scripts/check-pdf.mjs +189 -0
- package/skills/pixelcraft-visual-qa/scripts/check-tui.mjs +321 -0
- package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +174 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-aria-modal.html +19 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-audit.html +34 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-modal.html +17 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-deferred.js +1 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-edge.html +52 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.html +80 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.js +8 -0
- package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +668 -0
- package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +1226 -0
- package/skills/pixelcraft-web/SKILL.md +132 -0
- package/skills/pixelcraft-web/references/accessibility-performance.md +42 -0
- package/skills/pixelcraft-web/references/adaptive-layout.md +69 -0
- package/skills/pixelcraft-web/references/angular.md +108 -0
- package/skills/pixelcraft-web/references/assets-pipeline.md +67 -0
- package/skills/pixelcraft-web/references/astro.md +113 -0
- package/skills/pixelcraft-web/references/audio-reactive.md +61 -0
- package/skills/pixelcraft-web/references/auth-and-checkout-ui.md +115 -0
- package/skills/pixelcraft-web/references/build-and-architecture.md +215 -0
- package/skills/pixelcraft-web/references/canvas-and-node-editors.md +157 -0
- package/skills/pixelcraft-web/references/clojurescript.md +88 -0
- package/skills/pixelcraft-web/references/component-systems.md +102 -0
- package/skills/pixelcraft-web/references/component-testing.md +170 -0
- package/skills/pixelcraft-web/references/creative-effects.md +59 -0
- package/skills/pixelcraft-web/references/creative-runtime.md +34 -0
- package/skills/pixelcraft-web/references/elm.md +53 -0
- package/skills/pixelcraft-web/references/enterprise-data-ui.md +138 -0
- package/skills/pixelcraft-web/references/file-upload-media-ui.md +82 -0
- package/skills/pixelcraft-web/references/forms-validation.md +123 -0
- package/skills/pixelcraft-web/references/fsharp-fable.md +54 -0
- package/skills/pixelcraft-web/references/gsap.md +102 -0
- package/skills/pixelcraft-web/references/html-css.md +220 -0
- package/skills/pixelcraft-web/references/htmx-alpine.md +103 -0
- package/skills/pixelcraft-web/references/i18n-engineering.md +106 -0
- package/skills/pixelcraft-web/references/interaction-and-search-primitives.md +196 -0
- package/skills/pixelcraft-web/references/java-web.md +61 -0
- package/skills/pixelcraft-web/references/kotlin-web.md +57 -0
- package/skills/pixelcraft-web/references/leptos-yew.md +97 -0
- package/skills/pixelcraft-web/references/lit-web-components.md +63 -0
- package/skills/pixelcraft-web/references/local-first-sync.md +105 -0
- package/skills/pixelcraft-web/references/media-players.md +104 -0
- package/skills/pixelcraft-web/references/motion-react.md +96 -0
- package/skills/pixelcraft-web/references/motion-recipes.md +82 -0
- package/skills/pixelcraft-web/references/preact-fresh-hono.md +111 -0
- package/skills/pixelcraft-web/references/pwa.md +230 -0
- package/skills/pixelcraft-web/references/qwik.md +94 -0
- package/skills/pixelcraft-web/references/r3f-integration.md +69 -0
- package/skills/pixelcraft-web/references/react-next.md +168 -0
- package/skills/pixelcraft-web/references/rendering-choice.md +63 -0
- package/skills/pixelcraft-web/references/rendering-performance.md +80 -0
- package/skills/pixelcraft-web/references/rich-text-and-code-editors.md +220 -0
- package/skills/pixelcraft-web/references/rive-lottie.md +73 -0
- package/skills/pixelcraft-web/references/scala-laminar.md +53 -0
- package/skills/pixelcraft-web/references/scene-architecture.md +132 -0
- package/skills/pixelcraft-web/references/server-rendered.md +114 -0
- package/skills/pixelcraft-web/references/shader-workflow.md +77 -0
- package/skills/pixelcraft-web/references/smooth-scroll.md +58 -0
- package/skills/pixelcraft-web/references/solid.md +111 -0
- package/skills/pixelcraft-web/references/state-architecture.md +107 -0
- package/skills/pixelcraft-web/references/styling-ecosystem.md +273 -0
- package/skills/pixelcraft-web/references/svelte.md +111 -0
- package/skills/pixelcraft-web/references/tailwind.md +99 -0
- package/skills/pixelcraft-web/references/video-media.md +69 -0
- package/skills/pixelcraft-web/references/vue-nuxt.md +86 -0
- package/skills/pixelcraft-web/references/web-3d-engines.md +97 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Token governance and lifecycle
|
|
2
|
+
|
|
3
|
+
Tokens are a public contract. Once components consume them, renaming or redefining a token is a product migration, not a cosmetic edit. Governance can be lightweight, but ownership and rollback must be explicit before a system grows beyond one screen.
|
|
4
|
+
|
|
5
|
+
## Ownership model
|
|
6
|
+
|
|
7
|
+
Assign one accountable owner for each area:
|
|
8
|
+
|
|
9
|
+
| Area | Owner responsibility |
|
|
10
|
+
|---|---|
|
|
11
|
+
| primitives | scale generation, naming consistency, licensing/provenance of assets/fonts |
|
|
12
|
+
| semantic tokens | meaning, contrast pairs, mode behavior, accessibility floor |
|
|
13
|
+
| component tokens | necessity review, component API alignment, removal when no longer justified |
|
|
14
|
+
| exporters/build outputs | generation correctness, version compatibility, consumer notification |
|
|
15
|
+
| documentation | usage examples, deprecation notices, migration guides |
|
|
16
|
+
|
|
17
|
+
In a solo project the same person may hold every role; still record the role so future agents know who must approve breaking changes. “Everyone owns tokens” means no one does.
|
|
18
|
+
|
|
19
|
+
## Change classes
|
|
20
|
+
|
|
21
|
+
| Class | Examples | Required action |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| additive | new semantic token, new mode, new optional component token | document intent; no consumer migration |
|
|
24
|
+
| corrective | fix wrong contrast/value while preserving meaning | validate consumers; record bugfix scope |
|
|
25
|
+
| behavioral | dark elevation model changes, focus-ring posture changes | visual review across affected states/modes |
|
|
26
|
+
| breaking | rename, removal, type change, changed alias target, altered semantic meaning | deprecation window or explicit migration; version bump; rollback plan |
|
|
27
|
+
| emergency | security/legal/accessibility defect | expedite, but still record affected consumers and validation evidence |
|
|
28
|
+
|
|
29
|
+
Do not silently change the meaning of an existing name. If `color.action.primary` moves from brand-blue to warning-red in meaning, create a new semantic token and migrate intentionally.
|
|
30
|
+
|
|
31
|
+
## Version and release record
|
|
32
|
+
|
|
33
|
+
Keep a `TOKENS.md`, changelog section, or equivalent release note near the token source when the project supports it:
|
|
34
|
+
|
|
35
|
+
```markdown
|
|
36
|
+
## <version/date>
|
|
37
|
+
- Added: <tokens + intended consumers>
|
|
38
|
+
- Changed: <token + behavioral effect + evidence>
|
|
39
|
+
- Deprecated: <token + replacement + removal date/version>
|
|
40
|
+
- Removed: <token + migration completed>
|
|
41
|
+
- Validation: <contrast matrix/modes/platforms/exporter tests>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Semantic-version the token package when it is versioned as a package. Treat generated CSS/native artifacts as build output; never patch them manually because that hides source drift.
|
|
45
|
+
|
|
46
|
+
## Deprecation procedure
|
|
47
|
+
|
|
48
|
+
1. Mark the old token or group with the standard DTCG `"$deprecated"` field (`true` or a migration string such as `"$deprecated": "Use color.action.primary; removal planned in v3.0"`) without changing its resolved value.
|
|
49
|
+
2. Add the replacement and migration example.
|
|
50
|
+
3. Inventory consumers before removal; search generated artifacts and platform code, not only web CSS.
|
|
51
|
+
4. Announce the removal window in the project’s normal change channel.
|
|
52
|
+
5. Migrate or shim consumers; keep aliases temporary when they reduce risk.
|
|
53
|
+
6. Remove only after consumer inventory is clean or the break is explicitly approved.
|
|
54
|
+
7. Record rollback: restore old source token and regenerate artifacts rather than hand-editing outputs.
|
|
55
|
+
|
|
56
|
+
## Rollback and recovery
|
|
57
|
+
|
|
58
|
+
Rollback must be cheap enough to use. Preserve the prior token source/version, generated artifacts, exporter version, validation matrix, and consumer compatibility notes. If rollback requires manually reverse-engineering generated files, the release process is incomplete.
|
|
59
|
+
|
|
60
|
+
## Contribution gate
|
|
61
|
+
|
|
62
|
+
Before accepting a token change, require:
|
|
63
|
+
|
|
64
|
+
- semantic purpose in user terms, not only a value;
|
|
65
|
+
- consuming surface/component example;
|
|
66
|
+
- contrast and state validation where color is involved;
|
|
67
|
+
- behavior across supported modes/themes;
|
|
68
|
+
- text scaling/localization implication where size/spacing/type is involved;
|
|
69
|
+
- platform export implication;
|
|
70
|
+
- migration/deprecation note for existing consumers;
|
|
71
|
+
- reviewer or owner decision recorded when behavior changes.
|
|
72
|
+
|
|
73
|
+
## Anti-patterns
|
|
74
|
+
|
|
75
|
+
- publishing every primitive as equally semantic API;
|
|
76
|
+
- creating component tokens for every property “just in case”;
|
|
77
|
+
- changing generated artifacts without changing source;
|
|
78
|
+
- copying a theme object into each platform and letting values drift;
|
|
79
|
+
- deprecating by deletion with no inventory;
|
|
80
|
+
- treating a token rename as safe because search finds no usage in one framework folder.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Component state token matrix
|
|
2
|
+
|
|
3
|
+
State tokens define how interface controls communicate interaction. They are semantic contracts, not decorative hover colors. Define them once at the highest useful tier and consume them consistently across platforms.
|
|
4
|
+
|
|
5
|
+
## Required state set
|
|
6
|
+
|
|
7
|
+
Cover these states where the control type supports them:
|
|
8
|
+
|
|
9
|
+
| State | Meaning | Required token categories |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| rest/default | stable baseline | background/surface, ink/icon, border, elevation |
|
|
12
|
+
| hover | pointer is over control; never required for operation | background/ink/border shift; avoid layout movement |
|
|
13
|
+
| focus-visible / focused | current keyboard/controller/remote input target | ring/outline, background/border contrast, invariant geometry |
|
|
14
|
+
| pressed/active | pointer or activation key currently down | immediate feedback; stronger but temporary contrast/depth |
|
|
15
|
+
| selected/checked/current | persistent selection or location | non-color cue plus semantic background/icon/text treatment |
|
|
16
|
+
| disabled/unavailable | visible but cannot be activated now | reduced contrast without becoming invisible; explanatory copy where needed |
|
|
17
|
+
| invalid/error | user input or process state failed validation | error border/icon/text/status token; do not rely on red alone |
|
|
18
|
+
| loading/busy/progress | action or content is pending | progress indication, disabled/interaction semantics, stable geometry |
|
|
19
|
+
| readonly | value visible but intentionally immutable | distinguish from editable and disabled without ambiguity |
|
|
20
|
+
| destructive | action causes irreversible/high-cost consequence | danger semantics, confirmation/undo behavior, restrained persistent emphasis |
|
|
21
|
+
| dragged/placeholder/target | object moving or valid drop target | position/order/affordance cues beyond color |
|
|
22
|
+
| expanded/collapsed/open | disclosure state | icon/chevron semantics, aria/state exposure, motion-safe transition |
|
|
23
|
+
|
|
24
|
+
Do not create every token for every atom. Define shared semantic roles first (`state.focus.ring`, `control.disabled.ink`, `feedback.error.surface`) and add component overrides only when behavior genuinely differs.
|
|
25
|
+
|
|
26
|
+
## Matrix template
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
| Component/region | Mode | State | Background/surface | Ink/icon | Border/ring | Elevation/overlay | Motion | Validation |
|
|
30
|
+
|---|---|---|---|---|---|---|---|---|
|
|
31
|
+
| button.primary | light | rest | | | | | | contrast/focus/target checked? |
|
|
32
|
+
| button.primary | dark | focus-visible | | | | | | |
|
|
33
|
+
| input.text | high-contrast | invalid+focus | | | | | | |
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Fill combinations that can actually occur. Invalid+focus, selected+disabled, loading+pressed, and hover+selected are common omissions. Mark impossible combinations `not applicable` instead of inventing decorative values.
|
|
37
|
+
|
|
38
|
+
## Interaction rules
|
|
39
|
+
|
|
40
|
+
1. **Hover is enhancement.** Never put essential meaning or access only in hover.
|
|
41
|
+
2. **Focus must beat theme decoration.** Focus indication needs contrast against adjacent colors in every mode and must not be clipped by overflow/rounded clipping.
|
|
42
|
+
3. **Pressed feedback is immediate.** Target acknowledgment within normal input latency; do not wait for network completion.
|
|
43
|
+
4. **Disabled does not mean invisible.** Preserve enough legibility for orientation, and explain missing permission/prerequisite when it affects the user.
|
|
44
|
+
5. **Selection is redundant.** Pair color with check/icon/text/position/weight or geometry.
|
|
45
|
+
6. **Loading preserves layout.** Avoid jumping controls; make cancellation/retry semantics explicit.
|
|
46
|
+
7. **Errors persist until corrected.** Do not clear them merely because focus moved away.
|
|
47
|
+
8. **Forced colors/high contrast may replace color tokens.** Preserve meaning through system colors, outlines, icons, and text rather than fighting the platform.
|
|
48
|
+
|
|
49
|
+
## Validation procedure
|
|
50
|
+
|
|
51
|
+
For each interactive component family:
|
|
52
|
+
|
|
53
|
+
- enumerate the realistic state combinations before implementation;
|
|
54
|
+
- verify foreground/background and border/ring contrast in all supported modes;
|
|
55
|
+
- inspect reduced-motion equivalents where state is animated;
|
|
56
|
+
- test keyboard/controller focus order and focus restoration;
|
|
57
|
+
- test touch/pointer target size outside hover-dependent behavior;
|
|
58
|
+
- inspect dark/high-contrast/forced-color rendering;
|
|
59
|
+
- validate localized/disabled/error text clipping;
|
|
60
|
+
- verify platform accessibility state (`selected`, `disabled`, `busy`, `invalid`, `expanded`) is exposed rather than only visually implied.
|
|
61
|
+
|
|
62
|
+
Exporter tests cover syntax only. They do not prove state usability; rendered or manual evidence remains necessary.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Theme presets: light, dark, and high contrast
|
|
2
|
+
|
|
3
|
+
A theme is a semantic reassignment, not a filter. Do not invert colors, flip luminance mechanically, or assume every hue keeps the same saturation/contrast across modes.
|
|
4
|
+
|
|
5
|
+
## Required preset model
|
|
6
|
+
|
|
7
|
+
Maintain at minimum:
|
|
8
|
+
|
|
9
|
+
| Mode | Purpose |
|
|
10
|
+
|---|---|
|
|
11
|
+
| light | default high-luminance surface system |
|
|
12
|
+
| dark | low-luminance surface system with adjusted elevation/accent behavior |
|
|
13
|
+
| high-contrast | accessibility-oriented variant increasing foreground/background separation and non-color redundancy; may exist in light and dark forms |
|
|
14
|
+
|
|
15
|
+
High contrast is not merely “more saturated.” It often means fewer decorative colors, stronger borders/focus indication, simpler surfaces, larger contrast ratios, and explicit system-color behavior. Decide whether it is a product theme, accessibility mode, or platform-mediated behavior and expose that choice consistently.
|
|
16
|
+
|
|
17
|
+
## Semantic dark-mode mapping
|
|
18
|
+
|
|
19
|
+
Map roles deliberately:
|
|
20
|
+
|
|
21
|
+
| Semantic role | Light behavior | Dark behavior |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `surface.base` | near-white/neutral paper | deep neutral, not pure black by default |
|
|
24
|
+
| `surface.raised` | white/light elevation | slightly lighter than base; dark elevation uses luminance/layering because black shadows disappear |
|
|
25
|
+
| `surface.overlay` | elevated card/popover | progressively lighter plus border/edge separation |
|
|
26
|
+
| `ink.primary` | dark high-contrast text | light high-contrast text, softened only enough to reduce glare |
|
|
27
|
+
| `ink.muted` | lower contrast but readable | carefully adjusted; dark muted text fails quickly |
|
|
28
|
+
| `action.primary` | saturated brand/action color | often lighter/desaturated to maintain contrast and avoid vibrating against dark surfaces |
|
|
29
|
+
| `focus.ring` | visible against surface/action | hue/luminance adjusted per surface; never same hue assumption as light |
|
|
30
|
+
| `border.subtle` | low-key gray | use actual semantic border tokens; hairlines behave differently in dark |
|
|
31
|
+
| `shadow.*` | darker shadow opacity | often reduce shadow opacity/size and add surface luminance/border instead |
|
|
32
|
+
|
|
33
|
+
Pure black backgrounds can cause smearing/halation and remove elevation cues. Pure white text can glare. Use measured contrast and real rendering, not aesthetic slogans.
|
|
34
|
+
|
|
35
|
+
Desaturate or lighten accents in dark mode when saturation vibrates or contrast fails. Preserve hue identity and state distinctness; do not make success/warning/error indistinguishable.
|
|
36
|
+
|
|
37
|
+
## `light-dark()`, `prefers-contrast`, `prefers-reduced-transparency`, and forced colors
|
|
38
|
+
|
|
39
|
+
On modern web targets, pair `color-scheme: light dark` with CSS Color 5 `light-dark()` so form controls, scrollbars, and semantic color tokens switch cleanly under system preference or explicit user choice (`color-scheme: light` / `color-scheme: dark` on `:root[data-theme="..."]`):
|
|
40
|
+
|
|
41
|
+
```css
|
|
42
|
+
:root {
|
|
43
|
+
color-scheme: light dark;
|
|
44
|
+
--color-surface-base: light-dark(oklch(0.98 0.005 95), oklch(0.20 0.01 265));
|
|
45
|
+
--color-ink-primary: light-dark(oklch(0.22 0.015 265), oklch(0.93 0.008 95));
|
|
46
|
+
}
|
|
47
|
+
:root[data-theme="light"] { color-scheme: light; }
|
|
48
|
+
:root[data-theme="dark"] { color-scheme: dark; }
|
|
49
|
+
|
|
50
|
+
@media (prefers-contrast: more) { /* stronger borders, ink separation, and focus outlines */ }
|
|
51
|
+
@media (prefers-reduced-transparency: reduce) { /* replace translucent/glass fills with opaque surface tokens */ }
|
|
52
|
+
@media (forced-colors: active) { /* preserve platform system colors and borders */ }
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`prefers-contrast` values include `no-preference`, `more`, `less`, and `custom`. Whenever a theme uses translucent or glass surfaces, provide an opaque high-contrast token swap under `prefers-reduced-transparency: reduce` (and Apple/Windows Reduce Transparency settings). Forced Colors Mode/Windows High Contrast is stronger: the platform constrains colors. Use system colors such as `Canvas`, `CanvasText`, `ButtonText`, `ButtonFace`, `LinkText`, `Highlight`, and `HighlightText` deliberately. Do not remove outlines/backgrounds that the platform needs for meaning, and do not use box shadows/background-only cues that disappear in forced colors.
|
|
56
|
+
|
|
57
|
+
### Anti-FOUC pre-paint theme initialization
|
|
58
|
+
|
|
59
|
+
For web apps supporting a persisted user theme override (`light` / `dark` / `system`), execute a tiny synchronous inline script in `<head>` **before** stylesheets paint so the page never flashes light mode before hydrating dark mode (or emit the saved theme cookie on the server during SSR):
|
|
60
|
+
|
|
61
|
+
```html
|
|
62
|
+
<script>
|
|
63
|
+
(() => {
|
|
64
|
+
try {
|
|
65
|
+
const saved = localStorage.getItem('theme');
|
|
66
|
+
const prefersDark = matchMedia('(prefers-color-scheme: dark)').matches;
|
|
67
|
+
const mode = saved === 'light' || saved === 'dark' ? saved : (prefersDark ? 'dark' : 'light');
|
|
68
|
+
document.documentElement.dataset.theme = mode;
|
|
69
|
+
document.documentElement.style.colorScheme = mode;
|
|
70
|
+
} catch {}
|
|
71
|
+
})();
|
|
72
|
+
</script>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## DTCG modes: Resolver vs. `$extensions.pixelcraft.modes`
|
|
76
|
+
|
|
77
|
+
For multi-theme and multi-brand production pipelines, use the **W3C DTCG 2025.10 Resolver Specification** (`*.resolver.json` with `sets`, `modifiers`, `contexts`, and `resolutionOrder`, documented in `references/format.md`) compiled with Terrazzo or Resolver-aware Style Dictionary.
|
|
78
|
+
|
|
79
|
+
For lightweight single-file token sets exported with Pixelcraft's zero-dependency `scripts/export-tokens.mjs`, use token-level overrides under `$extensions.pixelcraft.modes`. A replacement can be a raw value or an object containing `$value`:
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"color": {
|
|
84
|
+
"$type": "color",
|
|
85
|
+
"surface": {
|
|
86
|
+
"$value": { "colorSpace": "oklch", "components": [0.98, 0.005, 95], "alpha": 1 },
|
|
87
|
+
"$extensions": {
|
|
88
|
+
"pixelcraft": {
|
|
89
|
+
"modes": {
|
|
90
|
+
"dark": { "$value": { "colorSpace": "oklch", "components": [0.2, 0.01, 265], "alpha": 1 } },
|
|
91
|
+
"high-contrast": { "$value": { "colorSpace": "oklch", "components": [1, 0, 0], "alpha": 1 } }
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Use [../assets/tokens.modes.example.json](../assets/tokens.modes.example.json) for a fuller working file. Export a mode with:
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
node scripts/export-tokens.mjs assets/tokens.modes.example.json --format css --mode dark
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Rules:
|
|
107
|
+
|
|
108
|
+
- default/base `$value` remains the light or baseline theme;
|
|
109
|
+
- a mode may override only tokens that differ; unspecified tokens inherit the base value;
|
|
110
|
+
- references inside mode replacements resolve against the same token graph;
|
|
111
|
+
- mode names are lowercase hyphenated product semantics (`dark`, `high-contrast`, `dim`, brand/context modes), not implementation selectors;
|
|
112
|
+
- generated artifacts are output; do not manually patch one mode in generated CSS/native files.
|
|
113
|
+
|
|
114
|
+
## Validation matrix
|
|
115
|
+
|
|
116
|
+
- verify all required foreground/background pairings in every mode rather than isolated swatches;
|
|
117
|
+
- test hover/active/focus/selected/disabled/destructive/success/warning/info states;
|
|
118
|
+
- test elevation/order overlaps: base → raised → overlay → modal/popover;
|
|
119
|
+
- test charts/data visualization semantic palettes separately;
|
|
120
|
+
- inspect forced-colors and high-contrast rendering where the platform supports them;
|
|
121
|
+
- test transition/flash behavior at page load and theme switch;
|
|
122
|
+
- verify screenshots at real scale—contrast math does not capture glare, halation, antialiasing, or visual vibration.
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Design token tooling and Figma Code Connect pipeline
|
|
2
|
+
|
|
3
|
+
Use Pixelcraft's bundled `scripts/export-tokens.mjs` for lightweight zero-dependency DTCG exports, and step up to **Terrazzo**, **Style Dictionary v4**, **Tokens Studio**, and **Figma Variables + MCP Server + Code Connect** when a multi-platform design system needs DTCG Resolver builds, CI pipelines, live design-context reads, and Dev Mode component mapping.
|
|
4
|
+
|
|
5
|
+
## Tooling decision matrix
|
|
6
|
+
|
|
7
|
+
| Tool | Role | Best fit | Primary trade-off |
|
|
8
|
+
|---|---|---|---|
|
|
9
|
+
| **Terrazzo (`@terrazzo/cli`)** | Native W3C DTCG 2025.10 + Resolver compiler (`terrazzo.config.ts`) with CSS, Tailwind, Swift, JS/TS plugins | Teams adopting DTCG 2025.10 + `*.resolver.json` directly with strict spec validation and OKLCH color handling | Newer plugin ecosystem than Style Dictionary; verify custom platform targets before migrating |
|
|
10
|
+
| **Style Dictionary (v4+)** | Multi-platform token compiler (CSS, SCSS, Tailwind, Swift, Kotlin/Compose, Android XML) | Production multi-platform design systems consuming W3C DTCG JSON with rich custom transforms | Do not mix DTCG (`$value`/`$type`) and legacy (`value`/`type`) syntax inside the same Style Dictionary instance |
|
|
11
|
+
| **Tokens Studio (`@tokens-studio/sd-transforms`)** | Figma plugin + Style Dictionary transform bridge | Teams authoring multi-theme token sets in Figma and syncing via Git PRs | Requires `@tokens-studio/sd-transforms` preprocessor to normalize Tokens Studio math/composite tokens for Style Dictionary |
|
|
12
|
+
| **Figma Variables (REST / Plugin API)** | Native Figma variable collections and modes (Light/Dark/Brand/Density) | Direct variable-to-DTCG export and mode parity | Variable modes are tier-gated by Figma plan; map semantic collections cleanly to DTCG Resolver contexts |
|
|
13
|
+
| **Figma MCP Server** | Streams live Figma frame structure, variable definitions (`get_variable_defs`), screenshots, and Code Connect maps directly into coding agents | Reducing manual handoff drift by grounding agents in exact variables and bound component snippets | Requires authenticated Figma desktop/remote MCP server; still verify rendered output and missing states in code |
|
|
14
|
+
| **Figma Code Connect (`@figma/code-connect`)** | Maps Figma component variants to real production code snippets in Dev Mode & Figma MCP | Preventing design-to-code drift across React (`*.figma.tsx`), HTML/Web Components (`*.figma.ts`), SwiftUI (`*.figma.swift`), and Jetpack Compose (`*.figma.kt`) | Requires maintaining mapping files alongside component prop/parameter changes in CI |
|
|
15
|
+
|
|
16
|
+
## Verified implementation idioms
|
|
17
|
+
|
|
18
|
+
### Terrazzo (DTCG 2025.10 + Resolver)
|
|
19
|
+
|
|
20
|
+
Use `terrazzo.config.ts` to compile `*.resolver.json` or `*.tokens.json` with first-class DTCG validation and multi-mode CSS/JS/Swift plugins:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
// terrazzo.config.ts
|
|
24
|
+
import { defineConfig } from '@terrazzo/cli';
|
|
25
|
+
import css from '@terrazzo/plugin-css';
|
|
26
|
+
import js from '@terrazzo/plugin-js';
|
|
27
|
+
|
|
28
|
+
export default defineConfig({
|
|
29
|
+
tokens: ['./tokens/design-system.resolver.json'],
|
|
30
|
+
outDir: './dist/tokens/',
|
|
31
|
+
plugins: [
|
|
32
|
+
css({
|
|
33
|
+
filename: 'tokens.css',
|
|
34
|
+
modeSelectors: [
|
|
35
|
+
{ mode: 'dark', selectors: ['[data-theme="dark"]'] },
|
|
36
|
+
{ mode: 'high-contrast', selectors: ['[data-contrast="more"]'] },
|
|
37
|
+
],
|
|
38
|
+
}),
|
|
39
|
+
js({ js: 'tokens.js', dts: 'tokens.d.ts' }),
|
|
40
|
+
],
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Style Dictionary v4 (DTCG + semantic `outputReferences`)
|
|
45
|
+
|
|
46
|
+
- Use `outputReferences: true` (or a predicate function `(token, { dictionary, usesDtcg }) => boolean`) in `css/variables` so semantic CSS variables preserve `var(--primitive)` references rather than flattening every token to hardcoded hex values.
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
// style-dictionary.config.mjs
|
|
50
|
+
import { formats, transformGroups } from 'style-dictionary/enums';
|
|
51
|
+
|
|
52
|
+
export default {
|
|
53
|
+
source: ['tokens/**/*.tokens.json'],
|
|
54
|
+
usesDtcg: true,
|
|
55
|
+
platforms: {
|
|
56
|
+
css: {
|
|
57
|
+
transformGroup: transformGroups.css,
|
|
58
|
+
files: [
|
|
59
|
+
{
|
|
60
|
+
destination: 'dist/tokens.css',
|
|
61
|
+
format: formats.cssVariables,
|
|
62
|
+
options: {
|
|
63
|
+
outputReferences: true,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Figma Code Connect (`*.figma.tsx`, HTML, SwiftUI, Compose)
|
|
73
|
+
|
|
74
|
+
- Use modern Figma `/design/` URLs (not legacy `/file/` URLs) and map component properties explicitly with `figma.enum`, `figma.boolean`, `figma.string`, and `figma.children` so Dev Mode and Figma MCP emit real, type-checked component calls instead of raw div/CSS reconstructions.
|
|
75
|
+
- Author platform-native bindings alongside each stack's components: `*.figma.tsx` (React), `*.figma.ts` with `@figma/code-connect/html` (HTML / Web Components / Angular / Vue), `*.figma.swift` (`FigmaConnect` protocol for SwiftUI), and `*.figma.kt` (`@FigmaConnect` annotation for Jetpack Compose).
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
// Button.figma.tsx
|
|
79
|
+
import figma from '@figma/code-connect';
|
|
80
|
+
import { Button } from './Button';
|
|
81
|
+
|
|
82
|
+
figma.connect(Button, 'https://www.figma.com/design/FILE_KEY/DesignSystem?node-id=1-2', {
|
|
83
|
+
props: {
|
|
84
|
+
size: figma.enum('Size', { Small: 'sm', Medium: 'md', Large: 'lg' }),
|
|
85
|
+
disabled: figma.boolean('Disabled'),
|
|
86
|
+
children: figma.children('Label'),
|
|
87
|
+
},
|
|
88
|
+
example: ({ size, disabled, children }) => (
|
|
89
|
+
<Button size={size} disabled={disabled}>
|
|
90
|
+
{children}
|
|
91
|
+
</Button>
|
|
92
|
+
),
|
|
93
|
+
});
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Pipeline governance rules
|
|
97
|
+
|
|
98
|
+
- Treat compiled platform outputs (`dist/tokens.css`, `Tokens.swift`, `Tokens.kt`, `tokens.d.ts`) as **generated build artifacts**—never hand-edit them.
|
|
99
|
+
- Run token schema validation, broken-reference checks, `$deprecated` audit warnings, and `figma connect parse` in CI so renaming a token or component prop breaks the build immediately rather than silently drifting in Figma.
|
|
100
|
+
|
|
101
|
+
## Do/don't pairs
|
|
102
|
+
|
|
103
|
+
| Do | Don't |
|
|
104
|
+
|---|---|
|
|
105
|
+
| Use Terrazzo or Style Dictionary v4 with `usesDtcg: true` for DTCG 2025.10 builds | Mix legacy `value`/`type` and DTCG `$value`/`$type` in the same compiler instance |
|
|
106
|
+
| Enable `outputReferences` to preserve semantic-to-primitive CSS var chains | Flatten every semantic token to raw hex and lose runtime theme overrides |
|
|
107
|
+
| Use `/design/` URLs and co-locate Code Connect files (`*.figma.tsx`/`.ts`/`.swift`/`.kt`) checked in CI | Leave Code Connect snippets stale after renaming component props or rely on `/file/` URLs |
|
|
108
|
+
| Read bound variables and component mappings via Figma MCP Server during handoff | Visually eyeball hex values from screenshots when Figma Variables exist |
|
|
109
|
+
| Register `@tokens-studio/sd-transforms` when compiling Tokens Studio exports | Feed raw Tokens Studio math expressions into plain Style Dictionary without transforms |
|
|
110
|
+
|
|
111
|
+
## Verification commands
|
|
112
|
+
|
|
113
|
+
```sh
|
|
114
|
+
npx tz build # Terrazzo DTCG / Resolver build + lint
|
|
115
|
+
npx style-dictionary build # Style Dictionary v4 build
|
|
116
|
+
npx figma connect parse # Validate Code Connect mappings without publishing
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Verify generated CSS/TS/Swift/Kotlin/XML/XAML/Rust artifacts (`static`) and confirm theme-mode overrides resolve without broken `var(--*)` references in a real browser or native runtime (`rendered`).
|