@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,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pixelcraft-spatial
|
|
3
|
+
description: Designs and verifies embodied spatial, XR, VR, and AR interfaces across visionOS 26, Android XR (Jetpack XR / Compose for XR), Meta Horizon OS / Meta Spatial SDK, WebXR (@react-three/xr, Wonderland Engine, Needle Engine), Unity XR Interaction Toolkit, and Unreal OpenXR. Use for headset, room-scale, windows/volumes/immersive spaces, RealityKit, SceneCore, ornaments/orbiters, gaze-and-pinch/hand/controller input, locomotion comfort, depth/layering, spatial text legibility, frame-rate budgets, privacy, and XR accessibility; ordinary browser 3D scenes use pixelcraft-web.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
version: 0.1.0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Pixelcraft spatial
|
|
10
|
+
|
|
11
|
+
Spatial UI is embodied interface design. Depth, scale, motion, head/body ergonomics, input privacy, frame stability, and real-world safety are product behavior—not decorative polish. Do not place a flat screen in space and call it XR.
|
|
12
|
+
|
|
13
|
+
## Surface craft
|
|
14
|
+
|
|
15
|
+
Attach depth to a meaningful relationship such as an object with nearby annotation, not decorative panels scattered around the room. Keep primary controls at a comfortable stable depth; offer seated and low-motion routes, with a non-immersive alternative where practical. Verify occlusion, relocalization and task completion with actual input when hardware is available.
|
|
16
|
+
|
|
17
|
+
## References
|
|
18
|
+
|
|
19
|
+
- Read [references/platforms.md](references/platforms.md) for visionOS 2/26, Android XR (Jetpack Compose for XR / SceneCore), Meta Horizon OS / Meta Spatial SDK, WebXR (`@react-three/xr` v6, Wonderland Engine, Needle Engine, Babylon.js/PlayCanvas WebXR, WebXR Layers), Unity XR Interaction Toolkit, and Unreal OpenXR.
|
|
20
|
+
- Read [references/comfort-accessibility.md](references/comfort-accessibility.md) for locomotion comfort, frame-rate discipline, ergonomic distances/fields of view, angular sizing, depth/layering, gaze/pinch privacy, text legibility, and XR accessibility.
|
|
21
|
+
|
|
22
|
+
For ordinary browser 3D product scenes and graphics runtimes (`<model-viewer>`, Three.js/R3F, Babylon.js, PlayCanvas, Threlte, TresJS, luma.gl), use the `pixelcraft-web` skill.
|
|
23
|
+
|
|
24
|
+
## Required workflow
|
|
25
|
+
|
|
26
|
+
1. **Define reality model.** Shared windowed workspace, bounded volume, mixed-reality passthrough, immersive VR, tabletop/room scale, seated/standing/mobile use, and session duration.
|
|
27
|
+
2. **Map input truth.** Gaze/pinch, direct touch, indirect ray, controllers, hand tracking, keyboard/voice/gamepad, tracking loss, latency, and privacy permissions.
|
|
28
|
+
3. **Establish scale and coordinate systems.** Units, floor/reference space, user height/seated mode, recentering, collision/boundary behavior, and real-world object persistence.
|
|
29
|
+
4. **Design depth hierarchy.** Primary content, interactable objects, ambient context, UI chrome, passthrough visibility, occlusion, shadows, focus feedback, and layering collisions.
|
|
30
|
+
5. **Choose comfort intentionally.** Physical movement, teleport, snap/continuous turn, continuous motion, acceleration, camera motion, vignette, and user comfort settings.
|
|
31
|
+
6. **Verify in headset.** Simulator/browser rendering cannot prove comfort, stereo convergence, input fatigue, scale, tracking, or frame stability.
|
|
32
|
+
|
|
33
|
+
## Non-negotiable rules
|
|
34
|
+
|
|
35
|
+
| Concern | Rule |
|
|
36
|
+
|---|---|
|
|
37
|
+
| **Meta Quest VRC & frame lock** | Render the first head-tracked interactive frame in **`<= 4 s`** from launch and hold a locked **`72 / 90 / 120 fps`** (**`0` head-pose frame drops**; enable dynamic/eye-tracked foveated rendering `FFR`/`ETFR` before cutting stereo clarity). |
|
|
38
|
+
| **visionOS target & zero-shift gaze** | Size interactive spatial targets **`>= 60×60 pt` (`dpt`)** with **`>= 12–16 pt` edge spacing** (`>= 72–76 pt` center-to-center) and enforce **zero geometry/layout shift on eye-gaze hover**—use subtle OS specular/luminance `.hoverEffect()` only (resizing or nudging bounds under gaze causes saccadic oscillation and eye strain!). |
|
|
39
|
+
| **Spatial ergonomics & postures** | Anchor primary reading/control panels **`1.2–2.0 m`** away and **`5–15°` below eye horizon**, support **relaxed lap-level indirect pinch** ("gorilla-arm" prevention), **full one-handed completion** (zero mandatory two-hand chorded gestures without single-hand alternative), and **Seated, Standing, Wheelchair, AND Lying-down / Reclined recentering & height calibration**. |
|
|
40
|
+
| **No head-locked HUDs & interruption recovery** | **Never lock world-blocking HUD panels rigidly to head rotation** (use world-locked, lazy-follow, or wrist/orbiter anchors); never rotate/move the camera involuntarily; ship **teleport + `30–45°` snap-turn + angular comfort vignette** defaults; and handle **tracking-lost, low-light hand-tracking degradation, small-room/stationary guardian boundary, and headset-removed/donned interruption states** gracefully without disorientation or data loss. |
|
|
41
|
+
| **Passthrough & privacy** | Reserve raw eye-gaze rays strictly to OS system hover (zero covert gaze telemetry), disclose room/hand/camera permissions, and verify **passthrough UI legibility in both sunlit bright rooms AND dim rooms**. |
|
|
42
|
+
| **Spatial captions, audio cues & physical comfort QA** | Pair directional 3D audio with **world/lazy-anchored spatial captions AND directional visual edge/radar cues** so deaf/HoH users never miss off-FOV events; provide controller/hand/voice parity; and run **multi-user body/IPD/vision comfort testing on physical headsets** (`rendered`, never inferred from flat 2D simulator previews per `Rule #0.3`). |
|
|
43
|
+
|
|
44
|
+
## Pre-submit checklist
|
|
45
|
+
|
|
46
|
+
- [ ] **Boot & frame budget**: first head-tracked frame **`<= 4 s`** and locked **`72 / 90 / 120 fps`** (`0` head-pose drops, dynamic foveation profiled) verified on physical headset or marked `not-checked`;
|
|
47
|
+
- [ ] **Targets & gaze stability**: visionOS/spatial controls **`>= 60×60 pt` (`dpt`)** with **`>= 12–16 pt` spacing** and **zero layout/geometry shift on eye-gaze hover**;
|
|
48
|
+
- [ ] **Ergonomics, one-handed & wheelchair postures**: primary panels **`1.2–2.0 m`** at **`5–15°` below eye horizon**, **relaxed lap-level indirect pinch**, **one-handed mode**, and **Seated + Standing + Wheelchair + Lying-down/Reclined** recentering verified;
|
|
49
|
+
- [ ] **Comfort, captions & interruptions**: zero head-locked world-blocking HUDs; teleport + **`30–45°` snap-turn** + vignette defaults; **spatial captions & visual cues for spatial audio**; and **tracking-lost / low-light / small-room / headset-removed interruption states** handled cleanly;
|
|
50
|
+
- [ ] **Real-room passthrough, privacy & multi-user headset comfort**: text/glass contrast tested in **sunlit bright + dim rooms**, eye-gaze kept private to OS hover, and **multi-user body/vision comfort tested on physical headsets** (or labeled `not-checked`);
|
|
51
|
+
- [ ] **Checklist-Until-Passing Stop-Gate (`<HARD-GATE>`):** walk every checklist item above + run `slop-scan.mjs --fail-on p2`, `check-contrast.mjs`, XR build/profiler checks, and `check-acceptance.mjs .pixelcraft/acceptance.json` (`pixelcraft-review`) in a `Fix → Re-verify` loop until passing (`0` `fail`/`pending` rows, `rendered` evidence on visual/perf/a11y per `Rule #0.3`).
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# XR comfort, ergonomics, and accessibility
|
|
2
|
+
|
|
3
|
+
## Locomotion, boot time (`<= 4 s`), and locked frame-rate comfort
|
|
4
|
+
|
|
5
|
+
Motion sickness stems from visual-vestibular conflict, camera acceleration, head-locked clutter, or dropped head-tracked frames:
|
|
6
|
+
|
|
7
|
+
- **Meta Quest VRC boot & frame lock**: render the **first head-tracked interactive frame in `<= 4 seconds`** from app launch (never hang on a frozen black stereo buffer!) and sustain a locked **`72 / 90 / 120 fps`** with **`0` head-pose frame drops**, enabling **Dynamic / Eye-Tracked Foveated Rendering (`FFR` / `ETFR`)** and stereo layers before sacrificing text resolution.
|
|
8
|
+
- **Zero head-locked world-blocking HUDs**: **never bolt opaque HUD panels rigidly to the HMD camera transform**—head-locked panels induce immediate claustrophobia and prevent users from glancing directly at corner labels! Use lazy-follow/tag-along tethers with angular deadzones, wrist anchors, or world-locked spatial panels.
|
|
9
|
+
- **Comfort locomotion defaults**: never move/rotate/tilt the camera involuntarily; default to **physical movement / teleport + `30–45°` snap-turn + angular tunneling vignette** (offering smooth locomotion/turn strictly as opt-in comfort settings).
|
|
10
|
+
|
|
11
|
+
## Ergonomic placement (`1.2–2.0 m`, `5–15°` below horizon), targets, and lap pinch
|
|
12
|
+
|
|
13
|
+
Use angular and physical ergonomics together (`physical size ≈ 2 × distance × tan(angle / 2)`; `1° ≈ 17.5 mm` at `1 m`, `35 mm` at `2 m`):
|
|
14
|
+
|
|
15
|
+
| Concern | Studio-Grade spatial specification |
|
|
16
|
+
|---|---|
|
|
17
|
+
| **Primary panel anchor** | **`1.2–2.0 m` depth**, angled **`5–15°` below the eye horizon** (natural resting neck/gaze posture; placing primary UI above horizon causes rapid cervical strain) |
|
|
18
|
+
| **visionOS / spatial target floor** | **`>= 60×60 pt` (`dpt`)** interactive hit area with **`>= 12–16 pt` minimum edge spacing** (`>= 72–76 pt` center-to-center) for reliable eye-gaze + pinch targeting |
|
|
19
|
+
| **"Gorilla-arm" prevention** | Support **relaxed lap-level indirect gaze-and-pinch / controller ray** for sustained sessions (`> 2 min`); reserve `0.4–0.6 m` direct mid-air poke strictly for brief optional physical manipulation |
|
|
20
|
+
| **4-posture recentering** | Support **Seated**, **Standing**, **Wheelchair** (reachable arm-arc & clearance without floor-crouch assumptions), **AND Lying-down / Reclined** (`up`-vector pitch tilt) recentering |
|
|
21
|
+
| **Near boundary** | Keep sustained reading surfaces **`>= 0.5 m`** away to avoid vergence-accommodation conflict |
|
|
22
|
+
|
|
23
|
+
## Depth, layering, and real-room passthrough lighting QA
|
|
24
|
+
|
|
25
|
+
- Near objects invite direct manipulation; mid-distance (`1.2–2.0 m`) panels support reading/selection; distant geometry provides ambient context.
|
|
26
|
+
- Avoid z-fighting, intersecting panels, and eye-level overlays that block real-world tripping hazards in mixed reality.
|
|
27
|
+
- **Dual-lighting passthrough legibility QA**: translucent glass/additive spatial materials wash out against sunlit windows and glare harshly in dark bedrooms. **Test passthrough UI legibility in BOTH sunlit bright rooms (`> 500–1,000 lux`) AND dim rooms (`< 20 lux`)**, providing adaptive dark scrims/plates behind typography.
|
|
28
|
+
|
|
29
|
+
## Zero-shift eye-gaze hover & biometric privacy
|
|
30
|
+
|
|
31
|
+
- **Zero geometry or layout shift on eye-gaze hover**: when a user's eyes sweep across controls, **never scale, translate, expand, or reflow button bounds on hover**! Moving target edges under eye-gaze triggers involuntary corrective saccades, hover oscillation loops, and severe eye strain. Use **subtle OS-rendered specular/luminance `.hoverEffect()` highlights only**, deferring size/layout transitions until explicit pinch/click commit.
|
|
32
|
+
- **Strict gaze privacy**: keep raw eye-tracking vectors inside the OS compositor hover boundary—never record covert gaze heatmaps or dwell biometrics without explicit opt-in clinical/research consent, and always provide controller/hand/voice parity when eye tracking is uncalibrated or denied.
|
|
33
|
+
|
|
34
|
+
## Interruption recovery, spatial captions & multi-user headset comfort QA
|
|
35
|
+
|
|
36
|
+
- Use sturdy font weights (Regular/Medium+), generous leading, perpendicular/billboarded text planes, and native **compositor quad/cylinder layers** (`ViewAttachmentComponent`, `WebXR Layers`, `UStereoLayerComponent`) rather than double-sampled eye-buffer textures.
|
|
37
|
+
- **Accessibility & spatial audio cues**: provide **Seated / Standing / Wheelchair / Reclined** posture modes, **full one-handed mode** (zero mandatory two-hand chorded gestures without single-hand alternative), **world/lazy-anchored spatial captions AND directional visual edge/radar cues for spatial audio**, adjustable text/panel scale, and an always-reachable pause/exit action.
|
|
38
|
+
- **Hardware & environment interruption states**: handle **tracking-lost, low-light hand-tracking fallback, small-room / stationary guardian boundary, and headset-removed / re-donned session pause & re-anchoring** cleanly without camera lurch or state loss.
|
|
39
|
+
- **Multi-user physical headset comfort testing**: run comfort and legibility sessions across **multiple users spanning different heights, IPDs, glasses/prescription inserts, and motion-sensitivity profiles on physical headsets** (`rendered`—simulator previews never satisfy `Rule #0.3` for stereo comfort or thermal `72/90/120 fps` lock; mark unavailable hardware `not-checked`).
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# XR platform idioms
|
|
2
|
+
|
|
3
|
+
## visionOS (visionOS 2 & visionOS 26)
|
|
4
|
+
|
|
5
|
+
Core surface model:
|
|
6
|
+
|
|
7
|
+
| Surface | Use |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `WindowGroup` | 2D / shallow-depth UI in Shared Space; resizing and multitasking adaptation are mandatory |
|
|
10
|
+
| `WindowGroup` (volumetric / `Volume`) | bounded 3D content viewed from multiple angles without taking over the user's room |
|
|
11
|
+
| `ImmersiveSpace` | Full Space world or mixed-reality scene when spatial presence or room-scale interaction is the task |
|
|
12
|
+
|
|
13
|
+
Key visionOS 2 & visionOS 26 capabilities:
|
|
14
|
+
|
|
15
|
+
- **visionOS 2**: react to viewing angle around volumes via `VolumeViewpoint` (`onVolumeViewpointChange`), build shared tabletop experiences with **`TabletopKit`** (table surface, seats, pawns, physics), and handle unified indirect/direct 3D input via `SpatialTapGesture` and `SpatialEventCollection`.
|
|
16
|
+
- **visionOS 26**: author 3D SwiftUI hierarchies directly with **`SpatialLayout`**, **`depthAlignment`**, and **`ViewAttachmentComponent`** (attaching SwiftUI views straight onto RealityKit entities without boilerplate `attachments:` closures); anchor persistent **wall and table spatial widgets** (`WidgetKit` spatial mounting styles); coordinate shared spatial seating and **Spatial Personas / SharePlay** via `SystemCoordinator`; apply **Liquid Glass** spatial material updates thoughtfully (preserve text contrast over bright/cluttered passthrough); and embed stereo 3D on the spatial web via Safari's **`<model>`** element.
|
|
17
|
+
- **Target sizing (`>= 60×60 pt`), zero-shift hover & privacy**: size every visionOS interactive control **`>= 60×60 pt` (`dpt`)** (via `.frame(minWidth: 60, minHeight: 60)` + `.contentShape(...)`) with **`>= 12–16 pt` spacing** between adjacent hit bounds; apply OS `.hoverEffect(.highlight)` **without scaling or shifting layout geometry on gaze hover**; keep gaze-and-pinch private to system hover; and verify **Liquid Glass** legibility over both sunlit and dim passthrough rooms.
|
|
18
|
+
|
|
19
|
+
```swift
|
|
20
|
+
import SwiftUI
|
|
21
|
+
import RealityKit
|
|
22
|
+
|
|
23
|
+
struct InspectionVolume: View {
|
|
24
|
+
var body: some View {
|
|
25
|
+
RealityView { content in
|
|
26
|
+
let root = Entity()
|
|
27
|
+
// visionOS 26: attach SwiftUI directly as an entity component
|
|
28
|
+
let label = Entity()
|
|
29
|
+
label.components.set(ViewAttachmentComponent(rootView: Text("Turbine Core").padding(12).glassBackgroundEffect()))
|
|
30
|
+
label.position = [0, 0.25, 0]
|
|
31
|
+
root.addChild(label)
|
|
32
|
+
content.add(root)
|
|
33
|
+
}
|
|
34
|
+
.gesture(SpatialTapGesture().targetedToAnyEntity().onEnded { value in
|
|
35
|
+
// Unified relaxed lap-level gaze+pinch or direct touch hit handling
|
|
36
|
+
handleInspect(entity: value.entity)
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Android XR (Jetpack XR SDK / Jetpack Compose for XR / SceneCore)
|
|
43
|
+
|
|
44
|
+
Android XR distinguishes **Home Space** (multitasking shared space where existing 2D Android/Compose apps spatialize automatically alongside other apps) from **Full Space** (single focused app with unbounded 3D environment, passthrough control, spatial panels, and 3D glTF entities via **SceneCore**).
|
|
45
|
+
|
|
46
|
+
Use **Jetpack Compose for XR** (`androidx.xr.compose.spatial`) and **Material Design for XR** idioms:
|
|
47
|
+
|
|
48
|
+
- `Subspace`: hosts spatial composables inside a 3D coordinate container when in Full Space;
|
|
49
|
+
- `SpatialPanel`: positions interactive Compose UI panels in 3D space (`1.2–2.0 m` default distance, `5–15°` below horizon) with resize/move policies;
|
|
50
|
+
- `Orbiter`: attaches floating contextual navigation rails, toolbars, or controls offset from a panel edge (Android XR equivalent of visionOS ornaments);
|
|
51
|
+
- `SpatialRow` / `SpatialColumn` and `SpatialElevation` (`SpatialElevationLevel`): arrange multi-panel workspaces and depth hierarchy without manual matrix math;
|
|
52
|
+
- **SceneCore (`Session`, `GltfModelEntity`)**: load 3D glTF/GLB assets, spatial audio, and environment skyboxes alongside Compose panels.
|
|
53
|
+
|
|
54
|
+
```kotlin
|
|
55
|
+
import androidx.compose.runtime.Composable
|
|
56
|
+
import androidx.compose.ui.unit.dp
|
|
57
|
+
import androidx.xr.compose.spatial.ContentEdge
|
|
58
|
+
import androidx.xr.compose.spatial.Orbiter
|
|
59
|
+
import androidx.xr.compose.spatial.Subspace
|
|
60
|
+
import androidx.xr.compose.subspace.SpatialPanel
|
|
61
|
+
import androidx.xr.compose.subspace.SpatialRow
|
|
62
|
+
import androidx.xr.compose.subspace.layout.SubspaceModifier
|
|
63
|
+
import androidx.xr.compose.subspace.layout.height
|
|
64
|
+
import androidx.xr.compose.subspace.layout.width
|
|
65
|
+
|
|
66
|
+
@Composable
|
|
67
|
+
fun SpatialWorkspace() {
|
|
68
|
+
Subspace {
|
|
69
|
+
SpatialRow {
|
|
70
|
+
SpatialPanel(SubspaceModifier.width(900.dp).height(640.dp)) {
|
|
71
|
+
MainDocumentView()
|
|
72
|
+
Orbiter(position = ContentEdge.Start, offset = 24.dp) {
|
|
73
|
+
WorkspaceNavRail()
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Verify both Home Space fallback (2D window resizing without `Subspace`) and Full Space transition (`Session.scene.spatialEnvironment`) so apps degrade gracefully when users switch spaces.
|
|
82
|
+
|
|
83
|
+
## Meta Horizon OS and Meta Spatial SDK (`VRC` Certification Gates)
|
|
84
|
+
|
|
85
|
+
Meta Quest Store **Virtual Reality Checks (`VRCs`)** enforce hard startup, frame-pacing, and comfort thresholds:
|
|
86
|
+
|
|
87
|
+
- **VRC performance gates**: render the **first head-tracked interactive frame in `<= 4 s`** from cold launch (stream heavy assets asynchronously behind a responsive head-tracked splash/environment), sustain locked **`72 / 90 / 120 fps`** (`0` head-pose stalls), and enable **Dynamic Foveated Rendering (`OVRManager.foveatedRenderingLevel = HighTop / Dynamic`)**.
|
|
88
|
+
- **Meta Spatial SDK (native Android / Kotlin)**: build lightweight Quest spatial apps directly in Kotlin + Jetpack Compose panels + Spatial SDK ECS without a Unity/Unreal runtime—ideal for productivity, media, and mixed-reality utilities needing fast `<= 4 s` startup and crisp 2D/3D text.
|
|
89
|
+
- **Meta XR Interaction SDK (Unity / Unreal)** + **Horizon OS UI Set**: support seamless controller + relaxed lap-level hand-pinch parity, **Seated / Standing / Lying-down** recentering, and `30–45°` snap-turn + angular tunneling vignette comfort defaults (never lock opaque HUD panels to head rotation).
|
|
90
|
+
- **Mixed Reality & Passthrough**: use **MRUK (Mixed Reality Utility Kit)** and OpenXR scene understanding for room mesh, walls, tables, and persistent spatial anchors; disclose **Passthrough Camera API** usage explicitly and verify UI legibility in both bright sunlit rooms and dim rooms.
|
|
91
|
+
|
|
92
|
+
## WebXR (2025–2026)
|
|
93
|
+
|
|
94
|
+
Feature-detect `navigator.xr` and `await navigator.xr.isSessionSupported('immersive-vr' | 'immersive-ar')` with explicit session features (`local-floor`, `bounded-floor`, `hand-tracking`, `layers`) and always ship a non-XR desktop/mobile fallback.
|
|
95
|
+
|
|
96
|
+
### `@react-three/xr` v6 + `@pmndrs/uikit`
|
|
97
|
+
|
|
98
|
+
Use the v6 store API (`createXRStore()`, `<XR store={store}>`, `<XROrigin>`) rather than deprecated v5 `<VRButton>`/`<Controllers>`/`<Hands>` wrappers. Pair with **`@pmndrs/uikit`** for crisp MSDF/SDF Flexbox spatial UI inside Three.js/R3F instead of blurry HTML-to-canvas textures:
|
|
99
|
+
|
|
100
|
+
```tsx
|
|
101
|
+
import { Canvas } from '@react-three/fiber';
|
|
102
|
+
import { createXRStore, XR, XROrigin } from '@react-three/xr';
|
|
103
|
+
import { Root, Container, Text } from '@react-three/uikit';
|
|
104
|
+
|
|
105
|
+
const store = createXRStore();
|
|
106
|
+
|
|
107
|
+
export function SpatialApp() {
|
|
108
|
+
return (
|
|
109
|
+
<>
|
|
110
|
+
<button onClick={() => store.enterVR()}>Enter VR</button>
|
|
111
|
+
<Canvas>
|
|
112
|
+
<XR store={store}>
|
|
113
|
+
<XROrigin position={[0, 0, 1.5]} />
|
|
114
|
+
<group position={[0, 1.4, 0]}>
|
|
115
|
+
<Root sizeX={1.2} sizeY={0.7} flexDirection="column" padding={24} backgroundColor="#111827">
|
|
116
|
+
<Container>
|
|
117
|
+
<Text fontSize={32} color="#f8fafc">Spatial Control Panel</Text>
|
|
118
|
+
</Container>
|
|
119
|
+
</Root>
|
|
120
|
+
</group>
|
|
121
|
+
</XR>
|
|
122
|
+
</Canvas>
|
|
123
|
+
</>
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Dedicated WebXR engines, layers, and WebGPU caveats
|
|
129
|
+
|
|
130
|
+
- **Wonderland Engine**: WebAssembly + WebGL2 engine engineered specifically for standalone headset WebXR frame-rate budgets, tiny download payloads, and instanced rendering.
|
|
131
|
+
- **Needle Engine**: exports Unity/Blender scenes to WebXR/Three.js + USDZ Quick Look (visionOS/iOS) from one authoring pipeline.
|
|
132
|
+
- **Babylon.js & PlayCanvas WebXR**: use `scene.createDefaultXRExperienceAsync(...)` (Babylon) or `app.xr.start(camera, pc.XRTYPE_VR, pc.XRSPACE_LOCALFLOOR)` (PlayCanvas). **WebGPU + WebXR (`XRGPUBinding`) remains experimental/flag-gated across headset browsers—always provide a WebGL2 fallback path.**
|
|
133
|
+
- **WebXR Layers (`XRProjectionLayer`, `XRQuadLayer`, `XRCylinderLayer`)**: submit spatial UI panels and video directly to the XR compositor via quad/cylinder layers so text renders at native headset resolution without double-sampling through the eye buffer.
|
|
134
|
+
- **Three.js / A-Frame baseline**: always drive XR frames with `renderer.setAnimationLoop(render)` (never `requestAnimationFrame`), move an XR rig rather than fighting tracked camera transforms, and measure stereo frame time on standalone headsets rather than desktop GPUs.
|
|
135
|
+
|
|
136
|
+
## Unity XR Interaction Toolkit (XRI)
|
|
137
|
+
|
|
138
|
+
- Move the player via `XROrigin` + locomotion mediator/providers (teleport, snap turn, smooth turn, angular tunneling vignette).
|
|
139
|
+
- Use `XRBaseInteractor` / `XRBaseInteractable` (Near-Far Interactor, Poke Interactor, Ray Interactor) with Input System Action Maps across OpenXR controller and hand profiles.
|
|
140
|
+
- Profile on target standalone hardware (Quest / Android XR / visionOS via PolySpatial) using Unity Profiler + OVR Metrics Tool / RenderDoc—desktop editor frame rates hide mobile tile-GPU overdraw, thermal throttling, and GC spikes.
|
|
141
|
+
|
|
142
|
+
## Unreal Engine OpenXR
|
|
143
|
+
|
|
144
|
+
- Target the official **OpenXR** plugin (`OpenXR`, `OpenXRHandTracking`, `XRBase`) with **Enhanced Input** action mappings so motion controllers and hand-tracking profiles stay portable across Quest, PCVR, and Android XR.
|
|
145
|
+
- Interact with 3D `UWidgetComponent` menus using **`UWidgetInteractionComponent`** attached to controller/hand aim poses (set explicit interaction distance, debug visualization off in shipping builds, and ensure hover/focus states respond cleanly).
|
|
146
|
+
- Render critical HUD text, subtitles, and menus with **Stereo Layers (`UStereoLayerComponent`, Quad/Cylinder/Equirect)** so the XR compositor samples them directly at native sharpness instead of blurring text through temporal anti-aliasing / eye-buffer distortion.
|
|
147
|
+
- Budget draw calls, instanced stereo rendering, forward shading vs mobile deferred, and Vulkan mobile MSAA explicitly in Unreal Insights on device (`rendered`).
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pixelcraft-tokens
|
|
3
|
+
description: Creates, resolves, and exports cross-platform design tokens in the W3C Design Tokens Community Group (DTCG) 2025.10 format and DTCG Resolver specification. Use when defining OKLCH color ramps, type, spacing, radius, motion, elevation, theme, dark-mode, semantic, component, or multi-platform token systems; wiring Style Dictionary, Terrazzo, Tokens Studio, Figma Variables, or Code Connect pipelines; or exporting tokens across 19 formats including CSS, Tailwind, SCSS, TypeScript, Swift, Kotlin, Android XML, Dart, Python, Qt, Textual, XAML, Rust, Go Lip Gloss, Godot, Unity USS, Slint, GTK4, and Typst.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
version: 0.1.0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Pixelcraft tokens
|
|
10
|
+
|
|
11
|
+
Tokens are design decisions in portable form. They encode hierarchy and semantic intent; they are not a dump of raw constants.
|
|
12
|
+
|
|
13
|
+
## Reference and tools
|
|
14
|
+
|
|
15
|
+
- Read [references/format.md](references/format.md) when authoring DTCG 2025.10 structure, `$extends`/`$root`/`$deprecated`, references, or DTCG Resolver (`*.resolver.json`) modes and themes.
|
|
16
|
+
- Read [references/theme-presets.md](references/theme-presets.md) when designing light/dark/high-contrast modes, `light-dark()`, `prefers-reduced-transparency`, forced-colors behavior, anti-FOUC theme initialization, or DTCG mode overrides.
|
|
17
|
+
- Read [references/state-tokens.md](references/state-tokens.md) whenever defining interactive control states or validating state coverage across modes.
|
|
18
|
+
- Read [references/governance.md](references/governance.md) before renaming, removing, versioning, deprecating (`$deprecated`), or meaningfully redefining tokens.
|
|
19
|
+
- Read [references/adoption.md](references/adoption.md) when migrating consumers, inventorying hardcoded values, or improving documentation/usage of an existing system.
|
|
20
|
+
- Read [references/token-tooling.md](references/token-tooling.md) when setting up Terrazzo, Style Dictionary v4, Tokens Studio transforms, Figma Variables, Figma MCP Server, or Figma Code Connect mappings.
|
|
21
|
+
- Use [assets/tokens.example.json](assets/tokens.example.json) as the canonical small example and [assets/tokens.modes.example.json](assets/tokens.modes.example.json) for mode overrides.
|
|
22
|
+
- Run `node scripts/export-tokens.mjs --help` for exporter usage. The exporter supports all 19 formats: `css`, `tailwind`, `scss`, `ts`, `swift`, `kotlin`, `android-xml`, `dart`, `python`, `qt`, `textual`, `xaml`, `rust`, `go-lipgloss`, `godot`, `unity-uss`, `slint`, `gtk4`, and `typst`.
|
|
23
|
+
|
|
24
|
+
## Token tiers
|
|
25
|
+
|
|
26
|
+
1. **Primitive** — raw scales: hue ramps, spacing base, font families, durations. Names describe measurement (`color.blue.500`), not use.
|
|
27
|
+
2. **Semantic** — intent: `color.surface`, `color.ink.muted`, `color.action.primary`, `space.control.inline`, `motion.feedback.fast`. Product logic consumes these.
|
|
28
|
+
3. **Component** — scoped overrides only when a component truly needs them: `component.button.primary.background`. Do not duplicate every semantic token.
|
|
29
|
+
|
|
30
|
+
Consumers should use the highest meaningful tier. Component code should almost never consume primitives directly.
|
|
31
|
+
|
|
32
|
+
## Authoring rules
|
|
33
|
+
|
|
34
|
+
- Inherit the existing project token system when present. Extend semantic gaps rather than replacing names impulsively.
|
|
35
|
+
- Use DTCG `$type`, `$value`, `$description`, and `$extensions` deliberately; avoid tool-specific fields outside `$extensions`.
|
|
36
|
+
- Use references such as `{color.brand}` so semantic and component tokens preserve relationships.
|
|
37
|
+
- Encode mode/theme as explicit alternate semantic values or files. Do not implement dark mode by global inversion.
|
|
38
|
+
- Include state roles: hover, active, focus, selected, disabled, destructive, success, warning, info.
|
|
39
|
+
- Include density-aware spacing only when the product actually supports density modes; otherwise prefer one coherent rhythm.
|
|
40
|
+
- Tokenize motion intent (`duration.feedback-fast`, `easing.standard`) rather than implementation property names.
|
|
41
|
+
- Keep platform units out of semantic meaning. Exporters translate dimension units; `px` in DTCG input does not mean every platform should use pixels conceptually.
|
|
42
|
+
- **Ban Tailwind arbitrary-value sprawl:** never scatter magic literals like `bg-[#1f2937]`, `text-[#64748b]`, `p-[13px]`, or `rounded-[14px]` across components—promote recurring values into semantic tokens exposed via CSS custom properties / Tailwind `@theme`.
|
|
43
|
+
- **Ban untouched `shadcn/ui` default `:root` zinc tokens:** treat starter-kit CSS variables as a schema scaffold, not a finished palette; author surface, ink, border, accent, radius, and type tokens from the committed direction card unless the existing brownfield app explicitly locks the zinc theme.
|
|
44
|
+
|
|
45
|
+
## Validation checklist
|
|
46
|
+
|
|
47
|
+
Before implementation or export:
|
|
48
|
+
|
|
49
|
+
- [ ] every reference resolves and has no cycle;
|
|
50
|
+
- [ ] contrast pairs are defined by role (`≥ 4.5:1` text / `≥ 3:1` UI), not guessed later;
|
|
51
|
+
- [ ] focus/selection/disabled states exist and realistic combinations such as invalid+focus or selected+disabled are covered;
|
|
52
|
+
- [ ] state behavior is validated across supported modes rather than only in the base theme;
|
|
53
|
+
- [ ] ownership, deprecation, rollback, and consumer-impact notes exist for breaking or behavioral changes;
|
|
54
|
+
- [ ] dark/high-contrast behavior is explicit or marked absent;
|
|
55
|
+
- [ ] type roles cover display/body/UI/data/caption and required script fallbacks;
|
|
56
|
+
- [ ] localization expansion and directionality do not depend on fixed widths;
|
|
57
|
+
- [ ] anti-slop token check: zero Tailwind arbitrary-value sprawl (`bg-[#...]`, `p-[13px]`), zero untouched `shadcn/ui` default zinc `:root` tokens on greenfield/redesign work, and zero raw hex leaks in components;
|
|
58
|
+
- [ ] every generated platform artifact is treated as output, not edited by hand.
|
|
59
|
+
|
|
60
|
+
The bundled exporter is intentionally small and zero-dependency. It validates the subset it emits; use a dedicated DTCG compiler for advanced spec features or production edge cases.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$description": "Example tokens in W3C DTCG 2025.10 format",
|
|
3
|
+
"color": {
|
|
4
|
+
"$type": "color",
|
|
5
|
+
"brand": {
|
|
6
|
+
"$value": { "colorSpace": "oklch", "components": [0.55, 0.16, 250], "alpha": 1 },
|
|
7
|
+
"$description": "Primary subject accent"
|
|
8
|
+
},
|
|
9
|
+
"surface": {
|
|
10
|
+
"$value": { "colorSpace": "oklch", "components": [0.98, 0.01, 95], "alpha": 1 }
|
|
11
|
+
},
|
|
12
|
+
"ink": {
|
|
13
|
+
"$value": { "colorSpace": "oklch", "components": [0.22, 0.02, 265], "alpha": 1 }
|
|
14
|
+
},
|
|
15
|
+
"danger": {
|
|
16
|
+
"$value": { "colorSpace": "oklch", "components": [0.55, 0.2, 28], "alpha": 1 }
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"space": {
|
|
20
|
+
"$type": "dimension",
|
|
21
|
+
"base": { "$value": { "value": 4, "unit": "px" } },
|
|
22
|
+
"control": {
|
|
23
|
+
"inline": { "$value": "{space.base}" }
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"radius": {
|
|
27
|
+
"$type": "dimension",
|
|
28
|
+
"medium": { "$value": { "value": 10, "unit": "px" } }
|
|
29
|
+
},
|
|
30
|
+
"font": {
|
|
31
|
+
"family": {
|
|
32
|
+
"$type": "fontFamily",
|
|
33
|
+
"body": { "$value": ["System UI", "Arial", "sans-serif"] }
|
|
34
|
+
},
|
|
35
|
+
"size": {
|
|
36
|
+
"$type": "dimension",
|
|
37
|
+
"body": { "$value": { "value": 16, "unit": "px" } }
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"motion": {
|
|
41
|
+
"duration": {
|
|
42
|
+
"$type": "duration",
|
|
43
|
+
"fast": { "$value": { "value": 120, "unit": "ms" } }
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"semantic": {
|
|
47
|
+
"color": {
|
|
48
|
+
"$type": "color",
|
|
49
|
+
"action": { "$value": "{color.brand}" },
|
|
50
|
+
"background": { "$value": "{color.surface}" },
|
|
51
|
+
"foreground": { "$value": "{color.ink}" },
|
|
52
|
+
"error": { "$value": "{color.danger}" }
|
|
53
|
+
},
|
|
54
|
+
"space": {
|
|
55
|
+
"$type": "dimension",
|
|
56
|
+
"controlInline": { "$value": "{space.control.inline}" }
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"component": {
|
|
60
|
+
"button": {
|
|
61
|
+
"background": {
|
|
62
|
+
"$type": "color",
|
|
63
|
+
"$value": "{semantic.color.action}"
|
|
64
|
+
},
|
|
65
|
+
"radius": {
|
|
66
|
+
"$type": "dimension",
|
|
67
|
+
"$value": "{radius.medium}"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$description": "Example mode tokens in W3C DTCG 2025.10 format",
|
|
3
|
+
"color": {
|
|
4
|
+
"$type": "color",
|
|
5
|
+
"brand": {
|
|
6
|
+
"$value": { "colorSpace": "oklch", "components": [0.55, 0.16, 250], "alpha": 1 },
|
|
7
|
+
"$extensions": {
|
|
8
|
+
"pixelcraft": {
|
|
9
|
+
"modes": {
|
|
10
|
+
"dark": { "$value": { "colorSpace": "oklch", "components": [0.68, 0.11, 250], "alpha": 1 } },
|
|
11
|
+
"high-contrast": { "$value": { "colorSpace": "oklch", "components": [0.45, 0.2, 250], "alpha": 1 } }
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"surface": {
|
|
17
|
+
"$value": { "colorSpace": "oklch", "components": [0.98, 0.005, 95], "alpha": 1 },
|
|
18
|
+
"$extensions": {
|
|
19
|
+
"pixelcraft": {
|
|
20
|
+
"modes": {
|
|
21
|
+
"dark": { "$value": { "colorSpace": "oklch", "components": [0.2, 0.01, 265], "alpha": 1 } },
|
|
22
|
+
"high-contrast": { "$value": { "colorSpace": "oklch", "components": [1, 0, 0], "alpha": 1 } }
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"ink": {
|
|
28
|
+
"$value": { "colorSpace": "oklch", "components": [0.22, 0.02, 265], "alpha": 1 },
|
|
29
|
+
"$extensions": {
|
|
30
|
+
"pixelcraft": {
|
|
31
|
+
"modes": {
|
|
32
|
+
"dark": { "$value": { "colorSpace": "oklch", "components": [0.93, 0.01, 95], "alpha": 1 } },
|
|
33
|
+
"high-contrast": { "$value": { "colorSpace": "oklch", "components": [0, 0, 0], "alpha": 1 } }
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"semantic": {
|
|
40
|
+
"color": {
|
|
41
|
+
"$type": "color",
|
|
42
|
+
"action": { "$value": "{color.brand}" },
|
|
43
|
+
"background": { "$value": "{color.surface}" },
|
|
44
|
+
"foreground": { "$value": "{color.ink}" }
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Design-token adoption and migration
|
|
2
|
+
|
|
3
|
+
Token systems fail when teams cannot discover, trust, or migrate them. Adoption work is part of the design system, not optional documentation polish.
|
|
4
|
+
|
|
5
|
+
## Consumer inventory
|
|
6
|
+
|
|
7
|
+
Before changing or promoting tokens, inventory:
|
|
8
|
+
|
|
9
|
+
- applications/packages/screens using token source or generated artifacts;
|
|
10
|
+
- direct primitive usage that should be semantic;
|
|
11
|
+
- local copies or hardcoded values duplicating token meaning;
|
|
12
|
+
- platform-specific generated outputs and their generation date/version;
|
|
13
|
+
- exceptions/waivers and why they exist;
|
|
14
|
+
- documentation/examples that teach obsolete names.
|
|
15
|
+
|
|
16
|
+
A narrow search in one frontend folder is not an inventory. Include server-rendered templates, mobile/native code, data-app Python, email/document generation, tests, snapshots, and story/example files where relevant.
|
|
17
|
+
|
|
18
|
+
## Adoption path
|
|
19
|
+
|
|
20
|
+
Use a staged path rather than a big-bang rewrite:
|
|
21
|
+
|
|
22
|
+
1. **Name the contract.** Document semantic tiers and forbidden direct-primitive cases.
|
|
23
|
+
2. **Generate once.** Ensure every platform artifact comes from the same source/version.
|
|
24
|
+
3. **Start with high-leverage surfaces.** Migrate shared shell/components before leaf screens.
|
|
25
|
+
4. **Bridge, then remove.** Temporary aliases reduce breakage but need an owner and removal condition.
|
|
26
|
+
5. **Measure exception density.** Count hardcoded values/direct primitive use in representative surfaces; do not claim adoption from file existence.
|
|
27
|
+
6. **Validate behavior.** Run state/theme/contrast/export tests and inspect rendered critical screens.
|
|
28
|
+
7. **Record migration state.** `not started / bridging / migrated / waived` with scope and consequence.
|
|
29
|
+
|
|
30
|
+
## Documentation minimum
|
|
31
|
+
|
|
32
|
+
Every maintained token system needs enough documentation for a new contributor/agent to answer:
|
|
33
|
+
|
|
34
|
+
- which file is source and which files are generated;
|
|
35
|
+
- how to choose semantic vs component vs primitive;
|
|
36
|
+
- how themes/modes are represented;
|
|
37
|
+
- how to regenerate platform artifacts;
|
|
38
|
+
- which validation commands/tests exist;
|
|
39
|
+
- how to deprecate or request a token;
|
|
40
|
+
- who owns breaking changes;
|
|
41
|
+
- which exceptions are deliberate.
|
|
42
|
+
|
|
43
|
+
Keep examples close to usage. A long conceptual document without copyable correct examples increases misuse.
|
|
44
|
+
|
|
45
|
+
## Migration warning signs
|
|
46
|
+
|
|
47
|
+
- same semantic meaning exists under multiple names;
|
|
48
|
+
- generated artifacts disagree across platforms with no version note;
|
|
49
|
+
- consumers bypass semantic tokens because required states are missing;
|
|
50
|
+
- component tokens replicate entire semantic sets;
|
|
51
|
+
- no one can explain whether a change is breaking;
|
|
52
|
+
- visual regressions are discovered only after broad rollout;
|
|
53
|
+
- teams fork tokens because review latency is too high.
|
|
54
|
+
|
|
55
|
+
Treat these as system design problems. Do not solve them by adding more constants or stricter lectures.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# DTCG 2025.10 token format
|
|
2
|
+
|
|
3
|
+
Evidence base: DTCG format/color specifications; stable Community Group status caveat; exporter ecosystem caveats.
|
|
4
|
+
|
|
5
|
+
DTCG 2025.10 is a stable Final Community Group Report, not a W3C Standard. Treat it as a versioned interchange format and validate implementation support before relying on advanced behavior.
|
|
6
|
+
|
|
7
|
+
## Shape
|
|
8
|
+
|
|
9
|
+
Token files are JSON. Groups are nested objects; token leaves contain `$value`. `$type` may be declared on a token or inherited from a containing group.
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"color": {
|
|
14
|
+
"$type": "color",
|
|
15
|
+
"brand": {
|
|
16
|
+
"$value": { "colorSpace": "oklch", "components": [0.55, 0.16, 250], "alpha": 1 },
|
|
17
|
+
"$description": "Primary brand accent"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Common types include `color`, `dimension`, `fontFamily`, `fontWeight`, `duration`, `cubicBezier`, `number`, `strokeStyle`, `border`, `transition`, `shadow`, `gradient`, and `typography`. Use exact spec definitions before adding complex composite types.
|
|
24
|
+
|
|
25
|
+
## References, `$extends`, `$root`, and `$deprecated`
|
|
26
|
+
|
|
27
|
+
- **Curly alias references:** use `{color.brand}` for token-to-token aliases (supported by Pixelcraft's zero-dependency exporter and all DTCG compilers). JSON Pointer `$ref` inside composite values or resolver documents requires a full DTCG 2025.10 compiler such as Terrazzo or Style Dictionary v4.
|
|
28
|
+
- **`$root`:** define a group's default token value (`"accent": { "$root": { "$value": ... }, "hover": { "$value": ... } }`) so a group can hold both a base value and nested child tokens without inventing ad-hoc `.default` names.
|
|
29
|
+
- **`$extends`:** inherit and override an entire group (for example, a compact or brand variant group inheriting from a base group) without duplicating unchanged child tokens.
|
|
30
|
+
- **`$deprecated`:** mark obsolete tokens or groups using `"$deprecated": true` or a replacement string (`"$deprecated": "Use color.action.primary instead; scheduled for removal in v3."`) so compilers emit build warnings automatically.
|
|
31
|
+
|
|
32
|
+
## Modes and themes (DTCG 2025.10 Resolver)
|
|
33
|
+
|
|
34
|
+
The **W3C DTCG 2025.10 Resolver Specification** (`*.resolver.json`) is the standard multi-theme / multi-brand composition format. A resolver document declares `sets` (base and shared token files), `modifiers` with named `contexts` (such as `theme: light | dark | high-contrast` or `density: default | compact`), and an explicit `resolutionOrder`:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"version": "2025.10",
|
|
39
|
+
"sets": {
|
|
40
|
+
"primitives": { "sources": [{ "$ref": "./primitives.tokens.json" }] },
|
|
41
|
+
"semantic": { "sources": [{ "$ref": "./semantic.tokens.json" }] }
|
|
42
|
+
},
|
|
43
|
+
"modifiers": {
|
|
44
|
+
"theme": {
|
|
45
|
+
"default": "light",
|
|
46
|
+
"contexts": {
|
|
47
|
+
"light": [{ "$ref": "./themes/light.tokens.json" }],
|
|
48
|
+
"dark": [{ "$ref": "./themes/dark.tokens.json" }],
|
|
49
|
+
"high-contrast": [{ "$ref": "./themes/high-contrast.tokens.json" }]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"resolutionOrder": [
|
|
54
|
+
{ "$ref": "#/sets/primitives" },
|
|
55
|
+
{ "$ref": "#/sets/semantic" },
|
|
56
|
+
{ "$ref": "#/modifiers/theme" }
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Choose the lightest theme architecture that matches your compiler:
|
|
62
|
+
|
|
63
|
+
1. **DTCG Resolver (`*.resolver.json`)** — preferred for production multi-theme/multi-brand systems using Terrazzo or Resolver-aware Style Dictionary pipelines;
|
|
64
|
+
2. **Token-level `$extensions.pixelcraft.modes`** — compact single-file subset supported directly by Pixelcraft's zero-dependency `scripts/export-tokens.mjs` exporter;
|
|
65
|
+
3. **Separate files per mode (`tokens.base.json`, `tokens.dark.json`)** — simple fallback when a legacy pipeline expects flat file merges with identical semantic paths.
|
|
66
|
+
|
|
67
|
+
Rules:
|
|
68
|
+
|
|
69
|
+
- keep primitive scales mostly stable across modes;
|
|
70
|
+
- change semantic roles deliberately;
|
|
71
|
+
- verify contrast and state visibility per mode;
|
|
72
|
+
- never implement dark mode as automatic inversion;
|
|
73
|
+
- record whether high contrast is a theme, accessibility mode, or platform-mediated behavior.
|
|
74
|
+
|
|
75
|
+
## Naming
|
|
76
|
+
|
|
77
|
+
- lowercase dot paths in documentation and camel/kebab conversion only at export time;
|
|
78
|
+
- use intent before appearance for semantic names (`surface-warning`, not `yellow-100`);
|
|
79
|
+
- reserve component tier for true overrides;
|
|
80
|
+
- avoid encoding platform names in universal semantic tokens.
|
|
81
|
+
|
|
82
|
+
## Validation
|
|
83
|
+
|
|
84
|
+
Minimum checks: JSON parses; groups/tokens do not conflict; `$type` known/inherited; `$value` shape valid; references and `$extends` resolve; no cycles; units explicit for dimensions; alpha in range; `$deprecated` replacements point to live tokens; required semantic roles exist. The bundled exporter validates its supported subset and fails malformed tokens rather than guessing.
|