@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,132 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pixelcraft-web
|
|
3
|
+
description: Translates Pixelcraft direction, tokens, UX, and floor requirements into idiomatic web UI across HTML/CSS, React, Next.js, Vue, Nuxt, SvelteKit, SolidStart, Angular, Astro, Qwik, Preact, Fresh, Hono, htmx, Alpine, Lit, Rails/Hotwire, Laravel/Livewire/Filament/Inertia, Symfony UX, WordPress, Django/FastAPI/FastHTML, Phoenix LiveView, Blazor, Go templ/Gomponents, Rust Leptos/Dioxus, Kotlin, Java, Dart Jaspr, Elm, ClojureScript, F#, and Scala. Use for browser UI, Tailwind v4, headless/styled kits, cmdk/vaul/sonner/Embla, search/icons/fonts/images, forms/tables/editors, sync/auth/i18n/PWA, GSAP/Motion/Lenis/Rive, Three.js/R3F/Babylon/Spline/Theatre.js, WebGPU/shaders, or audio/video players.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
version: 0.1.0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Pixelcraft web
|
|
10
|
+
|
|
11
|
+
Use this skill when the rendering surface is HTML/CSS/DOM, including server-rendered pages, hybrid islands, browser 3D/WebGL/WebGPU scenes, and interactive media. Do not assume React or Tailwind; detect the actual stack nearest the changed files.
|
|
12
|
+
|
|
13
|
+
## Surface craft
|
|
14
|
+
|
|
15
|
+
Use one memorable device when the brief warrants it: a real product as the spatial anchor, editorial rows around comparable facts, or expressive type constrained by an underlying grid. Keep navigation and primary controls ordinary. Inspect normal scroll, mobile reflow, first-load payload, and the reduced-motion path; never trade orientation for scroll hijacking, a custom cursor, or delayed essential content.
|
|
16
|
+
|
|
17
|
+
## Detection signals
|
|
18
|
+
|
|
19
|
+
Inspect `package.json`, `Cargo.toml`, `go.mod`, `Gemfile`, `composer.json`, `pyproject.toml`, `mix.exs`, `*.csproj`, `pubspec.yaml`, `build.gradle*`, `pom.xml`, `deps.edn`, `elm.json`, `block.json`, `theme.json`, framework configs, template extensions, routes/controllers, CSS entry files, and island/hydration markers. Multiple web stacks can coexist; scope each decision to the active route or component surface.
|
|
20
|
+
|
|
21
|
+
## Translate direction to web idioms
|
|
22
|
+
|
|
23
|
+
1. Convert semantic DTCG roles to CSS custom properties or the framework's theme object; keep primitives hidden behind semantic names.
|
|
24
|
+
2. Express composition with native CSS Grid, Flex, container queries, and logical properties before framework-specific utility soup.
|
|
25
|
+
3. Choose rendering strategy deliberately (static, server-rendered, streamed, islands, resumable, SPA, or enhanced partial). Never hydrate a full page for one small control.
|
|
26
|
+
4. Build interactions with real HTML semantics first (`a`, `button`, `form`, `label`, `dialog`, `[popover]`), then layer framework behavior.
|
|
27
|
+
5. Connect state matrix rows to route, cache, and network behavior: loading, empty, error, offline, stale, unauthorized, optimistic rollback, and deep-link restoration.
|
|
28
|
+
6. Honor `prefers-reduced-motion`, `prefers-color-scheme`, forced colors, text scaling, logical direction, keyboard/focus restoration, and browser capability differences.
|
|
29
|
+
|
|
30
|
+
## Platform-wide rules
|
|
31
|
+
|
|
32
|
+
- **Post-tag 3-run median budgets & initial payload caps**: verify **after** real analytics/GTM/pixels/chat scripts are active—**3-run median Lighthouse** under 4G throttling (**Perf ≥ 90, A11y ≥ 95, Best Practices ≥ 95, SEO ≥ 95**) on **both mobile and desktop for every primary template**, Core Web Vitals **LCP < 2.5 s, INP < 200 ms, CLS < 0.10**, **Long Animation Frames (`LoAF`)** clean on scroll/drag, **`<= 3 Hz` flash cap** (`WCAG 2.3.1`), and **Network waterfall capture on the heaviest page**. Enforce initial compressed JS+CSS payload budgets by surface class (**Content/editorial `<= 150–250 KB`**; **Dashboard/app `<= 250–450 KB`**; **Promotional/rich experience `<= 350–700 KB`**; **Embedded widget `<= 100–200 KB`**—noting the `~3.1 MB / 103 req` showcase median is a cost calibration benchmark, NOT an acceptable budget). Isolate 3rd-party scripts off the main thread (Cloudflare Zaraz / Partytown) or behind interaction/Consent Mode v2 facades with zero banner CLS.
|
|
33
|
+
- **Typography, cascade & print/recovery**: self-host `<= 2–3` subsetted `.woff2` files with `@font-face` fallback metric overrides (`size-adjust`, `ascent-override`, `descent-override`, `line-gap-override`); structure CSS with `@layer` and logical properties (`margin-inline`, `inset-block`) without `!important` sprawl; render a first-focusable **Skip to main content** link; ship branded `404`/`500` recovery routes and a `@media print` stylesheet for articles, docs, receipts, and invoices.
|
|
34
|
+
- **Viewport, short-laptop fold & cross-browser matrix**: verify across `360 / 390 / 768 / 1024 / 1280 / 1440 / 1920+` (`svh`/`dvh`, `env(safe-area-inset-*)`, `clamp()`), scaled 13–14" Windows laptops (`1280×620` / `1366×650` at `125%–150%` OS scale) so the above-the-fold headline + primary CTA stay visible without clipping, and attach deliverable evidence across **`Chrome`, `Firefox`, `Edge`, `Safari macOS`, real `Safari iOS`, and `Chrome Android`**.
|
|
35
|
+
- **SEO, migration, CDN, security headers & deployment safety**: ship per-route `<title>`/description/canonical, `sitemap.xml`, `robots.txt`, JSON-LD, `hreflang` + `x-default`, legacy redesign `301` redirect maps (`0` broken/orphan links), SSR/SSG semantic HTML + `/llms.txt`, `1200×630` HTTPS JPEG/PNG `og:image` cards (Zalo/Slack/iMessage/FB safe—never SVG/WebP-only), `immutable` asset caching (`private, no-store` on auth routes), CSP/HSTS/`nosniff`/`Referrer-Policy`/`Permissions-Policy`/`frame-ancestors`, **PR preview deployments**, and a documented **production rollback plan**.
|
|
36
|
+
- **SaaS, checkout & CMS resilience**: keep search/filter/sort/page/tab/drawer IDs in the URL; sync sign-out and workspace/tenant switches across tabs (`BroadcastChannel`/`storage`); cancel stale fetches (`AbortController`); lock mutations synchronously with `Idempotency-Key`; preserve dirty drafts across `401` session expiry; guard single-key hotkeys inside inputs/contenteditable/IME and use Safe-Triangle submenu corridors; sanitize Word/Docs CMS paste and auto-transcode `10–15 MB` uploads with focal-point crops + Draft Live Preview.
|
|
37
|
+
|
|
38
|
+
## Anti-lazy / do-not-hand-roll guard
|
|
39
|
+
|
|
40
|
+
| Never do this | Use instead |
|
|
41
|
+
|---|---|
|
|
42
|
+
| Build a rich-text or code editor on raw `contenteditable` / `document.execCommand`, or bundle Monaco for static code snippets | ProseMirror, Tiptap, BlockNote, Lexical, CodeMirror 6 (editable), or **Shiki** (zero-JS read-only highlighting) |
|
|
43
|
+
| Render 5,000+ DOM table rows or write DIY scroll virtualization | TanStack Table + TanStack Virtual, AG Grid, MUI X Data Grid, or Glide Data Grid |
|
|
44
|
+
| Hand-roll modals, comboboxes, command palettes, touch drawers, toast stacks, carousels, date grids, split panes, or ad-hoc client search | Native `<dialog>` / `[popover]` / `<input type="date">` first; otherwise `@base-ui/react`, `radix-ui`, React Aria, Ariakit, Zag.js, Melt UI, `cmdk`/`kbar`, `vaul`, `sonner`, Embla/Splide, `react-day-picker`, `react-resizable-panels`, and Pagefind/Orama/Fuse.js/InstantSearch |
|
|
45
|
+
| Ship untouched `shadcn/ui` default zinc neutrals, `0.5rem` radius, and hairline card grids | Author project semantic tokens (`pixelcraft-tokens`) and direction (`pixelcraft-direction`) before building views |
|
|
46
|
+
| Hydrate a full SPA or spin up Three.js just for static content or a single GLB orbit preview | Static/SSR/islands rendering, `<model-viewer>` with `poster` and `alt`, and lazy-loaded heavy chunks |
|
|
47
|
+
|
|
48
|
+
## Common web-specific slop/UX failures
|
|
49
|
+
|
|
50
|
+
- centered hero + eyebrow + two CTAs + three cards regardless of content, or primary CTA pushed below a `1280×620` scaled-laptop fold;
|
|
51
|
+
- `div`/`span` buttons, missing **Skip to main content** link, or unguarded single-key hotkeys firing while typing in inputs/IME;
|
|
52
|
+
- hydration delay, main-thread 3rd-party pixels/chat widgets tanking INP/`LoAF`, or late cookie banners shifting CLS;
|
|
53
|
+
- infinite scroll without position recovery, trapped memory-only filters/drawers, or stale search responses overwriting newer queries;
|
|
54
|
+
- multi-tab tenant drift after workspace switch/sign-out, double-charge submits without `Idempotency-Key`, or `401` redirects wiping form drafts;
|
|
55
|
+
- modal/dropdown focus escaping, dark mode via CSS filter inversion, or untouched `shadcn/ui` defaults.
|
|
56
|
+
|
|
57
|
+
## Verification options
|
|
58
|
+
|
|
59
|
+
Be explicit with evidence labels (`rendered`, `static`, `model-judgment`, `not-checked`, `waived`) and enforce **Evidence Rule #0.3** (`static`/`model-judgment` never counts as `pass` for visual, performance, or interactive-a11y rows). Browser rendering, screenshots, DOM/accessibility trees, axe scans, Playwright/Vitest Browser Mode/Storybook tests, 3-run Lighthouse, `LoAF`/Network waterfall traces, responsive emulation, and real devices provide `rendered` evidence; builds, typechecks, and `jsdom` tests are `static` (or DOM-unit) evidence only.
|
|
60
|
+
|
|
61
|
+
## Pre-submit checklist
|
|
62
|
+
|
|
63
|
+
- [ ] zero `TODO`s, placeholder stubs, invented copy/metrics, or dead click/form handlers;
|
|
64
|
+
- [ ] **3-run median Lighthouse** under 4G throttling (`Perf ≥ 90`, `A11y/BP/SEO ≥ 95`) on mobile + desktop per primary template, CWV (`LCP < 2.5s`, `INP < 200ms`, `CLS < 0.1`), `LoAF` scroll/drag trace, Network waterfall on heaviest page, and initial compressed JS+CSS budget (`<= 150–250 KB` content, `<= 250–450 KB` app, `<= 350–700 KB` rich, `<= 100–200 KB` widget) met;
|
|
65
|
+
- [ ] all state-matrix rows wired (URL-synced filters/drawers, `AbortController` race cancellation, `BroadcastChannel` multi-tab auth/tenant sync, `Idempotency-Key` submit lock, `401` draft preservation);
|
|
66
|
+
- [ ] Skip-to-main link, native HTML semantics, keyboard/focus restoration, single-key hotkey input/IME guard, `<= 3 Hz` flash cap, logical properties, WCAG 2.2 AA contrast, branded `404`/`500`, and `@media print` verified;
|
|
67
|
+
- [ ] `prefers-reduced-motion`, `prefers-color-scheme`, `forced-colors`, `360–1920+` widths, `1280×620` / `1366×650` scaled-laptop fold, and cross-browser/device deliverables (`Chrome`, `Firefox`, `Edge`, `Safari macOS`, real `Safari iOS`, `Chrome Android`) verified or labeled `not-checked`;
|
|
68
|
+
- [ ] SEO/canonical/JSON-LD/`hreflang`+`x-default`/`/llms.txt`/`301` redirect map, `1200×630` HTTPS JPEG/PNG OG cards, CDN cache & security headers, PR preview deployment, and rollback plan verified;
|
|
69
|
+
- [ ] **Checklist-Until-Passing Stop-Gate (`<HARD-GATE>`):** walk every checklist item above + run `slop-scan.mjs --fail-on p2`, `check-contrast.mjs`, browser QA (`pixelcraft-visual-qa`), 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`).
|
|
70
|
+
|
|
71
|
+
## Framework and stack routing
|
|
72
|
+
|
|
73
|
+
- Read [references/html-css.md](references/html-css.md) when working directly in HTML/CSS, native `<dialog>`/`[popover]`/Anchor Positioning, Invoker Commands, customizable `<select>`, or browser-native primitives.
|
|
74
|
+
- Read [references/tailwind.md](references/tailwind.md) when Tailwind CSS v4 (`@theme inline`, `@custom-variant`, `@utility`, `@container`) is the styling layer.
|
|
75
|
+
- Read [references/react-next.md](references/react-next.md) when building with React 19, Next.js 15/16, React Router v7, or TanStack Start / TanStack Router.
|
|
76
|
+
- Read [references/vue-nuxt.md](references/vue-nuxt.md) when building with Vue 3.5/3.6 (Vapor Mode), Pinia, Nuxt 4, or Nuxt UI.
|
|
77
|
+
- Read [references/svelte.md](references/svelte.md) when building with Svelte 5 runes/attachments or SvelteKit 2 (`$app/state`, form actions).
|
|
78
|
+
- Read [references/solid.md](references/solid.md) when building with Solid or SolidStart 1.x (`query`, `createAsync`, `action`, `<Index>`/`<For>`).
|
|
79
|
+
- Read [references/angular.md](references/angular.md) when building with Angular 19–21 signals, zoneless mode, `httpResource`, incremental `@defer`, or NgRx SignalStore.
|
|
80
|
+
- Read [references/astro.md](references/astro.md) when building with Astro 5 Content Layer, Server Islands (`server:defer`), Actions, or `<ClientRouter />`.
|
|
81
|
+
- Read [references/qwik.md](references/qwik.md) when building resumable interfaces in Qwik 1.x/2.0 (`useTask$`, `useResource$`, `server$`).
|
|
82
|
+
- Read [references/preact-fresh-hono.md](references/preact-fresh-hono.md) when building with Preact (`@preact/signals`), Deno Fresh 2.0, Hono JSX/RPC (`hc`), RedwoodSDK, or Waku.
|
|
83
|
+
- Read [references/htmx-alpine.md](references/htmx-alpine.md) when building hypermedia interfaces with htmx 2.x, Alpine.js plugins, Datastar, or Unpoly.
|
|
84
|
+
- Read [references/lit-web-components.md](references/lit-web-components.md) when building Lit or standards-based Web Components with Shadow DOM and `ElementInternals`.
|
|
85
|
+
- Read [references/server-rendered.md](references/server-rendered.md) when building Rails 8/Hotwire (ViewComponent/Phlex), Laravel (Livewire/Filament/Flux/Inertia), Symfony UX, WordPress Gutenberg/Interactivity API, Django (Cotton/Ninja/Unfold/Wagtail), FastAPI+Jinja2, FastHTML, Phoenix LiveView, Blazor (FluentUI/MudBlazor/Radzen), Go `templ`/Gomponents, or Dart Jaspr.
|
|
86
|
+
- Read [references/leptos-yew.md](references/leptos-yew.md) when building Rust web apps in Leptos 0.7/0.8, Dioxus Web, Yew, or Axum + Askama/Maud + htmx.
|
|
87
|
+
- Read [references/kotlin-web.md](references/kotlin-web.md) when building Kotlin web apps in Compose Multiplatform Web (`wasmJs`/`js`) or Kobweb.
|
|
88
|
+
- Read [references/java-web.md](references/java-web.md) when building Java web UIs with Vaadin Flow, Vaadin Hilla, Spring + Thymeleaf + htmx, JTE, or Quarkus Qute.
|
|
89
|
+
- Read [references/elm.md](references/elm.md) when building Elm web applications.
|
|
90
|
+
- Read [references/clojurescript.md](references/clojurescript.md) when building ClojureScript UIs with UIx v2, Helix, or Reagent/re-frame.
|
|
91
|
+
- Read [references/fsharp-fable.md](references/fsharp-fable.md) when building F# Fable Feliz/Elmish apps with Vite.
|
|
92
|
+
- Read [references/scala-laminar.md](references/scala-laminar.md) when building Scala.js Laminar interfaces.
|
|
93
|
+
|
|
94
|
+
## Web engineering and UI architecture routing
|
|
95
|
+
|
|
96
|
+
- Read [references/adaptive-layout.md](references/adaptive-layout.md) when a web surface must adapt across phone, tablet, desktop, split window, shallow viewports, or mixed input modes.
|
|
97
|
+
- Read [references/styling-ecosystem.md](references/styling-ecosystem.md) when choosing CSS Modules, Lightning CSS, Sass, Panda CSS, vanilla-extract, Pigment CSS, StyleX, Tamagui Web, UnoCSS, Linaria, Open Props, CVA, or Tailwind Variants.
|
|
98
|
+
- Read [references/component-systems.md](references/component-systems.md) when selecting headless primitives (`@base-ui/react`, `radix-ui`, React Aria, Ark UI, Zag.js, Melt UI, Ariakit, Kobalte, Corvu, Reka UI, Bits UI), source-first kits (`shadcn/ui`, Park UI), enterprise suites, or Floating UI vs native popover.
|
|
99
|
+
- Read [references/interaction-and-search-primitives.md](references/interaction-and-search-primitives.md) when wiring command palettes (`cmdk`, `kbar`), drawers (`vaul`), toasts (`sonner`), carousels (Embla/Splide/Swiper), date pickers (`react-day-picker`), split panes (`react-resizable-panels`), search UIs (Pagefind, Orama, Fuse.js, InstantSearch, Meilisearch, Typesense), icons (Lucide, Phosphor, Tabler, Iconify), Fontsource fonts, or Unpic/ThumbHash images.
|
|
100
|
+
- Read [references/state-architecture.md](references/state-architecture.md) when designing URL state (`nuqs`), server caches (TanStack Query/DB, tRPC v11, oRPC, Apollo), client stores (Zustand, Pinia, NgRx SignalStore, Legend-State), XState v5, or IndexedDB (`Dexie`, `idb`).
|
|
101
|
+
- Read [references/forms-validation.md](references/forms-validation.md) when implementing TanStack Form, React Hook Form, Conform, SvelteKit Superforms, Modular Forms, VeeValidate, or Zod v4/Valibot/ArkType Standard Schema validation.
|
|
102
|
+
- Read [references/build-and-architecture.md](references/build-and-architecture.md) when configuring Vite 8/Rolldown/Environment API, Rsbuild/Rspack, Turbopack, `tsdown`, Bun, Biome/Oxlint, React Compiler, rendering modes, microfrontends, Web Workers, WASM, or Serwist/Workbox.
|
|
103
|
+
- Read [references/component-testing.md](references/component-testing.md) when setting up Storybook (`@storybook/addon-vitest`, `composeStories`), Vitest Browser Mode, MSW v2, Playwright (`page.clock`, ARIA/visual snapshots), or `axe-core` (`wcag22aa`).
|
|
104
|
+
- Read [references/pwa.md](references/pwa.md) when building installable, offline-capable, push-enabled, update-aware PWAs or testing iOS/iPadOS home-screen constraints.
|
|
105
|
+
- Read [references/enterprise-data-ui.md](references/enterprise-data-ui.md) when building headless tables (TanStack Table/Virtual), enterprise grids (AG Grid, MUI X Data Grid, Glide Data Grid), spreadsheets (Handsontable, Univer), or calendars/schedulers (FullCalendar, Schedule-X, Bryntum).
|
|
106
|
+
- Read [references/rich-text-and-code-editors.md](references/rich-text-and-code-editors.md) when building rich-text editors (ProseMirror, Tiptap, BlockNote, Lexical, Slate, Plate), read-only code highlighting (Shiki), code editors (CodeMirror 6, Monaco), playgrounds, or page builders (Puck).
|
|
107
|
+
- Read [references/canvas-and-node-editors.md](references/canvas-and-node-editors.md) when building whiteboards (tldraw, Excalidraw), 2D scene graphs (Konva, Fabric.js), node graphs (XYFlow/React Flow, Rete.js, Cytoscape), or drag-and-drop (dnd-kit, Pragmatic DnD).
|
|
108
|
+
- Read [references/local-first-sync.md](references/local-first-sync.md) when implementing offline-first or multiplayer sync (Yjs, Automerge, Zero, ElectricSQL, TanStack DB, PowerSync, Jazz, InstantDB, Convex, TinyBase, Liveblocks, RxDB, Durable Objects).
|
|
109
|
+
- Read [references/auth-and-checkout-ui.md](references/auth-and-checkout-ui.md) when building sign-in/auth UI (Better Auth, Clerk, Auth.js, Supabase), WebAuthn Level 3 Passkeys, OTP/MFA, or PCI-safe checkout (Stripe Embedded/Elements, Polar, Paddle, Lemon Squeezy).
|
|
110
|
+
- Read [references/file-upload-media-ui.md](references/file-upload-media-ui.md) when building S3/R2 presigned uploads, UploadThing, `tus-js-client`, Uppy, FilePond, clipboard paste, or Worker image compression.
|
|
111
|
+
- Read [references/i18n-engineering.md](references/i18n-engineering.md) when implementing `next-intl`, i18next, FormatJS, Lingui, Paraglide JS, Vue I18n, Angular localize, ICU plurals, `Intl.DurationFormat`, `Temporal`, RTL, or script/font fallbacks.
|
|
112
|
+
|
|
113
|
+
## Creative, motion, 3D, and media routing
|
|
114
|
+
|
|
115
|
+
- Read [references/creative-runtime.md](references/creative-runtime.md) when isolating motion, canvas, 3D, or media runtimes inside SSR/island web architectures.
|
|
116
|
+
- Read [references/gsap.md](references/gsap.md) when building GSAP 3.13+ timelines, ScrollTrigger, SplitText, Flip, Observer, `quickTo`, or `@gsap/react` lifecycles.
|
|
117
|
+
- Read [references/motion-react.md](references/motion-react.md) when implementing `motion/react`, `LazyMotion`, `AnimatePresence`, `LayoutGroup`, reduced-motion `MotionValue` gating, or vanilla `motion`.
|
|
118
|
+
- Read [references/smooth-scroll.md](references/smooth-scroll.md) before adding Lenis (`lenis/react`, `data-lenis-prevent`, `autoRaf: false`) or GSAP `ScrollSmoother`.
|
|
119
|
+
- Read [references/motion-recipes.md](references/motion-recipes.md) when implementing CSS scroll-driven animations, View Transition Types / `view-transition-class`, or interactive motion recipes.
|
|
120
|
+
- Read [references/rive-lottie.md](references/rive-lottie.md) when choosing or wiring Rive state machines/Data Binding or dotLottie (`.lottie`) vector animations.
|
|
121
|
+
- Read [references/scene-architecture.md](references/scene-architecture.md) when architecting Three.js scenes, `WebGPURenderer` (`three/webgpu`), TSL (`three/tsl`) node materials, Theatre.js choreography, Spline, or Unicorn Studio embeds.
|
|
122
|
+
- Read [references/r3f-integration.md](references/r3f-integration.md) when integrating React Three Fiber v9, `@react-three/postprocessing`, `@react-three/rapier`, and demand rendering (`invalidate`).
|
|
123
|
+
- Read [references/web-3d-engines.md](references/web-3d-engines.md) when choosing or implementing `<model-viewer>`, Babylon.js, PlayCanvas, Threlte v8, TresJS v5, luma.gl v9, or `regl`.
|
|
124
|
+
- Read [references/assets-pipeline.md](references/assets-pipeline.md) when optimizing GLB/glTF pipelines with `gltf-transform`, Meshopt, Draco, KTX2/Basis textures, and LODs.
|
|
125
|
+
- Read [references/rendering-performance.md](references/rendering-performance.md) when budgeting GPU frame times, DPR caps, offscreen pausing, and WebGL context loss/restoration.
|
|
126
|
+
- Read [references/rendering-choice.md](references/rendering-choice.md) when choosing DOM/SVG/Canvas 2D/PixiJS v8/WebGL/WebGPU and capability-detecting GPU backends.
|
|
127
|
+
- Read [references/shader-workflow.md](references/shader-workflow.md) when writing or debugging GLSL, WGSL, or TSL shaders with precision and reduced-motion uniforms.
|
|
128
|
+
- Read [references/creative-effects.md](references/creative-effects.md) when implementing deterministic seeded particle/noise/displacement effects and frozen-time QA hooks.
|
|
129
|
+
- Read [references/audio-reactive.md](references/audio-reactive.md) when wiring Web Audio `AnalyserNode`/`AudioWorklet` pipelines with StrictMode-safe `createMediaElementSource` guards.
|
|
130
|
+
- Read [references/video-media.md](references/video-media.md) when configuring AV1/HEVC/VP9/H.264 `<video>` delivery or `requestVideoFrameCallback` video textures.
|
|
131
|
+
- Read [references/media-players.md](references/media-players.md) when selecting or wiring Vidstack, Media Chrome, Mux Player, `hls.js` (`ManagedMediaSource`), Shaka, `dash.js`, Video.js, `wavesurfer.js`, `Howler.js`, or `Tone.js`.
|
|
132
|
+
- Read [references/accessibility-performance.md](references/accessibility-performance.md) when verifying `<track>` captions/descriptions, WCAG 2.2.2 pause controls, WCAG 2.3.1 flash limits, and media performance budgets.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Audiovisual accessibility and performance
|
|
2
|
+
|
|
3
|
+
Pair these concrete browser media rules with [media-players.md](media-players.md) and `pixelcraft-accessibility` (`motion-canvas.md`).
|
|
4
|
+
|
|
5
|
+
## `<track>` & alternative media contract (WCAG 1.2.x)
|
|
6
|
+
|
|
7
|
+
| Track `kind` | Purpose | Required when |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| `kind="captions"` | Spoken dialogue **plus** meaningful non-speech sound cues (`[alarm beeps]`, `[music fades]`) | All prerecorded informative video with audio (WCAG 1.2.2); include `srclang`, `label`, and `default` where appropriate |
|
|
10
|
+
| `kind="descriptions"` | Text audio-description cues describing critical visual-only actions/charts | Informative video containing visual information not spoken in the audio track (WCAG 1.2.3 / 1.2.5) |
|
|
11
|
+
| `kind="subtitles"` | Translated dialogue for viewers who can hear the audio | Multilingual releases (does **not** replace `captions` for deaf/hard-of-hearing users) |
|
|
12
|
+
| `kind="chapters"` | Navigable WebVTT chapter markers | Long tutorials, talks, and podcasts for keyboard/scrubber navigation |
|
|
13
|
+
|
|
14
|
+
- Supply a readable text transcript adjacent to audio-only podcasts/clips (WCAG 1.2.1) and long-form videos so users can search, copy, and translate content.
|
|
15
|
+
|
|
16
|
+
## User control & WCAG 2.2.2 / 2.3.1 safety rules
|
|
17
|
+
|
|
18
|
+
- **No unmuted autoplay (WCAG 1.4.2)**: never autoplay audible media (>3s without an immediate pause/stop/mute control).
|
|
19
|
+
- **WCAG 2.2.2 (Pause, Stop, Hide)**: any moving, blinking, scrolling, or auto-updating content (ambient background video, marquees, canvas loops, carousels) that starts automatically, lasts **more than 5 seconds**, and appears alongside other content **must** expose a visible, keyboard-focusable Pause/Stop/Hide button—honoring `prefers-reduced-motion` is necessary but not sufficient for users who have not enabled OS reduced motion.
|
|
20
|
+
- **WCAG 2.3.1 (Three Flashes or Below Threshold)**: never render content that flashes **more than 3 times in any 1-second period** above general or saturated-red flash thresholds. Clamp audio-reactive luminance/opacity modulation (`audio-reactive.md`) and shader noise frequencies accordingly.
|
|
21
|
+
- **Keyboard & assistive tech parity**: Play/Pause, Seek, Mute/Volume, Captions toggle, and Fullscreen must be reachable by `Tab`, operable with `Space`/`Enter`/arrows, expose `aria-pressed` or live state labels, and keep visible focus rings.
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<!-- Ambient loop satisfying WCAG 2.2.2 (Pause control) + reduced motion -->
|
|
25
|
+
<figure class="ambient-stage">
|
|
26
|
+
<video id="hero-loop" muted loop playsinline poster="/media/loop-poster.webp" aria-hidden="true">
|
|
27
|
+
<source src="/media/loop.mp4" type='video/mp4; codecs="avc1.42E01E"' />
|
|
28
|
+
</video>
|
|
29
|
+
<button type="button" id="toggle-loop" aria-pressed="false" aria-controls="hero-loop">
|
|
30
|
+
Pause background motion
|
|
31
|
+
</button>
|
|
32
|
+
</figure>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Performance & verification
|
|
36
|
+
|
|
37
|
+
- Record media transfer size, codec/decode cost, analyser/visualizer update rate, GPU frame time, memory, and device tier separately (`rendered`).
|
|
38
|
+
- Lazy-load below-fold media (`preload="none"` / `IntersectionObserver`), pause playback when offscreen or `document.hidden`, avoid per-frame allocations in audio visualizers, and test on mid-tier mobile or throttled network profiles (or mark device profiling `not-checked`).
|
|
39
|
+
|
|
40
|
+
Official guidance:
|
|
41
|
+
- WCAG 2.2: https://www.w3.org/TR/WCAG22/
|
|
42
|
+
- W3C Making Audio and Video Media Accessible: https://www.w3.org/WAI/media/av/
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Adaptive web interfaces
|
|
2
|
+
|
|
3
|
+
Design the task for available space and input, not for a device name. Decide in the plan where navigation, order, density and controls actually need a different composition. Preserve the same destinations, meaningful information, task outcomes and state. Share behavior and data across presentations; avoid duplicate focusable controls and loss of form inputs, selection or focus when crossing a breakpoint.
|
|
4
|
+
|
|
5
|
+
## Representative size and input classes
|
|
6
|
+
|
|
7
|
+
Use these as starting CSS viewport sizes, not prescribed breakpoints. Check just below and above meaningful layout changes and resize between classes, not only at preset widths. Combine cases only if the resulting coverage exercises each constraint; document scope that cannot be tested.
|
|
8
|
+
|
|
9
|
+
| Class | Example width × height | Task constraint to check |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| Small / standard phone portrait | 360×800 / 390×844 / 430×932 (plus 320px WCAG reflow) | One-handed reach, `>= 44×44px` touch targets, no hover dependency, long labels and soft keyboard. |
|
|
12
|
+
| Phone landscape | 844×390 | Safe insets (`env(safe-area-inset-*)`), short dialogs, keyboard/scroll recovery, primary action reachable. |
|
|
13
|
+
| Tablet portrait / landscape | 768×1024 / 1024×768 | Touch and attached keyboard/pointer; panes that adapt without losing current selection. |
|
|
14
|
+
| Foldable / split pane | Host pane sizes before and after change | Avoid a hinge or constrained pane when relevant; retain progress when resized or folded. |
|
|
15
|
+
| **Scaled 13–14" laptop (short fold)** | **`1280×620` / `1366×650`** (Windows `125%–150%` OS scale + browser chrome) | **Above-the-fold headline, value anchor, and primary CTA must remain visible and unclipped without blind scrolling.** |
|
|
16
|
+
| Desktop / large monitor | 1280×800 / 1440×900 / 1920×1080 | Keep scan efficiency, pointer actions, and keyboard/focus paths; never hide critical actions behind hover alone. |
|
|
17
|
+
| Ultrawide | 2560×1080+ | Constrain reading measure (`65–75ch`) and max shell width without stretching unrelated controls across the screen. |
|
|
18
|
+
| Shallow split / docked window | 1280×480 | Reachable focused fields and scrollable modal bodies despite sticky bars and reduced vertical space. |
|
|
19
|
+
|
|
20
|
+
## Implementation
|
|
21
|
+
|
|
22
|
+
- Verify across the standard width progression (`360`, `390`, `768`, `1024`, `1280`, `1440`, `1920+` CSS px) **and** short-height laptop folds (`1280×620` / `1366×650`). Never set hero sections to rigid `min-height: 900px` or excessive vertical padding that pushes the primary CTA below the fold on a `125%–150%` scaled Windows laptop—use `clamp()` vertical spacing and `@media (max-height: 700px)` tightening rules.
|
|
23
|
+
- Use fluid Grid/Flex, intrinsic sizing, `clamp()`, and logical properties. Use container queries for components reused in panels of different widths; reserve viewport queries for shell changes, including height and aspect-ratio constraints where needed.
|
|
24
|
+
- Consider a wide sidebar versus a compact tab bar or sheet, a table versus a summary list with details, and denser desktop controls versus touch targets. Choose only patterns that fit the task. Preserve actual table semantics or a usable comparison view when the task requires comparing rows/columns; do not remove fields to avoid reflow.
|
|
25
|
+
- Match affordances to keyboard, pointer and touch; use hover as enhancement, not the sole way to reveal an action. Test mixed-input devices and preserve Tab order and focus across presentation changes.
|
|
26
|
+
- Handle mobile browser chrome with dynamic/small viewport units (`100svh` for stable above-the-fold hero bounds without address-bar resize jumps; `100dvh`/`100dvb` with `100vh` fallback for full-height app shells) and safe-area insets (`env(safe-area-inset-*)`); treat on-screen keyboard occlusion as a separate runtime check. Make constrained regions scroll rather than clipping or locking the whole page, and verify focused controls stay visible.
|
|
27
|
+
|
|
28
|
+
```css
|
|
29
|
+
/* Logical-property adaptive shell + container-query panel adaptation */
|
|
30
|
+
.app-shell {
|
|
31
|
+
display: grid;
|
|
32
|
+
min-block-size: 100vh;
|
|
33
|
+
min-block-size: 100dvb;
|
|
34
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
35
|
+
padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.app-main {
|
|
39
|
+
container-type: inline-size;
|
|
40
|
+
container-name: workspace;
|
|
41
|
+
padding-inline: clamp(1rem, 3vw, 2rem);
|
|
42
|
+
padding-block: 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@media (inline-size >= 64rem) {
|
|
46
|
+
.app-shell {
|
|
47
|
+
grid-template-rows: none;
|
|
48
|
+
grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* Re-compose detail cards based on workspace slot width, not only viewport */
|
|
53
|
+
@container workspace (inline-size >= 44rem) {
|
|
54
|
+
.detail-grid {
|
|
55
|
+
display: grid;
|
|
56
|
+
grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
|
|
57
|
+
gap: var(--space-4, 1rem);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Preserve touch target floor on coarse pointers without inflating mouse density */
|
|
62
|
+
@media (pointer: coarse) {
|
|
63
|
+
.action-btn { min-block-size: 2.75rem; min-inline-size: 2.75rem; }
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Verification
|
|
68
|
+
|
|
69
|
+
Test the actual primary task in each distinct layout. Check touch, mouse and keyboard where relevant; include long content/text scaling, keyboard-open state for forms, and orientation/resize mid-task. Label an emulated browser viewport (`rendered` via emulation) separately from physical touch hardware, hinge, or mobile browser-chrome evidence (`rendered` on device or `not-checked`).
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Angular
|
|
2
|
+
|
|
3
|
+
## Token mapping
|
|
4
|
+
|
|
5
|
+
Import generated CSS variables in the global stylesheet configured in `angular.json` (`styles` array) or via SCSS `@use`—never legacy SCSS `@import`—and expose semantic roles through design-system components rather than copying values into component decorators:
|
|
6
|
+
|
|
7
|
+
```scss
|
|
8
|
+
// styles.scss
|
|
9
|
+
@use './tokens';
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
(Plain CSS files can still use standard CSS `@import './tokens.css';`.) Angular component encapsulation is useful for state variants, not a substitute for global semantic token ownership.
|
|
13
|
+
|
|
14
|
+
## Layout and responsive idioms
|
|
15
|
+
|
|
16
|
+
Use route-level layouts/components plus CSS grid/flex/container queries. Angular CDK layout utilities can help but should not hide simple CSS. Standalone components are the default in Angular 19+; avoid deep wrapper hierarchies that exist only for styling.
|
|
17
|
+
|
|
18
|
+
## Typography/custom fonts
|
|
19
|
+
|
|
20
|
+
Load fonts globally with preload/fallback policy. Use typographic classes/component roles rather than inline repeated typography. Verify text scaling because enterprise density often encourages fixed-height clipping.
|
|
21
|
+
|
|
22
|
+
## Motion/reduced motion
|
|
23
|
+
|
|
24
|
+
Do not add new dependencies on the deprecated `@angular/animations` DSL. Use native CSS transitions/animations (with `@starting-style` where supported) paired with Angular 20.2+ **`animate.enter`** and **`animate.leave`** bindings to animate mounting/unmounting nodes cleanly while letting CSS `@media (prefers-reduced-motion: no-preference)` govern motion:
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
@if (panelOpen()) {
|
|
28
|
+
<aside class="drawer" animate.enter="drawer-enter" animate.leave="drawer-leave">
|
|
29
|
+
...
|
|
30
|
+
</aside>
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Keep animations interruptible and honor `prefers-reduced-motion` in both CSS and any imperative Web Animations API calls.
|
|
35
|
+
|
|
36
|
+
## Accessibility specifics
|
|
37
|
+
|
|
38
|
+
Prefer native HTML controls or Angular CDK/Material components with correct configuration. CDK a11y tools (`FocusTrap`, `LiveAnnouncer`, `FocusKeyManager`) must be wired and tested; importing them is not evidence. Route focus/heading management is application responsibility. Reactive forms still require visible persistent labels and accessible error association.
|
|
39
|
+
|
|
40
|
+
## States idiom
|
|
41
|
+
|
|
42
|
+
Model async state explicitly with signals and resources: loading, refreshing, loaded-empty, loaded-partial, error, offline/stale, mutation pending, rollback. Do not unwrap async values into blank undefined states. HTTP interceptors must not swallow user-facing error context.
|
|
43
|
+
|
|
44
|
+
## Forms idiom
|
|
45
|
+
|
|
46
|
+
Reactive forms provide validation timing/control state (`touched`, `dirty`, `invalid`, async pending) while UX copy/recovery still must be designed. Use correct native input attributes (`autocomplete`, `inputmode`), preserve form model/input after submit failure, and expose a validation summary for complex flows.
|
|
47
|
+
|
|
48
|
+
## Angular 19–21 Signals, Zoneless, Resources, and Hydration idioms
|
|
49
|
+
|
|
50
|
+
- **Signals & two-way binding**: prefer `signal()`, `computed()`, `linkedSignal()` (writable derived state that resets when its source changes), `input()`, `output()`, and **`model()`** (for two-way `[(value)]` signal bindings) over manual RxJS `BehaviorSubject` boilerplate for synchronous UI state.
|
|
51
|
+
- **Async resources**: use **`httpResource()`** (reactive signal-backed `HttpClient` GET requests with `.value()`, `.isLoading()`, `.error()`, `.reload()` and automatic cancellation on param change) and **`rxResource()`** (when bridging existing RxJS streams) rather than manual `subscribe()` effects.
|
|
52
|
+
- **NgRx SignalStore (`@ngrx/signals`)**: for multi-feature shared state, prefer `signalStore(withState(...), withComputed(...), withMethods(...))` over heavy action/reducer boilerplate unless strict event-sourced DevTools auditing is required.
|
|
53
|
+
- **Control flow, `@let`, and Incremental Hydration**: use `@if`, `@for (item of items(); track item.id)`, `@switch`, template-local **`@let total = subtotal() + tax();`**, and **`@defer (on viewport; hydrate on interaction)`** (with `withIncrementalHydration()` in `provideClientHydration(...)`) so non-critical islands stay SSR HTML until needed.
|
|
54
|
+
- **Zoneless change detection**: enable `provideZonelessChangeDetection()` in `bootstrapApplication` for new apps (default in Angular 21+); never mutate plain non-signal fields and expect templates to update.
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import { Component, httpResource, model, signal } from '@angular/core';
|
|
58
|
+
|
|
59
|
+
@Component({
|
|
60
|
+
selector: 'app-invoice-list',
|
|
61
|
+
template: `
|
|
62
|
+
@let res = invoices;
|
|
63
|
+
@if (res.isLoading()) {
|
|
64
|
+
<p role="status" aria-busy="true">Loading invoices…</p>
|
|
65
|
+
} @else if (res.error()) {
|
|
66
|
+
<p role="alert">Could not load invoices. <button type="button" (click)="res.reload()">Retry</button></p>
|
|
67
|
+
} @else {
|
|
68
|
+
@for (inv of res.value() ?? []; track inv.id) {
|
|
69
|
+
<a [routerLink]="['/invoice', inv.id]">{{ inv.number }}</a>
|
|
70
|
+
} @empty {
|
|
71
|
+
<p>No invoices match "{{ query() }}".</p>
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
`,
|
|
75
|
+
})
|
|
76
|
+
export class InvoiceListComponent {
|
|
77
|
+
readonly query = model('');
|
|
78
|
+
readonly invoices = httpResource<Invoice[]>(() => `/api/invoices?q=${encodeURIComponent(this.query())}`);
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Do/don't pairs
|
|
83
|
+
|
|
84
|
+
| Do | Don't |
|
|
85
|
+
|---|---|
|
|
86
|
+
| `<a [routerLink]="['/invoice', id]">View invoice</a>` | `<div (click)="router.navigate(['/invoice', id])">View invoice</div>` |
|
|
87
|
+
| CSS transitions + `animate.enter` / `animate.leave` gated by `prefers-reduced-motion` | Introducing deprecated `@angular/animations` triggers in new components |
|
|
88
|
+
| `@use './tokens';` in SCSS and semantic CSS custom properties | Legacy SCSS `@import` or copying hex constants into component styles |
|
|
89
|
+
| `httpResource` / `rxResource` + `@for (...; track item.id)` + `@empty` | Manual `subscribe()` in `ngOnInit` without teardown or missing empty/error branches |
|
|
90
|
+
| `@defer (on viewport; hydrate on interaction)` for heavy secondary widgets | Eagerly hydrating every below-the-fold chart/widget on initial load |
|
|
91
|
+
| Validation after blur/submit using control state (`touched`) | Marking untouched fields red on initial render |
|
|
92
|
+
|
|
93
|
+
## Known traps
|
|
94
|
+
|
|
95
|
+
Mutating plain properties under zoneless change detection, introducing deprecated `@angular/animations` or Karma in new Angular 20/21 apps, subscription leaks, missing `track` keys in `@for`, focus traps that never release, enterprise fixed-density clipping, Angular Material defaults mistaken for project direction.
|
|
96
|
+
|
|
97
|
+
## Verification commands
|
|
98
|
+
|
|
99
|
+
Use the project's configured test runner (Vitest via `@angular/build:unit-test` in Angular 20/21+; check `angular.json` before assuming Karma):
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
npm run lint
|
|
103
|
+
npx ng test --watch=false
|
|
104
|
+
npm run build
|
|
105
|
+
npx playwright test
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Use browser/device inspection for actual rendering and interaction evidence (`rendered`); unit tests and builds are `static` or DOM-harness evidence.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# 3D asset pipeline
|
|
2
|
+
|
|
3
|
+
## Preferred delivery path
|
|
4
|
+
|
|
5
|
+
1. Author or obtain assets with clear provenance and license.
|
|
6
|
+
2. Export GLB/glTF containing only required meshes, materials, animations, and texture sets.
|
|
7
|
+
3. Strip hidden/unused nodes, duplicate materials, unused animation clips, and excess geometry.
|
|
8
|
+
4. Compress geometry with **Meshopt** (fast decode, preserves animation/morph targets cleanly) or **Draco** (smallest static meshes) via `gltf-transform`.
|
|
9
|
+
5. Transcode textures to **KTX2 / Basis Universal** (ETC1S for diffuse/albedo, UASTC for normal/ORM maps) so textures stay compressed in GPU VRAM instead of expanding into 4×–8× RGBA buffers.
|
|
10
|
+
6. Generate sensible LODs and cap texture dimensions (`1024px` mobile / `2048px` hero) before shipping.
|
|
11
|
+
7. Load lazily, cache by versioned URL, and show a poster/loading/error state until ready.
|
|
12
|
+
|
|
13
|
+
## Concrete `gltf-transform` & loader pipeline
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
# Optimize GLB: prune/dedup, resize textures <= 1024px, KTX2/WebP textures, Meshopt geometry
|
|
17
|
+
npx @gltf-transform/cli optimize raw-chair.glb chair.opt.glb \
|
|
18
|
+
--compress meshopt \
|
|
19
|
+
--texture-compress ktx2 \
|
|
20
|
+
--texture-size 1024
|
|
21
|
+
|
|
22
|
+
# Inspect geometry, draw calls, texture sizes, and extensions
|
|
23
|
+
npx @gltf-transform/cli inspect chair.opt.glb
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
// Three.js GLTFLoader wired with self-hosted Draco/KTX2/Meshopt decoders + cleanup
|
|
28
|
+
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
|
|
29
|
+
import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
|
|
30
|
+
import { KTX2Loader } from 'three/addons/loaders/KTX2Loader.js';
|
|
31
|
+
import { MeshoptDecoder } from 'three/addons/libs/meshopt_decoder.module.js';
|
|
32
|
+
|
|
33
|
+
export function createAssetLoader(renderer: THREE.WebGLRenderer) {
|
|
34
|
+
const draco = new DRACOLoader().setDecoderPath('/decoders/draco/');
|
|
35
|
+
const ktx2 = new KTX2Loader().setTranscoderPath('/decoders/basis/').detectSupport(renderer);
|
|
36
|
+
|
|
37
|
+
const loader = new GLTFLoader();
|
|
38
|
+
loader.setDRACOLoader(draco);
|
|
39
|
+
loader.setKTX2Loader(ktx2);
|
|
40
|
+
loader.setMeshoptDecoder(MeshoptDecoder);
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
loader,
|
|
44
|
+
dispose: () => {
|
|
45
|
+
draco.dispose();
|
|
46
|
+
ktx2.dispose();
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Host `/decoders/draco/` and `/decoders/basis/` from your own static assets (rather than unpinned third-party CDNs) so CSP and offline caching remain deterministic.
|
|
53
|
+
|
|
54
|
+
## Validation
|
|
55
|
+
|
|
56
|
+
- Check visual parity after compression: normals (keep UASTC or linear encoding on normal maps), tangents, sRGB vs linear color space, alpha cutoff, animation tracks, and material roughness.
|
|
57
|
+
- Measure compressed transfer size, decode/parse time, GPU VRAM (`renderer.info.memory`), draw calls (`renderer.info.render.calls`), and time-to-interactive (`rendered`).
|
|
58
|
+
- Prefer `InstancedMesh` for repeated geometry and fetch only the active variant rather than preloading every color/model upfront.
|
|
59
|
+
|
|
60
|
+
## Useful tooling and references
|
|
61
|
+
|
|
62
|
+
- glTF 2.0 specification: https://www.khronos.org/gltf/
|
|
63
|
+
- glTF-Transform CLI & SDK: https://gltf-transform.dev/
|
|
64
|
+
- Three.js GLTFLoader: https://threejs.org/docs/#examples/en/loaders/GLTFLoader
|
|
65
|
+
- Draco: https://google.github.io/draco/
|
|
66
|
+
- Meshoptimizer: https://meshoptimizer.org/
|
|
67
|
+
- KTX-Software: https://github.com/KhronosGroup/KTX-Software
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Astro
|
|
2
|
+
|
|
3
|
+
## Token mapping
|
|
4
|
+
|
|
5
|
+
Import generated CSS variables in a shared layout or global stylesheet:
|
|
6
|
+
|
|
7
|
+
```astro
|
|
8
|
+
---
|
|
9
|
+
import '../styles/tokens.css';
|
|
10
|
+
---
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Use semantic variables in static CSS and pass only semantic names/roles into hydrated islands. Do not ship tokens repeatedly inside every island bundle.
|
|
14
|
+
|
|
15
|
+
## Layout and responsive idioms
|
|
16
|
+
|
|
17
|
+
Astro's strength is content-first static rendering with selective islands. Keep navigation/article/content composition server-rendered; use framework islands only where interaction is required. Layouts own shell structure; pages own content. Use CSS grid/container queries/measure rather than hydrating layout that does not need JS.
|
|
18
|
+
|
|
19
|
+
## Typography/custom fonts
|
|
20
|
+
|
|
21
|
+
Static rendering makes font loading visible immediately. Use the **Astro Fonts API** (`fonts` in `astro.config.mjs` with `fontProviders` + `<Font cssVariable="--font-display" preload />` in `<head>`) when on Astro 5.7+ for automatic self-hosting, metric-adjusted fallbacks, and subsetting; otherwise configure explicit `@font-face` + preload/fallback policy. Do not load display fonts needed only on one route globally unless reuse justifies cost.
|
|
22
|
+
|
|
23
|
+
## Motion/reduced motion
|
|
24
|
+
|
|
25
|
+
Use CSS motion for static/semantic transitions. For client-side view transitions in Astro 5, import **`<ClientRouter />`** from `'astro:transitions'` (replacing the deprecated `<ViewTransitions />`), honor `prefers-reduced-motion`, and re-initialize any non-island listeners on `astro:page-load`. In framework islands (`client:load`, `client:visible`, `client:idle`), honor `prefers-reduced-motion` and prefer `client:visible`/`client:idle` for nonessential animated islands.
|
|
26
|
+
|
|
27
|
+
## Accessibility specifics
|
|
28
|
+
|
|
29
|
+
Static HTML must be correct before hydration. Islands need real controls, labels, focus behavior, and route/navigation semantics. `<ClientRouter />` transitions must preserve focus, route announcements, and reduced-motion expectations. Do not use client directives to delay critical semantic content unnecessarily.
|
|
30
|
+
|
|
31
|
+
## States idiom
|
|
32
|
+
|
|
33
|
+
Static content has fewer runtime states by design; dynamic user/live data belongs in **Server Islands** (`server:defer`) or client islands. Always provide a sized `slot="fallback"` on `server:defer` components so streaming personalized regions (cart badge, user greeting, live price) do not cause CLS. Render empty/error/loading explicitly inside islands and server-island error paths.
|
|
34
|
+
|
|
35
|
+
## Forms idiom
|
|
36
|
+
|
|
37
|
+
Use **Astro Actions** (`src/actions/index.ts`, `defineAction` + Zod validation) paired with standard HTML `<form method="POST" action={actions.subscribe}>` for progressively enhanced submissions that work without client JS, then enhance optionally on the client with `actions.subscribe(formData)` and `isInputError(error)`. Always preserve entered values on validation failure and associate errors next to fields.
|
|
38
|
+
|
|
39
|
+
## Astro 5 architecture idioms
|
|
40
|
+
|
|
41
|
+
- **Content Layer API (`src/content.config.ts`)**: define collections at `src/content.config.ts` (moved from legacy `src/content/config.ts`) using `loader: glob({ pattern: '**/*.md', base: './src/content/docs' })` or `file(...)` plus `z.object(...)` schemas. Load entries with `getCollection()` and render Markdown/MDX with standalone `render(entry)` from `'astro:content'`.
|
|
42
|
+
- **Server Islands (`server:defer`)**: keep the outer page statically cached at the CDN while deferring small dynamic `.astro` components to render on demand with a fixed-height `slot="fallback"`.
|
|
43
|
+
- **Typed environment variables (`astro:env`)**: declare public/secret schema in `astro.config.mjs` (`env.schema`) and import from `astro:env/client` or `astro:env/server` instead of raw `import.meta.env` casts.
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
// src/content.config.ts (Astro 5 Content Layer)
|
|
47
|
+
import { defineCollection, z } from 'astro:content';
|
|
48
|
+
import { glob } from 'astro/loaders';
|
|
49
|
+
|
|
50
|
+
const guides = defineCollection({
|
|
51
|
+
loader: glob({ pattern: '**/*.{md,mdx}', base: './src/content/guides' }),
|
|
52
|
+
schema: z.object({ title: z.string(), publishedAt: z.coerce.date(), draft: z.boolean().default(false) }),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export const collections = { guides };
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
// src/actions/index.ts (Astro Actions)
|
|
60
|
+
import { defineAction } from 'astro:actions';
|
|
61
|
+
import { z } from 'astro:schema';
|
|
62
|
+
|
|
63
|
+
export const server = {
|
|
64
|
+
contact: defineAction({
|
|
65
|
+
accept: 'form',
|
|
66
|
+
input: z.object({ email: z.string().email(), message: z.string().min(10) }),
|
|
67
|
+
handler: async ({ email, message }) => ({ ok: true, email, length: message.length }),
|
|
68
|
+
}),
|
|
69
|
+
};
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```astro
|
|
73
|
+
---
|
|
74
|
+
import { ClientRouter } from 'astro:transitions';
|
|
75
|
+
import { actions } from 'astro:actions';
|
|
76
|
+
import CartCount from '../components/CartCount.astro';
|
|
77
|
+
---
|
|
78
|
+
<head>
|
|
79
|
+
<ClientRouter />
|
|
80
|
+
</head>
|
|
81
|
+
<header>
|
|
82
|
+
<CartCount server:defer>
|
|
83
|
+
<span slot="fallback" class="badge-placeholder" aria-busy="true">—</span>
|
|
84
|
+
</CartCount>
|
|
85
|
+
</header>
|
|
86
|
+
<form method="POST" action={actions.contact}>...</form>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Do/don't pairs
|
|
90
|
+
|
|
91
|
+
| Do | Don't |
|
|
92
|
+
|---|---|
|
|
93
|
+
| Static article/navigation markup plus `<Search client:visible />` or `<CartCount server:defer>` | Hydrating the entire marketing/docs page or disabling static caching for one dynamic badge |
|
|
94
|
+
| `src/content.config.ts` with `loader: glob(...)` and `render(entry)` | Legacy `src/content/config.ts` with `type: 'content'` and `entry.render()` in Astro 5 |
|
|
95
|
+
| `<ClientRouter />` from `'astro:transitions'` | Deprecated `<ViewTransitions />` |
|
|
96
|
+
| `defineAction` + `<form method="POST" action={actions.x}>` for forms | Hand-rolled untyped `/api/*.ts` endpoints without progressive fallback |
|
|
97
|
+
| `astro:env/server` for secrets and `astro:env/client` for public config | Reading unvalidated `import.meta.env` keys across client/server boundaries |
|
|
98
|
+
| Stable `slot="fallback"` sized like the resolved island | Blank layout-shifting fallback on `server:defer` or `client:visible` |
|
|
99
|
+
|
|
100
|
+
## Known traps
|
|
101
|
+
|
|
102
|
+
Putting Content Layer config in legacy `src/content/config.ts`, forgetting `slot="fallback"` sizing on `server:defer` islands, attaching DOM scripts on `DOMContentLoaded` instead of `astro:page-load` when `<ClientRouter />` is active, too many `client:load` directives, duplicated framework renderers, leaking server env vars into client islands.
|
|
103
|
+
|
|
104
|
+
## Verification commands
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
npx astro check
|
|
108
|
+
npm run build
|
|
109
|
+
npm run test -- --run
|
|
110
|
+
npx playwright test
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Inspect generated HTML and `astro check` as `static` evidence, and verify hydration, Server Island fallback stability, and `<ClientRouter />` focus behavior in a real browser (`rendered`).
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Audio-reactive graphics
|
|
2
|
+
|
|
3
|
+
For player UIs, waveform scrubbers (`wavesurfer.js`), game SFX (`Howler.js`), and interactive synthesis (`Tone.js`), read [media-players.md](media-players.md).
|
|
4
|
+
|
|
5
|
+
## Audio pipeline
|
|
6
|
+
|
|
7
|
+
Use Web Audio when audio analysis genuinely improves a visual interaction. Separate media playback from analysis:
|
|
8
|
+
1. Obtain a user gesture (`click` / `keydown`) before starting or resuming an `AudioContext` (`await ctx.resume()`).
|
|
9
|
+
2. Connect the media source to an `AnalyserNode` or `AudioWorklet` **and** route playback to `ctx.destination`—creating a `MediaElementAudioSourceNode` detaches the element from default speakers, so terminating at the analyser silences audio.
|
|
10
|
+
3. **Single-call `createMediaElementSource` guard**: the Web Audio spec allows calling `ctx.createMediaElementSource(el)` **only once per `HTMLMediaElement` lifetime**. Calling it again (for example during React Strict Mode double-effects or re-mounts) throws `InvalidStateError`. Cache `{ ctx, source }` in a `WeakMap<HTMLMediaElement, ...>` and reconnect/disconnect the `AnalyserNode` on remount rather than re-creating the source node.
|
|
11
|
+
4. Smooth amplitude/frequency values, map a few bands to bounded visual parameters, and pause analysis when playback stops or `document.hidden` is true.
|
|
12
|
+
5. Disconnect analyser nodes and cancel `requestAnimationFrame` on teardown (only close a cached `AudioContext` when the `<audio>`/`<video>` element itself is permanently discarded).
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
// StrictMode-safe MediaElement analysis graph (never calls createMediaElementSource twice)
|
|
16
|
+
type Graph = { ctx: AudioContext; source: MediaElementAudioSourceNode; analyser: AnalyserNode };
|
|
17
|
+
const elementGraphs = new WeakMap<HTMLMediaElement, Graph>();
|
|
18
|
+
|
|
19
|
+
export function attachAudioAnalyser(mediaEl: HTMLMediaElement): { analyser: AnalyserNode; detach: () => void } {
|
|
20
|
+
let graph = elementGraphs.get(mediaEl);
|
|
21
|
+
if (!graph) {
|
|
22
|
+
const ctx = new AudioContext();
|
|
23
|
+
const source = ctx.createMediaElementSource(mediaEl);
|
|
24
|
+
const analyser = ctx.createAnalyser();
|
|
25
|
+
analyser.fftSize = 2048;
|
|
26
|
+
analyser.smoothingTimeConstant = 0.8;
|
|
27
|
+
source.connect(analyser);
|
|
28
|
+
analyser.connect(ctx.destination); // Required so audible playback is not silenced
|
|
29
|
+
graph = { ctx, source, analyser };
|
|
30
|
+
elementGraphs.set(mediaEl, graph);
|
|
31
|
+
}
|
|
32
|
+
if (graph.ctx.state === 'suspended') void graph.ctx.resume();
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
analyser: graph.analyser,
|
|
36
|
+
detach: () => {
|
|
37
|
+
// Suspend analysis work without destroying the single-use MediaElementAudioSourceNode
|
|
38
|
+
if (graph!.ctx.state === 'running' && mediaEl.paused) void graph!.ctx.suspend();
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Do not ask for microphone permission when analysing an already playing media element. Treat microphone capture as a separate, explicit, purpose-limited permission.
|
|
45
|
+
|
|
46
|
+
## Mapping rules
|
|
47
|
+
|
|
48
|
+
- Smooth and normalize low/mid/high frequency values; avoid raw-bin jitter.
|
|
49
|
+
- Change a small number of meaningful visual properties rather than every particle independently.
|
|
50
|
+
- Clamp amplitude, hue, speed, scale, and displacement ranges.
|
|
51
|
+
- Never map audio peaks to high-contrast flashing or strobing (>3 flashes/second violates WCAG 2.3.1; see [accessibility-performance.md](accessibility-performance.md)).
|
|
52
|
+
- Support fixed seed/frozen time for visual regression tests and expose a reduced-motion / opt-out toggle.
|
|
53
|
+
|
|
54
|
+
## AudioWorklet
|
|
55
|
+
|
|
56
|
+
Use `AudioWorklet` only when custom DSP or low-latency audio processing needs a dedicated audio rendering thread. Verify browser support, module loading, sample-rate assumptions, and fallback.
|
|
57
|
+
|
|
58
|
+
Official docs:
|
|
59
|
+
- Web Audio API: https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API
|
|
60
|
+
- AnalyserNode: https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode
|
|
61
|
+
- AudioWorklet: https://developer.mozilla.org/en-US/docs/Web/API/AudioWorklet
|