@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.
Files changed (297) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/.claude-plugin/marketplace.json +20 -0
  3. package/.claude-plugin/plugin.json +11 -0
  4. package/LICENSE +21 -0
  5. package/README.md +407 -2
  6. package/assets/README.md +28 -0
  7. package/assets/pixelcraft-logo-512.png +0 -0
  8. package/bin/pixelcraft.mjs +444 -0
  9. package/docs/ARCHITECTURE.md +102 -0
  10. package/docs/DESIGN-RATIONALE.md +143 -0
  11. package/evals/README.md +27 -0
  12. package/evals/fixtures/README.md +36 -0
  13. package/evals/fixtures/direction-prototype-complexity.json +29 -0
  14. package/evals/fixtures/finish-gate-anti-slop.json +30 -0
  15. package/evals/fixtures/forms-accessibility-negative.json +29 -0
  16. package/evals/fixtures/handoff-fidelity-tolerance.json +29 -0
  17. package/evals/fixtures/plan-brownfield-evidence.json +28 -0
  18. package/evals/fixtures/visual-qa-task-evidence.json +29 -0
  19. package/evals/fixtures/workflow-checkpoints.json +30 -0
  20. package/evals/pixelcraft-accessibility.md +57 -0
  21. package/evals/pixelcraft-brandkit.md +58 -0
  22. package/evals/pixelcraft-chat-ui.md +55 -0
  23. package/evals/pixelcraft-constrained.md +55 -0
  24. package/evals/pixelcraft-craft.md +60 -0
  25. package/evals/pixelcraft-data-apps.md +55 -0
  26. package/evals/pixelcraft-dataviz.md +59 -0
  27. package/evals/pixelcraft-desktop.md +55 -0
  28. package/evals/pixelcraft-direction.md +60 -0
  29. package/evals/pixelcraft-document.md +55 -0
  30. package/evals/pixelcraft-email.md +55 -0
  31. package/evals/pixelcraft-extensions.md +55 -0
  32. package/evals/pixelcraft-game-ui.md +59 -0
  33. package/evals/pixelcraft-handoff.md +57 -0
  34. package/evals/pixelcraft-media.md +55 -0
  35. package/evals/pixelcraft-mobile.md +59 -0
  36. package/evals/pixelcraft-patterns.md +57 -0
  37. package/evals/pixelcraft-plan.md +65 -0
  38. package/evals/pixelcraft-review.md +63 -0
  39. package/evals/pixelcraft-spatial.md +55 -0
  40. package/evals/pixelcraft-tokens.md +57 -0
  41. package/evals/pixelcraft-tui.md +55 -0
  42. package/evals/pixelcraft-ux.md +59 -0
  43. package/evals/pixelcraft-visual-qa.md +80 -0
  44. package/evals/pixelcraft-web.md +71 -0
  45. package/evals/pixelcraft.md +70 -0
  46. package/gemini-extension.json +5 -0
  47. package/install.ps1 +295 -0
  48. package/install.sh +437 -0
  49. package/package.json +63 -4
  50. package/plugin.json +24 -0
  51. package/scripts/build-adapters.mjs +290 -0
  52. package/scripts/build-release-archives.mjs +61 -0
  53. package/scripts/build-skill-zips.mjs +94 -0
  54. package/scripts/test-build-adapters.mjs +48 -0
  55. package/scripts/test-distribution.mjs +124 -0
  56. package/scripts/test-export-tokens.mjs +105 -0
  57. package/scripts/test-finish-gate.mjs +148 -0
  58. package/scripts/test-installers.mjs +67 -0
  59. package/scripts/test-release-archives.mjs +42 -0
  60. package/scripts/test-shoot.mjs +65 -0
  61. package/scripts/test-slop-scan.mjs +29 -0
  62. package/scripts/test-style-inventory.mjs +211 -0
  63. package/scripts/test-validate-skills.mjs +117 -0
  64. package/scripts/validate-skills.mjs +512 -0
  65. package/skills/pixelcraft/SKILL.md +135 -0
  66. package/skills/pixelcraft/references/design-brief.md +75 -0
  67. package/skills/pixelcraft/references/floor.md +73 -0
  68. package/skills/pixelcraft/references/report-template.md +35 -0
  69. package/skills/pixelcraft/references/stack-detection.md +155 -0
  70. package/skills/pixelcraft/references/surface-acceptance.md +40 -0
  71. package/skills/pixelcraft/references/workflow-checkpoints.md +29 -0
  72. package/skills/pixelcraft-accessibility/SKILL.md +33 -0
  73. package/skills/pixelcraft-accessibility/references/apg-patterns.md +51 -0
  74. package/skills/pixelcraft-accessibility/references/platforms.md +58 -0
  75. package/skills/pixelcraft-accessibility/references/verification.md +59 -0
  76. package/skills/pixelcraft-accessibility/references/wcag22-checks.md +66 -0
  77. package/skills/pixelcraft-brandkit/SKILL.md +115 -0
  78. package/skills/pixelcraft-brandkit/references/asset-pipeline.md +125 -0
  79. package/skills/pixelcraft-brandkit/references/brand-governance.md +80 -0
  80. package/skills/pixelcraft-brandkit/references/layouts.md +88 -0
  81. package/skills/pixelcraft-brandkit/references/logo-concepting.md +83 -0
  82. package/skills/pixelcraft-brandkit/references/logo-methods.md +98 -0
  83. package/skills/pixelcraft-brandkit/references/pixel-art-logos.md +82 -0
  84. package/skills/pixelcraft-brandkit/references/prompt-template.md +85 -0
  85. package/skills/pixelcraft-brandkit/references/qa-checklist.md +88 -0
  86. package/skills/pixelcraft-brandkit/references/visual-modes.md +123 -0
  87. package/skills/pixelcraft-chat-ui/SKILL.md +53 -0
  88. package/skills/pixelcraft-chat-ui/references/conversation-design.md +78 -0
  89. package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +87 -0
  90. package/skills/pixelcraft-chat-ui/references/slack-discord.md +96 -0
  91. package/skills/pixelcraft-constrained/SKILL.md +51 -0
  92. package/skills/pixelcraft-constrained/references/specialized-hardware.md +66 -0
  93. package/skills/pixelcraft-constrained/references/tv-wearables.md +84 -0
  94. package/skills/pixelcraft-constrained/references/voice-ui.md +63 -0
  95. package/skills/pixelcraft-craft/SKILL.md +44 -0
  96. package/skills/pixelcraft-craft/references/color.md +69 -0
  97. package/skills/pixelcraft-craft/references/imagery-icons.md +37 -0
  98. package/skills/pixelcraft-craft/references/layout-quality.md +65 -0
  99. package/skills/pixelcraft-craft/references/layout.md +41 -0
  100. package/skills/pixelcraft-craft/references/motion.md +76 -0
  101. package/skills/pixelcraft-craft/references/typography.md +71 -0
  102. package/skills/pixelcraft-data-apps/SKILL.md +67 -0
  103. package/skills/pixelcraft-data-apps/references/dash.md +53 -0
  104. package/skills/pixelcraft-data-apps/references/evidence.md +75 -0
  105. package/skills/pixelcraft-data-apps/references/gradio.md +65 -0
  106. package/skills/pixelcraft-data-apps/references/julia-genie.md +54 -0
  107. package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +53 -0
  108. package/skills/pixelcraft-data-apps/references/nicegui.md +63 -0
  109. package/skills/pixelcraft-data-apps/references/observable-framework.md +67 -0
  110. package/skills/pixelcraft-data-apps/references/panel.md +53 -0
  111. package/skills/pixelcraft-data-apps/references/r-shiny.md +54 -0
  112. package/skills/pixelcraft-data-apps/references/reflex.md +62 -0
  113. package/skills/pixelcraft-data-apps/references/shiny.md +53 -0
  114. package/skills/pixelcraft-data-apps/references/streamlit.md +65 -0
  115. package/skills/pixelcraft-dataviz/SKILL.md +63 -0
  116. package/skills/pixelcraft-dataviz/references/chart-choice.md +55 -0
  117. package/skills/pixelcraft-dataviz/references/color-accessibility.md +112 -0
  118. package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +97 -0
  119. package/skills/pixelcraft-dataviz/references/libraries.md +57 -0
  120. package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +99 -0
  121. package/skills/pixelcraft-desktop/SKILL.md +71 -0
  122. package/skills/pixelcraft-desktop/references/appkit.md +58 -0
  123. package/skills/pixelcraft-desktop/references/avalonia.md +59 -0
  124. package/skills/pixelcraft-desktop/references/cpp-gui.md +52 -0
  125. package/skills/pixelcraft-desktop/references/electron.md +54 -0
  126. package/skills/pixelcraft-desktop/references/go-gui.md +54 -0
  127. package/skills/pixelcraft-desktop/references/gtk.md +54 -0
  128. package/skills/pixelcraft-desktop/references/javafx-swing.md +52 -0
  129. package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +61 -0
  130. package/skills/pixelcraft-desktop/references/rust-gui.md +65 -0
  131. package/skills/pixelcraft-desktop/references/tauri.md +54 -0
  132. package/skills/pixelcraft-desktop/references/uno-platform.md +52 -0
  133. package/skills/pixelcraft-desktop/references/winui-wpf.md +58 -0
  134. package/skills/pixelcraft-desktop/references/working-context.md +5 -0
  135. package/skills/pixelcraft-direction/SKILL.md +154 -0
  136. package/skills/pixelcraft-direction/references/composition-library.md +84 -0
  137. package/skills/pixelcraft-direction/references/direction-card.md +54 -0
  138. package/skills/pixelcraft-direction/references/direction-scoring.md +72 -0
  139. package/skills/pixelcraft-direction/references/movements.md +68 -0
  140. package/skills/pixelcraft-direction/references/repetition-history.md +75 -0
  141. package/skills/pixelcraft-direction/references/slop-fingerprints.md +58 -0
  142. package/skills/pixelcraft-direction/references/wildcards.md +47 -0
  143. package/skills/pixelcraft-document/SKILL.md +54 -0
  144. package/skills/pixelcraft-document/references/archetypes.md +83 -0
  145. package/skills/pixelcraft-document/references/pdf-tools.md +154 -0
  146. package/skills/pixelcraft-document/references/print-css.md +134 -0
  147. package/skills/pixelcraft-document/references/slides.md +102 -0
  148. package/skills/pixelcraft-email/SKILL.md +58 -0
  149. package/skills/pixelcraft-email/references/client-quirks.md +45 -0
  150. package/skills/pixelcraft-email/references/html-tables.md +53 -0
  151. package/skills/pixelcraft-email/references/mjml.md +52 -0
  152. package/skills/pixelcraft-email/references/react-email.md +53 -0
  153. package/skills/pixelcraft-extensions/SKILL.md +51 -0
  154. package/skills/pixelcraft-extensions/references/browser-extensions.md +31 -0
  155. package/skills/pixelcraft-extensions/references/figma-office.md +23 -0
  156. package/skills/pixelcraft-extensions/references/raycast.md +19 -0
  157. package/skills/pixelcraft-extensions/references/vscode-webviews.md +26 -0
  158. package/skills/pixelcraft-game-ui/SKILL.md +61 -0
  159. package/skills/pixelcraft-game-ui/references/bevy.md +52 -0
  160. package/skills/pixelcraft-game-ui/references/godot.md +57 -0
  161. package/skills/pixelcraft-game-ui/references/hud-principles.md +38 -0
  162. package/skills/pixelcraft-game-ui/references/love2d.md +51 -0
  163. package/skills/pixelcraft-game-ui/references/monogame.md +52 -0
  164. package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +65 -0
  165. package/skills/pixelcraft-game-ui/references/unreal-umg.md +53 -0
  166. package/skills/pixelcraft-handoff/SKILL.md +49 -0
  167. package/skills/pixelcraft-handoff/references/design-translation.md +104 -0
  168. package/skills/pixelcraft-handoff/references/fidelity-tolerance.md +78 -0
  169. package/skills/pixelcraft-media/SKILL.md +52 -0
  170. package/skills/pixelcraft-media/references/banners-video.md +112 -0
  171. package/skills/pixelcraft-media/references/og-generation.md +107 -0
  172. package/skills/pixelcraft-media/references/social-cards.md +72 -0
  173. package/skills/pixelcraft-mobile/SKILL.md +69 -0
  174. package/skills/pixelcraft-mobile/references/dotnet-maui.md +63 -0
  175. package/skills/pixelcraft-mobile/references/flet.md +53 -0
  176. package/skills/pixelcraft-mobile/references/flutter.md +69 -0
  177. package/skills/pixelcraft-mobile/references/ionic-capacitor.md +65 -0
  178. package/skills/pixelcraft-mobile/references/jetpack-compose.md +61 -0
  179. package/skills/pixelcraft-mobile/references/kivy.md +59 -0
  180. package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +60 -0
  181. package/skills/pixelcraft-mobile/references/react-native-expo.md +71 -0
  182. package/skills/pixelcraft-mobile/references/swiftui.md +70 -0
  183. package/skills/pixelcraft-mobile/references/task-state-composition.md +5 -0
  184. package/skills/pixelcraft-mobile/references/uikit.md +58 -0
  185. package/skills/pixelcraft-patterns/SKILL.md +58 -0
  186. package/skills/pixelcraft-patterns/references/auth-onboarding.md +25 -0
  187. package/skills/pixelcraft-patterns/references/commerce.md +28 -0
  188. package/skills/pixelcraft-patterns/references/communication.md +26 -0
  189. package/skills/pixelcraft-patterns/references/creative-tools.md +29 -0
  190. package/skills/pixelcraft-patterns/references/dashboard-admin.md +31 -0
  191. package/skills/pixelcraft-patterns/references/marketing.md +32 -0
  192. package/skills/pixelcraft-patterns/references/pattern-selection.md +74 -0
  193. package/skills/pixelcraft-patterns/references/search-filtering.md +42 -0
  194. package/skills/pixelcraft-patterns/references/settings.md +23 -0
  195. package/skills/pixelcraft-patterns/references/tables-crud.md +43 -0
  196. package/skills/pixelcraft-plan/SKILL.md +67 -0
  197. package/skills/pixelcraft-plan/references/design-input.md +69 -0
  198. package/skills/pixelcraft-plan/references/plan-template.md +99 -0
  199. package/skills/pixelcraft-plan/references/repo-discovery.md +42 -0
  200. package/skills/pixelcraft-plan/references/stack-freshness.md +50 -0
  201. package/skills/pixelcraft-plan/references/stack-selection.md +42 -0
  202. package/skills/pixelcraft-review/SKILL.md +64 -0
  203. package/skills/pixelcraft-review/references/audit-report.md +50 -0
  204. package/skills/pixelcraft-review/references/critique-protocol.md +89 -0
  205. package/skills/pixelcraft-review/references/heuristics.md +18 -0
  206. package/skills/pixelcraft-review/references/personas.md +26 -0
  207. package/skills/pixelcraft-review/references/polish.md +38 -0
  208. package/skills/pixelcraft-review/scripts/fixtures/brand-critique-waivers.json +14 -0
  209. package/skills/pixelcraft-review/scripts/fixtures/brand-critique.css +18 -0
  210. package/skills/pixelcraft-review/scripts/fixtures/clean.html +43 -0
  211. package/skills/pixelcraft-review/scripts/fixtures/focus-after-block.css +4 -0
  212. package/skills/pixelcraft-review/scripts/fixtures/focus-at-rules.css +17 -0
  213. package/skills/pixelcraft-review/scripts/fixtures/focus-comments.css +10 -0
  214. package/skills/pixelcraft-review/scripts/fixtures/focus-html-quote-leak.html +12 -0
  215. package/skills/pixelcraft-review/scripts/fixtures/focus-invalid-replacements.css +27 -0
  216. package/skills/pixelcraft-review/scripts/fixtures/focus-nested-rules.css +19 -0
  217. package/skills/pixelcraft-review/scripts/fixtures/focus-not-visible-skip.css +8 -0
  218. package/skills/pixelcraft-review/scripts/fixtures/focus-outline-shorthands.css +11 -0
  219. package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-and-border.css +15 -0
  220. package/skills/pixelcraft-review/scripts/fixtures/focus-unknown-last-wins.css +19 -0
  221. package/skills/pixelcraft-review/scripts/fixtures/focus-valid-replacements-extended.css +29 -0
  222. package/skills/pixelcraft-review/scripts/fixtures/focus-visible-no-replacement.css +3 -0
  223. package/skills/pixelcraft-review/scripts/fixtures/focus-visible-valid-replacements.css +9 -0
  224. package/skills/pixelcraft-review/scripts/fixtures/slop.html +28 -0
  225. package/skills/pixelcraft-review/scripts/slop-scan.mjs +586 -0
  226. package/skills/pixelcraft-spatial/SKILL.md +52 -0
  227. package/skills/pixelcraft-spatial/references/comfort-accessibility.md +98 -0
  228. package/skills/pixelcraft-spatial/references/platforms.md +77 -0
  229. package/skills/pixelcraft-tokens/SKILL.md +56 -0
  230. package/skills/pixelcraft-tokens/assets/tokens.example.json +71 -0
  231. package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +47 -0
  232. package/skills/pixelcraft-tokens/references/adoption.md +55 -0
  233. package/skills/pixelcraft-tokens/references/format.md +54 -0
  234. package/skills/pixelcraft-tokens/references/governance.md +80 -0
  235. package/skills/pixelcraft-tokens/references/state-tokens.md +62 -0
  236. package/skills/pixelcraft-tokens/references/theme-presets.md +94 -0
  237. package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +285 -0
  238. package/skills/pixelcraft-tui/SKILL.md +60 -0
  239. package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +60 -0
  240. package/skills/pixelcraft-tui/references/ink.md +60 -0
  241. package/skills/pixelcraft-tui/references/ratatui.md +62 -0
  242. package/skills/pixelcraft-tui/references/rich.md +62 -0
  243. package/skills/pixelcraft-tui/references/textual.md +67 -0
  244. package/skills/pixelcraft-ux/SKILL.md +46 -0
  245. package/skills/pixelcraft-ux/references/cognitive-walkthrough.md +70 -0
  246. package/skills/pixelcraft-ux/references/feedback-performance.md +30 -0
  247. package/skills/pixelcraft-ux/references/flows-ia.md +44 -0
  248. package/skills/pixelcraft-ux/references/forms.md +97 -0
  249. package/skills/pixelcraft-ux/references/i18n.md +183 -0
  250. package/skills/pixelcraft-ux/references/laws.md +18 -0
  251. package/skills/pixelcraft-ux/references/locale-test-matrix.md +60 -0
  252. package/skills/pixelcraft-ux/references/state-matrix.md +39 -0
  253. package/skills/pixelcraft-ux/references/usability-testing.md +84 -0
  254. package/skills/pixelcraft-ux/references/ux-writing.md +43 -0
  255. package/skills/pixelcraft-visual-qa/SKILL.md +82 -0
  256. package/skills/pixelcraft-visual-qa/references/baseline-governance.md +70 -0
  257. package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +38 -0
  258. package/skills/pixelcraft-visual-qa/references/capture-email.md +34 -0
  259. package/skills/pixelcraft-visual-qa/references/capture-mobile.md +35 -0
  260. package/skills/pixelcraft-visual-qa/references/capture-terminal.md +31 -0
  261. package/skills/pixelcraft-visual-qa/references/critique-rubric.md +71 -0
  262. package/skills/pixelcraft-visual-qa/references/finish-gate.md +35 -0
  263. package/skills/pixelcraft-visual-qa/references/measured-craft.md +30 -0
  264. package/skills/pixelcraft-visual-qa/references/performance-budgets.md +65 -0
  265. package/skills/pixelcraft-visual-qa/references/task-verification.md +81 -0
  266. package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +135 -0
  267. package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-aria-modal.html +19 -0
  268. package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-audit.html +34 -0
  269. package/skills/pixelcraft-visual-qa/scripts/fixtures/shoot-modal.html +17 -0
  270. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-deferred.js +1 -0
  271. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory-edge.html +52 -0
  272. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.html +80 -0
  273. package/skills/pixelcraft-visual-qa/scripts/fixtures/style-inventory.js +8 -0
  274. package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +513 -0
  275. package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +1154 -0
  276. package/skills/pixelcraft-web/SKILL.md +76 -0
  277. package/skills/pixelcraft-web/references/adaptive-layout.md +25 -0
  278. package/skills/pixelcraft-web/references/angular.md +61 -0
  279. package/skills/pixelcraft-web/references/astro.md +62 -0
  280. package/skills/pixelcraft-web/references/clojurescript.md +53 -0
  281. package/skills/pixelcraft-web/references/elm.md +53 -0
  282. package/skills/pixelcraft-web/references/fsharp-fable.md +53 -0
  283. package/skills/pixelcraft-web/references/html-css.md +88 -0
  284. package/skills/pixelcraft-web/references/htmx-alpine.md +53 -0
  285. package/skills/pixelcraft-web/references/java-web.md +52 -0
  286. package/skills/pixelcraft-web/references/kotlin-web.md +53 -0
  287. package/skills/pixelcraft-web/references/leptos-yew.md +54 -0
  288. package/skills/pixelcraft-web/references/lit-web-components.md +61 -0
  289. package/skills/pixelcraft-web/references/pwa.md +225 -0
  290. package/skills/pixelcraft-web/references/qwik.md +54 -0
  291. package/skills/pixelcraft-web/references/react-next.md +69 -0
  292. package/skills/pixelcraft-web/references/scala-laminar.md +53 -0
  293. package/skills/pixelcraft-web/references/server-rendered.md +71 -0
  294. package/skills/pixelcraft-web/references/solid.md +60 -0
  295. package/skills/pixelcraft-web/references/svelte.md +61 -0
  296. package/skills/pixelcraft-web/references/tailwind.md +73 -0
  297. package/skills/pixelcraft-web/references/vue-nuxt.md +62 -0
@@ -0,0 +1,586 @@
1
+ #!/usr/bin/env node
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
+
5
+ const exts = new Set(['.css','.scss','.html','.jsx','.tsx','.vue','.svelte','.dart','.swift','.kt','.py','.qss','.tcss','.js','.ts']);
6
+ const cssExts = new Set(['.css','.scss','.qss','.tcss']);
7
+ const markupExts = new Set(['.html','.vue','.svelte']);
8
+ const skip = new Set(['node_modules','.git','dist','build','coverage']);
9
+ const skillHosts = new Set(['.claude','.agents','.cursor','.gemini','.github','.copilot']);
10
+ const disclaimer = 'A zero score means only that these known fingerprints were not detected; zero findings is not evidence of good design.';
11
+ const brandRules = new Set(['default-font-only', 'purple-blue-gradient', 'rounded-2xl-repetition',
12
+ 'uniform-shadow', 'centered-hero-two-ctas', 'gradient-text-treatment', 'rounded-accent-rail']);
13
+
14
+ function help() {
15
+ return `Usage: node slop-scan.mjs <file-or-directory> [--json] [--waivers FILE]\n\nScan source files for recurring AI-slop fingerprints. Output includes file:line,\nseverity, score contribution, and a suggested fix. ${disclaimer}`;
16
+ }
17
+ function partsOf(file) { return file.split(/[\\/]/); }
18
+ function isInstalledPixelcraftSkill(file) {
19
+ const parts = partsOf(file);
20
+ return parts.some((part, i) => skillHosts.has(part) && parts[i + 1] === 'skills' && parts[i + 2]?.startsWith('pixelcraft'));
21
+ }
22
+ function isInsidePixelcraftSkill(file) {
23
+ const parts = partsOf(file);
24
+ return parts.some((part, i) => part === 'skills' && parts[i + 1]?.startsWith('pixelcraft'));
25
+ }
26
+ function walk(dir, out = []) {
27
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
28
+ if (skip.has(entry.name)) continue;
29
+ const file = path.join(dir, entry.name);
30
+ if (isInstalledPixelcraftSkill(file)) continue;
31
+ if ((entry.name === 'fixtures' || entry.name === 'examples') && isInsidePixelcraftSkill(file)) continue;
32
+ if (entry.isDirectory()) walk(file, out);
33
+ else if (exts.has(path.extname(entry.name))) out.push(file);
34
+ }
35
+ return out;
36
+ }
37
+ function lineOf(text, index) { return text.slice(0, index).split(/\r?\n/).length; }
38
+
39
+ function maskCssComments(text) {
40
+ const chars = text.split('');
41
+ let quote = '';
42
+ for (let i = 0; i < text.length; i += 1) {
43
+ const c = text[i];
44
+ if (quote) {
45
+ if (c === '\\') i += 1;
46
+ else if (c === quote) quote = '';
47
+ } else if (c === '"' || c === "'") quote = c;
48
+ else if (c === '/' && text[i + 1] === '*') {
49
+ chars[i] = chars[i + 1] = ' ';
50
+ i += 2;
51
+ for (; i < text.length; i += 1) {
52
+ if (text[i] === '*' && text[i + 1] === '/') {
53
+ chars[i] = chars[i + 1] = ' ';
54
+ i += 1;
55
+ break;
56
+ }
57
+ if (text[i] !== '\n' && text[i] !== '\r') chars[i] = ' ';
58
+ }
59
+ }
60
+ }
61
+ return chars.join('');
62
+ }
63
+
64
+ function blankRange(chars, start, end) {
65
+ for (let i = start; i <= end && i < chars.length; i += 1) {
66
+ if (chars[i] !== '\n' && chars[i] !== '\r') chars[i] = ' ';
67
+ }
68
+ }
69
+
70
+ function findBraceEnd(text, open) {
71
+ let depth = 1, quote = '';
72
+ for (let i = open + 1; i < text.length; i += 1) {
73
+ const c = text[i];
74
+ if (quote) {
75
+ if (c === '\\') i += 1;
76
+ else if (c === quote) quote = '';
77
+ } else if (c === '"' || c === "'") quote = c;
78
+ else if (c === '{') depth += 1;
79
+ else if (c === '}') {
80
+ depth -= 1;
81
+ if (depth === 0) return i;
82
+ }
83
+ }
84
+ return -1;
85
+ }
86
+
87
+ function extractNestedBlocks(body) {
88
+ const declarationChars = body.split('');
89
+ const nested = [];
90
+ let chunkStart = 0, depth = 0, quote = '';
91
+ for (let i = 0; i < body.length; i += 1) {
92
+ const c = body[i];
93
+ if (quote) {
94
+ if (c === '\\') i += 1;
95
+ else if (c === quote) quote = '';
96
+ } else if (c === '"' || c === "'") quote = c;
97
+ else if (c === '(' || c === '[') depth += 1;
98
+ else if (c === ')' || c === ']') depth = Math.max(0, depth - 1);
99
+ else if (c === ';' && depth === 0) chunkStart = i + 1;
100
+ else if (c === '{' && depth === 0) {
101
+ const end = findBraceEnd(body, i);
102
+ if (end < 0) break;
103
+ const rawPrelude = body.slice(chunkStart, i);
104
+ const prelude = rawPrelude.trim();
105
+ if (prelude) {
106
+ nested.push({
107
+ prelude,
108
+ body: body.slice(i + 1, end),
109
+ selectorIndex: chunkStart + rawPrelude.length - rawPrelude.trimStart().length,
110
+ bodyIndex: i + 1
111
+ });
112
+ }
113
+ blankRange(declarationChars, chunkStart, end);
114
+ chunkStart = end + 1;
115
+ i = end;
116
+ }
117
+ }
118
+ return { declarationText: declarationChars.join(''), nested };
119
+ }
120
+
121
+ function skipComment(text, i) {
122
+ const end = text.indexOf('*/', i + 2);
123
+ return end < 0 ? text.length : end + 2;
124
+ }
125
+
126
+ function styleSegments(text) {
127
+ const lower = text.toLowerCase();
128
+ const out = [];
129
+ let pos = 0;
130
+ while (pos < text.length) {
131
+ const open = lower.indexOf('<style', pos);
132
+ if (open < 0) break;
133
+ const tagEnd = lower.indexOf('>', open);
134
+ if (tagEnd < 0) break;
135
+ const close = lower.indexOf('</style', tagEnd + 1);
136
+ if (close < 0) break;
137
+ out.push({ text: text.slice(tagEnd + 1, close), offset: tagEnd + 1 });
138
+ pos = close + 8;
139
+ }
140
+ return out;
141
+ }
142
+
143
+ function cssSegments(file, text) {
144
+ const ext = path.extname(file);
145
+ if (cssExts.has(ext)) return [{ text, offset: 0 }];
146
+ if (markupExts.has(ext)) return styleSegments(text);
147
+ return [];
148
+ }
149
+
150
+ function splitSelectorList(selector) {
151
+ const out = [];
152
+ let start = 0, depth = 0, quote = '';
153
+ for (let i = 0; i < selector.length; i += 1) {
154
+ const c = selector[i];
155
+ if (quote) {
156
+ if (c === '\\') i += 1;
157
+ else if (c === quote) quote = '';
158
+ } else if (c === '"' || c === "'") quote = c;
159
+ else if (c === '(' || c === '[') depth += 1;
160
+ else if (c === ')' || c === ']') depth = Math.max(0, depth - 1);
161
+ else if (c === ',' && depth === 0) {
162
+ out.push(selector.slice(start, i).trim());
163
+ start = i + 1;
164
+ }
165
+ }
166
+ out.push(selector.slice(start).trim());
167
+ return out.filter(Boolean);
168
+ }
169
+
170
+ function stripNotContents(selector) {
171
+ let out = '';
172
+ for (let i = 0; i < selector.length; i += 1) {
173
+ if (selector.slice(i, i + 5).toLowerCase() === ':not(') {
174
+ let depth = 1, quote = '';
175
+ i += 5;
176
+ for (; i < selector.length && depth; i += 1) {
177
+ const c = selector[i];
178
+ if (quote) {
179
+ if (c === '\\') i += 1;
180
+ else if (c === quote) quote = '';
181
+ } else if (c === '"' || c === "'") quote = c;
182
+ else if (c === '(') depth += 1;
183
+ else if (c === ')') depth -= 1;
184
+ }
185
+ i -= 1;
186
+ } else out += selector[i];
187
+ }
188
+ return out;
189
+ }
190
+
191
+ function selectorFocusState(selector) {
192
+ const stripped = stripNotContents(selector);
193
+ return {
194
+ positive: /:focus-visible(?![-_a-z0-9])/i.test(stripped) || /:focus(?![-_a-z0-9])/i.test(stripped),
195
+ excludesFocusVisible: /:not\(\s*:focus-visible\s*\)/i.test(selector)
196
+ };
197
+ }
198
+
199
+ function selectorContexts(selectorText, inherited) {
200
+ const contexts = [];
201
+ const parents = inherited.length ? inherited : [{ positive: false, excludesFocusVisible: false }];
202
+ for (const parent of parents) {
203
+ for (const selector of splitSelectorList(selectorText)) {
204
+ const own = selectorFocusState(selector);
205
+ const sameElement = selector.includes('&');
206
+ const positive = own.positive || (sameElement && parent.positive);
207
+ const excludesFocusVisible = own.excludesFocusVisible || (sameElement && parent.excludesFocusVisible);
208
+ contexts.push({ positive, excludesFocusVisible, relevant: positive && !excludesFocusVisible });
209
+ }
210
+ }
211
+ return contexts;
212
+ }
213
+
214
+ function declarations(body) {
215
+ const out = [];
216
+ let start = 0, depth = 0, quote = '';
217
+ for (let i = 0; i <= body.length; i += 1) {
218
+ const c = body[i] || ';';
219
+ if (c === '/' && body[i + 1] === '*') { i = skipComment(body, i) - 1; continue; }
220
+ if (quote) {
221
+ if (c === '\\') i += 1;
222
+ else if (c === quote) quote = '';
223
+ } else if (c === '"' || c === "'") quote = c;
224
+ else if (c === '(') depth += 1;
225
+ else if (c === ')') depth = Math.max(0, depth - 1);
226
+ else if (c === ';' && depth === 0) {
227
+ const raw = body.slice(start, i);
228
+ const colon = raw.indexOf(':');
229
+ if (colon > 0) out.push({ prop: raw.slice(0, colon).trim().toLowerCase(), value: raw.slice(colon + 1).trim().toLowerCase(), offset: start + colon + 1 });
230
+ start = i + 1;
231
+ }
232
+ }
233
+ return out;
234
+ }
235
+
236
+ const visibleOutlineStyles = new Set(['auto', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset']);
237
+ const invisibleOutlineStyles = new Set(['none', 'hidden']);
238
+ const visibleBorderStyles = new Set(['dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset']);
239
+ const textDecorationLines = new Set(['underline', 'overline', 'line-through', 'blink', 'spelling-error', 'grammar-error']);
240
+ const cssColorKeywords = new Set(('aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray green greenyellow grey honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray slategrey snow springgreen steelblue tan teal thistle tomato turquoise violet wheat white whitesmoke yellow yellowgreen transparent currentcolor').split(' '));
241
+
242
+ function cleanValue(value) {
243
+ return value.replace(/\s*!important\s*$/, '').trim();
244
+ }
245
+
246
+ function splitValueTokens(value) {
247
+ const out = [];
248
+ let start = 0, depth = 0, quote = '';
249
+ const push = (end) => {
250
+ const token = value.slice(start, end).trim();
251
+ if (token) out.push(token);
252
+ };
253
+ for (let i = 0; i < value.length; i += 1) {
254
+ const c = value[i];
255
+ if (quote) {
256
+ if (c === '\\') i += 1;
257
+ else if (c === quote) quote = '';
258
+ } else if (c === '"' || c === "'") quote = c;
259
+ else if (c === '(') depth += 1;
260
+ else if (c === ')') depth = Math.max(0, depth - 1);
261
+ else if (/\s/.test(c) && depth === 0) {
262
+ push(i);
263
+ start = i + 1;
264
+ }
265
+ }
266
+ push(value.length);
267
+ return out;
268
+ }
269
+
270
+ function isZeroWidth(token) {
271
+ return /^-?0(?:\.0+)?(?:[a-z%]+)?$/.test(token);
272
+ }
273
+
274
+ function isNonzeroNumericWidth(token) {
275
+ const match = /^(-?(?:\d+|\d*\.\d+))(?:[a-z%]+)?$/.exec(token);
276
+ return match !== null && Number(match[1]) !== 0;
277
+ }
278
+
279
+ function isVisibleWidth(token) {
280
+ return token === 'thin' || token === 'medium' || token === 'thick' || isNonzeroNumericWidth(token);
281
+ }
282
+
283
+ function isColorToken(token) {
284
+ return token.startsWith('#') || cssColorKeywords.has(token) || /^(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color|color-mix)\(/.test(token);
285
+ }
286
+
287
+ function outlineTokenKind(token) {
288
+ if (invisibleOutlineStyles.has(token)) return 'invisible-style';
289
+ if (visibleOutlineStyles.has(token)) return 'visible-style';
290
+ if (isZeroWidth(token)) return 'zero-width';
291
+ if (isVisibleWidth(token)) return 'width';
292
+ if (isColorToken(token)) return 'color';
293
+ return 'unknown';
294
+ }
295
+
296
+ function hasUnresolvedTokens(value) {
297
+ return splitValueTokens(cleanValue(value)).some((token) => outlineTokenKind(token) === 'unknown');
298
+ }
299
+
300
+ function parseOutlineShorthand(value) {
301
+ const parsed = { style: 'none', width: 'medium', removes: false, unknown: false };
302
+ for (const token of splitValueTokens(cleanValue(value))) {
303
+ const kind = outlineTokenKind(token);
304
+ if (kind === 'unknown') parsed.unknown = true;
305
+ else if (kind === 'invisible-style') {
306
+ parsed.style = token;
307
+ parsed.removes = true;
308
+ } else if (kind === 'visible-style') parsed.style = token;
309
+ else if (kind === 'zero-width') {
310
+ parsed.width = token;
311
+ parsed.removes = true;
312
+ } else if (kind === 'width') parsed.width = token;
313
+ }
314
+ if (parsed.unknown) parsed.removes = false;
315
+ return parsed;
316
+ }
317
+
318
+ function analyzeOutline(decls) {
319
+ let style = 'none', width = 'medium', removal = null;
320
+ let styleUnknown = false, widthUnknown = false;
321
+ for (const decl of decls) {
322
+ const value = cleanValue(decl.value);
323
+ if (decl.prop === 'outline') {
324
+ const parsed = parseOutlineShorthand(value);
325
+ if (parsed.unknown) {
326
+ styleUnknown = true;
327
+ widthUnknown = true;
328
+ style = 'none';
329
+ width = 'medium';
330
+ } else {
331
+ style = parsed.style;
332
+ width = parsed.width;
333
+ styleUnknown = false;
334
+ widthUnknown = false;
335
+ }
336
+ if (parsed.removes && !removal) removal = decl;
337
+ } else if (decl.prop === 'outline-style') {
338
+ style = value;
339
+ styleUnknown = hasUnresolvedTokens(value);
340
+ } else if (decl.prop === 'outline-width') {
341
+ width = value;
342
+ widthUnknown = hasUnresolvedTokens(value);
343
+ }
344
+ }
345
+ return { removal, visible: styleUnknown || widthUnknown || (visibleOutlineStyles.has(style) && isVisibleWidth(width)) };
346
+ }
347
+
348
+ function borderShorthandProp(prop) {
349
+ return prop === 'border' || /^border-(?:top|right|bottom|left|inline|block)(?:-(?:start|end))?$/.test(prop);
350
+ }
351
+
352
+ function borderColorProp(prop) {
353
+ return prop === 'border-color' || /^border-(?:top|right|bottom|left|inline|block)(?:-(?:start|end))?-color$/.test(prop);
354
+ }
355
+
356
+ function visibleBorder(value) {
357
+ let styled = false, zero = false, invisible = false;
358
+ for (const token of splitValueTokens(cleanValue(value))) {
359
+ if (isZeroWidth(token)) zero = true;
360
+ else if (visibleBorderStyles.has(token)) styled = true;
361
+ else if (token === 'none' || token === 'hidden') invisible = true;
362
+ }
363
+ return styled && !zero && !invisible;
364
+ }
365
+
366
+ function visibleTextDecoration(value) {
367
+ return splitValueTokens(cleanValue(value)).some((token) => textDecorationLines.has(token));
368
+ }
369
+
370
+ function visibleReplacement(decls, outline) {
371
+ if (outline.visible) return true;
372
+ let visibleBorderStyle = false, positiveBorderWidth = false;
373
+ for (const { prop, value } of decls) {
374
+ const tokens = splitValueTokens(cleanValue(value));
375
+ if (prop === 'border-style' && tokens.some((token) => visibleBorderStyles.has(token))) visibleBorderStyle = true;
376
+ if (prop === 'border-width' && tokens.some((token) => isVisibleWidth(token))) positiveBorderWidth = true;
377
+ }
378
+ if (visibleBorderStyle && positiveBorderWidth) return true;
379
+ return decls.some(({ prop, value }) => {
380
+ const clean = cleanValue(value);
381
+ if (prop === 'box-shadow') return clean !== 'none';
382
+ if (borderShorthandProp(prop)) return visibleBorder(clean);
383
+ if (borderColorProp(prop)) return clean !== 'none' && clean !== 'transparent';
384
+ if (prop === 'text-decoration' || prop === 'text-decoration-line') return visibleTextDecoration(clean);
385
+ return false;
386
+ });
387
+ }
388
+
389
+ function scanRuleList(text, baseOffset, sourceText, visit, inherited) {
390
+ let i = 0;
391
+ while (i < text.length) {
392
+ while (i < text.length && /\s/.test(text[i])) i += 1;
393
+ if (i >= text.length) break;
394
+ const start = i;
395
+ let quote = '', depth = 0, terminator = '';
396
+ for (; i < text.length; i += 1) {
397
+ const c = text[i];
398
+ if (quote) {
399
+ if (c === '\\') i += 1;
400
+ else if (c === quote) quote = '';
401
+ } else if (c === '"' || c === "'") quote = c;
402
+ else if (c === '(' || c === '[') depth += 1;
403
+ else if (c === ')' || c === ']') depth = Math.max(0, depth - 1);
404
+ else if ((c === '{' || c === ';') && depth === 0) {
405
+ terminator = c;
406
+ break;
407
+ }
408
+ }
409
+ if (terminator === ';') {
410
+ i += 1;
411
+ continue;
412
+ }
413
+ if (terminator !== '{') break;
414
+ const rawPrelude = text.slice(start, i);
415
+ const end = findBraceEnd(text, i);
416
+ if (end < 0) break;
417
+ scanRule({
418
+ prelude: rawPrelude.trim(),
419
+ body: text.slice(i + 1, end),
420
+ selectorIndex: baseOffset + start + rawPrelude.length - rawPrelude.trimStart().length,
421
+ bodyIndex: baseOffset + i + 1
422
+ }, sourceText, visit, inherited);
423
+ i = end + 1;
424
+ }
425
+ }
426
+
427
+ function scanRule(rule, sourceText, visit, inherited) {
428
+ const parts = extractNestedBlocks(rule.body);
429
+ let childInherited = inherited;
430
+ if (rule.prelude && !rule.prelude.startsWith('@')) {
431
+ const contexts = selectorContexts(rule.prelude, inherited);
432
+ visit(rule.prelude, declarations(parts.declarationText), {
433
+ selectorIndex: rule.selectorIndex,
434
+ bodyIndex: rule.bodyIndex,
435
+ sourceText
436
+ }, contexts);
437
+ childInherited = contexts;
438
+ }
439
+ for (const nested of parts.nested) {
440
+ scanRule({
441
+ prelude: nested.prelude,
442
+ body: nested.body,
443
+ selectorIndex: rule.bodyIndex + nested.selectorIndex,
444
+ bodyIndex: rule.bodyIndex + nested.bodyIndex
445
+ }, sourceText, visit, childInherited);
446
+ }
447
+ }
448
+
449
+ function scanRules(segment, baseOffset, sourceText, visit) {
450
+ scanRuleList(segment.text, baseOffset, sourceText, visit, [{ positive: false, excludesFocusVisible: false }]);
451
+ }
452
+
453
+ function scanFile(file, root) {
454
+ const text = fs.readFileSync(file, 'utf8');
455
+ const lines = text.split(/\r?\n/);
456
+ const findings = [];
457
+ const seenRules = new Set();
458
+ const add = (rule, severity, weight, line, match, fix) => {
459
+ const key = `${rule}:${line}`;
460
+ if (seenRules.has(key)) return;
461
+ seenRules.add(key);
462
+ findings.push({ rule, severity, weight, file: path.relative(root, file), line, match: match.trim().slice(0, 160), fix });
463
+ };
464
+
465
+ // Focus scan is heuristic; live keyboard testing remains authoritative.
466
+ for (const segment of cssSegments(file, text)) {
467
+ const maskedSegment = { text: maskCssComments(segment.text), offset: segment.offset };
468
+ scanRules(maskedSegment, segment.offset, maskedSegment.text, (selectorText, decls, location, contexts) => {
469
+ const lastFirst = [...decls].reverse();
470
+ const declaration = (property) => lastFirst.find((decl) => property.test(decl.prop));
471
+ const clip = declaration(/^(?:-webkit-)?background-clip$/);
472
+ const background = declaration(/^background(?:-image)?$/);
473
+ const color = declaration(/^(?:color|-webkit-text-fill-color)$/);
474
+ if (clip && cleanValue(clip.value) === 'text' && background && /gradient\(/i.test(background.value)
475
+ && color && cleanValue(color.value) === 'transparent') {
476
+ add('gradient-text-treatment','P3',1,lineOf(text,location.bodyIndex + clip.offset),selectorText,
477
+ 'Check that decorative gradient text fits the direction and remains legible.');
478
+ }
479
+ const rail = declaration(/^border-(?:left|right|inline-start|inline-end)$/);
480
+ const radius = declaration(/^border-radius$/);
481
+ const railTokens = rail ? splitValueTokens(cleanValue(rail.value)) : [];
482
+ if (radius && /^\d*\.?\d+(?:px|em|rem|%)(?:\s|$)/.test(cleanValue(radius.value))
483
+ && Number.parseFloat(radius.value) > 0 && rail && visibleBorder(rail.value)
484
+ && railTokens.some((token) => /^\d+(?:\.\d+)?px$/.test(token) && Number.parseFloat(token) >= 4)
485
+ && /\.(?:\w+-)?(?:card|tile|panel)\b/i.test(selectorText)) {
486
+ add('rounded-accent-rail','P3',1,lineOf(text,location.bodyIndex + rail.offset),selectorText,
487
+ 'Check whether the thick edge communicates a status or is repeated decoration.');
488
+ }
489
+ const outline = analyzeOutline(decls);
490
+ if (!outline.removal || visibleReplacement(decls, outline)) return;
491
+ for (const context of contexts) {
492
+ if (!context.relevant) continue;
493
+ add('outline-removed','P0',5,lineOf(text,location.bodyIndex + outline.removal.offset),`outline: ${outline.removal.value}`,'Restore a visible keyboard focus indicator.');
494
+ }
495
+ });
496
+ }
497
+
498
+ lines.forEach((line, i) => {
499
+ const n = i + 1;
500
+ if (/font-family\s*:\s*['"]?(Inter|Roboto|Geist|Arial)['"]?\s*;?/i.test(line)) add('default-font-only','P2',2,n,line,'Choose type by voice/platform and provide deliberate fallbacks.');
501
+ if (/transition\s*:\s*all\b/.test(line)) add('transition-all','P2',2,n,line,'Animate only intentional properties with semantic durations/easing.');
502
+ if (/<(input|textarea)\b[^>]*placeholder=/i.test(line) && !/aria-label|aria-labelledby/i.test(line)) add('placeholder-as-label','P1',4,n,line,'Use a persistent programmatic label; placeholder is only a hint.');
503
+ if (/(user-scalable\s*=\s*["']?no|maximum-scale\s*=\s*["']?1(?:\.0)?\b)/i.test(line)) add('zoom-disabled','P0',5,n,line,'Do not disable pinch zoom or text scaling.');
504
+ if (/\p{Extended_Pictographic}/u.test(line) && /icon|button|nav|<span/i.test(line)) add('emoji-as-icon','P2',2,n,line,'Use a coherent icon system or text instead of structural emoji.');
505
+ if (/\b(get started|seamless|unlock|revolutionize|elevate)\b/i.test(line) || /lorem ipsum/i.test(line)) add('generic-copy','P2',2,n,line,'Replace template copy with concrete user/domain language.');
506
+ if (/rounded-2xl/.test(line)) add('rounded-2xl-repetition','P3',1,n,line,'Use semantic radius variation rather than uniform rounded-2xl.');
507
+ if (/shadow-(lg|xl|2xl)/.test(line)) add('uniform-shadow','P3',1,n,line,'Use elevation/shadow only where material semantics require it.');
508
+ });
509
+
510
+ const rounded = (text.match(/rounded-2xl/g) || []).length;
511
+ if (rounded < 3) for (const f of findings.filter((f) => f.rule === 'rounded-2xl-repetition')) f.drop = true;
512
+ const shadows = (text.match(/shadow-(lg|xl|2xl)/g) || []).length;
513
+ if (shadows < 3) for (const f of findings.filter((f) => f.rule === 'uniform-shadow')) f.drop = true;
514
+
515
+ if (/gradient/i.test(text) && /(purple|violet|indigo|blue|#[0-9a-f]{3,8})/i.test(text) && /(purple|violet|indigo)/i.test(text) && /(blue|cyan)/i.test(text)) add('purple-blue-gradient','P2',2,lineOf(text,/gradient/i.exec(text)?.index || 0),'gradient definition','Use a color posture derived from subject/material rather than the default AI gradient.');
516
+ const paste = /paste[\s\S]{0,160}preventDefault|preventDefault[\s\S]{0,160}paste/i.exec(text);
517
+ if (paste) add('paste-blocked','P0',5,lineOf(text,paste.index),paste[0],'Never block paste; it harms password managers, accessibility, and recovery.');
518
+ const motion = /@keyframes|\banimation\b|\btransition\b/.exec(text);
519
+ if (motion && !/prefers-reduced-motion|reduceMotion|accessibilityReduceMotion/i.test(text)) add('missing-reduced-motion','P1',4,lineOf(text,motion.index),motion[0],'Provide a reduced-motion path when animation or transitions exist.');
520
+ const hexes = [...text.matchAll(/#[0-9a-fA-F]{3,8}\b/g)];
521
+ const tokenRefs = (text.match(/var\(|token|theme\.|Color\.|semantic/gi) || []).length;
522
+ if (hexes.length >= 6 && hexes.length > tokenRefs * 2) add('hardcoded-color-literals','P2',2,lineOf(text,hexes[0].index),`${hexes.length} hardcoded color literals`,'Move recurring colors into semantic tokens and verify contrast roles.');
523
+ const heroIndex = text.search(/hero|text-center|items-center|justify-center|mx-auto/i);
524
+ const ctaCount = (text.match(/<button|<a\b|get started|learn more/gi) || []).length;
525
+ if (heroIndex >= 0 && ctaCount >= 2 && /(hero|text-center)/i.test(text)) add('centered-hero-two-ctas','P3',1,lineOf(text,heroIndex),'centered hero with repeated calls to action','Question the centered hero/two-CTA template; choose composition from the user decision.');
526
+ return findings.filter((f) => !f.drop);
527
+ }
528
+
529
+ function applyWaivers(findings, file) {
530
+ const items = JSON.parse(fs.readFileSync(file, 'utf8'));
531
+ if (!Array.isArray(items)) throw new Error('waivers must be an array of {rule, file, line, reason}');
532
+ const byFinding = new Map();
533
+ for (const item of items) {
534
+ if (!item || !brandRules.has(item.rule) || typeof item.file !== 'string' || !item.file.trim()
535
+ || !Number.isInteger(item.line) || item.line < 1 || typeof item.reason !== 'string' || !item.reason.trim()) {
536
+ throw new Error('waivers require an advisory brand rule, exact file and line, and a nonempty reason');
537
+ }
538
+ const key = JSON.stringify([item.rule, item.file.replace(/\\/g, '/'), item.line]);
539
+ if (byFinding.has(key)) throw new Error(`duplicate waiver: ${key}`);
540
+ byFinding.set(key, item);
541
+ }
542
+ const waived = [];
543
+ const active = findings.filter((finding) => {
544
+ const key = JSON.stringify([finding.rule, finding.file.replace(/\\/g, '/'), finding.line]);
545
+ const item = byFinding.get(key);
546
+ if (!item) return true;
547
+ waived.push({ ...finding, label: 'waived', reason: item.reason.trim() });
548
+ byFinding.delete(key);
549
+ return false;
550
+ });
551
+ return { active, waived, unusedWaivers: Array.from(byFinding.values()) };
552
+ }
553
+
554
+ try {
555
+ const args = process.argv.slice(2);
556
+ if (args.includes('--help') || args.includes('-h')) { console.log(help()); process.exit(0); }
557
+ const json = args.includes('--json');
558
+ let dir, waivers;
559
+ for (let index = 0; index < args.length; index += 1) {
560
+ const argument = args[index];
561
+ if (argument === '--json') continue;
562
+ if (argument === '--waivers' && !waivers && args[index + 1] && !args[index + 1].startsWith('-')) waivers = args[++index];
563
+ else if (!dir && !argument.startsWith('-')) dir = argument;
564
+ else throw new Error(`unexpected argument: ${argument}`);
565
+ }
566
+ if (!dir || !fs.existsSync(dir)) throw new Error('provide an existing file or directory to scan');
567
+ const input = path.resolve(dir);
568
+ const stat = fs.statSync(input);
569
+ const root = stat.isDirectory() ? input : path.dirname(input);
570
+ const files = stat.isDirectory() ? walk(input) : [input];
571
+ const detected = files.flatMap((file) => scanFile(file, root));
572
+ const { active: findings, ...waiverReport } = waivers ? applyWaivers(detected, waivers) : { active: detected };
573
+ const score = findings.reduce((sum, f) => sum + f.weight, 0);
574
+ const output = { score, disclaimer, findings, ...waiverReport };
575
+ if (json) console.log(JSON.stringify(output, null, 2));
576
+ else {
577
+ console.log(`slop-scan score: ${score}`);
578
+ for (const f of findings) console.log(`${f.severity} ${f.file}:${f.line} ${f.rule} (+${f.weight}) — ${f.match}\n fix: ${f.fix}`);
579
+ for (const f of waiverReport.waived ?? []) console.log(`waived ${f.file}:${f.line} ${f.rule} — ${f.reason}`);
580
+ for (const f of waiverReport.unusedWaivers ?? []) console.log(`unused waiver ${f.file}:${f.line} ${f.rule}`);
581
+ console.log(`disclaimer: ${disclaimer}`);
582
+ }
583
+ } catch (error) {
584
+ console.error(`slop-scan: ${error.message}`);
585
+ process.exit(1);
586
+ }
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: pixelcraft-spatial
3
+ description: Designs and verifies spatial, XR, VR, AR, and 3D interfaces across visionOS, WebXR, Three.js/React Three Fiber/A-Frame, Meta Quest Interaction SDK, and Unity XR Interaction Toolkit. Use for windows/volumes/immersive spaces, RealityKit, ornaments, glass materials, hover effects, gaze-and-pinch input, hand/controller interaction, locomotion comfort, depth/layering, XR ergonomics, spatial text legibility, privacy, frame-rate budgets, and XR accessibility.
4
+ license: MIT
5
+ metadata:
6
+ version: 0.1.0
7
+ ---
8
+
9
+ # Pixelcraft spatial
10
+
11
+ Spatial UI is embodied interface design. Depth, scale, motion, head/body ergonomics, input privacy, frame stability, and real-world safety are product behavior—not decorative polish. Do not place a flat screen in space and call it XR.
12
+
13
+ ## Surface craft
14
+
15
+ Attach depth to a meaningful relationship such as an object with nearby annotation, not decorative panels scattered around the room. Keep primary controls at a comfortable stable depth; offer seated and low-motion routes, with a non-immersive alternative where practical. Verify occlusion, relocalization and task completion with actual input when hardware is available.
16
+
17
+ ## References
18
+
19
+ - Read [references/platforms.md](references/platforms.md) for visionOS, WebXR, Three.js/React Three Fiber/A-Frame, Meta Quest Interaction SDK, and Unity XR Interaction Toolkit.
20
+ - Read [references/comfort-accessibility.md](references/comfort-accessibility.md) for locomotion comfort, frame-rate discipline, ergonomic distances/fields of view, angular sizing, depth/layering, gaze/pinch privacy, text legibility, and XR accessibility.
21
+
22
+ ## Required workflow
23
+
24
+ 1. **Define reality model.** Shared windowed workspace, bounded volume, mixed-reality passthrough, immersive VR, tabletop/room scale, seated/standing/mobile use, and session duration.
25
+ 2. **Map input truth.** Gaze/pinch, direct touch, indirect ray, controllers, hand tracking, keyboard/voice/gamepad, tracking loss, latency, and privacy permissions.
26
+ 3. **Establish scale and coordinate systems.** Units, floor/reference space, user height/seated mode, recentering, collision/boundary behavior, and real-world object persistence.
27
+ 4. **Design depth hierarchy.** Primary content, interactable objects, ambient context, UI chrome, passthrough visibility, occlusion, shadows, focus feedback, and layering collisions.
28
+ 5. **Choose comfort intentionally.** Physical movement, teleport, snap/continuous turn, continuous motion, acceleration, camera motion, vignette, and user comfort settings.
29
+ 6. **Verify in headset.** Simulator/browser rendering cannot prove comfort, stereo convergence, input fatigue, scale, tracking, or frame stability.
30
+
31
+ ## Non-negotiable rules
32
+
33
+ | Concern | Rule |
34
+ |---|---|
35
+ | dimensional purpose | Use 3D/immersion only when spatial inspection, embodiment, presence, scale, or environmental context improves the task. |
36
+ | comfort | Never move/rotate the camera involuntarily; offer locomotion/comfort choices and preserve orientation/recovery. |
37
+ | frame stability | Dropped frames/reprojection are UX failures in XR; budget assets/shaders/lights/physics accordingly. |
38
+ | input feedback | Every interactable needs hover/target/acquire/release feedback through visual/audio/haptic channels appropriate to input mode. |
39
+ | privacy | Treat gaze, hand/body tracking, room geometry, camera/passthrough, biometrics, and spatial audio telemetry as sensitive. |
40
+ | accessibility | Provide seated/standing/one-handed/controller alternatives, captions/audio equivalents, contrast/scale controls, reduced motion, and non-head-aimed interaction where possible. |
41
+ | anti-slop | Reject floating glass panels everywhere, pointless particle/depth effects, miniature desktop UI, unbounded scroll walls, motion-heavy demos, and demo scenes that ignore safety boundaries. |
42
+
43
+ ## Pre-submit checklist
44
+
45
+ - [ ] reality model, session duration, physical posture, and input modes are explicit;
46
+ - [ ] object scale/distance/angular size can be recalculated from documented assumptions;
47
+ - [ ] primary content stays in a comfortable viewing/interaction envelope;
48
+ - [ ] depth/layering/occlusion collisions are tested from multiple positions/heights;
49
+ - [ ] locomotion and camera-motion choices include comfort settings;
50
+ - [ ] measured frame timing/headroom meets the target device or is `not-checked`;
51
+ - [ ] gaze/hand/camera/room data collection is minimized and disclosed;
52
+ - [ ] accessibility alternatives were implemented or explicitly labeled `not-checked`.