@thanhnguyxn/pixelcraft 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +20 -0
- package/.antigravity-plugin/plugin.json +32 -0
- package/.claude-plugin/marketplace.json +20 -0
- package/.claude-plugin/plugin.json +22 -0
- package/.codex-plugin/plugin.json +45 -0
- package/.cursor-plugin/marketplace.json +17 -0
- package/.cursor-plugin/plugin.json +27 -0
- package/.devin-plugin/plugin.json +21 -0
- package/.github/plugin/marketplace.json +34 -0
- package/CHANGELOG.md +159 -0
- package/GEMINI.md +1 -0
- package/LICENSE +21 -0
- package/README.md +264 -2
- package/SECURITY.md +28 -0
- package/assets/README.md +28 -0
- package/assets/pixelcraft-logo-128.png +0 -0
- package/assets/pixelcraft-logo-256.png +0 -0
- package/assets/pixelcraft-logo-512.png +0 -0
- package/bin/pixelcraft.mjs +852 -0
- package/docs/ARCHITECTURE.md +105 -0
- package/docs/DESIGN-RATIONALE.md +191 -0
- package/docs/INSTALL.md +221 -0
- package/evals/README.md +37 -0
- package/evals/fixtures/3d-web-engineering.json +69 -0
- package/evals/fixtures/README.md +36 -0
- package/evals/fixtures/acceptance-checklist-rule03-gate.json +43 -0
- package/evals/fixtures/ai-ui-libraries.json +53 -0
- package/evals/fixtures/audio-visual-accessibility.json +69 -0
- package/evals/fixtures/auth-and-checkout-ui.json +53 -0
- package/evals/fixtures/brandkit-identity-governance.json +48 -0
- package/evals/fixtures/build-and-architecture.json +53 -0
- package/evals/fixtures/canvas-and-node-editors.json +53 -0
- package/evals/fixtures/chat-ai-exfiltration-ime-hitl-gate.json +43 -0
- package/evals/fixtures/completion-gate-scan-until-clean.json +44 -0
- package/evals/fixtures/component-systems.json +53 -0
- package/evals/fixtures/component-testing.json +53 -0
- package/evals/fixtures/constrained-voice-and-tv.json +43 -0
- package/evals/fixtures/creative-code-rendering.json +69 -0
- package/evals/fixtures/creative-reference-evidence.json +67 -0
- package/evals/fixtures/data-app-python-marimo.json +49 -0
- package/evals/fixtures/desktop-cpp-juce-audio.json +49 -0
- package/evals/fixtures/desktop-csharp-avalonia.json +49 -0
- package/evals/fixtures/desktop-native-workspace.json +48 -0
- package/evals/fixtures/desktop-python-anti-tkinter.json +49 -0
- package/evals/fixtures/direction-prototype-complexity.json +29 -0
- package/evals/fixtures/document-prepress-pdfx4-tounicode.json +43 -0
- package/evals/fixtures/document-rust-typst-invoice.json +49 -0
- package/evals/fixtures/document-typst-and-print-css.json +43 -0
- package/evals/fixtures/email-mjml-dark-mode.json +49 -0
- package/evals/fixtures/email-outlook-and-plaintext.json +43 -0
- package/evals/fixtures/enterprise-data-ui.json +53 -0
- package/evals/fixtures/extended-tui-toolkits.json +53 -0
- package/evals/fixtures/extensions-mv3-and-vscode.json +43 -0
- package/evals/fixtures/file-upload-media-ui.json +53 -0
- package/evals/fixtures/finish-gate-anti-slop.json +30 -0
- package/evals/fixtures/forms-accessibility-negative.json +29 -0
- package/evals/fixtures/forms-validation.json +53 -0
- package/evals/fixtures/game-go-ebitengine.json +49 -0
- package/evals/fixtures/game-godot-gdscript.json +49 -0
- package/evals/fixtures/game-ui-hud-and-engines.json +43 -0
- package/evals/fixtures/handoff-fidelity-tolerance.json +29 -0
- package/evals/fixtures/i18n-engineering.json +53 -0
- package/evals/fixtures/local-first-sync.json +53 -0
- package/evals/fixtures/lynxjs.json +53 -0
- package/evals/fixtures/maizzle-email.json +53 -0
- package/evals/fixtures/maps-geospatial.json +53 -0
- package/evals/fixtures/media-og-and-video-export.json +43 -0
- package/evals/fixtures/media-players.json +53 -0
- package/evals/fixtures/mobile-compose-16kb-foldable-store-gate.json +44 -0
- package/evals/fixtures/mobile-elixir-liveview-native.json +49 -0
- package/evals/fixtures/mobile-flutter-dynamic-type.json +49 -0
- package/evals/fixtures/mobile-harmonyos-arkui.json +49 -0
- package/evals/fixtures/mobile-jetpack-compose.json +49 -0
- package/evals/fixtures/mobile-swiftui-ios.json +49 -0
- package/evals/fixtures/motion-engineering.json +69 -0
- package/evals/fixtures/pdfjs-and-pptx.json +53 -0
- package/evals/fixtures/plan-brownfield-evidence.json +28 -0
- package/evals/fixtures/plan-discovery-interview.json +31 -0
- package/evals/fixtures/plan-grill-me-brainstorm-gate.json +49 -0
- package/evals/fixtures/reactive-data-apps.json +53 -0
- package/evals/fixtures/review-evidence-audit.json +43 -0
- package/evals/fixtures/rich-text-and-code-editors.json +53 -0
- package/evals/fixtures/scrollytelling-resilience.json +70 -0
- package/evals/fixtures/spatial-xr-comfort-and-platforms.json +43 -0
- package/evals/fixtures/state-architecture.json +53 -0
- package/evals/fixtures/styling-ecosystem.json +53 -0
- package/evals/fixtures/token-tooling.json +53 -0
- package/evals/fixtures/tui-go-bubbletea.json +49 -0
- package/evals/fixtures/tui-rust-ratatui-grapheme-paste-teardown.json +44 -0
- package/evals/fixtures/tui-rust-ratatui.json +49 -0
- package/evals/fixtures/ux-state-matrix-and-i18n.json +43 -0
- package/evals/fixtures/visual-qa-task-evidence.json +29 -0
- package/evals/fixtures/web-3d-engines.json +53 -0
- package/evals/fixtures/web-php-laravel-filament.json +49 -0
- package/evals/fixtures/web-ruby-viewcomponent-phlex.json +49 -0
- package/evals/fixtures/workflow-checkpoints.json +30 -0
- package/evals/pixelcraft-accessibility.md +74 -0
- package/evals/pixelcraft-brandkit.md +58 -0
- package/evals/pixelcraft-chat-ui.md +55 -0
- package/evals/pixelcraft-constrained.md +55 -0
- package/evals/pixelcraft-craft.md +76 -0
- package/evals/pixelcraft-data-apps.md +55 -0
- package/evals/pixelcraft-dataviz.md +59 -0
- package/evals/pixelcraft-desktop.md +55 -0
- package/evals/pixelcraft-direction.md +77 -0
- package/evals/pixelcraft-document.md +55 -0
- package/evals/pixelcraft-email.md +55 -0
- package/evals/pixelcraft-extensions.md +55 -0
- package/evals/pixelcraft-game-ui.md +59 -0
- package/evals/pixelcraft-handoff.md +57 -0
- package/evals/pixelcraft-media.md +55 -0
- package/evals/pixelcraft-mobile.md +59 -0
- package/evals/pixelcraft-patterns.md +73 -0
- package/evals/pixelcraft-plan.md +127 -0
- package/evals/pixelcraft-review.md +63 -0
- package/evals/pixelcraft-spatial.md +55 -0
- package/evals/pixelcraft-tokens.md +57 -0
- package/evals/pixelcraft-tui.md +55 -0
- package/evals/pixelcraft-ux.md +59 -0
- package/evals/pixelcraft-visual-qa.md +86 -0
- package/evals/pixelcraft-web.md +89 -0
- package/evals/pixelcraft.md +70 -0
- package/gemini-extension.json +6 -0
- package/install.ps1 +341 -0
- package/install.sh +512 -0
- package/package.json +91 -4
- package/plugin.json +29 -0
- package/scripts/build-adapters.mjs +288 -0
- package/scripts/build-release-archives.mjs +61 -0
- package/scripts/build-skill-zips.mjs +94 -0
- package/scripts/run-evals.mjs +397 -0
- package/scripts/sync-docs.mjs +381 -0
- package/scripts/test-build-adapters.mjs +61 -0
- package/scripts/test-cross-platform-qa.mjs +359 -0
- package/scripts/test-distribution.mjs +203 -0
- package/scripts/test-export-tokens.mjs +361 -0
- package/scripts/test-finish-gate.mjs +271 -0
- package/scripts/test-installers.mjs +216 -0
- package/scripts/test-release-archives.mjs +42 -0
- package/scripts/test-shoot.mjs +87 -0
- package/scripts/test-slop-scan.mjs +416 -0
- package/scripts/test-style-inventory.mjs +234 -0
- package/scripts/test-sync-docs.mjs +140 -0
- package/scripts/test-validate-skills.mjs +195 -0
- package/scripts/validate-skills.mjs +658 -0
- package/skills/pixelcraft/SKILL.md +155 -0
- package/skills/pixelcraft/references/design-brief.md +75 -0
- package/skills/pixelcraft/references/floor.md +90 -0
- package/skills/pixelcraft/references/report-template.md +49 -0
- package/skills/pixelcraft/references/stack-detection.md +226 -0
- package/skills/pixelcraft/references/surface-acceptance.md +52 -0
- package/skills/pixelcraft/references/workflow-checkpoints.md +71 -0
- package/skills/pixelcraft-accessibility/SKILL.md +54 -0
- package/skills/pixelcraft-accessibility/references/apg-patterns.md +64 -0
- package/skills/pixelcraft-accessibility/references/motion-canvas.md +57 -0
- package/skills/pixelcraft-accessibility/references/platforms.md +86 -0
- package/skills/pixelcraft-accessibility/references/verification.md +64 -0
- package/skills/pixelcraft-accessibility/references/wcag22-checks.md +99 -0
- package/skills/pixelcraft-brandkit/SKILL.md +127 -0
- package/skills/pixelcraft-brandkit/references/asset-pipeline.md +165 -0
- package/skills/pixelcraft-brandkit/references/brand-governance.md +82 -0
- package/skills/pixelcraft-brandkit/references/layouts.md +88 -0
- package/skills/pixelcraft-brandkit/references/logo-concepting.md +83 -0
- package/skills/pixelcraft-brandkit/references/logo-methods.md +97 -0
- package/skills/pixelcraft-brandkit/references/pixel-art-logos.md +82 -0
- package/skills/pixelcraft-brandkit/references/prompt-template.md +87 -0
- package/skills/pixelcraft-brandkit/references/qa-checklist.md +93 -0
- package/skills/pixelcraft-brandkit/references/visual-modes.md +123 -0
- package/skills/pixelcraft-chat-ui/SKILL.md +57 -0
- package/skills/pixelcraft-chat-ui/references/agentic-workspace.md +66 -0
- package/skills/pixelcraft-chat-ui/references/ai-ui-libraries.md +259 -0
- package/skills/pixelcraft-chat-ui/references/conversation-design.md +84 -0
- package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +77 -0
- package/skills/pixelcraft-chat-ui/references/slack-discord.md +80 -0
- package/skills/pixelcraft-constrained/SKILL.md +52 -0
- package/skills/pixelcraft-constrained/references/specialized-hardware.md +90 -0
- package/skills/pixelcraft-constrained/references/tv-wearables.md +134 -0
- package/skills/pixelcraft-constrained/references/voice-ui.md +104 -0
- package/skills/pixelcraft-craft/SKILL.md +58 -0
- package/skills/pixelcraft-craft/references/color.md +125 -0
- package/skills/pixelcraft-craft/references/imagery-icons.md +37 -0
- package/skills/pixelcraft-craft/references/layout-quality.md +65 -0
- package/skills/pixelcraft-craft/references/layout.md +73 -0
- package/skills/pixelcraft-craft/references/motion.md +163 -0
- package/skills/pixelcraft-craft/references/typography.md +110 -0
- package/skills/pixelcraft-data-apps/SKILL.md +86 -0
- package/skills/pixelcraft-data-apps/references/ai-and-internal-data-apps.md +147 -0
- package/skills/pixelcraft-data-apps/references/dash.md +109 -0
- package/skills/pixelcraft-data-apps/references/evidence.md +90 -0
- package/skills/pixelcraft-data-apps/references/gradio.md +103 -0
- package/skills/pixelcraft-data-apps/references/julia-genie.md +89 -0
- package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +91 -0
- package/skills/pixelcraft-data-apps/references/nicegui.md +102 -0
- package/skills/pixelcraft-data-apps/references/observable-framework.md +105 -0
- package/skills/pixelcraft-data-apps/references/panel.md +99 -0
- package/skills/pixelcraft-data-apps/references/r-shiny.md +124 -0
- package/skills/pixelcraft-data-apps/references/reactive-data-apps.md +186 -0
- package/skills/pixelcraft-data-apps/references/reflex.md +116 -0
- package/skills/pixelcraft-data-apps/references/shiny.md +110 -0
- package/skills/pixelcraft-data-apps/references/streamlit.md +113 -0
- package/skills/pixelcraft-dataviz/SKILL.md +60 -0
- package/skills/pixelcraft-dataviz/references/chart-choice.md +55 -0
- package/skills/pixelcraft-dataviz/references/color-accessibility.md +112 -0
- package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +107 -0
- package/skills/pixelcraft-dataviz/references/libraries.md +176 -0
- package/skills/pixelcraft-dataviz/references/maps-geospatial.md +159 -0
- package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +92 -0
- package/skills/pixelcraft-desktop/SKILL.md +93 -0
- package/skills/pixelcraft-desktop/references/appkit.md +92 -0
- package/skills/pixelcraft-desktop/references/avalonia.md +95 -0
- package/skills/pixelcraft-desktop/references/cpp-gui.md +129 -0
- package/skills/pixelcraft-desktop/references/electron.md +96 -0
- package/skills/pixelcraft-desktop/references/go-gui.md +83 -0
- package/skills/pixelcraft-desktop/references/gtk.md +97 -0
- package/skills/pixelcraft-desktop/references/javafx-swing.md +81 -0
- package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +88 -0
- package/skills/pixelcraft-desktop/references/rust-gui.md +83 -0
- package/skills/pixelcraft-desktop/references/tauri.md +110 -0
- package/skills/pixelcraft-desktop/references/uno-platform.md +71 -0
- package/skills/pixelcraft-desktop/references/winui-wpf.md +98 -0
- package/skills/pixelcraft-desktop/references/working-context.md +84 -0
- package/skills/pixelcraft-direction/SKILL.md +120 -0
- package/skills/pixelcraft-direction/references/composition-library.md +84 -0
- package/skills/pixelcraft-direction/references/creative-brainstorming.md +72 -0
- package/skills/pixelcraft-direction/references/direction-card.md +64 -0
- package/skills/pixelcraft-direction/references/direction-scoring.md +76 -0
- package/skills/pixelcraft-direction/references/motion-identity.md +67 -0
- package/skills/pixelcraft-direction/references/movements.md +71 -0
- package/skills/pixelcraft-direction/references/reference-analysis.md +37 -0
- package/skills/pixelcraft-direction/references/repetition-history.md +75 -0
- package/skills/pixelcraft-direction/references/slop-fingerprints.md +83 -0
- package/skills/pixelcraft-direction/references/wildcards.md +47 -0
- package/skills/pixelcraft-document/SKILL.md +58 -0
- package/skills/pixelcraft-document/references/archetypes.md +106 -0
- package/skills/pixelcraft-document/references/pdf-tools.md +314 -0
- package/skills/pixelcraft-document/references/pdfjs-and-pptx.md +114 -0
- package/skills/pixelcraft-document/references/print-css.md +187 -0
- package/skills/pixelcraft-document/references/slides.md +198 -0
- package/skills/pixelcraft-email/SKILL.md +80 -0
- package/skills/pixelcraft-email/references/client-quirks.md +113 -0
- package/skills/pixelcraft-email/references/html-tables.md +114 -0
- package/skills/pixelcraft-email/references/maizzle.md +54 -0
- package/skills/pixelcraft-email/references/mjml.md +54 -0
- package/skills/pixelcraft-email/references/react-email.md +95 -0
- package/skills/pixelcraft-extensions/SKILL.md +56 -0
- package/skills/pixelcraft-extensions/references/browser-extensions.md +105 -0
- package/skills/pixelcraft-extensions/references/figma-office.md +106 -0
- package/skills/pixelcraft-extensions/references/ide-and-saas-plugins.md +125 -0
- package/skills/pixelcraft-extensions/references/raycast.md +98 -0
- package/skills/pixelcraft-extensions/references/vscode-webviews.md +100 -0
- package/skills/pixelcraft-game-ui/SKILL.md +80 -0
- package/skills/pixelcraft-game-ui/references/bevy.md +90 -0
- package/skills/pixelcraft-game-ui/references/godot.md +130 -0
- package/skills/pixelcraft-game-ui/references/hud-principles.md +67 -0
- package/skills/pixelcraft-game-ui/references/love2d.md +77 -0
- package/skills/pixelcraft-game-ui/references/monogame.md +68 -0
- package/skills/pixelcraft-game-ui/references/unity-ugui.md +109 -0
- package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +107 -0
- package/skills/pixelcraft-game-ui/references/unreal-umg.md +80 -0
- package/skills/pixelcraft-game-ui/references/web-and-middleware-game-ui.md +122 -0
- package/skills/pixelcraft-handoff/SKILL.md +50 -0
- package/skills/pixelcraft-handoff/references/design-translation.md +134 -0
- package/skills/pixelcraft-handoff/references/fidelity-tolerance.md +78 -0
- package/skills/pixelcraft-handoff/references/motion-handoff.md +54 -0
- package/skills/pixelcraft-media/SKILL.md +49 -0
- package/skills/pixelcraft-media/references/banners-video.md +130 -0
- package/skills/pixelcraft-media/references/og-generation.md +154 -0
- package/skills/pixelcraft-media/references/social-cards.md +71 -0
- package/skills/pixelcraft-mobile/SKILL.md +86 -0
- package/skills/pixelcraft-mobile/references/dotnet-maui.md +91 -0
- package/skills/pixelcraft-mobile/references/flet.md +80 -0
- package/skills/pixelcraft-mobile/references/flutter.md +113 -0
- package/skills/pixelcraft-mobile/references/harmonyos-and-emerging-mobile.md +121 -0
- package/skills/pixelcraft-mobile/references/ionic-capacitor.md +87 -0
- package/skills/pixelcraft-mobile/references/jetpack-compose.md +129 -0
- package/skills/pixelcraft-mobile/references/kivy.md +82 -0
- package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +86 -0
- package/skills/pixelcraft-mobile/references/lynxjs.md +110 -0
- package/skills/pixelcraft-mobile/references/nativescript-and-skip.md +91 -0
- package/skills/pixelcraft-mobile/references/react-native-expo.md +106 -0
- package/skills/pixelcraft-mobile/references/swiftui.md +200 -0
- package/skills/pixelcraft-mobile/references/tactile-interactions.md +55 -0
- package/skills/pixelcraft-mobile/references/task-state-composition.md +85 -0
- package/skills/pixelcraft-mobile/references/uikit.md +92 -0
- package/skills/pixelcraft-patterns/SKILL.md +75 -0
- package/skills/pixelcraft-patterns/references/accessibility-resilience.md +29 -0
- package/skills/pixelcraft-patterns/references/ai-and-offline-patterns.md +54 -0
- package/skills/pixelcraft-patterns/references/auth-onboarding.md +44 -0
- package/skills/pixelcraft-patterns/references/billing-paywalls.md +40 -0
- package/skills/pixelcraft-patterns/references/command-workspace.md +56 -0
- package/skills/pixelcraft-patterns/references/commerce.md +47 -0
- package/skills/pixelcraft-patterns/references/communication.md +45 -0
- package/skills/pixelcraft-patterns/references/creative-tools.md +42 -0
- package/skills/pixelcraft-patterns/references/creative-web-composition.md +38 -0
- package/skills/pixelcraft-patterns/references/dashboard-admin.md +35 -0
- package/skills/pixelcraft-patterns/references/history-diff-undo.md +50 -0
- package/skills/pixelcraft-patterns/references/marketing.md +44 -0
- package/skills/pixelcraft-patterns/references/multi-tenant-rbac.md +47 -0
- package/skills/pixelcraft-patterns/references/narrative-systems.md +42 -0
- package/skills/pixelcraft-patterns/references/notifications-activity.md +57 -0
- package/skills/pixelcraft-patterns/references/pattern-selection.md +80 -0
- package/skills/pixelcraft-patterns/references/scheduling-kanban.md +47 -0
- package/skills/pixelcraft-patterns/references/scroll-implementation.md +37 -0
- package/skills/pixelcraft-patterns/references/search-filtering.md +42 -0
- package/skills/pixelcraft-patterns/references/settings.md +51 -0
- package/skills/pixelcraft-patterns/references/tables-crud.md +43 -0
- package/skills/pixelcraft-plan/SKILL.md +103 -0
- package/skills/pixelcraft-plan/references/design-input.md +69 -0
- package/skills/pixelcraft-plan/references/discovery-interview.md +110 -0
- package/skills/pixelcraft-plan/references/grill-me-protocol.md +63 -0
- package/skills/pixelcraft-plan/references/plan-template.md +134 -0
- package/skills/pixelcraft-plan/references/repo-discovery.md +49 -0
- package/skills/pixelcraft-plan/references/stack-freshness.md +67 -0
- package/skills/pixelcraft-plan/references/stack-selection.md +98 -0
- package/skills/pixelcraft-review/SKILL.md +86 -0
- package/skills/pixelcraft-review/references/audit-report.md +69 -0
- package/skills/pixelcraft-review/references/critique-protocol.md +89 -0
- package/skills/pixelcraft-review/references/heuristics.md +63 -0
- package/skills/pixelcraft-review/references/personas.md +53 -0
- package/skills/pixelcraft-review/references/polish.md +78 -0
- package/skills/pixelcraft-review/scripts/check-acceptance.mjs +619 -0
- package/skills/pixelcraft-review/scripts/fixtures/brand-critique-waivers.json +14 -0
- package/skills/pixelcraft-review/scripts/fixtures/brand-critique.css +18 -0
- package/skills/pixelcraft-review/scripts/fixtures/clean.html +43 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-after-block.css +4 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-at-rules.css +17 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-comments.css +10 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-html-quote-leak.html +12 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-invalid-replacements.css +27 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-longhand-removal.css +34 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-nested-rules.css +19 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-not-visible-skip.css +8 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-outline-shorthands.css +11 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-and-border.css +15 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-last-wins.css +19 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-valid-replacements-extended.css +29 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-visible-no-replacement.css +3 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-visible-valid-replacements.css +9 -0
- package/skills/pixelcraft-review/scripts/fixtures/slop.html +28 -0
- package/skills/pixelcraft-review/scripts/slop-scan.mjs +1233 -0
- package/skills/pixelcraft-spatial/SKILL.md +51 -0
- package/skills/pixelcraft-spatial/references/comfort-accessibility.md +39 -0
- package/skills/pixelcraft-spatial/references/platforms.md +147 -0
- package/skills/pixelcraft-tokens/SKILL.md +60 -0
- package/skills/pixelcraft-tokens/assets/tokens.example.json +71 -0
- package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +47 -0
- package/skills/pixelcraft-tokens/references/adoption.md +55 -0
- package/skills/pixelcraft-tokens/references/format.md +84 -0
- package/skills/pixelcraft-tokens/references/governance.md +80 -0
- package/skills/pixelcraft-tokens/references/state-tokens.md +62 -0
- package/skills/pixelcraft-tokens/references/theme-presets.md +122 -0
- package/skills/pixelcraft-tokens/references/token-tooling.md +119 -0
- package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +847 -0
- package/skills/pixelcraft-tui/SKILL.md +76 -0
- package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +79 -0
- package/skills/pixelcraft-tui/references/extended-tui-toolkits.md +127 -0
- package/skills/pixelcraft-tui/references/ink.md +109 -0
- package/skills/pixelcraft-tui/references/ratatui.md +102 -0
- package/skills/pixelcraft-tui/references/rich.md +82 -0
- package/skills/pixelcraft-tui/references/terminal-protocols.md +80 -0
- package/skills/pixelcraft-tui/references/textual.md +108 -0
- package/skills/pixelcraft-ux/SKILL.md +56 -0
- package/skills/pixelcraft-ux/references/cognitive-walkthrough.md +70 -0
- package/skills/pixelcraft-ux/references/feedback-performance.md +50 -0
- package/skills/pixelcraft-ux/references/flows-ia.md +44 -0
- package/skills/pixelcraft-ux/references/forms.md +151 -0
- package/skills/pixelcraft-ux/references/i18n.md +221 -0
- package/skills/pixelcraft-ux/references/laws.md +39 -0
- package/skills/pixelcraft-ux/references/locale-test-matrix.md +60 -0
- package/skills/pixelcraft-ux/references/state-matrix.md +53 -0
- package/skills/pixelcraft-ux/references/usability-testing.md +84 -0
- package/skills/pixelcraft-ux/references/ux-writing.md +44 -0
- package/skills/pixelcraft-visual-qa/SKILL.md +96 -0
- package/skills/pixelcraft-visual-qa/references/baseline-governance.md +70 -0
- package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +59 -0
- package/skills/pixelcraft-visual-qa/references/capture-document.md +70 -0
- package/skills/pixelcraft-visual-qa/references/capture-email.md +38 -0
- package/skills/pixelcraft-visual-qa/references/capture-mobile.md +50 -0
- package/skills/pixelcraft-visual-qa/references/capture-terminal.md +35 -0
- package/skills/pixelcraft-visual-qa/references/critique-rubric.md +71 -0
- package/skills/pixelcraft-visual-qa/references/finish-gate.md +35 -0
- package/skills/pixelcraft-visual-qa/references/measured-craft.md +30 -0
- package/skills/pixelcraft-visual-qa/references/motion-capture.md +63 -0
- package/skills/pixelcraft-visual-qa/references/performance-budgets.md +78 -0
- package/skills/pixelcraft-visual-qa/references/realtime-graphics.md +55 -0
- package/skills/pixelcraft-visual-qa/references/task-verification.md +81 -0
- package/skills/pixelcraft-visual-qa/scripts/check-contrast.mjs +442 -0
- package/skills/pixelcraft-visual-qa/scripts/check-email.mjs +397 -0
- package/skills/pixelcraft-visual-qa/scripts/check-pdf.mjs +189 -0
- package/skills/pixelcraft-visual-qa/scripts/check-tui.mjs +321 -0
- package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +174 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-aria-modal.html +19 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-audit.html +34 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-modal.html +17 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-deferred.js +1 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-edge.html +52 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.html +80 -0
- package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.js +8 -0
- package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +668 -0
- package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +1226 -0
- package/skills/pixelcraft-web/SKILL.md +132 -0
- package/skills/pixelcraft-web/references/accessibility-performance.md +42 -0
- package/skills/pixelcraft-web/references/adaptive-layout.md +69 -0
- package/skills/pixelcraft-web/references/angular.md +108 -0
- package/skills/pixelcraft-web/references/assets-pipeline.md +67 -0
- package/skills/pixelcraft-web/references/astro.md +113 -0
- package/skills/pixelcraft-web/references/audio-reactive.md +61 -0
- package/skills/pixelcraft-web/references/auth-and-checkout-ui.md +115 -0
- package/skills/pixelcraft-web/references/build-and-architecture.md +215 -0
- package/skills/pixelcraft-web/references/canvas-and-node-editors.md +157 -0
- package/skills/pixelcraft-web/references/clojurescript.md +88 -0
- package/skills/pixelcraft-web/references/component-systems.md +102 -0
- package/skills/pixelcraft-web/references/component-testing.md +170 -0
- package/skills/pixelcraft-web/references/creative-effects.md +59 -0
- package/skills/pixelcraft-web/references/creative-runtime.md +34 -0
- package/skills/pixelcraft-web/references/elm.md +53 -0
- package/skills/pixelcraft-web/references/enterprise-data-ui.md +138 -0
- package/skills/pixelcraft-web/references/file-upload-media-ui.md +82 -0
- package/skills/pixelcraft-web/references/forms-validation.md +123 -0
- package/skills/pixelcraft-web/references/fsharp-fable.md +54 -0
- package/skills/pixelcraft-web/references/gsap.md +102 -0
- package/skills/pixelcraft-web/references/html-css.md +220 -0
- package/skills/pixelcraft-web/references/htmx-alpine.md +103 -0
- package/skills/pixelcraft-web/references/i18n-engineering.md +106 -0
- package/skills/pixelcraft-web/references/interaction-and-search-primitives.md +196 -0
- package/skills/pixelcraft-web/references/java-web.md +61 -0
- package/skills/pixelcraft-web/references/kotlin-web.md +57 -0
- package/skills/pixelcraft-web/references/leptos-yew.md +97 -0
- package/skills/pixelcraft-web/references/lit-web-components.md +63 -0
- package/skills/pixelcraft-web/references/local-first-sync.md +105 -0
- package/skills/pixelcraft-web/references/media-players.md +104 -0
- package/skills/pixelcraft-web/references/motion-react.md +96 -0
- package/skills/pixelcraft-web/references/motion-recipes.md +82 -0
- package/skills/pixelcraft-web/references/preact-fresh-hono.md +111 -0
- package/skills/pixelcraft-web/references/pwa.md +230 -0
- package/skills/pixelcraft-web/references/qwik.md +94 -0
- package/skills/pixelcraft-web/references/r3f-integration.md +69 -0
- package/skills/pixelcraft-web/references/react-next.md +168 -0
- package/skills/pixelcraft-web/references/rendering-choice.md +63 -0
- package/skills/pixelcraft-web/references/rendering-performance.md +80 -0
- package/skills/pixelcraft-web/references/rich-text-and-code-editors.md +220 -0
- package/skills/pixelcraft-web/references/rive-lottie.md +73 -0
- package/skills/pixelcraft-web/references/scala-laminar.md +53 -0
- package/skills/pixelcraft-web/references/scene-architecture.md +132 -0
- package/skills/pixelcraft-web/references/server-rendered.md +114 -0
- package/skills/pixelcraft-web/references/shader-workflow.md +77 -0
- package/skills/pixelcraft-web/references/smooth-scroll.md +58 -0
- package/skills/pixelcraft-web/references/solid.md +111 -0
- package/skills/pixelcraft-web/references/state-architecture.md +107 -0
- package/skills/pixelcraft-web/references/styling-ecosystem.md +273 -0
- package/skills/pixelcraft-web/references/svelte.md +111 -0
- package/skills/pixelcraft-web/references/tailwind.md +99 -0
- package/skills/pixelcraft-web/references/video-media.md +69 -0
- package/skills/pixelcraft-web/references/vue-nuxt.md +86 -0
- package/skills/pixelcraft-web/references/web-3d-engines.md +97 -0
|
@@ -0,0 +1,658 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { spawnSync } from 'node:child_process';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
|
|
7
|
+
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
8
|
+
const skillsRoot = path.join(root, 'skills');
|
|
9
|
+
const evalsRoot = path.join(root, 'evals');
|
|
10
|
+
const rootScriptsDir = path.join(root, 'scripts');
|
|
11
|
+
const errors = [];
|
|
12
|
+
const namePattern = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
13
|
+
const yamlPlainStartPattern = /^[-?:,\[\]{}#&*!|>'"%@`]/;
|
|
14
|
+
const allowedFrontmatterKeys = new Set(['name', 'description', 'license', 'metadata']);
|
|
15
|
+
|
|
16
|
+
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
|
17
|
+
console.log('Usage: node scripts/validate-skills.mjs\n\nValidates all skills/*/SKILL.md frontmatter, body limits, local/reference links, orphan references, eval guides/fixtures, and script --help contracts.');
|
|
18
|
+
process.exit(0);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function fail(file, message) {
|
|
22
|
+
errors.push(`${path.relative(root, file)}: ${message}`);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function quoteCanOpen(text, index) {
|
|
26
|
+
if (index === 0) return true;
|
|
27
|
+
let previous = index - 1;
|
|
28
|
+
while (previous >= 0 && /\s/.test(text[previous])) previous--;
|
|
29
|
+
return previous < 0 || '{[,:'.includes(text[previous]);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function stripYamlComment(raw) {
|
|
33
|
+
let quote = null;
|
|
34
|
+
for (let i = 0; i < raw.length; i++) {
|
|
35
|
+
const char = raw[i];
|
|
36
|
+
if (quote === '"') {
|
|
37
|
+
if (char === '\\') i++;
|
|
38
|
+
else if (char === '"') quote = null;
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (quote === "'") {
|
|
42
|
+
if (char === "'" && raw[i + 1] === "'") i++;
|
|
43
|
+
else if (char === "'") quote = null;
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if ((char === '"' || char === "'") && quoteCanOpen(raw, i)) {
|
|
47
|
+
quote = char;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (char === '#' && (i === 0 || /\s/.test(raw[i - 1]))) return raw.slice(0, i).trimEnd();
|
|
51
|
+
}
|
|
52
|
+
return raw.trimEnd();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function indentationWidth(line) {
|
|
56
|
+
return /^ */.exec(line)[0].length;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function parseBlockHeader(value) {
|
|
60
|
+
const match = /^([|>])((?:[+-]?[1-9]?|[1-9]?[+-]?))$/.exec(value);
|
|
61
|
+
if (!match) return /^[|>]/.test(value) ? { invalid: true } : null;
|
|
62
|
+
const suffix = match[2];
|
|
63
|
+
const explicitIndent = /[1-9]/.exec(suffix);
|
|
64
|
+
return {
|
|
65
|
+
style: match[1],
|
|
66
|
+
chomp: suffix.includes('-') ? '-' : suffix.includes('+') ? '+' : '',
|
|
67
|
+
indent: explicitIndent ? Number(explicitIndent[0]) : 0
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function foldBlockLines(lines) {
|
|
72
|
+
let output = '';
|
|
73
|
+
for (let i = 0; i < lines.length; i++) {
|
|
74
|
+
const line = lines[i];
|
|
75
|
+
output += line;
|
|
76
|
+
if (i === lines.length - 1) break;
|
|
77
|
+
const next = lines[i + 1];
|
|
78
|
+
const foldable = line && next && !/^\s/.test(line) && !/^\s/.test(next);
|
|
79
|
+
if (foldable) output += ' ';
|
|
80
|
+
else if (!(line === '' && next !== '' && i > 0)) output += '\n';
|
|
81
|
+
}
|
|
82
|
+
return output;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function applyChomp(body, lineCount, chomp) {
|
|
86
|
+
if (!lineCount) return '';
|
|
87
|
+
if (chomp === '-') return body.replace(/\n+$/g, '');
|
|
88
|
+
if (chomp === '+') return `${body}\n`;
|
|
89
|
+
return `${body.replace(/\n+$/g, '')}\n`;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function readBlockScalar(lines, start, end, header) {
|
|
93
|
+
let indent = header.indent;
|
|
94
|
+
if (!indent) {
|
|
95
|
+
for (let probe = start + 1; probe < end; probe++) {
|
|
96
|
+
if (!lines[probe].trim()) continue;
|
|
97
|
+
indent = indentationWidth(lines[probe]) || 1;
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
if (!indent) indent = 1;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const content = [];
|
|
104
|
+
let index = start + 1;
|
|
105
|
+
for (; index < end; index++) {
|
|
106
|
+
const line = lines[index];
|
|
107
|
+
if (!line.trim()) {
|
|
108
|
+
content.push('');
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (indentationWidth(line) < indent) break;
|
|
112
|
+
content.push(line.slice(indent));
|
|
113
|
+
}
|
|
114
|
+
const body = header.style === '|' ? content.join('\n') : foldBlockLines(content);
|
|
115
|
+
return { value: applyChomp(body, content.length, header.chomp), nextIndex: index };
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function validatePlainScalar(value, label) {
|
|
119
|
+
if (value.includes(': ')) return `unquoted scalar for ${label} contains ': '; quote it for strict YAML loaders`;
|
|
120
|
+
if (yamlPlainStartPattern.test(value)) return `unquoted scalar for ${label} starts with YAML-special character '${value[0]}'; quote it for strict YAML loaders`;
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function findQuoteEnd(text, start, quote) {
|
|
125
|
+
for (let i = start + 1; i < text.length; i++) {
|
|
126
|
+
const char = text[i];
|
|
127
|
+
if (quote === '"' && char === '\\') {
|
|
128
|
+
i++;
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (quote === "'" && char === "'" && text[i + 1] === "'") {
|
|
132
|
+
i++;
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
if (char === quote) return i;
|
|
136
|
+
}
|
|
137
|
+
return -1;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function validateQuotedScalar(value, label) {
|
|
141
|
+
const end = findQuoteEnd(value, 0, value[0]);
|
|
142
|
+
if (end === -1) return { error: `unterminated quoted scalar for ${label}` };
|
|
143
|
+
if (value.slice(end + 1).trim()) return { error: `unexpected content after quoted scalar for ${label}` };
|
|
144
|
+
return { kind: 'scalar', value: value.slice(1, end) };
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function splitFlowEntries(inner, label) {
|
|
148
|
+
const parts = [];
|
|
149
|
+
let start = 0;
|
|
150
|
+
let quote = null;
|
|
151
|
+
for (let i = 0; i < inner.length; i++) {
|
|
152
|
+
const char = inner[i];
|
|
153
|
+
if (quote === '"') {
|
|
154
|
+
if (char === '\\') i++;
|
|
155
|
+
else if (char === '"') quote = null;
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
if (quote === "'") {
|
|
159
|
+
if (char === "'" && inner[i + 1] === "'") i++;
|
|
160
|
+
else if (char === "'") quote = null;
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
if ((char === '"' || char === "'") && quoteCanOpen(inner, i)) {
|
|
164
|
+
quote = char;
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
if ('{}[]'.includes(char)) return { error: `nested flow collections in ${label} are outside the supported frontmatter subset` };
|
|
168
|
+
if (char === ',') {
|
|
169
|
+
parts.push(inner.slice(start, i));
|
|
170
|
+
start = i + 1;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (quote) return { error: `unterminated quoted scalar in flow mapping for ${label}` };
|
|
174
|
+
parts.push(inner.slice(start));
|
|
175
|
+
return { parts };
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function splitFlowPair(part) {
|
|
179
|
+
const index = part.indexOf(':');
|
|
180
|
+
if (index === -1) return null;
|
|
181
|
+
return { keyText: part.slice(0, index), valueText: part.slice(index + 1) };
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function parseFlowScalar(text, label) {
|
|
185
|
+
const trimmed = text.trim();
|
|
186
|
+
if (!trimmed) return { error: `missing scalar value in flow mapping for ${label}` };
|
|
187
|
+
if (trimmed.startsWith('"') || trimmed.startsWith("'")) return validateQuotedScalar(trimmed, label);
|
|
188
|
+
if (trimmed.startsWith('{') || trimmed.startsWith('[')) return { error: `nested flow collections in ${label} are outside the supported frontmatter subset` };
|
|
189
|
+
const problem = validatePlainScalar(trimmed, label);
|
|
190
|
+
if (problem) return { error: problem };
|
|
191
|
+
return { kind: 'scalar', value: trimmed };
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function parseFlowMapping(value, key) {
|
|
195
|
+
if (!value.endsWith('}')) return { error: `unterminated inline flow mapping for ${key}` };
|
|
196
|
+
const inner = value.slice(1, -1);
|
|
197
|
+
if (!inner.trim()) return { kind: 'mapping', value };
|
|
198
|
+
const split = splitFlowEntries(inner, key);
|
|
199
|
+
if (split.error) return { error: split.error };
|
|
200
|
+
const keys = new Set();
|
|
201
|
+
for (const part of split.parts) {
|
|
202
|
+
if (!part.trim()) return { error: `empty entry in flow mapping for ${key}` };
|
|
203
|
+
const pair = splitFlowPair(part);
|
|
204
|
+
if (!pair || (pair.valueText && !/^[ \t]/.test(pair.valueText))) return { error: `flow mapping entry for ${key} is not a simple key: value pair` };
|
|
205
|
+
const entryKey = pair.keyText.trim();
|
|
206
|
+
if (!/^[A-Za-z0-9_-]+$/.test(entryKey)) return { error: `flow mapping key '${entryKey}' in ${key} is outside the supported frontmatter subset` };
|
|
207
|
+
if (keys.has(entryKey)) return { error: `duplicate key '${entryKey}' in flow mapping for ${key}` };
|
|
208
|
+
keys.add(entryKey);
|
|
209
|
+
const scalar = parseFlowScalar(pair.valueText, `${key}.${entryKey}`);
|
|
210
|
+
if (scalar.error) return { error: scalar.error };
|
|
211
|
+
}
|
|
212
|
+
return { kind: 'mapping', value };
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function parseInlineValue(value, key) {
|
|
216
|
+
if (value.startsWith('"') || value.startsWith("'")) return validateQuotedScalar(value, key);
|
|
217
|
+
if (value.startsWith('{')) return parseFlowMapping(value, key);
|
|
218
|
+
if (value.startsWith('[')) return { kind: 'sequence', value };
|
|
219
|
+
const problem = validatePlainScalar(value, key);
|
|
220
|
+
if (problem) return { error: problem };
|
|
221
|
+
return { kind: 'scalar', value };
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function parseNestedScalar(value, label) {
|
|
225
|
+
if (value.startsWith('{') || value.startsWith('[')) return { error: `collection value for ${label} is outside the supported frontmatter subset` };
|
|
226
|
+
if (value.startsWith('"') || value.startsWith("'")) return validateQuotedScalar(value, label);
|
|
227
|
+
const problem = validatePlainScalar(value, label);
|
|
228
|
+
if (problem) return { error: problem };
|
|
229
|
+
return { kind: 'scalar', value };
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function readBlockMapping(lines, start, end, parentKey) {
|
|
233
|
+
let expectedIndent = 0;
|
|
234
|
+
let entries = 0;
|
|
235
|
+
const seen = new Set();
|
|
236
|
+
let index = start + 1;
|
|
237
|
+
for (; index < end; index++) {
|
|
238
|
+
const line = lines[index];
|
|
239
|
+
if (!line.trim() || line.trimStart().startsWith('#')) continue;
|
|
240
|
+
if (line.includes('\t')) return { error: 'frontmatter contains a tab character' };
|
|
241
|
+
const indent = indentationWidth(line);
|
|
242
|
+
if (indent === 0) break;
|
|
243
|
+
if (!expectedIndent) expectedIndent = indent;
|
|
244
|
+
if (indent !== expectedIndent) return { error: `content deeper than one level or inconsistently indented in block mapping for ${parentKey} is outside the supported frontmatter subset` };
|
|
245
|
+
|
|
246
|
+
const childLine = line.slice(indent);
|
|
247
|
+
if (/^-($|\s)/.test(childLine)) return { error: 'block sequences are outside the supported frontmatter subset' };
|
|
248
|
+
const match = /^([A-Za-z0-9_-]+):(?:[ \t]*(.*))?$/.exec(childLine);
|
|
249
|
+
if (!match) return { error: `unparseable nested mapping line: ${childLine}` };
|
|
250
|
+
const [, childKey, raw = ''] = match;
|
|
251
|
+
if (seen.has(childKey)) return { error: `duplicate nested key in block mapping for ${parentKey}: ${childKey}` };
|
|
252
|
+
seen.add(childKey);
|
|
253
|
+
const value = stripYamlComment(raw).trim();
|
|
254
|
+
if (!value) return { error: `nested value for ${parentKey}.${childKey} must be a single-line scalar` };
|
|
255
|
+
const parsed = parseNestedScalar(value, `${parentKey}.${childKey}`);
|
|
256
|
+
if (parsed.error) return { error: parsed.error };
|
|
257
|
+
entries++;
|
|
258
|
+
}
|
|
259
|
+
if (!entries) return { error: `block mapping for ${parentKey} has no entries` };
|
|
260
|
+
return { nextIndex: index };
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
function scalarKindError(key) {
|
|
264
|
+
return `${key} must be a scalar string (plain, quoted, or block scalar)`;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function isBlankOrComment(line) {
|
|
268
|
+
return !line.trim() || line.trimStart().startsWith('#');
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function parseFrontmatter(file, text) {
|
|
272
|
+
const lines = text.split(/\r?\n/);
|
|
273
|
+
if (lines[0] !== '---') return { error: 'missing opening frontmatter delimiter' };
|
|
274
|
+
const end = lines.findIndex((line, index) => index > 0 && line === '---');
|
|
275
|
+
if (end === -1) return { error: 'missing closing frontmatter delimiter' };
|
|
276
|
+
|
|
277
|
+
const data = {};
|
|
278
|
+
const seen = new Set();
|
|
279
|
+
for (let index = 1; index < end; index++) {
|
|
280
|
+
const line = lines[index];
|
|
281
|
+
if (!line.trim() || line.trimStart().startsWith('#')) continue;
|
|
282
|
+
if (line.includes('\t')) return { error: 'frontmatter contains a tab character' };
|
|
283
|
+
if (indentationWidth(line) > 0) return { error: `indented frontmatter line has no owning block or mapping: ${line.trim()}` };
|
|
284
|
+
const match = /^([A-Za-z0-9_-]+):(?:[ \t]*(.*))?$/.exec(line);
|
|
285
|
+
if (!match) return { error: `unparseable frontmatter line: ${line}` };
|
|
286
|
+
const [, key, raw = ''] = match;
|
|
287
|
+
if (!allowedFrontmatterKeys.has(key)) return { error: `unsupported non-portable frontmatter key: ${key}` };
|
|
288
|
+
if (seen.has(key)) return { error: `duplicate frontmatter key: ${key}` };
|
|
289
|
+
seen.add(key);
|
|
290
|
+
const requiresScalar = key === 'name' || key === 'description';
|
|
291
|
+
const value = stripYamlComment(raw).trim();
|
|
292
|
+
const block = parseBlockHeader(value);
|
|
293
|
+
if (block?.invalid) return { error: `invalid block scalar header for ${key}` };
|
|
294
|
+
if (block) {
|
|
295
|
+
const scalar = readBlockScalar(lines, index, end, block);
|
|
296
|
+
data[key] = scalar.value;
|
|
297
|
+
index = scalar.nextIndex - 1;
|
|
298
|
+
continue;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (!value) {
|
|
302
|
+
let probe = index + 1;
|
|
303
|
+
while (probe < end && isBlankOrComment(lines[probe])) probe++;
|
|
304
|
+
if (probe < end && indentationWidth(lines[probe]) > 0) {
|
|
305
|
+
if (/^-($|\s)/.test(lines[probe].trimStart())) {
|
|
306
|
+
if (requiresScalar) return { error: scalarKindError(key) };
|
|
307
|
+
return { error: 'block sequences are outside the supported frontmatter subset' };
|
|
308
|
+
}
|
|
309
|
+
if (requiresScalar) return { error: scalarKindError(key) };
|
|
310
|
+
if (key !== 'metadata') return { error: `block mappings are only supported for metadata; ${key} must use a scalar value` };
|
|
311
|
+
const mapping = readBlockMapping(lines, index, end, key);
|
|
312
|
+
if (mapping.error) return { error: mapping.error };
|
|
313
|
+
data[key] = '';
|
|
314
|
+
index = mapping.nextIndex - 1;
|
|
315
|
+
} else {
|
|
316
|
+
if (requiresScalar) return { error: scalarKindError(key) };
|
|
317
|
+
data[key] = '';
|
|
318
|
+
}
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
const parsed = parseInlineValue(value, key);
|
|
323
|
+
if (parsed.error) return { error: parsed.error };
|
|
324
|
+
if (requiresScalar && parsed.kind !== 'scalar') return { error: scalarKindError(key) };
|
|
325
|
+
if (parsed.kind === 'sequence') return { error: 'flow sequences are outside the supported frontmatter subset' };
|
|
326
|
+
if (parsed.kind === 'mapping' && key !== 'metadata') return { error: `flow mappings are only supported for metadata; ${key} must use a scalar value` };
|
|
327
|
+
data[key] = parsed.value;
|
|
328
|
+
}
|
|
329
|
+
return { data, bodyLines: lines.slice(end + 1) };
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
function stripCode(text) {
|
|
333
|
+
return text.replace(/^```[\s\S]*?^```/gm, '').replace(/`[^`\n]*`/g, '');
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
function checkLinks(file, baseDir, skillName, text) {
|
|
337
|
+
const visible = stripCode(text);
|
|
338
|
+
const linkPattern = /\[[^\]\n]+\]\(([^)\s]+)(?:\s+["'][^"']*["'])?\)/g;
|
|
339
|
+
for (const match of visible.matchAll(linkPattern)) {
|
|
340
|
+
let target = match[1].trim();
|
|
341
|
+
if (!target || target.startsWith('#') || /^[a-z][a-z0-9+.-]*:/i.test(target)) continue;
|
|
342
|
+
target = decodeURIComponent(target.split('#')[0].split('?')[0]);
|
|
343
|
+
if (!target) continue;
|
|
344
|
+
const resolved = path.resolve(baseDir, target);
|
|
345
|
+
const relToSkills = path.relative(skillsRoot, resolved);
|
|
346
|
+
if (!relToSkills.startsWith('..') && !path.isAbsolute(relToSkills)) {
|
|
347
|
+
const owner = relToSkills.split(path.sep)[0];
|
|
348
|
+
if (owner !== skillName) fail(file, `cross-skill relative link to ${target}`);
|
|
349
|
+
}
|
|
350
|
+
if (!fs.existsSync(resolved)) fail(file, `broken relative link: ${match[1]}`);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
function checkSuppressedShellCommands(file, text) {
|
|
355
|
+
const fencePattern = /^```([a-zA-Z0-9_-]*)\r?\n([\s\S]*?)^```/gm;
|
|
356
|
+
for (const match of text.matchAll(fencePattern)) {
|
|
357
|
+
const lang = (match[1] || '').toLowerCase();
|
|
358
|
+
if (lang && !['sh', 'bash', 'shell', 'zsh'].includes(lang)) continue;
|
|
359
|
+
if (/\|\|\s*true\b/.test(match[2])) {
|
|
360
|
+
fail(file, 'shell snippet suppresses command failures with `|| true`');
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function checkScriptHelp(file) {
|
|
366
|
+
const result = spawnSync(process.execPath, [file, '--help'], { encoding: 'utf8' });
|
|
367
|
+
const output = `${result.stdout}\n${result.stderr}`;
|
|
368
|
+
if (result.error || result.status !== 0 || !/usage|help/i.test(output)) {
|
|
369
|
+
fail(file, `script does not exit successfully with a usage/help response for --help`);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
function isNonEmptyString(value) {
|
|
374
|
+
return typeof value === 'string' && value.trim().length > 0;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
function checkStringArray(file, value, field) {
|
|
378
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
379
|
+
fail(file, `${field} must be a nonempty array`);
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
for (const [index, item] of value.entries()) {
|
|
383
|
+
if (!isNonEmptyString(item)) fail(file, `${field}[${index}] must be a nonempty string`);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
function checkEvalFixture(file, skillNames, seenIds) {
|
|
388
|
+
let fixture;
|
|
389
|
+
try {
|
|
390
|
+
fixture = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
391
|
+
} catch (error) {
|
|
392
|
+
fail(file, `invalid JSON: ${error.message}`);
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
if (!fixture || Array.isArray(fixture) || typeof fixture !== 'object') {
|
|
396
|
+
fail(file, 'fixture root must be a JSON object');
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
if (fixture.schemaVersion !== 1) fail(file, 'schemaVersion must be 1');
|
|
401
|
+
if (!isNonEmptyString(fixture.id)) fail(file, 'id must be a nonempty string');
|
|
402
|
+
else {
|
|
403
|
+
if (!namePattern.test(fixture.id)) fail(file, `id is not valid lowercase-hyphen: ${fixture.id}`);
|
|
404
|
+
if (fixture.id !== path.basename(file, '.json')) fail(file, `id (${fixture.id}) must match filename`);
|
|
405
|
+
if (seenIds.has(fixture.id)) fail(file, `duplicate fixture id: ${fixture.id}`);
|
|
406
|
+
seenIds.add(fixture.id);
|
|
407
|
+
}
|
|
408
|
+
if (!isNonEmptyString(fixture.skill)) fail(file, 'skill must be a nonempty string');
|
|
409
|
+
else if (!skillNames.has(fixture.skill)) fail(file, `fixture references unknown skill: ${fixture.skill}`);
|
|
410
|
+
if (!isNonEmptyString(fixture.title)) fail(file, 'title must be a nonempty string');
|
|
411
|
+
if (!isNonEmptyString(fixture.prompt)) fail(file, 'prompt must be a nonempty string');
|
|
412
|
+
|
|
413
|
+
const context = fixture.contextSnapshot;
|
|
414
|
+
if (!context || Array.isArray(context) || typeof context !== 'object') {
|
|
415
|
+
fail(file, 'contextSnapshot must be an object');
|
|
416
|
+
} else {
|
|
417
|
+
for (const key of ['surface', 'platform', 'mode']) {
|
|
418
|
+
if (!isNonEmptyString(context[key])) fail(file, `contextSnapshot.${key} must be a nonempty string`);
|
|
419
|
+
}
|
|
420
|
+
checkStringArray(file, context.states, 'contextSnapshot.states');
|
|
421
|
+
checkStringArray(file, context.constraints, 'contextSnapshot.constraints');
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
checkStringArray(file, fixture.expectedRouting, 'expectedRouting');
|
|
425
|
+
if (Array.isArray(fixture.expectedRouting)) {
|
|
426
|
+
const routedSkills = [fixture.skill, ...fixture.expectedRouting.filter((item) => isNonEmptyString(item) && skillNames.has(item))];
|
|
427
|
+
for (const entry of fixture.expectedRouting) {
|
|
428
|
+
if (!isNonEmptyString(entry)) continue;
|
|
429
|
+
if (/^pixelcraft(?:-[a-z0-9]+)*$/.test(entry) && !skillNames.has(entry)) {
|
|
430
|
+
fail(file, `expectedRouting references unknown skill: ${entry}`);
|
|
431
|
+
} else if (entry.startsWith('references/')) {
|
|
432
|
+
const exists = routedSkills.some((owner) => owner && fs.existsSync(path.join(skillsRoot, owner, entry)));
|
|
433
|
+
if (!exists) fail(file, `expectedRouting references missing file: ${entry}`);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
checkStringArray(file, fixture.forbiddenBehaviors, 'forbiddenBehaviors');
|
|
438
|
+
|
|
439
|
+
if (!Array.isArray(fixture.rubricDimensions) || fixture.rubricDimensions.length === 0) {
|
|
440
|
+
fail(file, 'rubricDimensions must be a nonempty array');
|
|
441
|
+
} else {
|
|
442
|
+
for (const [index, item] of fixture.rubricDimensions.entries()) {
|
|
443
|
+
if (!item || Array.isArray(item) || typeof item !== 'object') {
|
|
444
|
+
fail(file, `rubricDimensions[${index}] must be an object`);
|
|
445
|
+
continue;
|
|
446
|
+
}
|
|
447
|
+
for (const key of ['dimension', 'pass', 'fail']) {
|
|
448
|
+
if (!isNonEmptyString(item[key])) fail(file, `rubricDimensions[${index}].${key} must be a nonempty string`);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
if (!Array.isArray(fixture.negativeControls) || fixture.negativeControls.length === 0) {
|
|
454
|
+
fail(file, 'negativeControls must be a nonempty array');
|
|
455
|
+
} else {
|
|
456
|
+
for (const [index, item] of fixture.negativeControls.entries()) {
|
|
457
|
+
if (!item || Array.isArray(item) || typeof item !== 'object') {
|
|
458
|
+
fail(file, `negativeControls[${index}] must be an object`);
|
|
459
|
+
continue;
|
|
460
|
+
}
|
|
461
|
+
for (const key of ['name', 'input', 'mustNot']) {
|
|
462
|
+
if (!isNonEmptyString(item[key])) fail(file, `negativeControls[${index}].${key} must be a nonempty string`);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
const baseline = fixture.baseline;
|
|
468
|
+
if (!baseline || Array.isArray(baseline) || typeof baseline !== 'object') {
|
|
469
|
+
fail(file, 'baseline must be an object');
|
|
470
|
+
} else {
|
|
471
|
+
for (const key of ['withoutSkill', 'withSkill']) {
|
|
472
|
+
if (!isNonEmptyString(baseline[key])) fail(file, `baseline.${key} must be a nonempty string`);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
function checkEvalFixtures(skillNames) {
|
|
478
|
+
const fixturesRoot = path.join(evalsRoot, 'fixtures');
|
|
479
|
+
if (!fs.existsSync(fixturesRoot)) return;
|
|
480
|
+
const seenIds = new Set();
|
|
481
|
+
for (const entry of fs.readdirSync(fixturesRoot, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
482
|
+
if (!entry.isFile() || !entry.name.endsWith('.json')) continue;
|
|
483
|
+
checkEvalFixture(path.join(fixturesRoot, entry.name), skillNames, seenIds);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
if (!fs.existsSync(skillsRoot)) {
|
|
488
|
+
console.error('skills/ directory not found');
|
|
489
|
+
process.exit(1);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
const skillDirs = fs.readdirSync(skillsRoot, { withFileTypes: true })
|
|
493
|
+
.filter((entry) => entry.isDirectory())
|
|
494
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
495
|
+
|
|
496
|
+
if (skillDirs.length === 0) errors.push('skills/: no skills found');
|
|
497
|
+
|
|
498
|
+
for (const entry of skillDirs) {
|
|
499
|
+
const skillName = entry.name;
|
|
500
|
+
const skillDir = path.join(skillsRoot, skillName);
|
|
501
|
+
const file = path.join(skillDir, 'SKILL.md');
|
|
502
|
+
if (!fs.existsSync(file)) {
|
|
503
|
+
fail(file, 'missing SKILL.md');
|
|
504
|
+
continue;
|
|
505
|
+
}
|
|
506
|
+
const text = fs.readFileSync(file, 'utf8');
|
|
507
|
+
const parsed = parseFrontmatter(file, text);
|
|
508
|
+
if (parsed.error) {
|
|
509
|
+
fail(file, parsed.error);
|
|
510
|
+
continue;
|
|
511
|
+
}
|
|
512
|
+
const { data, bodyLines } = parsed;
|
|
513
|
+
if (!namePattern.test(skillName) || skillName.length > 64) fail(file, `folder name is not valid lowercase-hyphen <=64 chars: ${skillName}`);
|
|
514
|
+
if (data.name !== skillName) fail(file, `frontmatter name (${data.name || 'missing'}) does not equal folder name (${skillName})`);
|
|
515
|
+
if (!data.description || !data.description.trim()) fail(file, 'description is missing or empty');
|
|
516
|
+
else if (data.description.length > 1024) fail(file, `description is ${data.description.length} characters; limit is 1024`);
|
|
517
|
+
if (bodyLines.length > 500) fail(file, `body has ${bodyLines.length} lines; limit is 500`);
|
|
518
|
+
checkSkillHeadings(file, bodyLines);
|
|
519
|
+
checkLinks(file, skillDir, skillName, text);
|
|
520
|
+
checkSuppressedShellCommands(file, text);
|
|
521
|
+
|
|
522
|
+
const refsDir = path.join(skillDir, 'references');
|
|
523
|
+
if (fs.existsSync(refsDir)) {
|
|
524
|
+
const visibleSkillText = stripCode(text);
|
|
525
|
+
for (const refEntry of fs.readdirSync(refsDir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
526
|
+
const refPath = path.join(refsDir, refEntry.name);
|
|
527
|
+
if (refEntry.isDirectory()) {
|
|
528
|
+
fail(refPath, 'references/ must stay one level deep (no subdirectories)');
|
|
529
|
+
continue;
|
|
530
|
+
}
|
|
531
|
+
if (!refEntry.isFile() || !refEntry.name.endsWith('.md')) continue;
|
|
532
|
+
if (!visibleSkillText.includes(`references/${refEntry.name}`)) {
|
|
533
|
+
fail(refPath, `orphan reference not linked from SKILL.md`);
|
|
534
|
+
}
|
|
535
|
+
const refText = fs.readFileSync(refPath, 'utf8');
|
|
536
|
+
checkLinks(refPath, refsDir, skillName, refText);
|
|
537
|
+
checkSuppressedShellCommands(refPath, refText);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
const evalFile = path.join(evalsRoot, `${skillName}.md`);
|
|
542
|
+
if (!fs.existsSync(evalFile)) {
|
|
543
|
+
fail(evalFile, `missing evaluation file for ${skillName}`);
|
|
544
|
+
} else {
|
|
545
|
+
const evalText = fs.readFileSync(evalFile, 'utf8');
|
|
546
|
+
if (!/^##\s+Case\b/m.test(evalText)) fail(evalFile, 'missing at least one `## Case` evaluation prompt');
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
const scriptsDir = path.join(skillDir, 'scripts');
|
|
550
|
+
if (fs.existsSync(scriptsDir)) {
|
|
551
|
+
for (const script of fs.readdirSync(scriptsDir).filter((name) => name.endsWith('.mjs')).sort()) {
|
|
552
|
+
checkScriptHelp(path.join(scriptsDir, script));
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
const skillNameSet = new Set(skillDirs.map((entry) => entry.name));
|
|
558
|
+
checkPlatformRoutingSync(skillNameSet);
|
|
559
|
+
checkEvalFixtures(skillNameSet);
|
|
560
|
+
|
|
561
|
+
if (fs.existsSync(rootScriptsDir)) {
|
|
562
|
+
for (const script of fs.readdirSync(rootScriptsDir).filter((name) => name.endsWith('.mjs')).sort()) {
|
|
563
|
+
checkScriptHelp(path.join(rootScriptsDir, script));
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
if (errors.length) {
|
|
568
|
+
console.error(`Skill validation failed (${errors.length} problem${errors.length === 1 ? '' : 's'}):`);
|
|
569
|
+
for (const error of errors) console.error(`- ${error}`);
|
|
570
|
+
process.exit(1);
|
|
571
|
+
}
|
|
572
|
+
console.log(`Skill validation passed: ${skillDirs.length} skill${skillDirs.length === 1 ? '' : 's'} checked.`);
|
|
573
|
+
|
|
574
|
+
function checkSkillHeadings(file, bodyLines) {
|
|
575
|
+
let inCodeFence = false;
|
|
576
|
+
let prevHeading = null;
|
|
577
|
+
const seenRouting = new Set();
|
|
578
|
+
for (const line of bodyLines) {
|
|
579
|
+
if (/^```/.test(line.trimStart())) {
|
|
580
|
+
inCodeFence = !inCodeFence;
|
|
581
|
+
continue;
|
|
582
|
+
}
|
|
583
|
+
if (inCodeFence) continue;
|
|
584
|
+
const match = /^(#{1,6})\s+(.+?)\s*$/.exec(line);
|
|
585
|
+
if (!match) continue;
|
|
586
|
+
const level = match[1];
|
|
587
|
+
const title = match[2].trim().toLowerCase();
|
|
588
|
+
const normalized = `${level} ${title}`;
|
|
589
|
+
if (prevHeading !== null && normalized === prevHeading) {
|
|
590
|
+
fail(file, `duplicate consecutive heading: ${line.trim()}`);
|
|
591
|
+
}
|
|
592
|
+
prevHeading = normalized;
|
|
593
|
+
if (level === '##' && (title === 'domain routing' || title === 'platform routing')) {
|
|
594
|
+
if (seenRouting.has(normalized)) {
|
|
595
|
+
fail(file, `duplicate '${line.trim()}' heading`);
|
|
596
|
+
}
|
|
597
|
+
seenRouting.add(normalized);
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
function checkPlatformRoutingSync(skillNames) {
|
|
603
|
+
const orchestratorFile = path.join(skillsRoot, 'pixelcraft', 'SKILL.md');
|
|
604
|
+
if (!fs.existsSync(orchestratorFile)) return;
|
|
605
|
+
const text = fs.readFileSync(orchestratorFile, 'utf8').replace(/^```[\s\S]*?^```/gm, '');
|
|
606
|
+
const headerMatch = /^##\s+Platform routing\s*$/mi.exec(text);
|
|
607
|
+
if (!headerMatch) {
|
|
608
|
+
fail(orchestratorFile, "missing '## Platform routing' section");
|
|
609
|
+
return;
|
|
610
|
+
}
|
|
611
|
+
const rest = text.slice(headerMatch.index + headerMatch[0].length);
|
|
612
|
+
const nextSection = rest.search(/^##\s+/m);
|
|
613
|
+
const section = nextSection >= 0 ? rest.slice(0, nextSection) : rest;
|
|
614
|
+
|
|
615
|
+
const seenPlatformRows = new Set();
|
|
616
|
+
for (const rawLine of section.split(/\r?\n/)) {
|
|
617
|
+
const m = /^\|\s*`(pixelcraft-[a-z0-9-]+)`\s*\|\s*(.+?)\s*\|$/.exec(rawLine.trim());
|
|
618
|
+
if (!m) continue;
|
|
619
|
+
const platformSkill = m[1];
|
|
620
|
+
const cell = m[2];
|
|
621
|
+
if (seenPlatformRows.has(platformSkill)) {
|
|
622
|
+
fail(orchestratorFile, `duplicate Platform routing row for ${platformSkill}`);
|
|
623
|
+
continue;
|
|
624
|
+
}
|
|
625
|
+
seenPlatformRows.add(platformSkill);
|
|
626
|
+
if (!skillNames.has(platformSkill)) {
|
|
627
|
+
fail(orchestratorFile, `Platform routing table references unknown skill: ${platformSkill}`);
|
|
628
|
+
continue;
|
|
629
|
+
}
|
|
630
|
+
const listed = new Set();
|
|
631
|
+
for (const refMatch of cell.matchAll(/`([a-z0-9][a-z0-9-]*)`/g)) {
|
|
632
|
+
const refName = refMatch[1];
|
|
633
|
+
if (listed.has(refName)) {
|
|
634
|
+
fail(orchestratorFile, `Platform routing table for ${platformSkill} lists duplicate reference '${refName}'`);
|
|
635
|
+
}
|
|
636
|
+
listed.add(refName);
|
|
637
|
+
}
|
|
638
|
+
const refsDir = path.join(skillsRoot, platformSkill, 'references');
|
|
639
|
+
const actual = new Set();
|
|
640
|
+
if (fs.existsSync(refsDir)) {
|
|
641
|
+
for (const entry of fs.readdirSync(refsDir, { withFileTypes: true })) {
|
|
642
|
+
if (entry.isFile() && entry.name.endsWith('.md')) {
|
|
643
|
+
actual.add(entry.name.slice(0, -3));
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
for (const stem of [...actual].sort()) {
|
|
648
|
+
if (!listed.has(stem)) {
|
|
649
|
+
fail(orchestratorFile, `Platform routing table for ${platformSkill} is missing reference '${stem}'`);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
for (const stem of [...listed].sort()) {
|
|
653
|
+
if (!actual.has(stem)) {
|
|
654
|
+
fail(orchestratorFile, `Platform routing table for ${platformSkill} lists nonexistent reference '${stem}'`);
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|