@thanhnguyxn/pixelcraft 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +1 -1
- package/.antigravity-plugin/plugin.json +32 -0
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +15 -4
- package/.codex-plugin/plugin.json +45 -0
- package/.cursor-plugin/marketplace.json +17 -0
- package/.cursor-plugin/plugin.json +27 -0
- package/.devin-plugin/plugin.json +21 -0
- package/.github/plugin/marketplace.json +34 -0
- package/CHANGELOG.md +159 -0
- package/GEMINI.md +1 -0
- package/README.md +185 -328
- package/SECURITY.md +28 -0
- package/assets/pixelcraft-logo-128.png +0 -0
- package/assets/pixelcraft-logo-256.png +0 -0
- package/bin/pixelcraft.mjs +431 -23
- package/docs/ARCHITECTURE.md +40 -37
- package/docs/DESIGN-RATIONALE.md +51 -3
- package/docs/INSTALL.md +221 -0
- package/evals/README.md +16 -6
- package/evals/fixtures/3d-web-engineering.json +69 -0
- package/evals/fixtures/acceptance-checklist-rule03-gate.json +43 -0
- package/evals/fixtures/ai-ui-libraries.json +53 -0
- package/evals/fixtures/audio-visual-accessibility.json +69 -0
- package/evals/fixtures/auth-and-checkout-ui.json +53 -0
- package/evals/fixtures/brandkit-identity-governance.json +48 -0
- package/evals/fixtures/build-and-architecture.json +53 -0
- package/evals/fixtures/canvas-and-node-editors.json +53 -0
- package/evals/fixtures/chat-ai-exfiltration-ime-hitl-gate.json +43 -0
- package/evals/fixtures/completion-gate-scan-until-clean.json +44 -0
- package/evals/fixtures/component-systems.json +53 -0
- package/evals/fixtures/component-testing.json +53 -0
- package/evals/fixtures/constrained-voice-and-tv.json +43 -0
- package/evals/fixtures/creative-code-rendering.json +69 -0
- package/evals/fixtures/creative-reference-evidence.json +67 -0
- package/evals/fixtures/data-app-python-marimo.json +49 -0
- package/evals/fixtures/desktop-cpp-juce-audio.json +49 -0
- package/evals/fixtures/desktop-csharp-avalonia.json +49 -0
- package/evals/fixtures/desktop-native-workspace.json +48 -0
- package/evals/fixtures/desktop-python-anti-tkinter.json +49 -0
- package/evals/fixtures/document-prepress-pdfx4-tounicode.json +43 -0
- package/evals/fixtures/document-rust-typst-invoice.json +49 -0
- package/evals/fixtures/document-typst-and-print-css.json +43 -0
- package/evals/fixtures/email-mjml-dark-mode.json +49 -0
- package/evals/fixtures/email-outlook-and-plaintext.json +43 -0
- package/evals/fixtures/enterprise-data-ui.json +53 -0
- package/evals/fixtures/extended-tui-toolkits.json +53 -0
- package/evals/fixtures/extensions-mv3-and-vscode.json +43 -0
- package/evals/fixtures/file-upload-media-ui.json +53 -0
- package/evals/fixtures/forms-validation.json +53 -0
- package/evals/fixtures/game-go-ebitengine.json +49 -0
- package/evals/fixtures/game-godot-gdscript.json +49 -0
- package/evals/fixtures/game-ui-hud-and-engines.json +43 -0
- package/evals/fixtures/i18n-engineering.json +53 -0
- package/evals/fixtures/local-first-sync.json +53 -0
- package/evals/fixtures/lynxjs.json +53 -0
- package/evals/fixtures/maizzle-email.json +53 -0
- package/evals/fixtures/maps-geospatial.json +53 -0
- package/evals/fixtures/media-og-and-video-export.json +43 -0
- package/evals/fixtures/media-players.json +53 -0
- package/evals/fixtures/mobile-compose-16kb-foldable-store-gate.json +44 -0
- package/evals/fixtures/mobile-elixir-liveview-native.json +49 -0
- package/evals/fixtures/mobile-flutter-dynamic-type.json +49 -0
- package/evals/fixtures/mobile-harmonyos-arkui.json +49 -0
- package/evals/fixtures/mobile-jetpack-compose.json +49 -0
- package/evals/fixtures/mobile-swiftui-ios.json +49 -0
- package/evals/fixtures/motion-engineering.json +69 -0
- package/evals/fixtures/pdfjs-and-pptx.json +53 -0
- package/evals/fixtures/plan-discovery-interview.json +31 -0
- package/evals/fixtures/plan-grill-me-brainstorm-gate.json +49 -0
- package/evals/fixtures/reactive-data-apps.json +53 -0
- package/evals/fixtures/review-evidence-audit.json +43 -0
- package/evals/fixtures/rich-text-and-code-editors.json +53 -0
- package/evals/fixtures/scrollytelling-resilience.json +70 -0
- package/evals/fixtures/spatial-xr-comfort-and-platforms.json +43 -0
- package/evals/fixtures/state-architecture.json +53 -0
- package/evals/fixtures/styling-ecosystem.json +53 -0
- package/evals/fixtures/token-tooling.json +53 -0
- package/evals/fixtures/tui-go-bubbletea.json +49 -0
- package/evals/fixtures/tui-rust-ratatui-grapheme-paste-teardown.json +44 -0
- package/evals/fixtures/tui-rust-ratatui.json +49 -0
- package/evals/fixtures/ux-state-matrix-and-i18n.json +43 -0
- package/evals/fixtures/web-3d-engines.json +53 -0
- package/evals/fixtures/web-php-laravel-filament.json +49 -0
- package/evals/fixtures/web-ruby-viewcomponent-phlex.json +49 -0
- package/evals/pixelcraft-accessibility.md +17 -0
- package/evals/pixelcraft-craft.md +16 -0
- package/evals/pixelcraft-dataviz.md +3 -3
- package/evals/pixelcraft-direction.md +17 -0
- package/evals/pixelcraft-game-ui.md +3 -3
- package/evals/pixelcraft-mobile.md +3 -3
- package/evals/pixelcraft-patterns.md +16 -0
- package/evals/pixelcraft-plan.md +65 -3
- package/evals/pixelcraft-review.md +3 -3
- package/evals/pixelcraft-visual-qa.md +11 -5
- package/evals/pixelcraft-web.md +21 -3
- package/evals/pixelcraft.md +4 -4
- package/gemini-extension.json +3 -2
- package/install.ps1 +57 -11
- package/install.sh +82 -7
- package/package.json +32 -4
- package/plugin.json +6 -1
- package/scripts/build-adapters.mjs +11 -13
- package/scripts/run-evals.mjs +397 -0
- package/scripts/sync-docs.mjs +381 -0
- package/scripts/test-build-adapters.mjs +14 -1
- package/scripts/test-cross-platform-qa.mjs +359 -0
- package/scripts/test-distribution.mjs +86 -7
- package/scripts/test-export-tokens.mjs +259 -3
- package/scripts/test-finish-gate.mjs +133 -10
- package/scripts/test-installers.mjs +155 -6
- package/scripts/test-shoot.mjs +23 -1
- package/scripts/test-slop-scan.mjs +390 -3
- package/scripts/test-style-inventory.mjs +23 -0
- package/scripts/test-sync-docs.mjs +140 -0
- package/scripts/test-validate-skills.mjs +82 -4
- package/scripts/validate-skills.mjs +149 -3
- package/skills/pixelcraft/SKILL.md +67 -47
- package/skills/pixelcraft/references/design-brief.md +2 -2
- package/skills/pixelcraft/references/floor.md +36 -19
- package/skills/pixelcraft/references/report-template.md +25 -11
- package/skills/pixelcraft/references/stack-detection.md +138 -67
- package/skills/pixelcraft/references/surface-acceptance.md +33 -21
- package/skills/pixelcraft/references/workflow-checkpoints.md +49 -7
- package/skills/pixelcraft-accessibility/SKILL.md +34 -13
- package/skills/pixelcraft-accessibility/references/apg-patterns.md +13 -0
- package/skills/pixelcraft-accessibility/references/motion-canvas.md +57 -0
- package/skills/pixelcraft-accessibility/references/platforms.md +34 -6
- package/skills/pixelcraft-accessibility/references/verification.md +15 -10
- package/skills/pixelcraft-accessibility/references/wcag22-checks.md +38 -5
- package/skills/pixelcraft-brandkit/SKILL.md +42 -30
- package/skills/pixelcraft-brandkit/references/asset-pipeline.md +90 -50
- package/skills/pixelcraft-brandkit/references/brand-governance.md +29 -27
- package/skills/pixelcraft-brandkit/references/logo-methods.md +33 -34
- package/skills/pixelcraft-brandkit/references/prompt-template.md +53 -51
- package/skills/pixelcraft-brandkit/references/qa-checklist.md +7 -2
- package/skills/pixelcraft-brandkit/references/visual-modes.md +16 -16
- package/skills/pixelcraft-chat-ui/SKILL.md +31 -27
- package/skills/pixelcraft-chat-ui/references/agentic-workspace.md +66 -0
- package/skills/pixelcraft-chat-ui/references/ai-ui-libraries.md +259 -0
- package/skills/pixelcraft-chat-ui/references/conversation-design.md +12 -6
- package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +58 -68
- package/skills/pixelcraft-chat-ui/references/slack-discord.md +60 -76
- package/skills/pixelcraft-constrained/SKILL.md +21 -20
- package/skills/pixelcraft-constrained/references/specialized-hardware.md +69 -45
- package/skills/pixelcraft-constrained/references/tv-wearables.md +123 -73
- package/skills/pixelcraft-constrained/references/voice-ui.md +86 -45
- package/skills/pixelcraft-craft/SKILL.md +29 -15
- package/skills/pixelcraft-craft/references/color.md +62 -6
- package/skills/pixelcraft-craft/references/layout.md +32 -0
- package/skills/pixelcraft-craft/references/motion.md +99 -12
- package/skills/pixelcraft-craft/references/typography.md +48 -9
- package/skills/pixelcraft-data-apps/SKILL.md +50 -31
- package/skills/pixelcraft-data-apps/references/ai-and-internal-data-apps.md +147 -0
- package/skills/pixelcraft-data-apps/references/dash.md +87 -31
- package/skills/pixelcraft-data-apps/references/evidence.md +41 -26
- package/skills/pixelcraft-data-apps/references/gradio.md +65 -27
- package/skills/pixelcraft-data-apps/references/julia-genie.md +64 -29
- package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +65 -27
- package/skills/pixelcraft-data-apps/references/nicegui.md +73 -34
- package/skills/pixelcraft-data-apps/references/observable-framework.md +65 -27
- package/skills/pixelcraft-data-apps/references/panel.md +69 -23
- package/skills/pixelcraft-data-apps/references/r-shiny.md +104 -34
- package/skills/pixelcraft-data-apps/references/reactive-data-apps.md +186 -0
- package/skills/pixelcraft-data-apps/references/reflex.md +85 -31
- package/skills/pixelcraft-data-apps/references/shiny.md +84 -27
- package/skills/pixelcraft-data-apps/references/streamlit.md +73 -25
- package/skills/pixelcraft-dataviz/SKILL.md +21 -24
- package/skills/pixelcraft-dataviz/references/color-accessibility.md +2 -2
- package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +35 -25
- package/skills/pixelcraft-dataviz/references/libraries.md +165 -46
- package/skills/pixelcraft-dataviz/references/maps-geospatial.md +159 -0
- package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +58 -65
- package/skills/pixelcraft-desktop/SKILL.md +61 -39
- package/skills/pixelcraft-desktop/references/appkit.md +60 -26
- package/skills/pixelcraft-desktop/references/avalonia.md +65 -29
- package/skills/pixelcraft-desktop/references/cpp-gui.md +104 -27
- package/skills/pixelcraft-desktop/references/electron.md +68 -26
- package/skills/pixelcraft-desktop/references/go-gui.md +59 -30
- package/skills/pixelcraft-desktop/references/gtk.md +74 -31
- package/skills/pixelcraft-desktop/references/javafx-swing.md +54 -25
- package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +57 -30
- package/skills/pixelcraft-desktop/references/rust-gui.md +59 -41
- package/skills/pixelcraft-desktop/references/tauri.md +80 -24
- package/skills/pixelcraft-desktop/references/uno-platform.md +42 -23
- package/skills/pixelcraft-desktop/references/winui-wpf.md +66 -26
- package/skills/pixelcraft-desktop/references/working-context.md +82 -3
- package/skills/pixelcraft-direction/SKILL.md +48 -82
- package/skills/pixelcraft-direction/references/creative-brainstorming.md +72 -0
- package/skills/pixelcraft-direction/references/direction-card.md +11 -1
- package/skills/pixelcraft-direction/references/direction-scoring.md +5 -1
- package/skills/pixelcraft-direction/references/motion-identity.md +67 -0
- package/skills/pixelcraft-direction/references/movements.md +3 -0
- package/skills/pixelcraft-direction/references/reference-analysis.md +37 -0
- package/skills/pixelcraft-direction/references/slop-fingerprints.md +32 -7
- package/skills/pixelcraft-document/SKILL.md +27 -23
- package/skills/pixelcraft-document/references/archetypes.md +27 -4
- package/skills/pixelcraft-document/references/pdf-tools.md +241 -81
- package/skills/pixelcraft-document/references/pdfjs-and-pptx.md +114 -0
- package/skills/pixelcraft-document/references/print-css.md +96 -43
- package/skills/pixelcraft-document/references/slides.md +123 -27
- package/skills/pixelcraft-email/SKILL.md +42 -20
- package/skills/pixelcraft-email/references/client-quirks.md +101 -33
- package/skills/pixelcraft-email/references/html-tables.md +83 -22
- package/skills/pixelcraft-email/references/maizzle.md +54 -0
- package/skills/pixelcraft-email/references/mjml.md +13 -11
- package/skills/pixelcraft-email/references/react-email.md +76 -34
- package/skills/pixelcraft-extensions/SKILL.md +32 -27
- package/skills/pixelcraft-extensions/references/browser-extensions.md +91 -17
- package/skills/pixelcraft-extensions/references/figma-office.md +97 -14
- package/skills/pixelcraft-extensions/references/ide-and-saas-plugins.md +125 -0
- package/skills/pixelcraft-extensions/references/raycast.md +90 -11
- package/skills/pixelcraft-extensions/references/vscode-webviews.md +91 -17
- package/skills/pixelcraft-game-ui/SKILL.md +45 -26
- package/skills/pixelcraft-game-ui/references/bevy.md +69 -31
- package/skills/pixelcraft-game-ui/references/godot.md +100 -27
- package/skills/pixelcraft-game-ui/references/hud-principles.md +50 -21
- package/skills/pixelcraft-game-ui/references/love2d.md +53 -27
- package/skills/pixelcraft-game-ui/references/monogame.md +45 -29
- package/skills/pixelcraft-game-ui/references/unity-ugui.md +109 -0
- package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +69 -27
- package/skills/pixelcraft-game-ui/references/unreal-umg.md +53 -26
- package/skills/pixelcraft-game-ui/references/web-and-middleware-game-ui.md +122 -0
- package/skills/pixelcraft-handoff/SKILL.md +14 -13
- package/skills/pixelcraft-handoff/references/design-translation.md +40 -10
- package/skills/pixelcraft-handoff/references/motion-handoff.md +54 -0
- package/skills/pixelcraft-media/SKILL.md +20 -23
- package/skills/pixelcraft-media/references/banners-video.md +83 -65
- package/skills/pixelcraft-media/references/og-generation.md +110 -63
- package/skills/pixelcraft-media/references/social-cards.md +57 -58
- package/skills/pixelcraft-mobile/SKILL.md +53 -36
- package/skills/pixelcraft-mobile/references/dotnet-maui.md +62 -34
- package/skills/pixelcraft-mobile/references/flet.md +53 -26
- package/skills/pixelcraft-mobile/references/flutter.md +76 -32
- package/skills/pixelcraft-mobile/references/harmonyos-and-emerging-mobile.md +121 -0
- package/skills/pixelcraft-mobile/references/ionic-capacitor.md +48 -26
- package/skills/pixelcraft-mobile/references/jetpack-compose.md +92 -24
- package/skills/pixelcraft-mobile/references/kivy.md +54 -31
- package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +53 -27
- package/skills/pixelcraft-mobile/references/lynxjs.md +110 -0
- package/skills/pixelcraft-mobile/references/nativescript-and-skip.md +91 -0
- package/skills/pixelcraft-mobile/references/react-native-expo.md +66 -31
- package/skills/pixelcraft-mobile/references/swiftui.md +158 -28
- package/skills/pixelcraft-mobile/references/tactile-interactions.md +55 -0
- package/skills/pixelcraft-mobile/references/task-state-composition.md +82 -2
- package/skills/pixelcraft-mobile/references/uikit.md +57 -23
- package/skills/pixelcraft-patterns/SKILL.md +30 -13
- package/skills/pixelcraft-patterns/references/accessibility-resilience.md +29 -0
- package/skills/pixelcraft-patterns/references/ai-and-offline-patterns.md +54 -0
- package/skills/pixelcraft-patterns/references/auth-onboarding.md +32 -13
- package/skills/pixelcraft-patterns/references/billing-paywalls.md +40 -0
- package/skills/pixelcraft-patterns/references/command-workspace.md +56 -0
- package/skills/pixelcraft-patterns/references/commerce.md +35 -16
- package/skills/pixelcraft-patterns/references/communication.md +34 -15
- package/skills/pixelcraft-patterns/references/creative-tools.md +30 -17
- package/skills/pixelcraft-patterns/references/creative-web-composition.md +38 -0
- package/skills/pixelcraft-patterns/references/dashboard-admin.md +22 -18
- package/skills/pixelcraft-patterns/references/history-diff-undo.md +50 -0
- package/skills/pixelcraft-patterns/references/marketing.md +31 -19
- package/skills/pixelcraft-patterns/references/multi-tenant-rbac.md +47 -0
- package/skills/pixelcraft-patterns/references/narrative-systems.md +42 -0
- package/skills/pixelcraft-patterns/references/notifications-activity.md +57 -0
- package/skills/pixelcraft-patterns/references/pattern-selection.md +8 -2
- package/skills/pixelcraft-patterns/references/scheduling-kanban.md +47 -0
- package/skills/pixelcraft-patterns/references/scroll-implementation.md +37 -0
- package/skills/pixelcraft-patterns/references/settings.md +40 -12
- package/skills/pixelcraft-plan/SKILL.md +54 -18
- package/skills/pixelcraft-plan/references/discovery-interview.md +110 -0
- package/skills/pixelcraft-plan/references/grill-me-protocol.md +63 -0
- package/skills/pixelcraft-plan/references/plan-template.md +44 -9
- package/skills/pixelcraft-plan/references/repo-discovery.md +16 -9
- package/skills/pixelcraft-plan/references/stack-freshness.md +22 -5
- package/skills/pixelcraft-plan/references/stack-selection.md +65 -9
- package/skills/pixelcraft-review/SKILL.md +41 -19
- package/skills/pixelcraft-review/references/audit-report.md +20 -1
- package/skills/pixelcraft-review/references/heuristics.md +63 -18
- package/skills/pixelcraft-review/references/personas.md +41 -14
- package/skills/pixelcraft-review/references/polish.md +66 -26
- package/skills/pixelcraft-review/scripts/check-acceptance.mjs +619 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-longhand-removal.css +34 -0
- package/skills/pixelcraft-review/scripts/slop-scan.mjs +679 -32
- package/skills/pixelcraft-spatial/SKILL.md +16 -17
- package/skills/pixelcraft-spatial/references/comfort-accessibility.md +25 -84
- package/skills/pixelcraft-spatial/references/platforms.md +123 -53
- package/skills/pixelcraft-tokens/SKILL.md +18 -14
- package/skills/pixelcraft-tokens/assets/tokens.example.json +1 -1
- package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +1 -1
- package/skills/pixelcraft-tokens/references/format.md +39 -9
- package/skills/pixelcraft-tokens/references/governance.md +1 -1
- package/skills/pixelcraft-tokens/references/theme-presets.md +36 -8
- package/skills/pixelcraft-tokens/references/token-tooling.md +119 -0
- package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +637 -75
- package/skills/pixelcraft-tui/SKILL.md +41 -25
- package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +49 -30
- package/skills/pixelcraft-tui/references/extended-tui-toolkits.md +127 -0
- package/skills/pixelcraft-tui/references/ink.md +77 -28
- package/skills/pixelcraft-tui/references/ratatui.md +70 -30
- package/skills/pixelcraft-tui/references/rich.md +53 -33
- package/skills/pixelcraft-tui/references/terminal-protocols.md +80 -0
- package/skills/pixelcraft-tui/references/textual.md +75 -34
- package/skills/pixelcraft-ux/SKILL.md +22 -12
- package/skills/pixelcraft-ux/references/feedback-performance.md +39 -19
- package/skills/pixelcraft-ux/references/forms.md +57 -3
- package/skills/pixelcraft-ux/references/i18n.md +50 -12
- package/skills/pixelcraft-ux/references/laws.md +35 -14
- package/skills/pixelcraft-ux/references/state-matrix.md +15 -1
- package/skills/pixelcraft-ux/references/ux-writing.md +1 -0
- package/skills/pixelcraft-visual-qa/SKILL.md +21 -7
- package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +28 -7
- package/skills/pixelcraft-visual-qa/references/capture-document.md +70 -0
- package/skills/pixelcraft-visual-qa/references/capture-email.md +13 -9
- package/skills/pixelcraft-visual-qa/references/capture-mobile.md +20 -5
- package/skills/pixelcraft-visual-qa/references/capture-terminal.md +6 -2
- package/skills/pixelcraft-visual-qa/references/motion-capture.md +63 -0
- package/skills/pixelcraft-visual-qa/references/performance-budgets.md +25 -12
- package/skills/pixelcraft-visual-qa/references/realtime-graphics.md +55 -0
- package/skills/pixelcraft-visual-qa/scripts/check-contrast.mjs +442 -0
- package/skills/pixelcraft-visual-qa/scripts/check-email.mjs +397 -0
- package/skills/pixelcraft-visual-qa/scripts/check-pdf.mjs +189 -0
- package/skills/pixelcraft-visual-qa/scripts/check-tui.mjs +321 -0
- package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +50 -11
- package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +214 -59
- package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +121 -49
- package/skills/pixelcraft-web/SKILL.md +105 -49
- package/skills/pixelcraft-web/references/accessibility-performance.md +42 -0
- package/skills/pixelcraft-web/references/adaptive-layout.md +52 -8
- package/skills/pixelcraft-web/references/angular.md +63 -16
- package/skills/pixelcraft-web/references/assets-pipeline.md +67 -0
- package/skills/pixelcraft-web/references/astro.md +64 -13
- package/skills/pixelcraft-web/references/audio-reactive.md +61 -0
- package/skills/pixelcraft-web/references/auth-and-checkout-ui.md +115 -0
- package/skills/pixelcraft-web/references/build-and-architecture.md +215 -0
- package/skills/pixelcraft-web/references/canvas-and-node-editors.md +157 -0
- package/skills/pixelcraft-web/references/clojurescript.md +52 -17
- package/skills/pixelcraft-web/references/component-systems.md +102 -0
- package/skills/pixelcraft-web/references/component-testing.md +170 -0
- package/skills/pixelcraft-web/references/creative-effects.md +59 -0
- package/skills/pixelcraft-web/references/creative-runtime.md +34 -0
- package/skills/pixelcraft-web/references/enterprise-data-ui.md +138 -0
- package/skills/pixelcraft-web/references/file-upload-media-ui.md +82 -0
- package/skills/pixelcraft-web/references/forms-validation.md +123 -0
- package/skills/pixelcraft-web/references/fsharp-fable.md +3 -2
- package/skills/pixelcraft-web/references/gsap.md +102 -0
- package/skills/pixelcraft-web/references/html-css.md +144 -12
- package/skills/pixelcraft-web/references/htmx-alpine.md +68 -18
- package/skills/pixelcraft-web/references/i18n-engineering.md +106 -0
- package/skills/pixelcraft-web/references/interaction-and-search-primitives.md +196 -0
- package/skills/pixelcraft-web/references/java-web.md +27 -18
- package/skills/pixelcraft-web/references/kotlin-web.md +6 -2
- package/skills/pixelcraft-web/references/leptos-yew.md +62 -19
- package/skills/pixelcraft-web/references/lit-web-components.md +4 -2
- package/skills/pixelcraft-web/references/local-first-sync.md +105 -0
- package/skills/pixelcraft-web/references/media-players.md +104 -0
- package/skills/pixelcraft-web/references/motion-react.md +96 -0
- package/skills/pixelcraft-web/references/motion-recipes.md +82 -0
- package/skills/pixelcraft-web/references/preact-fresh-hono.md +111 -0
- package/skills/pixelcraft-web/references/pwa.md +6 -1
- package/skills/pixelcraft-web/references/qwik.md +51 -11
- package/skills/pixelcraft-web/references/r3f-integration.md +69 -0
- package/skills/pixelcraft-web/references/react-next.md +112 -13
- package/skills/pixelcraft-web/references/rendering-choice.md +63 -0
- package/skills/pixelcraft-web/references/rendering-performance.md +80 -0
- package/skills/pixelcraft-web/references/rich-text-and-code-editors.md +220 -0
- package/skills/pixelcraft-web/references/rive-lottie.md +73 -0
- package/skills/pixelcraft-web/references/scene-architecture.md +132 -0
- package/skills/pixelcraft-web/references/server-rendered.md +106 -63
- package/skills/pixelcraft-web/references/shader-workflow.md +77 -0
- package/skills/pixelcraft-web/references/smooth-scroll.md +58 -0
- package/skills/pixelcraft-web/references/solid.md +67 -16
- package/skills/pixelcraft-web/references/state-architecture.md +107 -0
- package/skills/pixelcraft-web/references/styling-ecosystem.md +273 -0
- package/skills/pixelcraft-web/references/svelte.md +61 -11
- package/skills/pixelcraft-web/references/tailwind.md +40 -14
- package/skills/pixelcraft-web/references/video-media.md +69 -0
- package/skills/pixelcraft-web/references/vue-nuxt.md +37 -13
- package/skills/pixelcraft-web/references/web-3d-engines.md +97 -0
package/scripts/test-shoot.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import path from 'node:path';
|
|
|
5
5
|
import { spawnSync } from 'node:child_process';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
7
|
|
|
8
|
-
if (process.argv.includes('--help')) {
|
|
8
|
+
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
9
9
|
console.log('Usage: node scripts/test-shoot.mjs');
|
|
10
10
|
process.exit(0);
|
|
11
11
|
}
|
|
@@ -13,6 +13,28 @@ if (process.argv.includes('--help')) {
|
|
|
13
13
|
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'pixelcraft-shoot-test-'));
|
|
14
14
|
try {
|
|
15
15
|
const local = (file) => fileURLToPath(new URL(`../skills/pixelcraft-visual-qa/scripts/${file}`, import.meta.url));
|
|
16
|
+
const rawRun = (...args) => spawnSync(process.execPath, [local('shoot.mjs'), ...args], { encoding: 'utf8', timeout: 30000 });
|
|
17
|
+
|
|
18
|
+
const helpRes = rawRun('--help');
|
|
19
|
+
assert.equal(helpRes.status, 0, helpRes.stderr);
|
|
20
|
+
assert.match(helpRes.stdout, /--executable-path/);
|
|
21
|
+
assert.match(helpRes.stdout, /--forced-colors/);
|
|
22
|
+
assert.match(helpRes.stdout, /--locale/);
|
|
23
|
+
|
|
24
|
+
for (const [args, pattern] of [
|
|
25
|
+
[['--out'], /--out requires a value/],
|
|
26
|
+
[['--timeout', '0'], /--timeout must be a positive number/],
|
|
27
|
+
[['--timeout=abc'], /--timeout must be a positive number/],
|
|
28
|
+
[['--forced-colors', 'inverted'], /--forced-colors must be 'none' or 'active'/],
|
|
29
|
+
[['--locale='], /--locale requires a value/],
|
|
30
|
+
[['--executable-path'], /--executable-path requires a value/],
|
|
31
|
+
]) {
|
|
32
|
+
const failed = rawRun('https://example.com', ...args);
|
|
33
|
+
assert.notEqual(failed.status, 0, `expected failure for ${args.join(' ')}`);
|
|
34
|
+
assert.match(failed.stderr, pattern);
|
|
35
|
+
}
|
|
36
|
+
console.log('ok 0 - shoot CLI validates flags, timeout, forced-colors, locale, and executable-path');
|
|
37
|
+
|
|
16
38
|
const run = (fixture, ...options) => spawnSync(process.execPath, [
|
|
17
39
|
local('shoot.mjs'), local(`fixtures/${fixture}`), '--out', dir, '--project',
|
|
18
40
|
process.env.PIXELCRAFT_TEST_PLAYWRIGHT_PROJECT ?? process.cwd(), '--breakpoints=390x844,768x1024',
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import assert from 'node:assert/strict';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import path from 'node:path';
|
|
2
5
|
import { spawnSync } from 'node:child_process';
|
|
3
6
|
import { fileURLToPath } from 'node:url';
|
|
4
7
|
|
|
5
|
-
if (process.argv.includes('--help')) {
|
|
8
|
+
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
6
9
|
console.log('Usage: node scripts/test-slop-scan.mjs');
|
|
7
10
|
process.exit(0);
|
|
8
11
|
}
|
|
9
12
|
|
|
10
13
|
const base = new URL('../skills/pixelcraft-review/scripts/', import.meta.url);
|
|
11
14
|
const local = (relative) => fileURLToPath(new URL(relative, base));
|
|
12
|
-
const
|
|
13
|
-
const result = spawnSync(process.execPath, [local('slop-scan.mjs'),
|
|
15
|
+
const runPath = (target, ...args) => {
|
|
16
|
+
const result = spawnSync(process.execPath, [local('slop-scan.mjs'), target, '--json', ...args], { encoding: 'utf8' });
|
|
14
17
|
assert.equal(result.status, 0, result.stderr);
|
|
15
18
|
return JSON.parse(result.stdout);
|
|
16
19
|
};
|
|
20
|
+
const run = (file, ...args) => runPath(local(`fixtures/${file}`), ...args);
|
|
21
|
+
|
|
17
22
|
assert.equal(run('slop.html').score, 40);
|
|
18
23
|
assert.equal(run('clean.html').score, 0);
|
|
19
24
|
const { findings } = run('brand-critique.css');
|
|
@@ -21,9 +26,391 @@ assert.deepEqual(findings.map(({ rule, line }) => [rule, line]), [
|
|
|
21
26
|
['gradient-text-treatment', 3], ['rounded-accent-rail', 8],
|
|
22
27
|
]);
|
|
23
28
|
console.log('ok 1 - advisory rules flag decorative forms, not plain styles, and preserve prior scores');
|
|
29
|
+
|
|
24
30
|
const waived = run('brand-critique.css', '--waivers', local('fixtures/brand-critique-waivers.json'));
|
|
25
31
|
assert.deepEqual(waived.findings.map(({ rule }) => rule), ['rounded-accent-rail']);
|
|
26
32
|
assert.equal(waived.waived[0].label, 'waived');
|
|
27
33
|
assert.match(waived.waived[0].reason, /approved wordmark/i);
|
|
28
34
|
assert.equal(waived.unusedWaivers[0].line, 17);
|
|
29
35
|
console.log('ok 2 - scoped brand waiver preserves the evidence and reports stale waivers');
|
|
36
|
+
|
|
37
|
+
const longhand = run('focus-longhand-removal.css');
|
|
38
|
+
assert.deepEqual(longhand.findings.map(({ rule, line, match }) => [rule, line, match]), [
|
|
39
|
+
['outline-removed', 2, 'outline-style: none'],
|
|
40
|
+
['outline-removed', 6, 'outline-style: hidden'],
|
|
41
|
+
['outline-removed', 10, 'outline-width: 0'],
|
|
42
|
+
['outline-removed', 14, 'outline: none'],
|
|
43
|
+
['outline-removed', 19, 'outline: none'],
|
|
44
|
+
]);
|
|
45
|
+
console.log('ok 3 - longhand outline removals and zero/transparent box-shadow non-replacements are caught while system/light-dark/contrast-color tokens pass');
|
|
46
|
+
|
|
47
|
+
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'pixelcraft-slop-scan-'));
|
|
48
|
+
try {
|
|
49
|
+
// Tailwind + inline styles + positive-tabindex + generic-copy + motion
|
|
50
|
+
const twBad = path.join(tmp, 'BadComponent.tsx');
|
|
51
|
+
fs.writeFileSync(twBad, `export function BadComponent() {
|
|
52
|
+
return (
|
|
53
|
+
<div>
|
|
54
|
+
<button className="px-4 focus:outline-none">No ring</button>
|
|
55
|
+
<a className="focus-visible:outline-0 focus-visible:ring-0" href="/x">Zero ring</a>
|
|
56
|
+
<button className="focus:outline-none focus-visible:ring-2">Safe ring</button>
|
|
57
|
+
<button className="focus:outline-none focus-visible:outline-2">Safe outline</button>
|
|
58
|
+
<button className="focus:outline-none focus:border-blue-600">Safe border</button>
|
|
59
|
+
<div className="transition-all duration-200">Broad transition</div>
|
|
60
|
+
<h1 className="bg-gradient-to-r from-red-500 to-amber-500 bg-clip-text text-transparent">Banner</h1>
|
|
61
|
+
<h2 className="bg-linear-to-r from-red-500 to-amber-500 bg-clip-text text-transparent">V4 Banner</h2>
|
|
62
|
+
<span className="animate-bounce">Bouncing</span>
|
|
63
|
+
<button style={{ outline: 'none' }}>Inline outline none</button>
|
|
64
|
+
<input tabIndex={2} aria-label="Order" />
|
|
65
|
+
<p>Supercharge your cutting-edge analytics</p>
|
|
66
|
+
</div>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
`);
|
|
70
|
+
const twRes = runPath(twBad);
|
|
71
|
+
const rulesAndLines = twRes.findings.map(({ rule, line }) => `${rule}:${line}`);
|
|
72
|
+
assert.ok(rulesAndLines.includes('outline-removed:4'), `expected focus:outline-none: ${rulesAndLines}`);
|
|
73
|
+
assert.ok(rulesAndLines.includes('outline-removed:5'), `expected focus-visible:outline-0 with ring-0: ${rulesAndLines}`);
|
|
74
|
+
assert.ok(!rulesAndLines.includes('outline-removed:6'), `safe ring flagged: ${rulesAndLines}`);
|
|
75
|
+
assert.ok(!rulesAndLines.includes('outline-removed:7'), `safe outline flagged: ${rulesAndLines}`);
|
|
76
|
+
assert.ok(!rulesAndLines.includes('outline-removed:8'), `safe border flagged: ${rulesAndLines}`);
|
|
77
|
+
assert.ok(rulesAndLines.includes('transition-all:9'), `expected Tailwind transition-all: ${rulesAndLines}`);
|
|
78
|
+
assert.ok(rulesAndLines.includes('gradient-text-treatment:10'), `expected Tailwind bg-gradient-to: ${rulesAndLines}`);
|
|
79
|
+
assert.ok(rulesAndLines.includes('gradient-text-treatment:11'), `expected Tailwind bg-linear-to: ${rulesAndLines}`);
|
|
80
|
+
assert.ok(rulesAndLines.includes('missing-reduced-motion:12'), `expected Tailwind animate-bounce missing reduced motion: ${rulesAndLines}`);
|
|
81
|
+
assert.ok(rulesAndLines.includes('outline-removed:13'), `expected inline JSX outline none: ${rulesAndLines}`);
|
|
82
|
+
assert.ok(rulesAndLines.includes('positive-tabindex:14'), `expected positive tabIndex: ${rulesAndLines}`);
|
|
83
|
+
assert.equal(twRes.findings.find((f) => f.rule === 'positive-tabindex').weight, 3);
|
|
84
|
+
assert.ok(rulesAndLines.includes('generic-copy:15'), `expected supercharge/cutting-edge: ${rulesAndLines}`);
|
|
85
|
+
console.log('ok 4 - Tailwind utilities, inline styles, positive-tabindex, and supercharge/cutting-edge copy are detected');
|
|
86
|
+
|
|
87
|
+
// False-positive reductions: useTransition, code identifiers, labeled multi-line inputs, custom brand font stack, motion-reduce
|
|
88
|
+
const cleanTsx = path.join(tmp, 'CleanComponent.tsx');
|
|
89
|
+
fs.writeFileSync(cleanTsx, `import { useTransition } from 'react';
|
|
90
|
+
// animation: fade 1s; transition: all 200ms; font-family: Inter;
|
|
91
|
+
export function unlockAccount(getStartedUrl: string) {
|
|
92
|
+
const [isPending, startTransition] = useTransition();
|
|
93
|
+
const unlock_account = Boolean(getStartedUrl);
|
|
94
|
+
return (
|
|
95
|
+
<form style={{ fontFamily: "'Fraunces', Inter, sans-serif" }}>
|
|
96
|
+
<label htmlFor="email-field">Work email</label>
|
|
97
|
+
<input
|
|
98
|
+
id="email-field"
|
|
99
|
+
type="email"
|
|
100
|
+
placeholder="name@company.com"
|
|
101
|
+
tabIndex={0}
|
|
102
|
+
/>
|
|
103
|
+
<label>
|
|
104
|
+
Notes
|
|
105
|
+
<textarea
|
|
106
|
+
rows={3}
|
|
107
|
+
placeholder="Optional details"
|
|
108
|
+
tabIndex={-1}
|
|
109
|
+
/>
|
|
110
|
+
</label>
|
|
111
|
+
<span className="animate-spin motion-reduce:animate-none">{isPending ? 'Saving' : String(unlock_account)}</span>
|
|
112
|
+
</form>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
`);
|
|
116
|
+
const cleanTsxRes = runPath(cleanTsx);
|
|
117
|
+
assert.deepEqual(cleanTsxRes.findings, [], `unexpected findings on clean TSX: ${JSON.stringify(cleanTsxRes.findings)}`);
|
|
118
|
+
|
|
119
|
+
// Multi-line unlabeled input IS still caught, and default-font-only stack IS caught
|
|
120
|
+
const unlabeled = path.join(tmp, 'Unlabeled.astro');
|
|
121
|
+
fs.writeFileSync(unlabeled, `<style>
|
|
122
|
+
body { font-family: 'Inter', system-ui, sans-serif; }
|
|
123
|
+
.brand { font-family: 'Fraunces', Inter, sans-serif; }
|
|
124
|
+
button:focus-visible { outline-style: none; }
|
|
125
|
+
</style>
|
|
126
|
+
<input
|
|
127
|
+
type="text"
|
|
128
|
+
placeholder="Search inventory"
|
|
129
|
+
tabindex="3"
|
|
130
|
+
/>
|
|
131
|
+
`);
|
|
132
|
+
const astroRes = runPath(unlabeled);
|
|
133
|
+
assert.deepEqual(astroRes.findings.map(({ rule, line }) => [rule, line]).sort((a, b) => a[1] - b[1]), [
|
|
134
|
+
['default-font-only', 2],
|
|
135
|
+
['outline-removed', 4],
|
|
136
|
+
['placeholder-as-label', 6],
|
|
137
|
+
['positive-tabindex', 9],
|
|
138
|
+
]);
|
|
139
|
+
console.log('ok 5 - false positives are avoided for useTransition, code identifiers, labeled multi-line inputs, and brand font stacks while real defects in .astro are caught');
|
|
140
|
+
|
|
141
|
+
// Expanded extensions, skips, and skillHosts
|
|
142
|
+
const walkDir = path.join(tmp, 'walk-test');
|
|
143
|
+
fs.mkdirSync(path.join(walkDir, '.next'), { recursive: true });
|
|
144
|
+
fs.mkdirSync(path.join(walkDir, '.windsurf/skills/pixelcraft-review'), { recursive: true });
|
|
145
|
+
fs.mkdirSync(path.join(walkDir, 'src'), { recursive: true });
|
|
146
|
+
fs.writeFileSync(path.join(walkDir, '.next', 'ignored.css'), 'button:focus { outline: none; }\n');
|
|
147
|
+
fs.writeFileSync(path.join(walkDir, '.windsurf/skills/pixelcraft-review', 'ignored.css'), 'button:focus { outline: none; }\n');
|
|
148
|
+
fs.writeFileSync(path.join(walkDir, 'src', 'app.pcss'), 'button:focus-visible { outline-width: 0; }\n');
|
|
149
|
+
fs.writeFileSync(path.join(walkDir, 'src', 'hud.gd'), '# TODO: wire stamina bar\nvar color = "#ffffff"\n');
|
|
150
|
+
const walkRes = runPath(walkDir);
|
|
151
|
+
assert.equal(walkRes.findings.length, 2);
|
|
152
|
+
assert.deepEqual(walkRes.findings.map((f) => [f.file.replace(/\\/g, '/'), f.rule]).sort(), [
|
|
153
|
+
['src/app.pcss', 'outline-removed'],
|
|
154
|
+
['src/hud.gd', 'todo-stub-in-ui'],
|
|
155
|
+
]);
|
|
156
|
+
console.log('ok 6 - directory scan includes expanded extensions (including .gd/.pcss) and skips build directories and installed skill hosts');
|
|
157
|
+
|
|
158
|
+
// Anti-laziness detectors: TODO/FIXME/ellipsis stubs, empty event handlers, lazy DIY antipatterns, and 2025-2026 generic copy
|
|
159
|
+
const lazyTsx = path.join(tmp, 'LazyView.tsx');
|
|
160
|
+
fs.writeFileSync(lazyTsx, `export function LazyView() {
|
|
161
|
+
// TODO: implement pagination
|
|
162
|
+
const runFormat = () => document.execCommand('bold');
|
|
163
|
+
const empower = (x: string) => x;
|
|
164
|
+
return (
|
|
165
|
+
<form onSubmit={(e) => { e.preventDefault(); }}>
|
|
166
|
+
<p>Built for modern teams with an ai-powered, effortless, next-gen workspace.</p>
|
|
167
|
+
{/* ... more items */}
|
|
168
|
+
<button onClick={() => {}}>Submit</button>
|
|
169
|
+
<a href="#">Dead anchor</a>
|
|
170
|
+
<a href="#" onClick={runFormat}>Handled anchor</a>
|
|
171
|
+
<a href="#" role="button">Role anchor</a>
|
|
172
|
+
<span>{empower('ok')}</span>
|
|
173
|
+
</form>
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
`);
|
|
177
|
+
const lazyRes = runPath(lazyTsx);
|
|
178
|
+
const lazyRules = lazyRes.findings.map(({ rule, line }) => `${rule}:${line}`);
|
|
179
|
+
assert.ok(lazyRules.includes('todo-stub-in-ui:2'), `expected TODO stub: ${lazyRules}`);
|
|
180
|
+
assert.ok(lazyRules.includes('lazy-diy-antipattern:3'), `expected execCommand: ${lazyRules}`);
|
|
181
|
+
assert.ok(lazyRules.includes('empty-event-handler:6'), `expected preventDefault-only onSubmit: ${lazyRules}`);
|
|
182
|
+
assert.ok(lazyRules.includes('generic-copy:7'), `expected 2025-2026 AI clichés: ${lazyRules}`);
|
|
183
|
+
assert.ok(lazyRules.includes('todo-stub-in-ui:8'), `expected ellipsis stub: ${lazyRules}`);
|
|
184
|
+
assert.ok(lazyRules.includes('empty-event-handler:9'), `expected empty onClick: ${lazyRules}`);
|
|
185
|
+
assert.ok(lazyRules.includes('empty-event-handler:10'), `expected dead href="#": ${lazyRules}`);
|
|
186
|
+
assert.ok(!lazyRules.includes('empty-event-handler:11'), `handled href="#" false positive: ${lazyRules}`);
|
|
187
|
+
assert.ok(!lazyRules.includes('empty-event-handler:12'), `role="button" href="#" false positive: ${lazyRules}`);
|
|
188
|
+
assert.ok(!lazyRules.includes('generic-copy:4'), `identifier empower false positive: ${lazyRules}`);
|
|
189
|
+
assert.ok(!lazyRules.includes('generic-copy:13'), `call empower() false positive: ${lazyRules}`);
|
|
190
|
+
console.log('ok 7 - anti-laziness detectors (TODO/ellipsis stubs, empty handlers, execCommand) and 2025-2026 AI copy work with zero false positives on valid code');
|
|
191
|
+
|
|
192
|
+
// Python # comment masking, hex preservation, tkinter detection, Lua -- & ClojureScript ; comment masking
|
|
193
|
+
const pyFile = path.join(tmp, 'desktop_app.py');
|
|
194
|
+
fs.writeFileSync(pyFile, `# Seamless effortless dashboard comment that should be masked
|
|
195
|
+
import tkinter as tk
|
|
196
|
+
# TODO: replace placeholder dialog
|
|
197
|
+
PALETTE = """
|
|
198
|
+
background: #fff;
|
|
199
|
+
color: #111111;
|
|
200
|
+
"""
|
|
201
|
+
label = "Revenue ledger" # unleash next-gen
|
|
202
|
+
`);
|
|
203
|
+
const pyRes = runPath(pyFile);
|
|
204
|
+
assert.deepEqual(pyRes.findings.map(({ rule, line }) => [rule, line]), [
|
|
205
|
+
['todo-stub-in-ui', 3],
|
|
206
|
+
['lazy-diy-antipattern', 2],
|
|
207
|
+
]);
|
|
208
|
+
|
|
209
|
+
const cleanPy = path.join(tmp, 'clean_app.py');
|
|
210
|
+
fs.writeFileSync(cleanPy, `# Effortless next-gen comment is masked and ignored
|
|
211
|
+
PRIMARY = "#fff" # delve into notes
|
|
212
|
+
SECONDARY = '#1a2b3c'
|
|
213
|
+
`);
|
|
214
|
+
assert.deepEqual(runPath(cleanPy).findings, [], 'clean Python file with # comments and hex strings should produce zero findings');
|
|
215
|
+
|
|
216
|
+
const luaFile = path.join(tmp, 'hud.lua');
|
|
217
|
+
fs.writeFileSync(luaFile, `-- Seamless effortless next-gen comment\nlocal title = "Inventory"\n`);
|
|
218
|
+
assert.deepEqual(runPath(luaFile).findings, [], 'Lua -- comment should be masked');
|
|
219
|
+
|
|
220
|
+
const cljsFile = path.join(tmp, 'view.cljs');
|
|
221
|
+
fs.writeFileSync(cljsFile, `; Seamless next-gen comment\n(def label "Ledger 'ok")\n`);
|
|
222
|
+
assert.deepEqual(runPath(cljsFile).findings, [], 'ClojureScript ; comment should be masked');
|
|
223
|
+
|
|
224
|
+
const cssHash = path.join(tmp, 'todo.css');
|
|
225
|
+
fs.writeFileSync(cssHash, `#todo { color: var(--ink); }\n`);
|
|
226
|
+
assert.deepEqual(runPath(cssHash).findings, [], 'CSS #todo ID selector must not trigger todo-stub-in-ui');
|
|
227
|
+
console.log('ok 8 - Python #, Lua --, and ClojureScript ; comment masking preserve hex strings and avoid CSS #todo false positives');
|
|
228
|
+
|
|
229
|
+
// Native non-JS floor rules + native reduced-motion + hardcoded-color-literals fix
|
|
230
|
+
const ktBad = path.join(tmp, 'BadScreen.kt');
|
|
231
|
+
fs.writeFileSync(ktBad, `import androidx.compose.ui.graphics.Color
|
|
232
|
+
val c1 = Color(0xFF112233)
|
|
233
|
+
val c2 = Color(0xFF223344)
|
|
234
|
+
val c3 = Color(0xFF334455)
|
|
235
|
+
val c4 = Color(0xFF445566)
|
|
236
|
+
val c5 = Color(0xFF556677)
|
|
237
|
+
val c6 = Color(0xFF667788)
|
|
238
|
+
val raw = Color.Red
|
|
239
|
+
val raw2 = Color.Blue
|
|
240
|
+
val alpha by animateFloatAsState(targetValue = 1f)
|
|
241
|
+
Text("Total", fontSize = 14.dp)
|
|
242
|
+
`);
|
|
243
|
+
const ktRes = runPath(ktBad);
|
|
244
|
+
const ktRules = ktRes.findings.map((f) => f.rule);
|
|
245
|
+
assert.ok(ktRules.includes('compose-dp-font-size'), `expected compose-dp-font-size: ${ktRules}`);
|
|
246
|
+
assert.ok(ktRules.includes('missing-reduced-motion'), `expected Compose reduced-motion: ${ktRules}`);
|
|
247
|
+
assert.ok(ktRules.includes('hardcoded-color-literals'), `expected hardcoded-color-literals despite Color.Red/Blue: ${ktRules}`);
|
|
248
|
+
|
|
249
|
+
const ktGood = path.join(tmp, 'GoodScreen.kt');
|
|
250
|
+
fs.writeFileSync(ktGood, `val scale = Settings.Global.ANIMATOR_DURATION_SCALE
|
|
251
|
+
val tint = MaterialTheme.colorScheme.primary
|
|
252
|
+
val alpha by animateFloatAsState(targetValue = if (scale == 0f) 1f else 0.5f)
|
|
253
|
+
Text("Total", fontSize = 14.sp, color = tint)
|
|
254
|
+
`);
|
|
255
|
+
assert.deepEqual(runPath(ktGood).findings, [], 'clean Compose file with .sp, MaterialTheme.colorScheme, and ANIMATOR_DURATION_SCALE passes');
|
|
256
|
+
|
|
257
|
+
const dartBad = path.join(tmp, 'bad_widget.dart');
|
|
258
|
+
fs.writeFileSync(dartBad, `final ctrl = AnimationController(vsync: this);
|
|
259
|
+
final child = MediaQuery(data: data.copyWith(textScaler: TextScaler.noScaling), child: Text("Hi"));
|
|
260
|
+
`);
|
|
261
|
+
const dartRes = runPath(dartBad);
|
|
262
|
+
assert.deepEqual(dartRes.findings.map((f) => f.rule).sort(), ['flutter-text-scaling-locked', 'missing-reduced-motion']);
|
|
263
|
+
|
|
264
|
+
const dartGood = path.join(tmp, 'good_widget.dart');
|
|
265
|
+
fs.writeFileSync(dartGood, `final reduce = MediaQuery.disableAnimationsOf(context);
|
|
266
|
+
final ctrl = AnimationController(vsync: this, duration: reduce ? Duration.zero : Duration(milliseconds: 200));
|
|
267
|
+
final themeColor = Theme.of(context).colorScheme.primary;
|
|
268
|
+
`);
|
|
269
|
+
assert.deepEqual(runPath(dartGood).findings, [], 'clean Flutter file with disableAnimations and Theme.of passes');
|
|
270
|
+
|
|
271
|
+
const swiftBad = path.join(tmp, 'BadView.swift');
|
|
272
|
+
fs.writeFileSync(swiftBad, `struct BadView: View {
|
|
273
|
+
var body: some View {
|
|
274
|
+
Button("Save") { withAnimation { expanded.toggle() } }
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
`);
|
|
278
|
+
assert.deepEqual(runPath(swiftBad).findings.map((f) => f.rule), ['missing-reduced-motion']);
|
|
279
|
+
|
|
280
|
+
const swiftGood = path.join(tmp, 'GoodView.swift');
|
|
281
|
+
fs.writeFileSync(swiftGood, `struct GoodView: View {
|
|
282
|
+
@Environment(\\.accessibilityReduceMotion) var reduceMotion
|
|
283
|
+
var body: some View {
|
|
284
|
+
Button("Save") { withAnimation(reduceMotion ? nil : .default) { expanded.toggle() } }
|
|
285
|
+
.foregroundStyle(Color("SurfaceInk"))
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
`);
|
|
289
|
+
assert.deepEqual(runPath(swiftGood).findings, [], 'clean SwiftUI file with accessibilityReduceMotion passes');
|
|
290
|
+
|
|
291
|
+
const rsBad = path.join(tmp, 'bad_egui.rs');
|
|
292
|
+
fs.writeFileSync(rsBad, `fn update(ctx: &egui::Context) {
|
|
293
|
+
let _a = [Color32::from_rgb(1,2,3), Color32::from_rgb(2,3,4), Color32::from_rgb(3,4,5),
|
|
294
|
+
Color32::from_rgb(4,5,6), Color32::from_rgb(5,6,7), Color32::from_rgb(6,7,8)];
|
|
295
|
+
ctx.request_repaint();
|
|
296
|
+
}
|
|
297
|
+
`);
|
|
298
|
+
assert.deepEqual(runPath(rsBad).findings.map((f) => f.rule).sort(), ['egui-unconditional-repaint', 'hardcoded-color-literals']);
|
|
299
|
+
|
|
300
|
+
const rsGood = path.join(tmp, 'good_egui.rs');
|
|
301
|
+
fs.writeFileSync(rsGood, `fn update(ctx: &egui::Context) {
|
|
302
|
+
ctx.request_repaint_after(std::time::Duration::from_millis(250));
|
|
303
|
+
}
|
|
304
|
+
`);
|
|
305
|
+
assert.deepEqual(runPath(rsGood).findings, [], 'egui using request_repaint_after passes');
|
|
306
|
+
|
|
307
|
+
const gsapBad = path.join(tmp, 'MotionCard.tsx');
|
|
308
|
+
fs.writeFileSync(gsapBad, `export function MotionCard() {
|
|
309
|
+
gsap.to('.box', { x: 100 });
|
|
310
|
+
return <motion.div whileInView={{ opacity: 1 }}>Content</motion.div>;
|
|
311
|
+
}
|
|
312
|
+
`);
|
|
313
|
+
assert.deepEqual(runPath(gsapBad).findings.map((f) => f.rule), ['missing-reduced-motion']);
|
|
314
|
+
|
|
315
|
+
const gsapGood = path.join(tmp, 'MotionCardSafe.tsx');
|
|
316
|
+
fs.writeFileSync(gsapGood, `export function MotionCardSafe() {
|
|
317
|
+
const prefersReduced = useReducedMotion();
|
|
318
|
+
return <motion.div whileInView={{ opacity: 1 }}>{String(prefersReduced)}</motion.div>;
|
|
319
|
+
}
|
|
320
|
+
`);
|
|
321
|
+
assert.deepEqual(runPath(gsapGood).findings, [], 'Motion with useReducedMotion passes');
|
|
322
|
+
console.log('ok 9 - native floor rules (Compose .dp, Flutter TextScaler.noScaling, egui request_repaint), SwiftUI/Compose/Flutter/GSAP/Motion reduced-motion, and color literal rules work');
|
|
323
|
+
|
|
324
|
+
// --fail-on threshold behavior and --help documentation
|
|
325
|
+
const helpOut = spawnSync(process.execPath, [local('slop-scan.mjs'), '--help'], { encoding: 'utf8' });
|
|
326
|
+
assert.equal(helpOut.status, 0);
|
|
327
|
+
assert.match(helpOut.stdout, /--fail-on/);
|
|
328
|
+
|
|
329
|
+
const p0Fail = spawnSync(process.execPath, [local('slop-scan.mjs'), dartBad, '--json', '--fail-on', 'p0'], { encoding: 'utf8' });
|
|
330
|
+
assert.equal(p0Fail.status, 1, 'P0 finding must fail under --fail-on p0');
|
|
331
|
+
assert.equal(JSON.parse(p0Fail.stdout).findings.some((f) => f.severity === 'P0'), true);
|
|
332
|
+
|
|
333
|
+
const p0PassOnP1Only = spawnSync(process.execPath, [local('slop-scan.mjs'), swiftBad, '--json', '--fail-on', 'p0'], { encoding: 'utf8' });
|
|
334
|
+
assert.equal(p0PassOnP1Only.status, 0, 'P1-only finding should exit 0 under --fail-on p0');
|
|
335
|
+
|
|
336
|
+
const p1FailOnP1 = spawnSync(process.execPath, [local('slop-scan.mjs'), swiftBad, '--json', '--fail-on=p1'], { encoding: 'utf8' });
|
|
337
|
+
assert.equal(p1FailOnP1.status, 1, 'P1 finding must fail under --fail-on=p1');
|
|
338
|
+
|
|
339
|
+
const anyFailOnP3 = spawnSync(process.execPath, [local('slop-scan.mjs'), local('fixtures/brand-critique.css'), '--fail-on', 'any'], { encoding: 'utf8' });
|
|
340
|
+
assert.equal(anyFailOnP3.status, 1, 'P3 finding must fail under --fail-on any');
|
|
341
|
+
|
|
342
|
+
const cleanAny = spawnSync(process.execPath, [local('slop-scan.mjs'), local('fixtures/clean.html'), '--fail-on', 'any'], { encoding: 'utf8' });
|
|
343
|
+
assert.equal(cleanAny.status, 0, 'clean file must exit 0 under --fail-on any');
|
|
344
|
+
|
|
345
|
+
const invalidFailOn = spawnSync(process.execPath, [local('slop-scan.mjs'), local('fixtures/clean.html'), '--fail-on', 'p9'], { encoding: 'utf8' });
|
|
346
|
+
assert.equal(invalidFailOn.status, 1);
|
|
347
|
+
console.log('ok 10 - --fail-on p0|p1|p2|any enforces severity exit gates while preserving default exit 0');
|
|
348
|
+
|
|
349
|
+
// 11. Studio-Grade 2026 rules: ime-enter-without-composing, important-override-sprawl, and mv3-remote-script
|
|
350
|
+
const imeBad = path.join(tmp, 'ChatComposerBad.tsx');
|
|
351
|
+
fs.writeFileSync(imeBad, `export function ChatComposerBad({ send }: { send: () => void }) {
|
|
352
|
+
return (
|
|
353
|
+
<label>
|
|
354
|
+
Message
|
|
355
|
+
<textarea onKeyDown={(e) => { if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); send(); } }} />
|
|
356
|
+
</label>
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
`);
|
|
360
|
+
assert.deepEqual(runPath(imeBad).findings.map((f) => f.rule), ['ime-enter-without-composing']);
|
|
361
|
+
|
|
362
|
+
const imeGood = path.join(tmp, 'ChatComposerGood.tsx');
|
|
363
|
+
fs.writeFileSync(imeGood, `export function ChatComposerGood({ send }: { send: () => void }) {
|
|
364
|
+
return (
|
|
365
|
+
<label>
|
|
366
|
+
Message
|
|
367
|
+
<textarea onKeyDown={(e) => {
|
|
368
|
+
if (e.nativeEvent.isComposing || e.keyCode === 229) return;
|
|
369
|
+
if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); send(); }
|
|
370
|
+
}} />
|
|
371
|
+
</label>
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
`);
|
|
375
|
+
assert.deepEqual(runPath(imeGood).findings, [], 'IME-guarded Enter handler should pass');
|
|
376
|
+
|
|
377
|
+
const impBad = path.join(tmp, 'sprawl.css');
|
|
378
|
+
fs.writeFileSync(impBad, `.a { color: var(--ink) !important; }
|
|
379
|
+
.b { padding: 8px !important; }
|
|
380
|
+
.c { margin: 0 !important; }
|
|
381
|
+
.d { display: block !important; }
|
|
382
|
+
`);
|
|
383
|
+
assert.deepEqual(runPath(impBad).findings.map((f) => f.rule), ['important-override-sprawl']);
|
|
384
|
+
|
|
385
|
+
const impGood = path.join(tmp, 'a11y-print.css');
|
|
386
|
+
fs.writeFileSync(impGood, `@media (prefers-reduced-motion: reduce) {
|
|
387
|
+
*, *::before, *::after {
|
|
388
|
+
animation-duration: 0.01ms !important;
|
|
389
|
+
animation-iteration-count: 1 !important;
|
|
390
|
+
transition-duration: 0.01ms !important;
|
|
391
|
+
scroll-behavior: auto !important;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
@media print {
|
|
395
|
+
.no-print { display: none !important; }
|
|
396
|
+
.sheet { background: transparent !important; }
|
|
397
|
+
}
|
|
398
|
+
`);
|
|
399
|
+
assert.deepEqual(runPath(impGood).findings, [], 'prefers-reduced-motion and @media print !important resets must not be flagged');
|
|
400
|
+
|
|
401
|
+
const mv3Dir = path.join(tmp, 'mv3-ext');
|
|
402
|
+
fs.mkdirSync(mv3Dir, { recursive: true });
|
|
403
|
+
fs.writeFileSync(path.join(mv3Dir, 'manifest.json'), JSON.stringify({ manifest_version: 3, name: 'Test Ext', version: '1.0.0' }));
|
|
404
|
+
const mv3Popup = path.join(mv3Dir, 'popup.html');
|
|
405
|
+
fs.writeFileSync(mv3Popup, `<!doctype html><html lang="en"><head><title>Ext</title><script src="https://cdn.example.com/sdk.js"></script></head><body><h1>Inspector</h1></body></html>\n`);
|
|
406
|
+
assert.deepEqual(runPath(mv3Popup).findings.map((f) => f.rule), ['mv3-remote-script']);
|
|
407
|
+
|
|
408
|
+
const regularWeb = path.join(tmp, 'marketing.html');
|
|
409
|
+
fs.writeFileSync(regularWeb, `<!doctype html><html lang="en"><head><title>Site</title><script src="https://plausible.io/js/script.js" defer></script></head><body><h1>Docs</h1></body></html>\n`);
|
|
410
|
+
assert.deepEqual(runPath(regularWeb).findings, [], 'normal non-MV3 web page with deferred script should not trigger mv3-remote-script');
|
|
411
|
+
console.log('ok 11 - ime-enter-without-composing, important-override-sprawl, and mv3-remote-script catch real defects with zero false positives');
|
|
412
|
+
} finally {
|
|
413
|
+
fs.rmSync(tmp, { recursive: true, force: true });
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
|
|
@@ -7,6 +7,11 @@ import os from 'node:os';
|
|
|
7
7
|
import path from 'node:path';
|
|
8
8
|
import { fileURLToPath } from 'node:url';
|
|
9
9
|
|
|
10
|
+
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
11
|
+
console.log('Usage: node scripts/test-style-inventory.mjs');
|
|
12
|
+
process.exit(0);
|
|
13
|
+
}
|
|
14
|
+
|
|
10
15
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
11
16
|
const script = path.join(root, 'skills/pixelcraft-visual-qa/scripts/style-inventory.mjs');
|
|
12
17
|
const fixture = path.join(root, 'skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.html');
|
|
@@ -40,6 +45,24 @@ function runInventoryAsync(target, outPath, extra = []) {
|
|
|
40
45
|
}
|
|
41
46
|
|
|
42
47
|
try {
|
|
48
|
+
const helpRes = spawnSync(process.execPath, [script, '--help'], { encoding: 'utf8', cwd: root });
|
|
49
|
+
assert.equal(helpRes.status, 0, helpRes.stderr);
|
|
50
|
+
assert.match(helpRes.stdout, /--color-scheme/);
|
|
51
|
+
assert.match(helpRes.stdout, /--reduced-motion/);
|
|
52
|
+
assert.match(helpRes.stdout, /--allow-http-error/);
|
|
53
|
+
|
|
54
|
+
for (const [args, pattern] of [
|
|
55
|
+
[['--color-scheme', 'sepia'], /--color-scheme must be 'light' or 'dark'/],
|
|
56
|
+
[['--color-scheme='], /--color-scheme requires a value/],
|
|
57
|
+
[['--reduced-motion', 'slow'], /--reduced-motion must be 'no-preference' or 'reduce'/],
|
|
58
|
+
[['--reduced-motion='], /--reduced-motion requires a value/],
|
|
59
|
+
]) {
|
|
60
|
+
const failed = spawnSync(process.execPath, [script, fixture, ...args], { encoding: 'utf8', cwd: root });
|
|
61
|
+
assert.notEqual(failed.status, 0, `expected failure for ${args.join(' ')}`);
|
|
62
|
+
assert.match(failed.stderr, pattern);
|
|
63
|
+
}
|
|
64
|
+
console.log('ok 0 - style-inventory CLI validates color-scheme, reduced-motion, and allow-http-error options');
|
|
65
|
+
|
|
43
66
|
const out = path.join(tmp, 'inventory.json');
|
|
44
67
|
const result = runInventory(fixture, out, ['--breakpoints=390x500,800x600', '--wait-ms=100']);
|
|
45
68
|
const combined = `${result.stdout}\n${result.stderr}`;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { execFileSync } from 'node:child_process';
|
|
4
|
+
import fs from 'node:fs';
|
|
5
|
+
import os from 'node:os';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
|
|
9
|
+
if (process.argv.includes('--help')) {
|
|
10
|
+
console.log('Usage: node scripts/test-sync-docs.mjs');
|
|
11
|
+
process.exit(0);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
15
|
+
const script = path.join(root, 'scripts/sync-docs.mjs');
|
|
16
|
+
|
|
17
|
+
function run(args, allowFail = false) {
|
|
18
|
+
try {
|
|
19
|
+
const stdout = execFileSync(process.execPath, [script, ...args], {
|
|
20
|
+
cwd: root,
|
|
21
|
+
encoding: 'utf8',
|
|
22
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
23
|
+
});
|
|
24
|
+
return { code: 0, stdout, stderr: '' };
|
|
25
|
+
} catch (err) {
|
|
26
|
+
if (!allowFail) throw err;
|
|
27
|
+
return {
|
|
28
|
+
code: err.status ?? 1,
|
|
29
|
+
stdout: err.stdout?.toString('utf8') ?? '',
|
|
30
|
+
stderr: err.stderr?.toString('utf8') ?? '',
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// 1. --help works
|
|
36
|
+
const helpRes = run(['--help']);
|
|
37
|
+
assert.equal(helpRes.code, 0);
|
|
38
|
+
assert.match(helpRes.stdout, /--check/);
|
|
39
|
+
assert.match(helpRes.stdout, /--write/);
|
|
40
|
+
console.log('ok 1 - sync-docs.mjs supports --help');
|
|
41
|
+
|
|
42
|
+
// 2. Real repo passes --check cleanly
|
|
43
|
+
const checkRes = run(['--check', '--json']);
|
|
44
|
+
assert.equal(checkRes.code, 0);
|
|
45
|
+
const parsed = JSON.parse(checkRes.stdout);
|
|
46
|
+
assert.deepEqual(parsed.drifted, [], `Unexpected drift in repo: ${parsed.drifted.join(', ')}`);
|
|
47
|
+
assert.ok(parsed.metrics.skills >= 26);
|
|
48
|
+
assert.ok(parsed.metrics.references >= 247);
|
|
49
|
+
assert.ok(parsed.metrics.scripts >= 9);
|
|
50
|
+
assert.ok(parsed.metrics.tokenFormatCount >= 19);
|
|
51
|
+
assert.ok(parsed.metrics.scanRuleCount >= 23);
|
|
52
|
+
assert.ok(parsed.metrics.evalFixtures >= 66);
|
|
53
|
+
assert.ok(parsed.metrics.galleryExhibits >= 6);
|
|
54
|
+
console.log('ok 2 - real repository passes --check with live metrics');
|
|
55
|
+
|
|
56
|
+
// 3. Stale counts & version drift fail --check and heal cleanly under --write
|
|
57
|
+
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'pixelcraft-sync-docs-'));
|
|
58
|
+
try {
|
|
59
|
+
for (const rel of [
|
|
60
|
+
'package.json',
|
|
61
|
+
'plugin.json',
|
|
62
|
+
'gemini-extension.json',
|
|
63
|
+
'.claude-plugin',
|
|
64
|
+
'.cursor-plugin',
|
|
65
|
+
'.antigravity-plugin',
|
|
66
|
+
'.codex-plugin',
|
|
67
|
+
'.github/plugin',
|
|
68
|
+
'.devin-plugin',
|
|
69
|
+
'README.md',
|
|
70
|
+
'docs',
|
|
71
|
+
'evals',
|
|
72
|
+
'skills',
|
|
73
|
+
'bin',
|
|
74
|
+
'website/package.json',
|
|
75
|
+
'website/package-lock.json',
|
|
76
|
+
'website/src/generated/repo-meta.json',
|
|
77
|
+
'website/README.md',
|
|
78
|
+
'website/public/gallery',
|
|
79
|
+
]) {
|
|
80
|
+
const src = path.join(root, rel);
|
|
81
|
+
const dst = path.join(tmp, rel);
|
|
82
|
+
fs.mkdirSync(path.dirname(dst), { recursive: true });
|
|
83
|
+
fs.cpSync(src, dst, { recursive: true });
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Introduce deliberate drift across README.md, evals/README.md, website/package.json, website/src/generated/repo-meta.json, and .antigravity-plugin/plugin.json
|
|
87
|
+
const readmePath = path.join(tmp, 'README.md');
|
|
88
|
+
fs.writeFileSync(
|
|
89
|
+
readmePath,
|
|
90
|
+
fs.readFileSync(readmePath, 'utf8')
|
|
91
|
+
.replace(/references-\d+-0984e3\.svg" alt="\d+ References"/, 'references-199-0984e3.svg" alt="199 References"')
|
|
92
|
+
.replace(/\(\d+ JSON fixtures\)/, '(48 JSON fixtures)'),
|
|
93
|
+
'utf8',
|
|
94
|
+
);
|
|
95
|
+
const evalReadmePath = path.join(tmp, 'evals/README.md');
|
|
96
|
+
fs.writeFileSync(
|
|
97
|
+
evalReadmePath,
|
|
98
|
+
fs.readFileSync(evalReadmePath, 'utf8').replace(/\(\d+ fixtures covering/, '(48 fixtures covering'),
|
|
99
|
+
'utf8',
|
|
100
|
+
);
|
|
101
|
+
const webPkgPath = path.join(tmp, 'website/package.json');
|
|
102
|
+
const webPkg = JSON.parse(fs.readFileSync(webPkgPath, 'utf8'));
|
|
103
|
+
webPkg.version = '0.0.1';
|
|
104
|
+
fs.writeFileSync(webPkgPath, `${JSON.stringify(webPkg, null, 2)}\n`, 'utf8');
|
|
105
|
+
|
|
106
|
+
const repoMetaPath = path.join(tmp, 'website/src/generated/repo-meta.json');
|
|
107
|
+
const repoMeta = JSON.parse(fs.readFileSync(repoMetaPath, 'utf8'));
|
|
108
|
+
repoMeta.version = '0.0.1';
|
|
109
|
+
fs.writeFileSync(repoMetaPath, `${JSON.stringify(repoMeta, null, 2)}\n`, 'utf8');
|
|
110
|
+
|
|
111
|
+
const agyPath = path.join(tmp, '.antigravity-plugin/plugin.json');
|
|
112
|
+
const agyPkg = JSON.parse(fs.readFileSync(agyPath, 'utf8'));
|
|
113
|
+
agyPkg.version = '0.0.1';
|
|
114
|
+
fs.writeFileSync(agyPath, `${JSON.stringify(agyPkg, null, 2)}\n`, 'utf8');
|
|
115
|
+
|
|
116
|
+
const failRes = run(['--check', '--root', tmp], true);
|
|
117
|
+
assert.equal(failRes.code, 1, 'Expected --check to fail on drifted files');
|
|
118
|
+
assert.match(failRes.stderr, /README\.md/);
|
|
119
|
+
assert.match(failRes.stderr, /evals\/README\.md/);
|
|
120
|
+
assert.match(failRes.stderr, /website\/package\.json/);
|
|
121
|
+
assert.match(failRes.stderr, /website\/src\/generated\/repo-meta\.json/);
|
|
122
|
+
assert.match(failRes.stderr, /\.antigravity-plugin\/plugin\.json/);
|
|
123
|
+
|
|
124
|
+
const writeRes = run(['--write', '--root', tmp]);
|
|
125
|
+
assert.equal(writeRes.code, 0);
|
|
126
|
+
|
|
127
|
+
const healedRes = run(['--check', '--root', tmp]);
|
|
128
|
+
assert.equal(healedRes.code, 0);
|
|
129
|
+
const healedWebPkg = JSON.parse(fs.readFileSync(webPkgPath, 'utf8'));
|
|
130
|
+
assert.equal(healedWebPkg.version, parsed.metrics.version);
|
|
131
|
+
const healedRepoMeta = JSON.parse(fs.readFileSync(repoMetaPath, 'utf8'));
|
|
132
|
+
assert.equal(healedRepoMeta.version, parsed.metrics.version);
|
|
133
|
+
const healedAgyPkg = JSON.parse(fs.readFileSync(agyPath, 'utf8'));
|
|
134
|
+
assert.equal(healedAgyPkg.version, parsed.metrics.version);
|
|
135
|
+
console.log('ok 3 - drift fails --check and heals idempotently with --write');
|
|
136
|
+
} finally {
|
|
137
|
+
fs.rmSync(tmp, { recursive: true, force: true });
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
console.log('sync-docs tests passed');
|