@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,444 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import readline from 'node:readline';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
|
|
8
|
+
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
9
|
+
const skillsRoot = path.join(repoRoot, 'skills');
|
|
10
|
+
const canonicalAgents = ['claude', 'codex', 'agents', 'devin', 'cursor', 'gemini', 'copilot', 'windsurf', 'opencode', 'kiro', 'cline', 'roo', 'droid', 'antigravity'];
|
|
11
|
+
const validAgents = [...canonicalAgents, 'all'];
|
|
12
|
+
const agentAliases = {
|
|
13
|
+
'claude-code': 'claude',
|
|
14
|
+
'gemini-cli': 'gemini',
|
|
15
|
+
'github-copilot': 'copilot',
|
|
16
|
+
'open-code': 'opencode',
|
|
17
|
+
'roo-code': 'roo',
|
|
18
|
+
factory: 'droid',
|
|
19
|
+
amp: 'agents',
|
|
20
|
+
zed: 'agents',
|
|
21
|
+
goose: 'agents',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
function skillNames() {
|
|
25
|
+
return fs.readdirSync(skillsRoot, { withFileTypes: true })
|
|
26
|
+
.filter((entry) => entry.isDirectory() && fs.existsSync(path.join(skillsRoot, entry.name, 'SKILL.md')))
|
|
27
|
+
.map((entry) => entry.name)
|
|
28
|
+
.sort();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function canonicalAgent(name) {
|
|
32
|
+
const normalized = name.trim().toLowerCase();
|
|
33
|
+
return agentAliases[normalized] || normalized;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function expandAgents(input) {
|
|
37
|
+
const values = (Array.isArray(input) ? input : [input])
|
|
38
|
+
.flatMap((value) => String(value).split(/[\s,]+/))
|
|
39
|
+
.filter(Boolean)
|
|
40
|
+
.map(canonicalAgent);
|
|
41
|
+
if (values.length === 0) throw new Error('add requires --agent');
|
|
42
|
+
const unknown = values.filter((name) => !validAgents.includes(name));
|
|
43
|
+
if (unknown.length) throw new Error(`invalid agent '${unknown.join(', ')}'; expected one of ${validAgents.join(', ')}`);
|
|
44
|
+
if (values.includes('all')) return canonicalAgents;
|
|
45
|
+
return [...new Set(values)];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function targetsFor(agentInput, globalInstall) {
|
|
49
|
+
const home = os.homedir();
|
|
50
|
+
const project = {
|
|
51
|
+
claude: { root: '.claude/skills', type: 'skills' },
|
|
52
|
+
codex: { root: '.agents/skills', type: 'skills' },
|
|
53
|
+
agents: { root: '.agents/skills', type: 'skills' },
|
|
54
|
+
devin: { root: '.agents/skills', type: 'skills' },
|
|
55
|
+
cursor: { root: '.cursor/skills', type: 'skills' },
|
|
56
|
+
gemini: { root: '.gemini/skills', type: 'skills' },
|
|
57
|
+
copilot: { root: '.github/skills', type: 'skills' },
|
|
58
|
+
windsurf: { root: '.windsurf', type: 'windsurf' },
|
|
59
|
+
opencode: { root: '.opencode/skills', type: 'skills' },
|
|
60
|
+
kiro: { root: '.kiro', type: 'kiro' },
|
|
61
|
+
cline: { root: '.cline/skills', type: 'skills' },
|
|
62
|
+
roo: { root: '.roo/skills', type: 'skills' },
|
|
63
|
+
droid: { root: '.factory/skills', type: 'skills' },
|
|
64
|
+
antigravity: { root: '.agents/skills', type: 'skills' },
|
|
65
|
+
};
|
|
66
|
+
const globalMap = {
|
|
67
|
+
claude: { root: path.join(home, '.claude/skills'), type: 'skills' },
|
|
68
|
+
codex: { root: path.join(home, '.agents/skills'), type: 'skills' },
|
|
69
|
+
agents: { root: path.join(home, '.agents/skills'), type: 'skills' },
|
|
70
|
+
devin: { root: path.join(home, '.agents/skills'), type: 'skills' },
|
|
71
|
+
cursor: { root: path.join(home, '.cursor/skills'), type: 'skills' },
|
|
72
|
+
gemini: { root: path.join(home, '.gemini/skills'), type: 'skills' },
|
|
73
|
+
copilot: { root: path.join(home, '.copilot/skills'), type: 'skills' },
|
|
74
|
+
windsurf: { root: path.join(home, '.codeium/windsurf'), type: 'windsurf' },
|
|
75
|
+
opencode: { root: path.join(home, '.config/opencode/skills'), type: 'skills' },
|
|
76
|
+
kiro: { root: path.join(home, '.kiro'), type: 'kiro' },
|
|
77
|
+
cline: { root: path.join(home, '.cline/skills'), type: 'skills' },
|
|
78
|
+
roo: { root: path.join(home, '.roo/skills'), type: 'skills' },
|
|
79
|
+
droid: { root: path.join(home, '.factory/skills'), type: 'skills' },
|
|
80
|
+
antigravity: { root: path.join(home, '.gemini/config/skills'), type: 'skills' },
|
|
81
|
+
};
|
|
82
|
+
const map = globalInstall ? globalMap : project;
|
|
83
|
+
const seen = new Set();
|
|
84
|
+
const targets = [];
|
|
85
|
+
for (const agent of expandAgents(agentInput)) {
|
|
86
|
+
const spec = map[agent];
|
|
87
|
+
const key = `${spec.type}:${spec.root}`;
|
|
88
|
+
if (seen.has(key)) continue;
|
|
89
|
+
seen.add(key);
|
|
90
|
+
targets.push({ agent, type: spec.type, root: path.resolve(process.cwd(), spec.root), global: globalInstall });
|
|
91
|
+
}
|
|
92
|
+
return targets;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function help() {
|
|
96
|
+
return `Usage: pixelcraft [command] [options]
|
|
97
|
+
|
|
98
|
+
Install from npm: npm i -g @thanhnguyxn/pixelcraft
|
|
99
|
+
Run with no arguments to start the interactive install wizard.
|
|
100
|
+
|
|
101
|
+
Commands:
|
|
102
|
+
add <skill...|all> --agent <name|all> [--global] [--dry-run] [--force] [--docs-mcp]
|
|
103
|
+
Copy self-contained skill folders into one or more agent skills directories.
|
|
104
|
+
Repeat --agent or use comma-separated names for multiple targets.
|
|
105
|
+
list
|
|
106
|
+
List skills bundled in this package.
|
|
107
|
+
help, --help
|
|
108
|
+
Show this help.
|
|
109
|
+
|
|
110
|
+
Agents: ${validAgents.join(', ')}.
|
|
111
|
+
Aliases: ${Object.keys(agentAliases).join(', ')}.
|
|
112
|
+
|
|
113
|
+
Options:
|
|
114
|
+
--agent NAME Target host. Required for non-interactive add.
|
|
115
|
+
--global Install in the user-level skills directory instead of the current project.
|
|
116
|
+
--dry-run Print destination copies without writing files.
|
|
117
|
+
--docs-mcp Print optional Context7 setup guidance without configuring any host.
|
|
118
|
+
--force Replace existing explicitly requested skill directories. Auto-added core skills install only when missing.
|
|
119
|
+
|
|
120
|
+
Symlink safety: installation refuses a symlinked target skills directory or skill
|
|
121
|
+
directory instead of replacing files outside the project.
|
|
122
|
+
|
|
123
|
+
Project locations: claude=.claude/skills; codex/agents/devin=.agents/skills;
|
|
124
|
+
cursor=.cursor/skills; gemini=.gemini/skills; copilot=.github/skills;
|
|
125
|
+
opencode=.opencode/skills; kiro=.kiro/skills; cline=.cline/skills;
|
|
126
|
+
roo=.roo/skills; droid=.factory/skills. Windsurf and Kiro get native skills and
|
|
127
|
+
router files. Claude/Cursor/Copilot adapter commands and rules are written
|
|
128
|
+
alongside their skills. Universal .agents/skills remains available through the
|
|
129
|
+
agents target and as a compatibility path in several hosts.
|
|
130
|
+
Global locations: claude=~/.claude/skills; codex/agents/devin=~/.agents/skills;
|
|
131
|
+
cursor=~/.cursor/skills; gemini=~/.gemini/skills; copilot=~/.copilot/skills;
|
|
132
|
+
windsurf=~/.codeium/windsurf/skills plus memories/global_rules.md;
|
|
133
|
+
opencode=~/.config/opencode/skills; kiro=~/.kiro/skills; cline=~/.cline/skills;
|
|
134
|
+
roo=~/.roo/skills; droid=~/.factory/skills; antigravity=~/.gemini/config/skills.
|
|
135
|
+
|
|
136
|
+
Host behavior and global paths follow current public documentation where available.
|
|
137
|
+
They change quickly; verify current host documentation before depending on them in automation.`;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function parse(args) {
|
|
141
|
+
const positional = [];
|
|
142
|
+
const options = { global: false, dryRun: false, force: false, agents: [] };
|
|
143
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
144
|
+
const arg = args[index];
|
|
145
|
+
if (arg === '--global') options.global = true;
|
|
146
|
+
else if (arg === '--dry-run') options.dryRun = true;
|
|
147
|
+
else if (arg === '--docs-mcp') options.docsMcp = true;
|
|
148
|
+
else if (arg === '--force') options.force = true;
|
|
149
|
+
else if (arg === '--agent') {
|
|
150
|
+
index += 1;
|
|
151
|
+
if (!args[index]) throw new Error('--agent requires a value');
|
|
152
|
+
options.agents.push(args[index]);
|
|
153
|
+
} else if (arg.startsWith('--agent=')) options.agents.push(arg.slice('--agent='.length));
|
|
154
|
+
else if (arg === '--help' || arg === '-h') options.help = true;
|
|
155
|
+
else if (arg.startsWith('-')) throw new Error(`unknown option: ${arg}`);
|
|
156
|
+
else positional.push(arg);
|
|
157
|
+
}
|
|
158
|
+
return { positional, options };
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function lstatIfExists(file) {
|
|
162
|
+
try {
|
|
163
|
+
return fs.lstatSync(file);
|
|
164
|
+
} catch (error) {
|
|
165
|
+
if (error.code === 'ENOENT') return null;
|
|
166
|
+
throw error;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function assertNotSymlink(file, label) {
|
|
171
|
+
if (lstatIfExists(file)?.isSymbolicLink()) throw new Error(`${label} is a symlink: ${file}; refusing to install through it`);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function assertInstallPathSafe(target, boundary, label) {
|
|
175
|
+
const base = path.resolve(boundary);
|
|
176
|
+
const destination = path.resolve(target);
|
|
177
|
+
const relative = path.relative(base, destination);
|
|
178
|
+
if (relative.startsWith('..') || path.isAbsolute(relative)) throw new Error(`${label} is outside the install scope: ${target}`);
|
|
179
|
+
assertNotSymlink(base, label);
|
|
180
|
+
let current = base;
|
|
181
|
+
if (relative) {
|
|
182
|
+
for (const part of relative.split(path.sep).filter(Boolean)) {
|
|
183
|
+
current = path.join(current, part);
|
|
184
|
+
assertNotSymlink(current, label);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function copySkill(name, destinationRoot, dryRun, { force = false, auto = false, boundary = process.cwd() } = {}) {
|
|
190
|
+
const source = path.join(skillsRoot, name);
|
|
191
|
+
const destination = path.join(destinationRoot, name);
|
|
192
|
+
assertNotSymlink(source, 'source skill directory');
|
|
193
|
+
assertInstallPathSafe(destinationRoot, boundary, 'target skills path component');
|
|
194
|
+
const destinationStat = lstatIfExists(destination);
|
|
195
|
+
const exists = destinationStat !== null;
|
|
196
|
+
if (auto && exists) {
|
|
197
|
+
const kind = destinationStat.isSymbolicLink() ? 'existing symlink' : 'existing install';
|
|
198
|
+
console.log(`${dryRun ? 'dry-run: ' : ''}skipped auto-added ${kind}: ${name} -> ${destination}`);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
if (destinationStat?.isSymbolicLink()) throw new Error(`installed skill directory is a symlink: ${destination}; refusing to install through it`);
|
|
202
|
+
if (dryRun) {
|
|
203
|
+
if (exists && !force) console.log(`dry-run: skipped existing ${name} -> ${destination} (use --force to replace)`);
|
|
204
|
+
else console.log(`dry-run: ${name} -> ${destination}`);
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
fs.mkdirSync(destinationRoot, { recursive: true });
|
|
208
|
+
assertInstallPathSafe(destinationRoot, boundary, 'target skills path component');
|
|
209
|
+
if (exists && !force) {
|
|
210
|
+
console.log(`skipped existing: ${name} -> ${destination} (use --force to replace)`);
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
fs.rmSync(destination, { recursive: true, force: true });
|
|
214
|
+
fs.cpSync(source, destination, { recursive: true });
|
|
215
|
+
console.log(`installed: ${name} -> ${destination}`);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function selectSkills(positional, available) {
|
|
219
|
+
const requested = positional.includes('all') ? available : positional;
|
|
220
|
+
const unknown = requested.filter((name) => !available.includes(name));
|
|
221
|
+
if (unknown.length) throw new Error(`unknown skill(s): ${unknown.join(', ')}; available: ${available.join(', ')}`);
|
|
222
|
+
|
|
223
|
+
let selected = requested.map((name) => ({ name, auto: false }));
|
|
224
|
+
if (!positional.includes('all')) {
|
|
225
|
+
const required = ['pixelcraft', 'pixelcraft-plan'].filter((name) => available.includes(name));
|
|
226
|
+
const injected = required.filter((name) => !requested.includes(name));
|
|
227
|
+
if (injected.length) {
|
|
228
|
+
selected = [...injected.map((name) => ({ name, auto: true })), ...selected];
|
|
229
|
+
console.log(`note: including required core skill(s): ${injected.join(', ')}`);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return selected;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
const adapterActions = [
|
|
236
|
+
['pixelcraft', 'pixelcraft', 'Run the Pixelcraft orchestrator for UI design/build work'],
|
|
237
|
+
['pixelcraft-plan', 'pixelcraft-plan', 'Run Pixelcraft step-zero planning before UI work'],
|
|
238
|
+
['pixelcraft-review', 'pixelcraft-review', 'Audit or critique UI with Pixelcraft evidence rules'],
|
|
239
|
+
['pixelcraft-visual-qa', 'pixelcraft-visual-qa', 'Capture and inspect rendered UI evidence'],
|
|
240
|
+
['pixelcraft-direction', 'pixelcraft-direction', 'Generate divergent visual directions'],
|
|
241
|
+
];
|
|
242
|
+
|
|
243
|
+
function adapterIntro(skillsPath) {
|
|
244
|
+
return `Use Pixelcraft for any request to design, build, redesign, review, audit, polish, or visually verify a user interface. Start with \`pixelcraft-plan\` before implementation, use the \`pixelcraft\` orchestrator for routing, choose the matching platform/pattern skills, and finish with \`pixelcraft-review\` plus \`pixelcraft-visual-qa\` when rendered verification is possible.\n\nDo not inline skill bodies here. Read the matching self-contained skill under \`${skillsPath}\`:\n\n${skillNames().map((name) => `- \`${name}\` — \`${skillsPath}/${name}/SKILL.md\``).join('\n')}\n`;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function commandText(skill, task) {
|
|
248
|
+
return `---\ndescription: ${task}\n---\n\n${task}. Read and follow the self-contained \`${skill}\` skill available in this workspace or user installation. Preserve the user's brief, existing design system, platform conventions, accessibility requirements, and evidence labels.\n`;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
function workflowText(skill, task) {
|
|
252
|
+
return `# ${task}\n\n1. Read the self-contained \`${skill}\` skill from the installed Pixelcraft distribution or source checkout.\n2. Follow its workflow, including referenced files when they match the task.\n3. Preserve user requirements, project conventions, accessibility, and evidence labels.\n4. Report rendered/static/not-checked/waived verification honestly.\n`;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
const managedStart = '<!-- pixelcraft:start -->';
|
|
256
|
+
const managedEnd = '<!-- pixelcraft:end -->';
|
|
257
|
+
|
|
258
|
+
function managedUpsert(existing, content) {
|
|
259
|
+
const block = `${managedStart}\n${content.trimEnd()}\n${managedEnd}`;
|
|
260
|
+
const pattern = new RegExp(`${managedStart}[\\s\\S]*?${managedEnd}`);
|
|
261
|
+
if (pattern.test(existing)) return existing.replace(pattern, block);
|
|
262
|
+
if (existing.includes(managedStart)) throw new Error(`managed Pixelcraft block is missing its end marker: fix the file before installing`);
|
|
263
|
+
return existing ? `${existing.trimEnd()}\n\n${block}\n` : `${block}\n`;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function assertAdapterPathSafe(file, boundary) {
|
|
267
|
+
assertInstallPathSafe(file, boundary, 'adapter path component');
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
function writeAdapterFile(file, content, dryRun, force, boundary = process.cwd(), managed = false) {
|
|
271
|
+
assertAdapterPathSafe(file, boundary);
|
|
272
|
+
const exists = lstatIfExists(file) !== null;
|
|
273
|
+
if (dryRun) {
|
|
274
|
+
console.log(`dry-run: ${managed ? 'managed adapter' : exists && !force ? 'skipped existing adapter' : 'adapter'} ${file}${!managed && exists && !force ? ' (use --force to replace)' : ''}`);
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
if (!managed && exists && !force) {
|
|
278
|
+
console.log(`skipped existing adapter: ${file} (use --force to replace)`);
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
282
|
+
assertAdapterPathSafe(file, boundary);
|
|
283
|
+
const output = managed ? managedUpsert(exists ? fs.readFileSync(file, 'utf8') : '', content) : content;
|
|
284
|
+
fs.writeFileSync(file, output);
|
|
285
|
+
console.log(`installed adapter: ${file}`);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
function writeAgentAdapters(target, dryRun, force, selected) {
|
|
289
|
+
const base = target.type === 'skills' ? path.dirname(target.root) : target.root;
|
|
290
|
+
const displayRoot = target.global ? target.root.replace(os.homedir(), '~') : path.relative(process.cwd(), target.root);
|
|
291
|
+
const boundary = target.global ? os.homedir() : process.cwd();
|
|
292
|
+
const file = (relative) => path.join(base, ...relative.split('/'));
|
|
293
|
+
const write = (relative, content, managed = false) => writeAdapterFile(file(relative), content, dryRun, force, boundary, managed);
|
|
294
|
+
if (target.agent === 'claude') {
|
|
295
|
+
for (const [command, skill, task] of adapterActions.slice(0, 4)) write(`commands/${command}.md`, commandText(skill, task));
|
|
296
|
+
} else if (target.agent === 'cursor') {
|
|
297
|
+
write('rules/pixelcraft.mdc', `---\ndescription: Route UI design and review through Pixelcraft\nalwaysApply: true\n---\n\n# Pixelcraft router\n\n${adapterIntro(displayRoot)}`);
|
|
298
|
+
} else if (target.agent === 'copilot') {
|
|
299
|
+
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`);
|
|
301
|
+
for (const [command, skill, task] of adapterActions.slice(1)) write(`prompts/${command}.prompt.md`, commandText(skill, task));
|
|
302
|
+
} else if (target.type === 'windsurf' || target.type === 'kiro') {
|
|
303
|
+
const supportRoot = path.join(base, 'skills');
|
|
304
|
+
assertAdapterPathSafe(path.join(supportRoot, 'probe'), boundary);
|
|
305
|
+
for (const entry of selected) copySkill(entry.name, supportRoot, dryRun, { force: force && !entry.auto, auto: entry.auto, boundary });
|
|
306
|
+
const displaySupport = target.global ? supportRoot.replace(os.homedir(), '~') : path.relative(process.cwd(), supportRoot);
|
|
307
|
+
if (target.type === 'windsurf') {
|
|
308
|
+
write(target.global ? 'memories/global_rules.md' : 'rules/pixelcraft.md', `# Pixelcraft router\n\n${adapterIntro(displaySupport)}`, target.global);
|
|
309
|
+
for (const [command, skill, task] of adapterActions.slice(1)) write(`workflows/${command}.md`, workflowText(skill, task));
|
|
310
|
+
} else {
|
|
311
|
+
write('steering/pixelcraft.md', `# Pixelcraft steering\n\n${adapterIntro(displaySupport)}`);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
function runAdd({ positional, options }) {
|
|
317
|
+
if (positional.length === 0) throw new Error('add requires at least one skill name or all');
|
|
318
|
+
const available = skillNames();
|
|
319
|
+
const selected = selectSkills(positional, available);
|
|
320
|
+
const targets = targetsFor(options.agents, options.global);
|
|
321
|
+
for (const target of targets) {
|
|
322
|
+
if (target.type === 'skills') {
|
|
323
|
+
for (const entry of selected) {
|
|
324
|
+
copySkill(entry.name, target.root, options.dryRun, { force: options.force && !entry.auto, auto: entry.auto, boundary: target.global ? os.homedir() : process.cwd() });
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
writeAgentAdapters(target, options.dryRun, options.force, selected);
|
|
328
|
+
}
|
|
329
|
+
if (options.docsMcp) {
|
|
330
|
+
console.log(`Optional docs MCP for ${expandAgents(options.agents).join(', ')}: follow the Context7 instructions for your host at https://github.com/upstash/context7#readme. Pixelcraft does not configure MCP or request credentials. If unavailable or unsupported, use versioned official docs and the package registry.`);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
function numberedSelection(answer, names) {
|
|
335
|
+
const tokens = answer.split(/[\s,]+/).filter(Boolean);
|
|
336
|
+
if (tokens.length === 0) throw new Error('empty selection');
|
|
337
|
+
return [...new Set(tokens.map((token) => {
|
|
338
|
+
if (/^\d+$/.test(token)) {
|
|
339
|
+
const index = Number(token) - 1;
|
|
340
|
+
if (!names[index]) throw new Error(`selection ${token} is outside the numbered list`);
|
|
341
|
+
return names[index];
|
|
342
|
+
}
|
|
343
|
+
return token.toLowerCase();
|
|
344
|
+
}))];
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
function createPrompter() {
|
|
348
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
349
|
+
const eof = Symbol('eof');
|
|
350
|
+
const lines = [];
|
|
351
|
+
const waiters = [];
|
|
352
|
+
rl.on('line', (line) => {
|
|
353
|
+
if (waiters.length) waiters.shift()(line);
|
|
354
|
+
else lines.push(line);
|
|
355
|
+
});
|
|
356
|
+
rl.on('close', () => {
|
|
357
|
+
while (waiters.length) waiters.shift()(eof);
|
|
358
|
+
});
|
|
359
|
+
return {
|
|
360
|
+
async question(text) {
|
|
361
|
+
process.stdout.write(text);
|
|
362
|
+
if (lines.length) return lines.shift();
|
|
363
|
+
const answer = await new Promise((resolve) => waiters.push(resolve));
|
|
364
|
+
if (answer === eof) throw new Error('input ended before the wizard completed');
|
|
365
|
+
return answer;
|
|
366
|
+
},
|
|
367
|
+
close() {
|
|
368
|
+
rl.close();
|
|
369
|
+
},
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
async function wizard() {
|
|
374
|
+
const available = skillNames();
|
|
375
|
+
const prompter = createPrompter();
|
|
376
|
+
try {
|
|
377
|
+
console.log('Pixelcraft interactive installer\n');
|
|
378
|
+
console.log('Agents:');
|
|
379
|
+
canonicalAgents.forEach((name, index) => console.log(` ${index + 1}) ${name}`));
|
|
380
|
+
console.log(` ${canonicalAgents.length + 1}) all`);
|
|
381
|
+
const ask = async (question, fallback) => {
|
|
382
|
+
const answer = (await prompter.question(question)).trim();
|
|
383
|
+
return answer || fallback;
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
const agentAnswer = await ask(`Choose agent(s) by number/name, comma-separated [1]: `, '1');
|
|
387
|
+
const agents = numberedSelection(agentAnswer, [...canonicalAgents, 'all']);
|
|
388
|
+
|
|
389
|
+
const allAnswer = (await ask('Install all skills? [Y/n]: ', 'y')).toLowerCase();
|
|
390
|
+
let positional = ['all'];
|
|
391
|
+
if (allAnswer.startsWith('n')) {
|
|
392
|
+
console.log('Skills:');
|
|
393
|
+
available.forEach((name, index) => console.log(` ${index + 1}) ${name}`));
|
|
394
|
+
const skillAnswer = await ask('Choose skills by number/name, comma-separated [1]: ', '1');
|
|
395
|
+
positional = numberedSelection(skillAnswer, available);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
const scope = (await ask('Scope: project or global? [project]: ', 'project')).toLowerCase();
|
|
399
|
+
if (scope !== 'project' && scope !== 'global') throw new Error(`scope must be project or global, got '${scope}'`);
|
|
400
|
+
const docsMcp = /^(y|yes)$/i.test(await ask('Show optional Context7 docs MCP setup guidance? [y/N]: ', 'n'));
|
|
401
|
+
console.log(`\nReady to install ${positional.join(', ')} for ${agents.join(', ')} in ${scope} scope.`);
|
|
402
|
+
const confirm = (await ask('Continue? [Y/n]: ', 'y')).toLowerCase();
|
|
403
|
+
if (confirm.startsWith('n')) throw new Error('installation cancelled');
|
|
404
|
+
|
|
405
|
+
return {
|
|
406
|
+
positional,
|
|
407
|
+
options: { global: scope === 'global', dryRun: false, force: false, agents, docsMcp },
|
|
408
|
+
};
|
|
409
|
+
} finally {
|
|
410
|
+
prompter.close();
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
async function main() {
|
|
415
|
+
const args = process.argv.slice(2);
|
|
416
|
+
if (args.includes('--help') || args.includes('-h') || args[0] === 'help') {
|
|
417
|
+
console.log(help());
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
if (args.length === 0) {
|
|
421
|
+
if (!process.stdin.isTTY) {
|
|
422
|
+
console.log(help());
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
runAdd(await wizard());
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
const [command, ...rest] = args;
|
|
430
|
+
if (command === 'list') {
|
|
431
|
+
for (const name of skillNames()) console.log(name);
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
if (command !== 'add') throw new Error(`unknown command: ${command}; run pixelcraft --help`);
|
|
435
|
+
|
|
436
|
+
const { positional, options } = parse(rest);
|
|
437
|
+
if (options.agents.length === 0) throw new Error('add requires --agent');
|
|
438
|
+
runAdd({ positional, options });
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
main().catch((error) => {
|
|
442
|
+
console.error(`pixelcraft: ${error.message}`);
|
|
443
|
+
process.exit(1);
|
|
444
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Pixelcraft architecture
|
|
2
|
+
|
|
3
|
+
Pixelcraft is a pack of portable Agent Skills (`skills/<name>/SKILL.md`) that makes coding agents
|
|
4
|
+
produce distinctive UI and rigorous UX on **any** frontend stack. Read `docs/DESIGN-RATIONALE.md`
|
|
5
|
+
before changing the reasoning behind major rules.
|
|
6
|
+
|
|
7
|
+
## Product thesis
|
|
8
|
+
|
|
9
|
+
1. **Divergence before commitment** — LLM UIs converge because single-shot "best design" prompting
|
|
10
|
+
collapses to the mode. Pixelcraft forces a distribution of 3–5 far-apart directions,
|
|
11
|
+
scores them against the brief, commits to one, and records history so the next build differs.
|
|
12
|
+
2. **A hard floor that never dictates appearance** — truthfulness, accessibility, state coverage,
|
|
13
|
+
localization, responsiveness, performance and verifiability are mandatory; heroes, cards,
|
|
14
|
+
palettes, fonts and layout shapes are not.
|
|
15
|
+
3. **Design once, translate per stack** — core skills speak design language (roles, scales, units,
|
|
16
|
+
rules). Platform skills translate them into idioms of web, mobile, data apps, desktop, TUI, email
|
|
17
|
+
and game UI. Never assume React/Tailwind.
|
|
18
|
+
4. **Honest verification** — every claim names its evidence: rendered, static inspection,
|
|
19
|
+
model judgment, not checked, or waived.
|
|
20
|
+
|
|
21
|
+
## Authority order
|
|
22
|
+
|
|
23
|
+
explicit user brief → existing project design system/tokens → platform conventions + legal +
|
|
24
|
+
accessibility floor → Pixelcraft guidance → model taste.
|
|
25
|
+
|
|
26
|
+
## Skills
|
|
27
|
+
|
|
28
|
+
The architecture has five layers: **Plan** (`pixelcraft-plan`), **Core** (orchestration, direction, craft, tokens, UX), **Surfaces** (platform/framework skills), **Patterns** (surface-independent product patterns), and **Quality** (review, accessibility, visual QA). Layers compose; no layer substitutes for the mandatory floor.
|
|
29
|
+
|
|
30
|
+
| Skill | Role |
|
|
31
|
+
|---|---|
|
|
32
|
+
| `pixelcraft` | Orchestrator: detect stack + surface mode, run the loop, route to other skills, final report contract |
|
|
33
|
+
| `pixelcraft-plan` | Step 0: brownfield repo discovery, greenfield requirements intake, weighted stack selection, `.pixelcraft/plan.md` consumed by later skills |
|
|
34
|
+
| `pixelcraft-direction` | Divergence engine: brief/material extraction, verbalized-sampling directions, movement catalog, signature element, slop fingerprints, history |
|
|
35
|
+
| `pixelcraft-craft` | Visual craft: typography, color (OKLCH, contrast), layout/composition, motion, imagery, iconography |
|
|
36
|
+
| `pixelcraft-tokens` | DTCG 2025.10 tokens, theming/modes, export to CSS/Tailwind/Swift/Compose/Flutter/Python/Qt/Textual |
|
|
37
|
+
| `pixelcraft-ux` | UX before and during build: JTBD, flows, IA, full state coverage, forms, feedback, navigation, cognitive load, i18n, UX writing |
|
|
38
|
+
| `pixelcraft-patterns` | Patterns layer: surface-independent dashboards/admin, commerce, creative tools, communication, auth/onboarding, marketing, settings, search/filtering, tables/CRUD |
|
|
39
|
+
| `pixelcraft-dataviz` | Patterns layer for evidence communication: chart choice, encoding, color/accessibility, tables/dashboards, streaming, node graphs, maps, rendering scale, cross-language libraries |
|
|
40
|
+
| `pixelcraft-accessibility` | WCAG 2.2 floor + platform translations (HIG, Material, desktop, TUI, email, game) and verification split |
|
|
41
|
+
| `pixelcraft-review` | Audit / critique / polish: heuristic scoring with evidence + confidence, persona walkthroughs, slop scan script |
|
|
42
|
+
| `pixelcraft-visual-qa` | Quality-layer render/screenshot/critique/fix loop, cross-surface capture guidance, contrast/overflow/clipping evidence, performance budgets |
|
|
43
|
+
| `pixelcraft-extensions` | Host-constrained extension/plugin surfaces: MV3 browser UI, content-script Shadow DOM, VS Code webviews, Raycast, Figma/Office |
|
|
44
|
+
| `pixelcraft-web` | HTML/CSS, React/Next, Vue/Nuxt, Svelte, Solid, Angular, Astro, Qwik, htmx/Alpine, Lit, server-rendered (Rails, Laravel, Django, Phoenix, Blazor, templ), Rust/Kotlin/Elm/Clojure/F#/Scala/Java web |
|
|
45
|
+
| `pixelcraft-mobile` | SwiftUI, UIKit, Jetpack Compose, Flutter, React Native/Expo, KMP, Ionic, .NET MAUI, Flet, Kivy |
|
|
46
|
+
| `pixelcraft-data-apps` | Streamlit, Gradio, Reflex, NiceGUI, Dash, Panel, Shiny, Jupyter widgets, R Shiny, Julia Genie, Observable Framework, Evidence |
|
|
47
|
+
| `pixelcraft-desktop` | Tauri, Electron, Qt/PySide/QML, WinUI/WPF, AppKit, GTK, Avalonia, Rust GUIs, JavaFX/Swing, C++ Qt/ImGui/wx, Go GUI, Uno |
|
|
48
|
+
| `pixelcraft-tui` | Textual, Rich, Ink, Bubble Tea, Ratatui |
|
|
49
|
+
| `pixelcraft-email` | HTML email / MJML / React Email: tables, inline CSS, dark mode, image blocking, plaintext parity |
|
|
50
|
+
| `pixelcraft-document` | Print/paged-media surface: print CSS, PDF toolchains, invoices/reports/CVs, slide decks, physical typography and final-artifact verification |
|
|
51
|
+
| `pixelcraft-media` | External media surface: social cards/OG generation, SVG banners, platform safe zones, thumbnail legibility, motion/video export constraints |
|
|
52
|
+
| `pixelcraft-chat-ui` | Messaging/conversation surface: host-native cards, keyboards, modals, mini apps, payload limits, privacy, fallback and interaction lifecycle |
|
|
53
|
+
| `pixelcraft-constrained` | Hardware/input-constrained surfaces: TV/wearables/e-ink/kiosk/embedded/automotive/voice, spatial focus, glanceability, physical safety and budgets |
|
|
54
|
+
| `pixelcraft-handoff` | Design-to-code bridge: approved-design translation, variables/modes, existing-component reuse, missing states and measured fidelity |
|
|
55
|
+
| `pixelcraft-spatial` | XR/spatial surface: visionOS/WebXR/Quest/Unity XRI, depth/ergonomics, locomotion comfort, spatial privacy, legibility and accessibility |
|
|
56
|
+
| `pixelcraft-game-ui` | Unity UI Toolkit, Godot, Unreal UMG, LÖVE2D, Bevy, MonoGame: HUD legibility, controller nav, safe areas, localization |
|
|
57
|
+
| `pixelcraft-brandkit` | Premium brand-kit / identity-board image generation (art direction for image models) |
|
|
58
|
+
|
|
59
|
+
Each skill is self-contained (installable alone). Skills refer to each other **by name**
|
|
60
|
+
("use the `pixelcraft-ux` skill"), never by relative path across skill folders.
|
|
61
|
+
Platform skills keep one reference file per framework (`references/<framework>.md`) so they scale to
|
|
62
|
+
many stacks via progressive disclosure.
|
|
63
|
+
|
|
64
|
+
## The Pixelcraft loop (owned by `pixelcraft`)
|
|
65
|
+
|
|
66
|
+
0. **Plan** – `pixelcraft-plan`: brownfield repo map or greenfield constraints/stack decision in `.pixelcraft/plan.md`.
|
|
67
|
+
1. **Frame** – stack + surface detection, mode (Persuade / Operate / Read / Experience / Play /
|
|
68
|
+
Communicate), audience, job-to-be-done, real material inventory, existing design system.
|
|
69
|
+
2. **Diverge** – `pixelcraft-direction`: 3–5 directions with probabilities, scored; pick; log why
|
|
70
|
+
others lost; check history.
|
|
71
|
+
3. **Specify** – direction card + tokens (`pixelcraft-tokens`) + UX plan (flows + state matrix,
|
|
72
|
+
`pixelcraft-ux`).
|
|
73
|
+
4. **Build** – via the platform skill; floor rules applied by default, not repaired later.
|
|
74
|
+
5. **Verify** – `pixelcraft-review` plus `pixelcraft-visual-qa`: slop scan, a11y checks, rendered screenshots/captures where possible,
|
|
75
|
+
heuristic critique, persona walkthrough, performance-budget evidence.
|
|
76
|
+
6. **Report** – what was verified and how, open risks, decisions.
|
|
77
|
+
|
|
78
|
+
## Conventions for SKILL.md
|
|
79
|
+
|
|
80
|
+
- Frontmatter: `name` (= folder name, lowercase-hyphen, ≤64 chars) and `description`
|
|
81
|
+
(third person, what + when + trigger words, ≤1024 chars). Optional `license`, `metadata`.
|
|
82
|
+
No host-specific fields.
|
|
83
|
+
- Body ≤ 500 lines (target ≤ 300). Depth in `references/*.md`, one level deep, each linked from
|
|
84
|
+
SKILL.md with a one-line "read when…".
|
|
85
|
+
- Imperative, concrete, checkable rules. Do not restate what models already know.
|
|
86
|
+
Prefer tables, checklists, do/don't pairs with code in the target idiom.
|
|
87
|
+
- Scripts: Node ≥ 18, zero dependencies, `.mjs`, runnable as `node scripts/x.mjs --help`.
|
|
88
|
+
|
|
89
|
+
## Repository layout
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
skills/<skill>/SKILL.md, references/, scripts/, assets/
|
|
93
|
+
bin/pixelcraft.mjs # zero-dependency installer CLI and wizard
|
|
94
|
+
install.sh, install.ps1 # Node-free shell and PowerShell installers
|
|
95
|
+
scripts/ # validator, adapter builder, and contract tests
|
|
96
|
+
evals/ # 26 behavioural eval guides + JSON fixtures
|
|
97
|
+
assets/ # brand artwork and icons
|
|
98
|
+
docs/ARCHITECTURE.md, docs/DESIGN-RATIONALE.md
|
|
99
|
+
plugin.json, gemini-extension.json
|
|
100
|
+
.claude-plugin/, .agents/plugins/
|
|
101
|
+
.github/workflows/ # CI validation and tag-release workflows
|
|
102
|
+
```
|