@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,321 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { spawnSync } from 'node:child_process';
|
|
5
|
+
|
|
6
|
+
const ansiRe = /\x1b(?:\[[0-?]*[ -/]*[@-~]|\][^\x07\x1b]*(?:\x07|\x1b\\)|[@-Z\\-_])/g;
|
|
7
|
+
|
|
8
|
+
function help() {
|
|
9
|
+
return `Usage: node check-tui.mjs [--cols N] [--json] (--input FILE | -- <cmd ...>)
|
|
10
|
+
|
|
11
|
+
Inspect captured TUI output or execute a terminal command under NO_COLOR=1 and a non-TTY pipe.
|
|
12
|
+
Verifies zero ANSI escape leakage under NO_COLOR=1, UAX #29 grapheme-cluster visible line widths
|
|
13
|
+
within --cols, clean 6-step terminal mode teardown (alternate screen, cursor, bracketed paste,
|
|
14
|
+
synchronized output, mouse tracking, Kitty keyboard), and zero exit status.
|
|
15
|
+
|
|
16
|
+
Options:
|
|
17
|
+
--cols N Maximum visible column width (default: 80)
|
|
18
|
+
--input FILE Inspect captured output file instead of executing a command
|
|
19
|
+
--json Print machine-readable JSON output
|
|
20
|
+
-- <cmd ...> Execute command with NO_COLOR=1, FORCE_COLOR=0, TERM=dumb, COLUMNS=<cols>
|
|
21
|
+
--help Show this help`;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const graphemeSegmenter = new Intl.Segmenter('en', { granularity: 'grapheme' });
|
|
25
|
+
|
|
26
|
+
function isWideCodePoint(cp) {
|
|
27
|
+
return (cp >= 0x1100 && cp <= 0x115f)
|
|
28
|
+
|| cp === 0x2329 || cp === 0x232a
|
|
29
|
+
|| (cp >= 0x2e80 && cp <= 0xa4cf && cp !== 0x303f)
|
|
30
|
+
|| (cp >= 0xac00 && cp <= 0xd7a3)
|
|
31
|
+
|| (cp >= 0xf900 && cp <= 0xfaff)
|
|
32
|
+
|| (cp >= 0xfe10 && cp <= 0xfe19)
|
|
33
|
+
|| (cp >= 0xfe30 && cp <= 0xfe6f)
|
|
34
|
+
|| (cp >= 0xff00 && cp <= 0xff60)
|
|
35
|
+
|| (cp >= 0xffe0 && cp <= 0xffe6)
|
|
36
|
+
|| (cp >= 0x1f300 && cp <= 0x1faff)
|
|
37
|
+
|| (cp >= 0x20000 && cp <= 0x2fffd)
|
|
38
|
+
|| (cp >= 0x30000 && cp <= 0x3fffd);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function isZeroWidthCodePoint(cp) {
|
|
42
|
+
return cp <= 0x1f
|
|
43
|
+
|| (cp >= 0x7f && cp <= 0x9f)
|
|
44
|
+
|| cp === 0x200b || cp === 0x200c || cp === 0x200d || cp === 0xfeff
|
|
45
|
+
|| (cp >= 0xfe00 && cp <= 0xfe0f)
|
|
46
|
+
|| (cp >= 0xe0100 && cp <= 0xe01ef);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function visibleWidth(line) {
|
|
50
|
+
const stripped = line.replace(ansiRe, '').replace(/\r/g, '');
|
|
51
|
+
let width = 0;
|
|
52
|
+
for (const { segment } of graphemeSegmenter.segment(stripped)) {
|
|
53
|
+
if (segment === '\t') {
|
|
54
|
+
width += 4;
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (/^\p{Mark}+$/u.test(segment)) continue;
|
|
58
|
+
const hasTextPresentation = segment.includes('\ufe0e');
|
|
59
|
+
if (!hasTextPresentation && (
|
|
60
|
+
segment.includes('\u200d')
|
|
61
|
+
|| segment.includes('\ufe0f')
|
|
62
|
+
|| segment.includes('\u20e3')
|
|
63
|
+
|| /\p{Regional_Indicator}{2}/u.test(segment)
|
|
64
|
+
|| /\p{Emoji_Presentation}/u.test(segment)
|
|
65
|
+
)) {
|
|
66
|
+
width += 2;
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
let baseCp = -1;
|
|
70
|
+
for (const ch of segment) {
|
|
71
|
+
if (/\p{Mark}/u.test(ch)) continue;
|
|
72
|
+
const cp = ch.codePointAt(0);
|
|
73
|
+
if (isZeroWidthCodePoint(cp)) continue;
|
|
74
|
+
baseCp = cp;
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
if (baseCp < 0) continue;
|
|
78
|
+
width += isWideCodePoint(baseCp) ? 2 : 1;
|
|
79
|
+
}
|
|
80
|
+
return width;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function parseCli(args) {
|
|
84
|
+
const out = { help: false, json: false, cols: 80, input: '', cmd: [] };
|
|
85
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
86
|
+
const arg = args[i];
|
|
87
|
+
if (arg === '--') {
|
|
88
|
+
out.cmd = args.slice(i + 1);
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
if (arg === '--help' || arg === '-h') out.help = true;
|
|
92
|
+
else if (arg === '--json') out.json = true;
|
|
93
|
+
else if (arg === '--cols') {
|
|
94
|
+
if (!args[i + 1]) throw new Error('--cols requires a positive integer');
|
|
95
|
+
out.cols = Number(args[++i]);
|
|
96
|
+
} else if (arg.startsWith('--cols=')) out.cols = Number(arg.slice('--cols='.length));
|
|
97
|
+
else if (arg === '--input') {
|
|
98
|
+
if (!args[i + 1]) throw new Error('--input requires a file path');
|
|
99
|
+
out.input = args[++i];
|
|
100
|
+
} else if (arg.startsWith('--input=')) out.input = arg.slice('--input='.length);
|
|
101
|
+
else if (arg.startsWith('-')) throw new Error(`unknown option: ${arg}`);
|
|
102
|
+
else if (!out.input) out.input = arg;
|
|
103
|
+
else throw new Error(`unexpected argument: ${arg}`);
|
|
104
|
+
}
|
|
105
|
+
if (!Number.isSafeInteger(out.cols) || out.cols < 1) {
|
|
106
|
+
throw new Error('--cols must be a positive integer');
|
|
107
|
+
}
|
|
108
|
+
return out;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function analyzeOutput(text, cols, exitCode, execError, signal) {
|
|
112
|
+
const findings = [];
|
|
113
|
+
if (execError) {
|
|
114
|
+
findings.push({
|
|
115
|
+
rule: 'command-exec-error',
|
|
116
|
+
severity: 'P0',
|
|
117
|
+
line: 1,
|
|
118
|
+
message: `Command failed to execute: ${execError}`,
|
|
119
|
+
fix: 'Verify the binary path and runtime dependencies.',
|
|
120
|
+
});
|
|
121
|
+
} else if (signal || (exitCode !== null && exitCode !== 0)) {
|
|
122
|
+
findings.push({
|
|
123
|
+
rule: 'nonzero-exit',
|
|
124
|
+
severity: 'P0',
|
|
125
|
+
line: 1,
|
|
126
|
+
message: signal ? `Process terminated by signal ${signal}.` : `Process exited with non-zero code ${exitCode}.`,
|
|
127
|
+
fix: 'Ensure clean non-TTY execution and error teardown without crashing.',
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Unclosed terminal protocol modes (6-step teardown hygiene)
|
|
132
|
+
const modePairs = [
|
|
133
|
+
{
|
|
134
|
+
enter: /\x1b\[\?1049h/g,
|
|
135
|
+
exit: /\x1b\[\?1049l/g,
|
|
136
|
+
severity: 'P0',
|
|
137
|
+
message: 'Alternate screen buffer entered (\\x1b[?1049h) without matching exit (\\x1b[?1049l).',
|
|
138
|
+
fix: 'Restore the primary screen buffer on normal exit, errors, panics, and SIGINT/SIGTERM.',
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
enter: /\x1b\[\?25l/g,
|
|
142
|
+
exit: /\x1b\[\?25h/g,
|
|
143
|
+
severity: 'P0',
|
|
144
|
+
message: 'Cursor hidden (\\x1b[?25l) without matching restore (\\x1b[?25h).',
|
|
145
|
+
fix: 'Always restore cursor visibility in terminal teardown handlers.',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
enter: /\x1b\[\?2004h/g,
|
|
149
|
+
exit: /\x1b\[\?2004l/g,
|
|
150
|
+
severity: 'P0',
|
|
151
|
+
message: 'Bracketed paste mode enabled (\\x1b[?2004h) without matching reset (\\x1b[?2004l).',
|
|
152
|
+
fix: 'Disable DECSET 2004 bracketed paste on exit so the parent shell is not polluted with paste escape wrappers.',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
enter: /\x1b\[\?2026h/g,
|
|
156
|
+
exit: /\x1b\[\?2026l/g,
|
|
157
|
+
severity: 'P1',
|
|
158
|
+
message: 'Synchronized output mode enabled (\\x1b[?2026h) without matching flush/reset (\\x1b[?2026l).',
|
|
159
|
+
fix: 'Close synchronized frame updates with \\x1b[?2026l before exiting so terminal rendering does not freeze.',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
enter: /\x1b\[>\d*(?:;\d*)*u/g,
|
|
163
|
+
exit: /\x1b\[<\d*u/g,
|
|
164
|
+
severity: 'P0',
|
|
165
|
+
message: 'Kitty keyboard protocol pushed (\\x1b[>...u) without matching pop (\\x1b[<u).',
|
|
166
|
+
fix: 'Pop Kitty keyboard enhancement flags (\\x1b[<u) on exit and panic.',
|
|
167
|
+
},
|
|
168
|
+
];
|
|
169
|
+
for (const mode of modePairs) {
|
|
170
|
+
const enterCount = (text.match(mode.enter) || []).length;
|
|
171
|
+
const exitCount = (text.match(mode.exit) || []).length;
|
|
172
|
+
if (enterCount > exitCount) {
|
|
173
|
+
findings.push({
|
|
174
|
+
rule: 'teardown-leak',
|
|
175
|
+
severity: mode.severity,
|
|
176
|
+
line: 1,
|
|
177
|
+
message: mode.message,
|
|
178
|
+
fix: mode.fix,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
for (const code of ['1000', '1002', '1003', '1006']) {
|
|
183
|
+
const enterRe = new RegExp(`\\x1b\\[\\?${code}h`, 'g');
|
|
184
|
+
const exitRe = new RegExp(`\\x1b\\[\\?${code}l`, 'g');
|
|
185
|
+
if ((text.match(enterRe) || []).length > (text.match(exitRe) || []).length) {
|
|
186
|
+
findings.push({
|
|
187
|
+
rule: 'teardown-leak',
|
|
188
|
+
severity: 'P0',
|
|
189
|
+
line: 1,
|
|
190
|
+
message: `Mouse tracking mode (\\x1b[?${code}h) enabled without matching disable (\\x1b[?${code}l).`,
|
|
191
|
+
fix: 'Disable all mouse tracking modes (?1000l/?1002l/?1003l/?1006l) before returning control to the shell.',
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const lines = text.split(/\r?\n/);
|
|
197
|
+
let ansiCount = 0;
|
|
198
|
+
let firstAnsiLine = 0;
|
|
199
|
+
let maxWidth = 0;
|
|
200
|
+
const overflowLines = [];
|
|
201
|
+
|
|
202
|
+
lines.forEach((line, index) => {
|
|
203
|
+
const lineNum = index + 1;
|
|
204
|
+
const matches = line.match(ansiRe);
|
|
205
|
+
if (matches) {
|
|
206
|
+
ansiCount += matches.length;
|
|
207
|
+
if (!firstAnsiLine) firstAnsiLine = lineNum;
|
|
208
|
+
}
|
|
209
|
+
const width = visibleWidth(line);
|
|
210
|
+
if (width > maxWidth) maxWidth = width;
|
|
211
|
+
if (width > cols) overflowLines.push({ line: lineNum, width });
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
if (ansiCount > 0) {
|
|
215
|
+
findings.push({
|
|
216
|
+
rule: 'ansi-leak-no-color',
|
|
217
|
+
severity: 'P1',
|
|
218
|
+
line: firstAnsiLine,
|
|
219
|
+
message: `Detected ${ansiCount} ANSI escape sequence(s) under NO_COLOR=1 / non-TTY pipe (first on line ${firstAnsiLine}).`,
|
|
220
|
+
fix: 'Honor NO_COLOR and non-TTY stdout by omitting ANSI SGR/control escape codes.',
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
if (overflowLines.length > 0) {
|
|
225
|
+
const first = overflowLines[0];
|
|
226
|
+
findings.push({
|
|
227
|
+
rule: 'line-overflow',
|
|
228
|
+
severity: 'P1',
|
|
229
|
+
line: first.line,
|
|
230
|
+
message: `${overflowLines.length} line(s) exceed ${cols} visible columns (max ${maxWidth} cols; first on line ${first.line} at ${first.width} cols).`,
|
|
231
|
+
fix: `Wrap or truncate TUI output to fit within ${cols} columns cleanly.`,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
return {
|
|
236
|
+
lineCount: lines.length,
|
|
237
|
+
maxWidth,
|
|
238
|
+
ansiMatches: ansiCount,
|
|
239
|
+
overflowCount: overflowLines.length,
|
|
240
|
+
findings,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
function main() {
|
|
245
|
+
const cli = parseCli(process.argv.slice(2));
|
|
246
|
+
if (cli.help) {
|
|
247
|
+
console.log(help());
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
if (!cli.input && cli.cmd.length === 0) {
|
|
251
|
+
throw new Error('provide --input <file> or -- <cmd ...>; see --help');
|
|
252
|
+
}
|
|
253
|
+
if (cli.input && cli.cmd.length > 0) {
|
|
254
|
+
throw new Error('specify either --input <file> or -- <cmd ...>, not both');
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
let mode = 'input';
|
|
258
|
+
let label = 'static';
|
|
259
|
+
let text = '';
|
|
260
|
+
let exitCode = 0;
|
|
261
|
+
let execError = null;
|
|
262
|
+
let signal = null;
|
|
263
|
+
|
|
264
|
+
if (cli.cmd.length > 0) {
|
|
265
|
+
mode = 'command';
|
|
266
|
+
label = 'rendered';
|
|
267
|
+
const result = spawnSync(cli.cmd[0], cli.cmd.slice(1), {
|
|
268
|
+
encoding: 'utf8',
|
|
269
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
270
|
+
timeout: 15000,
|
|
271
|
+
env: {
|
|
272
|
+
...process.env,
|
|
273
|
+
NO_COLOR: '1',
|
|
274
|
+
FORCE_COLOR: '0',
|
|
275
|
+
TERM: 'dumb',
|
|
276
|
+
COLUMNS: String(cli.cols),
|
|
277
|
+
},
|
|
278
|
+
});
|
|
279
|
+
text = `${result.stdout || ''}${result.stderr || ''}`;
|
|
280
|
+
exitCode = result.status;
|
|
281
|
+
execError = result.error ? result.error.message : null;
|
|
282
|
+
signal = result.signal || null;
|
|
283
|
+
} else {
|
|
284
|
+
const file = path.resolve(cli.input);
|
|
285
|
+
if (!fs.existsSync(file)) throw new Error(`input file not found: ${cli.input}`);
|
|
286
|
+
text = fs.readFileSync(file, 'utf8');
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
const analysis = analyzeOutput(text, cli.cols, exitCode, execError, signal);
|
|
290
|
+
const report = {
|
|
291
|
+
mode,
|
|
292
|
+
target: mode === 'command' ? cli.cmd.join(' ') : cli.input,
|
|
293
|
+
label,
|
|
294
|
+
cols: cli.cols,
|
|
295
|
+
exitCode,
|
|
296
|
+
...analysis,
|
|
297
|
+
pass: analysis.findings.length === 0,
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
if (cli.json) {
|
|
301
|
+
console.log(JSON.stringify(report, null, 2));
|
|
302
|
+
} else {
|
|
303
|
+
console.log(`check-tui [${report.label}] (${report.mode}, cols=${report.cols}): ${report.pass ? 'PASS' : 'FAIL'} (maxWidth=${report.maxWidth}, ansi=${report.ansiMatches}, exit=${report.exitCode})`);
|
|
304
|
+
for (const f of report.findings) {
|
|
305
|
+
console.log(` ${f.severity} line ${f.line} ${f.rule} — ${f.message}\n fix: ${f.fix}`);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
if (!report.pass) process.exitCode = 1;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
import { fileURLToPath } from 'node:url';
|
|
312
|
+
|
|
313
|
+
const isEntrypoint = process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url);
|
|
314
|
+
if (isEntrypoint) {
|
|
315
|
+
try {
|
|
316
|
+
main();
|
|
317
|
+
} catch (error) {
|
|
318
|
+
console.error(`check-tui: ${error.message}`);
|
|
319
|
+
process.exit(1);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
|
|
6
|
+
const optional = ['error', 'empty', 'loading', 'theme', 'reduced-motion', 'reflow-320'];
|
|
7
|
+
const extendedOptional = ['i18n', 'locale', 'forced-colors', 'text-scale-200'];
|
|
8
|
+
const coreFloorOptional = new Set(['error', 'reduced-motion', 'theme']);
|
|
9
|
+
const lazyReasonPattern = /^(?:n\/?a|none|skip|skipped|todo|tbd|ignored|-)$/i;
|
|
10
|
+
const interfaces = ['responsive-web', 'mobile', 'desktop', 'tui', 'email', 'document', 'game', 'spatial', 'other'];
|
|
11
|
+
const shortHeightLayout = 'layout-short-height';
|
|
12
|
+
const shortHeightLimit = 600;
|
|
13
|
+
const webLayoutClasses = ['layout-landscape', shortHeightLayout];
|
|
14
|
+
const present = (value) => typeof value === 'string' && Boolean(value.trim());
|
|
15
|
+
const record = (value) => value && typeof value === 'object' && !Array.isArray(value);
|
|
16
|
+
const dimension = (value) => Number.isSafeInteger(value) && value > 0;
|
|
17
|
+
const isGeometryCheck = (id) => /^width-[1-9]\d*$/.test(id)
|
|
18
|
+
|| id === 'reflow-320'
|
|
19
|
+
|| /^layout-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(id);
|
|
20
|
+
const normalizeArtifact = (value) => path.normalize(value).replace(/\\/g, '/').replace(/^\.\//, '');
|
|
21
|
+
|
|
22
|
+
function isValidExclusionReason(id, reason) {
|
|
23
|
+
if (!present(reason)) return false;
|
|
24
|
+
const trimmed = reason.trim();
|
|
25
|
+
if (coreFloorOptional.has(id) && (trimmed.length < 8 || lazyReasonPattern.test(trimmed))) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function evaluateEvidence(manifest, hasArtifact) {
|
|
32
|
+
if (!record(manifest) || manifest.schemaVersion !== 1 || !interfaces.includes(manifest.surface)
|
|
33
|
+
|| ![manifest.target, manifest.revision, manifest.task, manifest.fixture].every(present)
|
|
34
|
+
|| !record(manifest.applicability) || !record(manifest.checks) || !Array.isArray(manifest.rounds)) {
|
|
35
|
+
throw new Error('expected schemaVersion 1, surface, target, revision, task, fixture, applicability, checks and rounds');
|
|
36
|
+
}
|
|
37
|
+
const web = manifest.surface === 'responsive-web';
|
|
38
|
+
const required = ['outcome', 'input', ...(web ? ['width-390', 'width-768', 'width-1440'] : ['layout'])];
|
|
39
|
+
const notChecked = new Map();
|
|
40
|
+
const failures = new Map();
|
|
41
|
+
const skipped = new Map();
|
|
42
|
+
const applyOptionalDecision = (id) => {
|
|
43
|
+
const applicability = manifest.applicability[id];
|
|
44
|
+
if (applicability === true) required.push(id);
|
|
45
|
+
else if (record(applicability) && applicability.applies === false) {
|
|
46
|
+
if (isValidExclusionReason(id, applicability.reason)) {
|
|
47
|
+
skipped.set(id, applicability.reason);
|
|
48
|
+
} else if (coreFloorOptional.has(id) && present(applicability.reason)) {
|
|
49
|
+
notChecked.set(id, 'Non-applicability reason for core floor check must be concrete (>= 8 chars and not a placeholder like n/a or skip).');
|
|
50
|
+
} else {
|
|
51
|
+
notChecked.set(id, 'Applicability must be decided before verification.');
|
|
52
|
+
}
|
|
53
|
+
} else notChecked.set(id, 'Applicability must be decided before verification.');
|
|
54
|
+
};
|
|
55
|
+
for (const id of optional) {
|
|
56
|
+
if (id === 'reflow-320' && !web) continue;
|
|
57
|
+
applyOptionalDecision(id);
|
|
58
|
+
}
|
|
59
|
+
for (const id of extendedOptional) {
|
|
60
|
+
if (!Object.hasOwn(manifest.applicability, id)) continue;
|
|
61
|
+
applyOptionalDecision(id);
|
|
62
|
+
}
|
|
63
|
+
if (manifest.surface === 'email' && Object.hasOwn(manifest.applicability, 'plaintext')) {
|
|
64
|
+
applyOptionalDecision('plaintext');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const layouts = record(manifest.layoutMatrix) ? manifest.layoutMatrix : {};
|
|
68
|
+
const expectedLayouts = new Map();
|
|
69
|
+
for (const id of new Set([...(web ? webLayoutClasses : []), ...Object.keys(layouts)])) {
|
|
70
|
+
const layout = layouts[id];
|
|
71
|
+
if (!/^layout-[a-z0-9]+(?:-[a-z0-9]+)*$/.test(id)) {
|
|
72
|
+
notChecked.set(id, 'Use layout-<class> for layout matrix IDs.');
|
|
73
|
+
} else if (record(layout) && layout.applies === false && present(layout.reason)) {
|
|
74
|
+
skipped.set(id, layout.reason);
|
|
75
|
+
} else if (web && id === shortHeightLayout && dimension(layout?.height) && layout.height >= shortHeightLimit) {
|
|
76
|
+
notChecked.set(id, `Short-height evidence must use a viewport below ${shortHeightLimit} CSS px tall.`);
|
|
77
|
+
} else if (record(layout) && layout.applies !== false
|
|
78
|
+
&& dimension(layout.width) && dimension(layout.height)
|
|
79
|
+
&& (id !== 'layout-landscape' || layout.width > layout.height)) {
|
|
80
|
+
required.push(id);
|
|
81
|
+
expectedLayouts.set(id, layout);
|
|
82
|
+
} else {
|
|
83
|
+
notChecked.set(id, 'Declare positive layout width and height (landscape must be wider than tall), or a reason it does not apply.');
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (manifest.rounds.length > 3) throw new Error('at most three repair rounds are allowed');
|
|
88
|
+
const repaired = new Set();
|
|
89
|
+
for (const round of manifest.rounds) {
|
|
90
|
+
if (!record(round) || ![round.failure, round.reproduction, round.change, round.rerun].every(present)
|
|
91
|
+
|| !hasArtifact(round.before) || !hasArtifact(round.after)
|
|
92
|
+
|| round.before === round.after) {
|
|
93
|
+
throw new Error('every repair round needs a failure, reproduction, change, rerun and distinct before/after artifacts');
|
|
94
|
+
}
|
|
95
|
+
repaired.add(round.failure);
|
|
96
|
+
skipped.delete(round.failure);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const geometryArtifacts = new Map();
|
|
100
|
+
for (const id of new Set([...required, ...repaired, ...Object.keys(manifest.checks)])) {
|
|
101
|
+
const entry = Object.hasOwn(manifest.checks, id) ? manifest.checks[id] : undefined;
|
|
102
|
+
if (skipped.has(id) && entry?.result !== 'fail') continue;
|
|
103
|
+
const width = id === 'reflow-320' ? 320 : Number(/^width-([1-9]\d*)(?:-.+)?$/.exec(id)?.[1]);
|
|
104
|
+
const layout = expectedLayouts.get(id);
|
|
105
|
+
if (id.startsWith('width-') && !Number.isSafeInteger(width)) {
|
|
106
|
+
notChecked.set(id, 'Invalid width check ID; use width-<px> or width-<px>-<defect>.');
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (!record(entry) || !['pass', 'fail'].includes(entry.result) || entry.label !== 'rendered'
|
|
110
|
+
|| ![entry.method, entry.expected, entry.observed].every(present) || !hasArtifact(entry.artifact)
|
|
111
|
+
|| (id === 'outcome' && !present(entry.assertion))
|
|
112
|
+
|| (id === 'input' && !present(entry.focus))
|
|
113
|
+
|| (web && id === 'input' && entry.modality !== 'keyboard')
|
|
114
|
+
|| (Number.isSafeInteger(width) && entry.width !== width)
|
|
115
|
+
|| (layout && (entry.width !== layout.width || entry.height !== layout.height))) {
|
|
116
|
+
notChecked.set(id, present(entry?.reason) ? entry.reason : 'Missing required rendered evidence or assertion.');
|
|
117
|
+
} else if (entry.result === 'fail') {
|
|
118
|
+
if (isGeometryCheck(id) && !notChecked.has(id)) {
|
|
119
|
+
const norm = normalizeArtifact(entry.artifact);
|
|
120
|
+
if (!geometryArtifacts.has(norm)) geometryArtifacts.set(norm, id);
|
|
121
|
+
}
|
|
122
|
+
skipped.delete(id);
|
|
123
|
+
failures.set(id, { expected: entry.expected, observed: entry.observed, artifact: entry.artifact });
|
|
124
|
+
} else if (isGeometryCheck(id) && !notChecked.has(id)) {
|
|
125
|
+
const norm = normalizeArtifact(entry.artifact);
|
|
126
|
+
const existingOwner = geometryArtifacts.get(norm);
|
|
127
|
+
if (existingOwner) {
|
|
128
|
+
notChecked.set(id, `Duplicate artifact '${entry.artifact}' already used by '${existingOwner}'; each viewport/layout check must use a separate artifact.`);
|
|
129
|
+
} else {
|
|
130
|
+
geometryArtifacts.set(norm, id);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const status = failures.size ? (manifest.rounds.length === 3 ? 'OPEN' : 'FAIL')
|
|
136
|
+
: notChecked.size ? 'NOT CHECKED' : 'PASS';
|
|
137
|
+
return { status, rounds: manifest.rounds.length, failures: Object.fromEntries(failures),
|
|
138
|
+
notChecked: Object.fromEntries(notChecked), notApplicable: Object.fromEntries(skipped) };
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function main(args) {
|
|
142
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
143
|
+
console.log('Usage: node finish-gate.mjs <evidence.json>\nChecks evidence completeness; exit 0 PASS, 1 FAIL/OPEN, 2 NOT CHECKED or invalid input.');
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
if (args.length !== 1) throw new Error('provide one evidence manifest; see --help');
|
|
147
|
+
const file = path.resolve(args[0]);
|
|
148
|
+
const root = path.dirname(file);
|
|
149
|
+
const manifest = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
150
|
+
const hasArtifact = (relative) => {
|
|
151
|
+
if (!present(relative) || path.isAbsolute(relative)) return false;
|
|
152
|
+
try {
|
|
153
|
+
const resolved = fs.realpathSync(path.resolve(root, relative));
|
|
154
|
+
const local = path.relative(fs.realpathSync(root), resolved);
|
|
155
|
+
if (!local || local === '..' || local.startsWith(`..${path.sep}`) || path.isAbsolute(local)) return false;
|
|
156
|
+
const stat = fs.statSync(resolved);
|
|
157
|
+
return stat.isFile() && stat.size > 0;
|
|
158
|
+
} catch {
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
const result = evaluateEvidence(manifest, hasArtifact);
|
|
163
|
+
console.log(JSON.stringify(result, null, 2));
|
|
164
|
+
process.exitCode = { PASS: 0, FAIL: 1, OPEN: 1, 'NOT CHECKED': 2 }[result.status];
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (process.argv[1] && fileURLToPath(import.meta.url) === path.resolve(process.argv[1])) {
|
|
168
|
+
try {
|
|
169
|
+
main(process.argv.slice(2));
|
|
170
|
+
} catch (error) {
|
|
171
|
+
console.error(`finish-gate: ${error.message}`);
|
|
172
|
+
process.exitCode = 2;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<meta charset="utf-8">
|
|
4
|
+
<title>ARIA modal occlusion</title>
|
|
5
|
+
<style>
|
|
6
|
+
body { color: #171717; background: white; }
|
|
7
|
+
.backdrop { position: fixed; inset: 0; background: white; }
|
|
8
|
+
.modal { position: fixed; inset: 40% 25% auto; padding: 1rem; background: white; }
|
|
9
|
+
.sample { position: relative; width: max-content; }
|
|
10
|
+
.cover { position: absolute; inset: 0; background: white; }
|
|
11
|
+
@media (max-width: 500px) { .modal { display: none; } }
|
|
12
|
+
</style>
|
|
13
|
+
<p id="behind-aria-modal">Background text intentionally covered by a sibling backdrop.</p>
|
|
14
|
+
<div class="backdrop"></div>
|
|
15
|
+
<div class="modal" role="dialog" aria-modal="true" aria-label="Settings">
|
|
16
|
+
<p id="readable-aria-modal">Readable modal text.</p>
|
|
17
|
+
<div class="sample"><span id="occluded-aria-modal">Hidden modal text.</span><div class="cover"></div></div>
|
|
18
|
+
</div>
|
|
19
|
+
</html>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<meta charset="utf-8">
|
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
5
|
+
<title>Rendered diagnostics</title>
|
|
6
|
+
<style>
|
|
7
|
+
body { margin: 12px; color: #171717; background: white; }
|
|
8
|
+
#wide { width: 450px; }
|
|
9
|
+
#hidden-essential { opacity: 0; }
|
|
10
|
+
.sample { position: relative; width: max-content; }
|
|
11
|
+
.cover { position: absolute; inset: 0; z-index: 1; }
|
|
12
|
+
#opaque { background: white; }
|
|
13
|
+
#low-contrast { color: #ddd; }
|
|
14
|
+
#focusless:focus { outline: none; }
|
|
15
|
+
#focus-ring:focus-visible { outline: 3px solid #1754ad; }
|
|
16
|
+
</style>
|
|
17
|
+
<main>
|
|
18
|
+
<h1>Settings</h1>
|
|
19
|
+
<button id="focusless">Focus lost</button>
|
|
20
|
+
<button id="focus-ring">Focus works</button>
|
|
21
|
+
<p id="wide">Wide element causes overflow at narrow sizes.</p>
|
|
22
|
+
<p id="hidden-essential" data-pixelcraft-essential>Required content cannot be seen.</p>
|
|
23
|
+
<details><summary>More details</summary><p id="closed" data-pixelcraft-essential>Intentionally closed.</p></details>
|
|
24
|
+
<dialog><h1 id="closed-dialog">Intentionally closed dialog</h1></dialog>
|
|
25
|
+
<div role="dialog" aria-modal="true" hidden>Intentionally hidden ARIA dialog</div>
|
|
26
|
+
<div class="sample"><span id="occluded">Important content hidden under an opaque layer</span><div id="opaque" class="cover"></div></div>
|
|
27
|
+
<div class="sample"><span id="not-occluded">Important content visible under a transparent layer</span><div class="cover"></div></div>
|
|
28
|
+
<p id="low-contrast">Insufficient text contrast.</p>
|
|
29
|
+
<p id="readable">Sufficient text contrast.</p>
|
|
30
|
+
<img id="broken" src="missing.png" alt="Broken product image" width="30" height="30">
|
|
31
|
+
<img id="valid" src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Crect width='30' height='30'/%3E%3C/svg%3E" alt="Valid product image" width="30" height="30">
|
|
32
|
+
<img id="hidden-image" hidden src="missing-hidden.png" alt="" width="30" height="30">
|
|
33
|
+
</main>
|
|
34
|
+
</html>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<meta charset="utf-8">
|
|
4
|
+
<title>Modal occlusion</title>
|
|
5
|
+
<style>
|
|
6
|
+
body { color: #171717; background: white; }
|
|
7
|
+
dialog::backdrop, .cover { background: white; }
|
|
8
|
+
.sample { position: relative; width: max-content; }
|
|
9
|
+
.cover { position: absolute; inset: 0; z-index: 1; }
|
|
10
|
+
</style>
|
|
11
|
+
<p id="behind-modal">Background text intentionally covered by a modal backdrop.</p>
|
|
12
|
+
<dialog aria-label="Settings">
|
|
13
|
+
<p id="readable-modal">Readable modal text.</p>
|
|
14
|
+
<div class="sample"><span id="occluded-modal">Hidden modal text.</span><div class="cover"></div></div>
|
|
15
|
+
</dialog>
|
|
16
|
+
<script>document.querySelector('dialog').showModal();</script>
|
|
17
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.__styleInventoryDeferredFixture = true;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<title>Style inventory edge fixture</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root, body {
|
|
9
|
+
margin: 0;
|
|
10
|
+
min-height: 100vh;
|
|
11
|
+
background: #000000;
|
|
12
|
+
color: #f5f5f5;
|
|
13
|
+
font: 400 16px/1.5 Arial, sans-serif;
|
|
14
|
+
}
|
|
15
|
+
main {
|
|
16
|
+
padding: 24px;
|
|
17
|
+
}
|
|
18
|
+
h1 {
|
|
19
|
+
margin: 0 0 12px;
|
|
20
|
+
font-size: 32px;
|
|
21
|
+
}
|
|
22
|
+
.faded {
|
|
23
|
+
opacity: 0.25;
|
|
24
|
+
}
|
|
25
|
+
.clipped-box {
|
|
26
|
+
width: 0;
|
|
27
|
+
height: 0;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
}
|
|
30
|
+
.clipped-box p {
|
|
31
|
+
color: #111111;
|
|
32
|
+
background: #000000;
|
|
33
|
+
}
|
|
34
|
+
</style>
|
|
35
|
+
</head>
|
|
36
|
+
<body>
|
|
37
|
+
<header role="presentation"></header>
|
|
38
|
+
<nav aria-hidden="true"></nav>
|
|
39
|
+
<aside hidden></aside>
|
|
40
|
+
<main>
|
|
41
|
+
<article>
|
|
42
|
+
<header></header>
|
|
43
|
+
<h1>Zero-channel dark surface</h1>
|
|
44
|
+
<p>Pure black background must resolve as dark mode with #000000 dominant color.</p>
|
|
45
|
+
<p class="faded">Low opacity text must fail contrast even though its color is light.</p>
|
|
46
|
+
<div class="clipped-box"><p>Clipped low-contrast text inside zero-size overflow hidden ancestor.</p></div>
|
|
47
|
+
<footer></footer>
|
|
48
|
+
</article>
|
|
49
|
+
</main>
|
|
50
|
+
<footer></footer>
|
|
51
|
+
</body>
|
|
52
|
+
</html>
|