quiver-cli 1.3.0 → 2.0.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 (384) hide show
  1. package/README.md +197 -239
  2. package/dist/cli.js +3163 -2040
  3. package/package.json +10 -11
  4. package/template/.agents/AGENTS.md +0 -26
  5. package/template/.agents/commands/cp.md +0 -108
  6. package/template/.agents/commands/next-setup.md +0 -1064
  7. package/template/.agents/commands/review.md +0 -68
  8. package/template/.agents/commands/terraform-readme.md +0 -38
  9. package/template/.agents/config.json +0 -80
  10. package/template/.agents/plugins/opencode/rtk.ts +0 -34
  11. package/template/.agents/skills/agent-browser/SKILL.md +0 -51
  12. package/template/.agents/skills/apps/skybridge/SKILL.md +0 -50
  13. package/template/.agents/skills/code/cleanup/SKILL.md +0 -26
  14. package/template/.agents/skills/code/improve/SKILL.md +0 -122
  15. package/template/.agents/skills/code/improve/references/audit-playbook.md +0 -130
  16. package/template/.agents/skills/code/improve/references/closing-the-loop.md +0 -96
  17. package/template/.agents/skills/code/improve/references/plan-template.md +0 -197
  18. package/template/.agents/skills/code/vercel-react-best-practices/AGENTS.md +0 -3810
  19. package/template/.agents/skills/code/vercel-react-best-practices/README.md +0 -123
  20. package/template/.agents/skills/code/vercel-react-best-practices/SKILL.md +0 -149
  21. package/template/.agents/skills/code/vercel-react-best-practices/metadata.json +0 -15
  22. package/template/.agents/skills/code/vercel-react-best-practices/rules/_sections.md +0 -46
  23. package/template/.agents/skills/code/vercel-react-best-practices/rules/_template.md +0 -28
  24. package/template/.agents/skills/code/vercel-react-best-practices/rules/advanced-effect-event-deps.md +0 -56
  25. package/template/.agents/skills/code/vercel-react-best-practices/rules/advanced-event-handler-refs.md +0 -55
  26. package/template/.agents/skills/code/vercel-react-best-practices/rules/advanced-init-once.md +0 -42
  27. package/template/.agents/skills/code/vercel-react-best-practices/rules/advanced-use-latest.md +0 -39
  28. package/template/.agents/skills/code/vercel-react-best-practices/rules/async-api-routes.md +0 -38
  29. package/template/.agents/skills/code/vercel-react-best-practices/rules/async-cheap-condition-before-await.md +0 -37
  30. package/template/.agents/skills/code/vercel-react-best-practices/rules/async-defer-await.md +0 -82
  31. package/template/.agents/skills/code/vercel-react-best-practices/rules/async-dependencies.md +0 -51
  32. package/template/.agents/skills/code/vercel-react-best-practices/rules/async-parallel.md +0 -28
  33. package/template/.agents/skills/code/vercel-react-best-practices/rules/async-suspense-boundaries.md +0 -99
  34. package/template/.agents/skills/code/vercel-react-best-practices/rules/bundle-analyzable-paths.md +0 -63
  35. package/template/.agents/skills/code/vercel-react-best-practices/rules/bundle-barrel-imports.md +0 -60
  36. package/template/.agents/skills/code/vercel-react-best-practices/rules/bundle-conditional.md +0 -31
  37. package/template/.agents/skills/code/vercel-react-best-practices/rules/bundle-defer-third-party.md +0 -49
  38. package/template/.agents/skills/code/vercel-react-best-practices/rules/bundle-dynamic-imports.md +0 -35
  39. package/template/.agents/skills/code/vercel-react-best-practices/rules/bundle-preload.md +0 -50
  40. package/template/.agents/skills/code/vercel-react-best-practices/rules/client-event-listeners.md +0 -74
  41. package/template/.agents/skills/code/vercel-react-best-practices/rules/client-localstorage-schema.md +0 -71
  42. package/template/.agents/skills/code/vercel-react-best-practices/rules/client-passive-event-listeners.md +0 -48
  43. package/template/.agents/skills/code/vercel-react-best-practices/rules/client-swr-dedup.md +0 -56
  44. package/template/.agents/skills/code/vercel-react-best-practices/rules/js-batch-dom-css.md +0 -107
  45. package/template/.agents/skills/code/vercel-react-best-practices/rules/js-cache-function-results.md +0 -80
  46. package/template/.agents/skills/code/vercel-react-best-practices/rules/js-cache-property-access.md +0 -28
  47. package/template/.agents/skills/code/vercel-react-best-practices/rules/js-cache-storage.md +0 -70
  48. package/template/.agents/skills/code/vercel-react-best-practices/rules/js-combine-iterations.md +0 -32
  49. package/template/.agents/skills/code/vercel-react-best-practices/rules/js-early-exit.md +0 -50
  50. package/template/.agents/skills/code/vercel-react-best-practices/rules/js-flatmap-filter.md +0 -60
  51. package/template/.agents/skills/code/vercel-react-best-practices/rules/js-hoist-regexp.md +0 -45
  52. package/template/.agents/skills/code/vercel-react-best-practices/rules/js-index-maps.md +0 -37
  53. package/template/.agents/skills/code/vercel-react-best-practices/rules/js-length-check-first.md +0 -49
  54. package/template/.agents/skills/code/vercel-react-best-practices/rules/js-min-max-loop.md +0 -82
  55. package/template/.agents/skills/code/vercel-react-best-practices/rules/js-request-idle-callback.md +0 -105
  56. package/template/.agents/skills/code/vercel-react-best-practices/rules/js-set-map-lookups.md +0 -24
  57. package/template/.agents/skills/code/vercel-react-best-practices/rules/js-tosorted-immutable.md +0 -57
  58. package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-activity.md +0 -26
  59. package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -47
  60. package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-conditional-render.md +0 -40
  61. package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-content-visibility.md +0 -38
  62. package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-hoist-jsx.md +0 -46
  63. package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +0 -82
  64. package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +0 -30
  65. package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-resource-hints.md +0 -85
  66. package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-script-defer-async.md +0 -68
  67. package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-svg-precision.md +0 -28
  68. package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-usetransition-loading.md +0 -75
  69. package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-defer-reads.md +0 -39
  70. package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-dependencies.md +0 -45
  71. package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +0 -40
  72. package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-derived-state.md +0 -29
  73. package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-functional-setstate.md +0 -74
  74. package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-lazy-state-init.md +0 -58
  75. package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +0 -38
  76. package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-memo.md +0 -44
  77. package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +0 -45
  78. package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-no-inline-components.md +0 -82
  79. package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +0 -35
  80. package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-split-combined-hooks.md +0 -64
  81. package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-transitions.md +0 -40
  82. package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-use-deferred-value.md +0 -59
  83. package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +0 -73
  84. package/template/.agents/skills/code/vercel-react-best-practices/rules/server-after-nonblocking.md +0 -73
  85. package/template/.agents/skills/code/vercel-react-best-practices/rules/server-auth-actions.md +0 -96
  86. package/template/.agents/skills/code/vercel-react-best-practices/rules/server-cache-lru.md +0 -41
  87. package/template/.agents/skills/code/vercel-react-best-practices/rules/server-cache-react.md +0 -76
  88. package/template/.agents/skills/code/vercel-react-best-practices/rules/server-dedup-props.md +0 -65
  89. package/template/.agents/skills/code/vercel-react-best-practices/rules/server-hoist-static-io.md +0 -149
  90. package/template/.agents/skills/code/vercel-react-best-practices/rules/server-no-shared-module-state.md +0 -50
  91. package/template/.agents/skills/code/vercel-react-best-practices/rules/server-parallel-fetching.md +0 -83
  92. package/template/.agents/skills/code/vercel-react-best-practices/rules/server-parallel-nested-fetching.md +0 -34
  93. package/template/.agents/skills/code/vercel-react-best-practices/rules/server-serialization.md +0 -38
  94. package/template/.agents/skills/data/prisma-cli/SKILL.md +0 -247
  95. package/template/.agents/skills/data/prisma-cli/references/db-execute.md +0 -78
  96. package/template/.agents/skills/data/prisma-cli/references/db-pull.md +0 -185
  97. package/template/.agents/skills/data/prisma-cli/references/db-push.md +0 -148
  98. package/template/.agents/skills/data/prisma-cli/references/db-seed.md +0 -188
  99. package/template/.agents/skills/data/prisma-cli/references/debug.md +0 -46
  100. package/template/.agents/skills/data/prisma-cli/references/dev.md +0 -157
  101. package/template/.agents/skills/data/prisma-cli/references/format.md +0 -48
  102. package/template/.agents/skills/data/prisma-cli/references/generate.md +0 -173
  103. package/template/.agents/skills/data/prisma-cli/references/init.md +0 -136
  104. package/template/.agents/skills/data/prisma-cli/references/mcp.md +0 -38
  105. package/template/.agents/skills/data/prisma-cli/references/migrate-deploy.md +0 -127
  106. package/template/.agents/skills/data/prisma-cli/references/migrate-dev.md +0 -145
  107. package/template/.agents/skills/data/prisma-cli/references/migrate-diff.md +0 -89
  108. package/template/.agents/skills/data/prisma-cli/references/migrate-reset.md +0 -78
  109. package/template/.agents/skills/data/prisma-cli/references/migrate-resolve.md +0 -57
  110. package/template/.agents/skills/data/prisma-cli/references/migrate-status.md +0 -65
  111. package/template/.agents/skills/data/prisma-cli/references/studio.md +0 -137
  112. package/template/.agents/skills/data/prisma-cli/references/validate.md +0 -53
  113. package/template/.agents/skills/data/prisma-client-api/SKILL.md +0 -216
  114. package/template/.agents/skills/data/prisma-client-api/references/client-methods.md +0 -223
  115. package/template/.agents/skills/data/prisma-client-api/references/constructor.md +0 -208
  116. package/template/.agents/skills/data/prisma-client-api/references/filters.md +0 -256
  117. package/template/.agents/skills/data/prisma-client-api/references/model-queries.md +0 -281
  118. package/template/.agents/skills/data/prisma-client-api/references/query-options.md +0 -276
  119. package/template/.agents/skills/data/prisma-client-api/references/raw-queries.md +0 -194
  120. package/template/.agents/skills/data/prisma-client-api/references/relations.md +0 -308
  121. package/template/.agents/skills/data/prisma-client-api/references/transactions.md +0 -184
  122. package/template/.agents/skills/design/impeccable/SKILL.md +0 -84
  123. package/template/.agents/skills/design/impeccable/reference/adapt.md +0 -312
  124. package/template/.agents/skills/design/impeccable/reference/adapt.native.md +0 -58
  125. package/template/.agents/skills/design/impeccable/reference/android.md +0 -40
  126. package/template/.agents/skills/design/impeccable/reference/animate.md +0 -86
  127. package/template/.agents/skills/design/impeccable/reference/audit.md +0 -136
  128. package/template/.agents/skills/design/impeccable/reference/audit.native.md +0 -139
  129. package/template/.agents/skills/design/impeccable/reference/bolder.md +0 -31
  130. package/template/.agents/skills/design/impeccable/reference/clarify.md +0 -94
  131. package/template/.agents/skills/design/impeccable/reference/colorize.md +0 -86
  132. package/template/.agents/skills/design/impeccable/reference/craft-floor.md +0 -42
  133. package/template/.agents/skills/design/impeccable/reference/craft.md +0 -5
  134. package/template/.agents/skills/design/impeccable/reference/critique.md +0 -788
  135. package/template/.agents/skills/design/impeccable/reference/degraded/asset-producer.md +0 -90
  136. package/template/.agents/skills/design/impeccable/reference/degraded/documenter.md +0 -24
  137. package/template/.agents/skills/design/impeccable/reference/degraded/finish-reviewer.md +0 -37
  138. package/template/.agents/skills/design/impeccable/reference/degraded/manual-edit-applier.md +0 -92
  139. package/template/.agents/skills/design/impeccable/reference/delight.md +0 -70
  140. package/template/.agents/skills/design/impeccable/reference/distill.md +0 -111
  141. package/template/.agents/skills/design/impeccable/reference/doctor.md +0 -53
  142. package/template/.agents/skills/design/impeccable/reference/document.md +0 -416
  143. package/template/.agents/skills/design/impeccable/reference/extract.md +0 -69
  144. package/template/.agents/skills/design/impeccable/reference/harden.md +0 -336
  145. package/template/.agents/skills/design/impeccable/reference/hooks.md +0 -105
  146. package/template/.agents/skills/design/impeccable/reference/init.md +0 -125
  147. package/template/.agents/skills/design/impeccable/reference/ios.md +0 -45
  148. package/template/.agents/skills/design/impeccable/reference/layout.md +0 -84
  149. package/template/.agents/skills/design/impeccable/reference/live-setup.md +0 -102
  150. package/template/.agents/skills/design/impeccable/reference/live.md +0 -323
  151. package/template/.agents/skills/design/impeccable/reference/new-work.md +0 -105
  152. package/template/.agents/skills/design/impeccable/reference/onboard.md +0 -234
  153. package/template/.agents/skills/design/impeccable/reference/operate.md +0 -61
  154. package/template/.agents/skills/design/impeccable/reference/optimize.md +0 -258
  155. package/template/.agents/skills/design/impeccable/reference/overdrive.md +0 -127
  156. package/template/.agents/skills/design/impeccable/reference/polish.md +0 -97
  157. package/template/.agents/skills/design/impeccable/reference/quieter.md +0 -99
  158. package/template/.agents/skills/design/impeccable/reference/routing.md +0 -18
  159. package/template/.agents/skills/design/impeccable/reference/shape.md +0 -59
  160. package/template/.agents/skills/design/impeccable/reference/typeset.md +0 -80
  161. package/template/.agents/skills/design/impeccable/reference/visualize.md +0 -47
  162. package/template/.agents/skills/design/impeccable/scripts/command-metadata.json +0 -94
  163. package/template/.agents/skills/design/impeccable/scripts/concept-seed.mjs +0 -558
  164. package/template/.agents/skills/design/impeccable/scripts/context-signals.mjs +0 -334
  165. package/template/.agents/skills/design/impeccable/scripts/context.mjs +0 -1450
  166. package/template/.agents/skills/design/impeccable/scripts/critique-storage.mjs +0 -213
  167. package/template/.agents/skills/design/impeccable/scripts/detect-csp.mjs +0 -198
  168. package/template/.agents/skills/design/impeccable/scripts/detect.mjs +0 -21
  169. package/template/.agents/skills/design/impeccable/scripts/detector/browser/injected/index.mjs +0 -2023
  170. package/template/.agents/skills/design/impeccable/scripts/detector/cli/main.mjs +0 -438
  171. package/template/.agents/skills/design/impeccable/scripts/detector/design-system.mjs +0 -983
  172. package/template/.agents/skills/design/impeccable/scripts/detector/detect-antipatterns-browser.js +0 -8283
  173. package/template/.agents/skills/design/impeccable/scripts/detector/detect-antipatterns.mjs +0 -50
  174. package/template/.agents/skills/design/impeccable/scripts/detector/engines/browser/detect-url.mjs +0 -372
  175. package/template/.agents/skills/design/impeccable/scripts/detector/engines/regex/detect-text.mjs +0 -768
  176. package/template/.agents/skills/design/impeccable/scripts/detector/engines/static-html/css-cascade.mjs +0 -1186
  177. package/template/.agents/skills/design/impeccable/scripts/detector/engines/static-html/detect-html.mjs +0 -264
  178. package/template/.agents/skills/design/impeccable/scripts/detector/engines/visual/screenshot-contrast.mjs +0 -189
  179. package/template/.agents/skills/design/impeccable/scripts/detector/findings.mjs +0 -18
  180. package/template/.agents/skills/design/impeccable/scripts/detector/node/file-system.mjs +0 -212
  181. package/template/.agents/skills/design/impeccable/scripts/detector/profile/profiler.mjs +0 -166
  182. package/template/.agents/skills/design/impeccable/scripts/detector/registry/antipatterns.mjs +0 -617
  183. package/template/.agents/skills/design/impeccable/scripts/detector/rules/checks.mjs +0 -5580
  184. package/template/.agents/skills/design/impeccable/scripts/detector/shared/color.mjs +0 -124
  185. package/template/.agents/skills/design/impeccable/scripts/detector/shared/constants.mjs +0 -112
  186. package/template/.agents/skills/design/impeccable/scripts/detector/shared/fonts.mjs +0 -30
  187. package/template/.agents/skills/design/impeccable/scripts/detector/shared/inline-ignores.mjs +0 -148
  188. package/template/.agents/skills/design/impeccable/scripts/detector/shared/page.mjs +0 -7
  189. package/template/.agents/skills/design/impeccable/scripts/doctor.mjs +0 -336
  190. package/template/.agents/skills/design/impeccable/scripts/embed-prompt.mjs +0 -133
  191. package/template/.agents/skills/design/impeccable/scripts/generate-image.mjs +0 -240
  192. package/template/.agents/skills/design/impeccable/scripts/hook-admin.mjs +0 -741
  193. package/template/.agents/skills/design/impeccable/scripts/hook-before-edit.mjs +0 -516
  194. package/template/.agents/skills/design/impeccable/scripts/hook-lib.mjs +0 -2100
  195. package/template/.agents/skills/design/impeccable/scripts/hook.mjs +0 -78
  196. package/template/.agents/skills/design/impeccable/scripts/lib/artifact-schema.mjs +0 -93
  197. package/template/.agents/skills/design/impeccable/scripts/lib/composition-catalog.mjs +0 -200
  198. package/template/.agents/skills/design/impeccable/scripts/lib/concept-catalog.mjs +0 -357
  199. package/template/.agents/skills/design/impeccable/scripts/lib/design-parser.mjs +0 -842
  200. package/template/.agents/skills/design/impeccable/scripts/lib/impeccable-config.mjs +0 -658
  201. package/template/.agents/skills/design/impeccable/scripts/lib/impeccable-paths.mjs +0 -137
  202. package/template/.agents/skills/design/impeccable/scripts/lib/is-generated.mjs +0 -69
  203. package/template/.agents/skills/design/impeccable/scripts/lib/provider.mjs +0 -5
  204. package/template/.agents/skills/design/impeccable/scripts/lib/roll-selection.mjs +0 -362
  205. package/template/.agents/skills/design/impeccable/scripts/lib/staleness-deep.mjs +0 -457
  206. package/template/.agents/skills/design/impeccable/scripts/lib/staleness-notice.mjs +0 -169
  207. package/template/.agents/skills/design/impeccable/scripts/lib/staleness.mjs +0 -457
  208. package/template/.agents/skills/design/impeccable/scripts/lib/surface-briefs.mjs +0 -151
  209. package/template/.agents/skills/design/impeccable/scripts/lib/target-args.mjs +0 -42
  210. package/template/.agents/skills/design/impeccable/scripts/lib/target-slug.mjs +0 -33
  211. package/template/.agents/skills/design/impeccable/scripts/lib/template-extensions.mjs +0 -146
  212. package/template/.agents/skills/design/impeccable/scripts/live/accept-css.mjs +0 -617
  213. package/template/.agents/skills/design/impeccable/scripts/live/accept-verify.mjs +0 -60
  214. package/template/.agents/skills/design/impeccable/scripts/live/browser-script-parts.mjs +0 -55
  215. package/template/.agents/skills/design/impeccable/scripts/live/completion.mjs +0 -28
  216. package/template/.agents/skills/design/impeccable/scripts/live/event-validation.mjs +0 -199
  217. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/astro.mjs +0 -47
  218. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/detect-utils.mjs +0 -73
  219. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/index.mjs +0 -143
  220. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/journal.mjs +0 -197
  221. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/nextjs.mjs +0 -49
  222. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/nuxt.mjs +0 -161
  223. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/script-src.mjs +0 -17
  224. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/static-html.mjs +0 -26
  225. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/sveltekit.mjs +0 -71
  226. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/tag-strategy.mjs +0 -247
  227. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/tanstack-start.mjs +0 -70
  228. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/vite-generic.mjs +0 -42
  229. package/template/.agents/skills/design/impeccable/scripts/live/generation-preflight.mjs +0 -149
  230. package/template/.agents/skills/design/impeccable/scripts/live/insert-ui.mjs +0 -458
  231. package/template/.agents/skills/design/impeccable/scripts/live/instructions.mjs +0 -142
  232. package/template/.agents/skills/design/impeccable/scripts/live/manual-apply.mjs +0 -939
  233. package/template/.agents/skills/design/impeccable/scripts/live/manual-edit-routes.mjs +0 -357
  234. package/template/.agents/skills/design/impeccable/scripts/live/manual-edits-buffer.mjs +0 -152
  235. package/template/.agents/skills/design/impeccable/scripts/live/poll-lanes.mjs +0 -14
  236. package/template/.agents/skills/design/impeccable/scripts/live/roots.mjs +0 -508
  237. package/template/.agents/skills/design/impeccable/scripts/live/session-store.mjs +0 -563
  238. package/template/.agents/skills/design/impeccable/scripts/live/source-lock.mjs +0 -105
  239. package/template/.agents/skills/design/impeccable/scripts/live/source-search.mjs +0 -105
  240. package/template/.agents/skills/design/impeccable/scripts/live/svelte-ast.mjs +0 -961
  241. package/template/.agents/skills/design/impeccable/scripts/live/svelte-component.mjs +0 -1342
  242. package/template/.agents/skills/design/impeccable/scripts/live/sveltekit-adapter.mjs +0 -316
  243. package/template/.agents/skills/design/impeccable/scripts/live/tanstack-adapter.mjs +0 -280
  244. package/template/.agents/skills/design/impeccable/scripts/live/ui-core.mjs +0 -180
  245. package/template/.agents/skills/design/impeccable/scripts/live/vocabulary.mjs +0 -171
  246. package/template/.agents/skills/design/impeccable/scripts/live-accept.mjs +0 -954
  247. package/template/.agents/skills/design/impeccable/scripts/live-browser-dom.js +0 -146
  248. package/template/.agents/skills/design/impeccable/scripts/live-browser-session.js +0 -123
  249. package/template/.agents/skills/design/impeccable/scripts/live-browser.js +0 -12512
  250. package/template/.agents/skills/design/impeccable/scripts/live-commit-manual-edits.mjs +0 -1244
  251. package/template/.agents/skills/design/impeccable/scripts/live-complete.mjs +0 -107
  252. package/template/.agents/skills/design/impeccable/scripts/live-copy-edit-agent.mjs +0 -683
  253. package/template/.agents/skills/design/impeccable/scripts/live-discard-manual-edits.mjs +0 -51
  254. package/template/.agents/skills/design/impeccable/scripts/live-inject.mjs +0 -503
  255. package/template/.agents/skills/design/impeccable/scripts/live-insert.mjs +0 -292
  256. package/template/.agents/skills/design/impeccable/scripts/live-manual-edit-evidence.mjs +0 -368
  257. package/template/.agents/skills/design/impeccable/scripts/live-poll.mjs +0 -429
  258. package/template/.agents/skills/design/impeccable/scripts/live-resume.mjs +0 -123
  259. package/template/.agents/skills/design/impeccable/scripts/live-server.mjs +0 -1661
  260. package/template/.agents/skills/design/impeccable/scripts/live-status.mjs +0 -71
  261. package/template/.agents/skills/design/impeccable/scripts/live-target.mjs +0 -30
  262. package/template/.agents/skills/design/impeccable/scripts/live-wrap.mjs +0 -927
  263. package/template/.agents/skills/design/impeccable/scripts/live.mjs +0 -359
  264. package/template/.agents/skills/design/impeccable/scripts/modern-screenshot.umd.js +0 -14
  265. package/template/.agents/skills/design/impeccable/scripts/palette.mjs +0 -628
  266. package/template/.agents/skills/design/impeccable/scripts/pin.mjs +0 -221
  267. package/template/.agents/skills/design/impeccable/scripts/serve-question.mjs +0 -932
  268. package/template/.agents/skills/design/impeccable/scripts/surface-brief.mjs +0 -74
  269. package/template/.agents/skills/design/shadcn/SKILL.md +0 -277
  270. package/template/.agents/skills/design/shadcn/agents/openai.yml +0 -5
  271. package/template/.agents/skills/design/shadcn/assets/shadcn-small.png +0 -0
  272. package/template/.agents/skills/design/shadcn/assets/shadcn.png +0 -0
  273. package/template/.agents/skills/design/shadcn/cli.md +0 -290
  274. package/template/.agents/skills/design/shadcn/customization.md +0 -209
  275. package/template/.agents/skills/design/shadcn/evals/evals.json +0 -77
  276. package/template/.agents/skills/design/shadcn/mcp.md +0 -105
  277. package/template/.agents/skills/design/shadcn/registry.md +0 -277
  278. package/template/.agents/skills/design/shadcn/rules/base-vs-radix.md +0 -306
  279. package/template/.agents/skills/design/shadcn/rules/chat.md +0 -224
  280. package/template/.agents/skills/design/shadcn/rules/composition.md +0 -213
  281. package/template/.agents/skills/design/shadcn/rules/forms.md +0 -192
  282. package/template/.agents/skills/design/shadcn/rules/icons.md +0 -101
  283. package/template/.agents/skills/design/shadcn/rules/styling.md +0 -185
  284. package/template/.agents/skills/find-skills/SKILL.md +0 -141
  285. package/template/.agents/skills/hono/SKILL.md +0 -579
  286. package/template/.agents/skills/integrations/langfuse/SKILL.md +0 -146
  287. package/template/.agents/skills/integrations/langfuse/references/ci-cd.md +0 -41
  288. package/template/.agents/skills/integrations/langfuse/references/cli.md +0 -60
  289. package/template/.agents/skills/integrations/langfuse/references/error-analysis.md +0 -88
  290. package/template/.agents/skills/integrations/langfuse/references/instrumentation.md +0 -121
  291. package/template/.agents/skills/integrations/langfuse/references/judge-calibration.md +0 -291
  292. package/template/.agents/skills/integrations/langfuse/references/prompt-engineering.md +0 -35
  293. package/template/.agents/skills/integrations/langfuse/references/prompt-migration.md +0 -79
  294. package/template/.agents/skills/integrations/langfuse/references/skill-feedback.md +0 -55
  295. package/template/.agents/skills/integrations/langfuse/references/trace-evaluator-upgrade.md +0 -76
  296. package/template/.agents/skills/integrations/langfuse/references/user-feedback.md +0 -92
  297. package/template/.agents/skills/integrations/langfuse/references/v4-project-migration.md +0 -73
  298. package/template/.agents/skills/integrations/posthog/SKILL.md +0 -102
  299. package/template/.agents/skills/integrations/posthog/references/error-tracking-alerts.md +0 -63
  300. package/template/.agents/skills/integrations/posthog/references/error-tracking-assigning-issues.md +0 -77
  301. package/template/.agents/skills/integrations/posthog/references/error-tracking-fingerprints.md +0 -57
  302. package/template/.agents/skills/integrations/posthog/references/error-tracking-monitoring.md +0 -140
  303. package/template/.agents/skills/integrations/posthog/references/error-tracking-nextjs.md +0 -490
  304. package/template/.agents/skills/integrations/posthog/references/error-tracking-source-maps.md +0 -45
  305. package/template/.agents/skills/integrations/posthog/references/feature-flags-best-practices.md +0 -139
  306. package/template/.agents/skills/integrations/posthog/references/feature-flags-react.md +0 -302
  307. package/template/.agents/skills/integrations/posthog/references/identify-users.md +0 -202
  308. package/template/.agents/skills/integrations/posthog/references/integration-example.md +0 -706
  309. package/template/.agents/skills/integrations/posthog/references/integration-nextjs.md +0 -385
  310. package/template/.agents/skills/integrations/posthog/references/integration-step-1-begin.md +0 -43
  311. package/template/.agents/skills/integrations/posthog/references/integration-step-2-edit.md +0 -37
  312. package/template/.agents/skills/integrations/posthog/references/integration-step-3-revise.md +0 -22
  313. package/template/.agents/skills/integrations/posthog/references/integration-step-4-conclude.md +0 -38
  314. package/template/.agents/skills/integrations/posthog/references/llm-analytics-anthropic.md +0 -200
  315. package/template/.agents/skills/integrations/posthog/references/llm-analytics-basics.md +0 -62
  316. package/template/.agents/skills/integrations/posthog/references/llm-analytics-costs.md +0 -197
  317. package/template/.agents/skills/integrations/posthog/references/llm-analytics-manual-capture.md +0 -397
  318. package/template/.agents/skills/integrations/posthog/references/llm-analytics-traces.md +0 -98
  319. package/template/.agents/skills/integrations/posthog/references/llm-analytics-vercel-ai.md +0 -120
  320. package/template/.agents/skills/repo/repo-ci/SKILL.md +0 -265
  321. package/template/.agents/skills/repo/repo-init-next-js/SKILL.md +0 -129
  322. package/template/.agents/skills/repo/repo-init-next-js/references/file-contents.md +0 -800
  323. package/template/.agents/skills/repo/repo-init-next-js/scripts/setup.sh +0 -47
  324. package/template/.agents/skills/repo/repo-init-node/SKILL.md +0 -196
  325. package/template/.agents/skills/skill-creator/LICENSE.txt +0 -202
  326. package/template/.agents/skills/skill-creator/SKILL.md +0 -485
  327. package/template/.agents/skills/skill-creator/agents/analyzer.md +0 -274
  328. package/template/.agents/skills/skill-creator/agents/comparator.md +0 -202
  329. package/template/.agents/skills/skill-creator/agents/grader.md +0 -223
  330. package/template/.agents/skills/skill-creator/assets/eval_review.html +0 -146
  331. package/template/.agents/skills/skill-creator/eval-viewer/generate_review.py +0 -471
  332. package/template/.agents/skills/skill-creator/eval-viewer/viewer.html +0 -1325
  333. package/template/.agents/skills/skill-creator/references/schemas.md +0 -430
  334. package/template/.agents/skills/skill-creator/scripts/__init__.py +0 -0
  335. package/template/.agents/skills/skill-creator/scripts/aggregate_benchmark.py +0 -401
  336. package/template/.agents/skills/skill-creator/scripts/generate_report.py +0 -326
  337. package/template/.agents/skills/skill-creator/scripts/improve_description.py +0 -247
  338. package/template/.agents/skills/skill-creator/scripts/package_skill.py +0 -136
  339. package/template/.agents/skills/skill-creator/scripts/quick_validate.py +0 -103
  340. package/template/.agents/skills/skill-creator/scripts/run_eval.py +0 -310
  341. package/template/.agents/skills/skill-creator/scripts/run_loop.py +0 -328
  342. package/template/.agents/skills/skill-creator/scripts/utils.py +0 -47
  343. package/template/.agents/skills/supabase/CHANGELOG.md +0 -71
  344. package/template/.agents/skills/supabase/SKILL.md +0 -145
  345. package/template/.agents/skills/supabase/assets/feedback-issue-template.md +0 -17
  346. package/template/.agents/skills/supabase/references/skill-feedback.md +0 -17
  347. package/template/.agents/skills/supabase-postgres-best-practices/CHANGELOG.md +0 -73
  348. package/template/.agents/skills/supabase-postgres-best-practices/SKILL.md +0 -64
  349. package/template/.agents/skills/supabase-postgres-best-practices/references/_contributing.md +0 -170
  350. package/template/.agents/skills/supabase-postgres-best-practices/references/_sections.md +0 -39
  351. package/template/.agents/skills/supabase-postgres-best-practices/references/_template.md +0 -34
  352. package/template/.agents/skills/supabase-postgres-best-practices/references/advanced-full-text-search.md +0 -55
  353. package/template/.agents/skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +0 -49
  354. package/template/.agents/skills/supabase-postgres-best-practices/references/conn-idle-timeout.md +0 -46
  355. package/template/.agents/skills/supabase-postgres-best-practices/references/conn-limits.md +0 -44
  356. package/template/.agents/skills/supabase-postgres-best-practices/references/conn-pooling.md +0 -41
  357. package/template/.agents/skills/supabase-postgres-best-practices/references/conn-prepared-statements.md +0 -46
  358. package/template/.agents/skills/supabase-postgres-best-practices/references/data-batch-inserts.md +0 -54
  359. package/template/.agents/skills/supabase-postgres-best-practices/references/data-n-plus-one.md +0 -53
  360. package/template/.agents/skills/supabase-postgres-best-practices/references/data-pagination.md +0 -50
  361. package/template/.agents/skills/supabase-postgres-best-practices/references/data-upsert.md +0 -50
  362. package/template/.agents/skills/supabase-postgres-best-practices/references/lock-advisory.md +0 -56
  363. package/template/.agents/skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +0 -68
  364. package/template/.agents/skills/supabase-postgres-best-practices/references/lock-short-transactions.md +0 -50
  365. package/template/.agents/skills/supabase-postgres-best-practices/references/lock-skip-locked.md +0 -54
  366. package/template/.agents/skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md +0 -45
  367. package/template/.agents/skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +0 -55
  368. package/template/.agents/skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +0 -55
  369. package/template/.agents/skills/supabase-postgres-best-practices/references/query-composite-indexes.md +0 -44
  370. package/template/.agents/skills/supabase-postgres-best-practices/references/query-covering-indexes.md +0 -40
  371. package/template/.agents/skills/supabase-postgres-best-practices/references/query-index-types.md +0 -48
  372. package/template/.agents/skills/supabase-postgres-best-practices/references/query-missing-indexes.md +0 -43
  373. package/template/.agents/skills/supabase-postgres-best-practices/references/query-partial-indexes.md +0 -45
  374. package/template/.agents/skills/supabase-postgres-best-practices/references/schema-constraints.md +0 -80
  375. package/template/.agents/skills/supabase-postgres-best-practices/references/schema-data-types.md +0 -46
  376. package/template/.agents/skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +0 -59
  377. package/template/.agents/skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +0 -55
  378. package/template/.agents/skills/supabase-postgres-best-practices/references/schema-partitioning.md +0 -55
  379. package/template/.agents/skills/supabase-postgres-best-practices/references/schema-primary-keys.md +0 -61
  380. package/template/.agents/skills/supabase-postgres-best-practices/references/security-privileges.md +0 -54
  381. package/template/.agents/skills/supabase-postgres-best-practices/references/security-rls-basics.md +0 -50
  382. package/template/.agents/skills/supabase-postgres-best-practices/references/security-rls-performance.md +0 -63
  383. package/template/.agents/skills/writing/humanizer/SKILL.md +0 -621
  384. package/template/.agents/upstreams.json +0 -116
@@ -1,658 +0,0 @@
1
- /**
2
- * CLI-side reader/writer for the unified `.impeccable` config.
3
- *
4
- * The CLI (published to npm) and the skill scripts (bundled into the install)
5
- * live in separate trees and cannot share runtime code, so this duplicates a
6
- * small slice of skill/scripts/hook-lib.mjs — the config-path layout, detector
7
- * ignore semantics, and the `.git/info/exclude` handling. Keep the schema,
8
- * ignore filtering, and exclude marker in sync if either side changes.
9
- *
10
- * Schema (config.json shared / config.local.json gitignored, per-developer):
11
- * {
12
- * "detector": { "ignoreRules": [], "ignoreFiles": [], "ignoreValues": [], "designSystem": { "enabled": true } },
13
- * "hook": { "consent": "accepted" | "declined", ... },
14
- * "updateCheck": bool
15
- * }
16
- */
17
-
18
- import { existsSync, readFileSync, writeFileSync, mkdirSync, statSync } from 'node:fs';
19
- import { join, dirname, isAbsolute, relative, resolve, sep } from 'node:path';
20
-
21
- export function getConfigPath(root) {
22
- return join(root, '.impeccable', 'config.json');
23
- }
24
-
25
- export function getLocalConfigPath(root) {
26
- return join(root, '.impeccable', 'config.local.json');
27
- }
28
-
29
- function safeReadJson(filePath) {
30
- try {
31
- const raw = JSON.parse(readFileSync(filePath, 'utf-8'));
32
- return raw && typeof raw === 'object' && !Array.isArray(raw) ? raw : null;
33
- } catch {
34
- return null;
35
- }
36
- }
37
-
38
- function hookSection(raw) {
39
- return raw && raw.hook && typeof raw.hook === 'object' && !Array.isArray(raw.hook) ? raw.hook : null;
40
- }
41
-
42
- function detectorSection(raw) {
43
- return raw && raw.detector && typeof raw.detector === 'object' && !Array.isArray(raw.detector) ? raw.detector : null;
44
- }
45
-
46
- const DETECTOR_CONFIG_KEYS = new Set(['ignoreRules', 'ignoreFiles', 'ignoreValues', 'designSystem', 'advisoryRules']);
47
-
48
- const DEFAULT_DETECTION_CONFIG = Object.freeze({
49
- ignoreRules: [],
50
- ignoreFiles: [],
51
- ignoreValues: [],
52
- designSystem: { enabled: true },
53
- });
54
-
55
- function cloneDetectionConfig() {
56
- return {
57
- ignoreRules: [],
58
- ignoreFiles: [],
59
- ignoreValues: [],
60
- designSystem: { ...DEFAULT_DETECTION_CONFIG.designSystem },
61
- };
62
- }
63
-
64
- function cloneRawDetectionConfig() {
65
- return {
66
- ignoreRules: [],
67
- ignoreFiles: [],
68
- ignoreValues: [],
69
- };
70
- }
71
-
72
- function applyDetectionConfigSource(config, raw) {
73
- if (!raw || typeof raw !== 'object') return config;
74
- // Advisory rules are opt-in for the design hook; the CLI carries the setting
75
- // so config round-trips (e.g. `impeccable hooks ignore-value`) preserve it.
76
- if (raw.advisoryRules === 'include' || raw.advisoryRules === 'exclude') {
77
- config.advisoryRules = raw.advisoryRules;
78
- }
79
- if (raw.designSystem && typeof raw.designSystem === 'object' && !Array.isArray(raw.designSystem)) {
80
- config.designSystem = {
81
- ...config.designSystem,
82
- enabled: raw.designSystem.enabled === false ? false : true,
83
- };
84
- }
85
- if (Array.isArray(raw.ignoreRules)) {
86
- config.ignoreRules = uniqueStrings([...config.ignoreRules, ...raw.ignoreRules]);
87
- }
88
- if (Array.isArray(raw.ignoreFiles)) {
89
- config.ignoreFiles = uniqueStrings([...config.ignoreFiles, ...raw.ignoreFiles]);
90
- }
91
- if (Array.isArray(raw.ignoreValues)) {
92
- config.ignoreValues = mergeIgnoreValues(config.ignoreValues, raw.ignoreValues);
93
- }
94
- return config;
95
- }
96
-
97
- function uniqueStrings(values) {
98
- return Array.from(new Set(values.map(String)));
99
- }
100
-
101
- /**
102
- * Detector filters shared by `npx impeccable detect` and the design hook.
103
- * `hook.enabled` remains hook lifecycle state; manual CLI scans still run when
104
- * the hook is disabled, but they honor the same ignore rules and design-system
105
- * toggle.
106
- */
107
- export function readDetectionConfig(root) {
108
- const config = cloneDetectionConfig();
109
- for (const filePath of [getConfigPath(root), getLocalConfigPath(root)]) {
110
- const raw = safeReadJson(filePath);
111
- // Back-compat: old builds stored detector filters under hook.*.
112
- applyDetectionConfigSource(config, hookSection(raw));
113
- applyDetectionConfigSource(config, detectorSection(raw));
114
- }
115
- return config;
116
- }
117
-
118
- export function readRawDetectionConfig(root, opts = {}) {
119
- const raw = safeReadJson(opts.local ? getLocalConfigPath(root) : getConfigPath(root));
120
- const config = cloneRawDetectionConfig();
121
- applyDetectionConfigSource(config, hookSection(raw));
122
- applyDetectionConfigSource(config, detectorSection(raw));
123
- return config;
124
- }
125
-
126
- export function writeDetectionConfig(root, detectorConfig, opts = {}) {
127
- const filePath = opts.local ? getLocalConfigPath(root) : getConfigPath(root);
128
- if (opts.local) ensureConfigGitExclude(root);
129
- const existing = safeReadJson(filePath) || {};
130
- const existingHook = hookSection(existing);
131
- const nextHook = stripDetectorKeys(existingHook);
132
- const nextDetector = {
133
- ...(detectorSection(existing) || {}),
134
- ...normalizeDetectionConfigForWrite(detectorConfig),
135
- };
136
- const next = {
137
- ...existing,
138
- detector: nextDetector,
139
- };
140
- if (nextHook && Object.keys(nextHook).length > 0) {
141
- next.hook = nextHook;
142
- } else {
143
- delete next.hook;
144
- }
145
- mkdirSync(dirname(filePath), { recursive: true });
146
- writeFileSync(filePath, `${JSON.stringify(next, null, 2)}\n`);
147
- return filePath;
148
- }
149
-
150
- function normalizeDetectionConfigForWrite(config) {
151
- const out = {};
152
- if (Array.isArray(config?.ignoreRules)) {
153
- out.ignoreRules = uniqueStrings(config.ignoreRules.map((rule) => normalizeIgnoreRule(rule)).filter(Boolean));
154
- }
155
- if (Array.isArray(config?.ignoreFiles)) {
156
- out.ignoreFiles = uniqueStrings(config.ignoreFiles.filter(v => typeof v === 'string' && v.trim()).map(v => v.trim()));
157
- }
158
- out.ignoreValues = normalizeIgnoreValueEntries(config?.ignoreValues || []);
159
- if (config?.advisoryRules === 'include' || config?.advisoryRules === 'exclude') {
160
- out.advisoryRules = config.advisoryRules;
161
- }
162
- if (config?.designSystem && typeof config.designSystem === 'object' && !Array.isArray(config.designSystem)) {
163
- out.designSystem = {
164
- enabled: config.designSystem.enabled === false ? false : true,
165
- };
166
- }
167
- return out;
168
- }
169
-
170
- function stripDetectorKeys(raw) {
171
- if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return null;
172
- const out = {};
173
- for (const [key, value] of Object.entries(raw)) {
174
- if (!DETECTOR_CONFIG_KEYS.has(key)) out[key] = value;
175
- }
176
- return out;
177
- }
178
-
179
- export function normalizeIgnoreValue(value) {
180
- return String(value || '')
181
- .trim()
182
- .replace(/^["']|["']$/g, '')
183
- .replace(/\+/g, ' ')
184
- .replace(/\s+/g, ' ')
185
- .toLowerCase();
186
- }
187
-
188
- function normalizeIgnoreRule(rule) {
189
- return String(rule || '').trim().toLowerCase();
190
- }
191
-
192
- function colorIgnoreKey(value) {
193
- const color = parseIgnoreColor(value);
194
- if (!color) return '';
195
- return `${color.r},${color.g},${color.b},${Math.round(color.a * 255)}`;
196
- }
197
-
198
- function parseIgnoreColor(value) {
199
- const text = String(value || '').trim().toLowerCase();
200
- if (!text) return null;
201
-
202
- const hex = text.match(/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i);
203
- if (hex) return parseHexIgnoreColor(hex[1]);
204
-
205
- const rgb = text.match(/^rgba?\((.*)\)$/i);
206
- if (rgb) {
207
- const parts = splitColorArgs(rgb[1]);
208
- if (parts.length < 3 || parts.length > 4) return null;
209
- const r = parseRgbChannel(parts[0]);
210
- const g = parseRgbChannel(parts[1]);
211
- const b = parseRgbChannel(parts[2]);
212
- const a = parts[3] === undefined ? 1 : parseAlphaChannel(parts[3]);
213
- if ([r, g, b, a].some((v) => v === null)) return null;
214
- return { r, g, b, a };
215
- }
216
-
217
- const hsl = text.match(/^hsla?\((.*)\)$/i);
218
- if (hsl) {
219
- const parts = splitColorArgs(hsl[1]);
220
- if (parts.length < 3 || parts.length > 4) return null;
221
- const h = parseHueChannel(parts[0]);
222
- const s = parsePercentChannel(parts[1]);
223
- const l = parsePercentChannel(parts[2]);
224
- const a = parts[3] === undefined ? 1 : parseAlphaChannel(parts[3]);
225
- if ([h, s, l, a].some((v) => v === null)) return null;
226
- return hslToRgb(h, s, l, a);
227
- }
228
-
229
- return null;
230
- }
231
-
232
- function parseHexIgnoreColor(hex) {
233
- if (hex.length === 3 || hex.length === 4) {
234
- const r = parseInt(hex[0] + hex[0], 16);
235
- const g = parseInt(hex[1] + hex[1], 16);
236
- const b = parseInt(hex[2] + hex[2], 16);
237
- const a = hex.length === 4 ? parseInt(hex[3] + hex[3], 16) / 255 : 1;
238
- return { r, g, b, a };
239
- }
240
- const r = parseInt(hex.slice(0, 2), 16);
241
- const g = parseInt(hex.slice(2, 4), 16);
242
- const b = parseInt(hex.slice(4, 6), 16);
243
- const a = hex.length === 8 ? parseInt(hex.slice(6, 8), 16) / 255 : 1;
244
- return { r, g, b, a };
245
- }
246
-
247
- function splitColorArgs(body) {
248
- const text = String(body || '').trim();
249
- if (!text) return [];
250
- if (text.includes(',')) {
251
- const parts = text.split(',').map((part) => part.trim()).filter(Boolean);
252
- const last = parts[parts.length - 1];
253
- if (last && last.includes('/')) {
254
- const split = last.split('/').map((part) => part.trim()).filter(Boolean);
255
- return [...parts.slice(0, -1), ...split];
256
- }
257
- return parts;
258
- }
259
- return text.replace(/\s*\/\s*/g, ' / ').split(/\s+/).filter((part) => part && part !== '/');
260
- }
261
-
262
- function parseRgbChannel(raw) {
263
- const text = String(raw || '').trim();
264
- const match = text.match(/^(-?\d*\.?\d+)(%)?$/);
265
- if (!match) return null;
266
- const value = Number.parseFloat(match[1]);
267
- if (!Number.isFinite(value)) return null;
268
- const scaled = match[2] ? value * 2.55 : value;
269
- if (scaled < 0 || scaled > 255) return null;
270
- return Math.round(scaled);
271
- }
272
-
273
- function parseAlphaChannel(raw) {
274
- const text = String(raw || '').trim();
275
- const match = text.match(/^(-?\d*\.?\d+)(%)?$/);
276
- if (!match) return null;
277
- const value = Number.parseFloat(match[1]);
278
- if (!Number.isFinite(value)) return null;
279
- const alpha = match[2] ? value / 100 : value;
280
- return alpha >= 0 && alpha <= 1 ? alpha : null;
281
- }
282
-
283
- function parseHueChannel(raw) {
284
- const text = String(raw || '').trim();
285
- const match = text.match(/^(-?\d*\.?\d+)(deg|rad|turn|grad)?$/);
286
- if (!match) return null;
287
- const value = Number.parseFloat(match[1]);
288
- if (!Number.isFinite(value)) return null;
289
- const unit = match[2] || 'deg';
290
- if (unit === 'turn') return value * 360;
291
- if (unit === 'rad') return value * (180 / Math.PI);
292
- if (unit === 'grad') return value * 0.9;
293
- return value;
294
- }
295
-
296
- function parsePercentChannel(raw) {
297
- const text = String(raw || '').trim();
298
- const match = text.match(/^(-?\d*\.?\d+)%$/);
299
- if (!match) return null;
300
- const value = Number.parseFloat(match[1]);
301
- if (!Number.isFinite(value)) return null;
302
- return value >= 0 && value <= 100 ? value / 100 : null;
303
- }
304
-
305
- function hslToRgb(hue, saturation, lightness, alpha) {
306
- const h = (((hue % 360) + 360) % 360) / 360;
307
- if (saturation === 0) {
308
- const gray = clampByte(Math.round(lightness * 255));
309
- return { r: gray, g: gray, b: gray, a: alpha };
310
- }
311
- const q = lightness < 0.5
312
- ? lightness * (1 + saturation)
313
- : lightness + saturation - lightness * saturation;
314
- const p = 2 * lightness - q;
315
- const toRgb = (t) => {
316
- let channel = t;
317
- if (channel < 0) channel += 1;
318
- if (channel > 1) channel -= 1;
319
- if (channel < 1 / 6) return p + (q - p) * 6 * channel;
320
- if (channel < 1 / 2) return q;
321
- if (channel < 2 / 3) return p + (q - p) * (2 / 3 - channel) * 6;
322
- return p;
323
- };
324
- return {
325
- r: clampByte(Math.round(toRgb(h + 1 / 3) * 255)),
326
- g: clampByte(Math.round(toRgb(h) * 255)),
327
- b: clampByte(Math.round(toRgb(h - 1 / 3) * 255)),
328
- a: alpha,
329
- };
330
- }
331
-
332
- function clampByte(value) {
333
- return Math.min(255, Math.max(0, value));
334
- }
335
-
336
- function ignoreValueMatches(rule, entryValue, findingValue) {
337
- if (entryValue === findingValue) return true;
338
- if (rule !== 'design-system-color') return false;
339
- const entryColor = colorIgnoreKey(entryValue);
340
- return Boolean(entryColor && entryColor === colorIgnoreKey(findingValue));
341
- }
342
-
343
- export function normalizeIgnoreValueEntries(entries) {
344
- if (!Array.isArray(entries)) return [];
345
- const out = [];
346
- for (const entry of entries) {
347
- if (!entry || typeof entry !== 'object') continue;
348
- const rule = normalizeIgnoreRule(entry.rule);
349
- const value = normalizeIgnoreValue(entry.value);
350
- if (!rule || !value) continue;
351
- const normalized = { rule, value };
352
- const files = uniqueStrings([
353
- ...(typeof entry.file === 'string' && entry.file.trim() ? [entry.file.trim()] : []),
354
- ...(Array.isArray(entry.files) ? entry.files.filter(v => typeof v === 'string' && v.trim()).map(v => v.trim()) : []),
355
- ]);
356
- if (files.length > 0) normalized.files = files;
357
- // Key order is rule, value, files, createdAt, reason and must stay that way:
358
- // normalizing runs on every write, so emitting a different order than the one
359
- // already on disk rewrites every untouched entry and churns the diff. Keep in
360
- // step with normalizeIgnoreValueEntries in skill/scripts/hook-lib.mjs.
361
- if (typeof entry.createdAt === 'string' && entry.createdAt.trim()) {
362
- normalized.createdAt = entry.createdAt.trim();
363
- }
364
- if (typeof entry.reason === 'string' && entry.reason.trim()) {
365
- normalized.reason = entry.reason.trim();
366
- }
367
- out.push(normalized);
368
- }
369
- return out;
370
- }
371
-
372
- function mergeIgnoreValues(existing, incoming) {
373
- const map = new Map();
374
- for (const entry of normalizeIgnoreValueEntries(existing)) {
375
- map.set(`${entry.rule}\0${entry.value}\0${ignoreValueFilesKey(entry.files)}`, entry);
376
- }
377
- for (const entry of normalizeIgnoreValueEntries(incoming)) {
378
- map.set(`${entry.rule}\0${entry.value}\0${ignoreValueFilesKey(entry.files)}`, entry);
379
- }
380
- return Array.from(map.values());
381
- }
382
-
383
- function ignoreValueFilesKey(files) {
384
- // Sort before joining: a scope is a set, so an entry already on disk in another
385
- // order must compare equal rather than dedup as two distinct entries.
386
- return Array.isArray(files) && files.length > 0 ? [...files].sort().join('\x1f') : '';
387
- }
388
-
389
- // Glob -> RegExp. Supports `**`, `*`, `?`, and `{a,b}` alternation.
390
- function globToRegex(glob) {
391
- let re = '^';
392
- let i = 0;
393
- while (i < glob.length) {
394
- const c = glob[i];
395
- if (c === '*') {
396
- if (glob[i + 1] === '*') {
397
- re += '.*';
398
- i += 2;
399
- if (glob[i] === '/') i += 1;
400
- } else {
401
- re += '[^/]*';
402
- i += 1;
403
- }
404
- } else if (c === '?') {
405
- re += '[^/]';
406
- i += 1;
407
- } else if (c === '{') {
408
- const end = glob.indexOf('}', i);
409
- if (end === -1) { re += '\\{'; i += 1; continue; }
410
- const parts = glob.slice(i + 1, end).split(',').map((p) => p.replace(/[.+^$()|[\]\\]/g, '\\$&'));
411
- re += `(?:${parts.join('|')})`;
412
- i = end + 1;
413
- } else if (/[.+^$()|[\]\\]/.test(c)) {
414
- re += `\\${c}`;
415
- i += 1;
416
- } else {
417
- re += c;
418
- i += 1;
419
- }
420
- }
421
- re += '$';
422
- return new RegExp(re);
423
- }
424
-
425
- export function matchesAnyGlob(filePath, globs) {
426
- if (!Array.isArray(globs) || globs.length === 0) return false;
427
- const normalized = String(filePath || '').split(sep).join('/');
428
- for (const glob of globs) {
429
- try {
430
- const re = globToRegex(String(glob));
431
- if (re.test(normalized)) return true;
432
- const base = normalized.split('/').pop();
433
- if (re.test(base)) return true;
434
- } catch {
435
- /* malformed glob, skip */
436
- }
437
- }
438
- return false;
439
- }
440
-
441
- export function shouldIgnoreDetectionFile(filePath, root, config) {
442
- const globs = config?.ignoreFiles || [];
443
- if (!Array.isArray(globs) || globs.length === 0) return false;
444
- const raw = String(filePath || '').trim();
445
- if (!raw) return false;
446
- if (matchesAnyGlob(raw, globs)) return true;
447
-
448
- try {
449
- const abs = isAbsolute(raw) ? raw : resolve(root, raw);
450
- if (matchesAnyGlob(abs, globs)) return true;
451
- const rel = relative(root, abs);
452
- if (rel && !rel.startsWith('..') && !isAbsolute(rel)) {
453
- return matchesAnyGlob(rel, globs);
454
- }
455
- } catch {
456
- /* ignore */
457
- }
458
- return false;
459
- }
460
-
461
- export function filterDetectionFindings(findings, config) {
462
- if (!Array.isArray(findings) || findings.length === 0) return [];
463
- const ignoreRules = new Set((config?.ignoreRules || []).map((rule) => normalizeIgnoreRule(rule)));
464
- const ignoreValues = normalizeIgnoreValueEntries(config?.ignoreValues || []);
465
- return findings.filter((finding) => {
466
- if (!finding || typeof finding !== 'object') return false;
467
- if (ignoreRules.has(normalizeIgnoreRule(finding.antipattern))) return false;
468
- if (isIgnoredFindingValue(finding, ignoreValues)) return false;
469
- return true;
470
- });
471
- }
472
-
473
- function isIgnoredFindingValue(finding, ignoreValues) {
474
- if (!Array.isArray(ignoreValues) || ignoreValues.length === 0) return false;
475
- const rule = normalizeIgnoreRule(finding.antipattern);
476
- if (!rule) return false;
477
- // File-scoped wildcards suppress rules with no extractable value, such as side-tab.
478
- const value = extractFindingIgnoreValue(finding);
479
- return ignoreValues.some((entry) => {
480
- if (entry.rule !== rule) return false;
481
- const wildcardValue = entry.value === '*';
482
- if (!wildcardValue && (!value || !ignoreValueMatches(rule, entry.value, value))) return false;
483
- if (!Array.isArray(entry.files) || entry.files.length === 0) return !wildcardValue;
484
- return findingMatchesScopedIgnoreFile(finding, entry.files);
485
- });
486
- }
487
-
488
- function findingMatchesScopedIgnoreFile(finding, globs) {
489
- const filePath = String(finding?.file || '').trim();
490
- if (!filePath) return false;
491
- if (matchesAnyGlob(filePath, globs)) return true;
492
-
493
- const normalized = filePath.split(sep).join('/');
494
- const parts = normalized.split('/').filter(Boolean);
495
- for (let i = 0; i < parts.length; i++) {
496
- const suffix = parts.slice(i).join('/');
497
- if (matchesAnyGlob(suffix, globs)) return true;
498
- }
499
- return false;
500
- }
501
-
502
- export function extractFindingIgnoreValue(finding) {
503
- if (!finding || typeof finding !== 'object') return '';
504
- const rule = normalizeIgnoreRule(finding.antipattern);
505
- const directValueRules = new Set([
506
- 'overused-font',
507
- 'bounce-easing',
508
- 'design-system-font',
509
- 'design-system-color',
510
- 'design-system-radius',
511
- 'design-system-font-size',
512
- ]);
513
- if (!directValueRules.has(rule)) return '';
514
- return normalizeIgnoreValue(extractFindingIgnoreValueRaw(finding, rule));
515
- }
516
-
517
- function extractFindingIgnoreValueRaw(finding, rule = normalizeIgnoreRule(finding?.antipattern)) {
518
- const direct = cleanIgnoreValueDisplay(finding.ignoreValue || finding.value || '');
519
- if (direct) return direct;
520
-
521
- const candidates = [finding.detail, finding.snippet].filter((v) => typeof v === 'string' && v);
522
- for (const text of candidates) {
523
- if (rule === 'bounce-easing') {
524
- const motion = extractMotionIgnoreValue(text);
525
- if (motion) return motion;
526
- continue;
527
- }
528
-
529
- const primary = text.match(/Primary font:\s*([^()\n;]+)/i);
530
- if (primary) return cleanIgnoreValueDisplay(primary[1]);
531
-
532
- const googleLabel = text.match(/Google Fonts:\s*([^()\n;]+)/i);
533
- if (googleLabel) return cleanIgnoreValueDisplay(googleLabel[1]);
534
-
535
- const family = text.match(/font-family\s*:\s*["']?([^'",;\n]+)/i);
536
- if (family) return cleanIgnoreValueDisplay(family[1]);
537
-
538
- const google = text.match(/[?&]family=([^&:;\n]+)/i);
539
- if (google) {
540
- try {
541
- return cleanIgnoreValueDisplay(decodeURIComponent(google[1]));
542
- } catch {
543
- return cleanIgnoreValueDisplay(google[1]);
544
- }
545
- }
546
- }
547
-
548
- return '';
549
- }
550
-
551
- function extractMotionIgnoreValue(text) {
552
- const tailwind = text.match(/\banimate-bounce\b/i);
553
- if (tailwind) return cleanIgnoreValueDisplay(tailwind[0]);
554
-
555
- const bezier = text.match(/cubic-bezier\([^)]+\)/i);
556
- if (bezier) return cleanIgnoreValueDisplay(bezier[0]);
557
-
558
- const animation = text.match(/animation(?:-name)?\s*:\s*([^;\n]+)/i);
559
- if (animation) {
560
- const token = animation[1]
561
- .split(/[,\s]+/)
562
- .find((part) => /bounce|elastic|wobble|jiggle|spring/i.test(part));
563
- if (token) return cleanIgnoreValueDisplay(token);
564
- }
565
-
566
- return '';
567
- }
568
-
569
- function cleanIgnoreValueDisplay(value) {
570
- return String(value || '')
571
- .trim()
572
- .replace(/^["']|["']$/g, '')
573
- .replace(/\+/g, ' ')
574
- .replace(/\s+/g, ' ');
575
- }
576
-
577
- /**
578
- * The recorded design-hook decision: 'accepted' | 'declined' | undefined.
579
- * config.local.json (per-developer) overrides config.json.
580
- */
581
- export function getHookConsent(root) {
582
- let consent;
583
- for (const filePath of [getConfigPath(root), getLocalConfigPath(root)]) {
584
- const hook = hookSection(safeReadJson(filePath));
585
- if (hook && (hook.consent === 'accepted' || hook.consent === 'declined')) consent = hook.consent;
586
- }
587
- return consent;
588
- }
589
-
590
- /**
591
- * Persist the per-developer decision to config.local.json, preserving any
592
- * sibling keys, and ensure the file is gitignored.
593
- */
594
- export function setHookConsent(root, value) {
595
- const filePath = getLocalConfigPath(root);
596
- const existing = safeReadJson(filePath) || {};
597
- const hook = hookSection(existing) || {};
598
- const next = { ...existing, hook: { ...hook, consent: value } };
599
- mkdirSync(dirname(filePath), { recursive: true });
600
- writeFileSync(filePath, `${JSON.stringify(next, null, 2)}\n`);
601
- ensureConfigGitExclude(root);
602
- return filePath;
603
- }
604
-
605
- const EXCLUDE_OPEN = '# impeccable-config-ignore-start';
606
- const EXCLUDE_CLOSE = '# impeccable-config-ignore-end';
607
- const EXCLUDE_PATTERNS = ['.impeccable/config.local.json'];
608
-
609
- /**
610
- * Add config.local.json to `.git/info/exclude` so a developer's decision is
611
- * never committed. Idempotent via marker comments. Best-effort; returns false
612
- * when there is no resolvable git dir.
613
- */
614
- export function ensureConfigGitExclude(root) {
615
- try {
616
- const gitDir = resolveGitDir(root);
617
- if (!gitDir) return false;
618
- const target = join(gitDir, 'info', 'exclude');
619
- const existing = existsSync(target) ? readFileSync(target, 'utf-8') : '';
620
- const block = [EXCLUDE_OPEN, ...EXCLUDE_PATTERNS, EXCLUDE_CLOSE].join('\n');
621
- const markerRe = new RegExp(`${escapeRegExp(EXCLUDE_OPEN)}[\\s\\S]*?${escapeRegExp(EXCLUDE_CLOSE)}`);
622
- let updated;
623
- if (markerRe.test(existing)) {
624
- updated = existing.replace(markerRe, block);
625
- } else {
626
- const prefix = existing.length === 0 ? '' : existing.endsWith('\n') ? existing : `${existing}\n`;
627
- updated = `${prefix}${block}\n`;
628
- }
629
- if (updated !== existing) {
630
- mkdirSync(dirname(target), { recursive: true });
631
- writeFileSync(target, updated);
632
- }
633
- return true;
634
- } catch {
635
- return false;
636
- }
637
- }
638
-
639
- function resolveGitDir(root) {
640
- const dotGit = join(root, '.git');
641
- if (!existsSync(dotGit)) return null;
642
- try {
643
- if (statSync(dotGit).isDirectory()) return dotGit;
644
- // A `.git` file (worktree/submodule) points elsewhere: "gitdir: <path>".
645
- const match = readFileSync(dotGit, 'utf-8').match(/gitdir:\s*(.+)/);
646
- if (match) {
647
- const resolved = match[1].trim();
648
- return isAbsolute(resolved) ? resolved : join(root, resolved);
649
- }
650
- } catch {
651
- /* fall through */
652
- }
653
- return null;
654
- }
655
-
656
- function escapeRegExp(value) {
657
- return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
658
- }