@thanhnguyxn/pixelcraft 0.0.0-stage → 0.1.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/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +11 -0
- package/LICENSE +21 -0
- package/README.md +407 -2
- package/assets/README.md +28 -0
- package/assets/pixelcraft-logo-512.png +0 -0
- package/bin/pixelcraft.mjs +444 -0
- package/docs/ARCHITECTURE.md +102 -0
- package/docs/DESIGN-RATIONALE.md +143 -0
- package/evals/README.md +27 -0
- package/evals/fixtures/README.md +36 -0
- package/evals/fixtures/direction-prototype-complexity.json +29 -0
- package/evals/fixtures/finish-gate-anti-slop.json +30 -0
- package/evals/fixtures/forms-accessibility-negative.json +29 -0
- package/evals/fixtures/handoff-fidelity-tolerance.json +29 -0
- package/evals/fixtures/plan-brownfield-evidence.json +28 -0
- package/evals/fixtures/visual-qa-task-evidence.json +29 -0
- package/evals/fixtures/workflow-checkpoints.json +30 -0
- package/evals/pixelcraft-accessibility.md +57 -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 +60 -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 +60 -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 +57 -0
- package/evals/pixelcraft-plan.md +65 -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 +80 -0
- package/evals/pixelcraft-web.md +71 -0
- package/evals/pixelcraft.md +70 -0
- package/gemini-extension.json +5 -0
- package/install.ps1 +295 -0
- package/install.sh +437 -0
- package/package.json +63 -4
- package/plugin.json +24 -0
- package/scripts/build-adapters.mjs +290 -0
- package/scripts/build-release-archives.mjs +61 -0
- package/scripts/build-skill-zips.mjs +94 -0
- package/scripts/test-build-adapters.mjs +48 -0
- package/scripts/test-distribution.mjs +124 -0
- package/scripts/test-export-tokens.mjs +105 -0
- package/scripts/test-finish-gate.mjs +148 -0
- package/scripts/test-installers.mjs +67 -0
- package/scripts/test-release-archives.mjs +42 -0
- package/scripts/test-shoot.mjs +65 -0
- package/scripts/test-slop-scan.mjs +29 -0
- package/scripts/test-style-inventory.mjs +211 -0
- package/scripts/test-validate-skills.mjs +117 -0
- package/scripts/validate-skills.mjs +512 -0
- package/skills/pixelcraft/SKILL.md +135 -0
- package/skills/pixelcraft/references/design-brief.md +75 -0
- package/skills/pixelcraft/references/floor.md +73 -0
- package/skills/pixelcraft/references/report-template.md +35 -0
- package/skills/pixelcraft/references/stack-detection.md +155 -0
- package/skills/pixelcraft/references/surface-acceptance.md +40 -0
- package/skills/pixelcraft/references/workflow-checkpoints.md +29 -0
- package/skills/pixelcraft-accessibility/SKILL.md +33 -0
- package/skills/pixelcraft-accessibility/references/apg-patterns.md +51 -0
- package/skills/pixelcraft-accessibility/references/platforms.md +58 -0
- package/skills/pixelcraft-accessibility/references/verification.md +59 -0
- package/skills/pixelcraft-accessibility/references/wcag22-checks.md +66 -0
- package/skills/pixelcraft-brandkit/SKILL.md +115 -0
- package/skills/pixelcraft-brandkit/references/asset-pipeline.md +125 -0
- package/skills/pixelcraft-brandkit/references/brand-governance.md +80 -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 +98 -0
- package/skills/pixelcraft-brandkit/references/pixel-art-logos.md +82 -0
- package/skills/pixelcraft-brandkit/references/prompt-template.md +85 -0
- package/skills/pixelcraft-brandkit/references/qa-checklist.md +88 -0
- package/skills/pixelcraft-brandkit/references/visual-modes.md +123 -0
- package/skills/pixelcraft-chat-ui/SKILL.md +53 -0
- package/skills/pixelcraft-chat-ui/references/conversation-design.md +78 -0
- package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +87 -0
- package/skills/pixelcraft-chat-ui/references/slack-discord.md +96 -0
- package/skills/pixelcraft-constrained/SKILL.md +51 -0
- package/skills/pixelcraft-constrained/references/specialized-hardware.md +66 -0
- package/skills/pixelcraft-constrained/references/tv-wearables.md +84 -0
- package/skills/pixelcraft-constrained/references/voice-ui.md +63 -0
- package/skills/pixelcraft-craft/SKILL.md +44 -0
- package/skills/pixelcraft-craft/references/color.md +69 -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 +41 -0
- package/skills/pixelcraft-craft/references/motion.md +76 -0
- package/skills/pixelcraft-craft/references/typography.md +71 -0
- package/skills/pixelcraft-data-apps/SKILL.md +67 -0
- package/skills/pixelcraft-data-apps/references/dash.md +53 -0
- package/skills/pixelcraft-data-apps/references/evidence.md +75 -0
- package/skills/pixelcraft-data-apps/references/gradio.md +65 -0
- package/skills/pixelcraft-data-apps/references/julia-genie.md +54 -0
- package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +53 -0
- package/skills/pixelcraft-data-apps/references/nicegui.md +63 -0
- package/skills/pixelcraft-data-apps/references/observable-framework.md +67 -0
- package/skills/pixelcraft-data-apps/references/panel.md +53 -0
- package/skills/pixelcraft-data-apps/references/r-shiny.md +54 -0
- package/skills/pixelcraft-data-apps/references/reflex.md +62 -0
- package/skills/pixelcraft-data-apps/references/shiny.md +53 -0
- package/skills/pixelcraft-data-apps/references/streamlit.md +65 -0
- package/skills/pixelcraft-dataviz/SKILL.md +63 -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 +97 -0
- package/skills/pixelcraft-dataviz/references/libraries.md +57 -0
- package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +99 -0
- package/skills/pixelcraft-desktop/SKILL.md +71 -0
- package/skills/pixelcraft-desktop/references/appkit.md +58 -0
- package/skills/pixelcraft-desktop/references/avalonia.md +59 -0
- package/skills/pixelcraft-desktop/references/cpp-gui.md +52 -0
- package/skills/pixelcraft-desktop/references/electron.md +54 -0
- package/skills/pixelcraft-desktop/references/go-gui.md +54 -0
- package/skills/pixelcraft-desktop/references/gtk.md +54 -0
- package/skills/pixelcraft-desktop/references/javafx-swing.md +52 -0
- package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +61 -0
- package/skills/pixelcraft-desktop/references/rust-gui.md +65 -0
- package/skills/pixelcraft-desktop/references/tauri.md +54 -0
- package/skills/pixelcraft-desktop/references/uno-platform.md +52 -0
- package/skills/pixelcraft-desktop/references/winui-wpf.md +58 -0
- package/skills/pixelcraft-desktop/references/working-context.md +5 -0
- package/skills/pixelcraft-direction/SKILL.md +154 -0
- package/skills/pixelcraft-direction/references/composition-library.md +84 -0
- package/skills/pixelcraft-direction/references/direction-card.md +54 -0
- package/skills/pixelcraft-direction/references/direction-scoring.md +72 -0
- package/skills/pixelcraft-direction/references/movements.md +68 -0
- package/skills/pixelcraft-direction/references/repetition-history.md +75 -0
- package/skills/pixelcraft-direction/references/slop-fingerprints.md +58 -0
- package/skills/pixelcraft-direction/references/wildcards.md +47 -0
- package/skills/pixelcraft-document/SKILL.md +54 -0
- package/skills/pixelcraft-document/references/archetypes.md +83 -0
- package/skills/pixelcraft-document/references/pdf-tools.md +154 -0
- package/skills/pixelcraft-document/references/print-css.md +134 -0
- package/skills/pixelcraft-document/references/slides.md +102 -0
- package/skills/pixelcraft-email/SKILL.md +58 -0
- package/skills/pixelcraft-email/references/client-quirks.md +45 -0
- package/skills/pixelcraft-email/references/html-tables.md +53 -0
- package/skills/pixelcraft-email/references/mjml.md +52 -0
- package/skills/pixelcraft-email/references/react-email.md +53 -0
- package/skills/pixelcraft-extensions/SKILL.md +51 -0
- package/skills/pixelcraft-extensions/references/browser-extensions.md +31 -0
- package/skills/pixelcraft-extensions/references/figma-office.md +23 -0
- package/skills/pixelcraft-extensions/references/raycast.md +19 -0
- package/skills/pixelcraft-extensions/references/vscode-webviews.md +26 -0
- package/skills/pixelcraft-game-ui/SKILL.md +61 -0
- package/skills/pixelcraft-game-ui/references/bevy.md +52 -0
- package/skills/pixelcraft-game-ui/references/godot.md +57 -0
- package/skills/pixelcraft-game-ui/references/hud-principles.md +38 -0
- package/skills/pixelcraft-game-ui/references/love2d.md +51 -0
- package/skills/pixelcraft-game-ui/references/monogame.md +52 -0
- package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +65 -0
- package/skills/pixelcraft-game-ui/references/unreal-umg.md +53 -0
- package/skills/pixelcraft-handoff/SKILL.md +49 -0
- package/skills/pixelcraft-handoff/references/design-translation.md +104 -0
- package/skills/pixelcraft-handoff/references/fidelity-tolerance.md +78 -0
- package/skills/pixelcraft-media/SKILL.md +52 -0
- package/skills/pixelcraft-media/references/banners-video.md +112 -0
- package/skills/pixelcraft-media/references/og-generation.md +107 -0
- package/skills/pixelcraft-media/references/social-cards.md +72 -0
- package/skills/pixelcraft-mobile/SKILL.md +69 -0
- package/skills/pixelcraft-mobile/references/dotnet-maui.md +63 -0
- package/skills/pixelcraft-mobile/references/flet.md +53 -0
- package/skills/pixelcraft-mobile/references/flutter.md +69 -0
- package/skills/pixelcraft-mobile/references/ionic-capacitor.md +65 -0
- package/skills/pixelcraft-mobile/references/jetpack-compose.md +61 -0
- package/skills/pixelcraft-mobile/references/kivy.md +59 -0
- package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +60 -0
- package/skills/pixelcraft-mobile/references/react-native-expo.md +71 -0
- package/skills/pixelcraft-mobile/references/swiftui.md +70 -0
- package/skills/pixelcraft-mobile/references/task-state-composition.md +5 -0
- package/skills/pixelcraft-mobile/references/uikit.md +58 -0
- package/skills/pixelcraft-patterns/SKILL.md +58 -0
- package/skills/pixelcraft-patterns/references/auth-onboarding.md +25 -0
- package/skills/pixelcraft-patterns/references/commerce.md +28 -0
- package/skills/pixelcraft-patterns/references/communication.md +26 -0
- package/skills/pixelcraft-patterns/references/creative-tools.md +29 -0
- package/skills/pixelcraft-patterns/references/dashboard-admin.md +31 -0
- package/skills/pixelcraft-patterns/references/marketing.md +32 -0
- package/skills/pixelcraft-patterns/references/pattern-selection.md +74 -0
- package/skills/pixelcraft-patterns/references/search-filtering.md +42 -0
- package/skills/pixelcraft-patterns/references/settings.md +23 -0
- package/skills/pixelcraft-patterns/references/tables-crud.md +43 -0
- package/skills/pixelcraft-plan/SKILL.md +67 -0
- package/skills/pixelcraft-plan/references/design-input.md +69 -0
- package/skills/pixelcraft-plan/references/plan-template.md +99 -0
- package/skills/pixelcraft-plan/references/repo-discovery.md +42 -0
- package/skills/pixelcraft-plan/references/stack-freshness.md +50 -0
- package/skills/pixelcraft-plan/references/stack-selection.md +42 -0
- package/skills/pixelcraft-review/SKILL.md +64 -0
- package/skills/pixelcraft-review/references/audit-report.md +50 -0
- package/skills/pixelcraft-review/references/critique-protocol.md +89 -0
- package/skills/pixelcraft-review/references/heuristics.md +18 -0
- package/skills/pixelcraft-review/references/personas.md +26 -0
- package/skills/pixelcraft-review/references/polish.md +38 -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-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 +586 -0
- package/skills/pixelcraft-spatial/SKILL.md +52 -0
- package/skills/pixelcraft-spatial/references/comfort-accessibility.md +98 -0
- package/skills/pixelcraft-spatial/references/platforms.md +77 -0
- package/skills/pixelcraft-tokens/SKILL.md +56 -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 +54 -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 +94 -0
- package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +285 -0
- package/skills/pixelcraft-tui/SKILL.md +60 -0
- package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +60 -0
- package/skills/pixelcraft-tui/references/ink.md +60 -0
- package/skills/pixelcraft-tui/references/ratatui.md +62 -0
- package/skills/pixelcraft-tui/references/rich.md +62 -0
- package/skills/pixelcraft-tui/references/textual.md +67 -0
- package/skills/pixelcraft-ux/SKILL.md +46 -0
- package/skills/pixelcraft-ux/references/cognitive-walkthrough.md +70 -0
- package/skills/pixelcraft-ux/references/feedback-performance.md +30 -0
- package/skills/pixelcraft-ux/references/flows-ia.md +44 -0
- package/skills/pixelcraft-ux/references/forms.md +97 -0
- package/skills/pixelcraft-ux/references/i18n.md +183 -0
- package/skills/pixelcraft-ux/references/laws.md +18 -0
- package/skills/pixelcraft-ux/references/locale-test-matrix.md +60 -0
- package/skills/pixelcraft-ux/references/state-matrix.md +39 -0
- package/skills/pixelcraft-ux/references/usability-testing.md +84 -0
- package/skills/pixelcraft-ux/references/ux-writing.md +43 -0
- package/skills/pixelcraft-visual-qa/SKILL.md +82 -0
- package/skills/pixelcraft-visual-qa/references/baseline-governance.md +70 -0
- package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +38 -0
- package/skills/pixelcraft-visual-qa/references/capture-email.md +34 -0
- package/skills/pixelcraft-visual-qa/references/capture-mobile.md +35 -0
- package/skills/pixelcraft-visual-qa/references/capture-terminal.md +31 -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/performance-budgets.md +65 -0
- package/skills/pixelcraft-visual-qa/references/task-verification.md +81 -0
- package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +135 -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 +513 -0
- package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +1154 -0
- package/skills/pixelcraft-web/SKILL.md +76 -0
- package/skills/pixelcraft-web/references/adaptive-layout.md +25 -0
- package/skills/pixelcraft-web/references/angular.md +61 -0
- package/skills/pixelcraft-web/references/astro.md +62 -0
- package/skills/pixelcraft-web/references/clojurescript.md +53 -0
- package/skills/pixelcraft-web/references/elm.md +53 -0
- package/skills/pixelcraft-web/references/fsharp-fable.md +53 -0
- package/skills/pixelcraft-web/references/html-css.md +88 -0
- package/skills/pixelcraft-web/references/htmx-alpine.md +53 -0
- package/skills/pixelcraft-web/references/java-web.md +52 -0
- package/skills/pixelcraft-web/references/kotlin-web.md +53 -0
- package/skills/pixelcraft-web/references/leptos-yew.md +54 -0
- package/skills/pixelcraft-web/references/lit-web-components.md +61 -0
- package/skills/pixelcraft-web/references/pwa.md +225 -0
- package/skills/pixelcraft-web/references/qwik.md +54 -0
- package/skills/pixelcraft-web/references/react-next.md +69 -0
- package/skills/pixelcraft-web/references/scala-laminar.md +53 -0
- package/skills/pixelcraft-web/references/server-rendered.md +71 -0
- package/skills/pixelcraft-web/references/solid.md +60 -0
- package/skills/pixelcraft-web/references/svelte.md +61 -0
- package/skills/pixelcraft-web/references/tailwind.md +73 -0
- package/skills/pixelcraft-web/references/vue-nuxt.md +62 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Satori, `@vercel/og`, and `ImageResponse`
|
|
2
|
+
|
|
3
|
+
These tools are not browsers. They implement constrained JSX/CSS layout pipelines for deterministic image generation. Check the exact installed package/version because upstream Satori evolves independently from Vercel/Next wrappers.
|
|
4
|
+
|
|
5
|
+
## Pipeline boundaries
|
|
6
|
+
|
|
7
|
+
| Tool | Output/model | Critical boundary |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| Satori | JSX/element tree → SVG string | requires explicit fonts; subset of HTML/CSS; no React state/effects; no guarantee of pixel-perfect browser parity |
|
|
10
|
+
| `@vercel/og` | JSX/CSS → PNG through Satori + Resvg | Vercel documents only flexbox plus a subset of CSS; maximum bundle size 500 KB; TTF/OTF/WOFF fonts only |
|
|
11
|
+
| Next.js `ImageResponse` (`next/og`) | route-level image response using `@vercel/og` | current Next docs repeat the flex-only/CSS-subset and 500 KB limits; import path changed from `next/server` to `next/og` in v14 |
|
|
12
|
+
|
|
13
|
+
Upstream Satori's README describes a broader/evolving layout implementation. That does not override the narrower documented `@vercel/og`/`ImageResponse` contract. If a project calls Satori directly, inspect the pinned Satori version and feature table rather than assuming either the old or new limit.
|
|
14
|
+
|
|
15
|
+
## Required constraints for Vercel/Next generation
|
|
16
|
+
|
|
17
|
+
- use `display: flex` layouts; do not depend on CSS grid;
|
|
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
|
|
29
|
+
import { ImageResponse } from 'next/og';
|
|
30
|
+
|
|
31
|
+
export async function GET() {
|
|
32
|
+
const fontData = await fetch(new URL('./Inter-Bold.ttf', import.meta.url)).then((res) => res.arrayBuffer());
|
|
33
|
+
|
|
34
|
+
return new ImageResponse(
|
|
35
|
+
(
|
|
36
|
+
<div
|
|
37
|
+
style={{
|
|
38
|
+
width: '100%',
|
|
39
|
+
height: '100%',
|
|
40
|
+
display: 'flex',
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
padding: 80,
|
|
43
|
+
background: '#101820',
|
|
44
|
+
color: 'white',
|
|
45
|
+
fontFamily: 'Inter',
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
Pixelcraft
|
|
49
|
+
</div>
|
|
50
|
+
),
|
|
51
|
+
{
|
|
52
|
+
width: 1200,
|
|
53
|
+
height: 630,
|
|
54
|
+
fonts: [
|
|
55
|
+
{
|
|
56
|
+
name: 'Inter',
|
|
57
|
+
data: fontData,
|
|
58
|
+
weight: 700,
|
|
59
|
+
style: 'normal',
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Exact behavior depends on runtime/framework. Do not fetch secrets or unbounded remote URLs. Cache font bytes deliberately; font loading can dominate cold-start time and bundle size.
|
|
68
|
+
|
|
69
|
+
## Satori direct-use pattern
|
|
70
|
+
|
|
71
|
+
```js
|
|
72
|
+
import satori from 'satori';
|
|
73
|
+
|
|
74
|
+
const svg = await satori(element, {
|
|
75
|
+
width: 1200,
|
|
76
|
+
height: 630,
|
|
77
|
+
fonts: [{ name: 'Inter', data: interBuffer, weight: 700, style: 'normal' }],
|
|
78
|
+
});
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Satori returns SVG. Convert to PNG with an explicit rasterizer such as Sharp/librsvg or Resvg depending on the environment; verify text rasterization and bundled native/runtime dependencies. `@vercel/og` already performs its own PNG pipeline.
|
|
82
|
+
|
|
83
|
+
## Layout guidance
|
|
84
|
+
|
|
85
|
+
- compose with nested flex rows/columns and absolute positioning where supported;
|
|
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.
|
|
91
|
+
|
|
92
|
+
## Security and performance
|
|
93
|
+
|
|
94
|
+
- treat user-controlled text as untrusted input; do not interpolate raw HTML/script behavior;
|
|
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.
|
|
99
|
+
|
|
100
|
+
## Verification
|
|
101
|
+
|
|
102
|
+
1. inspect generated bytes/dimensions/content type;
|
|
103
|
+
2. render/compare light/dark and crop-scale thumbnails;
|
|
104
|
+
3. verify actual text shaping/wrapping for target scripts;
|
|
105
|
+
4. test missing font/image/network failure;
|
|
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.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Social cards, frames, and platform safe zones
|
|
2
|
+
|
|
3
|
+
Platform behavior changes often and varies by client. Treat dimensions below as production baselines, then validate with current platform documentation/debuggers before release. Do not copy third-party size lists as immutable truth.
|
|
4
|
+
|
|
5
|
+
## Working size table
|
|
6
|
+
|
|
7
|
+
| Placement | Working frame | Ratio / constraint | Practical guidance |
|
|
8
|
+
|---|---:|---|---|
|
|
9
|
+
| Open Graph default | 1200×630 | 1.91:1 | safest general `og:image` baseline; PNG/JPEG/WebP depending platform support |
|
|
10
|
+
| Facebook/Meta link preview | 1200×630 baseline | about 1.91:1 | use absolute HTTPS URL; inspect Sharing Debugger/cache behavior |
|
|
11
|
+
| LinkedIn link preview | 1200×627 baseline | close to 1.91:1 | minor crop difference means edge text is unsafe |
|
|
12
|
+
| X/Twitter large card | 1200×600 baseline | 2:1 target | supply accurate `twitter:card`/image metadata; verify current card type |
|
|
13
|
+
| square thumbnail fallback | 1200×1200 or platform-specific square | 1:1 | use only when platform/card type explicitly favors square |
|
|
14
|
+
| GitHub repository social preview | 1280×640 recommended; 640×320 minimum | exactly 2:1; PNG/JPG/GIF under 1 MB | upload in repository Settings → General → Social preview; keep essential content in a conservative central safe area |
|
|
15
|
+
| video/presentation landscape | 1920×1080 | 16:9 | standard video/slide frame; edges still need inset |
|
|
16
|
+
| vertical short video/story | 1080×1920 | 9:16 | platform UI overlays top/bottom/side; use platform-specific safe templates |
|
|
17
|
+
| square feed/video | 1080×1080 | 1:1 | validate feed crop and compression |
|
|
18
|
+
|
|
19
|
+
File-size/type limits are platform-specific. GitHub's documented repository preview rules are the most concrete here: recommended 1280×640, minimum 640×320, PNG/JPG/GIF, under 1 MB. For other platforms, confirm current crawler/card documentation instead of inventing exact cache or file-size guarantees.
|
|
20
|
+
|
|
21
|
+
## Safe-area design
|
|
22
|
+
|
|
23
|
+
No single rectangle is universally safe. Apply layered protection:
|
|
24
|
+
|
|
25
|
+
1. keep logos/text at least 5% of frame width/height away from edges;
|
|
26
|
+
2. keep essential content inside the central horizontal band for landscape cards;
|
|
27
|
+
3. for GitHub's 2:1 preview, treat the central region—approximately the middle half of width and height—as the must-survive zone and inspect actual shares;
|
|
28
|
+
4. for vertical video, consult current platform UI overlays because buttons/captions/progress bars cover different regions;
|
|
29
|
+
5. export crop/contact-sheet variants rather than inspecting only the master frame.
|
|
30
|
+
|
|
31
|
+
Never put critical meaning in corners. Corners are the first casualty of cropping, overlay badges, player chrome, rounded masks, and compression artifacts.
|
|
32
|
+
|
|
33
|
+
## Thumbnail legibility
|
|
34
|
+
|
|
35
|
+
Design at final dimensions but inspect scaled down. Practical rules:
|
|
36
|
+
|
|
37
|
+
- one short headline or product name; usually fewer than ~8 words unless the brand requires more;
|
|
38
|
+
- minimum effective type size is whatever remains readable at feed scale—test at 25–33% display size, not just 100%;
|
|
39
|
+
- prefer high x-height, sturdy weight, generous letterspacing, and strong contrast;
|
|
40
|
+
- avoid thin strokes, dense code/screenshots, small chart axes, texture behind text, and multi-line legal copy;
|
|
41
|
+
- use one dominant visual anchor: product artifact, diagram, mark, number, or distinctive composition;
|
|
42
|
+
- test light/dark feed backgrounds because transparent PNG edges/halos can fail.
|
|
43
|
+
|
|
44
|
+
## Metadata and delivery
|
|
45
|
+
|
|
46
|
+
- use absolute HTTPS URLs for `og:image`/Twitter metadata;
|
|
47
|
+
- include accurate `og:title`, `og:description`, canonical URL, image dimensions/alt metadata where supported;
|
|
48
|
+
- ensure crawler access: no authentication, robots block, broken redirect, intermittent certificate, or hotlink protection;
|
|
49
|
+
- serve correct content type/cache headers and keep the URL stable when appropriate;
|
|
50
|
+
- social platforms cache aggressively. Debugging/refresh tools and deployment sequencing matter; changing pixels at the same URL may not propagate immediately;
|
|
51
|
+
- localization needs separate metadata/assets only when the platform/link resolution can actually select them.
|
|
52
|
+
|
|
53
|
+
## Composition patterns
|
|
54
|
+
|
|
55
|
+
Useful patterns:
|
|
56
|
+
|
|
57
|
+
- **artifact-first:** product screenshot/interface detail cropped intentionally and enlarged;
|
|
58
|
+
- **statement-first:** short claim/name in editorial typography with one supporting visual motif;
|
|
59
|
+
- **system-first:** diagram/map/flow simplified to one readable idea;
|
|
60
|
+
- **identity-first:** strong logo/wordmark only when recognition already exists.
|
|
61
|
+
|
|
62
|
+
Anti-slop pattern: centered logo over gradient, floating glass browser frame, random sparkle/rocket, fake user avatars, “Do more with less” copy, tiny feature checklist, and unrelated stock imagery. Distinctiveness should come from the subject's real material and disciplined scale contrast.
|
|
63
|
+
|
|
64
|
+
## Verification matrix
|
|
65
|
+
|
|
66
|
+
- inspect exported file dimensions/type/bytes;
|
|
67
|
+
- inspect at 100%, feed scale, and mobile density;
|
|
68
|
+
- inspect light/dark feed backgrounds;
|
|
69
|
+
- test crawler/debugger/share preview when available;
|
|
70
|
+
- verify compression/crop in target client or label it `not-checked`;
|
|
71
|
+
- confirm alt text/metadata/link destination;
|
|
72
|
+
- retain source file/export preset for repeatable updates.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pixelcraft-mobile
|
|
3
|
+
description: Translates Pixelcraft direction, tokens, UX, and floor requirements into idiomatic mobile UI across SwiftUI, UIKit, Jetpack Compose, Flutter, React Native/Expo, Kotlin Multiplatform, Ionic/Capacitor, .NET MAUI, Flet, and Kivy. Use for native or cross-platform app screens, navigation, safe areas, Dynamic Type/sp scaling, touch targets, gestures, haptics, platform conventions, forms, states, motion, accessibility, and device verification.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
version: 0.1.0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Pixelcraft mobile
|
|
10
|
+
|
|
11
|
+
Use this skill when the surface is a phone/tablet/foldable/watch-adjacent app. Respect the host platform: iOS uses Apple HIG idioms, Android uses Material behavior, and cross-platform runtimes must translate rather than average them.
|
|
12
|
+
|
|
13
|
+
## Surface craft
|
|
14
|
+
|
|
15
|
+
Give the primary task a short route with native back/dismiss behavior; add delight at a meaningful state transition, not at every tap. Compare Compact and large-text layouts, resume after interruption, and make haptics optional reinforcement rather than the only confirmation. Do not copy a gallery's onboarding screens without following the activation and recovery steps.
|
|
16
|
+
|
|
17
|
+
## Detection signals
|
|
18
|
+
|
|
19
|
+
`Package.swift`, Xcode projects/workspaces, SwiftUI/UIKit imports, `build.gradle(.kts)` Compose dependencies, `pubspec.yaml`, React Native/Expo config, KMP shared modules, Ionic/Capacitor config, `.csproj` MAUI references, Flet controls/page setup, Kivy KV/App classes, platform folders (`ios/`, `android/`), and target/device family declarations.
|
|
20
|
+
|
|
21
|
+
## Translate direction to mobile idioms
|
|
22
|
+
|
|
23
|
+
1. Map DTCG semantic roles to native theme systems: SwiftUI asset catalogs/environment, UIKit trait-aware colors, Compose `MaterialTheme`, Flutter `ThemeData`/`ColorScheme`, RN theme context, Ionic CSS variables, MAUI resources, Flet theme objects, or Kivy KV/Python constants.
|
|
24
|
+
2. Recompose for touch and reach: primary actions within reach, no desktop hover dependence, dense information only where expert use justifies it.
|
|
25
|
+
3. Use platform navigation rather than web metaphors: navigation stack/tab bar/sheet on iOS; navigation bar/rail/drawer/predictive back on Android; large-title behavior only where idiomatic.
|
|
26
|
+
4. Scale type using Dynamic Type or sp scaling; restructure instead of truncating essential content at accessibility sizes.
|
|
27
|
+
5. Keep targets at least 44×44 pt iOS and 48×48 dp Android unless a documented platform exception applies.
|
|
28
|
+
6. Map motion to native spring/transition idioms and honor Reduce Motion/Remove animations. Haptics confirm meaningful physical/input moments only.
|
|
29
|
+
|
|
30
|
+
## Platform-wide rules
|
|
31
|
+
|
|
32
|
+
- Respect safe areas, status/navigation bars, display cutouts, split screen, landscape, foldables, keyboards, and edge gestures.
|
|
33
|
+
- Preserve state across process death/backgrounding where the platform expects it; interruption is normal mobile behavior.
|
|
34
|
+
- Back/swipe/home interruption must never silently discard work or duplicate side effects.
|
|
35
|
+
- Use platform pickers, keyboards, autofill, share sheets, permissions prompts, undo, and text editing behavior before custom replacements.
|
|
36
|
+
- Explain permission value before prompting and provide denied-state recovery.
|
|
37
|
+
- Test dark/light, increased contrast, reduced motion, bold/expanded text, RTL, offline, slow network, one-hand use, screen reader, keyboard/controller where relevant.
|
|
38
|
+
|
|
39
|
+
## Common mobile-specific failures
|
|
40
|
+
|
|
41
|
+
- fixed-height rows clipping Dynamic Type or sp scaling;
|
|
42
|
+
- bottom CTAs hidden by home indicator, keyboard, or system navigation;
|
|
43
|
+
- custom nav bars that break swipe/predictive back;
|
|
44
|
+
- web-style cards/hero layouts transplanted into native product UI;
|
|
45
|
+
- haptics/animation on every interaction;
|
|
46
|
+
- permission primer loops with no escape;
|
|
47
|
+
- scroll views nesting unpredictably or fighting edge gestures;
|
|
48
|
+
- cross-platform UI forced to look identical at the expense of both platforms.
|
|
49
|
+
|
|
50
|
+
## Verification options
|
|
51
|
+
|
|
52
|
+
Rendered verification is possible only through simulator/emulator/device tooling or existing snapshot/screenshot tests. Xcode Previews, Accessibility Inspector, Android Layout Inspector/Accessibility Scanner, Flutter widget tests/golden tests, RN/Expo device testing, and platform screenshot tests provide different evidence. Compilation or preview generation alone is not visual verification; label unavailable device inspection `not-checked`.
|
|
53
|
+
|
|
54
|
+
## Framework routing
|
|
55
|
+
|
|
56
|
+
- Read [references/task-state-composition.md](references/task-state-composition.md) for a branded timer, recording flow, or other activity with a distinct before/during/after state.
|
|
57
|
+
|
|
58
|
+
- Read [references/swiftui.md](references/swiftui.md) for SwiftUI/iOS/watchOS/visionOS-style declarative Apple UI.
|
|
59
|
+
- Read [references/uikit.md](references/uikit.md) for UIKit/AppKit-adjacent imperative iOS UI.
|
|
60
|
+
- Read [references/jetpack-compose.md](references/jetpack-compose.md) for Android Compose.
|
|
61
|
+
- Read [references/flutter.md](references/flutter.md) for Flutter/Dart across mobile and embedded surfaces.
|
|
62
|
+
- Read [references/react-native-expo.md](references/react-native-expo.md) for React Native/Expo.
|
|
63
|
+
- Read [references/kotlin-multiplatform.md](references/kotlin-multiplatform.md) for Compose Multiplatform/KMP shared UI.
|
|
64
|
+
- Read [references/ionic-capacitor.md](references/ionic-capacitor.md) for Ionic/Capacitor hybrid apps.
|
|
65
|
+
- Read [references/dotnet-maui.md](references/dotnet-maui.md) for .NET MAUI.
|
|
66
|
+
- Read [references/flet.md](references/flet.md) for Flet cross-platform app surfaces.
|
|
67
|
+
- Read [references/kivy.md](references/kivy.md) for Kivy cross-platform app surfaces.
|
|
68
|
+
|
|
69
|
+
For watchOS/Wear OS wearables and tvOS/10-foot living-room surfaces, use `pixelcraft-constrained` as the primary surface skill alongside framework idioms here; for visionOS/XR spatial surfaces, use `pixelcraft-spatial`.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# .NET MAUI
|
|
2
|
+
|
|
3
|
+
## Token mapping
|
|
4
|
+
|
|
5
|
+
Map generated values into XAML resource dictionaries, semantic styles, and platform resources:
|
|
6
|
+
|
|
7
|
+
```xml
|
|
8
|
+
<Color x:Key="SemanticAction">#0074ca</Color>
|
|
9
|
+
<Style TargetType="Button" x:Key="PrimaryAction">
|
|
10
|
+
<Setter Property="BackgroundColor" Value="{StaticResource SemanticAction}" />
|
|
11
|
+
</Style>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Use dynamic resources/theme dictionaries for dark/light/high-contrast behavior. Do not copy raw colors through pages.
|
|
15
|
+
|
|
16
|
+
## Layout and responsive idioms
|
|
17
|
+
|
|
18
|
+
Use MAUI layouts (`Grid`, `VerticalStackLayout`, `CollectionView`, shells/flyout/tab/navigation) with platform idioms. Shell navigation is not automatically correct information architecture. Respect safe areas, orientation, desktop/mobile multi-target differences, keyboard/system navigation, and platform back semantics.
|
|
19
|
+
|
|
20
|
+
## Typography/custom fonts
|
|
21
|
+
|
|
22
|
+
Register fonts during app startup/resource setup and map semantic font styles. Support platform font scaling where expected. Avoid fixed-height labels that clip localized/expanded text; measure actual device scaling.
|
|
23
|
+
|
|
24
|
+
## Motion/reduced motion
|
|
25
|
+
|
|
26
|
+
Use MAUI animation APIs intentionally. Platform reduced-motion settings require platform-specific verification/abstraction; do not assume one universal cross-platform hook. Keep animations cancellable and nonblocking.
|
|
27
|
+
|
|
28
|
+
## Accessibility specifics
|
|
29
|
+
|
|
30
|
+
Use SemanticProperties (`SemanticProperties.Description`, HeadingLevel where applicable), automation properties/platform accessibility metadata, focus/keyboard behavior, visible focus/target size. Test TalkBack/VoiceOver/Narrator depending target; shared XAML does not guarantee equivalent accessibility trees.
|
|
31
|
+
|
|
32
|
+
## States idiom
|
|
33
|
+
|
|
34
|
+
Use MVVM state explicitly rather than boolean soup: loading/refreshing/empty/error/offline/permission/optimistic. Handle lifecycle/resume/process recreation and navigation parameters. Collection virtualization/reuse can leak visual state if bindings/converters are wrong.
|
|
35
|
+
|
|
36
|
+
## Forms idiom
|
|
37
|
+
|
|
38
|
+
Use correct keyboard, entry/editor behaviors, return type, validation timing, input preservation, focus order, paste/autofill/platform capabilities, and clear error recovery. Do not implement validation only through red borders without text.
|
|
39
|
+
|
|
40
|
+
## Do/don't pairs
|
|
41
|
+
|
|
42
|
+
| Do | Don't |
|
|
43
|
+
|---|---|
|
|
44
|
+
| real `Button` with command/accessibility metadata | tap gesture on a label as primary control |
|
|
45
|
+
| resource dictionary semantic colors | inline hex duplicated across pages |
|
|
46
|
+
| explicit VM async state and cancellation | hidden fire-and-forget async void mutation |
|
|
47
|
+
| Shell/platform back behavior verification | modal/navigation stack hacks that trap users |
|
|
48
|
+
| platform-specific accessibility testing | assuming shared XAML semantics are enough |
|
|
49
|
+
|
|
50
|
+
## Known traps
|
|
51
|
+
|
|
52
|
+
Handler/platform differences, XAML binding errors visible only at runtime, async void lifecycle bugs, collection virtualization state leakage, navigation stack confusion, font scaling clipping, inconsistent safe-area behavior, accessibility metadata varying across targets.
|
|
53
|
+
|
|
54
|
+
## Verification commands
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
dotnet build
|
|
58
|
+
dotnet test
|
|
59
|
+
dotnet build -t:Run -f net8.0-android 2>/dev/null || true
|
|
60
|
+
dotnet build -t:Run -f net8.0-ios 2>/dev/null || true
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Use device/emulator/simulator inspection, Narrator/TalkBack/VoiceOver, font scaling, dark/high contrast, orientation/resizing, offline state, and platform back/gesture testing as evidence.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Flet
|
|
2
|
+
|
|
3
|
+
## Token mapping
|
|
4
|
+
|
|
5
|
+
Configure page/theme objects rather than styling every control ad hoc. Current Flet commonly uses `page.theme = ft.Theme(...)` and color-scheme-related properties; verify exact constructor against the installed version. Keep generated Python constants in a semantic module and map them once into theme/control styles.
|
|
6
|
+
|
|
7
|
+
## Layout and responsive idioms
|
|
8
|
+
|
|
9
|
+
Use controls/containers/rows/columns/views/routes/expansion behavior according to app/window model. Flet can target desktop/web/mobile-like surfaces; do not assume browser DOM or mobile platform conventions automatically apply. Handle resize/orientation/window dimensions explicitly.
|
|
10
|
+
|
|
11
|
+
## Typography/custom fonts
|
|
12
|
+
|
|
13
|
+
Register/configure fonts and text styles deliberately. Verify fallback/glyph coverage and scaling. Fixed-size containers must not clip localized or scaled copy without intentional overflow behavior.
|
|
14
|
+
|
|
15
|
+
## Motion/reduced motion
|
|
16
|
+
|
|
17
|
+
Use animation/transition properties purposefully and keep durations semantic. Platform reduced-motion behavior depends on target/host; expose an app-level reduced-motion setting if system integration is uncertain. Never rely on motion alone for state.
|
|
18
|
+
|
|
19
|
+
## Accessibility specifics
|
|
20
|
+
|
|
21
|
+
Use semantic properties/labels/tooltips only as appropriate and inspect actual target behavior. Keyboard focus/traversal and screen-reader support vary by surface/version; custom-painted/control-heavy UI needs explicit verification. Do not fake buttons with gesture-only containers.
|
|
22
|
+
|
|
23
|
+
## States idiom
|
|
24
|
+
|
|
25
|
+
Understand page/update lifecycle and control tree ownership. Model loading/error/empty/offline/permission/background-task states explicitly. Async tasks need cancellation/error propagation and duplicate-submit protection. Preserve control values through route/navigation/session behavior.
|
|
26
|
+
|
|
27
|
+
## Forms idiom
|
|
28
|
+
|
|
29
|
+
Use labeled text fields/dropdowns/checkboxes, validation timing after completion/submit, focus traversal, correct keyboard/input behavior where exposed, paste/autofill capability verification, and input preservation across route changes.
|
|
30
|
+
|
|
31
|
+
## Do/don't pairs
|
|
32
|
+
|
|
33
|
+
| Do | Don't |
|
|
34
|
+
|---|---|
|
|
35
|
+
| one semantic theme module | raw color/style constants repeated through controls |
|
|
36
|
+
| real button/control semantics | clickable/gesture container as fake primary action |
|
|
37
|
+
| explicit async task error/cancel state | fire-and-forget background work with silent failure |
|
|
38
|
+
| resize-aware adaptive layout | fixed desktop wireframe scaled to every target |
|
|
39
|
+
| preserve form draft through navigation | reconstructing blank controls on every route change |
|
|
40
|
+
|
|
41
|
+
## Known traps
|
|
42
|
+
|
|
43
|
+
Version API churn, update batching/lifecycle confusion, control duplication, unclear async ownership, platform capability differences, font/glyph coverage, accessibility uncertainty, desktop/web behavior divergence.
|
|
44
|
+
|
|
45
|
+
## Verification commands
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
flet run app.py 2>/dev/null || python app.py
|
|
49
|
+
python -m pytest
|
|
50
|
+
python -m compileall .
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Inspect the actual target surface (browser/desktop/device). Python tests are state evidence only unless they drive the rendered target.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Flutter
|
|
2
|
+
|
|
3
|
+
Evidence: current Flutter docs confirm `MediaQuery.disableAnimationsOf(context)` corresponds to Android Remove animations; iOS reduce motion is exposed separately through accessibility features/reduceMotion in newer APIs.
|
|
4
|
+
|
|
5
|
+
## Token mapping
|
|
6
|
+
|
|
7
|
+
Map generated Dart constants into `ColorScheme`, `ThemeData`, text theme, extensions, and component themes:
|
|
8
|
+
|
|
9
|
+
```dart
|
|
10
|
+
final theme = ThemeData(
|
|
11
|
+
colorScheme: ColorScheme.fromSeed(seedColor: PixelcraftTokens.colorBrand),
|
|
12
|
+
);
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Prefer explicit semantic `ThemeExtension` when roles exceed Material defaults. Do not copy raw hex/dimensions into widgets.
|
|
16
|
+
|
|
17
|
+
## Layout and responsive idioms
|
|
18
|
+
|
|
19
|
+
Use constraints, `LayoutBuilder`, flexible/expanded, safe area, media query size/orientation/text scaler, slivers only when needed, and adaptive navigation scaffolds. Flutter renders consistently across platforms, but platform conventions still differ—do not force identical navigation/back idioms everywhere.
|
|
20
|
+
|
|
21
|
+
## Typography/custom fonts
|
|
22
|
+
|
|
23
|
+
Declare fonts/assets/pubspec correctly and map text theme roles. Respect `TextScaler`/system scaling; do not fixed-height clip essential text. Include glyph coverage for localization or configure fallback fonts deliberately.
|
|
24
|
+
|
|
25
|
+
## Motion/reduced motion
|
|
26
|
+
|
|
27
|
+
Use implicit/explicit animations purposefully. Check `MediaQuery.disableAnimationsOf(context)` for explicit/custom animations and respect reduce-motion platform signals where exposed in current Flutter version. Keep animation controllers disposed/cancelled and never block interaction unnecessarily.
|
|
28
|
+
|
|
29
|
+
## Accessibility specifics
|
|
30
|
+
|
|
31
|
+
Use `Semantics`, labels/hints/values, live region flags where appropriate, focus/traversal order, correct button/text-field semantics, and exclude decorative nodes. Test TalkBack/VoiceOver because material-looking widgets can still produce incorrect semantic trees. Target baseline follows platform: 48dp Android/44pt iOS expectations where applicable.
|
|
32
|
+
|
|
33
|
+
## States idiom
|
|
34
|
+
|
|
35
|
+
Use explicit state management ownership (`ValueNotifier`, Riverpod/Bloc/etc. per project) and immutable async state: loading/refreshing/data-empty/data-partial/error/offline/optimistic. Preserve scroll/input state through keys/restoration. Golden tests can validate states, but only if fixtures represent real data lengths/errors.
|
|
36
|
+
|
|
37
|
+
## Forms idiom
|
|
38
|
+
|
|
39
|
+
Use `Form`/`TextFormField`, correct keyboard type/text input action/autofill hints/input formatters, focus nodes, validation timing, and input preservation. Do not validate aggressively on every keystroke or clear controllers during rebuild/navigation.
|
|
40
|
+
|
|
41
|
+
## Do/don't pairs
|
|
42
|
+
|
|
43
|
+
| Do | Don't |
|
|
44
|
+
|---|---|
|
|
45
|
+
| `FilledButton(onPressed: save, child: Text('Save invoice'))` | `GestureDetector` around styled text as primary control |
|
|
46
|
+
| check `MediaQuery.disableAnimationsOf(context)` for custom motion | assuming the compiler removes motion automatically |
|
|
47
|
+
| semantic `ThemeExtension` roles | raw `Color(0xff...)` scattered through widgets |
|
|
48
|
+
| stable keys/scroll controllers for stateful lists | rebuild-dependent scroll/focus loss |
|
|
49
|
+
| `TextFormField(autofillHints: [AutofillHints.email])` | custom keyboard/paste-blocking behavior |
|
|
50
|
+
|
|
51
|
+
## Flutter web note
|
|
52
|
+
|
|
53
|
+
Flutter can target web, but choose rendering mode deliberately. Canvas-heavy Flutter web does not automatically provide normal browser semantics, text selection, SEO, deep-link behavior, or accessibility parity. For browser-dominant products, apply `pixelcraft-web` verification and compare a DOM/server-rendered alternative in `pixelcraft-plan` before committing.
|
|
54
|
+
|
|
55
|
+
## Known traps
|
|
56
|
+
|
|
57
|
+
Build context after async gaps, controller lifecycle leaks, fixed pixel design across densities/text scaling, platform back/navigation mismatch, nested scrollables, semantic tree mismatch, golden-test brittleness, font licensing/glyph coverage, treating identical cross-platform rendering as identical platform UX.
|
|
58
|
+
|
|
59
|
+
## Verification commands
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
flutter analyze
|
|
63
|
+
flutter test
|
|
64
|
+
flutter test --update-goldens # only intentionally
|
|
65
|
+
flutter run -d <device>
|
|
66
|
+
flutter build apk 2>/dev/null || true
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Use widget/golden tests, device/emulator screenshots, accessibility scanner/TalkBack/VoiceOver, text scaling, dark mode, orientation, offline/slow network, and platform back/gesture inspection as evidence.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Ionic / Capacitor
|
|
2
|
+
|
|
3
|
+
## Token mapping
|
|
4
|
+
|
|
5
|
+
Ionic exposes CSS variables for theme and component customization. Bridge generated CSS variables into Ionic semantic variables in global CSS:
|
|
6
|
+
|
|
7
|
+
```css
|
|
8
|
+
:root {
|
|
9
|
+
--ion-color-primary: var(--semantic-color-action);
|
|
10
|
+
--ion-background-color: var(--semantic-color-background);
|
|
11
|
+
}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Do not override internal shadow DOM with brittle selectors when documented CSS variables/parts exist.
|
|
15
|
+
|
|
16
|
+
## Layout and responsive idioms
|
|
17
|
+
|
|
18
|
+
Use Ionic page/content/header/footer/menu/router outlet idioms. Respect safe areas, split pane behavior, hardware/software back semantics, keyboard inset behavior, and mobile navigation rather than treating the app as a responsive website in a shell. Web responsive layout remains relevant inside content.
|
|
19
|
+
|
|
20
|
+
## Typography/custom fonts
|
|
21
|
+
|
|
22
|
+
Use web font loading plus platform-appropriate fallbacks. Ionic mode (`ios`/`md`) affects typography/platform behavior; choose intentionally rather than forcing one mode blindly everywhere. Text zoom/reflow must survive WebView settings and device font scaling.
|
|
23
|
+
|
|
24
|
+
## Motion/reduced motion
|
|
25
|
+
|
|
26
|
+
Use Ionic component transitions/navigation idioms and CSS motion honoring `prefers-reduced-motion`. Capacitor plugins/native APIs may expose additional behavior, but do not fake system haptics/animation everywhere.
|
|
27
|
+
|
|
28
|
+
## Accessibility specifics
|
|
29
|
+
|
|
30
|
+
Ionic components carry useful semantics but still require labels/names/focus management. Router transitions and modal/popover dismissal need focus restoration. Capacitor apps need real device testing because web accessibility behavior does not cover native shell/permissions/keyboards.
|
|
31
|
+
|
|
32
|
+
## States idiom
|
|
33
|
+
|
|
34
|
+
Treat web data state and native device state separately: network offline/online, permission denied, background/resume, keyboard open/closed, deep link/app URL open, push notification cold start. Loading/empty/error/offline/optimistic states follow web rules plus native interruption recovery.
|
|
35
|
+
|
|
36
|
+
## Forms idiom
|
|
37
|
+
|
|
38
|
+
Ionic inputs need persistent labels (`ion-label` or modern input label APIs), correct type/autocomplete/inputmode, clear helper/error copy, paste/autofill support, keyboard behavior, and validation timing. Do not use floating labels as the only memory aid in long forms without checking overlap/truncation.
|
|
39
|
+
|
|
40
|
+
## Do/don't pairs
|
|
41
|
+
|
|
42
|
+
| Do | Don't |
|
|
43
|
+
|---|---|
|
|
44
|
+
| use documented `--ion-*` variables/parts | piercing shadow internals with fragile selectors |
|
|
45
|
+
| platform-aware navigation/back behavior | forcing one navigation model because codebase is shared |
|
|
46
|
+
| explicit focus restoration after modal close | assuming WebView automatically chooses correct focus |
|
|
47
|
+
| device permission primer/fallback flow | looping the native permission prompt with no escape |
|
|
48
|
+
| test keyboard-safe bottom action | placing fixed CTA beneath keyboard/home indicator |
|
|
49
|
+
|
|
50
|
+
## Known traps
|
|
51
|
+
|
|
52
|
+
WebView version fragmentation, safe-area/keyboard mismatch, shadow DOM styling frustration, forced MD/iOS mode alien to users, native plugin permission lifecycle, hardware back duplication, deep-link cold start state, offline cache staleness, confusing PWA/mobile behavior.
|
|
53
|
+
|
|
54
|
+
## Verification commands
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
npm run lint
|
|
58
|
+
npm run test -- --watch=false
|
|
59
|
+
npm run build
|
|
60
|
+
npx cap sync
|
|
61
|
+
npx cap run ios 2>/dev/null || true
|
|
62
|
+
npx cap run android 2>/dev/null || true
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Use browser inspection for DOM plus real device/emulator tests for native shell, keyboard, permissions, back, gestures, screen readers, and offline behavior.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Jetpack Compose
|
|
2
|
+
|
|
3
|
+
## Token mapping
|
|
4
|
+
|
|
5
|
+
Map generated Kotlin values into `ColorScheme`, typography, shapes, spacing object, and `CompositionLocal` only when Material/theme APIs cannot express the role:
|
|
6
|
+
|
|
7
|
+
```kotlin
|
|
8
|
+
val LightColors = lightColorScheme(primary = SemanticAction)
|
|
9
|
+
val spacing = LocalSpacing.current
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Use generated `.dp`/`.sp` output semantically. Do not scatter raw `Color(0xff…)` or hard-coded dimensions in composables.
|
|
13
|
+
|
|
14
|
+
## Layout and responsive idioms
|
|
15
|
+
|
|
16
|
+
Use `Column`/`Row`/lazy layouts/box/grid constraints deliberately; measure with constraints and adapt through window size classes/pane scaffold where relevant. Handle predictive back, system bars, display cutouts, foldables, landscape, keyboard insets, and content padding. Do not hard-code screen width buckets copied from web breakpoints.
|
|
17
|
+
|
|
18
|
+
## Typography/custom fonts
|
|
19
|
+
|
|
20
|
+
Use Material typography roles and `sp` scaling. Font resources/downloadable fonts must declare fallbacks/weights correctly. Respect user font scale; avoid fixed-height single-line text for essential content unless truncation/expansion behavior is deliberate.
|
|
21
|
+
|
|
22
|
+
## Motion/reduced motion
|
|
23
|
+
|
|
24
|
+
Compose animation APIs since 1.2 generally honor Android Remove animations for Animator-based behavior, but custom/Lottie/progress motion may need explicit checks. Use `Settings.Global.ANIMATOR_DURATION_SCALE` (and transition scale where appropriate) as a proxy; zero means animations disabled. Provide static/opacity alternatives.
|
|
25
|
+
|
|
26
|
+
## Accessibility specifics
|
|
27
|
+
|
|
28
|
+
Use semantics modifiers: `semantics`, `contentDescription`, `role`, `stateDescription`, `progressBarRangeInfo`, custom actions, traversal ordering. Do not label decorative images. Test TalkBack order/action semantics. Touch target baseline is 48×48 dp; use size/minimum touch target behavior rather than visual-only padding illusions.
|
|
29
|
+
|
|
30
|
+
## States idiom
|
|
31
|
+
|
|
32
|
+
State hoisting/recomposition ownership must be explicit. Represent loading/refreshing/empty/error/offline/permission/optimistic state in UI state rather than boolean soup. Use stable keys in lazy lists; preserve/restore state with lifecycle-aware primitives. Duplicate clicks/recomposition/network retry need idempotent behavior.
|
|
33
|
+
|
|
34
|
+
## Forms idiom
|
|
35
|
+
|
|
36
|
+
Use `KeyboardOptions`, `KeyboardActions`, correct `keyboardType`/`imeAction`, capitalization/autocorrect where exposed, focus requester/order, validation after completion, and input preservation through process/state changes. Do not clear text field state because recomposition recreated it incorrectly.
|
|
37
|
+
|
|
38
|
+
## Do/don't pairs
|
|
39
|
+
|
|
40
|
+
| Do | Don't |
|
|
41
|
+
|---|---|
|
|
42
|
+
| `Button(onClick = { save() }) { Text("Save invoice") }` | clickable `Text` masquerading as a button |
|
|
43
|
+
| stable lazy item key `items(items, key = { it.id })` | index-only reuse causing wrong focus/scroll/state |
|
|
44
|
+
| consume `WindowInsets` / scaffold padding deliberately | CTA hidden behind gesture navigation/keyboard |
|
|
45
|
+
| validate after field completion/submit with recovery copy | error every keystroke before input is finished |
|
|
46
|
+
| `Modifier.semantics { contentDescription = "Delete invoice" }` | trash-can vector as sole accessible meaning |
|
|
47
|
+
|
|
48
|
+
## Known traps
|
|
49
|
+
|
|
50
|
+
Recomposition caused by unstable inputs, state loss across process death, incorrect `remember` keys, lazy list focus/reuse, inset double padding, gesture conflicts/nested scroll, accessibility traversal order, custom theme bypassing Material state layers, assuming all animation automatically respects Remove animations.
|
|
51
|
+
|
|
52
|
+
## Verification commands
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
./gradlew assembleDebug
|
|
56
|
+
./gradlew testDebugUnitTest
|
|
57
|
+
./gradlew connectedDebugAndroidTest
|
|
58
|
+
./gradlew lint
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Use emulator/device screenshots, Layout Inspector, Accessibility Scanner, TalkBack, font scale/display size, dark mode, landscape/foldable/split-screen, network throttling, and Remove animations settings for evidence.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Kivy
|
|
2
|
+
|
|
3
|
+
## Token mapping
|
|
4
|
+
|
|
5
|
+
Kivy has no universal modern design-token pipeline. Encode semantic constants in Python/KV variables and apply them through reusable styles/classes:
|
|
6
|
+
|
|
7
|
+
```kv
|
|
8
|
+
#:set pc_action (0.0, 0.455, 0.792, 1)
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Keep color units/channel conventions explicit. Do not scatter raw RGBA arrays through KV/rules.
|
|
12
|
+
|
|
13
|
+
## Layout and responsive idioms
|
|
14
|
+
|
|
15
|
+
Use Box/Grid/Relative/Float/Anchor layouts intentionally, KV size hints, dp/sp units, window resize behavior, orientation/density, and scroll views. Do not use absolute pixel coordinates for everything. Canvas drawing is powerful but must be recomputed on resize/scale.
|
|
16
|
+
|
|
17
|
+
## Typography/custom fonts
|
|
18
|
+
|
|
19
|
+
Register custom fonts and use sp-based sizing. Verify glyph coverage/fallback because Kivy font behavior differs by platform. Do not fixed-size clip localized or scaled text; measure texture constraints where custom layout matters.
|
|
20
|
+
|
|
21
|
+
## Motion/reduced motion
|
|
22
|
+
|
|
23
|
+
Use `kivy.animation.Animation` purposefully, cancel animations on lifecycle/navigation, and avoid motion-only feedback. System reduced-motion integration is not uniform; expose an app-level reduced-motion option where necessary.
|
|
24
|
+
|
|
25
|
+
## Accessibility specifics
|
|
26
|
+
|
|
27
|
+
Kivy accessibility support is limited/platform-dependent compared with native UI frameworks. Keyboard input/focus behavior must be explicit; touch target sizing and non-color state are critical. Treat screen-reader support as uncertain until verified on target. Do not make essential UI canvas-only without semantic/navigation alternatives.
|
|
28
|
+
|
|
29
|
+
## States idiom
|
|
30
|
+
|
|
31
|
+
Use properties/event binding/state machine explicitness. Loading/empty/error/offline/permission/background-operation states must be represented in widget tree. Clock scheduling/threading needs lifecycle cancellation and duplicate protection. Preserve user input across screen manager transitions.
|
|
32
|
+
|
|
33
|
+
## Forms idiom
|
|
34
|
+
|
|
35
|
+
Use labeled inputs, focus order, keyboard behavior, validation timing, paste/input-method capabilities verification, and input preservation. Mobile keyboard occlusion and scrolling need deliberate testing.
|
|
36
|
+
|
|
37
|
+
## Do/don't pairs
|
|
38
|
+
|
|
39
|
+
| Do | Don't |
|
|
40
|
+
|---|---|
|
|
41
|
+
| real `Button` behavior where control semantics matter | drawing a fake button on canvas with only touch coordinates |
|
|
42
|
+
| dp/sp units and resize-aware layout | absolute pixels copied from one mockup |
|
|
43
|
+
| cancel/complete Clock/thread work explicitly | background thread mutating UI/state after screen destruction |
|
|
44
|
+
| explicit keyboard/focus order | assuming tab/screen-reader behavior exists automatically |
|
|
45
|
+
| non-color/icon/text state cues | color-only validation or status |
|
|
46
|
+
|
|
47
|
+
## Known traps
|
|
48
|
+
|
|
49
|
+
Canvas redraw/resize bugs, touch target inconsistency, platform packaging differences, text scaling/glyph coverage, weak screen-reader support, thread/UI lifecycle mistakes, keyboard occlusion, accidental absolute positioning, animation cancellation leaks.
|
|
50
|
+
|
|
51
|
+
## Verification commands
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
python main.py
|
|
55
|
+
python -m pytest
|
|
56
|
+
python -m compileall .
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Use actual desktop/device runs at multiple sizes/input modes. Kivy behavior cannot be verified meaningfully by compile/tests alone.
|