@thanhnguyxn/pixelcraft 0.1.0 → 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 +1 -1
- package/.antigravity-plugin/plugin.json +32 -0
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +15 -4
- 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/README.md +185 -328
- package/SECURITY.md +28 -0
- package/assets/pixelcraft-logo-128.png +0 -0
- package/assets/pixelcraft-logo-256.png +0 -0
- package/bin/pixelcraft.mjs +431 -23
- package/docs/ARCHITECTURE.md +40 -37
- package/docs/DESIGN-RATIONALE.md +51 -3
- package/docs/INSTALL.md +221 -0
- package/evals/README.md +16 -6
- package/evals/fixtures/3d-web-engineering.json +69 -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/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/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/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-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/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/pixelcraft-accessibility.md +17 -0
- package/evals/pixelcraft-craft.md +16 -0
- package/evals/pixelcraft-dataviz.md +3 -3
- package/evals/pixelcraft-direction.md +17 -0
- package/evals/pixelcraft-game-ui.md +3 -3
- package/evals/pixelcraft-mobile.md +3 -3
- package/evals/pixelcraft-patterns.md +16 -0
- package/evals/pixelcraft-plan.md +65 -3
- package/evals/pixelcraft-review.md +3 -3
- package/evals/pixelcraft-visual-qa.md +11 -5
- package/evals/pixelcraft-web.md +21 -3
- package/evals/pixelcraft.md +4 -4
- package/gemini-extension.json +3 -2
- package/install.ps1 +57 -11
- package/install.sh +82 -7
- package/package.json +32 -4
- package/plugin.json +6 -1
- package/scripts/build-adapters.mjs +11 -13
- package/scripts/run-evals.mjs +397 -0
- package/scripts/sync-docs.mjs +381 -0
- package/scripts/test-build-adapters.mjs +14 -1
- package/scripts/test-cross-platform-qa.mjs +359 -0
- package/scripts/test-distribution.mjs +86 -7
- package/scripts/test-export-tokens.mjs +259 -3
- package/scripts/test-finish-gate.mjs +133 -10
- package/scripts/test-installers.mjs +155 -6
- package/scripts/test-shoot.mjs +23 -1
- package/scripts/test-slop-scan.mjs +390 -3
- package/scripts/test-style-inventory.mjs +23 -0
- package/scripts/test-sync-docs.mjs +140 -0
- package/scripts/test-validate-skills.mjs +82 -4
- package/scripts/validate-skills.mjs +149 -3
- package/skills/pixelcraft/SKILL.md +67 -47
- package/skills/pixelcraft/references/design-brief.md +2 -2
- package/skills/pixelcraft/references/floor.md +36 -19
- package/skills/pixelcraft/references/report-template.md +25 -11
- package/skills/pixelcraft/references/stack-detection.md +138 -67
- package/skills/pixelcraft/references/surface-acceptance.md +33 -21
- package/skills/pixelcraft/references/workflow-checkpoints.md +49 -7
- package/skills/pixelcraft-accessibility/SKILL.md +34 -13
- package/skills/pixelcraft-accessibility/references/apg-patterns.md +13 -0
- package/skills/pixelcraft-accessibility/references/motion-canvas.md +57 -0
- package/skills/pixelcraft-accessibility/references/platforms.md +34 -6
- package/skills/pixelcraft-accessibility/references/verification.md +15 -10
- package/skills/pixelcraft-accessibility/references/wcag22-checks.md +38 -5
- package/skills/pixelcraft-brandkit/SKILL.md +42 -30
- package/skills/pixelcraft-brandkit/references/asset-pipeline.md +90 -50
- package/skills/pixelcraft-brandkit/references/brand-governance.md +29 -27
- package/skills/pixelcraft-brandkit/references/logo-methods.md +33 -34
- package/skills/pixelcraft-brandkit/references/prompt-template.md +53 -51
- package/skills/pixelcraft-brandkit/references/qa-checklist.md +7 -2
- package/skills/pixelcraft-brandkit/references/visual-modes.md +16 -16
- package/skills/pixelcraft-chat-ui/SKILL.md +31 -27
- 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 +12 -6
- package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +58 -68
- package/skills/pixelcraft-chat-ui/references/slack-discord.md +60 -76
- package/skills/pixelcraft-constrained/SKILL.md +21 -20
- package/skills/pixelcraft-constrained/references/specialized-hardware.md +69 -45
- package/skills/pixelcraft-constrained/references/tv-wearables.md +123 -73
- package/skills/pixelcraft-constrained/references/voice-ui.md +86 -45
- package/skills/pixelcraft-craft/SKILL.md +29 -15
- package/skills/pixelcraft-craft/references/color.md +62 -6
- package/skills/pixelcraft-craft/references/layout.md +32 -0
- package/skills/pixelcraft-craft/references/motion.md +99 -12
- package/skills/pixelcraft-craft/references/typography.md +48 -9
- package/skills/pixelcraft-data-apps/SKILL.md +50 -31
- package/skills/pixelcraft-data-apps/references/ai-and-internal-data-apps.md +147 -0
- package/skills/pixelcraft-data-apps/references/dash.md +87 -31
- package/skills/pixelcraft-data-apps/references/evidence.md +41 -26
- package/skills/pixelcraft-data-apps/references/gradio.md +65 -27
- package/skills/pixelcraft-data-apps/references/julia-genie.md +64 -29
- package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +65 -27
- package/skills/pixelcraft-data-apps/references/nicegui.md +73 -34
- package/skills/pixelcraft-data-apps/references/observable-framework.md +65 -27
- package/skills/pixelcraft-data-apps/references/panel.md +69 -23
- package/skills/pixelcraft-data-apps/references/r-shiny.md +104 -34
- package/skills/pixelcraft-data-apps/references/reactive-data-apps.md +186 -0
- package/skills/pixelcraft-data-apps/references/reflex.md +85 -31
- package/skills/pixelcraft-data-apps/references/shiny.md +84 -27
- package/skills/pixelcraft-data-apps/references/streamlit.md +73 -25
- package/skills/pixelcraft-dataviz/SKILL.md +21 -24
- package/skills/pixelcraft-dataviz/references/color-accessibility.md +2 -2
- package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +35 -25
- package/skills/pixelcraft-dataviz/references/libraries.md +165 -46
- package/skills/pixelcraft-dataviz/references/maps-geospatial.md +159 -0
- package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +58 -65
- package/skills/pixelcraft-desktop/SKILL.md +61 -39
- package/skills/pixelcraft-desktop/references/appkit.md +60 -26
- package/skills/pixelcraft-desktop/references/avalonia.md +65 -29
- package/skills/pixelcraft-desktop/references/cpp-gui.md +104 -27
- package/skills/pixelcraft-desktop/references/electron.md +68 -26
- package/skills/pixelcraft-desktop/references/go-gui.md +59 -30
- package/skills/pixelcraft-desktop/references/gtk.md +74 -31
- package/skills/pixelcraft-desktop/references/javafx-swing.md +54 -25
- package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +57 -30
- package/skills/pixelcraft-desktop/references/rust-gui.md +59 -41
- package/skills/pixelcraft-desktop/references/tauri.md +80 -24
- package/skills/pixelcraft-desktop/references/uno-platform.md +42 -23
- package/skills/pixelcraft-desktop/references/winui-wpf.md +66 -26
- package/skills/pixelcraft-desktop/references/working-context.md +82 -3
- package/skills/pixelcraft-direction/SKILL.md +48 -82
- package/skills/pixelcraft-direction/references/creative-brainstorming.md +72 -0
- package/skills/pixelcraft-direction/references/direction-card.md +11 -1
- package/skills/pixelcraft-direction/references/direction-scoring.md +5 -1
- package/skills/pixelcraft-direction/references/motion-identity.md +67 -0
- package/skills/pixelcraft-direction/references/movements.md +3 -0
- package/skills/pixelcraft-direction/references/reference-analysis.md +37 -0
- package/skills/pixelcraft-direction/references/slop-fingerprints.md +32 -7
- package/skills/pixelcraft-document/SKILL.md +27 -23
- package/skills/pixelcraft-document/references/archetypes.md +27 -4
- package/skills/pixelcraft-document/references/pdf-tools.md +241 -81
- package/skills/pixelcraft-document/references/pdfjs-and-pptx.md +114 -0
- package/skills/pixelcraft-document/references/print-css.md +96 -43
- package/skills/pixelcraft-document/references/slides.md +123 -27
- package/skills/pixelcraft-email/SKILL.md +42 -20
- package/skills/pixelcraft-email/references/client-quirks.md +101 -33
- package/skills/pixelcraft-email/references/html-tables.md +83 -22
- package/skills/pixelcraft-email/references/maizzle.md +54 -0
- package/skills/pixelcraft-email/references/mjml.md +13 -11
- package/skills/pixelcraft-email/references/react-email.md +76 -34
- package/skills/pixelcraft-extensions/SKILL.md +32 -27
- package/skills/pixelcraft-extensions/references/browser-extensions.md +91 -17
- package/skills/pixelcraft-extensions/references/figma-office.md +97 -14
- package/skills/pixelcraft-extensions/references/ide-and-saas-plugins.md +125 -0
- package/skills/pixelcraft-extensions/references/raycast.md +90 -11
- package/skills/pixelcraft-extensions/references/vscode-webviews.md +91 -17
- package/skills/pixelcraft-game-ui/SKILL.md +45 -26
- package/skills/pixelcraft-game-ui/references/bevy.md +69 -31
- package/skills/pixelcraft-game-ui/references/godot.md +100 -27
- package/skills/pixelcraft-game-ui/references/hud-principles.md +50 -21
- package/skills/pixelcraft-game-ui/references/love2d.md +53 -27
- package/skills/pixelcraft-game-ui/references/monogame.md +45 -29
- package/skills/pixelcraft-game-ui/references/unity-ugui.md +109 -0
- package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +69 -27
- package/skills/pixelcraft-game-ui/references/unreal-umg.md +53 -26
- package/skills/pixelcraft-game-ui/references/web-and-middleware-game-ui.md +122 -0
- package/skills/pixelcraft-handoff/SKILL.md +14 -13
- package/skills/pixelcraft-handoff/references/design-translation.md +40 -10
- package/skills/pixelcraft-handoff/references/motion-handoff.md +54 -0
- package/skills/pixelcraft-media/SKILL.md +20 -23
- package/skills/pixelcraft-media/references/banners-video.md +83 -65
- package/skills/pixelcraft-media/references/og-generation.md +110 -63
- package/skills/pixelcraft-media/references/social-cards.md +57 -58
- package/skills/pixelcraft-mobile/SKILL.md +53 -36
- package/skills/pixelcraft-mobile/references/dotnet-maui.md +62 -34
- package/skills/pixelcraft-mobile/references/flet.md +53 -26
- package/skills/pixelcraft-mobile/references/flutter.md +76 -32
- package/skills/pixelcraft-mobile/references/harmonyos-and-emerging-mobile.md +121 -0
- package/skills/pixelcraft-mobile/references/ionic-capacitor.md +48 -26
- package/skills/pixelcraft-mobile/references/jetpack-compose.md +92 -24
- package/skills/pixelcraft-mobile/references/kivy.md +54 -31
- package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +53 -27
- 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 +66 -31
- package/skills/pixelcraft-mobile/references/swiftui.md +158 -28
- package/skills/pixelcraft-mobile/references/tactile-interactions.md +55 -0
- package/skills/pixelcraft-mobile/references/task-state-composition.md +82 -2
- package/skills/pixelcraft-mobile/references/uikit.md +57 -23
- package/skills/pixelcraft-patterns/SKILL.md +30 -13
- 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 +32 -13
- 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 +35 -16
- package/skills/pixelcraft-patterns/references/communication.md +34 -15
- package/skills/pixelcraft-patterns/references/creative-tools.md +30 -17
- package/skills/pixelcraft-patterns/references/creative-web-composition.md +38 -0
- package/skills/pixelcraft-patterns/references/dashboard-admin.md +22 -18
- package/skills/pixelcraft-patterns/references/history-diff-undo.md +50 -0
- package/skills/pixelcraft-patterns/references/marketing.md +31 -19
- 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 +8 -2
- 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/settings.md +40 -12
- package/skills/pixelcraft-plan/SKILL.md +54 -18
- 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 +44 -9
- package/skills/pixelcraft-plan/references/repo-discovery.md +16 -9
- package/skills/pixelcraft-plan/references/stack-freshness.md +22 -5
- package/skills/pixelcraft-plan/references/stack-selection.md +65 -9
- package/skills/pixelcraft-review/SKILL.md +41 -19
- package/skills/pixelcraft-review/references/audit-report.md +20 -1
- package/skills/pixelcraft-review/references/heuristics.md +63 -18
- package/skills/pixelcraft-review/references/personas.md +41 -14
- package/skills/pixelcraft-review/references/polish.md +66 -26
- package/skills/pixelcraft-review/scripts/check-acceptance.mjs +619 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-longhand-removal.css +34 -0
- package/skills/pixelcraft-review/scripts/slop-scan.mjs +679 -32
- package/skills/pixelcraft-spatial/SKILL.md +16 -17
- package/skills/pixelcraft-spatial/references/comfort-accessibility.md +25 -84
- package/skills/pixelcraft-spatial/references/platforms.md +123 -53
- package/skills/pixelcraft-tokens/SKILL.md +18 -14
- package/skills/pixelcraft-tokens/assets/tokens.example.json +1 -1
- package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +1 -1
- package/skills/pixelcraft-tokens/references/format.md +39 -9
- package/skills/pixelcraft-tokens/references/governance.md +1 -1
- package/skills/pixelcraft-tokens/references/theme-presets.md +36 -8
- package/skills/pixelcraft-tokens/references/token-tooling.md +119 -0
- package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +637 -75
- package/skills/pixelcraft-tui/SKILL.md +41 -25
- package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +49 -30
- package/skills/pixelcraft-tui/references/extended-tui-toolkits.md +127 -0
- package/skills/pixelcraft-tui/references/ink.md +77 -28
- package/skills/pixelcraft-tui/references/ratatui.md +70 -30
- package/skills/pixelcraft-tui/references/rich.md +53 -33
- package/skills/pixelcraft-tui/references/terminal-protocols.md +80 -0
- package/skills/pixelcraft-tui/references/textual.md +75 -34
- package/skills/pixelcraft-ux/SKILL.md +22 -12
- package/skills/pixelcraft-ux/references/feedback-performance.md +39 -19
- package/skills/pixelcraft-ux/references/forms.md +57 -3
- package/skills/pixelcraft-ux/references/i18n.md +50 -12
- package/skills/pixelcraft-ux/references/laws.md +35 -14
- package/skills/pixelcraft-ux/references/state-matrix.md +15 -1
- package/skills/pixelcraft-ux/references/ux-writing.md +1 -0
- package/skills/pixelcraft-visual-qa/SKILL.md +21 -7
- package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +28 -7
- package/skills/pixelcraft-visual-qa/references/capture-document.md +70 -0
- package/skills/pixelcraft-visual-qa/references/capture-email.md +13 -9
- package/skills/pixelcraft-visual-qa/references/capture-mobile.md +20 -5
- package/skills/pixelcraft-visual-qa/references/capture-terminal.md +6 -2
- package/skills/pixelcraft-visual-qa/references/motion-capture.md +63 -0
- package/skills/pixelcraft-visual-qa/references/performance-budgets.md +25 -12
- package/skills/pixelcraft-visual-qa/references/realtime-graphics.md +55 -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 +50 -11
- package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +214 -59
- package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +121 -49
- package/skills/pixelcraft-web/SKILL.md +105 -49
- package/skills/pixelcraft-web/references/accessibility-performance.md +42 -0
- package/skills/pixelcraft-web/references/adaptive-layout.md +52 -8
- package/skills/pixelcraft-web/references/angular.md +63 -16
- package/skills/pixelcraft-web/references/assets-pipeline.md +67 -0
- package/skills/pixelcraft-web/references/astro.md +64 -13
- 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 +52 -17
- 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/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 +3 -2
- package/skills/pixelcraft-web/references/gsap.md +102 -0
- package/skills/pixelcraft-web/references/html-css.md +144 -12
- package/skills/pixelcraft-web/references/htmx-alpine.md +68 -18
- 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 +27 -18
- package/skills/pixelcraft-web/references/kotlin-web.md +6 -2
- package/skills/pixelcraft-web/references/leptos-yew.md +62 -19
- package/skills/pixelcraft-web/references/lit-web-components.md +4 -2
- 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 +6 -1
- package/skills/pixelcraft-web/references/qwik.md +51 -11
- package/skills/pixelcraft-web/references/r3f-integration.md +69 -0
- package/skills/pixelcraft-web/references/react-next.md +112 -13
- 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/scene-architecture.md +132 -0
- package/skills/pixelcraft-web/references/server-rendered.md +106 -63
- 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 +67 -16
- 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 +61 -11
- package/skills/pixelcraft-web/references/tailwind.md +40 -14
- package/skills/pixelcraft-web/references/video-media.md +69 -0
- package/skills/pixelcraft-web/references/vue-nuxt.md +37 -13
- package/skills/pixelcraft-web/references/web-3d-engines.md +97 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# SVG banners and motion
|
|
1
|
+
# SVG banners, programmatic video, and vector motion export
|
|
2
2
|
|
|
3
|
-
Vector banners
|
|
3
|
+
Vector banners, video loops, and motion graphics are consumed through crops, scaling, platform recompression, and host UI overlays outside the author's control. Build deterministically from real content and inspect the exported artifact.
|
|
4
4
|
|
|
5
5
|
## SVG banners and posters
|
|
6
6
|
|
|
@@ -8,105 +8,123 @@ SVG is ideal for deterministic banners because it is scalable, inspectable, and
|
|
|
8
8
|
|
|
9
9
|
Rules:
|
|
10
10
|
|
|
11
|
-
-
|
|
11
|
+
- set an explicit `viewBox` plus width/height and export mapping;
|
|
12
12
|
- include `<title>` and `<desc>` when SVG is inline in HTML; raster exports need platform alt text instead;
|
|
13
|
-
- do not assume viewer fonts
|
|
14
|
-
- verify text wrapping
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
- simplify paths enough for file size but preserve sharp edges at target scale;
|
|
18
|
-
- test light/dark embedding contexts; transparent art can disappear or halo.
|
|
13
|
+
- do not assume viewer fonts—embed/convert text deliberately or export with bundled licensed fonts;
|
|
14
|
+
- verify text wrapping manually because ordinary SVG `<text>` does not reflow like HTML;
|
|
15
|
+
- strip scripts, foreignObject, and untrusted external URLs from crawler-facing or user-supplied SVG;
|
|
16
|
+
- test light and dark embedding contexts (`prefers-color-scheme` or solid backing) so transparent art never disappears or halos.
|
|
19
17
|
|
|
20
|
-
For repository banners/docs, export PNG/WebP fallbacks where inline SVG is
|
|
18
|
+
For repository banners/docs, export PNG/WebP fallbacks where inline SVG is blocked, preserving the source SVG and exact export command.
|
|
21
19
|
|
|
22
20
|
## Aspect-ratio variants
|
|
23
21
|
|
|
24
|
-
Design a system
|
|
22
|
+
Design a system rather than center-cropping one master:
|
|
25
23
|
|
|
26
|
-
| Ratio | Typical frame | Role |
|
|
24
|
+
| Ratio | Typical frame | Role & mandatory safe inset |
|
|
27
25
|
|---|---:|---|
|
|
28
|
-
| 16:9 | 1920×1080 or 1280×720 | presentation, landscape video, docs |
|
|
29
|
-
| 1:1 | 1080×1080 | square feed/embed |
|
|
30
|
-
| 9:16 | 1080×1920 |
|
|
31
|
-
| 2:1 | 1280×640 | GitHub social
|
|
26
|
+
| 16:9 | 1920×1080 or 1280×720 | presentation, YouTube, landscape video, docs (`5–10%` edge inset; YouTube bottom-right duration badge clear) |
|
|
27
|
+
| 1:1 | 1080×1080 | square feed/embed (`>= 80 px` edge inset) |
|
|
28
|
+
| 9:16 | 1080×1920 | Reels / TikTok / Shorts: keep titles, faces, and burned-in captions clear of **`top >= 150–220 px`**, **`bottom >= 320–420 px`**, and **`right >= 120–160 px`** (`>= 60 px` left) |
|
|
29
|
+
| 1.91:1 / 2:1 | 1200×630 / 1280×640 | universal OG (`1000×500` center safe zone) / GitHub social preview |
|
|
32
30
|
|
|
33
|
-
Recompose hierarchy
|
|
31
|
+
Recompose hierarchy per ratio: never center-crop a `16:9` master into `9:16`—vertical feeds require stacking subject + open captions inside the `top 220 px .. bottom 1500 px`, `left 60 px .. right 920 px` clear corridor so TikTok/Reels/Shorts chrome never occludes copy.
|
|
34
32
|
|
|
35
|
-
## Remotion
|
|
33
|
+
## Remotion (v4+)
|
|
36
34
|
|
|
37
|
-
Remotion renders
|
|
35
|
+
Remotion renders deterministic video from React components using frame-driven state (`useCurrentFrame()`, `useVideoConfig()`, `spring()`, `interpolate()`).
|
|
38
36
|
|
|
39
|
-
```
|
|
40
|
-
import { Composition } from 'remotion';
|
|
37
|
+
```tsx
|
|
38
|
+
import { Composition, OffthreadVideo, staticFile } from 'remotion';
|
|
39
|
+
import { TransitionSeries, linearTiming } from '@remotion/transitions';
|
|
40
|
+
import { fade } from '@remotion/transitions/fade';
|
|
41
|
+
import { loadFont } from '@remotion/google-fonts/Inter';
|
|
42
|
+
|
|
43
|
+
const { fontFamily } = loadFont('normal', { weights: ['600', '700'], subsets: ['latin'] });
|
|
41
44
|
|
|
42
45
|
export const Root = () => (
|
|
43
46
|
<Composition
|
|
44
|
-
id="
|
|
45
|
-
component={
|
|
46
|
-
durationInFrames={
|
|
47
|
+
id="ReleaseHighlight"
|
|
48
|
+
component={ReleaseHighlight}
|
|
49
|
+
durationInFrames={180}
|
|
47
50
|
fps={30}
|
|
48
51
|
width={1920}
|
|
49
52
|
height={1080}
|
|
50
|
-
defaultProps={{ title: 'Pixelcraft' }}
|
|
53
|
+
defaultProps={{ title: 'Pixelcraft v2', clip: staticFile('demo.mp4') }}
|
|
51
54
|
/>
|
|
52
55
|
);
|
|
53
56
|
```
|
|
54
57
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
Rules:
|
|
58
|
+
Remotion v4+ production rules:
|
|
58
59
|
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
- test audio sync, dropped frames, alpha/transparent output, color space, and render concurrency;
|
|
65
|
-
- keep captions as timed data rather than burned-in decoration only; supply caption files where platform supports them.
|
|
60
|
+
- **`<OffthreadVideo>` vs `<Video>`**: prefer `<OffthreadVideo>` during headless/server renders—it decodes exact frames via native FFmpeg outside Chromium's `<video>` element, preventing dropped frames, seek drift, and browser codec mismatches; use `<Video>` primarily inside interactive browser `<Player>` previews.
|
|
61
|
+
- **Interactive preview (`@remotion/player`)**: embed `<Player>` in web apps for real-time parameter previewing and scrubbing without invoking server rendering on every edit.
|
|
62
|
+
- **Cloud rendering**: scale batch/user-generated exports with **Remotion Lambda** (AWS Lambda distributed chunk rendering) or **Remotion Cloud Run** rather than blocking web request threads.
|
|
63
|
+
- **Official v4 packages**: use `@remotion/transitions` (`<TransitionSeries>`), `@remotion/captions` (SRT/WebVTT parsing + timed captions), and `@remotion/google-fonts` (deterministic font loading before frame 0).
|
|
64
|
+
- Derive every pixel strictly from `frame` and props; never use `Date.now()`, `Math.random()` without `random(seed)`, or unawaited CSS transitions (`transition: all`) which desync during frame-by-frame capture.
|
|
66
65
|
|
|
67
|
-
## Motion Canvas
|
|
66
|
+
## Motion Canvas and Revideo
|
|
68
67
|
|
|
69
|
-
Motion Canvas uses generator-based TypeScript scenes
|
|
68
|
+
**Motion Canvas** uses generator-based TypeScript scenes with a visual timeline editor; **Revideo** is the maintained headless-first fork of Motion Canvas built for CLI/server-side programmatic rendering, parameterized scenes, audio tracks, and cloud video pipelines.
|
|
70
69
|
|
|
71
70
|
```tsx
|
|
72
|
-
import { makeScene2D,
|
|
73
|
-
import {
|
|
71
|
+
import { makeScene2D, Txt } from '@motion-canvas/2d';
|
|
72
|
+
import { createRef, waitFor } from '@motion-canvas/core';
|
|
74
73
|
|
|
75
74
|
export default makeScene2D(function* (view) {
|
|
76
75
|
const title = createRef<Txt>();
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
const subtitle = createRef<Txt>();
|
|
77
|
+
// Frame 0 (0.0s) MUST render a legible title/poster immediately when autoplay is disabled
|
|
78
|
+
view.add(
|
|
79
|
+
<>
|
|
80
|
+
<Txt ref={title} fill="#f8fafc" fontSize={84} y={-26} opacity={1}>Pixelcraft v2</Txt>
|
|
81
|
+
<Txt ref={subtitle} fill="#94a3b8" fontSize={36} y={42} opacity={0}>Studio-Grade Motion</Txt>
|
|
82
|
+
</>,
|
|
83
|
+
);
|
|
84
|
+
yield* waitFor(0.2);
|
|
85
|
+
yield* subtitle().opacity(1, 0.45);
|
|
86
|
+
yield* waitFor(1.2);
|
|
80
87
|
});
|
|
81
88
|
```
|
|
82
89
|
|
|
83
|
-
|
|
90
|
+
- Pick **Motion Canvas** for author-driven visual editing and technical explainer animations; pick **Revideo** (`@revideo/2d`, `@revideo/core`, `@revideo/renderer`) when you need headless CI/server video generation from the same generator paradigm;
|
|
91
|
+
- **Never start frame `0` (`0.0s`) empty or at `opacity={0}`**: paused embeds, reduced-motion fallbacks, and social feed scrubbers display `0.0s` whenever no external poster overrides it—render a legible title/poster state at `0.0s` before secondary transitions;
|
|
92
|
+
- use signals/layout references rather than visual guesses, pin project resolution/fps, and verify fonts in both editor and headless render.
|
|
84
93
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
94
|
+
## FFmpeg export pipeline
|
|
95
|
+
|
|
96
|
+
Standardize web and social video exports with explicit pixel format, container atom ordering, codec budget, loudness normalization, and caption tracks:
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
# 1. Universal H.264 MP4 (Safari/QuickTime/iOS safe + fast web start + -14 LUFS social/web loudness)
|
|
100
|
+
ffmpeg -i input.mov -i captions.vtt \
|
|
101
|
+
-c:v libx264 -crf 20 -preset slow -pix_fmt yuv420p \
|
|
102
|
+
-c:a aac -b:a 160k -af "loudnorm=I=-14:TP=-1.5:LRA=11" \
|
|
103
|
+
-c:s mov_text -metadata:s:s:0 language=eng \
|
|
104
|
+
-movflags +faststart output.mp4
|
|
105
|
+
|
|
106
|
+
# 2. Compact web loop replacing heavy animated GIFs (VP9 WebM + H.264 MP4 fallback)
|
|
107
|
+
ffmpeg -i source.mov -an -c:v libvpx-vp9 -crf 32 -b:v 0 -pix_fmt yuv420p loop.webm
|
|
108
|
+
ffmpeg -i source.mov -an -c:v libx264 -crf 22 -pix_fmt yuv420p -movflags +faststart loop.mp4
|
|
109
|
+
```
|
|
90
110
|
|
|
91
|
-
|
|
111
|
+
Critical FFmpeg rules:
|
|
92
112
|
|
|
93
|
-
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
113
|
+
- **`-pix_fmt yuv420p` is mandatory for H.264 compatibility**: default `yuv444p` / 10-bit output renders black or fails to open in Safari, QuickTime, and iOS;
|
|
114
|
+
- **`-movflags +faststart`**: relocates the MP4 `moov` atom to the start of the file so browsers begin playback immediately instead of downloading the entire file first;
|
|
115
|
+
- **Codec ladder**: use H.264 (`libx264`, `-crf 18–23`) as the universal baseline; add VP9 (`libvpx-vp9`) or AV1 (`libsvtav1`) `<source>` variants for bandwidth-heavy loops where target decoders support them;
|
|
116
|
+
- **Audio loudness (`loudnorm`)**: normalize social and web video feeds (YouTube, Reels, TikTok, Shorts, X, LinkedIn) to `loudnorm=I=-14:TP=-1.5:LRA=11` (`-14 LUFS` integrated loudness, `-1.5 dBTP` true-peak ceiling); use `-16 LUFS` only for Apple Podcasts and spoken-word mobile audio;
|
|
117
|
+
- **Captions**: mux WebVTT/SRT soft tracks (`-c:s mov_text` for MP4) AND keep burned-in open captions inside vertical/feed safe zones for muted social autoplay;
|
|
118
|
+
- **MP4/WebM loops over heavy GIFs**: replace multi-megabyte GIFs with muted looping `<video autoplay loop muted playsinline poster="first-frame.webp">` (typically 5–10× smaller with full 24-bit color and 60 fps); use GIF only on surfaces that disallow video embeds.
|
|
99
119
|
|
|
100
|
-
##
|
|
120
|
+
## Lottie (`dotLottie`) and Rive vector export pipelines
|
|
101
121
|
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
- test on device/feed scale and in light/dark contexts;
|
|
105
|
-
- validate transparency/background behavior;
|
|
106
|
-
- compare audio loudness/sync when audio exists;
|
|
107
|
-
- test compression artifacts in the target platform or label platform verification `not-checked`;
|
|
108
|
-
- keep deterministic seeds/settings and source assets under version control where licensing permits.
|
|
122
|
+
- **Lottie (`dotLottie`, `.lottie`)**: package JSON animations + bitmap assets/themes into a compressed `.lottie` archive rather than shipping bloated raw `.json`. Strip unsupported After Effects expressions, merge/track-matte glitches, and verify playback in the exact target player (`@lottiefiles/dotlottie-web`, iOS/Android native).
|
|
123
|
+
- **Rive (`.riv`)**: export compact binary `.riv` files with explicit artboard bounds, state-machine inputs, embedded fonts (or vector outlines), and a static reduced-motion state/poster image. Never hide critical UI copy exclusively inside opaque vector animation files without accessible text equivalents.
|
|
109
124
|
|
|
110
|
-
##
|
|
125
|
+
## Captions, sound, and export verification
|
|
111
126
|
|
|
112
|
-
|
|
127
|
+
- Never rely on sound for essential meaning; avoid flashing/strobing luminance changes (>3 flashes/sec);
|
|
128
|
+
- keep burned-in captions inside platform safe zones and supply sidecar WebVTT/SRT where supported;
|
|
129
|
+
- inspect exported `ffprobe` metadata (dimensions, `pix_fmt`, fps, duration, codecs, bitrate, audio sample rate, byte size) (`static`) and inspect first/middle/last frames plus key transitions on light/dark backgrounds and mobile feed scale (`rendered`);
|
|
130
|
+
- reject endless floating gradients, fake tilted UI fly-throughs, sparkles replacing substance, and unreadable kinetic typography.
|
|
@@ -1,35 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# OG and programmatic image generation pipelines
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Choose the generator for layout complexity, script shaping (Latin vs Arabic/Indic/CJK), output format (PNG/WebP/AVIF), latency budget, and runtime environment (Node.js, Rust, Edge, or headless browser).
|
|
4
4
|
|
|
5
5
|
## Pipeline boundaries
|
|
6
6
|
|
|
7
|
-
| Tool | Output/model | Critical
|
|
8
|
-
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
|
7
|
+
| Tool | Output / model | Best for | Critical boundaries |
|
|
8
|
+
|---|---|---|---|
|
|
9
|
+
| **Takumi** (`@takumi-rs/image-response` / Rust) | Rust high-speed JSX/Tailwind → PNG/WebP/AVIF | fast dynamic OG cards needing **CSS Grid**, Flexbox, WOFF2 fonts, and WebP/AVIF output | native Rust binding (Node.js/server runtime or WASM build); verify CSS support per pinned version |
|
|
10
|
+
| **Next.js `ImageResponse` (`next/og`)** | JSX/CSS → PNG via Satori + Resvg | Next.js App Router `opengraph-image.tsx` routes | Next.js 15/16 defaults to **Node.js runtime** (`runtime = 'nodejs'`), lifting the 500 KB Edge limit and enabling `fs.readFile`; Edge Runtime (`runtime = 'edge'`) keeps the 500 KB bundle cap; Flexbox-only + TTF/OTF/WOFF fonts |
|
|
11
|
+
| **`@vercel/og`** | JSX/CSS → PNG via Satori + Resvg | Vercel Edge / serverless functions | 500 KB Edge bundle cap including JSX/fonts/assets; Flexbox-only subset; TTF/OTF/WOFF only (no WOFF2) |
|
|
12
|
+
| **Satori + `@resvg/resvg-js`** | JSX → SVG string → PNG buffer | framework-agnostic Node/CI/Astro/Remix OG generation | explicit font buffers required; no system fallback; handle emoji/CJK via `loadAdditionalAsset` |
|
|
13
|
+
| **Sharp** (`sharp`) | libvips raster compositing, resize, WebP/AVIF/PNG | compositing SVG/PNG badges, multi-crop social variants, strict byte budgets (WhatsApp <300 KB, GitHub <1 MB) | not an HTML/CSS layout engine; pair with SVG/Satori/Takumi |
|
|
14
|
+
| **`@napi-rs/canvas` / `skia-canvas`** | Rust/Skia 2D Canvas API in Node.js | custom generative art, pixel-exact charts, dense data badges without HTML layout | manual text wrapping and coordinate layout |
|
|
15
|
+
| **Playwright HTML-to-screenshot** | full Chromium render → PNG/JPEG/WebP | complex **Arabic/Indic/CJK bidirectional shaping**, full CSS Grid/subgrid, SVG filters, rich web components | high memory/cold-start latency; pre-render at build time or cache aggressively behind CDN |
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
## Next.js 15/16 `ImageResponse` (Node.js runtime)
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
In Next.js 15/16, `opengraph-image.tsx` and Route Handlers default to the **Node.js runtime** (`export const runtime = 'nodejs'`), which lifts the legacy 500 KB Edge bundle cap and allows reading local font assets directly via `node:fs/promises`:
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
- use only the documented supported CSS subset;
|
|
19
|
-
- maximum bundle size is 500 KB including JSX/CSS/fonts/images/assets;
|
|
20
|
-
- font data must be supplied explicitly as `Buffer`/`ArrayBuffer`;
|
|
21
|
-
- supported font formats are TTF, OTF, and WOFF—not WOFF2; TTF/OTF are preferred for parsing speed;
|
|
22
|
-
- every text style needs matching family/weight/style font data;
|
|
23
|
-
- images need explicit dimensions and reliable data/URLs; prefer inline/buffer data where latency/reliability matters;
|
|
24
|
-
- JSX must be pure/static: no hooks/state/effects/browser DOM assumptions.
|
|
25
|
-
|
|
26
|
-
## Font loading pattern
|
|
27
|
-
|
|
28
|
-
```jsx
|
|
21
|
+
```tsx
|
|
29
22
|
import { ImageResponse } from 'next/og';
|
|
23
|
+
import { readFile } from 'node:fs/promises';
|
|
24
|
+
import { join } from 'node:path';
|
|
30
25
|
|
|
31
|
-
export
|
|
32
|
-
|
|
26
|
+
export const runtime = 'nodejs'; // default in Next.js 15/16; lifts 500 KB Edge cap
|
|
27
|
+
export const size = { width: 1200, height: 630 };
|
|
28
|
+
export const contentType = 'image/png';
|
|
29
|
+
|
|
30
|
+
export default async function Image() {
|
|
31
|
+
const interBold = await readFile(join(process.cwd(), 'assets/fonts/Inter-Bold.ttf'));
|
|
33
32
|
|
|
34
33
|
return new ImageResponse(
|
|
35
34
|
(
|
|
@@ -38,70 +37,118 @@ export async function GET() {
|
|
|
38
37
|
width: '100%',
|
|
39
38
|
height: '100%',
|
|
40
39
|
display: 'flex',
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
flexDirection: 'column',
|
|
41
|
+
justifyContent: 'space-between',
|
|
42
|
+
padding: 72,
|
|
43
|
+
background: '#0f172a',
|
|
44
|
+
color: '#f8fafc',
|
|
45
45
|
fontFamily: 'Inter',
|
|
46
46
|
}}
|
|
47
47
|
>
|
|
48
|
-
Pixelcraft
|
|
48
|
+
<div style={{ fontSize: 64, fontWeight: 700, lineHeight: 1.1 }}>Pixelcraft</div>
|
|
49
|
+
<div style={{ fontSize: 28, color: '#cbd5e1' }}>Portable UI craft across every surface</div>
|
|
49
50
|
</div>
|
|
50
51
|
),
|
|
51
52
|
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
fonts: [
|
|
55
|
-
{
|
|
56
|
-
name: 'Inter',
|
|
57
|
-
data: fontData,
|
|
58
|
-
weight: 700,
|
|
59
|
-
style: 'normal',
|
|
60
|
-
},
|
|
61
|
-
],
|
|
53
|
+
...size,
|
|
54
|
+
fonts: [{ name: 'Inter', data: interBold, weight: 700, style: 'normal' }],
|
|
62
55
|
},
|
|
63
56
|
);
|
|
64
57
|
}
|
|
65
58
|
```
|
|
66
59
|
|
|
67
|
-
|
|
60
|
+
If you explicitly opt into `export const runtime = 'edge'`, enforce the 500 KB total bundle cap and load fonts via `fetch(new URL('./Inter-Bold.ttf', import.meta.url))`.
|
|
61
|
+
|
|
62
|
+
## Satori + `@resvg/resvg-js` (`loadAdditionalAsset` & `tw` caveats)
|
|
68
63
|
|
|
69
|
-
|
|
64
|
+
Use Satori directly with `@resvg/resvg-js` when you want deterministic Node/CI generation outside Vercel/Next:
|
|
70
65
|
|
|
71
|
-
```
|
|
66
|
+
```ts
|
|
72
67
|
import satori from 'satori';
|
|
68
|
+
import { Resvg } from '@resvg/resvg-js';
|
|
69
|
+
import { readFile } from 'node:fs/promises';
|
|
70
|
+
|
|
71
|
+
const interBold = await readFile('./assets/Inter-Bold.ttf');
|
|
73
72
|
|
|
74
73
|
const svg = await satori(element, {
|
|
75
74
|
width: 1200,
|
|
76
75
|
height: 630,
|
|
77
|
-
fonts: [{ name: 'Inter', data:
|
|
76
|
+
fonts: [{ name: 'Inter', data: interBold, weight: 700, style: 'normal' }],
|
|
77
|
+
// On-demand emoji (Twemoji SVG data URI) or CJK subset fonts without bloating the base bundle
|
|
78
|
+
loadAdditionalAsset: async (code, segment) => {
|
|
79
|
+
if (code === 'emoji') {
|
|
80
|
+
return await loadLocalTwemojiDataUri(segment);
|
|
81
|
+
}
|
|
82
|
+
return '';
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// Satori already converts glyphs to vector paths; disable system font scanning for speed & determinism
|
|
87
|
+
const resvg = new Resvg(svg, {
|
|
88
|
+
fitTo: { mode: 'width', value: 1200 },
|
|
89
|
+
font: { loadSystemFonts: false },
|
|
78
90
|
});
|
|
91
|
+
const pngBuffer = resvg.render().asPng();
|
|
79
92
|
```
|
|
80
93
|
|
|
81
|
-
Satori
|
|
94
|
+
Satori caveats:
|
|
82
95
|
|
|
83
|
-
|
|
96
|
+
- **`tw` prop**: Satori's built-in Tailwind `tw="..."` prop parses a constrained Tailwind v3-era subset (no CSS Grid, no Tailwind v4 `oklch()` / CSS variables, no responsive breakpoints or arbitrary pseudo-selectors). Prefer explicit `style` objects or inspect rendered PNG bytes whenever using `tw`.
|
|
97
|
+
- **`loadAdditionalAsset`**: use for Twemoji/OpenMoji SVG data URIs or on-demand CJK/Arabic subset fonts so missing glyphs never render as tofu boxes; pin local or allowlisted assets rather than making uncached per-request external fetches.
|
|
98
|
+
- **No implicit system fallback**: every weight (`400`, `700`) and style (`normal`, `italic`) used in JSX needs a matching buffer in `fonts`.
|
|
84
99
|
|
|
85
|
-
|
|
86
|
-
- avoid external stylesheets/selectors/media queries/pseudo-elements unless the pinned renderer explicitly supports them;
|
|
87
|
-
- do not rely on system fonts; there is no implicit system font fallback in Satori-style rendering;
|
|
88
|
-
- test emoji/CJK/RTL/Indic scripts explicitly—font coverage and shaping are renderer/font dependent;
|
|
89
|
-
- keep text wrapping deterministic by constraining width/height and using explicit ellipsis/truncation strategy where supported;
|
|
90
|
-
- test missing image/font/fetch failure states; a broken OG route should fail visibly in monitoring rather than emit a blank card.
|
|
100
|
+
## Takumi (Rust JSX/Tailwind → PNG/WebP/AVIF)
|
|
91
101
|
|
|
92
|
-
|
|
102
|
+
Use **Takumi** (`@takumi-rs/image-response` or native Rust crate) when you need Satori-style JSX authoring with **CSS Grid**, **WOFF2** font support, native **WebP/AVIF** compression, and multi-millisecond Rust throughput:
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
import { ImageResponse } from '@takumi-rs/image-response';
|
|
106
|
+
|
|
107
|
+
export async function renderCard(title: string) {
|
|
108
|
+
return new ImageResponse(
|
|
109
|
+
(
|
|
110
|
+
<div className="grid grid-cols-12 h-full w-full bg-[#0f172a] text-white p-16 gap-8">
|
|
111
|
+
<div className="col-span-8 flex flex-col justify-center">
|
|
112
|
+
<h1 className="text-6xl font-bold leading-tight">{title}</h1>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
),
|
|
116
|
+
// Use 'png' (or JPEG via Sharp) for universal og:image chat unfurlers (Zalo, iMessage, Slack, LinkedIn); reserve 'webp'/'avif' for in-app <img>/<picture>
|
|
117
|
+
{ width: 1200, height: 630, format: 'png' },
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Sharp composite and unfurler-safe `< 300 KB` pipeline
|
|
123
|
+
|
|
124
|
+
Use **Sharp** to composite generated overlays inside the **center `1000×500` safe zone** of a `1200×630` card and emit universally decodable **JPEG (`mozjpeg`) or palette-quantized PNG** under `< 200–300 KB` so Zalo, WhatsApp, iMessage, Slack, X, and LinkedIn unfurlers never drop the preview:
|
|
125
|
+
|
|
126
|
+
```ts
|
|
127
|
+
import sharp from 'sharp';
|
|
128
|
+
|
|
129
|
+
await sharp('base-1200x630.png')
|
|
130
|
+
.composite([{ input: svgOverlayBuffer, top: 65, left: 100 }]) // 1000x500 center safe zone
|
|
131
|
+
.jpeg({ quality: 84, mozjpeg: true }) // or .png({ palette: true, compressionLevel: 9 }) for flat UI cards
|
|
132
|
+
.toFile('og-card.jpg');
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## `@napi-rs/canvas` / `skia-canvas` and Playwright HTML-to-screenshot
|
|
136
|
+
|
|
137
|
+
- **`@napi-rs/canvas` / `skia-canvas`**: choose for procedural visualizations, sparklines, and canvas-native graphics where explicit `ctx.measureText` + Skia rendering outperform HTML boxes. Register fonts via `GlobalFonts.registerFromPath(...)` / `FontLibrary.use(...)`.
|
|
138
|
+
- **Playwright HTML-to-screenshot**: choose when cards require **complex Arabic/RTL, Devanagari/Indic, Thai, or mixed CJK bidirectional shaping**, full CSS Grid/subgrid, `backdrop-filter`, or real rendered UI components:
|
|
139
|
+
|
|
140
|
+
```ts
|
|
141
|
+
await page.setViewportSize({ width: 1200, height: 630 });
|
|
142
|
+
await page.setContent(safeHtml, { waitUntil: 'networkidle' });
|
|
143
|
+
await page.evaluate(() => document.fonts.ready);
|
|
144
|
+
await page.screenshot({ path: 'og-ar.png', type: 'png' });
|
|
145
|
+
```
|
|
93
146
|
|
|
94
|
-
|
|
95
|
-
- constrain remote asset domains and timeouts;
|
|
96
|
-
- cache immutable generated assets by content/input hash;
|
|
97
|
-
- measure cold/warm latency and memory, especially font parsing/rasterization;
|
|
98
|
-
- do not expose private data in public preview images or metadata.
|
|
147
|
+
Never render untrusted user HTML directly in Playwright—escape text strictly, block internal network requests (SSRF protection), and cache by content hash.
|
|
99
148
|
|
|
100
|
-
##
|
|
149
|
+
## Security, caching, and verification
|
|
101
150
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
5. validate platform crawler can fetch the absolute URL;
|
|
107
|
-
6. record whether layout behavior was checked against Satori direct use, `@vercel/og`, or Next `ImageResponse`—their contracts are not identical.
|
|
151
|
+
- Treat user-supplied titles/handles as untrusted text; bound character length and sanitize/escape before templating;
|
|
152
|
+
- constrain remote image domains and timeouts (or inline buffers) so slow external hosts never stall crawlers;
|
|
153
|
+
- cache generated OG images immutably by content/version hash (`Cache-Control: public, max-age=31536000, immutable`);
|
|
154
|
+
- inspect generated byte size, exact dimensions, `Content-Type`, thumbnail legibility at 25–33% scale, and target script shaping (`rendered`); record which renderer produced the image.
|
|
@@ -1,72 +1,71 @@
|
|
|
1
1
|
# Social cards, frames, and platform safe zones
|
|
2
2
|
|
|
3
|
-
Platform behavior changes
|
|
3
|
+
Platform behavior changes frequently and varies by client. Treat dimensions and constraints below as production baselines, then validate with current platform debuggers/previews before release.
|
|
4
4
|
|
|
5
5
|
## Working size table
|
|
6
6
|
|
|
7
7
|
| Placement | Working frame | Ratio / constraint | Practical guidance |
|
|
8
8
|
|---|---:|---|---|
|
|
9
|
-
| Open Graph default | 1200×630 | 1.91:1 | safest general
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
- use
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
-
|
|
9
|
+
| Open Graph default (`og:image`) | 1200×630 | 1.91:1 | safest general baseline; PNG/JPEG/WebP depending on client support |
|
|
10
|
+
| YouTube thumbnail | 1280×720 | 16:9; JPG/PNG/WebP under 2 MB | keep critical text/faces out of the **bottom-right duration timestamp overlay zone** (~20% width × 15% height); validate legibility at mobile feed width (~160px) |
|
|
11
|
+
| X / Twitter large card | 1200×600 (or 1200×630) | 2:1 / 1.91:1; under 5 MB | set `twitter:card="summary_large_image"` + `twitter:image:alt`; verify crop at 2:1 |
|
|
12
|
+
| Facebook / Meta & LinkedIn | 1200×630 / 1200×627 | ~1.91:1 | use absolute HTTPS URL; minor vertical crop difference makes edge text unsafe |
|
|
13
|
+
| Bluesky | 1200×630 | 1.91:1; blob limit ~1 MB | AT Protocol card crawler fetches `og:image` and re-encodes to JPEG/WebP; requires public unauthenticated fetch |
|
|
14
|
+
| Mastodon / Fediverse | 1200×630 | 1.91:1 | federated instances crawl/cache independently and crop across web/Ivory/Elk clients; set `og:image:alt` and optional `fediverse:creator` |
|
|
15
|
+
| Discord | 1200×630 | 1.91:1 | include `twitter:card="summary_large_image"`—without it Discord often shrinks `og:image` to a small right-aligned square thumbnail; `<meta name="theme-color">` sets the embed accent stripe |
|
|
16
|
+
| Slack | 1200×630 | 1.91:1; `< 1 MB` fast crawl | unfurls `og:title`/`og:description`/`og:image` (PNG/JPEG safest); supports `twitter:label1`/`twitter:data1` metadata rows |
|
|
17
|
+
| **Zalo** (chat & Official Account) | 1200×630 | 1.91:1; **`< 300 KB–500 KB`**, PNG/JPEG | Zalo link crawler caches `og:image` aggressively, requires fast public HTTPS TTFB (`< 2 s`), and frequently drops `svg`/`webp` or oversized PNGs—keep copy in the **center `1000×500` safe zone** so 1:1 / mobile chat list crops survive |
|
|
18
|
+
| WhatsApp | 1200×630 (or 1:1) | **strict `< 300 KB`** (target `< 200 KB`) | exceeding ~300 KB or slow TTFB causes WhatsApp to drop the thumbnail silently; declare `og:image:width`, `og:image:height`, `og:image:type`, and serve optimized **JPEG or indexed PNG** |
|
|
19
|
+
| Telegram | 1200×630 | 1.91:1; `< 1 MB` | uses `og:image` + `twitter:card="summary_large_image"`; refresh stale caches with `@WebpageBot` |
|
|
20
|
+
| iMessage / Apple Rich Links | 1200×630 | 1.91:1; `< 1 MB` PNG/JPEG | Apple `LPLinkMetadata` requires `og:image` (`>= 300px` wide so it does not collapse to a small icon; SVG `og:image` is ignored) plus `apple-touch-icon` |
|
|
21
|
+
| GitHub repository social preview | 1280×640 rec.; 640×320 min | exactly 2:1; PNG/JPG/GIF under 1 MB | upload in Settings → General → Social preview; keep essential content inside the central `1000×500` safe zone |
|
|
22
|
+
| Video / presentation landscape | 1920×1080 | 16:9 | standard video/slide frame; inset edges 5–10% |
|
|
23
|
+
| Vertical short video (`Reels / TikTok / Shorts`) | 1080×1920 | 9:16 | strict UI exclusion margins: **`top >= 150–220 px`**, **`bottom >= 320–420 px`**, **`right >= 120–160 px`** |
|
|
24
|
+
| Square feed / thumbnail fallback | 1080×1080 or 1200×1200 | 1:1 | use only when the platform/card type favors square |
|
|
25
|
+
|
|
26
|
+
## Safe-area & `9:16` exclusion-zone geometry
|
|
27
|
+
|
|
28
|
+
No single rectangle is universally safe. Lock layout guides to exact pixel coordinates:
|
|
29
|
+
|
|
30
|
+
1. **`1200×630` (`1.91:1`) universal OG safe zone (`1000×500` center box)**: inset at least **`100 px` left/right and `65 px` top/bottom** (`1000×500` inner box) so X (`2:1` `1200×600`), LinkedIn (`1200×627`), iMessage rounded bubbles, Slack, and Zalo mobile previews never clip headlines or brand marks;
|
|
31
|
+
2. **`1080×1920` (`9:16`) Reels / TikTok / YouTube Shorts exclusion zones**: host chrome covers three edges simultaneously—keep all headlines, speaker faces, and burned-in captions strictly clear of:
|
|
32
|
+
- **`top >= 150–220 px`** (status bar, notch, search/live header),
|
|
33
|
+
- **`bottom >= 320–420 px`** (account handle, expandable multi-line caption, audio marquee, shop/CTA pill, scrub bar),
|
|
34
|
+
- **`right >= 120–160 px`** (vertical avatar, like, comment, bookmark, and share icon rail), plus `>= 60 px` left margin;
|
|
35
|
+
3. **YouTube `1280×720` thumbnails**: leave the bottom-right `~260×110 px` clear of words or faces for the duration timestamp badge;
|
|
36
|
+
4. export a crop & overlay contact sheet (`1200×630` + `1000×500` box, `2:1`, `9:16` UI mask, and `25%` thumbnail scale) rather than inspecting only the raw 100% canvas.
|
|
37
|
+
|
|
38
|
+
## Thumbnail legibility (`150–300 px` downscale check)
|
|
39
|
+
|
|
40
|
+
Design at final dimensions, then verify scaled down:
|
|
41
|
+
|
|
42
|
+
- one short headline or product name (typically `<= 6–8` words);
|
|
43
|
+
- test readability when downscaled to **`150–300 px` thumbnail width** (`25–33%` scale) in **both light and dark social feeds**;
|
|
44
|
+
- prefer high x-height, sturdy weight, generous tracking, and strong foreground/background contrast;
|
|
45
|
+
- avoid thin strokes, dense code screenshots, tiny chart axes, busy textures behind text, and legal footnotes;
|
|
46
|
+
- use one dominant visual anchor: real product detail, simplified diagram, decisive metric, or recognizable mark;
|
|
47
|
+
- test light and dark host feed backgrounds so transparent PNG edges never halo or vanish.
|
|
48
|
+
|
|
49
|
+
## Metadata, format fallbacks, byte budgets, and delivery
|
|
50
|
+
|
|
51
|
+
- **Absolute `https://` + PNG/JPEG `og:image` compatibility**: **never point `og:image` or `twitter:image` at an `.svg`** (all major social/chat crawlers reject SVG for security), and **prefer optimized `.png` or `.jpg` over `.webp`/`.avif`** for `og:image` because Zalo, older Outlook/Slack unfurlers, LinkedIn edge scrapers, and enterprise link-preview proxies still drop WebP/AVIF thumbnails silently;
|
|
52
|
+
- include `og:title`, `og:description`, `og:image`, `og:image:secure_url`, `og:image:width` (`1200`), `og:image:height` (`630`), `og:image:type` (`image/png` or `image/jpeg`), `og:image:alt`, `twitter:card="summary_large_image"`, and `twitter:image:alt`;
|
|
53
|
+
- keep **WhatsApp / Zalo** OG assets **`< 200–300 KB`** (`< 1 MB` across Slack/iMessage/X/LinkedIn/Bluesky) with crawler response **`< 1.5–2.0 s`** (no auth wall, `robots.txt` block on `/og/*`, or slow cold-start timeouts);
|
|
54
|
+
- cache-bust via versioned path/query (`/og/v2/post-slug.png`) when updating artwork because Zalo, LinkedIn, Telegram (`@WebpageBot`), Slack, and iMessage cache unfurls aggressively.
|
|
52
55
|
|
|
53
56
|
## Composition patterns
|
|
54
57
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
- **artifact-first:** product screenshot/interface detail cropped intentionally and enlarged;
|
|
58
|
+
- **artifact-first:** real product interface cropped intentionally and enlarged;
|
|
58
59
|
- **statement-first:** short claim/name in editorial typography with one supporting visual motif;
|
|
59
|
-
- **system-first:**
|
|
60
|
-
- **identity-first:**
|
|
60
|
+
- **system-first:** architecture/flow diagram simplified to one readable idea;
|
|
61
|
+
- **identity-first:** bold mark/wordmark only when audience recognition already exists.
|
|
61
62
|
|
|
62
|
-
Anti-slop
|
|
63
|
+
Anti-slop: centered logo over purple-blue gradient, floating glass browser chrome, random rocket/sparkle clip art, fake avatars, tiny feature checklists, and unrelated stock photos.
|
|
63
64
|
|
|
64
|
-
## Verification matrix
|
|
65
|
+
## Verification matrix & required deliverables
|
|
65
66
|
|
|
66
|
-
- inspect exported file dimensions
|
|
67
|
-
- inspect at 100
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
- confirm alt text/metadata/link destination;
|
|
72
|
-
- retain source file/export preset for repeatable updates.
|
|
67
|
+
- inspect exported file dimensions, MIME type, exact byte count against target caps (WhatsApp/Zalo `< 300 KB`, GitHub `< 1 MB`, YouTube `< 2 MB`), and attach a complete **asset license table** (fonts, photos, icons, audio/music, AI provenance) (`static`);
|
|
68
|
+
- inspect at `100%` and **`150–300 px` downscaled thumbnail width** on **both light and dark social feed backgrounds** (`rendered`);
|
|
69
|
+
- verify YouTube bottom-right safe zone and `2:1` / `1.91:1` / `1:1` / `9:16` crop overlays (`rendered`);
|
|
70
|
+
- capture **live share-debugger / unfurl previews (`Facebook`, `X`, `LinkedIn`, `Zalo`)** (`rendered`, or explicitly label unhosted/offline platforms `not-checked`);
|
|
71
|
+
- confirm `og:image:alt`, `twitter:card`, absolute HTTPS URLs, and reproducible export preset (`static`).
|