@thanhnguyxn/pixelcraft 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +20 -0
- package/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +11 -0
- package/LICENSE +21 -0
- package/README.md +407 -2
- package/assets/README.md +28 -0
- package/assets/pixelcraft-logo-512.png +0 -0
- package/bin/pixelcraft.mjs +444 -0
- package/docs/ARCHITECTURE.md +102 -0
- package/docs/DESIGN-RATIONALE.md +143 -0
- package/evals/README.md +27 -0
- package/evals/fixtures/README.md +36 -0
- package/evals/fixtures/direction-prototype-complexity.json +29 -0
- package/evals/fixtures/finish-gate-anti-slop.json +30 -0
- package/evals/fixtures/forms-accessibility-negative.json +29 -0
- package/evals/fixtures/handoff-fidelity-tolerance.json +29 -0
- package/evals/fixtures/plan-brownfield-evidence.json +28 -0
- package/evals/fixtures/visual-qa-task-evidence.json +29 -0
- package/evals/fixtures/workflow-checkpoints.json +30 -0
- package/evals/pixelcraft-accessibility.md +57 -0
- package/evals/pixelcraft-brandkit.md +58 -0
- package/evals/pixelcraft-chat-ui.md +55 -0
- package/evals/pixelcraft-constrained.md +55 -0
- package/evals/pixelcraft-craft.md +60 -0
- package/evals/pixelcraft-data-apps.md +55 -0
- package/evals/pixelcraft-dataviz.md +59 -0
- package/evals/pixelcraft-desktop.md +55 -0
- package/evals/pixelcraft-direction.md +60 -0
- package/evals/pixelcraft-document.md +55 -0
- package/evals/pixelcraft-email.md +55 -0
- package/evals/pixelcraft-extensions.md +55 -0
- package/evals/pixelcraft-game-ui.md +59 -0
- package/evals/pixelcraft-handoff.md +57 -0
- package/evals/pixelcraft-media.md +55 -0
- package/evals/pixelcraft-mobile.md +59 -0
- package/evals/pixelcraft-patterns.md +57 -0
- package/evals/pixelcraft-plan.md +65 -0
- package/evals/pixelcraft-review.md +63 -0
- package/evals/pixelcraft-spatial.md +55 -0
- package/evals/pixelcraft-tokens.md +57 -0
- package/evals/pixelcraft-tui.md +55 -0
- package/evals/pixelcraft-ux.md +59 -0
- package/evals/pixelcraft-visual-qa.md +80 -0
- package/evals/pixelcraft-web.md +71 -0
- package/evals/pixelcraft.md +70 -0
- package/gemini-extension.json +5 -0
- package/install.ps1 +295 -0
- package/install.sh +437 -0
- package/package.json +63 -4
- package/plugin.json +24 -0
- package/scripts/build-adapters.mjs +290 -0
- package/scripts/build-release-archives.mjs +61 -0
- package/scripts/build-skill-zips.mjs +94 -0
- package/scripts/test-build-adapters.mjs +48 -0
- package/scripts/test-distribution.mjs +124 -0
- package/scripts/test-export-tokens.mjs +105 -0
- package/scripts/test-finish-gate.mjs +148 -0
- package/scripts/test-installers.mjs +67 -0
- package/scripts/test-release-archives.mjs +42 -0
- package/scripts/test-shoot.mjs +65 -0
- package/scripts/test-slop-scan.mjs +29 -0
- package/scripts/test-style-inventory.mjs +211 -0
- package/scripts/test-validate-skills.mjs +117 -0
- package/scripts/validate-skills.mjs +512 -0
- package/skills/pixelcraft/SKILL.md +135 -0
- package/skills/pixelcraft/references/design-brief.md +75 -0
- package/skills/pixelcraft/references/floor.md +73 -0
- package/skills/pixelcraft/references/report-template.md +35 -0
- package/skills/pixelcraft/references/stack-detection.md +155 -0
- package/skills/pixelcraft/references/surface-acceptance.md +40 -0
- package/skills/pixelcraft/references/workflow-checkpoints.md +29 -0
- package/skills/pixelcraft-accessibility/SKILL.md +33 -0
- package/skills/pixelcraft-accessibility/references/apg-patterns.md +51 -0
- package/skills/pixelcraft-accessibility/references/platforms.md +58 -0
- package/skills/pixelcraft-accessibility/references/verification.md +59 -0
- package/skills/pixelcraft-accessibility/references/wcag22-checks.md +66 -0
- package/skills/pixelcraft-brandkit/SKILL.md +115 -0
- package/skills/pixelcraft-brandkit/references/asset-pipeline.md +125 -0
- package/skills/pixelcraft-brandkit/references/brand-governance.md +80 -0
- package/skills/pixelcraft-brandkit/references/layouts.md +88 -0
- package/skills/pixelcraft-brandkit/references/logo-concepting.md +83 -0
- package/skills/pixelcraft-brandkit/references/logo-methods.md +98 -0
- package/skills/pixelcraft-brandkit/references/pixel-art-logos.md +82 -0
- package/skills/pixelcraft-brandkit/references/prompt-template.md +85 -0
- package/skills/pixelcraft-brandkit/references/qa-checklist.md +88 -0
- package/skills/pixelcraft-brandkit/references/visual-modes.md +123 -0
- package/skills/pixelcraft-chat-ui/SKILL.md +53 -0
- package/skills/pixelcraft-chat-ui/references/conversation-design.md +78 -0
- package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +87 -0
- package/skills/pixelcraft-chat-ui/references/slack-discord.md +96 -0
- package/skills/pixelcraft-constrained/SKILL.md +51 -0
- package/skills/pixelcraft-constrained/references/specialized-hardware.md +66 -0
- package/skills/pixelcraft-constrained/references/tv-wearables.md +84 -0
- package/skills/pixelcraft-constrained/references/voice-ui.md +63 -0
- package/skills/pixelcraft-craft/SKILL.md +44 -0
- package/skills/pixelcraft-craft/references/color.md +69 -0
- package/skills/pixelcraft-craft/references/imagery-icons.md +37 -0
- package/skills/pixelcraft-craft/references/layout-quality.md +65 -0
- package/skills/pixelcraft-craft/references/layout.md +41 -0
- package/skills/pixelcraft-craft/references/motion.md +76 -0
- package/skills/pixelcraft-craft/references/typography.md +71 -0
- package/skills/pixelcraft-data-apps/SKILL.md +67 -0
- package/skills/pixelcraft-data-apps/references/dash.md +53 -0
- package/skills/pixelcraft-data-apps/references/evidence.md +75 -0
- package/skills/pixelcraft-data-apps/references/gradio.md +65 -0
- package/skills/pixelcraft-data-apps/references/julia-genie.md +54 -0
- package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +53 -0
- package/skills/pixelcraft-data-apps/references/nicegui.md +63 -0
- package/skills/pixelcraft-data-apps/references/observable-framework.md +67 -0
- package/skills/pixelcraft-data-apps/references/panel.md +53 -0
- package/skills/pixelcraft-data-apps/references/r-shiny.md +54 -0
- package/skills/pixelcraft-data-apps/references/reflex.md +62 -0
- package/skills/pixelcraft-data-apps/references/shiny.md +53 -0
- package/skills/pixelcraft-data-apps/references/streamlit.md +65 -0
- package/skills/pixelcraft-dataviz/SKILL.md +63 -0
- package/skills/pixelcraft-dataviz/references/chart-choice.md +55 -0
- package/skills/pixelcraft-dataviz/references/color-accessibility.md +112 -0
- package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +97 -0
- package/skills/pixelcraft-dataviz/references/libraries.md +57 -0
- package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +99 -0
- package/skills/pixelcraft-desktop/SKILL.md +71 -0
- package/skills/pixelcraft-desktop/references/appkit.md +58 -0
- package/skills/pixelcraft-desktop/references/avalonia.md +59 -0
- package/skills/pixelcraft-desktop/references/cpp-gui.md +52 -0
- package/skills/pixelcraft-desktop/references/electron.md +54 -0
- package/skills/pixelcraft-desktop/references/go-gui.md +54 -0
- package/skills/pixelcraft-desktop/references/gtk.md +54 -0
- package/skills/pixelcraft-desktop/references/javafx-swing.md +52 -0
- package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +61 -0
- package/skills/pixelcraft-desktop/references/rust-gui.md +65 -0
- package/skills/pixelcraft-desktop/references/tauri.md +54 -0
- package/skills/pixelcraft-desktop/references/uno-platform.md +52 -0
- package/skills/pixelcraft-desktop/references/winui-wpf.md +58 -0
- package/skills/pixelcraft-desktop/references/working-context.md +5 -0
- package/skills/pixelcraft-direction/SKILL.md +154 -0
- package/skills/pixelcraft-direction/references/composition-library.md +84 -0
- package/skills/pixelcraft-direction/references/direction-card.md +54 -0
- package/skills/pixelcraft-direction/references/direction-scoring.md +72 -0
- package/skills/pixelcraft-direction/references/movements.md +68 -0
- package/skills/pixelcraft-direction/references/repetition-history.md +75 -0
- package/skills/pixelcraft-direction/references/slop-fingerprints.md +58 -0
- package/skills/pixelcraft-direction/references/wildcards.md +47 -0
- package/skills/pixelcraft-document/SKILL.md +54 -0
- package/skills/pixelcraft-document/references/archetypes.md +83 -0
- package/skills/pixelcraft-document/references/pdf-tools.md +154 -0
- package/skills/pixelcraft-document/references/print-css.md +134 -0
- package/skills/pixelcraft-document/references/slides.md +102 -0
- package/skills/pixelcraft-email/SKILL.md +58 -0
- package/skills/pixelcraft-email/references/client-quirks.md +45 -0
- package/skills/pixelcraft-email/references/html-tables.md +53 -0
- package/skills/pixelcraft-email/references/mjml.md +52 -0
- package/skills/pixelcraft-email/references/react-email.md +53 -0
- package/skills/pixelcraft-extensions/SKILL.md +51 -0
- package/skills/pixelcraft-extensions/references/browser-extensions.md +31 -0
- package/skills/pixelcraft-extensions/references/figma-office.md +23 -0
- package/skills/pixelcraft-extensions/references/raycast.md +19 -0
- package/skills/pixelcraft-extensions/references/vscode-webviews.md +26 -0
- package/skills/pixelcraft-game-ui/SKILL.md +61 -0
- package/skills/pixelcraft-game-ui/references/bevy.md +52 -0
- package/skills/pixelcraft-game-ui/references/godot.md +57 -0
- package/skills/pixelcraft-game-ui/references/hud-principles.md +38 -0
- package/skills/pixelcraft-game-ui/references/love2d.md +51 -0
- package/skills/pixelcraft-game-ui/references/monogame.md +52 -0
- package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +65 -0
- package/skills/pixelcraft-game-ui/references/unreal-umg.md +53 -0
- package/skills/pixelcraft-handoff/SKILL.md +49 -0
- package/skills/pixelcraft-handoff/references/design-translation.md +104 -0
- package/skills/pixelcraft-handoff/references/fidelity-tolerance.md +78 -0
- package/skills/pixelcraft-media/SKILL.md +52 -0
- package/skills/pixelcraft-media/references/banners-video.md +112 -0
- package/skills/pixelcraft-media/references/og-generation.md +107 -0
- package/skills/pixelcraft-media/references/social-cards.md +72 -0
- package/skills/pixelcraft-mobile/SKILL.md +69 -0
- package/skills/pixelcraft-mobile/references/dotnet-maui.md +63 -0
- package/skills/pixelcraft-mobile/references/flet.md +53 -0
- package/skills/pixelcraft-mobile/references/flutter.md +69 -0
- package/skills/pixelcraft-mobile/references/ionic-capacitor.md +65 -0
- package/skills/pixelcraft-mobile/references/jetpack-compose.md +61 -0
- package/skills/pixelcraft-mobile/references/kivy.md +59 -0
- package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +60 -0
- package/skills/pixelcraft-mobile/references/react-native-expo.md +71 -0
- package/skills/pixelcraft-mobile/references/swiftui.md +70 -0
- package/skills/pixelcraft-mobile/references/task-state-composition.md +5 -0
- package/skills/pixelcraft-mobile/references/uikit.md +58 -0
- package/skills/pixelcraft-patterns/SKILL.md +58 -0
- package/skills/pixelcraft-patterns/references/auth-onboarding.md +25 -0
- package/skills/pixelcraft-patterns/references/commerce.md +28 -0
- package/skills/pixelcraft-patterns/references/communication.md +26 -0
- package/skills/pixelcraft-patterns/references/creative-tools.md +29 -0
- package/skills/pixelcraft-patterns/references/dashboard-admin.md +31 -0
- package/skills/pixelcraft-patterns/references/marketing.md +32 -0
- package/skills/pixelcraft-patterns/references/pattern-selection.md +74 -0
- package/skills/pixelcraft-patterns/references/search-filtering.md +42 -0
- package/skills/pixelcraft-patterns/references/settings.md +23 -0
- package/skills/pixelcraft-patterns/references/tables-crud.md +43 -0
- package/skills/pixelcraft-plan/SKILL.md +67 -0
- package/skills/pixelcraft-plan/references/design-input.md +69 -0
- package/skills/pixelcraft-plan/references/plan-template.md +99 -0
- package/skills/pixelcraft-plan/references/repo-discovery.md +42 -0
- package/skills/pixelcraft-plan/references/stack-freshness.md +50 -0
- package/skills/pixelcraft-plan/references/stack-selection.md +42 -0
- package/skills/pixelcraft-review/SKILL.md +64 -0
- package/skills/pixelcraft-review/references/audit-report.md +50 -0
- package/skills/pixelcraft-review/references/critique-protocol.md +89 -0
- package/skills/pixelcraft-review/references/heuristics.md +18 -0
- package/skills/pixelcraft-review/references/personas.md +26 -0
- package/skills/pixelcraft-review/references/polish.md +38 -0
- package/skills/pixelcraft-review/scripts/fixtures/brand-critique-waivers.json +14 -0
- package/skills/pixelcraft-review/scripts/fixtures/brand-critique.css +18 -0
- package/skills/pixelcraft-review/scripts/fixtures/clean.html +43 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-after-block.css +4 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-at-rules.css +17 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-comments.css +10 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-html-quote-leak.html +12 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-invalid-replacements.css +27 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-nested-rules.css +19 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-not-visible-skip.css +8 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-outline-shorthands.css +11 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-and-border.css +15 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-last-wins.css +19 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-valid-replacements-extended.css +29 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-visible-no-replacement.css +3 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-visible-valid-replacements.css +9 -0
- package/skills/pixelcraft-review/scripts/fixtures/slop.html +28 -0
- package/skills/pixelcraft-review/scripts/slop-scan.mjs +586 -0
- package/skills/pixelcraft-spatial/SKILL.md +52 -0
- package/skills/pixelcraft-spatial/references/comfort-accessibility.md +98 -0
- package/skills/pixelcraft-spatial/references/platforms.md +77 -0
- package/skills/pixelcraft-tokens/SKILL.md +56 -0
- package/skills/pixelcraft-tokens/assets/tokens.example.json +71 -0
- package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +47 -0
- package/skills/pixelcraft-tokens/references/adoption.md +55 -0
- package/skills/pixelcraft-tokens/references/format.md +54 -0
- package/skills/pixelcraft-tokens/references/governance.md +80 -0
- package/skills/pixelcraft-tokens/references/state-tokens.md +62 -0
- package/skills/pixelcraft-tokens/references/theme-presets.md +94 -0
- package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +285 -0
- package/skills/pixelcraft-tui/SKILL.md +60 -0
- package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +60 -0
- package/skills/pixelcraft-tui/references/ink.md +60 -0
- package/skills/pixelcraft-tui/references/ratatui.md +62 -0
- package/skills/pixelcraft-tui/references/rich.md +62 -0
- package/skills/pixelcraft-tui/references/textual.md +67 -0
- package/skills/pixelcraft-ux/SKILL.md +46 -0
- package/skills/pixelcraft-ux/references/cognitive-walkthrough.md +70 -0
- package/skills/pixelcraft-ux/references/feedback-performance.md +30 -0
- package/skills/pixelcraft-ux/references/flows-ia.md +44 -0
- package/skills/pixelcraft-ux/references/forms.md +97 -0
- package/skills/pixelcraft-ux/references/i18n.md +183 -0
- package/skills/pixelcraft-ux/references/laws.md +18 -0
- package/skills/pixelcraft-ux/references/locale-test-matrix.md +60 -0
- package/skills/pixelcraft-ux/references/state-matrix.md +39 -0
- package/skills/pixelcraft-ux/references/usability-testing.md +84 -0
- package/skills/pixelcraft-ux/references/ux-writing.md +43 -0
- package/skills/pixelcraft-visual-qa/SKILL.md +82 -0
- package/skills/pixelcraft-visual-qa/references/baseline-governance.md +70 -0
- package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +38 -0
- package/skills/pixelcraft-visual-qa/references/capture-email.md +34 -0
- package/skills/pixelcraft-visual-qa/references/capture-mobile.md +35 -0
- package/skills/pixelcraft-visual-qa/references/capture-terminal.md +31 -0
- package/skills/pixelcraft-visual-qa/references/critique-rubric.md +71 -0
- package/skills/pixelcraft-visual-qa/references/finish-gate.md +35 -0
- package/skills/pixelcraft-visual-qa/references/measured-craft.md +30 -0
- package/skills/pixelcraft-visual-qa/references/performance-budgets.md +65 -0
- package/skills/pixelcraft-visual-qa/references/task-verification.md +81 -0
- package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +135 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-aria-modal.html +19 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-audit.html +34 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-modal.html +17 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-deferred.js +1 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-edge.html +52 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.html +80 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.js +8 -0
- package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +513 -0
- package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +1154 -0
- package/skills/pixelcraft-web/SKILL.md +76 -0
- package/skills/pixelcraft-web/references/adaptive-layout.md +25 -0
- package/skills/pixelcraft-web/references/angular.md +61 -0
- package/skills/pixelcraft-web/references/astro.md +62 -0
- package/skills/pixelcraft-web/references/clojurescript.md +53 -0
- package/skills/pixelcraft-web/references/elm.md +53 -0
- package/skills/pixelcraft-web/references/fsharp-fable.md +53 -0
- package/skills/pixelcraft-web/references/html-css.md +88 -0
- package/skills/pixelcraft-web/references/htmx-alpine.md +53 -0
- package/skills/pixelcraft-web/references/java-web.md +52 -0
- package/skills/pixelcraft-web/references/kotlin-web.md +53 -0
- package/skills/pixelcraft-web/references/leptos-yew.md +54 -0
- package/skills/pixelcraft-web/references/lit-web-components.md +61 -0
- package/skills/pixelcraft-web/references/pwa.md +225 -0
- package/skills/pixelcraft-web/references/qwik.md +54 -0
- package/skills/pixelcraft-web/references/react-next.md +69 -0
- package/skills/pixelcraft-web/references/scala-laminar.md +53 -0
- package/skills/pixelcraft-web/references/server-rendered.md +71 -0
- package/skills/pixelcraft-web/references/solid.md +60 -0
- package/skills/pixelcraft-web/references/svelte.md +61 -0
- package/skills/pixelcraft-web/references/tailwind.md +73 -0
- package/skills/pixelcraft-web/references/vue-nuxt.md +62 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# pixelcraft-web evaluation cases
|
|
2
|
+
|
|
3
|
+
## Case — compact campaign shell with a costly hero
|
|
4
|
+
|
|
5
|
+
**Prompt**
|
|
6
|
+
|
|
7
|
+
> Keep our cinematic showcase on wide pages. On a phone the compact navigation should not hide booking; on shallow windows or with reduced motion a static hero is enough.
|
|
8
|
+
|
|
9
|
+
**Expected behaviors**
|
|
10
|
+
|
|
11
|
+
- Keeps the real booking destination reachable with the menu closed; checks menu dismissal and focus at portrait and short height.
|
|
12
|
+
- Keeps semantic content independent of the hero, and uses a fresh load in reduced motion and a trace to test that the unneeded scene does not initialize.
|
|
13
|
+
- Distinguishes a DOM geometry estimate from visual negative space inside the hero asset.
|
|
14
|
+
|
|
15
|
+
**Failure signals**
|
|
16
|
+
|
|
17
|
+
- Shrinks wide navigation without testing a touch action; classifies a hidden but eagerly loaded scene as a lightweight fallback; reports reduced-motion support from a media query alone.
|
|
18
|
+
|
|
19
|
+
## Case 1 — react app
|
|
20
|
+
|
|
21
|
+
**Prompt**
|
|
22
|
+
|
|
23
|
+
> Build a server-rendered React catalog page with filters.
|
|
24
|
+
|
|
25
|
+
**Expected behaviors**
|
|
26
|
+
|
|
27
|
+
- Selects or applies `pixelcraft-web` behavior when the prompt matches its trigger.
|
|
28
|
+
- uses real HTML semantics/render strategy/hydration discipline/state restoration.
|
|
29
|
+
- Documents platform constraints, missing states, and verification tradeoffs explicitly.
|
|
30
|
+
- Preserves truthful content, necessary states, accessibility, security/privacy constraints, and honest evidence labels.
|
|
31
|
+
|
|
32
|
+
**Failure signals**
|
|
33
|
+
|
|
34
|
+
- hydrates everything.
|
|
35
|
+
- breaks back/scroll restoration.
|
|
36
|
+
- generic responsive shrink.
|
|
37
|
+
|
|
38
|
+
**With-vs-without comparison criteria**
|
|
39
|
+
|
|
40
|
+
| Dimension | Without skill baseline | With skill target |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| Trigger/routing | Implements directly with generic assumptions | Recognizes the domain and applies the matching skill/reference |
|
|
43
|
+
| Constraint fidelity | Relies on common defaults or stale APIs | Uses the exact surface constraints, state model, and platform idioms in the expected behaviors |
|
|
44
|
+
| Verification | Reports code/text output only | Provides appropriate rendered/static/model evidence and labels unavailable checks |
|
|
45
|
+
|
|
46
|
+
## Case 2 — pwa request
|
|
47
|
+
|
|
48
|
+
**Prompt**
|
|
49
|
+
|
|
50
|
+
> Make a documentation app installable and offline-capable.
|
|
51
|
+
|
|
52
|
+
**Expected behaviors**
|
|
53
|
+
|
|
54
|
+
- Selects or applies `pixelcraft-web` behavior when the prompt matches its trigger.
|
|
55
|
+
- routes to PWA manifest/service-worker/install/update/iOS guidance.
|
|
56
|
+
- Documents platform constraints, missing states, and verification tradeoffs explicitly.
|
|
57
|
+
- Preserves truthful content, necessary states, accessibility, security/privacy constraints, and honest evidence labels.
|
|
58
|
+
|
|
59
|
+
**Failure signals**
|
|
60
|
+
|
|
61
|
+
- manifest-only PWA.
|
|
62
|
+
- no offline states.
|
|
63
|
+
- ignores update flow.
|
|
64
|
+
|
|
65
|
+
**With-vs-without comparison criteria**
|
|
66
|
+
|
|
67
|
+
| Dimension | Without skill baseline | With skill target |
|
|
68
|
+
|---|---|---|
|
|
69
|
+
| Trigger/routing | Implements directly with generic assumptions | Recognizes the domain and applies the matching skill/reference |
|
|
70
|
+
| Constraint fidelity | Relies on common defaults or stale APIs | Uses the exact surface constraints, state model, and platform idioms in the expected behaviors |
|
|
71
|
+
| Verification | Reports code/text output only | Provides appropriate rendered/static/model evidence and labels unavailable checks |
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# pixelcraft evaluation cases
|
|
2
|
+
|
|
3
|
+
## Case — new project, extension, or rebuild under pressure
|
|
4
|
+
|
|
5
|
+
In one run, ask for a new booking app from an empty project with undecided direction and an existing backend contract. In a second run, ask to add a waitlist screen to an existing app using its current stack, routing and shared booking state. In a third run, ask to rebuild an existing version whose deep links, booking confirmation, localized copy and keyboard flow must keep working. In each run, ask to move quickly, without waiving any check.
|
|
6
|
+
|
|
7
|
+
Pass: follow the phase order and show evidence of actual reading and decisions before implementing the new app. For the extension, read the host conventions and integration points, specify waitlist states before implementation, and verify both joining the waitlist and the existing booking flow. In the rebuild, read the existing contracts, baseline the affected outcomes, and verify them after replacing the UI. Use the current project stack unless a change is authorized. Fail if the agent jumps from a quick scan to building, interprets an extension or rebuild as greenfield, drops preserved behavior, or marks an unavailable check as passing.
|
|
8
|
+
|
|
9
|
+
## Case — narrow repair with a misleading green probe
|
|
10
|
+
|
|
11
|
+
Give the agent a working settings screen with a broken Save handler, prior stack evidence, labeled demo rows and an unrelated TODO in a test. A browser screenshot looks correct and a shell probe swallows a failing exit code.
|
|
12
|
+
|
|
13
|
+
Pass: reuse the plan, repair Save without redesigning, verify a persisted change or report it unchecked, preserve legitimate fixtures and unrelated TODOs, and never cite the swallowed error as a pass. Under a low budget give a checkpoint with evidence and the next meaningful check rather than rerunning the same commands.
|
|
14
|
+
|
|
15
|
+
## Case 1 — full redesign
|
|
16
|
+
|
|
17
|
+
**Prompt**
|
|
18
|
+
|
|
19
|
+
> Redesign a project management dashboard in React for busy operations teams.
|
|
20
|
+
|
|
21
|
+
**Expected behaviors**
|
|
22
|
+
|
|
23
|
+
- Selects or applies `pixelcraft` behavior when the prompt matches its trigger.
|
|
24
|
+
- runs plan/direction/constraint routing before implementation.
|
|
25
|
+
- suppresses divergence for approved design scope while still diverging only on undecided parts.
|
|
26
|
+
- creates or updates a concise design brief with evidence classes, approval state, non-goals, missing material, and validation requirements.
|
|
27
|
+
- coordinates ux/tokens/platform/review skills.
|
|
28
|
+
- Preserves truthful content, necessary states, accessibility, security/privacy constraints, and honest evidence labels.
|
|
29
|
+
|
|
30
|
+
**Failure signals**
|
|
31
|
+
|
|
32
|
+
- starts with component styling.
|
|
33
|
+
- generic hero/cards output.
|
|
34
|
+
- no evidence labels.
|
|
35
|
+
|
|
36
|
+
**With-vs-without comparison criteria**
|
|
37
|
+
|
|
38
|
+
| Dimension | Without skill baseline | With skill target |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| Trigger/routing | Implements directly with generic assumptions | Recognizes the domain and applies the matching skill/reference |
|
|
41
|
+
| Constraint fidelity | Relies on common defaults or stale APIs | Uses the exact surface constraints, state model, and platform idioms in the expected behaviors |
|
|
42
|
+
| Verification | Reports code/text output only | Provides appropriate rendered/static/model evidence and labels unavailable checks |
|
|
43
|
+
|
|
44
|
+
## Case 2 — brownfield polish
|
|
45
|
+
|
|
46
|
+
**Prompt**
|
|
47
|
+
|
|
48
|
+
> Improve this existing settings page without changing the stack or visual identity.
|
|
49
|
+
|
|
50
|
+
**Expected behaviors**
|
|
51
|
+
|
|
52
|
+
- Selects or applies `pixelcraft` behavior when the prompt matches its trigger.
|
|
53
|
+
- inspects existing architecture and preserves constraints.
|
|
54
|
+
- reports surface acceptance dimensions or explicitly marks unavailable rows `not-checked`/`waived`.
|
|
55
|
+
- routes only relevant domain/platform guidance.
|
|
56
|
+
- Preserves truthful content, necessary states, accessibility, security/privacy constraints, and honest evidence labels.
|
|
57
|
+
|
|
58
|
+
**Failure signals**
|
|
59
|
+
|
|
60
|
+
- rewrites the stack.
|
|
61
|
+
- ignores existing design system.
|
|
62
|
+
- overclaims visual verification.
|
|
63
|
+
|
|
64
|
+
**With-vs-without comparison criteria**
|
|
65
|
+
|
|
66
|
+
| Dimension | Without skill baseline | With skill target |
|
|
67
|
+
|---|---|---|
|
|
68
|
+
| Trigger/routing | Implements directly with generic assumptions | Recognizes the domain and applies the matching skill/reference |
|
|
69
|
+
| Constraint fidelity | Relies on common defaults or stale APIs | Uses the exact surface constraints, state model, and platform idioms in the expected behaviors |
|
|
70
|
+
| Verification | Reports code/text output only | Provides appropriate rendered/static/model evidence and labels unavailable checks |
|
package/install.ps1
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
[CmdletBinding()]
|
|
2
|
+
param(
|
|
3
|
+
[string[]]$Agent = @('agents'),
|
|
4
|
+
[string[]]$Skill = @('all'),
|
|
5
|
+
[switch]$Global,
|
|
6
|
+
[switch]$Force,
|
|
7
|
+
[switch]$DryRun,
|
|
8
|
+
[switch]$DocsMcp,
|
|
9
|
+
[string]$Ref = 'main',
|
|
10
|
+
[string]$Repo = 'ThanhNguyxnOrg/Pixelcraft',
|
|
11
|
+
[string]$Archive
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
& {
|
|
15
|
+
Set-StrictMode -Version Latest
|
|
16
|
+
$ErrorActionPreference = 'Stop'
|
|
17
|
+
|
|
18
|
+
$canonicalAgents = @('claude', 'codex', 'agents', 'devin', 'cursor', 'gemini', 'copilot', 'windsurf', 'opencode', 'kiro', 'cline', 'roo', 'droid', 'antigravity')
|
|
19
|
+
$validAgents = $canonicalAgents + @('all')
|
|
20
|
+
|
|
21
|
+
function ConvertTo-CanonicalAgent([string]$Name) {
|
|
22
|
+
$value = $Name.Trim().ToLowerInvariant()
|
|
23
|
+
switch ($value) {
|
|
24
|
+
'claude-code' { return 'claude' }
|
|
25
|
+
'gemini-cli' { return 'gemini' }
|
|
26
|
+
'github-copilot' { return 'copilot' }
|
|
27
|
+
'open-code' { return 'opencode' }
|
|
28
|
+
'roo-code' { return 'roo' }
|
|
29
|
+
'factory' { return 'droid' }
|
|
30
|
+
{ $_ -in @('amp', 'zed', 'goose') } { return 'agents' }
|
|
31
|
+
default { return $value }
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function Test-AnyPath([string]$Path) {
|
|
36
|
+
$item = Get-Item -LiteralPath $Path -Force -ErrorAction SilentlyContinue
|
|
37
|
+
return ($null -ne $item)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function Test-ReparsePoint([string]$Path) {
|
|
41
|
+
$item = Get-Item -LiteralPath $Path -Force -ErrorAction SilentlyContinue
|
|
42
|
+
return ($null -ne $item -and [bool]($item.Attributes -band [System.IO.FileAttributes]::ReparsePoint))
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function Assert-TargetPathSafe([string]$DestinationRoot, [bool]$GlobalScope) {
|
|
46
|
+
$base = if ($GlobalScope) { [System.Environment]::GetFolderPath('UserProfile') } else { (Get-Location).Path }
|
|
47
|
+
$rootFull = [System.IO.Path]::GetFullPath($DestinationRoot)
|
|
48
|
+
$baseFull = [System.IO.Path]::GetFullPath($base)
|
|
49
|
+
$separator = [string][System.IO.Path]::DirectorySeparatorChar
|
|
50
|
+
$prefix = $baseFull
|
|
51
|
+
if (-not $prefix.EndsWith($separator)) { $prefix += $separator }
|
|
52
|
+
if (-not $rootFull.StartsWith($prefix, [System.StringComparison]::OrdinalIgnoreCase)) {
|
|
53
|
+
throw "target skills directory is outside the expected scope: $DestinationRoot"
|
|
54
|
+
}
|
|
55
|
+
$relative = $rootFull.Substring($prefix.Length)
|
|
56
|
+
$current = $baseFull
|
|
57
|
+
foreach ($part in ($relative -split '[\\/]+')) {
|
|
58
|
+
if ([string]::IsNullOrWhiteSpace($part)) { continue }
|
|
59
|
+
$current = Join-Path $current $part
|
|
60
|
+
if (Test-ReparsePoint $current) {
|
|
61
|
+
throw "target skills path component is a symlink or reparse point: $current; refusing to install through it"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function Get-TargetRoot([string]$Name, [bool]$GlobalScope) {
|
|
67
|
+
$homeDir = [System.Environment]::GetFolderPath('UserProfile')
|
|
68
|
+
if ($GlobalScope) {
|
|
69
|
+
if ($Name -eq 'claude') { return (Join-Path $homeDir '.claude/skills') }
|
|
70
|
+
if ($Name -in @('codex', 'agents', 'devin')) { return (Join-Path $homeDir '.agents/skills') }
|
|
71
|
+
if ($Name -eq 'cursor') { return (Join-Path $homeDir '.cursor/skills') }
|
|
72
|
+
if ($Name -eq 'gemini') { return (Join-Path $homeDir '.gemini/skills') }
|
|
73
|
+
if ($Name -eq 'copilot') { return (Join-Path $homeDir '.copilot/skills') }
|
|
74
|
+
if ($Name -eq 'windsurf') { return (Join-Path $homeDir '.codeium/windsurf/skills') }
|
|
75
|
+
if ($Name -eq 'opencode') { return (Join-Path $homeDir '.config/opencode/skills') }
|
|
76
|
+
if ($Name -eq 'kiro') { return (Join-Path $homeDir '.kiro/skills') }
|
|
77
|
+
if ($Name -eq 'cline') { return (Join-Path $homeDir '.cline/skills') }
|
|
78
|
+
if ($Name -eq 'roo') { return (Join-Path $homeDir '.roo/skills') }
|
|
79
|
+
if ($Name -eq 'droid') { return (Join-Path $homeDir '.factory/skills') }
|
|
80
|
+
if ($Name -eq 'antigravity') { return (Join-Path $homeDir '.gemini/config/skills') }
|
|
81
|
+
} else {
|
|
82
|
+
$base = (Get-Location).Path
|
|
83
|
+
if ($Name -eq 'claude') { return (Join-Path $base '.claude/skills') }
|
|
84
|
+
if ($Name -in @('codex', 'agents', 'devin', 'antigravity')) { return (Join-Path $base '.agents/skills') }
|
|
85
|
+
if ($Name -eq 'cursor') { return (Join-Path $base '.cursor/skills') }
|
|
86
|
+
if ($Name -eq 'gemini') { return (Join-Path $base '.gemini/skills') }
|
|
87
|
+
if ($Name -eq 'copilot') { return (Join-Path $base '.github/skills') }
|
|
88
|
+
if ($Name -eq 'windsurf') { return (Join-Path $base '.windsurf/skills') }
|
|
89
|
+
if ($Name -eq 'opencode') { return (Join-Path $base '.opencode/skills') }
|
|
90
|
+
if ($Name -eq 'kiro') { return (Join-Path $base '.kiro/skills') }
|
|
91
|
+
if ($Name -eq 'cline') { return (Join-Path $base '.cline/skills') }
|
|
92
|
+
if ($Name -eq 'roo') { return (Join-Path $base '.roo/skills') }
|
|
93
|
+
if ($Name -eq 'droid') { return (Join-Path $base '.factory/skills') }
|
|
94
|
+
}
|
|
95
|
+
throw "invalid agent '$Name'"
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function Get-WorkflowTask([string]$Name) {
|
|
99
|
+
switch ($Name) {
|
|
100
|
+
'pixelcraft-plan' { return 'Run Pixelcraft step-zero planning before UI work' }
|
|
101
|
+
'pixelcraft-review' { return 'Audit or critique UI with Pixelcraft evidence rules' }
|
|
102
|
+
'pixelcraft-visual-qa' { return 'Capture and inspect rendered UI evidence' }
|
|
103
|
+
'pixelcraft-direction' { return 'Generate divergent visual directions' }
|
|
104
|
+
default { return 'Run the Pixelcraft orchestrator for UI design/build work' }
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function Write-AdapterFile([string]$Path, [string[]]$Lines) {
|
|
109
|
+
$parent = Split-Path -Parent $Path
|
|
110
|
+
Assert-TargetPathSafe $parent ([bool]$Global)
|
|
111
|
+
if (Test-ReparsePoint $Path) { throw "adapter output is a symlink or reparse point: $Path; refusing to install through it" }
|
|
112
|
+
$exists = Test-AnyPath $Path
|
|
113
|
+
if ($exists -and -not $Force) {
|
|
114
|
+
$prefix = if ($DryRun) { 'dry-run: ' } else { '' }
|
|
115
|
+
Write-Host "${prefix}skipped existing adapter: $Path (use -Force to replace)"
|
|
116
|
+
return
|
|
117
|
+
}
|
|
118
|
+
if ($DryRun) {
|
|
119
|
+
Write-Host "dry-run: adapter $Path"
|
|
120
|
+
return
|
|
121
|
+
}
|
|
122
|
+
if (-not (Test-AnyPath $parent)) { New-Item -ItemType Directory -Path $parent -Force | Out-Null }
|
|
123
|
+
Assert-TargetPathSafe $parent ([bool]$Global)
|
|
124
|
+
Set-Content -LiteralPath $Path -Value $Lines -Encoding UTF8
|
|
125
|
+
Write-Host "installed adapter: $Path"
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function Write-PixelcraftAdapter([string]$AgentName, [string]$SkillRoot) {
|
|
129
|
+
$base = Split-Path -Parent $SkillRoot
|
|
130
|
+
$workflowActions = @(
|
|
131
|
+
@{ Name = 'pixelcraft-plan'; Task = (Get-WorkflowTask 'pixelcraft-plan') },
|
|
132
|
+
@{ Name = 'pixelcraft-review'; Task = (Get-WorkflowTask 'pixelcraft-review') },
|
|
133
|
+
@{ Name = 'pixelcraft-visual-qa'; Task = (Get-WorkflowTask 'pixelcraft-visual-qa') },
|
|
134
|
+
@{ Name = 'pixelcraft-direction'; Task = (Get-WorkflowTask 'pixelcraft-direction') }
|
|
135
|
+
)
|
|
136
|
+
if ($AgentName -eq 'claude') {
|
|
137
|
+
$commandActions = @(@{ Name = 'pixelcraft'; Task = (Get-WorkflowTask 'pixelcraft') }) + $workflowActions
|
|
138
|
+
foreach ($action in $commandActions) {
|
|
139
|
+
Write-AdapterFile (Join-Path $base ("commands/$($action.Name).md")) @('---', "description: $($action.Task)", '---', '', "$($action.Task). Read and follow the self-contained $($action.Name) skill. Preserve user requirements, project conventions, accessibility, and evidence labels.")
|
|
140
|
+
}
|
|
141
|
+
} elseif ($AgentName -eq 'cursor') {
|
|
142
|
+
Write-AdapterFile (Join-Path $base 'rules/pixelcraft.mdc') @('---', 'description: Route UI design and review through Pixelcraft', 'alwaysApply: true', '---', '', '# Pixelcraft router', '', "Use Pixelcraft for interface design, implementation, review, and visual QA. Start with pixelcraft-plan and read the matching self-contained skill under $SkillRoot; do not inline large generated content.")
|
|
143
|
+
} elseif ($AgentName -eq 'copilot') {
|
|
144
|
+
Write-AdapterFile (Join-Path $base 'copilot-instructions.md') @('# Pixelcraft router', '', "Use Pixelcraft for interface design, implementation, review, and visual QA. Start with pixelcraft-plan and read the matching self-contained skill under $SkillRoot; do not inline large generated content.")
|
|
145
|
+
Write-AdapterFile (Join-Path $base 'instructions/pixelcraft.instructions.md') @('---', 'applyTo: "**/*.{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}"', '---', '', 'When editing interface or user-facing behavior, follow copilot-instructions.md and read the matching Pixelcraft skill before implementation or review.')
|
|
146
|
+
foreach ($action in $workflowActions) {
|
|
147
|
+
Write-AdapterFile (Join-Path $base ("prompts/$($action.Name).prompt.md")) @('---', "description: $($action.Task)", '---', '', "$($action.Task). Read and follow the self-contained $($action.Name) skill. Preserve user requirements, project conventions, accessibility, and evidence labels.")
|
|
148
|
+
}
|
|
149
|
+
} elseif ($AgentName -eq 'windsurf') {
|
|
150
|
+
Write-AdapterFile (Join-Path $base 'rules/pixelcraft.md') @('# Pixelcraft router', '', "Use Pixelcraft for interface design, implementation, review, and visual QA. Start with pixelcraft-plan and read the matching self-contained skill under $SkillRoot.")
|
|
151
|
+
foreach ($action in $workflowActions) {
|
|
152
|
+
Write-AdapterFile (Join-Path $base ("workflows/$($action.Name).md")) @("# $($action.Task)", '', "1. Read the self-contained $($action.Name) skill under $SkillRoot.", '2. Follow its workflow and references.', '3. Preserve user requirements, accessibility, and evidence labels.')
|
|
153
|
+
}
|
|
154
|
+
} elseif ($AgentName -eq 'kiro') {
|
|
155
|
+
Write-AdapterFile (Join-Path $base 'steering/pixelcraft.md') @('# Pixelcraft steering', '', "Use Pixelcraft for interface design, implementation, review, and visual QA. Start with pixelcraft-plan and read the matching self-contained skill under $SkillRoot.")
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
$agents = @()
|
|
160
|
+
foreach ($raw in ($Agent | ForEach-Object { $_ -split '[,\s]+' })) {
|
|
161
|
+
if ([string]::IsNullOrWhiteSpace($raw)) { continue }
|
|
162
|
+
$name = ConvertTo-CanonicalAgent $raw
|
|
163
|
+
if ($validAgents -notcontains $name) { throw "invalid agent '$raw'; expected one of $($validAgents -join ', ')" }
|
|
164
|
+
if ($name -eq 'all') {
|
|
165
|
+
$agents = $canonicalAgents
|
|
166
|
+
break
|
|
167
|
+
}
|
|
168
|
+
if ($agents -notcontains $name) { $agents += $name }
|
|
169
|
+
}
|
|
170
|
+
if ($agents.Count -eq 0) { throw 'at least one agent is required' }
|
|
171
|
+
|
|
172
|
+
$tmpRoot = Join-Path ([System.IO.Path]::GetTempPath()) ('pixelcraft-' + [guid]::NewGuid().ToString('N'))
|
|
173
|
+
New-Item -ItemType Directory -Path $tmpRoot -Force | Out-Null
|
|
174
|
+
|
|
175
|
+
try {
|
|
176
|
+
$zipPath = Join-Path $tmpRoot 'pixelcraft.zip'
|
|
177
|
+
if ($Archive) {
|
|
178
|
+
if (-not (Test-Path -LiteralPath $Archive -PathType Leaf)) { throw "archive not found: $Archive" }
|
|
179
|
+
Copy-Item -LiteralPath $Archive -Destination $zipPath
|
|
180
|
+
} else {
|
|
181
|
+
$uri = "https://github.com/$Repo/archive/$Ref.zip"
|
|
182
|
+
Invoke-WebRequest -Uri $uri -OutFile $zipPath -UseBasicParsing
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
Expand-Archive -LiteralPath $zipPath -DestinationPath $tmpRoot -Force
|
|
186
|
+
if (Test-Path -LiteralPath (Join-Path $tmpRoot 'skills') -PathType Container) {
|
|
187
|
+
$sourceRoot = Get-Item -LiteralPath $tmpRoot
|
|
188
|
+
} else {
|
|
189
|
+
$sourceRoot = Get-ChildItem -LiteralPath $tmpRoot -Directory |
|
|
190
|
+
Where-Object { Test-Path -LiteralPath (Join-Path $_.FullName 'skills') -PathType Container } |
|
|
191
|
+
Select-Object -First 1
|
|
192
|
+
}
|
|
193
|
+
if ($null -eq $sourceRoot) { throw 'archive does not contain a skills directory' }
|
|
194
|
+
$skillsRoot = Join-Path $sourceRoot.FullName 'skills'
|
|
195
|
+
|
|
196
|
+
$available = @()
|
|
197
|
+
Get-ChildItem -LiteralPath $skillsRoot -Directory |
|
|
198
|
+
Where-Object { Test-Path -LiteralPath (Join-Path $_.FullName 'SKILL.md') -PathType Leaf } |
|
|
199
|
+
Sort-Object Name |
|
|
200
|
+
ForEach-Object { $available += $_.Name }
|
|
201
|
+
if ($available.Count -eq 0) { throw 'no skills found in archive' }
|
|
202
|
+
|
|
203
|
+
$requested = @()
|
|
204
|
+
$useAll = $false
|
|
205
|
+
foreach ($raw in ($Skill | ForEach-Object { $_ -split '[,\s]+' })) {
|
|
206
|
+
if ([string]::IsNullOrWhiteSpace($raw)) { continue }
|
|
207
|
+
$name = $raw.Trim()
|
|
208
|
+
if ($name -ieq 'all') {
|
|
209
|
+
$useAll = $true
|
|
210
|
+
break
|
|
211
|
+
}
|
|
212
|
+
if ($available -notcontains $name) { throw "unknown skill '$name'; available: $($available -join ', ')" }
|
|
213
|
+
if ($requested -notcontains $name) { $requested += $name }
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
$selected = @()
|
|
217
|
+
if ($useAll) {
|
|
218
|
+
foreach ($name in $available) { $selected += [pscustomobject]@{ Name = $name; Auto = $false } }
|
|
219
|
+
} else {
|
|
220
|
+
$injected = @()
|
|
221
|
+
foreach ($core in @('pixelcraft', 'pixelcraft-plan')) {
|
|
222
|
+
if (($available -contains $core) -and ($requested -notcontains $core)) { $injected += $core }
|
|
223
|
+
}
|
|
224
|
+
if ($injected.Count -gt 0) {
|
|
225
|
+
Write-Host "note: including required core skill(s): $($injected -join ', ')"
|
|
226
|
+
foreach ($name in $injected) { $selected += [pscustomobject]@{ Name = $name; Auto = $true } }
|
|
227
|
+
}
|
|
228
|
+
foreach ($name in $requested) { $selected += [pscustomobject]@{ Name = $name; Auto = $false } }
|
|
229
|
+
}
|
|
230
|
+
if ($selected.Count -eq 0) { throw 'at least one skill is required' }
|
|
231
|
+
|
|
232
|
+
$copySkill = {
|
|
233
|
+
param([string]$Name, [string]$DestinationRoot, [bool]$IsAuto)
|
|
234
|
+
$source = Join-Path $skillsRoot $Name
|
|
235
|
+
$destination = Join-Path $DestinationRoot $Name
|
|
236
|
+
|
|
237
|
+
if (Test-ReparsePoint $source) { throw "source skill directory is a symlink: $source; refusing to install through it" }
|
|
238
|
+
if (Test-ReparsePoint $DestinationRoot) { throw "target skills directory is a symlink: $DestinationRoot; refusing to install through it" }
|
|
239
|
+
|
|
240
|
+
$exists = Test-AnyPath $destination
|
|
241
|
+
$isLink = Test-ReparsePoint $destination
|
|
242
|
+
if ($IsAuto -and $exists) {
|
|
243
|
+
$kind = if ($isLink) { 'existing symlink' } else { 'existing install' }
|
|
244
|
+
$prefix = if ($DryRun) { 'dry-run: ' } else { '' }
|
|
245
|
+
Write-Host "${prefix}skipped auto-added ${kind}: $Name -> $destination"
|
|
246
|
+
return
|
|
247
|
+
}
|
|
248
|
+
if ($isLink) { throw "installed skill directory is a symlink: $destination; refusing to install through it" }
|
|
249
|
+
|
|
250
|
+
if ($DryRun) {
|
|
251
|
+
if ($exists -and -not $Force) {
|
|
252
|
+
Write-Host "dry-run: skipped existing $Name -> $destination (use -Force to replace)"
|
|
253
|
+
} else {
|
|
254
|
+
Write-Host "dry-run: $Name -> $destination"
|
|
255
|
+
}
|
|
256
|
+
return
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (-not (Test-AnyPath $DestinationRoot)) { New-Item -ItemType Directory -Path $DestinationRoot -Force | Out-Null }
|
|
260
|
+
if (Test-ReparsePoint $DestinationRoot) { throw "target skills directory is a symlink: $DestinationRoot; refusing to install through it" }
|
|
261
|
+
if ($exists -and -not $Force) {
|
|
262
|
+
Write-Host "skipped existing: $Name -> $destination (use -Force to replace)"
|
|
263
|
+
return
|
|
264
|
+
}
|
|
265
|
+
if ($exists) { Remove-Item -LiteralPath $destination -Recurse -Force }
|
|
266
|
+
Copy-Item -LiteralPath $source -Destination $destination -Recurse
|
|
267
|
+
Write-Host "installed: $Name -> $destination"
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
$targets = @()
|
|
271
|
+
$targetAgents = @()
|
|
272
|
+
foreach ($name in $agents) {
|
|
273
|
+
$target = Get-TargetRoot $name ([bool]$Global)
|
|
274
|
+
Assert-TargetPathSafe $target ([bool]$Global)
|
|
275
|
+
if ($targets -notcontains $target) {
|
|
276
|
+
$targets += $target
|
|
277
|
+
$targetAgents += $name
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
for ($index = 0; $index -lt $targets.Count; $index += 1) {
|
|
282
|
+
$target = $targets[$index]
|
|
283
|
+
$agentName = $targetAgents[$index]
|
|
284
|
+
foreach ($entry in $selected) {
|
|
285
|
+
& $copySkill ($entry.Name) $target ($entry.Auto)
|
|
286
|
+
}
|
|
287
|
+
Write-PixelcraftAdapter $agentName $target
|
|
288
|
+
}
|
|
289
|
+
if ($DocsMcp) {
|
|
290
|
+
Write-Output 'Optional Context7 docs MCP: follow the instructions for your host at https://github.com/upstash/context7#readme. Pixelcraft does not configure MCP or request credentials. If unavailable, use versioned official docs and the package registry.'
|
|
291
|
+
}
|
|
292
|
+
} finally {
|
|
293
|
+
Remove-Item -LiteralPath $tmpRoot -Recurse -Force -ErrorAction SilentlyContinue
|
|
294
|
+
}
|
|
295
|
+
}
|