@thanhnguyxn/pixelcraft 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +20 -0
- package/.antigravity-plugin/plugin.json +32 -0
- package/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +22 -0
- package/.codex-plugin/plugin.json +45 -0
- package/.cursor-plugin/marketplace.json +17 -0
- package/.cursor-plugin/plugin.json +27 -0
- package/.devin-plugin/plugin.json +21 -0
- package/.github/plugin/marketplace.json +34 -0
- package/CHANGELOG.md +159 -0
- package/GEMINI.md +1 -0
- package/LICENSE +21 -0
- package/README.md +264 -2
- package/SECURITY.md +28 -0
- package/assets/README.md +28 -0
- package/assets/pixelcraft-logo-128.png +0 -0
- package/assets/pixelcraft-logo-256.png +0 -0
- package/assets/pixelcraft-logo-512.png +0 -0
- package/bin/pixelcraft.mjs +852 -0
- package/docs/ARCHITECTURE.md +105 -0
- package/docs/DESIGN-RATIONALE.md +191 -0
- package/docs/INSTALL.md +221 -0
- package/evals/README.md +37 -0
- package/evals/fixtures/3d-web-engineering.json +69 -0
- package/evals/fixtures/README.md +36 -0
- package/evals/fixtures/acceptance-checklist-rule03-gate.json +43 -0
- package/evals/fixtures/ai-ui-libraries.json +53 -0
- package/evals/fixtures/audio-visual-accessibility.json +69 -0
- package/evals/fixtures/auth-and-checkout-ui.json +53 -0
- package/evals/fixtures/brandkit-identity-governance.json +48 -0
- package/evals/fixtures/build-and-architecture.json +53 -0
- package/evals/fixtures/canvas-and-node-editors.json +53 -0
- package/evals/fixtures/chat-ai-exfiltration-ime-hitl-gate.json +43 -0
- package/evals/fixtures/completion-gate-scan-until-clean.json +44 -0
- package/evals/fixtures/component-systems.json +53 -0
- package/evals/fixtures/component-testing.json +53 -0
- package/evals/fixtures/constrained-voice-and-tv.json +43 -0
- package/evals/fixtures/creative-code-rendering.json +69 -0
- package/evals/fixtures/creative-reference-evidence.json +67 -0
- package/evals/fixtures/data-app-python-marimo.json +49 -0
- package/evals/fixtures/desktop-cpp-juce-audio.json +49 -0
- package/evals/fixtures/desktop-csharp-avalonia.json +49 -0
- package/evals/fixtures/desktop-native-workspace.json +48 -0
- package/evals/fixtures/desktop-python-anti-tkinter.json +49 -0
- package/evals/fixtures/direction-prototype-complexity.json +29 -0
- package/evals/fixtures/document-prepress-pdfx4-tounicode.json +43 -0
- package/evals/fixtures/document-rust-typst-invoice.json +49 -0
- package/evals/fixtures/document-typst-and-print-css.json +43 -0
- package/evals/fixtures/email-mjml-dark-mode.json +49 -0
- package/evals/fixtures/email-outlook-and-plaintext.json +43 -0
- package/evals/fixtures/enterprise-data-ui.json +53 -0
- package/evals/fixtures/extended-tui-toolkits.json +53 -0
- package/evals/fixtures/extensions-mv3-and-vscode.json +43 -0
- package/evals/fixtures/file-upload-media-ui.json +53 -0
- package/evals/fixtures/finish-gate-anti-slop.json +30 -0
- package/evals/fixtures/forms-accessibility-negative.json +29 -0
- package/evals/fixtures/forms-validation.json +53 -0
- package/evals/fixtures/game-go-ebitengine.json +49 -0
- package/evals/fixtures/game-godot-gdscript.json +49 -0
- package/evals/fixtures/game-ui-hud-and-engines.json +43 -0
- package/evals/fixtures/handoff-fidelity-tolerance.json +29 -0
- package/evals/fixtures/i18n-engineering.json +53 -0
- package/evals/fixtures/local-first-sync.json +53 -0
- package/evals/fixtures/lynxjs.json +53 -0
- package/evals/fixtures/maizzle-email.json +53 -0
- package/evals/fixtures/maps-geospatial.json +53 -0
- package/evals/fixtures/media-og-and-video-export.json +43 -0
- package/evals/fixtures/media-players.json +53 -0
- package/evals/fixtures/mobile-compose-16kb-foldable-store-gate.json +44 -0
- package/evals/fixtures/mobile-elixir-liveview-native.json +49 -0
- package/evals/fixtures/mobile-flutter-dynamic-type.json +49 -0
- package/evals/fixtures/mobile-harmonyos-arkui.json +49 -0
- package/evals/fixtures/mobile-jetpack-compose.json +49 -0
- package/evals/fixtures/mobile-swiftui-ios.json +49 -0
- package/evals/fixtures/motion-engineering.json +69 -0
- package/evals/fixtures/pdfjs-and-pptx.json +53 -0
- package/evals/fixtures/plan-brownfield-evidence.json +28 -0
- package/evals/fixtures/plan-discovery-interview.json +31 -0
- package/evals/fixtures/plan-grill-me-brainstorm-gate.json +49 -0
- package/evals/fixtures/reactive-data-apps.json +53 -0
- package/evals/fixtures/review-evidence-audit.json +43 -0
- package/evals/fixtures/rich-text-and-code-editors.json +53 -0
- package/evals/fixtures/scrollytelling-resilience.json +70 -0
- package/evals/fixtures/spatial-xr-comfort-and-platforms.json +43 -0
- package/evals/fixtures/state-architecture.json +53 -0
- package/evals/fixtures/styling-ecosystem.json +53 -0
- package/evals/fixtures/token-tooling.json +53 -0
- package/evals/fixtures/tui-go-bubbletea.json +49 -0
- package/evals/fixtures/tui-rust-ratatui-grapheme-paste-teardown.json +44 -0
- package/evals/fixtures/tui-rust-ratatui.json +49 -0
- package/evals/fixtures/ux-state-matrix-and-i18n.json +43 -0
- package/evals/fixtures/visual-qa-task-evidence.json +29 -0
- package/evals/fixtures/web-3d-engines.json +53 -0
- package/evals/fixtures/web-php-laravel-filament.json +49 -0
- package/evals/fixtures/web-ruby-viewcomponent-phlex.json +49 -0
- package/evals/fixtures/workflow-checkpoints.json +30 -0
- package/evals/pixelcraft-accessibility.md +74 -0
- package/evals/pixelcraft-brandkit.md +58 -0
- package/evals/pixelcraft-chat-ui.md +55 -0
- package/evals/pixelcraft-constrained.md +55 -0
- package/evals/pixelcraft-craft.md +76 -0
- package/evals/pixelcraft-data-apps.md +55 -0
- package/evals/pixelcraft-dataviz.md +59 -0
- package/evals/pixelcraft-desktop.md +55 -0
- package/evals/pixelcraft-direction.md +77 -0
- package/evals/pixelcraft-document.md +55 -0
- package/evals/pixelcraft-email.md +55 -0
- package/evals/pixelcraft-extensions.md +55 -0
- package/evals/pixelcraft-game-ui.md +59 -0
- package/evals/pixelcraft-handoff.md +57 -0
- package/evals/pixelcraft-media.md +55 -0
- package/evals/pixelcraft-mobile.md +59 -0
- package/evals/pixelcraft-patterns.md +73 -0
- package/evals/pixelcraft-plan.md +127 -0
- package/evals/pixelcraft-review.md +63 -0
- package/evals/pixelcraft-spatial.md +55 -0
- package/evals/pixelcraft-tokens.md +57 -0
- package/evals/pixelcraft-tui.md +55 -0
- package/evals/pixelcraft-ux.md +59 -0
- package/evals/pixelcraft-visual-qa.md +86 -0
- package/evals/pixelcraft-web.md +89 -0
- package/evals/pixelcraft.md +70 -0
- package/gemini-extension.json +6 -0
- package/install.ps1 +341 -0
- package/install.sh +512 -0
- package/package.json +91 -4
- package/plugin.json +29 -0
- package/scripts/build-adapters.mjs +288 -0
- package/scripts/build-release-archives.mjs +61 -0
- package/scripts/build-skill-zips.mjs +94 -0
- package/scripts/run-evals.mjs +397 -0
- package/scripts/sync-docs.mjs +381 -0
- package/scripts/test-build-adapters.mjs +61 -0
- package/scripts/test-cross-platform-qa.mjs +359 -0
- package/scripts/test-distribution.mjs +203 -0
- package/scripts/test-export-tokens.mjs +361 -0
- package/scripts/test-finish-gate.mjs +271 -0
- package/scripts/test-installers.mjs +216 -0
- package/scripts/test-release-archives.mjs +42 -0
- package/scripts/test-shoot.mjs +87 -0
- package/scripts/test-slop-scan.mjs +416 -0
- package/scripts/test-style-inventory.mjs +234 -0
- package/scripts/test-sync-docs.mjs +140 -0
- package/scripts/test-validate-skills.mjs +195 -0
- package/scripts/validate-skills.mjs +658 -0
- package/skills/pixelcraft/SKILL.md +155 -0
- package/skills/pixelcraft/references/design-brief.md +75 -0
- package/skills/pixelcraft/references/floor.md +90 -0
- package/skills/pixelcraft/references/report-template.md +49 -0
- package/skills/pixelcraft/references/stack-detection.md +226 -0
- package/skills/pixelcraft/references/surface-acceptance.md +52 -0
- package/skills/pixelcraft/references/workflow-checkpoints.md +71 -0
- package/skills/pixelcraft-accessibility/SKILL.md +54 -0
- package/skills/pixelcraft-accessibility/references/apg-patterns.md +64 -0
- package/skills/pixelcraft-accessibility/references/motion-canvas.md +57 -0
- package/skills/pixelcraft-accessibility/references/platforms.md +86 -0
- package/skills/pixelcraft-accessibility/references/verification.md +64 -0
- package/skills/pixelcraft-accessibility/references/wcag22-checks.md +99 -0
- package/skills/pixelcraft-brandkit/SKILL.md +127 -0
- package/skills/pixelcraft-brandkit/references/asset-pipeline.md +165 -0
- package/skills/pixelcraft-brandkit/references/brand-governance.md +82 -0
- package/skills/pixelcraft-brandkit/references/layouts.md +88 -0
- package/skills/pixelcraft-brandkit/references/logo-concepting.md +83 -0
- package/skills/pixelcraft-brandkit/references/logo-methods.md +97 -0
- package/skills/pixelcraft-brandkit/references/pixel-art-logos.md +82 -0
- package/skills/pixelcraft-brandkit/references/prompt-template.md +87 -0
- package/skills/pixelcraft-brandkit/references/qa-checklist.md +93 -0
- package/skills/pixelcraft-brandkit/references/visual-modes.md +123 -0
- package/skills/pixelcraft-chat-ui/SKILL.md +57 -0
- package/skills/pixelcraft-chat-ui/references/agentic-workspace.md +66 -0
- package/skills/pixelcraft-chat-ui/references/ai-ui-libraries.md +259 -0
- package/skills/pixelcraft-chat-ui/references/conversation-design.md +84 -0
- package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +77 -0
- package/skills/pixelcraft-chat-ui/references/slack-discord.md +80 -0
- package/skills/pixelcraft-constrained/SKILL.md +52 -0
- package/skills/pixelcraft-constrained/references/specialized-hardware.md +90 -0
- package/skills/pixelcraft-constrained/references/tv-wearables.md +134 -0
- package/skills/pixelcraft-constrained/references/voice-ui.md +104 -0
- package/skills/pixelcraft-craft/SKILL.md +58 -0
- package/skills/pixelcraft-craft/references/color.md +125 -0
- package/skills/pixelcraft-craft/references/imagery-icons.md +37 -0
- package/skills/pixelcraft-craft/references/layout-quality.md +65 -0
- package/skills/pixelcraft-craft/references/layout.md +73 -0
- package/skills/pixelcraft-craft/references/motion.md +163 -0
- package/skills/pixelcraft-craft/references/typography.md +110 -0
- package/skills/pixelcraft-data-apps/SKILL.md +86 -0
- package/skills/pixelcraft-data-apps/references/ai-and-internal-data-apps.md +147 -0
- package/skills/pixelcraft-data-apps/references/dash.md +109 -0
- package/skills/pixelcraft-data-apps/references/evidence.md +90 -0
- package/skills/pixelcraft-data-apps/references/gradio.md +103 -0
- package/skills/pixelcraft-data-apps/references/julia-genie.md +89 -0
- package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +91 -0
- package/skills/pixelcraft-data-apps/references/nicegui.md +102 -0
- package/skills/pixelcraft-data-apps/references/observable-framework.md +105 -0
- package/skills/pixelcraft-data-apps/references/panel.md +99 -0
- package/skills/pixelcraft-data-apps/references/r-shiny.md +124 -0
- package/skills/pixelcraft-data-apps/references/reactive-data-apps.md +186 -0
- package/skills/pixelcraft-data-apps/references/reflex.md +116 -0
- package/skills/pixelcraft-data-apps/references/shiny.md +110 -0
- package/skills/pixelcraft-data-apps/references/streamlit.md +113 -0
- package/skills/pixelcraft-dataviz/SKILL.md +60 -0
- package/skills/pixelcraft-dataviz/references/chart-choice.md +55 -0
- package/skills/pixelcraft-dataviz/references/color-accessibility.md +112 -0
- package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +107 -0
- package/skills/pixelcraft-dataviz/references/libraries.md +176 -0
- package/skills/pixelcraft-dataviz/references/maps-geospatial.md +159 -0
- package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +92 -0
- package/skills/pixelcraft-desktop/SKILL.md +93 -0
- package/skills/pixelcraft-desktop/references/appkit.md +92 -0
- package/skills/pixelcraft-desktop/references/avalonia.md +95 -0
- package/skills/pixelcraft-desktop/references/cpp-gui.md +129 -0
- package/skills/pixelcraft-desktop/references/electron.md +96 -0
- package/skills/pixelcraft-desktop/references/go-gui.md +83 -0
- package/skills/pixelcraft-desktop/references/gtk.md +97 -0
- package/skills/pixelcraft-desktop/references/javafx-swing.md +81 -0
- package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +88 -0
- package/skills/pixelcraft-desktop/references/rust-gui.md +83 -0
- package/skills/pixelcraft-desktop/references/tauri.md +110 -0
- package/skills/pixelcraft-desktop/references/uno-platform.md +71 -0
- package/skills/pixelcraft-desktop/references/winui-wpf.md +98 -0
- package/skills/pixelcraft-desktop/references/working-context.md +84 -0
- package/skills/pixelcraft-direction/SKILL.md +120 -0
- package/skills/pixelcraft-direction/references/composition-library.md +84 -0
- package/skills/pixelcraft-direction/references/creative-brainstorming.md +72 -0
- package/skills/pixelcraft-direction/references/direction-card.md +64 -0
- package/skills/pixelcraft-direction/references/direction-scoring.md +76 -0
- package/skills/pixelcraft-direction/references/motion-identity.md +67 -0
- package/skills/pixelcraft-direction/references/movements.md +71 -0
- package/skills/pixelcraft-direction/references/reference-analysis.md +37 -0
- package/skills/pixelcraft-direction/references/repetition-history.md +75 -0
- package/skills/pixelcraft-direction/references/slop-fingerprints.md +83 -0
- package/skills/pixelcraft-direction/references/wildcards.md +47 -0
- package/skills/pixelcraft-document/SKILL.md +58 -0
- package/skills/pixelcraft-document/references/archetypes.md +106 -0
- package/skills/pixelcraft-document/references/pdf-tools.md +314 -0
- package/skills/pixelcraft-document/references/pdfjs-and-pptx.md +114 -0
- package/skills/pixelcraft-document/references/print-css.md +187 -0
- package/skills/pixelcraft-document/references/slides.md +198 -0
- package/skills/pixelcraft-email/SKILL.md +80 -0
- package/skills/pixelcraft-email/references/client-quirks.md +113 -0
- package/skills/pixelcraft-email/references/html-tables.md +114 -0
- package/skills/pixelcraft-email/references/maizzle.md +54 -0
- package/skills/pixelcraft-email/references/mjml.md +54 -0
- package/skills/pixelcraft-email/references/react-email.md +95 -0
- package/skills/pixelcraft-extensions/SKILL.md +56 -0
- package/skills/pixelcraft-extensions/references/browser-extensions.md +105 -0
- package/skills/pixelcraft-extensions/references/figma-office.md +106 -0
- package/skills/pixelcraft-extensions/references/ide-and-saas-plugins.md +125 -0
- package/skills/pixelcraft-extensions/references/raycast.md +98 -0
- package/skills/pixelcraft-extensions/references/vscode-webviews.md +100 -0
- package/skills/pixelcraft-game-ui/SKILL.md +80 -0
- package/skills/pixelcraft-game-ui/references/bevy.md +90 -0
- package/skills/pixelcraft-game-ui/references/godot.md +130 -0
- package/skills/pixelcraft-game-ui/references/hud-principles.md +67 -0
- package/skills/pixelcraft-game-ui/references/love2d.md +77 -0
- package/skills/pixelcraft-game-ui/references/monogame.md +68 -0
- package/skills/pixelcraft-game-ui/references/unity-ugui.md +109 -0
- package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +107 -0
- package/skills/pixelcraft-game-ui/references/unreal-umg.md +80 -0
- package/skills/pixelcraft-game-ui/references/web-and-middleware-game-ui.md +122 -0
- package/skills/pixelcraft-handoff/SKILL.md +50 -0
- package/skills/pixelcraft-handoff/references/design-translation.md +134 -0
- package/skills/pixelcraft-handoff/references/fidelity-tolerance.md +78 -0
- package/skills/pixelcraft-handoff/references/motion-handoff.md +54 -0
- package/skills/pixelcraft-media/SKILL.md +49 -0
- package/skills/pixelcraft-media/references/banners-video.md +130 -0
- package/skills/pixelcraft-media/references/og-generation.md +154 -0
- package/skills/pixelcraft-media/references/social-cards.md +71 -0
- package/skills/pixelcraft-mobile/SKILL.md +86 -0
- package/skills/pixelcraft-mobile/references/dotnet-maui.md +91 -0
- package/skills/pixelcraft-mobile/references/flet.md +80 -0
- package/skills/pixelcraft-mobile/references/flutter.md +113 -0
- package/skills/pixelcraft-mobile/references/harmonyos-and-emerging-mobile.md +121 -0
- package/skills/pixelcraft-mobile/references/ionic-capacitor.md +87 -0
- package/skills/pixelcraft-mobile/references/jetpack-compose.md +129 -0
- package/skills/pixelcraft-mobile/references/kivy.md +82 -0
- package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +86 -0
- package/skills/pixelcraft-mobile/references/lynxjs.md +110 -0
- package/skills/pixelcraft-mobile/references/nativescript-and-skip.md +91 -0
- package/skills/pixelcraft-mobile/references/react-native-expo.md +106 -0
- package/skills/pixelcraft-mobile/references/swiftui.md +200 -0
- package/skills/pixelcraft-mobile/references/tactile-interactions.md +55 -0
- package/skills/pixelcraft-mobile/references/task-state-composition.md +85 -0
- package/skills/pixelcraft-mobile/references/uikit.md +92 -0
- package/skills/pixelcraft-patterns/SKILL.md +75 -0
- package/skills/pixelcraft-patterns/references/accessibility-resilience.md +29 -0
- package/skills/pixelcraft-patterns/references/ai-and-offline-patterns.md +54 -0
- package/skills/pixelcraft-patterns/references/auth-onboarding.md +44 -0
- package/skills/pixelcraft-patterns/references/billing-paywalls.md +40 -0
- package/skills/pixelcraft-patterns/references/command-workspace.md +56 -0
- package/skills/pixelcraft-patterns/references/commerce.md +47 -0
- package/skills/pixelcraft-patterns/references/communication.md +45 -0
- package/skills/pixelcraft-patterns/references/creative-tools.md +42 -0
- package/skills/pixelcraft-patterns/references/creative-web-composition.md +38 -0
- package/skills/pixelcraft-patterns/references/dashboard-admin.md +35 -0
- package/skills/pixelcraft-patterns/references/history-diff-undo.md +50 -0
- package/skills/pixelcraft-patterns/references/marketing.md +44 -0
- package/skills/pixelcraft-patterns/references/multi-tenant-rbac.md +47 -0
- package/skills/pixelcraft-patterns/references/narrative-systems.md +42 -0
- package/skills/pixelcraft-patterns/references/notifications-activity.md +57 -0
- package/skills/pixelcraft-patterns/references/pattern-selection.md +80 -0
- package/skills/pixelcraft-patterns/references/scheduling-kanban.md +47 -0
- package/skills/pixelcraft-patterns/references/scroll-implementation.md +37 -0
- package/skills/pixelcraft-patterns/references/search-filtering.md +42 -0
- package/skills/pixelcraft-patterns/references/settings.md +51 -0
- package/skills/pixelcraft-patterns/references/tables-crud.md +43 -0
- package/skills/pixelcraft-plan/SKILL.md +103 -0
- package/skills/pixelcraft-plan/references/design-input.md +69 -0
- package/skills/pixelcraft-plan/references/discovery-interview.md +110 -0
- package/skills/pixelcraft-plan/references/grill-me-protocol.md +63 -0
- package/skills/pixelcraft-plan/references/plan-template.md +134 -0
- package/skills/pixelcraft-plan/references/repo-discovery.md +49 -0
- package/skills/pixelcraft-plan/references/stack-freshness.md +67 -0
- package/skills/pixelcraft-plan/references/stack-selection.md +98 -0
- package/skills/pixelcraft-review/SKILL.md +86 -0
- package/skills/pixelcraft-review/references/audit-report.md +69 -0
- package/skills/pixelcraft-review/references/critique-protocol.md +89 -0
- package/skills/pixelcraft-review/references/heuristics.md +63 -0
- package/skills/pixelcraft-review/references/personas.md +53 -0
- package/skills/pixelcraft-review/references/polish.md +78 -0
- package/skills/pixelcraft-review/scripts/check-acceptance.mjs +619 -0
- package/skills/pixelcraft-review/scripts/fixtures/brand-critique-waivers.json +14 -0
- package/skills/pixelcraft-review/scripts/fixtures/brand-critique.css +18 -0
- package/skills/pixelcraft-review/scripts/fixtures/clean.html +43 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-after-block.css +4 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-at-rules.css +17 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-comments.css +10 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-html-quote-leak.html +12 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-invalid-replacements.css +27 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-longhand-removal.css +34 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-nested-rules.css +19 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-not-visible-skip.css +8 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-outline-shorthands.css +11 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-and-border.css +15 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-last-wins.css +19 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-valid-replacements-extended.css +29 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-visible-no-replacement.css +3 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-visible-valid-replacements.css +9 -0
- package/skills/pixelcraft-review/scripts/fixtures/slop.html +28 -0
- package/skills/pixelcraft-review/scripts/slop-scan.mjs +1233 -0
- package/skills/pixelcraft-spatial/SKILL.md +51 -0
- package/skills/pixelcraft-spatial/references/comfort-accessibility.md +39 -0
- package/skills/pixelcraft-spatial/references/platforms.md +147 -0
- package/skills/pixelcraft-tokens/SKILL.md +60 -0
- package/skills/pixelcraft-tokens/assets/tokens.example.json +71 -0
- package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +47 -0
- package/skills/pixelcraft-tokens/references/adoption.md +55 -0
- package/skills/pixelcraft-tokens/references/format.md +84 -0
- package/skills/pixelcraft-tokens/references/governance.md +80 -0
- package/skills/pixelcraft-tokens/references/state-tokens.md +62 -0
- package/skills/pixelcraft-tokens/references/theme-presets.md +122 -0
- package/skills/pixelcraft-tokens/references/token-tooling.md +119 -0
- package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +847 -0
- package/skills/pixelcraft-tui/SKILL.md +76 -0
- package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +79 -0
- package/skills/pixelcraft-tui/references/extended-tui-toolkits.md +127 -0
- package/skills/pixelcraft-tui/references/ink.md +109 -0
- package/skills/pixelcraft-tui/references/ratatui.md +102 -0
- package/skills/pixelcraft-tui/references/rich.md +82 -0
- package/skills/pixelcraft-tui/references/terminal-protocols.md +80 -0
- package/skills/pixelcraft-tui/references/textual.md +108 -0
- package/skills/pixelcraft-ux/SKILL.md +56 -0
- package/skills/pixelcraft-ux/references/cognitive-walkthrough.md +70 -0
- package/skills/pixelcraft-ux/references/feedback-performance.md +50 -0
- package/skills/pixelcraft-ux/references/flows-ia.md +44 -0
- package/skills/pixelcraft-ux/references/forms.md +151 -0
- package/skills/pixelcraft-ux/references/i18n.md +221 -0
- package/skills/pixelcraft-ux/references/laws.md +39 -0
- package/skills/pixelcraft-ux/references/locale-test-matrix.md +60 -0
- package/skills/pixelcraft-ux/references/state-matrix.md +53 -0
- package/skills/pixelcraft-ux/references/usability-testing.md +84 -0
- package/skills/pixelcraft-ux/references/ux-writing.md +44 -0
- package/skills/pixelcraft-visual-qa/SKILL.md +96 -0
- package/skills/pixelcraft-visual-qa/references/baseline-governance.md +70 -0
- package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +59 -0
- package/skills/pixelcraft-visual-qa/references/capture-document.md +70 -0
- package/skills/pixelcraft-visual-qa/references/capture-email.md +38 -0
- package/skills/pixelcraft-visual-qa/references/capture-mobile.md +50 -0
- package/skills/pixelcraft-visual-qa/references/capture-terminal.md +35 -0
- package/skills/pixelcraft-visual-qa/references/critique-rubric.md +71 -0
- package/skills/pixelcraft-visual-qa/references/finish-gate.md +35 -0
- package/skills/pixelcraft-visual-qa/references/measured-craft.md +30 -0
- package/skills/pixelcraft-visual-qa/references/motion-capture.md +63 -0
- package/skills/pixelcraft-visual-qa/references/performance-budgets.md +78 -0
- package/skills/pixelcraft-visual-qa/references/realtime-graphics.md +55 -0
- package/skills/pixelcraft-visual-qa/references/task-verification.md +81 -0
- package/skills/pixelcraft-visual-qa/scripts/check-contrast.mjs +442 -0
- package/skills/pixelcraft-visual-qa/scripts/check-email.mjs +397 -0
- package/skills/pixelcraft-visual-qa/scripts/check-pdf.mjs +189 -0
- package/skills/pixelcraft-visual-qa/scripts/check-tui.mjs +321 -0
- package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +174 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-aria-modal.html +19 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-audit.html +34 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-modal.html +17 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-deferred.js +1 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-edge.html +52 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.html +80 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.js +8 -0
- package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +668 -0
- package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +1226 -0
- package/skills/pixelcraft-web/SKILL.md +132 -0
- package/skills/pixelcraft-web/references/accessibility-performance.md +42 -0
- package/skills/pixelcraft-web/references/adaptive-layout.md +69 -0
- package/skills/pixelcraft-web/references/angular.md +108 -0
- package/skills/pixelcraft-web/references/assets-pipeline.md +67 -0
- package/skills/pixelcraft-web/references/astro.md +113 -0
- package/skills/pixelcraft-web/references/audio-reactive.md +61 -0
- package/skills/pixelcraft-web/references/auth-and-checkout-ui.md +115 -0
- package/skills/pixelcraft-web/references/build-and-architecture.md +215 -0
- package/skills/pixelcraft-web/references/canvas-and-node-editors.md +157 -0
- package/skills/pixelcraft-web/references/clojurescript.md +88 -0
- package/skills/pixelcraft-web/references/component-systems.md +102 -0
- package/skills/pixelcraft-web/references/component-testing.md +170 -0
- package/skills/pixelcraft-web/references/creative-effects.md +59 -0
- package/skills/pixelcraft-web/references/creative-runtime.md +34 -0
- package/skills/pixelcraft-web/references/elm.md +53 -0
- package/skills/pixelcraft-web/references/enterprise-data-ui.md +138 -0
- package/skills/pixelcraft-web/references/file-upload-media-ui.md +82 -0
- package/skills/pixelcraft-web/references/forms-validation.md +123 -0
- package/skills/pixelcraft-web/references/fsharp-fable.md +54 -0
- package/skills/pixelcraft-web/references/gsap.md +102 -0
- package/skills/pixelcraft-web/references/html-css.md +220 -0
- package/skills/pixelcraft-web/references/htmx-alpine.md +103 -0
- package/skills/pixelcraft-web/references/i18n-engineering.md +106 -0
- package/skills/pixelcraft-web/references/interaction-and-search-primitives.md +196 -0
- package/skills/pixelcraft-web/references/java-web.md +61 -0
- package/skills/pixelcraft-web/references/kotlin-web.md +57 -0
- package/skills/pixelcraft-web/references/leptos-yew.md +97 -0
- package/skills/pixelcraft-web/references/lit-web-components.md +63 -0
- package/skills/pixelcraft-web/references/local-first-sync.md +105 -0
- package/skills/pixelcraft-web/references/media-players.md +104 -0
- package/skills/pixelcraft-web/references/motion-react.md +96 -0
- package/skills/pixelcraft-web/references/motion-recipes.md +82 -0
- package/skills/pixelcraft-web/references/preact-fresh-hono.md +111 -0
- package/skills/pixelcraft-web/references/pwa.md +230 -0
- package/skills/pixelcraft-web/references/qwik.md +94 -0
- package/skills/pixelcraft-web/references/r3f-integration.md +69 -0
- package/skills/pixelcraft-web/references/react-next.md +168 -0
- package/skills/pixelcraft-web/references/rendering-choice.md +63 -0
- package/skills/pixelcraft-web/references/rendering-performance.md +80 -0
- package/skills/pixelcraft-web/references/rich-text-and-code-editors.md +220 -0
- package/skills/pixelcraft-web/references/rive-lottie.md +73 -0
- package/skills/pixelcraft-web/references/scala-laminar.md +53 -0
- package/skills/pixelcraft-web/references/scene-architecture.md +132 -0
- package/skills/pixelcraft-web/references/server-rendered.md +114 -0
- package/skills/pixelcraft-web/references/shader-workflow.md +77 -0
- package/skills/pixelcraft-web/references/smooth-scroll.md +58 -0
- package/skills/pixelcraft-web/references/solid.md +111 -0
- package/skills/pixelcraft-web/references/state-architecture.md +107 -0
- package/skills/pixelcraft-web/references/styling-ecosystem.md +273 -0
- package/skills/pixelcraft-web/references/svelte.md +111 -0
- package/skills/pixelcraft-web/references/tailwind.md +99 -0
- package/skills/pixelcraft-web/references/video-media.md +69 -0
- package/skills/pixelcraft-web/references/vue-nuxt.md +86 -0
- package/skills/pixelcraft-web/references/web-3d-engines.md +97 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Terminal protocols & capability detection
|
|
2
|
+
|
|
3
|
+
Modern terminal emulators (Ghostty, Kitty, WezTerm, Alacritty, iTerm2, Windows Terminal, foot) support rich protocols that eliminate flicker, unlock crisp keyboard shortcuts, and enable graphics and clipboard integration over SSH. Every protocol is **progressive enhancement**—never assume universal emulator or multiplexer (`tmux`/`screen`) support.
|
|
4
|
+
|
|
5
|
+
## Modern terminal protocols
|
|
6
|
+
|
|
7
|
+
| Protocol | Sequence / contract | Purpose | Mandatory fallback & safety rule |
|
|
8
|
+
|---|---|---|---|
|
|
9
|
+
| **DEC Mode 2004** (Bracketed Paste) | Enable: `ESC [ ? 2004 h` · Disable: `ESC [ ? 2004 l` · Paste payload wrapped in `ESC [ 200 ~ ... ESC [ 201 ~` | Distinguishes pasted multi-line text from typed keystrokes. | **Mandatory** whenever reading raw/interactive input so pasting multi-line configs/SQL/commands never fires each newline as an accidental `Enter` submit! Always disable (`?2004l`) on exit. |
|
|
10
|
+
| **DEC Mode 2026** (Synchronized Output) | Begin: `ESC [ ? 2026 h` · End: `ESC [ ? 2026 l` (query via DECRQM `ESC [ ? 2026 $ p`) | Batches screen updates atomically so the terminal renders one complete frame with zero mid-frame tearing/flicker. | Safely ignored by older terminals; **always** emit `ESC [ ? 2026 l` on exit/panic so terminals never freeze waiting for end-of-frame. |
|
|
11
|
+
| **Graphics Protocols** (Kitty / Sixel / iTerm2) | Kitty `APC G ... ST` · Sixel `DCS q ... ST` · iTerm2 `OSC 1337 ; File=... BEL/ST` | Renders crisp thumbnails, charts, or previews inside character cells. | Probe support (or use `ratatui-image` / Chafa-style detection); degrade cleanly to **Unicode halfblocks (`▀`/`▄`)**, Braille, or an explicit text placeholder (`[Image: diagram.png]`) inside unsupported terminals or un-configured `tmux`/SSH. |
|
|
12
|
+
| **OSC 8 Hyperlinks** | `OSC 8 ; params ; URI ST label OSC 8 ; ; ST` | Makes labels clickable links in supporting terminals without cluttering narrow columns. | Never hide essential URLs behind `"click here"`—keep link text self-explanatory or print the raw URL in plain/`!isatty` output so piped logs and non-OSC-8 terminals still have the destination. |
|
|
13
|
+
| **Kitty Keyboard Protocol (`CSI u`)** | Push flags: `ESC [ > flags u` · Pop on exit: `ESC [ < u` | Disambiguates `Ctrl+I` vs `Tab`, `Ctrl+M` vs `Enter`, `Ctrl+[` vs `Esc`, `Shift+Enter`, and key release/repeat events. | Negotiate cleanly and **always pop (`ESC [ < u`) on exit/panic**; maintain legacy ANSI keybinding fallbacks so users on older terminals or basic SSH sessions can complete every task. |
|
|
14
|
+
| **OSC 52 Clipboard** | `OSC 52 ; c ; <base64-utf8> ST` | Copies text directly to the user's local clipboard even across remote SSH and `tmux` (`set-clipboard on`) without `pbcopy`/`xclip`/`wl-copy`. | Pair with local OS clipboard when running locally, respect emulator payload caps (~100 KB), handle security denial silently, and show visible copy confirmation. |
|
|
15
|
+
| **OSC 9;4 Progress** | `OSC 9 ; 4 ; <state> ; <0-100> ST` (`0`=clear, `1`=normal, `2`=error, `3`=indeterminate, `4`=paused) | Surfaces native taskbar/tab progress bars in Windows Terminal, Ghostty, WezTerm, and iTerm2. | Emit **only** to an interactive TTY and **always emit `state=0` (clear)** on completion, error exit, or `SIGINT` so stuck progress indicators never linger on the terminal tab. |
|
|
16
|
+
|
|
17
|
+
## Grapheme-cluster column width (`UAX #29`) & `--ascii` fallback
|
|
18
|
+
|
|
19
|
+
**Never** compute terminal column width with `.length`, `.len()`, `len()`, or UTF-16 code units—every border and table column will misalign on real international text:
|
|
20
|
+
|
|
21
|
+
- Segment by **Unicode Standard Annex #29 (`UAX #29`) extended grapheme clusters** + **East Asian Width**:
|
|
22
|
+
- **CJK ideographs** (`日本語` / `中文`) = **`2` cols** per character;
|
|
23
|
+
- **ZWJ Emoji sequences** (`👨👩👧👦`) = **`2` cols** total (not 8 or 11);
|
|
24
|
+
- **Variation Selector-16 (`VS16`, `U+FE0F`)** (`⚠️`) = **`2` cols**;
|
|
25
|
+
- **Vietnamese & combining diacritics** (e.g., `Nguyễn` NFD combining marks `U+0300`–`U+036F`) = **`0` extra cols**.
|
|
26
|
+
- Use proven width libraries per runtime: `unicode-segmentation` + `unicode-width` (Rust), `rivo/uniseg` / `go-runewidth` / `lipgloss.Width` (Go), `Intl.Segmenter` + `string-width` (Node/Bun), and `wcwidth` / `rich.cells.cell_len` (Python).
|
|
27
|
+
- **`--ascii` & non-UTF-8 locale fallback**: when `--ascii` is passed, `TERM=dumb`, or `LC_ALL`/`LANG` is `C`/`POSIX` (non-UTF-8), replace Unicode box-drawing (`╭─╮` → `+--+`), Braille spinners (`⠋` → `- \ | /`), and status glyphs (`✔`/`✖` → `[OK]`/`[ERR]`).
|
|
28
|
+
|
|
29
|
+
## 6-step panic & signal terminal restoration hook
|
|
30
|
+
|
|
31
|
+
Register a teardown hook covering normal exit, **`SIGINT`**, **`SIGTERM`**, **`SIGHUP`**, and uncaught **panics/exceptions** that executes all 6 restoration steps in order before writing any crash traceback:
|
|
32
|
+
|
|
33
|
+
1. **Leave alternate screen**: `\x1b[?1049l`
|
|
34
|
+
2. **Disable mouse tracking**: `\x1b[?1000l\x1b[?1002l\x1b[?1003l\x1b[?1006l`
|
|
35
|
+
3. **Disable bracketed paste**: `\x1b[?2004l`
|
|
36
|
+
4. **Disable synchronized output**: `\x1b[?2026l` (and clear `OSC 9;4` progress `\x1b]9;4;0;\x1b\\`)
|
|
37
|
+
5. **Pop Kitty keyboard protocol flags**: `\x1b[<u`
|
|
38
|
+
6. **Show cursor & exit raw mode**: `\x1b[?25h` + restore cooked `termios` / console mode.
|
|
39
|
+
|
|
40
|
+
## Capability, stream hygiene, `SIGPIPE`, color tiers & `--plain` screen-reader mode
|
|
41
|
+
|
|
42
|
+
| Signal / Condition | Required behavior |
|
|
43
|
+
|---|---|
|
|
44
|
+
| **Startup latency & live resize (`80×24` + `120×36`)** | Boot in **`< 200 ms`** (`hyperfine`/`time`) for compact CLIs/TUIs via lazy subcommand/plugin imports; reflow cleanly with **zero tearing/flicker** across **`80×24`** and **`120×36`** live `SIGWINCH` resizes. |
|
|
45
|
+
| **Stream separation (`stdout` vs `stderr`)** | Interactive TUI chrome, spinners, progress bars, and human warnings go strictly to `stderr` (or alternate screen only when `isatty(stdout)`). Machine-parseable payloads (`--json`, `--plain`, CSV) go strictly to `stdout`. |
|
|
46
|
+
| **Downstream pipe close (`SIGPIPE` / `EPIPE` / `BrokenPipeError`)** | Piping into `head -n 5` or `jq` closes `stdout` early. Catch `BrokenPipe` / `EPIPE` / `BrokenPipeError` and exit `0` **silently**—never print uncaught stack traces or panic dumps! |
|
|
47
|
+
| **`NO_COLOR=1` / `TERM=dumb` / `CI=true` / `--plain` screen-reader mode** | Strip ANSI colors (`NO_COLOR=1`), disable CSI/OSC escapes (`TERM=dumb`), disable interactive prompts (`CI=true`), and provide **`--plain`** (linear, non-animated, cursor-stable text output with explicit `[OK]`/`[ERR]` markers so terminal screen readers like NVDA, VoiceOver, and TDSR/Fenrir are never spammed by redrawing spinners). |
|
|
48
|
+
| **`16-color` + `256-color` + truecolor themes** | **Never** hardcode `#ffffff` assuming a black terminal or `#000000` assuming a white terminal. Verify graceful downgrade across `COLORTERM=truecolor`, `TERM=xterm-256color` (`256-color` palette), and **`16-color` dark + light ANSI themes**. |
|
|
49
|
+
|
|
50
|
+
## CLI & TUI distribution, `SHA-256` integrity & deliverables
|
|
51
|
+
|
|
52
|
+
Ship production terminal tools with complete operator ergonomics:
|
|
53
|
+
- **Standard flags & semantic exit codes**: `-h`/`--help`, `-V`/`--version`, `--json`, **`--plain`** (screen-reader non-animated mode), `--no-color`, `--ascii`; exit **`0`** on success, **`1`** on runtime/API failure, **`2`** on CLI usage/flag error, and **`130`** on `SIGINT` (`Ctrl+C`).
|
|
54
|
+
- **Shell completions & `man` page**: generate completions for **`bash`, `zsh`, `fish`, and `pwsh`** (`mycli completions <shell>`) plus a `roff` **`man` page** (`man 1 mycli`).
|
|
55
|
+
- **Checksums, signatures & clean uninstall**: publish **`SHA-256` (`SHA256SUMS`) checksums and cryptographic release signatures** (`cosign` / GPG / GitHub Attestations) across **Homebrew**, **Winget**, **Scoop**, **Cargo**, **npm**, or **PyPI**, paired with **documented uninstall instructions** removing binaries, completions, caches, and config files cleanly.
|
|
56
|
+
- **Required deliverable captures**: attach **`asciinema` (`.cast`) or Charm `VHS` recordings** plus rendered verification across **`iTerm2` / `Terminal.app`, `Windows Terminal`, `GNOME Terminal`, `tmux`, and `SSH`**.
|
|
57
|
+
|
|
58
|
+
## Do/don't pairs
|
|
59
|
+
|
|
60
|
+
| Do | Don't |
|
|
61
|
+
|---|---|
|
|
62
|
+
| Boot in `< 200 ms` (`hyperfine`), enable `?2004h` Bracketed Paste, and run the 6-step teardown on panic/signal | Ship a `1.5 s` CLI cold start, fire `Enter` on multi-line paste, or leave `?1049h`/`?1003h`/`CSI u` stuck after a crash |
|
|
63
|
+
| Measure columns with `UAX #29` grapheme + East Asian Width + `--ascii` fallback across `80×24` and `120×36` live resizes | Align borders with `.length`/`.len()`, breaking CJK, `👨👩👧👦`, `⚠️`, and Vietnamese diacritics |
|
|
64
|
+
| Route spinners to `stderr`, JSON/plain data to `stdout`, support `--plain` screen-reader mode, and exit silently on `SIGPIPE` | Spam screen readers with `60 Hz` Braille spinner redraws or dump a stack trace on `mycli list \| head -n 5` |
|
|
65
|
+
| Verify `16-color` (dark+light), `256-color`, and `NO_COLOR=1` legibility | Hardcode `#ffffff` text invisible on Solarized/macOS Light terminals |
|
|
66
|
+
| Ship `--help`, `--version`, `0/1/2/130` exit codes, completions, `man` page, `SHA-256` checksums/signatures, and uninstall docs | Exit `0` on errors or ship unsigned archives with no checksums or uninstall cleanup |
|
|
67
|
+
|
|
68
|
+
## Verification commands
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
# Benchmark < 200ms startup latency and test capability degradation / SIGPIPE:
|
|
72
|
+
hyperfine --warmup 3 'your-cli --version'
|
|
73
|
+
NO_COLOR=1 your-cli --help
|
|
74
|
+
TERM=xterm-256color your-cli --help
|
|
75
|
+
TERM=dumb your-cli --plain | head -n 5
|
|
76
|
+
# Verify stdout remains free of ANSI escape sequences when piped:
|
|
77
|
+
if your-cli --plain | LC_ALL=C grep -q $'\x1b\['; then echo "FAIL: ANSI leaked"; exit 1; fi
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Piped escape, `SHA-256` checksum, and `head -n 5` `SIGPIPE` checks provide deterministic `static`/output evidence. Record **`hyperfine`/`time` (`< 200 ms`)**, **`asciinema`/`VHS` walkthroughs**, `80×24` + `120×36` live resize, `16-color`/`256-color`/`NO_COLOR=1`/`--plain` modes, and 6-step panic restoration across **`iTerm2`/`Terminal.app`, `Windows Terminal`, `GNOME Terminal`, `tmux`, and `SSH`** (`rendered`; label unavailable host OS emulators `not-checked`).
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Textual (Python)
|
|
2
|
+
|
|
3
|
+
## Token mapping & Textual v1–v3+ `Theme` API
|
|
4
|
+
|
|
5
|
+
Textual CSS (TCSS) uses **character cell units** (`1`, `2`, `1fr`, `50%`, `w`, `h`)—**never `px`** (pixel units are invalid in TCSS). Register semantic themes via the **`Theme`** API (`app.register_theme(...)`) and reference built-in semantic design variables (`$primary`, `$surface`, `$panel`, `$error`, `$text-muted`) across TCSS:
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
from textual.app import App, ComposeResult
|
|
9
|
+
from textual.theme import Theme
|
|
10
|
+
|
|
11
|
+
PC_THEME = Theme(
|
|
12
|
+
name="pixelcraft-dark",
|
|
13
|
+
primary="#5BB2FF",
|
|
14
|
+
secondary="#7EE787",
|
|
15
|
+
accent="#D2A8FF",
|
|
16
|
+
foreground="#E6EDF3",
|
|
17
|
+
background="#0D1117",
|
|
18
|
+
surface="#161B22",
|
|
19
|
+
panel="#21262D",
|
|
20
|
+
error="#F85149",
|
|
21
|
+
dark=True,
|
|
22
|
+
)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```tcss
|
|
26
|
+
/* Integer cell units only — never `px` */
|
|
27
|
+
$space-control-inline: 2;
|
|
28
|
+
|
|
29
|
+
Button.-primary {
|
|
30
|
+
background: $primary;
|
|
31
|
+
padding: 0 $space-control-inline;
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Register the theme in `on_mount` (`self.register_theme(PC_THEME); self.theme = "pixelcraft-dark"`) so users can switch cleanly between light, dark, and high-contrast themes (including `textual-ansi` for 16-color/low-capability terminals).
|
|
36
|
+
|
|
37
|
+
## Layout, `CommandPalette`, & responsive idioms
|
|
38
|
+
|
|
39
|
+
Use `Vertical`, `Horizontal`, `Grid`, `Container`, `TabbedContent`, `DataTable`, `Dock`, fractional (`1fr`) and cell sizing, and terminal-size CSS/reactive breakpoints. Test at `80×24` minimum and define which secondary pane collapses first.
|
|
40
|
+
|
|
41
|
+
Expose keyboard-first command discovery through Textual's built-in **`CommandPalette`** (`Ctrl+P` by default) by adding custom `Provider` classes (`search` yielding `Hit` results) alongside concise `BINDINGS` displayed in `Footer`.
|
|
42
|
+
|
|
43
|
+
## Async workers (`@work(exclusive=True)`) & states idiom
|
|
44
|
+
|
|
45
|
+
Never block the Textual asyncio event loop with disk/HTTP calls. Isolate async or blocking work in **`@work`** methods with explicit `exclusive=True` (automatically cancelling superseded refreshes when the user changes filters or navigates) and `thread=True` for blocking SDK calls:
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
from textual import work
|
|
49
|
+
from textual.worker import get_current_worker
|
|
50
|
+
|
|
51
|
+
class InvoiceApp(App):
|
|
52
|
+
@work(exclusive=True, thread=True)
|
|
53
|
+
def load_invoices(self, query: str) -> None:
|
|
54
|
+
worker = get_current_worker()
|
|
55
|
+
rows = fetch_blocking(query)
|
|
56
|
+
if not worker.is_cancelled:
|
|
57
|
+
self.call_from_thread(self.apply_rows, rows)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Handle loading (`LoadingIndicator`), empty, error, offline, and worker-cancelled states visibly in the widget tree; preserve user input across `push_screen` / `pop_screen` modal dialogs and terminal resizes.
|
|
61
|
+
|
|
62
|
+
## `UAX #29` width (`wcwidth`/`rich.cells`), Bracketed Paste, `OSC 52` & teardown
|
|
63
|
+
|
|
64
|
+
- **Grapheme width & `--ascii`**: never compute terminal column alignment with Python `len(s)`—use **`rich.cells.cell_len`** or **`wcwidth.wcswidth`** so CJK (`2` cols), ZWJ emoji (`👨👩👧👦` = `2` cols), `VS16` (`⚠️` = `2` cols), and Vietnamese combining diacritics (`0` extra cols) align cleanly; provide `textual-ansi` (16-color dark+light safe) and ASCII borders (`border: ascii`) when `--ascii`, `TERM=dumb`, or non-UTF-8 locale is set.
|
|
65
|
+
- **Bracketed Paste (`DECSET 2004`) & `OSC 52` clipboard**: handle Textual's **`events.Paste`** (`?2004h`) in `Input` / `TextArea` / custom widgets so multi-line pastes never fire accidental `Enter` submissions, and call **`self.copy_to_clipboard(text)`** (which emits **`OSC 52`** automatically over remote SSH/`tmux`).
|
|
66
|
+
- **Stream hygiene, `BrokenPipeError`, & 6-step crash restoration**: only boot the alternate-screen Textual app when `sys.stdout.isatty()`; for `--json`/`--plain` CLI modes, write strictly to `sys.stdout`, catch **`BrokenPipeError`** (`os.dup2(os.open(os.devnull, os.O_WRONLY), sys.stdout.fileno())` + `sys.exit(0)` so `| head -n 5` exits silently without a Python traceback!), and ensure `SIGINT`/`SIGTERM`/`SIGHUP` + uncaught exception hooks complete the 6-step terminal reset (`?1049l`, mouse `?1000l/?1002l/?1003l/?1006l`, `?2004l`, `?2026l`, `\x1b[<u`, `?25h` + raw mode exit—see [terminal-protocols.md](terminal-protocols.md)).
|
|
67
|
+
- **Accessibility & CLI distribution**: ensure every task works strictly via keyboard (`Tab`/`Shift+Tab`, arrow keys, `Enter`, `Esc`, `CommandPalette`), pair colors with plain-text state markers (`[ERR]`, `[*]`), and ship `--help`, `--version`, `0/1/2/130` exit codes, `bash`/`zsh`/`fish`/`pwsh` completions (via Typer/Click/argcomplete), a `man` page, and `uv tool` / Homebrew / Scoop / Winget packaging.
|
|
68
|
+
|
|
69
|
+
## Headless verification (`App.run_test()` / `Pilot` & SVG snapshots)
|
|
70
|
+
|
|
71
|
+
Drive real keyboard workflows and narrow-terminal resize checks deterministically using **`App.run_test()`** and **`Pilot`**, paired with **`pytest-textual-snapshot`** (`snap_compare`) SVG snapshots:
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
import pytest
|
|
75
|
+
|
|
76
|
+
@pytest.mark.asyncio
|
|
77
|
+
async def test_narrow_keyboard_flow():
|
|
78
|
+
app = InvoiceApp()
|
|
79
|
+
async with app.run_test(size=(80, 24)) as pilot:
|
|
80
|
+
await pilot.press("ctrl+p")
|
|
81
|
+
await pilot.press("escape")
|
|
82
|
+
assert app.focused is not None
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Do/don't pairs
|
|
86
|
+
|
|
87
|
+
| Do | Don't |
|
|
88
|
+
|---|---|
|
|
89
|
+
| Use cell units (`padding: 0 2;`), registered `Theme` vars, and `textual-ansi` / `border: ascii` fallbacks | Write web pixel units (`4px`) or hardcode `#ffffff` unreadable on light 16-color terminals |
|
|
90
|
+
| Measure columns with `rich.cells.cell_len` / `wcwidth`, handle `events.Paste`, and use `copy_to_clipboard` (`OSC 52`) | Use Python `len(s)` on CJK/`👨👩👧👦`/Vietnamese text or let pasted newlines fire `Enter` submits |
|
|
91
|
+
| Use `@work(exclusive=True)`, catch `BrokenPipeError` on `--plain`/`--json`, and verify 6-step signal reset | Block asyncio, dump `BrokenPipeError` tracebacks on `\| head -n 5`, or leave `?1049h`/`?1003h` stuck |
|
|
92
|
+
| Test keyboard flows with `App.run_test(size=(80, 24))` + `Pilot` & `snap_compare` | Rely only on manually glancing at one wide developer terminal |
|
|
93
|
+
| Pair `BINDINGS` + `Footer` + `CommandPalette` + CLI completions (`bash`/`zsh`/`fish`/`pwsh`) + `man` page | Hide essential commands behind mouse-only clicks or ship without `--version`/completions |
|
|
94
|
+
|
|
95
|
+
## Known traps
|
|
96
|
+
|
|
97
|
+
Invalid CSS `px` units in TCSS, blocking the asyncio loop with synchronous `requests` calls, Python `len()` miscounting CJK/ZWJ/combining marks, `BrokenPipeError` tracebacks on piped `--json` output, focus lost after closing `ModalScreen`, omitting non-interactive CLI fallback when piped in CI.
|
|
98
|
+
|
|
99
|
+
## Verification commands
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
python -m compileall .
|
|
103
|
+
python -m pytest
|
|
104
|
+
NO_COLOR=1 python app.py --help
|
|
105
|
+
python app.py --plain | head -n 5
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
`compileall` and logic tests are `static`; `App.run_test`/`Pilot` and `snap_compare` SVGs verify headless rendering (`rendered` snapshot evidence). Also run in real dark and light terminal emulators at `80×24`, `TERM=dumb`/`NO_COLOR=1`, `--ascii`, multi-line paste, and piped `head -n 5` (`rendered`; label untested terminals `not-checked`).
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pixelcraft-ux
|
|
3
|
+
description: Designs rigorous user experience before and during implementation across any frontend stack. Use for task analysis, JTBD, user flows, information architecture, navigation, forms, passkeys, validation, empty/error/loading/offline and AI/streaming states, feedback timing, perceived performance, cognitive-load reduction, cognitive walkthrough, usability testing, localization-ready UX (i18n, RTL), UX writing, and interaction recovery.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
version: 0.1.0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Pixelcraft UX
|
|
10
|
+
|
|
11
|
+
UX precedes styling. Establish user intent, task sequence, state coverage, and recovery before choosing components or visual decoration.
|
|
12
|
+
|
|
13
|
+
## References
|
|
14
|
+
|
|
15
|
+
- Read [references/flows-ia.md](references/flows-ia.md) for JTBD, task analysis, flow shape, IA depth, entry points, deep links, and navigation conventions.
|
|
16
|
+
- Read [references/cognitive-walkthrough.md](references/cognitive-walkthrough.md) when judging first-use learnability or step-by-step task completion.
|
|
17
|
+
- Read [references/usability-testing.md](references/usability-testing.md) when behavioral uncertainty requires real-user evidence rather than inspection.
|
|
18
|
+
- Read [references/state-matrix.md](references/state-matrix.md) whenever data, network, permission, input, or async behavior exists.
|
|
19
|
+
- Read [references/forms.md](references/forms.md) for labels, validation, input preservation, autofill, paste, mobile keyboards, redundant entry, passkeys, cross-platform `IME` composition `Enter`/`Escape` guards, and error recovery.
|
|
20
|
+
- Read [references/feedback-performance.md](references/feedback-performance.md) for response-time limits, undo/destructive behavior, loading strategy, and perceived performance.
|
|
21
|
+
- Read [references/i18n.md](references/i18n.md) before layout/copy for `+30–40%` prose vs `+50–100%` short-label expansion, `Unicode NFC` & Vietnamese/stacked-diacritic glyph coverage, `IME` safety, RTL, and ICU/MF2 plurals.
|
|
22
|
+
- Read [references/locale-test-matrix.md](references/locale-test-matrix.md) when selecting concrete locales, scripts, fixtures, and rendering evidence for international verification.
|
|
23
|
+
- Read [references/ux-writing.md](references/ux-writing.md) for microcopy, actions, errors, empty states, and tone by mode.
|
|
24
|
+
- Read [references/laws.md](references/laws.md) when applying Hick, Fitts, Jakob, Doherty, recognition-over-recall, and cognitive-load evidence.
|
|
25
|
+
|
|
26
|
+
## Required sequence
|
|
27
|
+
|
|
28
|
+
1. **Define job:** actor, triggering situation, desired outcome, constraints, success signal, frequency, expertise, locale/accessibility needs.
|
|
29
|
+
2. **Map task:** current steps, decision points, interruptions, handoffs, errors, and recovery. Remove steps before decorating them.
|
|
30
|
+
3. **Diverge IA & workflow (greenfield / redesign):** before locking one layout or navigation pattern, compare **2–3 competing flow/IA shapes** (e.g., master-detail workbench vs. stepped drawer vs. inline ledger; single-screen workspace vs. tabbed routes) against step count, context preservation, and recovery cost. Record why the rejected shapes lost. Skip only when existing product IA or an approved spec fixes the flow.
|
|
31
|
+
4. **Walk the task:** use the cognitive-walkthrough contract for first-use intent, visibility, association, and feedback; escalate behavioral uncertainty to real-user evidence instead of inventing validation.
|
|
32
|
+
5. **Complete the mandatory core state matrix:** do not build only the happy path. Explicitly specify and wire every applicable core state: **empty** (first-use + no-results), **loading** (stable skeleton/progress without layout shift), **error** (cause + preserved input + recovery action), **disabled** (why disabled + how to unlock), **offline / degraded network**, **permission / unauthorized**, **long-content / overflow / extreme counts**, and **AI / streaming** (pending, partial tokens, abort/stop, citation provenance, side-effect approval).
|
|
33
|
+
6. **Design interaction copy and feedback:** concrete domain verbs, response-time budgets, progress, undo/recovery; zero AI marketing clichés (`references/ux-writing.md`).
|
|
34
|
+
7. **Reduce cognitive load:** smart defaults, recognition over recall, progressive disclosure, grouped decisions.
|
|
35
|
+
8. **Apply logical layout, expansion budgets & `IME`/`NFC` safety by default:** use logical directional properties (`inline-start`/`inline-end`, leading/trailing), budget `+30–40%` prose and `+50–100%` short-label expansion, normalize `Unicode NFC` diacritics with verified glyph coverage (`ư, ơ, ệ`), guard `Enter`/`Escape` during active `IME` composition, and format dates/numbers/plurals via locale APIs **even on English-first apps**.
|
|
36
|
+
9. **Validate against platform conventions & record risks:** back/escape, scroll restoration, shortcuts, gestures, focus/controller behavior, and unresolved UX risks with evidence labels.
|
|
37
|
+
|
|
38
|
+
## Non-negotiable checks & anti-slop guard
|
|
39
|
+
|
|
40
|
+
- Do not ask for information already available, inferable, previously entered, or low-value at the moment of use.
|
|
41
|
+
- Preserve user input across validation, navigation, authentication expiry, network failure, and accidental refresh where feasible.
|
|
42
|
+
- Guard `Enter`/`Escape` key handlers on search bars, chat composers, inline editors, and dialogs against active `IME` composition (`isComposing`, `markedTextRange`, `composition != null`, `hasMarkedText`).
|
|
43
|
+
- Every destructive action provides proportional undo, confirmation, or explicit irreversibility friction.
|
|
44
|
+
- Every async action exposes pending/success/failure/cancellation/retry semantics.
|
|
45
|
+
- Navigation state survives back/forward, refresh, deep link, logout/login, and app relaunch as appropriate.
|
|
46
|
+
- Primary tasks are operable without hover, memory of hidden commands, perfect network, or precise pointer control.
|
|
47
|
+
- **Anti-slop UX guard:** never ship a happy-path-only wireframe, dead-end `"No items yet"` empty state, `"Oops! Something went wrong"` error toast, vague `"Submit"`/`"Learn more"` buttons, AI hype microcopy, or half-wired forms that wipe entered values on validation failure.
|
|
48
|
+
|
|
49
|
+
## Pre-submit checklist
|
|
50
|
+
|
|
51
|
+
- [ ] 2–3 competing IA/workflow shapes compared and recorded for undecided greenfield/redesign flows (or existing/approved IA cited).
|
|
52
|
+
- [ ] All applicable core states specified and wired: `empty`, `loading`, `error`, `disabled`, `offline`, `permission`, `long-content`, and `AI/streaming`.
|
|
53
|
+
- [ ] User input preserved across errors and retries; `Enter`/`Escape` guarded during active `IME` composition; destructive actions have proportionate undo or confirmation.
|
|
54
|
+
- [ ] Logical layout direction (`inline-start`/leading), `+50–100%` short-label / `+30–40%` prose expansion, `Unicode NFC` diacritic glyph integrity, and locale-aware formatting applied.
|
|
55
|
+
- [ ] All CTAs, headings, errors, and empty states use concrete domain nouns/verbs with zero AI marketing clichés or fake proof.
|
|
56
|
+
- [ ] Primary task verified without hover, via keyboard/platform back-escape, and labeled honestly (`rendered`, `static`, `model-judgment`, or `not-checked`).
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Cognitive walkthrough
|
|
2
|
+
|
|
3
|
+
Use this reference to evaluate whether a first-time user can learn and complete a task without training or hidden knowledge. It is an inspection method, not a substitute for observing real users.
|
|
4
|
+
|
|
5
|
+
## Setup contract
|
|
6
|
+
|
|
7
|
+
Before walking steps, record:
|
|
8
|
+
|
|
9
|
+
1. **Actor/persona hypothesis:** role, expertise, language/locale, accessibility needs, device/input modality, interruption context.
|
|
10
|
+
2. **Task:** exact goal in user terms, not a feature name.
|
|
11
|
+
3. **Correct action sequence:** the shortest successful path, including decisions, system feedback, recovery, and completion.
|
|
12
|
+
4. **Evidence boundary:** prototype, implementation, static specification, or rendered surface.
|
|
13
|
+
|
|
14
|
+
Do not use a persona as proof of user behavior. Label it a hypothesis and include evidence class (`user-provided`, `analytics/research`, `assumption`, or `unknown`).
|
|
15
|
+
|
|
16
|
+
## Stepwise inspection
|
|
17
|
+
|
|
18
|
+
For every action in the correct sequence, answer four questions:
|
|
19
|
+
|
|
20
|
+
| Question | Failure examples |
|
|
21
|
+
|---|---|
|
|
22
|
+
| Will the user try to achieve the right effect? | user does not know this step is necessary; feature framing does not match their goal |
|
|
23
|
+
| Will the user notice the correct action/control? | hidden navigation, ambiguous icon, low contrast, action outside expected scan/input region |
|
|
24
|
+
| Will the user associate the action with the intended effect? | label describes implementation rather than outcome; control placement contradicts mental model |
|
|
25
|
+
| If the action is taken, will feedback show progress toward the goal? | no acknowledgment, delayed/ambiguous state, success/error unclear, input lost |
|
|
26
|
+
|
|
27
|
+
A “yes” must cite observable UI evidence: visible label, proximity, conventional placement, feedback text/state, or platform idiom. “Users will figure it out” is not evidence.
|
|
28
|
+
|
|
29
|
+
## Walkthrough record
|
|
30
|
+
|
|
31
|
+
```markdown
|
|
32
|
+
| Step | User goal at step | Correct action | Q1 intent | Q2 notice | Q3 association | Q4 feedback | Finding/evidence |
|
|
33
|
+
|---|---|---|---|---|---|---|---|
|
|
34
|
+
| 1 | | | pass/risk/fail/not-checked | | | | |
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Record confidence and evidence label for each important judgment. Distinguish:
|
|
38
|
+
|
|
39
|
+
- **failure:** the interface blocks or misleads the correct action;
|
|
40
|
+
- **risk:** ambiguity depends on knowledge/context not yet validated;
|
|
41
|
+
- **assumption:** missing persona/task evidence;
|
|
42
|
+
- **positive confirmation:** concrete cue supports learnability.
|
|
43
|
+
|
|
44
|
+
## Required inspection passes
|
|
45
|
+
|
|
46
|
+
Run the walkthrough at least once for:
|
|
47
|
+
|
|
48
|
+
- first use with no prior product knowledge;
|
|
49
|
+
- returning use after interruption where state matters;
|
|
50
|
+
- error/recovery path for the highest-cost failure;
|
|
51
|
+
- accessibility/input-modality path relevant to the audience (keyboard, screen reader, touch, controller, IME/voice where applicable);
|
|
52
|
+
- non-English/RTL or expanded-text path when localization is in scope.
|
|
53
|
+
|
|
54
|
+
For expert/high-frequency interfaces, evaluate both initial learnability and efficient repeated use. Do not excuse a confusing first use solely because training exists unless training is part of the actual product context.
|
|
55
|
+
|
|
56
|
+
## Common failure patterns
|
|
57
|
+
|
|
58
|
+
- actions named after system objects rather than user outcomes;
|
|
59
|
+
- progressive disclosure that hides the only path forward;
|
|
60
|
+
- success feedback identical to neutral state;
|
|
61
|
+
- focus/scroll position moving without explanation;
|
|
62
|
+
- destructive or irreversible consequence revealed only after commitment;
|
|
63
|
+
- required conceptual knowledge present nowhere in the interface or onboarding;
|
|
64
|
+
- recovery path requiring memory of a previous screen;
|
|
65
|
+
- translated text pushing the action outside the visible/focusable region;
|
|
66
|
+
- confirmation dialogs used as a substitute for clear action labeling.
|
|
67
|
+
|
|
68
|
+
## Output and escalation
|
|
69
|
+
|
|
70
|
+
Report blockers/risks in task order with concrete repair suggestions. If the walkthrough depends on uncertain user knowledge, task frequency, domain vocabulary, or environmental constraints, escalate to lightweight usability testing rather than treating model judgment as validation.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Feedback, response time, and perceived performance
|
|
2
|
+
|
|
3
|
+
Evidence: response-time limits, Core Web Vitals (INP / LoAF), streaming UX patterns, and state-hardening practice.
|
|
4
|
+
|
|
5
|
+
## Time budget and INP / LoAF
|
|
6
|
+
|
|
7
|
+
| Elapsed time | UX requirement |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `≤ 100 ms` | Direct manipulation feels instantaneous; press/drag/focus feedback must appear here |
|
|
10
|
+
| `≤ 200 ms` (INP good) | Web **Interaction to Next Paint (INP)** ceiling; inspect **Long Animation Frames (LoAF, > 50 ms)** and yield to the main thread (`scheduler.yield()` / chunked rendering / web workers) before heavy synchronous work blocks paint |
|
|
11
|
+
| `≤ 400 ms` (Doherty) | User momentum stays intact for search, filters, tab switches, and optimistic updates; never insert artificial animation delays |
|
|
12
|
+
| `~1 s` | Flow stays uninterrupted; avoid modal blocking chrome or flashing progress indicators below ~200–300 ms |
|
|
13
|
+
| `> 10 s` | Outer attention boundary; show explicit progress or stage status, cancellation, and whether navigating away cancels work |
|
|
14
|
+
|
|
15
|
+
## Skeleton vs. spinner vs. progress rules
|
|
16
|
+
|
|
17
|
+
Choose the loading pattern by duration and layout predictability—never throw a full-page spinner at every fetch:
|
|
18
|
+
|
|
19
|
+
| Situation | Use | Do not use |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| Fast response (`< 200–300 ms`) | No loader (or subtle pressed state); delay indicator onset to avoid visual flash | Flashing skeleton/spinner that disappears in 1 frame |
|
|
22
|
+
| Structured page/list load (`300 ms – ~3 s`) | **Skeleton** matching real container geometry (`aria-busy="true"`, single polite announcement) | Generic centered spinner that causes severe CLS on hydrate, or skeletons with fake numbers |
|
|
23
|
+
| Single button / inline action | Inline button pending label + spinner inside fixed-width button (`aria-disabled="true"` preserving focus) | Replacing the entire screen with a backdrop overlay |
|
|
24
|
+
| Multi-second upload, export, or batch job (`> 2–3 s`) | **Determinate progress bar** (with bytes/items/step count) + Cancel control | Fake progress bar that stalls at 99% |
|
|
25
|
+
| Indeterminate multi-step backend work | **Stage list** (`Queued → Validating → Indexing`) + Cancel / background notice | Silent frozen button or bare looping spinner with no context |
|
|
26
|
+
|
|
27
|
+
## AI and streaming UX (TTFT vs. completion)
|
|
28
|
+
|
|
29
|
+
LLM and agentic tasks split latency into **Time to First Token (TTFT)** and **Total Completion Time**:
|
|
30
|
+
|
|
31
|
+
- **Acknowledge immediately (`< 100 ms`):** append the user's message optimistically, focus/scroll cleanly, and indicate connection or tool execution before the first token arrives.
|
|
32
|
+
- **Keep reading stable during streaming:** stream into reserved/growing containers without shifting controls above the stream; disable auto-scroll the moment the user scrolls upward and offer a “Jump to latest” control.
|
|
33
|
+
- **Separate thinking/tools from answer:** show tool invocations or reasoning summaries in compact collapsible status blocks so users know progress is real without drowning the final answer.
|
|
34
|
+
- **Make stop/cancel first-class:** stopping mid-stream preserves generated text, stops billing/network traffic, and keeps the input ready for immediate correction.
|
|
35
|
+
|
|
36
|
+
## Optimistic UI and rollback race conditions
|
|
37
|
+
|
|
38
|
+
Optimistic updates improve perceived speed only when reconciliation is race-safe:
|
|
39
|
+
|
|
40
|
+
- **Tag every mutation with a monotonic client token/version** so a slow response from mutation #1 cannot overwrite the newer optimistic state of mutation #2.
|
|
41
|
+
- **Mark unconfirmed state subtly** when financial, collaborative, or offline stakes are high (e.g., pending sync badge).
|
|
42
|
+
- **Preserve user edits on failure:** if an optimistic edit rolls back, do not wipe what the user typed—restore the previous committed value clearly OR keep the failed draft editable with a one-click Retry and an explicit notice explaining what failed.
|
|
43
|
+
- **Guard double-submit & idempotency:** disable duplicate dispatch with an idempotency key while keeping keyboard focus intact.
|
|
44
|
+
|
|
45
|
+
## Destructive feedback and perceived performance
|
|
46
|
+
|
|
47
|
+
- Use **undo** instead of confirmation whenever reversal is cheap and reliable (`Deleted "Q3 Draft" · Undo` toast with generous timeout and keyboard access). Reserve modal confirmation for irreversible, high-cost, ambiguous, or externally visible destruction.
|
|
48
|
+
- Name the exact object and consequence in destructive copy: “Delete 14 invoices” not “Are you sure?”
|
|
49
|
+
- Prioritize primary content/action over decorative media and below-fold assets; reserve media dimensions (`width`/`height`/`aspect-ratio`) to keep CLS near `0`.
|
|
50
|
+
- Measure or inspect the actual interactive path (startup, route transition, INP/LoAF traces, scroll/jank, image decode, API wait). A high synthetic Lighthouse score alone does not prove responsive interaction.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Flows, JTBD, and information architecture
|
|
2
|
+
|
|
3
|
+
Evidence: recognition-over-recall and cognitive-load principles plus platform conventions.
|
|
4
|
+
|
|
5
|
+
## JTBD frame
|
|
6
|
+
|
|
7
|
+
Write: “When `<situation>`, `<actor>` wants to `<progress>` so `<outcome>`, despite `<constraint>`.” Add frequency, urgency, expertise, device/input, locale, accessibility need, and emotional/stakes context. Do not confuse persona demographics with causal context.
|
|
8
|
+
|
|
9
|
+
## Task analysis
|
|
10
|
+
|
|
11
|
+
| Column | Required detail |
|
|
12
|
+
|---|---|
|
|
13
|
+
| trigger | what starts the task; every entry point |
|
|
14
|
+
| goal state | observable success, not UI submission |
|
|
15
|
+
| steps | user decision/action, system work, handoff/wait |
|
|
16
|
+
| knowledge | what must be remembered vs recognized |
|
|
17
|
+
| failure | validation/network/permission/interruption/ambiguity |
|
|
18
|
+
| recovery | undo/retry/edit/cancel/support path |
|
|
19
|
+
|
|
20
|
+
Remove or automate steps before optimizing their visual design. Smart defaults must be reversible and visible.
|
|
21
|
+
|
|
22
|
+
## Flow shape
|
|
23
|
+
|
|
24
|
+
- Count real decision/action steps, not screen count. A one-screen overloaded form can be worse than a short sequence.
|
|
25
|
+
- Keep depth shallow for high-frequency tasks; use progressive disclosure only when the hidden choice is genuinely secondary.
|
|
26
|
+
- Preserve orientation: current position, progress certainty, completion consequence, escape/back behavior.
|
|
27
|
+
- Branch only when answers change later questions. Do not gate optional enhancement behind mandatory account creation or irrelevant choices.
|
|
28
|
+
- End with confirmation that states what happened, what happens next, and the useful next action—not a dead end.
|
|
29
|
+
|
|
30
|
+
## IA checks
|
|
31
|
+
|
|
32
|
+
- Group by user task/domain object, not internal org chart or implementation modules.
|
|
33
|
+
- Labels must be mutually exclusive at the same level; avoid catch-all “More/Other” unless genuinely necessary.
|
|
34
|
+
- Search, browse, filters, recent items, and saved state serve different recall/recognition modes; choose intentionally.
|
|
35
|
+
- Deep links must restore entity, filter/tab/pane, scroll anchor, permission state, and meaningful not-found/error behavior.
|
|
36
|
+
- Every entry point—notification, QR, email, search result, share sheet, CLI/docs link—lands in context rather than dumping users at home.
|
|
37
|
+
|
|
38
|
+
## Platform navigation
|
|
39
|
+
|
|
40
|
+
- Honor platform back: browser history, Android predictive back, iOS edge swipe/navigation back, desktop Escape/close semantics. Never trap or silently discard work.
|
|
41
|
+
- Restore scroll/pagination/selection when returning; reset only when context changed or stale state is unsafe.
|
|
42
|
+
- Desktop/web productivity: document keyboard shortcuts, focus behavior, modified-state semantics, and conflict handling.
|
|
43
|
+
- Mobile: account for one-hand reach, edge gestures, bottom-sheet dismissal, keyboard occlusion, and interruption by calls/notifications.
|
|
44
|
+
- TUI/game/controller: publish navigation model and focus order; do not depend on pointer-only mental models.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Forms
|
|
2
|
+
|
|
3
|
+
Evidence: validation and checkout research, WCAG redundant-entry/accessible-authentication requirements, and input usability guidance.
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
|
|
7
|
+
- One persistent visible label per field. Placeholder is never a label because it disappears, harms recall, and is often low contrast.
|
|
8
|
+
- Ask only for information needed now. Mark optional fields rather than plastering required markers everywhere when most fields are required.
|
|
9
|
+
- When requesting sensitive or unexpected data (phone number, date of birth, government ID), add a one-line inline reason explaining *why* it is needed (e.g., “Used only for courier delivery updates”).
|
|
10
|
+
- On mobile, avoid detouring users onto separate subpages mid-form (e.g., separate address/coupon pages that risk losing scroll or input state); use inline disclosure or a single-step bottom sheet that preserves all entered fields.
|
|
11
|
+
- Group related choices; order by user mental model, not database schema. Use one column in most task flows.
|
|
12
|
+
- Use correct control type: text input vs select vs radio/checkbox/stepper/date picker. Do not force tiny dropdowns for few choices or free text for constrained values.
|
|
13
|
+
- Accept forgiving formats; parse and normalize rather than forcing users to match backend storage.
|
|
14
|
+
- Preserve entered input after errors, navigation, refresh, authentication expiry, and submission failure.
|
|
15
|
+
|
|
16
|
+
## Input semantics and mobile adaptation
|
|
17
|
+
|
|
18
|
+
- Use correct autocomplete/input purpose tokens (`name`, `email`, `tel`, `url`, `postal-code`, payment fields, and `autocomplete="username webauthn"` for passkey conditional UI), input types/modes, virtual keyboard layout, `enterkeyhint` (`search`, `send`, `next`, `done`, `go`), capitalization/autocorrect settings, and paste behavior.
|
|
19
|
+
- Never block paste in email/password/verification/payment fields. Do not require retyping email or other redundant entry unless a security/legal reason exists.
|
|
20
|
+
- Accessible authentication: no cognitive memory test, puzzle, or transcription-only flow; support password managers, paste, passkeys/biometrics (`autocomplete="webauthn"` conditional mediation plus an explicit "Sign in with passkey" button), and magic links where appropriate.
|
|
21
|
+
- Use input masking only when it visibly reduces uncertainty without trapping IMEs/paste/screen readers.
|
|
22
|
+
- Verification codes: allow paste/autofill, do not split focus unpredictably, announce errors accessibly, and preserve countdown/resend state.
|
|
23
|
+
|
|
24
|
+
## Validation timing
|
|
25
|
+
|
|
26
|
+
| Moment | Use for |
|
|
27
|
+
|---|---|
|
|
28
|
+
| while typing | format hinting only when non-disruptive; do not show premature errors |
|
|
29
|
+
| after field completion/blur | invalid format, availability, mismatch, missing required value |
|
|
30
|
+
| on submit | cross-field/server/business-rule validation |
|
|
31
|
+
| after correction | clear error promptly; do not require full resubmission to know it fixed |
|
|
32
|
+
|
|
33
|
+
Do not validate required empty fields aggressively before the user has had a chance to answer. Never disable submit as the only indication of incomplete input; explain missing/invalid fields on attempt.
|
|
34
|
+
|
|
35
|
+
## Error copy and recovery
|
|
36
|
+
|
|
37
|
+
Pattern: `<what is wrong>` + `<what was preserved>` + `<how to fix>`.
|
|
38
|
+
|
|
39
|
+
- Bad: “Invalid input.” Better: “Enter the expiry month as two digits, for example 09. Your other payment details are unchanged.”
|
|
40
|
+
- Put messages adjacent to fields and provide an error summary for long/complex forms; moving focus must be deliberate and accessible.
|
|
41
|
+
- Use forgiving constraints before validation. A date picker, mask, or autocomplete is often prevention; validation is the fallback.
|
|
42
|
+
- Destructive form reset/cancel must distinguish discard from close/back and protect entered work.
|
|
43
|
+
|
|
44
|
+
## Input-type and autocomplete matrix
|
|
45
|
+
|
|
46
|
+
Choose semantics before layout:
|
|
47
|
+
|
|
48
|
+
| Data | Input/control posture | Formatting behavior |
|
|
49
|
+
|---|---|---|
|
|
50
|
+
| email | email semantics; `autocomplete="email"`; `enterkeyhint="next"` or `"done"`; paste allowed | do not reject valid internationalized/plus-address forms because they look unusual; trim only insignificant outer whitespace |
|
|
51
|
+
| sign-in username / passkey | `autocomplete="username webauthn"` for conditional passkey autofill + explicit passkey button fallback | support password managers and WebAuthn conditional mediation without hiding fallback auth |
|
|
52
|
+
| search / chat composer | `type="search"` + `enterkeyhint="search"` (or `enterkeyhint="send"` for chat input) | match mobile virtual keyboard action key to actual submit/next behavior |
|
|
53
|
+
| telephone | telephone semantics/input mode; `tel` autocomplete | accept grouping punctuation/spaces; normalize internally; never assume one national format without locale scope |
|
|
54
|
+
| URL | URL semantics/input mode; paste allowed | accept bare host only if product explicitly supports normalization; explain final normalization |
|
|
55
|
+
| postal code | postal-code autocomplete; text input, not number | preserve leading zeroes/spaces/case; validate by selected country/region only when known |
|
|
56
|
+
| payment card/expiry/CVC | correct payment autocomplete/input mode; numeric keyboard where appropriate | mask grouping visibly; tolerant spaces; never alter paste ordering or block password-manager/autofill behavior |
|
|
57
|
+
| name/address | full granular autocomplete tokens where platform supports them | do not force ASCII-only or given/family-name structure globally; preserve user spelling exactly |
|
|
58
|
+
| verification code | one-time-code semantics where supported; single coherent field or controlled segmented behavior | paste/autofill must fill the complete code; do not move focus unpredictably or lose digits during IME/paste |
|
|
59
|
+
| date/time/currency/number | constrained picker/stepper/input mode appropriate to locale and precision | parse locale-aware user input where feasible; store exact semantic value separately from display string |
|
|
60
|
+
|
|
61
|
+
`type=number` is not a substitute for validation. It can reject leading zeros, expose steppers users do not need, and mishandle localized decimal/grouping input. Use text input plus input mode/pattern behavior when identifiers are numeric strings rather than quantities.
|
|
62
|
+
|
|
63
|
+
## Masking rules
|
|
64
|
+
|
|
65
|
+
Use input masks only when they reduce uncertainty more than they constrain input:
|
|
66
|
+
|
|
67
|
+
- show expected grouping, not hidden enforcement;
|
|
68
|
+
- preserve cursor position predictably during correction/paste;
|
|
69
|
+
- accept unmasked pasted values and normalize them;
|
|
70
|
+
- never trap IME composition or screen-reader announcements;
|
|
71
|
+
- expose the mask/format in persistent hint text when failure is costly;
|
|
72
|
+
- validate the semantic value, not the visual mask;
|
|
73
|
+
- provide a plain-text fallback when international variation or assistive input makes the mask unreliable.
|
|
74
|
+
|
|
75
|
+
Do not use masks for names, free-form addresses, globally variable phone formats, or data whose valid structure is unknown.
|
|
76
|
+
|
|
77
|
+
## Adaptive validation behavior
|
|
78
|
+
|
|
79
|
+
Validation timing adapts to correction state:
|
|
80
|
+
|
|
81
|
+
1. Initial entry: avoid premature required/format errors while the user is still composing.
|
|
82
|
+
2. Commit/blur: validate field-level format/completeness when enough input exists to judge.
|
|
83
|
+
3. Submit attempt: run cross-field/business/server validation and preserve all input.
|
|
84
|
+
4. Correction: revalidate the corrected field promptly; clear resolved errors without requiring full form resubmission.
|
|
85
|
+
5. Server rejection: map the failure to the responsible field when possible, keep a summary for complex forms, and explain what was preserved.
|
|
86
|
+
6. Async availability/uniqueness: show pending state, stale-response protection, cancellation behavior, and failure-to-verify separately from invalid input.
|
|
87
|
+
|
|
88
|
+
Do not enable submit but silently ignore clicks, and do not disable submit as the only explanation. On attempted submit, summarize all material missing/invalid fields without overwhelming the user with redundant live announcements.
|
|
89
|
+
|
|
90
|
+
## Error summary and focus behavior
|
|
91
|
+
|
|
92
|
+
For long or complex forms:
|
|
93
|
+
|
|
94
|
+
- place an error summary near the top/result of the submission attempt and field-level messages adjacent to their controls;
|
|
95
|
+
- move focus deliberately to the summary or first actionable error according to platform convention; never move focus on every keystroke;
|
|
96
|
+
- summary entries link/navigate to the actual controls where supported and preserve scroll/context;
|
|
97
|
+
- use wording that identifies the field and correction, not a generic “error occurred”;
|
|
98
|
+
- expose summary/status through platform accessibility semantics without repeated live-region noise;
|
|
99
|
+
- after correction, remove stale summary entries or explain that revalidation/submission is required.
|
|
100
|
+
|
|
101
|
+
Focus movement is a context change. Do not use it as a substitute for visible persistent messages.
|
|
102
|
+
|
|
103
|
+
## Cross-platform IME composition guard & `Unicode NFC` normalization
|
|
104
|
+
|
|
105
|
+
Single-line search bars, chat/comment composers, tag inputs, inline cell editors, and dialogs that bind `Enter` (submit/send) or `Escape` (cancel/close) **must check active IME composition first**. Otherwise users typing Vietnamese Telex/VNI, Japanese Kana→Kanji, Korean Hangul, or Chinese Pinyin accidentally send half-composed messages or dismiss dialogs when committing/canceling IME candidates:
|
|
106
|
+
|
|
107
|
+
| Platform | Guard condition before treating `Enter` as submit or `Escape` as cancel/dismiss |
|
|
108
|
+
|---|---|
|
|
109
|
+
| **Web DOM** | `if (event.isComposing || event.keyCode === 229) return;` inside `keydown` (never bind submit to `keyup`) |
|
|
110
|
+
| **iOS UIKit / SwiftUI** | `guard textField.markedTextRange == nil else { return true }` (`UITextInput` marked text active) |
|
|
111
|
+
| **Android Views / Compose** | Views: `BaseInputConnection.getComposingSpanStart(editable) != -1`; Compose: `if (value.composition != null) return@onPreviewKeyEvent false` |
|
|
112
|
+
| **macOS AppKit / Qt / Desktop** | AppKit: `client.hasMarkedText()`; Qt: track active `QInputMethodEvent` preedit (`!preedit.isEmpty()`) before accepting `Qt::Key_Return` / `Qt::Key_Escape` |
|
|
113
|
+
|
|
114
|
+
Idiomatic multi-platform guards:
|
|
115
|
+
|
|
116
|
+
```js
|
|
117
|
+
// Web DOM: chat composer / search input / inline edit
|
|
118
|
+
input.addEventListener('keydown', (event) => {
|
|
119
|
+
if (event.isComposing || event.keyCode === 229) return;
|
|
120
|
+
if (event.key === 'Enter' && !event.shiftKey) {
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
submitNormalized(input.value.normalize('NFC'));
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
```swift
|
|
128
|
+
// iOS UIKit / SwiftUI UITextInput bridge: ignore Return while marked IME text is active
|
|
129
|
+
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
|
|
130
|
+
guard textField.markedTextRange == nil else { return false }
|
|
131
|
+
submit((textField.text ?? "").precomposedStringWithCanonicalMapping)
|
|
132
|
+
return true
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
```kotlin
|
|
137
|
+
// Jetpack Compose: guard hardware Enter while IME composition span is active
|
|
138
|
+
OutlinedTextField(
|
|
139
|
+
value = fieldValue,
|
|
140
|
+
onValueChange = { fieldValue = it },
|
|
141
|
+
modifier = Modifier.onPreviewKeyEvent { event ->
|
|
142
|
+
if (event.type == KeyEventType.KeyDown && event.key == Key.Enter && !event.isShiftPressed) {
|
|
143
|
+
if (fieldValue.composition != null) return@onPreviewKeyEvent false
|
|
144
|
+
onSubmit(Normalizer.normalize(fieldValue.text, Normalizer.Form.NFC))
|
|
145
|
+
true
|
|
146
|
+
} else false
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Normalize submitted and validated text to **`Unicode NFC`** before length checks, regex rules, deduplication, or persistence so pasted `NFD` strings (such as macOS filenames or Vietnamese names like `"Nguyễn"`) never fail validation or create duplicate records.
|