@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/SECURITY.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
Security fixes apply to the latest release on the `main` branch (`0.1.x`).
|
|
6
|
+
|
|
7
|
+
## Scope
|
|
8
|
+
|
|
9
|
+
Pixelcraft is a portable Agent Skills pack with zero-dependency Node.js, Bash, and PowerShell installers plus static verification scripts. Security-relevant areas include:
|
|
10
|
+
|
|
11
|
+
- **Installers (`bin/pixelcraft.mjs`, `install.sh`, `install.ps1`):** path traversal, symlink/reparse-point handling, archive extraction safety, unintended overwrites, or command injection.
|
|
12
|
+
- **Verification scripts (`skills/*/scripts/*.mjs`):** local file server boundaries in `shoot.mjs` / `style-inventory.mjs` (dot-segment refusal, root scoping), archive/JSON parsing, and subprocess handling in `check-tui.mjs`.
|
|
13
|
+
- **Showcase website (`website/`):** static server (`serve.mjs`) path confinement and client-side XSS.
|
|
14
|
+
|
|
15
|
+
## Reporting a Vulnerability
|
|
16
|
+
|
|
17
|
+
Please **do not** open a public GitHub issue for suspected security vulnerabilities.
|
|
18
|
+
|
|
19
|
+
1. Use [GitHub Private Vulnerability Reporting](https://github.com/ThanhNguyxnOrg/Pixelcraft/security/advisories/new) on `ThanhNguyxnOrg/Pixelcraft` (preferred), or contact the maintainers via the organization profile.
|
|
20
|
+
2. Include the affected file/command, reproduction steps, environment details (OS, Node/shell version), and impact.
|
|
21
|
+
3. We aim to acknowledge reports within **72 hours** and share a remediation timeline or fix plan once confirmed.
|
|
22
|
+
|
|
23
|
+
## Installer Safety Guarantees
|
|
24
|
+
|
|
25
|
+
- Installers never invoke `sudo` or request privilege escalation.
|
|
26
|
+
- Installers default to **project scope** and refuse symlinked or reparse-point target skill directories.
|
|
27
|
+
- Existing skill folders are skipped unless `--force` (`-Force`) is explicitly passed for requested skills.
|
|
28
|
+
- Use `--dry-run` (`-DryRun`) before writing files and pin `--ref <tag|commit-sha>` in automated setups.
|
|
Binary file
|
|
Binary file
|
package/bin/pixelcraft.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
2
3
|
import fs from 'node:fs';
|
|
3
4
|
import os from 'node:os';
|
|
4
5
|
import path from 'node:path';
|
|
@@ -38,7 +39,7 @@ function expandAgents(input) {
|
|
|
38
39
|
.flatMap((value) => String(value).split(/[\s,]+/))
|
|
39
40
|
.filter(Boolean)
|
|
40
41
|
.map(canonicalAgent);
|
|
41
|
-
if (values.length === 0) throw new Error('
|
|
42
|
+
if (values.length === 0) throw new Error('command requires --agent');
|
|
42
43
|
const unknown = values.filter((name) => !validAgents.includes(name));
|
|
43
44
|
if (unknown.length) throw new Error(`invalid agent '${unknown.join(', ')}'; expected one of ${validAgents.join(', ')}`);
|
|
44
45
|
if (values.includes('all')) return canonicalAgents;
|
|
@@ -102,6 +103,14 @@ Commands:
|
|
|
102
103
|
add <skill...|all> --agent <name|all> [--global] [--dry-run] [--force] [--docs-mcp]
|
|
103
104
|
Copy self-contained skill folders into one or more agent skills directories.
|
|
104
105
|
Repeat --agent or use comma-separated names for multiple targets.
|
|
106
|
+
remove <skill...|all> --agent <name|all> [--global] [--dry-run]
|
|
107
|
+
Safely remove installed Pixelcraft skill folders (refuses symlinks and non-Pixelcraft folders).
|
|
108
|
+
doctor [--agent <name|all>] [--global]
|
|
109
|
+
Verify Node.js version and inspect installed Pixelcraft skill directories for missing core skills or stale/incomplete installs.
|
|
110
|
+
init-router [--dir <path>] [--write <file>]
|
|
111
|
+
Detect repository tech stack from manifests and print (or upsert via --write) a managed Pixelcraft routing block for AGENTS.md/CLAUDE.md/GEMINI.md.
|
|
112
|
+
check <target> [--json] [--fail-on <p0|p1|p2|any>]
|
|
113
|
+
Run bundled verification scripts against <target> (slop-scan for UI source, check-contrast for DTCG token JSON, check-pdf for PDFs, with check-email hint for email markup).
|
|
105
114
|
list
|
|
106
115
|
List skills bundled in this package.
|
|
107
116
|
help, --help
|
|
@@ -111,22 +120,26 @@ Agents: ${validAgents.join(', ')}.
|
|
|
111
120
|
Aliases: ${Object.keys(agentAliases).join(', ')}.
|
|
112
121
|
|
|
113
122
|
Options:
|
|
114
|
-
--agent NAME
|
|
115
|
-
--global
|
|
116
|
-
--dry-run
|
|
117
|
-
--docs-mcp
|
|
118
|
-
--force
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
--agent NAME Target host. Required for non-interactive add and remove.
|
|
124
|
+
--global Use the user-level skills directory instead of the current project.
|
|
125
|
+
--dry-run Print planned changes without modifying files.
|
|
126
|
+
--docs-mcp Print optional Context7 setup guidance without configuring any host.
|
|
127
|
+
--force Replace existing explicitly requested skill directories. Auto-added core skills install only when missing.
|
|
128
|
+
--dir PATH Repository directory to inspect for init-router (default: current directory).
|
|
129
|
+
--write FILE Upsert a managed Pixelcraft routing block into FILE for init-router.
|
|
130
|
+
--json Emit machine-readable JSON output from check.
|
|
131
|
+
--fail-on LEVEL Exit non-zero from check when findings meet p0|p1|p2|any.
|
|
132
|
+
|
|
133
|
+
Symlink safety: installation and removal refuse a symlinked target skills directory or skill
|
|
134
|
+
directory instead of modifying files outside the project.
|
|
135
|
+
|
|
136
|
+
Project locations: claude=.claude/skills; codex/agents/devin/antigravity=.agents/skills;
|
|
124
137
|
cursor=.cursor/skills; gemini=.gemini/skills; copilot=.github/skills;
|
|
125
|
-
|
|
126
|
-
roo=.roo/skills; droid=.factory/skills. Windsurf and Kiro
|
|
127
|
-
router files. Claude/Cursor/Copilot adapter commands and
|
|
128
|
-
alongside their skills. Universal .agents/skills remains
|
|
129
|
-
agents target and as a compatibility path in several hosts.
|
|
138
|
+
windsurf=.windsurf/skills; opencode=.opencode/skills; kiro=.kiro/skills;
|
|
139
|
+
cline=.cline/skills; roo=.roo/skills; droid=.factory/skills. Windsurf and Kiro
|
|
140
|
+
get native skills and router files. Claude/Cursor/Copilot adapter commands and
|
|
141
|
+
rules are written alongside their skills. Universal .agents/skills remains
|
|
142
|
+
available through the agents target and as a compatibility path in several hosts.
|
|
130
143
|
Global locations: claude=~/.claude/skills; codex/agents/devin=~/.agents/skills;
|
|
131
144
|
cursor=~/.cursor/skills; gemini=~/.gemini/skills; copilot=~/.copilot/skills;
|
|
132
145
|
windsurf=~/.codeium/windsurf/skills plus memories/global_rules.md;
|
|
@@ -139,18 +152,34 @@ They change quickly; verify current host documentation before depending on them
|
|
|
139
152
|
|
|
140
153
|
function parse(args) {
|
|
141
154
|
const positional = [];
|
|
142
|
-
const options = { global: false, dryRun: false, force: false, agents: [] };
|
|
155
|
+
const options = { global: false, dryRun: false, force: false, json: false, agents: [], dir: '', write: '', failOn: '' };
|
|
143
156
|
for (let index = 0; index < args.length; index += 1) {
|
|
144
157
|
const arg = args[index];
|
|
145
158
|
if (arg === '--global') options.global = true;
|
|
146
159
|
else if (arg === '--dry-run') options.dryRun = true;
|
|
147
160
|
else if (arg === '--docs-mcp') options.docsMcp = true;
|
|
148
161
|
else if (arg === '--force') options.force = true;
|
|
162
|
+
else if (arg === '--json') options.json = true;
|
|
149
163
|
else if (arg === '--agent') {
|
|
150
164
|
index += 1;
|
|
151
165
|
if (!args[index]) throw new Error('--agent requires a value');
|
|
152
166
|
options.agents.push(args[index]);
|
|
153
167
|
} else if (arg.startsWith('--agent=')) options.agents.push(arg.slice('--agent='.length));
|
|
168
|
+
else if (arg === '--dir') {
|
|
169
|
+
index += 1;
|
|
170
|
+
if (!args[index]) throw new Error('--dir requires a value');
|
|
171
|
+
options.dir = args[index];
|
|
172
|
+
} else if (arg.startsWith('--dir=')) options.dir = arg.slice('--dir='.length);
|
|
173
|
+
else if (arg === '--write') {
|
|
174
|
+
index += 1;
|
|
175
|
+
if (!args[index]) throw new Error('--write requires a value');
|
|
176
|
+
options.write = args[index];
|
|
177
|
+
} else if (arg.startsWith('--write=')) options.write = arg.slice('--write='.length);
|
|
178
|
+
else if (arg === '--fail-on') {
|
|
179
|
+
index += 1;
|
|
180
|
+
if (!args[index]) throw new Error('--fail-on requires a value');
|
|
181
|
+
options.failOn = args[index];
|
|
182
|
+
} else if (arg.startsWith('--fail-on=')) options.failOn = arg.slice('--fail-on='.length);
|
|
154
183
|
else if (arg === '--help' || arg === '-h') options.help = true;
|
|
155
184
|
else if (arg.startsWith('-')) throw new Error(`unknown option: ${arg}`);
|
|
156
185
|
else positional.push(arg);
|
|
@@ -297,7 +326,7 @@ function writeAgentAdapters(target, dryRun, force, selected) {
|
|
|
297
326
|
write('rules/pixelcraft.mdc', `---\ndescription: Route UI design and review through Pixelcraft\nalwaysApply: true\n---\n\n# Pixelcraft router\n\n${adapterIntro(displayRoot)}`);
|
|
298
327
|
} else if (target.agent === 'copilot') {
|
|
299
328
|
write('copilot-instructions.md', `# Pixelcraft router\n\n${adapterIntro(displayRoot)}`, true);
|
|
300
|
-
write('instructions/pixelcraft.instructions.md', `---\napplyTo: "**/*.{html,css,scss,js,jsx,ts,tsx,vue,svelte,astro,py,rb,php,cs,java,kt,swift,dart,rs,go,lua,ex,exs,clj,cljs,elm,fs,scala}"\n---\n\nWhen editing interface or user-facing behavior, follow \`copilot-instructions.md\` and read the matching Pixelcraft skill before implementation or review.\n`);
|
|
329
|
+
write('instructions/pixelcraft.instructions.md', `---\napplyTo: "**/*.{html,css,scss,less,pcss,js,jsx,ts,tsx,vue,svelte,astro,mdx,razor,heex,erb,templ,twig,mjml,typ,tex,qmd,py,rb,php,cs,java,kt,swift,dart,rs,go,zig,lua,ex,exs,clj,cljs,elm,fs,scala,cpp,h,glsl,wgsl,qml,xaml,axaml,fxml,blp,slint,ets,uxml,uss,gd,tscn,tcss,qss,r,jl}"\n---\n\nWhen editing interface or user-facing behavior, follow \`copilot-instructions.md\` and read the matching Pixelcraft skill before implementation or review.\n`);
|
|
301
330
|
for (const [command, skill, task] of adapterActions.slice(1)) write(`prompts/${command}.prompt.md`, commandText(skill, task));
|
|
302
331
|
} else if (target.type === 'windsurf' || target.type === 'kiro') {
|
|
303
332
|
const supportRoot = path.join(base, 'skills');
|
|
@@ -313,6 +342,10 @@ function writeAgentAdapters(target, dryRun, force, selected) {
|
|
|
313
342
|
}
|
|
314
343
|
}
|
|
315
344
|
|
|
345
|
+
function skillsDirForTarget(target) {
|
|
346
|
+
return target.type === 'skills' ? target.root : path.join(target.root, 'skills');
|
|
347
|
+
}
|
|
348
|
+
|
|
316
349
|
function runAdd({ positional, options }) {
|
|
317
350
|
if (positional.length === 0) throw new Error('add requires at least one skill name or all');
|
|
318
351
|
const available = skillNames();
|
|
@@ -331,6 +364,359 @@ function runAdd({ positional, options }) {
|
|
|
331
364
|
}
|
|
332
365
|
}
|
|
333
366
|
|
|
367
|
+
function runRemove({ positional, options }) {
|
|
368
|
+
if (positional.length === 0) throw new Error('remove requires at least one skill name or all');
|
|
369
|
+
if (options.agents.length === 0) throw new Error('remove requires --agent');
|
|
370
|
+
const removeAll = positional.includes('all');
|
|
371
|
+
const available = new Set(skillNames());
|
|
372
|
+
if (!removeAll) {
|
|
373
|
+
for (const name of positional) {
|
|
374
|
+
if (!/^pixelcraft(?:-[a-z0-9]+)*$/.test(name)) {
|
|
375
|
+
throw new Error(`refusing to remove non-Pixelcraft skill name '${name}'`);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
const targets = targetsFor(options.agents, options.global);
|
|
380
|
+
for (const target of targets) {
|
|
381
|
+
const dir = skillsDirForTarget(target);
|
|
382
|
+
const boundary = target.global ? os.homedir() : process.cwd();
|
|
383
|
+
assertInstallPathSafe(dir, boundary, 'target skills path component');
|
|
384
|
+
const dirStat = lstatIfExists(dir);
|
|
385
|
+
if (!dirStat) {
|
|
386
|
+
console.log(`${options.dryRun ? 'dry-run: ' : ''}no skills directory at ${dir}`);
|
|
387
|
+
continue;
|
|
388
|
+
}
|
|
389
|
+
if (!dirStat.isDirectory()) throw new Error(`target skills path is not a directory: ${dir}`);
|
|
390
|
+
|
|
391
|
+
let names;
|
|
392
|
+
if (removeAll) {
|
|
393
|
+
names = fs.readdirSync(dir).filter((entry) => /^pixelcraft(?:-[a-z0-9]+)*$/.test(entry)).sort();
|
|
394
|
+
if (names.length === 0) {
|
|
395
|
+
console.log(`${options.dryRun ? 'dry-run: ' : ''}no Pixelcraft skills installed in ${dir}`);
|
|
396
|
+
continue;
|
|
397
|
+
}
|
|
398
|
+
} else {
|
|
399
|
+
names = [...new Set(positional)];
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
for (const name of names) {
|
|
403
|
+
const dest = path.join(dir, name);
|
|
404
|
+
const stat = lstatIfExists(dest);
|
|
405
|
+
if (!stat) {
|
|
406
|
+
console.log(`${options.dryRun ? 'dry-run: ' : ''}not installed: ${name} (${dir})`);
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
if (stat.isSymbolicLink()) {
|
|
410
|
+
throw new Error(`installed skill directory is a symlink: ${dest}; refusing to remove`);
|
|
411
|
+
}
|
|
412
|
+
if (!stat.isDirectory()) {
|
|
413
|
+
throw new Error(`refusing to remove non-directory path: ${dest}`);
|
|
414
|
+
}
|
|
415
|
+
if (!available.has(name) && !fs.existsSync(path.join(dest, 'SKILL.md'))) {
|
|
416
|
+
throw new Error(`refusing to remove folder without SKILL.md: ${dest}`);
|
|
417
|
+
}
|
|
418
|
+
if (options.dryRun) {
|
|
419
|
+
console.log(`dry-run: remove ${name} <- ${dest}`);
|
|
420
|
+
} else {
|
|
421
|
+
fs.rmSync(dest, { recursive: true, force: true });
|
|
422
|
+
console.log(`removed: ${name} <- ${dest}`);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
function runDoctor({ options }) {
|
|
429
|
+
const available = skillNames();
|
|
430
|
+
const availableSet = new Set(available);
|
|
431
|
+
const nodeMajor = Number(process.versions.node.split('.')[0]);
|
|
432
|
+
const issues = [];
|
|
433
|
+
console.log(`Pixelcraft doctor`);
|
|
434
|
+
console.log(`Node.js: v${process.versions.node} (${nodeMajor >= 18 ? 'ok' : 'FAIL: requires >= 18'})`);
|
|
435
|
+
console.log(`Bundled skills: ${available.length}`);
|
|
436
|
+
if (nodeMajor < 18) issues.push(`Node.js >= 18 is required (found v${process.versions.node})`);
|
|
437
|
+
|
|
438
|
+
const targets = targetsFor(options.agents.length ? options.agents : ['all'], options.global);
|
|
439
|
+
const seenDirs = new Set();
|
|
440
|
+
let installedRoots = 0;
|
|
441
|
+
|
|
442
|
+
for (const target of targets) {
|
|
443
|
+
const dir = skillsDirForTarget(target);
|
|
444
|
+
if (seenDirs.has(dir)) continue;
|
|
445
|
+
seenDirs.add(dir);
|
|
446
|
+
const stat = lstatIfExists(dir);
|
|
447
|
+
if (!stat) continue;
|
|
448
|
+
if (stat.isSymbolicLink()) {
|
|
449
|
+
issues.push(`${dir}: skills directory is a symlink`);
|
|
450
|
+
console.log(` WARN ${dir}: symlinked skills directory`);
|
|
451
|
+
continue;
|
|
452
|
+
}
|
|
453
|
+
if (!stat.isDirectory()) continue;
|
|
454
|
+
|
|
455
|
+
const installed = fs.readdirSync(dir).filter((name) => name.startsWith('pixelcraft')).sort();
|
|
456
|
+
if (installed.length === 0) continue;
|
|
457
|
+
installedRoots += 1;
|
|
458
|
+
|
|
459
|
+
const rootIssues = [];
|
|
460
|
+
for (const core of ['pixelcraft', 'pixelcraft-plan']) {
|
|
461
|
+
if (availableSet.has(core) && !installed.includes(core)) {
|
|
462
|
+
rootIssues.push(`missing required core skill '${core}'`);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
for (const name of installed) {
|
|
466
|
+
const full = path.join(dir, name);
|
|
467
|
+
const entryStat = lstatIfExists(full);
|
|
468
|
+
if (entryStat?.isSymbolicLink()) {
|
|
469
|
+
rootIssues.push(`'${name}' is a symlink`);
|
|
470
|
+
continue;
|
|
471
|
+
}
|
|
472
|
+
if (!entryStat?.isDirectory() || !fs.existsSync(path.join(full, 'SKILL.md'))) {
|
|
473
|
+
rootIssues.push(`'${name}' is incomplete (missing SKILL.md)`);
|
|
474
|
+
continue;
|
|
475
|
+
}
|
|
476
|
+
if (!availableSet.has(name)) {
|
|
477
|
+
rootIssues.push(`'${name}' is not in the bundled Pixelcraft skill set (stale or unknown)`);
|
|
478
|
+
continue;
|
|
479
|
+
}
|
|
480
|
+
const bundledRefs = path.join(skillsRoot, name, 'references');
|
|
481
|
+
if (fs.existsSync(bundledRefs)) {
|
|
482
|
+
const expectedRefs = fs.readdirSync(bundledRefs).filter((f) => f.endsWith('.md'));
|
|
483
|
+
const installedRefsDir = path.join(full, 'references');
|
|
484
|
+
const missingRefs = expectedRefs.filter((f) => !fs.existsSync(path.join(installedRefsDir, f)));
|
|
485
|
+
if (missingRefs.length) {
|
|
486
|
+
rootIssues.push(`'${name}' is stale/incomplete (missing ${missingRefs.length} reference file(s): ${missingRefs.slice(0, 3).join(', ')})`);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
const display = target.global ? dir.replace(os.homedir(), '~') : path.relative(process.cwd(), dir) || '.';
|
|
492
|
+
if (rootIssues.length === 0) {
|
|
493
|
+
console.log(` OK ${display}: ${installed.length} skill(s) installed and healthy`);
|
|
494
|
+
} else {
|
|
495
|
+
console.log(` FAIL ${display}: ${installed.length} skill(s), ${rootIssues.length} issue(s)`);
|
|
496
|
+
for (const msg of rootIssues) {
|
|
497
|
+
console.log(` - ${msg}`);
|
|
498
|
+
issues.push(`${display}: ${msg}`);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
if (installedRoots === 0) {
|
|
504
|
+
console.log(`No Pixelcraft installations found in ${options.global ? 'global' : 'project'} agent directories.`);
|
|
505
|
+
}
|
|
506
|
+
if (issues.length > 0) {
|
|
507
|
+
process.exitCode = 1;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
function readTextSafe(file) {
|
|
512
|
+
try {
|
|
513
|
+
return fs.readFileSync(file, 'utf8');
|
|
514
|
+
} catch {
|
|
515
|
+
return '';
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
function detectRepoStack(dir) {
|
|
520
|
+
const detected = [];
|
|
521
|
+
const skills = new Set(['pixelcraft-plan', 'pixelcraft']);
|
|
522
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
523
|
+
const names = new Set(entries.map((e) => e.name));
|
|
524
|
+
const filesByExt = (ext) => entries.filter((e) => e.isFile() && e.name.toLowerCase().endsWith(ext)).map((e) => e.name);
|
|
525
|
+
const hasDirExt = (ext) => entries.some((e) => e.isDirectory() && e.name.toLowerCase().endsWith(ext));
|
|
526
|
+
|
|
527
|
+
if (names.has('Cargo.toml')) {
|
|
528
|
+
const cargo = readTextSafe(path.join(dir, 'Cargo.toml'));
|
|
529
|
+
const tags = [];
|
|
530
|
+
if (/\b(?:ratatui|crossterm)\b/i.test(cargo)) { tags.push('Rust TUI'); skills.add('pixelcraft-tui'); }
|
|
531
|
+
if (/\b(?:gpui|egui|eframe|iced|slint|tauri|gtk4)\b/i.test(cargo)) { tags.push('Rust Desktop'); skills.add('pixelcraft-desktop'); }
|
|
532
|
+
if (/\bbevy\b/i.test(cargo)) { tags.push('Bevy'); skills.add('pixelcraft-game-ui'); }
|
|
533
|
+
if (/\b(?:leptos|yew|dioxus)\b/i.test(cargo)) { tags.push('Rust Web'); skills.add('pixelcraft-web'); }
|
|
534
|
+
detected.push(`Cargo.toml (${tags.length ? tags.join(', ') : 'Rust'})`);
|
|
535
|
+
}
|
|
536
|
+
if (names.has('Package.swift') || hasDirExt('.xcodeproj') || hasDirExt('.xcworkspace')) {
|
|
537
|
+
detected.push('Swift / Apple manifest (SwiftUI / UIKit / AppKit)');
|
|
538
|
+
skills.add('pixelcraft-mobile');
|
|
539
|
+
skills.add('pixelcraft-desktop');
|
|
540
|
+
}
|
|
541
|
+
if (names.has('build.gradle') || names.has('build.gradle.kts')) {
|
|
542
|
+
const gradle = readTextSafe(path.join(dir, names.has('build.gradle.kts') ? 'build.gradle.kts' : 'build.gradle'));
|
|
543
|
+
detected.push(`Gradle (${/compose|android/i.test(gradle) ? 'Android / Jetpack Compose' : 'JVM / Kotlin'})`);
|
|
544
|
+
if (/compose|android/i.test(gradle)) skills.add('pixelcraft-mobile');
|
|
545
|
+
else skills.add('pixelcraft-desktop');
|
|
546
|
+
}
|
|
547
|
+
if (names.has('pubspec.yaml')) {
|
|
548
|
+
detected.push('pubspec.yaml (Flutter / Dart)');
|
|
549
|
+
skills.add('pixelcraft-mobile');
|
|
550
|
+
}
|
|
551
|
+
if (names.has('go.mod')) {
|
|
552
|
+
const gomod = readTextSafe(path.join(dir, 'go.mod'));
|
|
553
|
+
const tags = [];
|
|
554
|
+
if (/bubbletea|lipgloss/i.test(gomod)) { tags.push('Bubble Tea / Lip Gloss'); skills.add('pixelcraft-tui'); }
|
|
555
|
+
if (/ebiten/i.test(gomod)) { tags.push('Ebitengine'); skills.add('pixelcraft-game-ui'); }
|
|
556
|
+
if (/fyne|wails|gioui/i.test(gomod)) { tags.push('Go Desktop'); skills.add('pixelcraft-desktop'); }
|
|
557
|
+
if (/templ/i.test(gomod)) { tags.push('templ Web'); skills.add('pixelcraft-web'); }
|
|
558
|
+
detected.push(`go.mod (${tags.length ? tags.join(', ') : 'Go'})`);
|
|
559
|
+
}
|
|
560
|
+
if (names.has('pyproject.toml') || names.has('requirements.txt')) {
|
|
561
|
+
const py = `${readTextSafe(path.join(dir, 'pyproject.toml'))}\n${readTextSafe(path.join(dir, 'requirements.txt'))}`;
|
|
562
|
+
const tags = [];
|
|
563
|
+
if (/\b(?:textual|rich)\b/i.test(py)) { tags.push('Textual/Rich'); skills.add('pixelcraft-tui'); }
|
|
564
|
+
if (/\b(?:streamlit|gradio|marimo|dash|panel|nicegui|reflex|shiny)\b/i.test(py)) { tags.push('Python Data App'); skills.add('pixelcraft-data-apps'); }
|
|
565
|
+
if (/\b(?:pyside6|pyqt6|pyside2|pyqt5|pygobject)\b/i.test(py)) { tags.push('Python Desktop'); skills.add('pixelcraft-desktop'); }
|
|
566
|
+
if (/\b(?:flet|kivy)\b/i.test(py)) { tags.push('Python Mobile'); skills.add('pixelcraft-mobile'); }
|
|
567
|
+
if (/\b(?:django|fastapi|flask)\b/i.test(py)) { tags.push('Python Web'); skills.add('pixelcraft-web'); }
|
|
568
|
+
detected.push(`Python manifest (${tags.length ? tags.join(', ') : 'Python'})`);
|
|
569
|
+
}
|
|
570
|
+
if (names.has('composer.json')) {
|
|
571
|
+
detected.push('composer.json (PHP / Laravel / Symfony)');
|
|
572
|
+
skills.add('pixelcraft-web');
|
|
573
|
+
}
|
|
574
|
+
if (names.has('Gemfile')) {
|
|
575
|
+
detected.push('Gemfile (Ruby / Rails)');
|
|
576
|
+
skills.add('pixelcraft-web');
|
|
577
|
+
}
|
|
578
|
+
if (names.has('mix.exs')) {
|
|
579
|
+
const mix = readTextSafe(path.join(dir, 'mix.exs'));
|
|
580
|
+
detected.push('mix.exs (Elixir / Phoenix)');
|
|
581
|
+
skills.add('pixelcraft-web');
|
|
582
|
+
if (/live_view_native/i.test(mix)) skills.add('pixelcraft-mobile');
|
|
583
|
+
}
|
|
584
|
+
const csprojs = filesByExt('.csproj');
|
|
585
|
+
if (csprojs.length) {
|
|
586
|
+
const combined = csprojs.map((f) => readTextSafe(path.join(dir, f))).join('\n');
|
|
587
|
+
const tags = [];
|
|
588
|
+
if (/Avalonia|UseWPF|UseWinUI|Microsoft\.WindowsAppSDK/i.test(combined)) { tags.push('.NET Desktop'); skills.add('pixelcraft-desktop'); }
|
|
589
|
+
if (/UseMaui|Microsoft\.Maui/i.test(combined)) { tags.push('.NET MAUI'); skills.add('pixelcraft-mobile'); }
|
|
590
|
+
if (/MonoGame/i.test(combined)) { tags.push('MonoGame'); skills.add('pixelcraft-game-ui'); }
|
|
591
|
+
if (/Blazor|Microsoft\.NET\.Sdk\.Web|Razor/i.test(combined)) { tags.push('Blazor/Razor'); skills.add('pixelcraft-web'); }
|
|
592
|
+
detected.push(`${csprojs[0]} (${tags.length ? tags.join(', ') : 'C# / .NET'})`);
|
|
593
|
+
}
|
|
594
|
+
if (names.has('package.json')) {
|
|
595
|
+
const pkgText = readTextSafe(path.join(dir, 'package.json'));
|
|
596
|
+
const tags = [];
|
|
597
|
+
if (/"(?:react|next|vue|nuxt|svelte|solid-js|@angular\/core|astro|@builder\.io\/qwik|htmx\.org|lit|preact|hono)"/i.test(pkgText)) {
|
|
598
|
+
tags.push('Web'); skills.add('pixelcraft-web');
|
|
599
|
+
}
|
|
600
|
+
if (/"(?:react-native|expo|@lynx-js\/|@ionic\/)"/i.test(pkgText)) {
|
|
601
|
+
tags.push('Mobile'); skills.add('pixelcraft-mobile');
|
|
602
|
+
}
|
|
603
|
+
if (/"(?:electron|@tauri-apps\/)"/i.test(pkgText)) {
|
|
604
|
+
tags.push('Desktop'); skills.add('pixelcraft-desktop');
|
|
605
|
+
}
|
|
606
|
+
if (/"ink"/i.test(pkgText)) { tags.push('Ink TUI'); skills.add('pixelcraft-tui'); }
|
|
607
|
+
if (/"(?:mjml|@react-email\/|maizzle)"/i.test(pkgText)) { tags.push('Email'); skills.add('pixelcraft-email'); }
|
|
608
|
+
if (/"(?:@raycast\/api|@types\/vscode)"/i.test(pkgText)) { tags.push('Extension'); skills.add('pixelcraft-extensions'); }
|
|
609
|
+
detected.push(`package.json (${tags.length ? tags.join(', ') : 'JS/TS'})`);
|
|
610
|
+
if (tags.length === 0) skills.add('pixelcraft-web');
|
|
611
|
+
}
|
|
612
|
+
if (names.has('project.godot')) {
|
|
613
|
+
detected.push('project.godot (Godot Engine)');
|
|
614
|
+
skills.add('pixelcraft-game-ui');
|
|
615
|
+
}
|
|
616
|
+
if (filesByExt('.typ').length > 0) {
|
|
617
|
+
detected.push('*.typ (Typst document)');
|
|
618
|
+
skills.add('pixelcraft-document');
|
|
619
|
+
}
|
|
620
|
+
if (filesByExt('.mjml').length > 0) {
|
|
621
|
+
detected.push('*.mjml (MJML email)');
|
|
622
|
+
skills.add('pixelcraft-email');
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
skills.add('pixelcraft-review');
|
|
626
|
+
skills.add('pixelcraft-visual-qa');
|
|
627
|
+
return { detected, skills: [...skills] };
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
function runInitRouter({ options }) {
|
|
631
|
+
const dir = path.resolve(process.cwd(), options.dir || '.');
|
|
632
|
+
if (!fs.existsSync(dir) || !fs.statSync(dir).isDirectory()) {
|
|
633
|
+
throw new Error(`--dir must point to an existing directory: ${dir}`);
|
|
634
|
+
}
|
|
635
|
+
const { detected, skills } = detectRepoStack(dir);
|
|
636
|
+
const stackSummary = detected.length
|
|
637
|
+
? detected.map((item) => `- ${item}`).join('\n')
|
|
638
|
+
: '- No stack manifest detected at repository root (inspect subdirectories during `pixelcraft-plan`).';
|
|
639
|
+
const content = [
|
|
640
|
+
'## Pixelcraft UI routing',
|
|
641
|
+
'',
|
|
642
|
+
'For any request to design, build, redesign, review, audit, or verify UI in this repository, follow the Pixelcraft loop:',
|
|
643
|
+
'1. Start with `pixelcraft-plan` (read repo conventions first) and `pixelcraft` for routing.',
|
|
644
|
+
'2. Respect authority order: explicit user brief > existing project design system/conventions > platform conventions & accessibility floor > Pixelcraft guidance > model taste.',
|
|
645
|
+
'3. Verify changes with `pixelcraft-review` and `pixelcraft-visual-qa` using explicit evidence labels (`rendered`, `static`, `model-judgment`, `not-checked`, `waived`).',
|
|
646
|
+
'',
|
|
647
|
+
'Detected stack manifests:',
|
|
648
|
+
stackSummary,
|
|
649
|
+
'',
|
|
650
|
+
`Recommended skills: ${skills.map((s) => `\`${s}\``).join(', ')}.`,
|
|
651
|
+
].join('\n');
|
|
652
|
+
|
|
653
|
+
if (options.write) {
|
|
654
|
+
const outFile = path.resolve(process.cwd(), options.write);
|
|
655
|
+
assertNotSymlink(outFile, 'router output file');
|
|
656
|
+
fs.mkdirSync(path.dirname(outFile), { recursive: true });
|
|
657
|
+
const existing = fs.existsSync(outFile) ? fs.readFileSync(outFile, 'utf8') : '';
|
|
658
|
+
const updated = managedUpsert(existing, content);
|
|
659
|
+
fs.writeFileSync(outFile, updated);
|
|
660
|
+
console.log(`updated router: ${outFile}`);
|
|
661
|
+
} else {
|
|
662
|
+
console.log(`${managedStart}\n${content}\n${managedEnd}`);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
function runCheck({ positional, options }) {
|
|
667
|
+
if (positional.length !== 1) throw new Error('check requires exactly one target file or directory');
|
|
668
|
+
const target = path.resolve(process.cwd(), positional[0]);
|
|
669
|
+
if (!fs.existsSync(target)) throw new Error(`target not found: ${positional[0]}`);
|
|
670
|
+
const stat = fs.statSync(target);
|
|
671
|
+
const ext = stat.isFile() ? path.extname(target).toLowerCase() : '';
|
|
672
|
+
|
|
673
|
+
const qaDir = path.join(skillsRoot, 'pixelcraft-visual-qa/scripts');
|
|
674
|
+
const reviewDir = path.join(skillsRoot, 'pixelcraft-review/scripts');
|
|
675
|
+
|
|
676
|
+
const dispatch = (scriptPath, scriptArgs) => {
|
|
677
|
+
const res = spawnSync(process.execPath, [scriptPath, ...scriptArgs], { encoding: 'utf8' });
|
|
678
|
+
if (res.stdout) process.stdout.write(res.stdout);
|
|
679
|
+
if (res.stderr) process.stderr.write(res.stderr);
|
|
680
|
+
process.exitCode = res.status ?? 1;
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
if (ext === '.pdf') {
|
|
684
|
+
const args = [target];
|
|
685
|
+
if (options.json) args.push('--json');
|
|
686
|
+
dispatch(path.join(qaDir, 'check-pdf.mjs'), args);
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
if (ext === '.json') {
|
|
691
|
+
const raw = readTextSafe(target);
|
|
692
|
+
if (/"\$(?:value|type)"/.test(raw)) {
|
|
693
|
+
const args = [target];
|
|
694
|
+
if (options.json) args.push('--json');
|
|
695
|
+
dispatch(path.join(qaDir, 'check-contrast.mjs'), args);
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
throw new Error(`${positional[0]} is JSON but does not look like a DTCG tokens file (missing "$value" or "$type")`);
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
const args = [target];
|
|
702
|
+
if (options.json) args.push('--json');
|
|
703
|
+
if (options.failOn) args.push('--fail-on', options.failOn);
|
|
704
|
+
dispatch(path.join(reviewDir, 'slop-scan.mjs'), args);
|
|
705
|
+
|
|
706
|
+
if (stat.isFile()) {
|
|
707
|
+
const isMjml = ext === '.mjml';
|
|
708
|
+
const isEmailHtml = ext === '.html' && (
|
|
709
|
+
/email|newsletter|receipt|digest|mail/i.test(path.basename(target))
|
|
710
|
+
|| /<mjml\b|urn:schemas-microsoft-com:vml|mso-/i.test(readTextSafe(target))
|
|
711
|
+
);
|
|
712
|
+
if (isMjml || isEmailHtml) {
|
|
713
|
+
const hint = `note: for email-specific checks (102 KB Gmail clip, Outlook CSS, plaintext parity), also run: node skills/pixelcraft-visual-qa/scripts/check-email.mjs ${positional[0]}`;
|
|
714
|
+
if (options.json) console.error(hint);
|
|
715
|
+
else console.log(hint);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
|
|
334
720
|
function numberedSelection(answer, names) {
|
|
335
721
|
const tokens = answer.split(/[\s,]+/).filter(Boolean);
|
|
336
722
|
if (tokens.length === 0) throw new Error('empty selection');
|
|
@@ -431,11 +817,33 @@ async function main() {
|
|
|
431
817
|
for (const name of skillNames()) console.log(name);
|
|
432
818
|
return;
|
|
433
819
|
}
|
|
434
|
-
if (command
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
820
|
+
if (command === 'add') {
|
|
821
|
+
const { positional, options } = parse(rest);
|
|
822
|
+
if (options.agents.length === 0) throw new Error('add requires --agent');
|
|
823
|
+
runAdd({ positional, options });
|
|
824
|
+
return;
|
|
825
|
+
}
|
|
826
|
+
if (command === 'remove') {
|
|
827
|
+
const { positional, options } = parse(rest);
|
|
828
|
+
runRemove({ positional, options });
|
|
829
|
+
return;
|
|
830
|
+
}
|
|
831
|
+
if (command === 'doctor') {
|
|
832
|
+
const { options } = parse(rest);
|
|
833
|
+
runDoctor({ options });
|
|
834
|
+
return;
|
|
835
|
+
}
|
|
836
|
+
if (command === 'init-router') {
|
|
837
|
+
const { options } = parse(rest);
|
|
838
|
+
runInitRouter({ options });
|
|
839
|
+
return;
|
|
840
|
+
}
|
|
841
|
+
if (command === 'check') {
|
|
842
|
+
const { positional, options } = parse(rest);
|
|
843
|
+
runCheck({ positional, options });
|
|
844
|
+
return;
|
|
845
|
+
}
|
|
846
|
+
throw new Error(`unknown command: ${command}; run pixelcraft --help`);
|
|
439
847
|
}
|
|
440
848
|
|
|
441
849
|
main().catch((error) => {
|