@luci-dev/skills 0.0.0-stage → 0.5.1

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 (389) hide show
  1. package/dist/benchmark.d.ts +48 -0
  2. package/dist/benchmark.d.ts.map +1 -0
  3. package/dist/benchmark.js +84 -0
  4. package/dist/benchmark.js.map +1 -0
  5. package/dist/discovery.d.ts +105 -0
  6. package/dist/discovery.d.ts.map +1 -0
  7. package/dist/discovery.js +271 -0
  8. package/dist/discovery.js.map +1 -0
  9. package/dist/drafts.d.ts +20 -0
  10. package/dist/drafts.d.ts.map +1 -0
  11. package/dist/drafts.js +57 -0
  12. package/dist/drafts.js.map +1 -0
  13. package/dist/github.d.ts +49 -0
  14. package/dist/github.d.ts.map +1 -0
  15. package/dist/github.js +93 -0
  16. package/dist/github.js.map +1 -0
  17. package/dist/import.d.ts +80 -0
  18. package/dist/import.d.ts.map +1 -0
  19. package/dist/import.js +286 -0
  20. package/dist/import.js.map +1 -0
  21. package/dist/index.d.ts +17 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +17 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/licenses.d.ts +30 -0
  26. package/dist/licenses.d.ts.map +1 -0
  27. package/dist/licenses.js +116 -0
  28. package/dist/licenses.js.map +1 -0
  29. package/dist/linter.d.ts +35 -0
  30. package/dist/linter.d.ts.map +1 -0
  31. package/dist/linter.js +262 -0
  32. package/dist/linter.js.map +1 -0
  33. package/dist/lss.d.ts +74 -0
  34. package/dist/lss.d.ts.map +1 -0
  35. package/dist/lss.js +273 -0
  36. package/dist/lss.js.map +1 -0
  37. package/dist/orchestrator.d.ts +164 -0
  38. package/dist/orchestrator.d.ts.map +1 -0
  39. package/dist/orchestrator.js +370 -0
  40. package/dist/orchestrator.js.map +1 -0
  41. package/dist/packs.d.ts +50 -0
  42. package/dist/packs.d.ts.map +1 -0
  43. package/dist/packs.js +166 -0
  44. package/dist/packs.js.map +1 -0
  45. package/dist/preferences.d.ts +18 -0
  46. package/dist/preferences.d.ts.map +1 -0
  47. package/dist/preferences.js +57 -0
  48. package/dist/preferences.js.map +1 -0
  49. package/dist/project.d.ts +45 -0
  50. package/dist/project.d.ts.map +1 -0
  51. package/dist/project.js +183 -0
  52. package/dist/project.js.map +1 -0
  53. package/dist/rankability.d.ts +51 -0
  54. package/dist/rankability.d.ts.map +1 -0
  55. package/dist/rankability.js +217 -0
  56. package/dist/rankability.js.map +1 -0
  57. package/dist/registry.d.ts +82 -0
  58. package/dist/registry.d.ts.map +1 -0
  59. package/dist/registry.js +300 -0
  60. package/dist/registry.js.map +1 -0
  61. package/dist/trust.d.ts +13 -0
  62. package/dist/trust.d.ts.map +1 -0
  63. package/dist/trust.js +41 -0
  64. package/dist/trust.js.map +1 -0
  65. package/dist/types.d.ts +44 -0
  66. package/dist/types.d.ts.map +1 -0
  67. package/dist/types.js +2 -0
  68. package/dist/types.js.map +1 -0
  69. package/library/3d/threejs/LICENSE.txt +21 -0
  70. package/library/3d/threejs/NOTICE.md +7 -0
  71. package/library/3d/threejs/SKILL.md +102 -0
  72. package/library/3d/threejs/luci.json +39 -0
  73. package/library/accessibility/accessibility-baseline/SKILL.md +51 -0
  74. package/library/accessibility/accessibility-baseline/luci.json +33 -0
  75. package/library/accessibility/fixing-accessibility/NOTICE.md +6 -0
  76. package/library/accessibility/fixing-accessibility/SKILL.md +141 -0
  77. package/library/accessibility/fixing-accessibility/luci.json +36 -0
  78. package/library/animation-motion/animation-systems/LICENSE.txt +21 -0
  79. package/library/animation-motion/animation-systems/NOTICE.md +7 -0
  80. package/library/animation-motion/animation-systems/SKILL.md +192 -0
  81. package/library/animation-motion/animation-systems/luci.json +32 -0
  82. package/library/animation-motion/animejs/SKILL.md +64 -0
  83. package/library/animation-motion/animejs/luci.json +12 -0
  84. package/library/animation-motion/motion-dev/SKILL.md +69 -0
  85. package/library/animation-motion/motion-dev/luci.json +13 -0
  86. package/library/animation-motion/react-view-transitions/AGENTS.md +1380 -0
  87. package/library/animation-motion/react-view-transitions/NOTICE.md +6 -0
  88. package/library/animation-motion/react-view-transitions/README.md +44 -0
  89. package/library/animation-motion/react-view-transitions/SKILL.md +334 -0
  90. package/library/animation-motion/react-view-transitions/luci.json +40 -0
  91. package/library/animation-motion/react-view-transitions/metadata.json +12 -0
  92. package/library/animation-motion/react-view-transitions/references/css-recipes.md +312 -0
  93. package/library/animation-motion/react-view-transitions/references/implementation.md +170 -0
  94. package/library/animation-motion/react-view-transitions/references/nextjs.md +233 -0
  95. package/library/animation-motion/react-view-transitions/references/patterns.md +274 -0
  96. package/library/animation-motion/react-view-transitions/references/troubleshooting.md +47 -0
  97. package/library/code-quality/code-review/NOTICE.md +6 -0
  98. package/library/code-quality/code-review/SKILL.md +94 -0
  99. package/library/code-quality/code-review/agents/openai.yaml +3 -0
  100. package/library/code-quality/code-review/luci.json +33 -0
  101. package/library/components/company-logos/LICENSE.txt +21 -0
  102. package/library/components/company-logos/NOTICE.md +7 -0
  103. package/library/components/company-logos/SKILL.md +27 -0
  104. package/library/components/company-logos/luci.json +38 -0
  105. package/library/components/container-lines/LICENSE.txt +21 -0
  106. package/library/components/container-lines/NOTICE.md +7 -0
  107. package/library/components/container-lines/SKILL.md +124 -0
  108. package/library/components/container-lines/luci.json +48 -0
  109. package/library/design-systems/build-design-system/NOTICE.md +6 -0
  110. package/library/design-systems/build-design-system/SKILL.md +78 -0
  111. package/library/design-systems/build-design-system/luci.json +29 -0
  112. package/library/design-systems/build-design-system/references/components.md +46 -0
  113. package/library/design-systems/build-design-system/references/glossary.md +77 -0
  114. package/library/design-systems/build-design-system/references/taste.md +37 -0
  115. package/library/design-systems/build-design-system/references/tokens.md +59 -0
  116. package/library/design-systems/build-design-system/references/traps.md +128 -0
  117. package/library/design-systems/build-design-system/scripts/capture-guard.mjs +470 -0
  118. package/library/design-systems/build-design-system/scripts/capture.mjs +355 -0
  119. package/library/design-systems/build-design-system/scripts/check-system.mjs +1883 -0
  120. package/library/design-systems/build-design-system/scripts/find-chromium.mjs +137 -0
  121. package/library/design-systems/build-design-system/scripts/oklch.mjs +221 -0
  122. package/library/design-systems/build-design-system/scripts/pixdiff.mjs +186 -0
  123. package/library/design-systems/component-docs/NOTICE.md +6 -0
  124. package/library/design-systems/component-docs/SKILL.md +50 -0
  125. package/library/design-systems/component-docs/luci.json +30 -0
  126. package/library/design-systems/component-docs/references/doc-format.md +85 -0
  127. package/library/design-systems/create-design-md/NOTICE.md +6 -0
  128. package/library/design-systems/create-design-md/SKILL.md +259 -0
  129. package/library/design-systems/create-design-md/luci.json +38 -0
  130. package/library/design-systems/design-system-boss/NOTICE.md +6 -0
  131. package/library/design-systems/design-system-boss/SKILL.md +58 -0
  132. package/library/design-systems/design-system-boss/luci.json +29 -0
  133. package/library/design-systems/design-system-boss/playbooks/build.md +10 -0
  134. package/library/design-systems/design-system-boss/playbooks/component.md +9 -0
  135. package/library/design-systems/design-system-boss/playbooks/migrate.md +11 -0
  136. package/library/design-systems/design-system-boss/playbooks/review.md +9 -0
  137. package/library/design-systems/migrate-design-system/NOTICE.md +6 -0
  138. package/library/design-systems/migrate-design-system/SKILL.md +62 -0
  139. package/library/design-systems/migrate-design-system/luci.json +33 -0
  140. package/library/design-systems/migrate-design-system/references/correct.md +37 -0
  141. package/library/design-systems/migrate-design-system/references/lessons.md +69 -0
  142. package/library/design-systems/migrate-design-system/references/parity.md +44 -0
  143. package/library/design-systems/migrate-design-system/references/running-many-agents.md +52 -0
  144. package/library/design-systems/migrate-design-system/scripts/bodies-check.mjs +215 -0
  145. package/library/design-systems/migrate-design-system/scripts/land.mjs +433 -0
  146. package/library/design-systems/migrate-design-system/scripts/legacy.mjs +283 -0
  147. package/library/design-systems/migrate-design-system/scripts/parity.mjs +173 -0
  148. package/library/design-systems/token-mapping/NOTICE.md +6 -0
  149. package/library/design-systems/token-mapping/SKILL.md +46 -0
  150. package/library/design-systems/token-mapping/luci.json +25 -0
  151. package/library/design-systems/token-mapping/references/mapping-rules.md +54 -0
  152. package/library/design-systems/ui-review/NOTICE.md +6 -0
  153. package/library/design-systems/ui-review/SKILL.md +53 -0
  154. package/library/design-systems/ui-review/luci.json +29 -0
  155. package/library/design-systems/ui-review/references/criteria.md +49 -0
  156. package/library/frontend/composition-patterns/AGENTS.md +946 -0
  157. package/library/frontend/composition-patterns/NOTICE.md +6 -0
  158. package/library/frontend/composition-patterns/README.md +60 -0
  159. package/library/frontend/composition-patterns/SKILL.md +86 -0
  160. package/library/frontend/composition-patterns/luci.json +33 -0
  161. package/library/frontend/composition-patterns/metadata.json +11 -0
  162. package/library/frontend/composition-patterns/rules/_sections.md +29 -0
  163. package/library/frontend/composition-patterns/rules/_template.md +24 -0
  164. package/library/frontend/composition-patterns/rules/architecture-avoid-boolean-props.md +100 -0
  165. package/library/frontend/composition-patterns/rules/architecture-compound-components.md +112 -0
  166. package/library/frontend/composition-patterns/rules/patterns-children-over-render-props.md +87 -0
  167. package/library/frontend/composition-patterns/rules/patterns-explicit-variants.md +100 -0
  168. package/library/frontend/composition-patterns/rules/react19-no-forwardref.md +42 -0
  169. package/library/frontend/composition-patterns/rules/state-context-interface.md +191 -0
  170. package/library/frontend/composition-patterns/rules/state-decouple-implementation.md +113 -0
  171. package/library/frontend/composition-patterns/rules/state-lift-state.md +125 -0
  172. package/library/frontend/design-mobile-apps/NOTICE.md +6 -0
  173. package/library/frontend/design-mobile-apps/SKILL.md +121 -0
  174. package/library/frontend/design-mobile-apps/designing.md +56 -0
  175. package/library/frontend/design-mobile-apps/endpoints.md +362 -0
  176. package/library/frontend/design-mobile-apps/implementing.md +213 -0
  177. package/library/frontend/design-mobile-apps/luci.json +31 -0
  178. package/library/frontend/design-mobile-apps/styling/nativewind.md +57 -0
  179. package/library/frontend/design-mobile-apps/styling/stylesheet.md +28 -0
  180. package/library/frontend/design-mobile-apps/styling/uniwind.md +38 -0
  181. package/library/frontend/frontend-design/LICENSE.txt +202 -0
  182. package/library/frontend/frontend-design/NOTICE.md +6 -0
  183. package/library/frontend/frontend-design/SKILL.md +81 -0
  184. package/library/frontend/frontend-design/luci.json +43 -0
  185. package/library/frontend/react-native-skills/AGENTS.md +2897 -0
  186. package/library/frontend/react-native-skills/NOTICE.md +6 -0
  187. package/library/frontend/react-native-skills/README.md +165 -0
  188. package/library/frontend/react-native-skills/SKILL.md +119 -0
  189. package/library/frontend/react-native-skills/luci.json +33 -0
  190. package/library/frontend/react-native-skills/metadata.json +16 -0
  191. package/library/frontend/react-native-skills/rules/_sections.md +86 -0
  192. package/library/frontend/react-native-skills/rules/_template.md +28 -0
  193. package/library/frontend/react-native-skills/rules/animation-derived-value.md +53 -0
  194. package/library/frontend/react-native-skills/rules/animation-gesture-detector-press.md +95 -0
  195. package/library/frontend/react-native-skills/rules/animation-gpu-properties.md +65 -0
  196. package/library/frontend/react-native-skills/rules/design-system-compound-components.md +66 -0
  197. package/library/frontend/react-native-skills/rules/fonts-config-plugin.md +71 -0
  198. package/library/frontend/react-native-skills/rules/imports-design-system-folder.md +68 -0
  199. package/library/frontend/react-native-skills/rules/js-hoist-intl.md +61 -0
  200. package/library/frontend/react-native-skills/rules/list-performance-callbacks.md +44 -0
  201. package/library/frontend/react-native-skills/rules/list-performance-function-references.md +132 -0
  202. package/library/frontend/react-native-skills/rules/list-performance-images.md +53 -0
  203. package/library/frontend/react-native-skills/rules/list-performance-inline-objects.md +97 -0
  204. package/library/frontend/react-native-skills/rules/list-performance-item-expensive.md +94 -0
  205. package/library/frontend/react-native-skills/rules/list-performance-item-memo.md +82 -0
  206. package/library/frontend/react-native-skills/rules/list-performance-item-types.md +104 -0
  207. package/library/frontend/react-native-skills/rules/list-performance-virtualize.md +67 -0
  208. package/library/frontend/react-native-skills/rules/monorepo-native-deps-in-app.md +46 -0
  209. package/library/frontend/react-native-skills/rules/monorepo-single-dependency-versions.md +63 -0
  210. package/library/frontend/react-native-skills/rules/navigation-native-navigators.md +188 -0
  211. package/library/frontend/react-native-skills/rules/react-compiler-destructure-functions.md +50 -0
  212. package/library/frontend/react-native-skills/rules/react-compiler-reanimated-shared-values.md +48 -0
  213. package/library/frontend/react-native-skills/rules/react-state-dispatcher.md +91 -0
  214. package/library/frontend/react-native-skills/rules/react-state-fallback.md +56 -0
  215. package/library/frontend/react-native-skills/rules/react-state-minimize.md +65 -0
  216. package/library/frontend/react-native-skills/rules/rendering-no-falsy-and.md +74 -0
  217. package/library/frontend/react-native-skills/rules/rendering-text-in-text-component.md +36 -0
  218. package/library/frontend/react-native-skills/rules/scroll-position-no-state.md +82 -0
  219. package/library/frontend/react-native-skills/rules/state-ground-truth.md +80 -0
  220. package/library/frontend/react-native-skills/rules/ui-expo-image.md +66 -0
  221. package/library/frontend/react-native-skills/rules/ui-image-gallery.md +104 -0
  222. package/library/frontend/react-native-skills/rules/ui-measure-views.md +78 -0
  223. package/library/frontend/react-native-skills/rules/ui-menus.md +174 -0
  224. package/library/frontend/react-native-skills/rules/ui-native-modals.md +77 -0
  225. package/library/frontend/react-native-skills/rules/ui-pressable.md +61 -0
  226. package/library/frontend/react-native-skills/rules/ui-safe-area-scroll.md +65 -0
  227. package/library/frontend/react-native-skills/rules/ui-scrollview-content-inset.md +45 -0
  228. package/library/frontend/react-native-skills/rules/ui-styling.md +87 -0
  229. package/library/frontend/tailwindcss/LICENSE.txt +21 -0
  230. package/library/frontend/tailwindcss/NOTICE.md +7 -0
  231. package/library/frontend/tailwindcss/SKILL.md +83 -0
  232. package/library/frontend/tailwindcss/luci.json +39 -0
  233. package/library/frontend-frameworks/react-best-practices/NOTICE.md +6 -0
  234. package/library/frontend-frameworks/react-best-practices/SKILL.md +151 -0
  235. package/library/frontend-frameworks/react-best-practices/luci.json +39 -0
  236. package/library/general/algorithmic-art/LICENSE.txt +202 -0
  237. package/library/general/algorithmic-art/NOTICE.md +6 -0
  238. package/library/general/algorithmic-art/SKILL.md +409 -0
  239. package/library/general/algorithmic-art/luci.json +27 -0
  240. package/library/general/algorithmic-art/templates/generator_template.js +223 -0
  241. package/library/general/algorithmic-art/templates/viewer.html +599 -0
  242. package/library/general/canvas-design/LICENSE.txt +202 -0
  243. package/library/general/canvas-design/NOTICE.md +6 -0
  244. package/library/general/canvas-design/SKILL.md +134 -0
  245. package/library/general/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -0
  246. package/library/general/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -0
  247. package/library/general/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -0
  248. package/library/general/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
  249. package/library/general/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -0
  250. package/library/general/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -0
  251. package/library/general/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -0
  252. package/library/general/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -0
  253. package/library/general/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -0
  254. package/library/general/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
  255. package/library/general/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
  256. package/library/general/canvas-design/canvas-fonts/Italiana-OFL.txt +93 -0
  257. package/library/general/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
  258. package/library/general/canvas-design/canvas-fonts/Jura-OFL.txt +93 -0
  259. package/library/general/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
  260. package/library/general/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
  261. package/library/general/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -0
  262. package/library/general/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
  263. package/library/general/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
  264. package/library/general/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -0
  265. package/library/general/canvas-design/canvas-fonts/PoiretOne-OFL.txt +93 -0
  266. package/library/general/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -0
  267. package/library/general/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -0
  268. package/library/general/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -0
  269. package/library/general/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
  270. package/library/general/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -0
  271. package/library/general/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
  272. package/library/general/canvas-design/luci.json +29 -0
  273. package/library/index.json +2507 -0
  274. package/library/interaction/animation-on-scroll/LICENSE.txt +21 -0
  275. package/library/interaction/animation-on-scroll/NOTICE.md +7 -0
  276. package/library/interaction/animation-on-scroll/SKILL.md +115 -0
  277. package/library/interaction/animation-on-scroll/luci.json +38 -0
  278. package/library/micro-interactions/masked-reveal/LICENSE.txt +21 -0
  279. package/library/micro-interactions/masked-reveal/NOTICE.md +7 -0
  280. package/library/micro-interactions/masked-reveal/SKILL.md +187 -0
  281. package/library/micro-interactions/masked-reveal/luci.json +63 -0
  282. package/library/micro-interactions/micro-interaction/NOTICE.md +6 -0
  283. package/library/micro-interactions/micro-interaction/SKILL.md +177 -0
  284. package/library/micro-interactions/micro-interaction/luci.json +52 -0
  285. package/library/micro-interactions/micro-interaction/references/css-recipes.md +142 -0
  286. package/library/micro-interactions/micro-interaction/references/framer-motion-recipes.md +187 -0
  287. package/library/micro-interactions/micro-interaction/scripts/README.md +42 -0
  288. package/library/micro-interactions/micro-interaction/scripts/contact-sheet.sh +17 -0
  289. package/library/micro-interactions/micro-interaction/scripts/seek-shot.sh +21 -0
  290. package/library/performance/fixing-motion-performance/NOTICE.md +6 -0
  291. package/library/performance/fixing-motion-performance/SKILL.md +156 -0
  292. package/library/performance/fixing-motion-performance/luci.json +30 -0
  293. package/library/seo/fixing-metadata/NOTICE.md +6 -0
  294. package/library/seo/fixing-metadata/SKILL.md +111 -0
  295. package/library/seo/fixing-metadata/luci.json +36 -0
  296. package/library/shadcn-ui/migrate-radix-to-base/NOTICE.md +6 -0
  297. package/library/shadcn-ui/migrate-radix-to-base/SKILL.md +178 -0
  298. package/library/shadcn-ui/migrate-radix-to-base/class-mapping.md +62 -0
  299. package/library/shadcn-ui/migrate-radix-to-base/consumer-props.md +58 -0
  300. package/library/shadcn-ui/migrate-radix-to-base/disclosure.md +353 -0
  301. package/library/shadcn-ui/migrate-radix-to-base/display-misc.md +410 -0
  302. package/library/shadcn-ui/migrate-radix-to-base/form-controls.md +390 -0
  303. package/library/shadcn-ui/migrate-radix-to-base/luci.json +33 -0
  304. package/library/shadcn-ui/migrate-radix-to-base/menus.md +409 -0
  305. package/library/shadcn-ui/migrate-radix-to-base/overlays.md +459 -0
  306. package/library/shadcn-ui/migrate-radix-to-base/universal-patterns.md +286 -0
  307. package/library/shadcn-ui/migrate-radix-to-base/wrapper-shapes.md +110 -0
  308. package/library/shadcn-ui/shadcn/NOTICE.md +6 -0
  309. package/library/shadcn-ui/shadcn/SKILL.md +187 -0
  310. package/library/shadcn-ui/shadcn/agents/openai.yml +5 -0
  311. package/library/shadcn-ui/shadcn/assets/shadcn-small.png +0 -0
  312. package/library/shadcn-ui/shadcn/assets/shadcn.png +0 -0
  313. package/library/shadcn-ui/shadcn/assets/showcase/color-pair.tsx +126 -0
  314. package/library/shadcn-ui/shadcn/assets/showcase/preview-states.css +14 -0
  315. package/library/shadcn-ui/shadcn/assets/showcase/state-matrix.tsx +72 -0
  316. package/library/shadcn-ui/shadcn/cli.md +290 -0
  317. package/library/shadcn-ui/shadcn/customization.md +211 -0
  318. package/library/shadcn-ui/shadcn/design-system-page.md +268 -0
  319. package/library/shadcn-ui/shadcn/design-system.md +386 -0
  320. package/library/shadcn-ui/shadcn/evals/evals.json +126 -0
  321. package/library/shadcn-ui/shadcn/luci.json +34 -0
  322. package/library/shadcn-ui/shadcn/mcp.md +105 -0
  323. package/library/shadcn-ui/shadcn/references/updating-components.md +91 -0
  324. package/library/shadcn-ui/shadcn/references/workflow.md +31 -0
  325. package/library/shadcn-ui/shadcn/registry.md +277 -0
  326. package/library/shadcn-ui/shadcn/rules/base-vs-radix.md +306 -0
  327. package/library/shadcn-ui/shadcn/rules/chat.md +507 -0
  328. package/library/shadcn-ui/shadcn/rules/composition.md +213 -0
  329. package/library/shadcn-ui/shadcn/rules/forms.md +192 -0
  330. package/library/shadcn-ui/shadcn/rules/icons.md +101 -0
  331. package/library/shadcn-ui/shadcn/rules/styling.md +185 -0
  332. package/library/shadcn-ui/shadcn/scripts/showcase-coverage.mjs +53 -0
  333. package/library/systems/baseline-ui/NOTICE.md +6 -0
  334. package/library/systems/baseline-ui/SKILL.md +90 -0
  335. package/library/systems/baseline-ui/luci.json +35 -0
  336. package/library/testing/tdd/NOTICE.md +6 -0
  337. package/library/testing/tdd/SKILL.md +43 -0
  338. package/library/testing/tdd/agents/openai.yaml +3 -0
  339. package/library/testing/tdd/luci.json +29 -0
  340. package/library/testing/tdd/mocking.md +59 -0
  341. package/library/testing/tdd/tests.md +77 -0
  342. package/library/testing/webapp-testing/LICENSE.txt +202 -0
  343. package/library/testing/webapp-testing/NOTICE.md +6 -0
  344. package/library/testing/webapp-testing/SKILL.md +100 -0
  345. package/library/testing/webapp-testing/examples/console_logging.py +35 -0
  346. package/library/testing/webapp-testing/examples/element_discovery.py +40 -0
  347. package/library/testing/webapp-testing/examples/static_html_automation.py +33 -0
  348. package/library/testing/webapp-testing/luci.json +33 -0
  349. package/library/testing/webapp-testing/scripts/with_server.py +106 -0
  350. package/library/ui-ux/improve-ui/NOTICE.md +6 -0
  351. package/library/ui-ux/improve-ui/SKILL.md +127 -0
  352. package/library/ui-ux/improve-ui/agents/openai.yaml +13 -0
  353. package/library/ui-ux/improve-ui/luci.json +47 -0
  354. package/library/ui-ux/improve-ui/references/plan-template.md +55 -0
  355. package/library/ui-ux/landing-page/LICENSE.txt +21 -0
  356. package/library/ui-ux/landing-page/NOTICE.md +7 -0
  357. package/library/ui-ux/landing-page/SKILL.md +213 -0
  358. package/library/ui-ux/landing-page/luci.json +47 -0
  359. package/library/ui-ux/pricing-page/LICENSE.txt +21 -0
  360. package/library/ui-ux/pricing-page/NOTICE.md +7 -0
  361. package/library/ui-ux/pricing-page/SKILL.md +217 -0
  362. package/library/ui-ux/pricing-page/luci.json +47 -0
  363. package/library/ui-ux/prototype/LOGIC.md +67 -0
  364. package/library/ui-ux/prototype/NOTICE.md +6 -0
  365. package/library/ui-ux/prototype/SKILL.md +31 -0
  366. package/library/ui-ux/prototype/UI.md +112 -0
  367. package/library/ui-ux/prototype/agents/openai.yaml +3 -0
  368. package/library/ui-ux/prototype/luci.json +33 -0
  369. package/library/ui-ux/theme-factory/LICENSE.txt +202 -0
  370. package/library/ui-ux/theme-factory/NOTICE.md +6 -0
  371. package/library/ui-ux/theme-factory/SKILL.md +62 -0
  372. package/library/ui-ux/theme-factory/luci.json +35 -0
  373. package/library/ui-ux/theme-factory/themes/arctic-frost.md +19 -0
  374. package/library/ui-ux/theme-factory/themes/botanical-garden.md +19 -0
  375. package/library/ui-ux/theme-factory/themes/desert-rose.md +19 -0
  376. package/library/ui-ux/theme-factory/themes/forest-canopy.md +19 -0
  377. package/library/ui-ux/theme-factory/themes/golden-hour.md +19 -0
  378. package/library/ui-ux/theme-factory/themes/midnight-galaxy.md +19 -0
  379. package/library/ui-ux/theme-factory/themes/modern-minimalist.md +19 -0
  380. package/library/ui-ux/theme-factory/themes/ocean-depths.md +19 -0
  381. package/library/ui-ux/theme-factory/themes/sunset-boulevard.md +19 -0
  382. package/library/ui-ux/theme-factory/themes/tech-innovation.md +19 -0
  383. package/package.json +21 -3
  384. package/packs/design-system-build.json +10 -0
  385. package/packs/design-system.json +16 -0
  386. package/packs/marketing.json +11 -0
  387. package/packs/motion.json +12 -0
  388. package/packs/ui.json +13 -0
  389. package/README.md +0 -3
@@ -0,0 +1,433 @@
1
+ #!/usr/bin/env node
2
+ // land.mjs: commit the named paths and nothing else, in a checkout other workers share. Node 18+, git 2.20+, no dependencies.
3
+ import { spawnSync, execFileSync } from "node:child_process";
4
+ import { appendFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync, chmodSync } from "node:fs";
5
+ import { tmpdir } from "node:os";
6
+ import { dirname, isAbsolute, join, relative, resolve } from "node:path";
7
+ import { fileURLToPath } from "node:url";
8
+
9
+ const SELF = fileURLToPath(import.meta.url);
10
+
11
+ const HELP = `land.mjs <surface> <subject> [flags] -- <paths...>
12
+ land.mjs --check-commit <sha> -- <paths...>
13
+ land.mjs --self-test | --help
14
+
15
+ Commits the working-tree state of the named paths and nothing else. Name exact files, because a folder takes everything
16
+ under it, other workers' dirty files included.
17
+ 1. Refuses a detached HEAD, the default branch (origin's HEAD, else init.defaultBranch, else main and master) and
18
+ the branch the run started on (--start-branch, else the first line of .design-system/start-branch).
19
+ 2. Takes a lock (a mkdir lock inside .git; a lock whose process died is taken over).
20
+ 3. Builds the commit in a private index seeded from HEAD, so a stale shared index cannot reach it.
21
+ 4. Refuses when write lines (mutate(, mutateAsync(, onSubmit, execute(, useMutation, non-GET fetch) were added,
22
+ removed or moved and --bodies-check does not pass. Decide the tier by this diff, not by a row label. Exit 0
23
+ passes. Exit 1 with "DIFF <proc>" lines (bodies-check.mjs) passes only when every DIFF procedure has an
24
+ intended change row: a line of the --intended file holding "intended change", the surface id and the
25
+ procedure. Any other exit, or a DIFF no row explains, refuses.
26
+ 5. Refuses when a changed row in an --also file (a ratchet, baseline or list file every worker shares) names a
27
+ file outside the named paths, so a file recomputed over a folder cannot carry others' rows. In a .json file
28
+ a row is a key path to a leaf, or one array element. In any other file a row is a line.
29
+ 6. Refuses when an added comment reads like a working note (worker, verifier, verdict, gate, run folder),
30
+ or when the message carries a process trailer (Verdict:, Verifier:, Worker:, Fingerprint:, Sha256:).
31
+ 7. Commits (git hooks run), asserts the commit's file list lies inside the named paths, resets only those
32
+ paths in the shared index, prints "committed <sha>" and then the file list as the last output.
33
+
34
+ Hooks run by default. A pre-commit hook can format or stage files outside the named set (step 7 then exits 3 and
35
+ prints the undo), rewrite files a worker still edits, or run for minutes while the lock is held. Read the repo's
36
+ hooks (.git/hooks, core.hooksPath, a husky or lefthook config) before the first landing. --no-verify skips them
37
+ only when the person allowed it, and prints a WARN line the report repeats.
38
+
39
+ Flags
40
+ --body <file> commit body, product text only
41
+ --also <path> a shared file to include, repeatable. Recompute it for your own files only (step 5)
42
+ --bodies-check "<cmd>" exits 0 when valid request-body evidence is on file (env LAND_BODIES_CHECK). SURFACE is set
43
+ --intended <file> the file of intended change rows. Default .design-system/decisions.tsv
44
+ --start-branch <name> the branch the run started on, refused as a target (step 1)
45
+ --trailer "<line>" attribution line from your session, repeatable. Nothing is added on its own
46
+ --run-log <file> append "time, surface, sha" as TSV here, never to the message
47
+ --allow-notes skip the working-note scan (report that you did)
48
+ --no-verify skip git hooks, only with the person's go-ahead. Prints a WARN line
49
+ --lock-wait <seconds> default 600
50
+ --dry-run stage in the private index, print the file list and any write lines, commit nothing
51
+
52
+ Exit 0 landed 1 failure 2 bad arguments or unsafe path 3 commit touches files outside the set
53
+ 4 write lines changed, no valid bodies 5 working note in added code 6 process trailer in message
54
+ 7 lock wait timed out 8 a shared file names paths outside the set 9 nothing to commit
55
+ 10 the branch is detached, the default branch or the branch the run started on
56
+ Never kill a git child of this script mid-write. If git hangs, report it and wait.`;
57
+
58
+ class Exit extends Error {
59
+ constructor(code, msg) { super(msg); this.code = code; }
60
+ }
61
+ const die = (code, msg) => { throw new Exit(code, msg); };
62
+
63
+ const WRITE_RE = /\b(mutate|mutateAsync|execute|useMutation)\s*\(|\bonSubmit\b|\bfetch\s*\([^)]*method\s*:\s*["'`](POST|PUT|PATCH|DELETE)/i;
64
+ const NOTE_RE = /\b(worker|verifier|verdict|run folder|parity (run|table)|baseline capture|wave \d+)\b|\bgate\b/i;
65
+ const PATH_RE = /(?:[\w@.-]+\/)+[\w@-][\w@.-]*\.[A-Za-z0-9]+/g;
66
+ const COMMENT_RE = /^\s*(\/\/|\/\*|\*|#|\{\/\*|<!--)/;
67
+ const TRAILER_RE = /^\s*(verdict|verifier|worker|fingerprint|sha256|checksum)\s*[:=]/im;
68
+
69
+ const git = (args, o = {}) => execFileSync("git", args, { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], maxBuffer: 256 << 20, ...o });
70
+
71
+ function parse(argv) {
72
+ const o = { pos: [], paths: [], also: [], trailers: [], lockWait: 600 };
73
+ let dd = false;
74
+ for (let i = 0; i < argv.length; i++) {
75
+ const a = argv[i];
76
+ if (dd) { o.paths.push(a); continue; }
77
+ const next = () => { if (i + 1 >= argv.length) die(2, `${a} needs a value`); return argv[++i]; };
78
+ if (a === "--") dd = true;
79
+ else if (a === "--help" || a === "-h") o.help = true;
80
+ else if (a === "--self-test") o.selfTest = true;
81
+ else if (a === "--body") o.body = next();
82
+ else if (a === "--also") o.also.push(next());
83
+ else if (a === "--bodies-check") o.bodiesCheck = next();
84
+ else if (a === "--trailer") o.trailers.push(next());
85
+ else if (a === "--run-log") o.runLog = next();
86
+ else if (a === "--intended") o.intended = next();
87
+ else if (a === "--start-branch") o.startBranch = next();
88
+ else if (a === "--lock-wait") o.lockWait = Number(next());
89
+ else if (a === "--check-commit") o.checkCommit = next();
90
+ else if (a === "--allow-notes") o.allowNotes = true;
91
+ else if (a === "--no-verify") o.noVerify = true;
92
+ else if (a === "--dry-run") o.dry = true;
93
+ else if (a.startsWith("-")) die(2, `unknown flag ${a} (see --help)`);
94
+ else o.pos.push(a);
95
+ }
96
+ return o;
97
+ }
98
+
99
+ function normalize(paths, root) {
100
+ return paths.map((p) => {
101
+ if (!p || [".", "./", "*", "**", ":/"].includes(p) || p.startsWith("..") || p.includes("/../")) die(2, `refusing path '${p}': name exact files or folders`);
102
+ const rel = relative(root, isAbsolute(p) ? p : resolve(process.cwd(), p)).split("\\").join("/");
103
+ if (!rel || rel.startsWith("..")) die(2, `path '${p}' is outside the repository`);
104
+ return rel.replace(/\/$/, "");
105
+ });
106
+ }
107
+
108
+ const inSet = (f, set) => set.some((p) => f === p || f.startsWith(p + "/"));
109
+ const commitFiles = (sha) => git(["diff-tree", "--no-commit-id", "--name-only", "-r", "--no-renames", "--root", sha]).split("\n").filter(Boolean);
110
+
111
+ function assertFiles(sha, set) {
112
+ const files = commitFiles(sha);
113
+ const stray = files.filter((f) => !inSet(f, set));
114
+ if (stray.length) {
115
+ const short = git(["rev-parse", "--short", sha]).trim();
116
+ die(3, `commit ${short} touches files outside the named set: ${stray.join(" ")}\nundo with: git revert --no-commit ${short} then restore the intended files`);
117
+ }
118
+ return files;
119
+ }
120
+
121
+ function pidAlive(pid) {
122
+ try { process.kill(pid, 0); return true; } catch (e) { return e.code === "EPERM"; }
123
+ }
124
+
125
+ async function lock(wait) {
126
+ const dir = join(resolve(git(["rev-parse", "--git-common-dir"]).trim()), "land.lock");
127
+ const until = Date.now() + wait * 1000;
128
+ for (;;) {
129
+ try { mkdirSync(dir); break; } catch (e) {
130
+ if (e.code !== "EEXIST") throw e;
131
+ let holder = 0;
132
+ try { holder = Number(readFileSync(join(dir, "pid"), "utf8")); } catch { /* holder is between mkdir and writing its pid */ }
133
+ if (holder && !pidAlive(holder)) { console.error(`land.mjs: taking over a lock whose holder ${holder} is gone`); rmSync(dir, { recursive: true, force: true }); continue; }
134
+ if (Date.now() > until) die(7, `lock ${dir} still held by pid ${holder || "unknown"}; do not delete it while that process runs`);
135
+ await new Promise((r) => setTimeout(r, 200));
136
+ }
137
+ }
138
+ writeFileSync(join(dir, "pid"), String(process.pid));
139
+ const release = () => rmSync(dir, { recursive: true, force: true });
140
+ process.on("exit", release);
141
+ for (const s of ["SIGINT", "SIGTERM"]) process.on(s, () => { release(); process.exit(130); });
142
+ }
143
+
144
+ function jsonRows(text) {
145
+ const rows = new Set();
146
+ const walk = (v, keys) => {
147
+ if (Array.isArray(v)) for (const x of v) rows.add([...keys, JSON.stringify(x)].join("\n"));
148
+ else if (v && typeof v === "object") for (const [k, x] of Object.entries(v)) walk(x, [...keys, k]);
149
+ else rows.add([...keys, JSON.stringify(v)].join("\n"));
150
+ };
151
+ walk(JSON.parse(text), []);
152
+ return rows;
153
+ }
154
+
155
+ function changedRows(shared, env) {
156
+ if (shared.endsWith(".json")) {
157
+ const show = (rev) => { const r = spawnSync("git", ["show", `${rev}:${shared}`], { env, encoding: "utf8", maxBuffer: 256 << 20 }); return r.status === 0 ? r.stdout : "{}"; };
158
+ try {
159
+ const [a, b] = [jsonRows(show("HEAD")), jsonRows(show(""))];
160
+ return [...a, ...b].filter((row) => !(a.has(row) && b.has(row)));
161
+ } catch { /* one side is not valid JSON: compare lines */ }
162
+ }
163
+ return git(["diff-index", "--cached", "-p", "--no-color", "-U0", "HEAD", "--", shared], { env }).split("\n").filter((l) => /^[+-](?![+-]{2} )/.test(l));
164
+ }
165
+
166
+ function scanDiff(diff) {
167
+ const writes = [];
168
+ const notes = [];
169
+ let file = "";
170
+ for (const line of diff.split("\n")) {
171
+ if (line.startsWith("+++ ")) { file = line.slice(4).replace(/^b\//, ""); continue; }
172
+ if (line.startsWith("--- ") || (!line.startsWith("+") && !line.startsWith("-"))) continue;
173
+ const text = line.slice(1);
174
+ if (WRITE_RE.test(text)) writes.push(`${file}: ${line.slice(0, 120)}`);
175
+ if (line.startsWith("+") && COMMENT_RE.test(text) && NOTE_RE.test(text)) notes.push(`${file}: ${line.slice(0, 120)}`);
176
+ }
177
+ return { writes, notes };
178
+ }
179
+
180
+ // The default branch: origin's HEAD, else init.defaultBranch, else main and master.
181
+ function defaultBranches() {
182
+ const r = spawnSync("git", ["symbolic-ref", "--short", "-q", "refs/remotes/origin/HEAD"], { encoding: "utf8" });
183
+ if (r.status === 0 && r.stdout.trim()) return [r.stdout.trim().replace(/^origin\//, "")];
184
+ const c = spawnSync("git", ["config", "--get", "init.defaultBranch"], { encoding: "utf8" });
185
+ return c.status === 0 && c.stdout.trim() ? [c.stdout.trim()] : ["main", "master"];
186
+ }
187
+
188
+ function guardBranch(o, root) {
189
+ const r = spawnSync("git", ["symbolic-ref", "--short", "-q", "HEAD"], { encoding: "utf8" });
190
+ const branch = r.status === 0 ? r.stdout.trim() : "";
191
+ if (!branch) die(10, "HEAD is detached. Check out the run branch first");
192
+ if (defaultBranches().includes(branch)) die(10, `refusing to land on ${branch}, the default branch. Cut the run branch and land there`);
193
+ const file = join(root, ".design-system/start-branch");
194
+ const start = o.startBranch || (existsSync(file) ? readFileSync(file, "utf8").split("\n")[0].trim() : "");
195
+ if (start && start === branch) die(10, `refusing to land on ${branch}, the branch the run started on. Cut the run branch and land there`);
196
+ return branch;
197
+ }
198
+
199
+ // Every DIFF procedure needs a row holding "intended change", the surface id and the procedure name.
200
+ export function explainDiffs(output, surface, rowsText) {
201
+ const diffs = [...String(output).matchAll(/^DIFF\s+(\S+)/gm)].map((m) => m[1]);
202
+ const rows = String(rowsText || "").split("\n").filter((l) => /intended change/i.test(l));
203
+ const has = (row, word) => new RegExp(`(^|[^\\w/.-])${word.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}($|[^\\w/.-])`).test(row);
204
+ const explained = diffs.map((p) => ({ proc: p, row: rows.find((row) => has(row, surface) && has(row, p)) }));
205
+ return { diffs, explained: explained.filter((e) => e.row), unexplained: explained.filter((e) => !e.row).map((e) => e.proc) };
206
+ }
207
+
208
+ export async function land(o) {
209
+ const root = git(["rev-parse", "--show-toplevel"]).trim();
210
+ if (o.checkCommit) { assertFiles(o.checkCommit, normalize(o.paths, root)); return; }
211
+ guardBranch(o, root);
212
+ if (o.pos.length !== 2) die(2, "expected <surface> <subject> -- <paths...> (see --help)");
213
+ const [surface, subject] = o.pos;
214
+ if (!o.paths.length) die(2, "no paths after --");
215
+ const set = normalize([...o.paths, ...o.also], root);
216
+ const body = o.body ? (existsSync(o.body) ? readFileSync(o.body, "utf8").trim() : die(2, `body file ${o.body} not found`)) : "";
217
+ const message = [subject, body, o.trailers.join("\n")].filter(Boolean).join("\n\n") + "\n";
218
+ if (TRAILER_RE.test(message)) die(6, "the message carries a process trailer. Verdicts, ids and checksums go to --run-log, not into a commit");
219
+
220
+ process.chdir(root);
221
+ await lock(o.lockWait);
222
+ const tmp = mkdtempSync(join(tmpdir(), "land-"));
223
+ const idx = join(tmp, "index");
224
+ const env = { ...process.env, GIT_INDEX_FILE: idx };
225
+ try {
226
+ git(["read-tree", "HEAD"], { env });
227
+ git(["add", "-A", "--", ...set], { env });
228
+ if (spawnSync("git", ["diff-index", "--cached", "--quiet", "HEAD", "--"], { env }).status === 0) die(9, `nothing to commit for ${set.join(" ")}`);
229
+ const own = normalize(o.paths, root);
230
+ for (const shared of normalize(o.also, root)) {
231
+ const foreign = [...new Set(changedRows(shared, env).flatMap((l) => l.match(PATH_RE) || []))].filter((f) => f !== shared && !inSet(f, own));
232
+ if (foreign.length) die(8, `${shared} changes rows for files outside this landing: ${foreign.join(" ")}. Recompute it for your own files only`);
233
+ }
234
+
235
+ const { writes, notes } = scanDiff(git(["diff-index", "--cached", "-p", "--no-color", "--no-ext-diff", "-U0", "HEAD", "--"], { env }));
236
+ if (writes.length) {
237
+ console.error(`write lines changed in this surface:\n${writes.join("\n")}`);
238
+ const cmd = o.bodiesCheck || process.env.LAND_BODIES_CHECK;
239
+ if (!cmd) die(4, "write lines changed and no --bodies-check is set. Nothing was committed");
240
+ const b = spawnSync("sh", ["-c", cmd], { encoding: "utf8", stdio: ["ignore", "pipe", "inherit"], env: { ...process.env, SURFACE: surface } });
241
+ if (b.stdout) process.stderr.write(b.stdout);
242
+ if (b.status === 1) {
243
+ const file = resolve(root, o.intended || ".design-system/decisions.tsv");
244
+ const { diffs, explained, unexplained } = explainDiffs(b.stdout, surface, existsSync(file) ? readFileSync(file, "utf8") : "");
245
+ if (!diffs.length) die(4, "the bodies check exited 1 with no DIFF line, so the body evidence is not valid. Nothing was committed");
246
+ if (unexplained.length) die(4, `request bodies differ for ${unexplained.join(", ")} and no intended change row in ${relative(root, file)} names surface ${surface} and that procedure. Nothing was committed`);
247
+ for (const e of explained) console.error(`land.mjs: DIFF ${e.proc} lands as an intended change: ${e.row.trim().slice(0, 160)}`);
248
+ } else if (b.status !== 0) die(4, "the bodies check failed, so the body evidence is not valid. Nothing was committed");
249
+ }
250
+ if (notes.length && !o.allowNotes) die(5, `added comments read like working notes. Describe the product, not the process:\n${notes.join("\n")}`);
251
+
252
+ if (o.dry) { console.log("dry run, would commit:\n" + git(["diff-index", "--cached", "--name-only", "--no-renames", "HEAD", "--"], { env }).trim()); return; }
253
+
254
+ if (o.noVerify) console.error("land.mjs: WARN --no-verify: the repo's git hooks did not run on this commit. Say so in the report");
255
+ const msg = join(tmp, "message");
256
+ writeFileSync(msg, message);
257
+ const before = git(["rev-parse", "HEAD"]).trim();
258
+ const c = spawnSync("git", ["commit", "-q", ...(o.noVerify ? ["--no-verify"] : []), "-F", msg], { env, encoding: "utf8" });
259
+ if (c.status !== 0) die(1, `git commit failed, nothing landed\n${c.stderr || c.stdout}`);
260
+ const sha = git(["rev-parse", "HEAD"]).trim();
261
+ if (sha === before) die(1, "HEAD did not move");
262
+ const files = assertFiles(sha, set);
263
+
264
+ const reset = spawnSync("git", ["reset", "-q", "--", ...set], { encoding: "utf8" });
265
+ if (reset.status !== 0) console.error(`WARN could not reset the shared index (an index.lock may be left by a killed git). Report it and wait. ${reset.stderr.trim()}`);
266
+ if (o.runLog) { mkdirSync(dirname(resolve(o.runLog)), { recursive: true }); appendFileSync(o.runLog, `${new Date().toISOString()}\t${surface}\t${sha}\n`); }
267
+ console.log(`committed ${sha}`);
268
+ console.log(files.join("\n"));
269
+ } finally {
270
+ rmSync(tmp, { recursive: true, force: true });
271
+ }
272
+ }
273
+
274
+ // ---------------------------------------------------------------- self-test
275
+ function selfTest() {
276
+ const base = mkdtempSync(join(tmpdir(), "land-st-"));
277
+ const env = { ...process.env, GIT_CONFIG_GLOBAL: "/dev/null", GIT_CONFIG_SYSTEM: "/dev/null", GIT_AUTHOR_NAME: "T", GIT_AUTHOR_EMAIL: "t@t", GIT_COMMITTER_NAME: "T", GIT_COMMITTER_EMAIL: "t@t" };
278
+ delete env.GIT_INDEX_FILE;
279
+ let fails = 0;
280
+ const check = (name, got, want) => { if (got === want) console.log(`ok ${name}`); else { fails++; console.log(`FAIL ${name} (got ${JSON.stringify(got)}, want ${JSON.stringify(want)})`); } };
281
+ const sh = (cwd, ...a) => execFileSync("git", a, { cwd, env, encoding: "utf8" }).trim();
282
+ const run = (cwd, ...a) => spawnSync(process.execPath, [SELF, ...a], { cwd, env, encoding: "utf8" });
283
+ let n = 0;
284
+ const mk = () => {
285
+ const d = join(base, `r${++n}`);
286
+ mkdirSync(d);
287
+ sh(d, "init", "-q");
288
+ sh(d, "symbolic-ref", "HEAD", "refs/heads/main");
289
+ writeFileSync(join(d, "route.txt"), "route v1\n");
290
+ writeFileSync(join(d, "other.txt"), "other v1\n");
291
+ sh(d, "add", "-A");
292
+ sh(d, "commit", "-q", "-m", "init");
293
+ sh(d, "switch", "-q", "-c", "run");
294
+ return d;
295
+ };
296
+ const w = (d, f, t) => { mkdirSync(dirname(join(d, f)), { recursive: true }); writeFileSync(join(d, f), t); };
297
+ const count = (d) => Number(sh(d, "rev-list", "--count", "HEAD"));
298
+
299
+ let r = mk();
300
+ w(r, "route.txt", "route v2\n"); w(r, "other.txt", "other dirty\n");
301
+ let p = run(r, "s1", "Move route", "--", "route.txt");
302
+ check("basic: last line is the file", p.stdout.trim().split("\n").pop(), "route.txt");
303
+ check("basic: foreign dirty file stays dirty", sh(r, "status", "--porcelain"), "M other.txt");
304
+ check("basic: shared index has no leftover", sh(r, "diff", "--cached", "--name-only"), "");
305
+
306
+ r = mk();
307
+ const stale = sh(r, "rev-parse", "HEAD:route.txt");
308
+ w(r, "route.txt", "route v2\n"); sh(r, "add", "route.txt"); sh(r, "commit", "-q", "-m", "landed v2");
309
+ sh(r, "update-index", "--cacheinfo", `100644,${stale},route.txt`);
310
+ w(r, "other.txt", "other v2\n");
311
+ run(r, "s2", "Land other", "--", "other.txt");
312
+ check("stale shared index: commit lists only other.txt", sh(r, "show", "--name-only", "--format=", "HEAD"), "other.txt");
313
+ check("stale shared index: landed route is still v2", sh(r, "show", "HEAD:route.txt"), "route v2");
314
+
315
+ // land.mjs once committed on whatever branch was checked out, the default branch included.
316
+ r = mk();
317
+ w(r, "route.txt", "route v2\n");
318
+ sh(r, "switch", "-q", "main");
319
+ check("the default branch is refused: exit 10", run(r, "s0", "Route", "--", "route.txt").status, 10);
320
+ sh(r, "switch", "-q", "-c", "dev");
321
+ w(r, ".design-system/start-branch", "dev\n");
322
+ check("the recorded start branch is refused: exit 10", run(r, "s0", "Route", "--", "route.txt").status, 10);
323
+ check("--start-branch names it too: exit 10", run(r, "s0", "Route", "--start-branch", "dev", "--", "route.txt").status, 10);
324
+ sh(r, "switch", "-q", "run");
325
+ check("the run branch lands", run(r, "s0", "Route", "--", "route.txt").status, 0);
326
+ check("nothing landed on main", sh(r, "rev-list", "--count", "main"), "1");
327
+ sh(r, "checkout", "-q", "--detach");
328
+ w(r, "route.txt", "route v3\n");
329
+ check("a detached HEAD is refused: exit 10", run(r, "s0", "Route", "--", "route.txt").status, 10);
330
+
331
+ r = mk();
332
+ w(r, "new.tsx", "export const A = () => { mutate({ id: 1 }) }\n");
333
+ check("write lines, no bodies: exit 4", run(r, "s3", "New", "--", "new.tsx").status, 4);
334
+ check("write lines: nothing committed", count(r), 1);
335
+ check("failing bodies check: exit 4", run(r, "s3", "New", "--bodies-check", "false", "--", "new.tsx").status, 4);
336
+ // A bodies DIFF once refused every landing, so an announced data fix could never land.
337
+ const diffCheck = "echo 'same items/list 1 1'; echo 'DIFF items/update 1 1'; exit 1";
338
+ check("a DIFF with no intended change row: exit 4", run(r, "s3", "New", "--bodies-check", diffCheck, "--", "new.tsx").status, 4);
339
+ w(r, ".design-system/decisions.tsv", "2026-01-01T00:00:00Z\tland\tintended change\ts9 items/update sends a whole number\tsha\tok\n");
340
+ check("a row for another surface does not explain it: exit 4", run(r, "s3", "New", "--bodies-check", diffCheck, "--", "new.tsx").status, 4);
341
+ w(r, ".design-system/decisions.tsv", "2026-01-01T00:00:00Z\tland\tintended change\ts3 items/updateAll sends a whole number\tsha\tok\n");
342
+ check("a row for another procedure does not explain it: exit 4", run(r, "s3", "New", "--bodies-check", diffCheck, "--", "new.tsx").status, 4);
343
+ check("exit 1 with no DIFF line: exit 4", run(r, "s3", "New", "--bodies-check", "exit 1", "--", "new.tsx").status, 4);
344
+ check("a rejected pair (exit 2): exit 4", run(r, "s3", "New", "--bodies-check", "echo 'DIFF items/update 1 1'; exit 2", "--", "new.tsx").status, 4);
345
+ w(r, "intended.tsv", "x\tintended change\ts3\titems/update\n");
346
+ p = run(r, "s3", "New", "--bodies-check", diffCheck, "--intended", "intended.tsv", "--dry-run", "--", "new.tsx");
347
+ check("a DIFF the --intended file explains passes", p.status === 0 && /DIFF items\/update lands as an intended change/.test(p.stderr), true);
348
+ check("valid bodies check lands", run(r, "s3", "New", "--bodies-check", "true", "--", "new.tsx").status, 0);
349
+
350
+ r = mk();
351
+ w(r, "a.tsx", "export const A = () => { mutate({ id: 1 }) }\n"); sh(r, "add", "a.tsx"); sh(r, "commit", "-q", "-m", "add a");
352
+ w(r, "a.tsx", "export const A = () => {}\n"); w(r, "b.tsx", "export const B = () => { mutate({ id: 1 }) }\n");
353
+ check("moved write call, no bodies: exit 4", run(r, "s4", "Move", "--", "a.tsx", "b.tsx").status, 4);
354
+
355
+ r = mk();
356
+ w(r, "route.txt", "route v2\n");
357
+ writeFileSync(join(r, ".git/hooks/pre-commit"), "#!/bin/sh\necho x > stray.txt\ngit add stray.txt\n"); chmodSync(join(r, ".git/hooks/pre-commit"), 0o755);
358
+ check("stray file from a hook: exit 3", run(r, "s5", "Route", "--", "route.txt").status, 3);
359
+ check("--check-commit exits 3 for the stray commit", run(r, "--check-commit", "HEAD", "--", "route.txt").status, 3);
360
+ check("--check-commit exits 0 when the set covers it", run(r, "--check-commit", "HEAD", "--", "route.txt", "stray.txt").status, 0);
361
+
362
+ r = mk();
363
+ check("path . is refused: exit 2", run(r, "s6", "x", "--", ".").status, 2);
364
+ check("nothing changed: exit 9", run(r, "s6", "x", "--", "route.txt").status, 9);
365
+
366
+ r = mk();
367
+ w(r, "route.txt", "route v2\n");
368
+ writeFileSync(join(r, "body.txt"), "Verdict: verified\n");
369
+ check("process trailer in the body: exit 6", run(r, "s7", "Route", "--body", "body.txt", "--", "route.txt").status, 6);
370
+ check("process trailer: nothing committed", count(r), 1);
371
+ check("attribution trailer is allowed", run(r, "s7", "Route", "--trailer", "Signed-off-by: A <a@x>", "--", "route.txt").status, 0);
372
+ check("attribution reaches the message", sh(r, "log", "-1", "--format=%B").includes("Signed-off-by: A"), true);
373
+
374
+ r = mk();
375
+ w(r, "route.txt", "route v2\n");
376
+ p = run(r, "s12", "Route", "--no-verify", "--", "route.txt");
377
+ check("--no-verify lands and says so in a WARN line", p.status === 0 && /WARN --no-verify/.test(p.stderr), true);
378
+
379
+ r = mk();
380
+ w(r, "x.ts", "// the verifier checked this gate\nexport const x = 1\n");
381
+ check("working note in a comment: exit 5", run(r, "s8", "X", "--", "x.ts").status, 5);
382
+ check("--allow-notes lands it", run(r, "s8", "X", "--allow-notes", "--", "x.ts").status, 0);
383
+
384
+ r = mk();
385
+ const lock = join(r, ".git/land.lock");
386
+ mkdirSync(lock); writeFileSync(join(lock, "pid"), "999999");
387
+ w(r, "route.txt", "route v2\n");
388
+ check("a lock whose holder died is taken over", run(r, "s9", "Route", "--", "route.txt").status, 0);
389
+ check("the lock is released after landing", existsSync(lock), false);
390
+
391
+ r = mk();
392
+ w(r, "route.txt", "route v2\n"); w(r, "baseline.json", "{}\n");
393
+ run(r, "s10", "Route", "--also", "baseline.json", "--", "route.txt");
394
+ check("--also adds the baseline file", sh(r, "show", "--name-only", "--format=", "HEAD").split("\n").sort().join(" "), "baseline.json route.txt");
395
+ w(r, "src/a.tsx", "a\n"); w(r, "baseline.json", '{"src/a.tsx": 1, "src/b.tsx": 4}\n');
396
+ check("a shared file carrying another file's row: exit 8", run(r, "s10", "A", "--also", "baseline.json", "--", "src/a.tsx").status, 8);
397
+ w(r, "baseline.json", '{"src/a.tsx": 1}\n');
398
+ check("a shared file changed only for its own files lands", run(r, "s10", "A", "--also", "baseline.json", "--", "src/a.tsx").status, 0);
399
+ w(r, "src/b.tsx", "b\n"); w(r, "baseline.json", '{"src/a.tsx": 1, "src/b.tsx": 4}\n');
400
+ run(r, "s10", "B", "--also", "baseline.json", "--", "src/b.tsx");
401
+ w(r, "src/a.tsx", "a2\n"); w(r, "baseline.json", '{"src/a.tsx": 0, "src/b.tsx": 4}\n');
402
+ check("one-line JSON: a change to its own key lands", run(r, "s10", "A", "--also", "baseline.json", "--", "src/a.tsx").status, 0);
403
+ w(r, "src/a.tsx", "a3\n"); w(r, "baseline.json", '{"src/a.tsx": 0, "src/b.tsx": 5}\n');
404
+ check("one-line JSON: a change to another file's key: exit 8", run(r, "s10", "A", "--also", "baseline.json", "--", "src/a.tsx").status, 8);
405
+ w(r, "baseline.json", '{"rules": [{"file": "src/a.tsx", "n": 1}, {"file": "src/b.tsx", "n": 4}]}\n');
406
+ check("JSON array: another file's element changed: exit 8", run(r, "s10", "A", "--also", "baseline.json", "--", "src/a.tsx").status, 8);
407
+ w(r, "baseline.json", '{"src/a.tsx": 0, "src/b.tsx": 4}\n');
408
+ w(r, "other.txt", "other v2\n");
409
+ const before = count(r);
410
+ run(r, "s10", "x", "--dry-run", "--", "other.txt");
411
+ check("--dry-run commits nothing", count(r), before);
412
+
413
+ r = mk();
414
+ w(r, "dir/a.txt", "x\n"); w(r, "dir/b.txt", "y\n"); sh(r, "add", "dir"); sh(r, "commit", "-q", "-m", "dir");
415
+ rmSync(join(r, "dir/a.txt")); w(r, "dir/b.txt", "z\n");
416
+ run(r, "s11", "Dir", "--", "dir");
417
+ check("a folder lands deletions and edits under it", sh(r, "show", "--name-only", "--format=", "HEAD").split("\n").sort().join(" "), "dir/a.txt dir/b.txt");
418
+
419
+ rmSync(base, { recursive: true, force: true });
420
+ console.log(fails ? `${fails} failed` : "all as expected");
421
+ return fails ? 1 : 0;
422
+ }
423
+
424
+ if (process.argv[1] && fileURLToPath(import.meta.url) === resolve(process.argv[1])) {
425
+ try {
426
+ const o = parse(process.argv.slice(2));
427
+ if (o.help) console.log(HELP);
428
+ else if (o.selfTest) process.exitCode = selfTest();
429
+ else await land(o);
430
+ } catch (e) {
431
+ if (e instanceof Exit) { console.error(`land.mjs: ${e.message}`); process.exitCode = e.code; } else throw e;
432
+ }
433
+ }