@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.
- package/dist/benchmark.d.ts +48 -0
- package/dist/benchmark.d.ts.map +1 -0
- package/dist/benchmark.js +84 -0
- package/dist/benchmark.js.map +1 -0
- package/dist/discovery.d.ts +105 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +271 -0
- package/dist/discovery.js.map +1 -0
- package/dist/drafts.d.ts +20 -0
- package/dist/drafts.d.ts.map +1 -0
- package/dist/drafts.js +57 -0
- package/dist/drafts.js.map +1 -0
- package/dist/github.d.ts +49 -0
- package/dist/github.d.ts.map +1 -0
- package/dist/github.js +93 -0
- package/dist/github.js.map +1 -0
- package/dist/import.d.ts +80 -0
- package/dist/import.d.ts.map +1 -0
- package/dist/import.js +286 -0
- package/dist/import.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/licenses.d.ts +30 -0
- package/dist/licenses.d.ts.map +1 -0
- package/dist/licenses.js +116 -0
- package/dist/licenses.js.map +1 -0
- package/dist/linter.d.ts +35 -0
- package/dist/linter.d.ts.map +1 -0
- package/dist/linter.js +262 -0
- package/dist/linter.js.map +1 -0
- package/dist/lss.d.ts +74 -0
- package/dist/lss.d.ts.map +1 -0
- package/dist/lss.js +273 -0
- package/dist/lss.js.map +1 -0
- package/dist/orchestrator.d.ts +164 -0
- package/dist/orchestrator.d.ts.map +1 -0
- package/dist/orchestrator.js +370 -0
- package/dist/orchestrator.js.map +1 -0
- package/dist/packs.d.ts +50 -0
- package/dist/packs.d.ts.map +1 -0
- package/dist/packs.js +166 -0
- package/dist/packs.js.map +1 -0
- package/dist/preferences.d.ts +18 -0
- package/dist/preferences.d.ts.map +1 -0
- package/dist/preferences.js +57 -0
- package/dist/preferences.js.map +1 -0
- package/dist/project.d.ts +45 -0
- package/dist/project.d.ts.map +1 -0
- package/dist/project.js +183 -0
- package/dist/project.js.map +1 -0
- package/dist/rankability.d.ts +51 -0
- package/dist/rankability.d.ts.map +1 -0
- package/dist/rankability.js +217 -0
- package/dist/rankability.js.map +1 -0
- package/dist/registry.d.ts +82 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +300 -0
- package/dist/registry.js.map +1 -0
- package/dist/trust.d.ts +13 -0
- package/dist/trust.d.ts.map +1 -0
- package/dist/trust.js +41 -0
- package/dist/trust.js.map +1 -0
- package/dist/types.d.ts +44 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/library/3d/threejs/LICENSE.txt +21 -0
- package/library/3d/threejs/NOTICE.md +7 -0
- package/library/3d/threejs/SKILL.md +102 -0
- package/library/3d/threejs/luci.json +39 -0
- package/library/accessibility/accessibility-baseline/SKILL.md +51 -0
- package/library/accessibility/accessibility-baseline/luci.json +33 -0
- package/library/accessibility/fixing-accessibility/NOTICE.md +6 -0
- package/library/accessibility/fixing-accessibility/SKILL.md +141 -0
- package/library/accessibility/fixing-accessibility/luci.json +36 -0
- package/library/animation-motion/animation-systems/LICENSE.txt +21 -0
- package/library/animation-motion/animation-systems/NOTICE.md +7 -0
- package/library/animation-motion/animation-systems/SKILL.md +192 -0
- package/library/animation-motion/animation-systems/luci.json +32 -0
- package/library/animation-motion/animejs/SKILL.md +64 -0
- package/library/animation-motion/animejs/luci.json +12 -0
- package/library/animation-motion/motion-dev/SKILL.md +69 -0
- package/library/animation-motion/motion-dev/luci.json +13 -0
- package/library/animation-motion/react-view-transitions/AGENTS.md +1380 -0
- package/library/animation-motion/react-view-transitions/NOTICE.md +6 -0
- package/library/animation-motion/react-view-transitions/README.md +44 -0
- package/library/animation-motion/react-view-transitions/SKILL.md +334 -0
- package/library/animation-motion/react-view-transitions/luci.json +40 -0
- package/library/animation-motion/react-view-transitions/metadata.json +12 -0
- package/library/animation-motion/react-view-transitions/references/css-recipes.md +312 -0
- package/library/animation-motion/react-view-transitions/references/implementation.md +170 -0
- package/library/animation-motion/react-view-transitions/references/nextjs.md +233 -0
- package/library/animation-motion/react-view-transitions/references/patterns.md +274 -0
- package/library/animation-motion/react-view-transitions/references/troubleshooting.md +47 -0
- package/library/code-quality/code-review/NOTICE.md +6 -0
- package/library/code-quality/code-review/SKILL.md +94 -0
- package/library/code-quality/code-review/agents/openai.yaml +3 -0
- package/library/code-quality/code-review/luci.json +33 -0
- package/library/components/company-logos/LICENSE.txt +21 -0
- package/library/components/company-logos/NOTICE.md +7 -0
- package/library/components/company-logos/SKILL.md +27 -0
- package/library/components/company-logos/luci.json +38 -0
- package/library/components/container-lines/LICENSE.txt +21 -0
- package/library/components/container-lines/NOTICE.md +7 -0
- package/library/components/container-lines/SKILL.md +124 -0
- package/library/components/container-lines/luci.json +48 -0
- package/library/design-systems/build-design-system/NOTICE.md +6 -0
- package/library/design-systems/build-design-system/SKILL.md +78 -0
- package/library/design-systems/build-design-system/luci.json +29 -0
- package/library/design-systems/build-design-system/references/components.md +46 -0
- package/library/design-systems/build-design-system/references/glossary.md +77 -0
- package/library/design-systems/build-design-system/references/taste.md +37 -0
- package/library/design-systems/build-design-system/references/tokens.md +59 -0
- package/library/design-systems/build-design-system/references/traps.md +128 -0
- package/library/design-systems/build-design-system/scripts/capture-guard.mjs +470 -0
- package/library/design-systems/build-design-system/scripts/capture.mjs +355 -0
- package/library/design-systems/build-design-system/scripts/check-system.mjs +1883 -0
- package/library/design-systems/build-design-system/scripts/find-chromium.mjs +137 -0
- package/library/design-systems/build-design-system/scripts/oklch.mjs +221 -0
- package/library/design-systems/build-design-system/scripts/pixdiff.mjs +186 -0
- package/library/design-systems/component-docs/NOTICE.md +6 -0
- package/library/design-systems/component-docs/SKILL.md +50 -0
- package/library/design-systems/component-docs/luci.json +30 -0
- package/library/design-systems/component-docs/references/doc-format.md +85 -0
- package/library/design-systems/create-design-md/NOTICE.md +6 -0
- package/library/design-systems/create-design-md/SKILL.md +259 -0
- package/library/design-systems/create-design-md/luci.json +38 -0
- package/library/design-systems/design-system-boss/NOTICE.md +6 -0
- package/library/design-systems/design-system-boss/SKILL.md +58 -0
- package/library/design-systems/design-system-boss/luci.json +29 -0
- package/library/design-systems/design-system-boss/playbooks/build.md +10 -0
- package/library/design-systems/design-system-boss/playbooks/component.md +9 -0
- package/library/design-systems/design-system-boss/playbooks/migrate.md +11 -0
- package/library/design-systems/design-system-boss/playbooks/review.md +9 -0
- package/library/design-systems/migrate-design-system/NOTICE.md +6 -0
- package/library/design-systems/migrate-design-system/SKILL.md +62 -0
- package/library/design-systems/migrate-design-system/luci.json +33 -0
- package/library/design-systems/migrate-design-system/references/correct.md +37 -0
- package/library/design-systems/migrate-design-system/references/lessons.md +69 -0
- package/library/design-systems/migrate-design-system/references/parity.md +44 -0
- package/library/design-systems/migrate-design-system/references/running-many-agents.md +52 -0
- package/library/design-systems/migrate-design-system/scripts/bodies-check.mjs +215 -0
- package/library/design-systems/migrate-design-system/scripts/land.mjs +433 -0
- package/library/design-systems/migrate-design-system/scripts/legacy.mjs +283 -0
- package/library/design-systems/migrate-design-system/scripts/parity.mjs +173 -0
- package/library/design-systems/token-mapping/NOTICE.md +6 -0
- package/library/design-systems/token-mapping/SKILL.md +46 -0
- package/library/design-systems/token-mapping/luci.json +25 -0
- package/library/design-systems/token-mapping/references/mapping-rules.md +54 -0
- package/library/design-systems/ui-review/NOTICE.md +6 -0
- package/library/design-systems/ui-review/SKILL.md +53 -0
- package/library/design-systems/ui-review/luci.json +29 -0
- package/library/design-systems/ui-review/references/criteria.md +49 -0
- package/library/frontend/composition-patterns/AGENTS.md +946 -0
- package/library/frontend/composition-patterns/NOTICE.md +6 -0
- package/library/frontend/composition-patterns/README.md +60 -0
- package/library/frontend/composition-patterns/SKILL.md +86 -0
- package/library/frontend/composition-patterns/luci.json +33 -0
- package/library/frontend/composition-patterns/metadata.json +11 -0
- package/library/frontend/composition-patterns/rules/_sections.md +29 -0
- package/library/frontend/composition-patterns/rules/_template.md +24 -0
- package/library/frontend/composition-patterns/rules/architecture-avoid-boolean-props.md +100 -0
- package/library/frontend/composition-patterns/rules/architecture-compound-components.md +112 -0
- package/library/frontend/composition-patterns/rules/patterns-children-over-render-props.md +87 -0
- package/library/frontend/composition-patterns/rules/patterns-explicit-variants.md +100 -0
- package/library/frontend/composition-patterns/rules/react19-no-forwardref.md +42 -0
- package/library/frontend/composition-patterns/rules/state-context-interface.md +191 -0
- package/library/frontend/composition-patterns/rules/state-decouple-implementation.md +113 -0
- package/library/frontend/composition-patterns/rules/state-lift-state.md +125 -0
- package/library/frontend/design-mobile-apps/NOTICE.md +6 -0
- package/library/frontend/design-mobile-apps/SKILL.md +121 -0
- package/library/frontend/design-mobile-apps/designing.md +56 -0
- package/library/frontend/design-mobile-apps/endpoints.md +362 -0
- package/library/frontend/design-mobile-apps/implementing.md +213 -0
- package/library/frontend/design-mobile-apps/luci.json +31 -0
- package/library/frontend/design-mobile-apps/styling/nativewind.md +57 -0
- package/library/frontend/design-mobile-apps/styling/stylesheet.md +28 -0
- package/library/frontend/design-mobile-apps/styling/uniwind.md +38 -0
- package/library/frontend/frontend-design/LICENSE.txt +202 -0
- package/library/frontend/frontend-design/NOTICE.md +6 -0
- package/library/frontend/frontend-design/SKILL.md +81 -0
- package/library/frontend/frontend-design/luci.json +43 -0
- package/library/frontend/react-native-skills/AGENTS.md +2897 -0
- package/library/frontend/react-native-skills/NOTICE.md +6 -0
- package/library/frontend/react-native-skills/README.md +165 -0
- package/library/frontend/react-native-skills/SKILL.md +119 -0
- package/library/frontend/react-native-skills/luci.json +33 -0
- package/library/frontend/react-native-skills/metadata.json +16 -0
- package/library/frontend/react-native-skills/rules/_sections.md +86 -0
- package/library/frontend/react-native-skills/rules/_template.md +28 -0
- package/library/frontend/react-native-skills/rules/animation-derived-value.md +53 -0
- package/library/frontend/react-native-skills/rules/animation-gesture-detector-press.md +95 -0
- package/library/frontend/react-native-skills/rules/animation-gpu-properties.md +65 -0
- package/library/frontend/react-native-skills/rules/design-system-compound-components.md +66 -0
- package/library/frontend/react-native-skills/rules/fonts-config-plugin.md +71 -0
- package/library/frontend/react-native-skills/rules/imports-design-system-folder.md +68 -0
- package/library/frontend/react-native-skills/rules/js-hoist-intl.md +61 -0
- package/library/frontend/react-native-skills/rules/list-performance-callbacks.md +44 -0
- package/library/frontend/react-native-skills/rules/list-performance-function-references.md +132 -0
- package/library/frontend/react-native-skills/rules/list-performance-images.md +53 -0
- package/library/frontend/react-native-skills/rules/list-performance-inline-objects.md +97 -0
- package/library/frontend/react-native-skills/rules/list-performance-item-expensive.md +94 -0
- package/library/frontend/react-native-skills/rules/list-performance-item-memo.md +82 -0
- package/library/frontend/react-native-skills/rules/list-performance-item-types.md +104 -0
- package/library/frontend/react-native-skills/rules/list-performance-virtualize.md +67 -0
- package/library/frontend/react-native-skills/rules/monorepo-native-deps-in-app.md +46 -0
- package/library/frontend/react-native-skills/rules/monorepo-single-dependency-versions.md +63 -0
- package/library/frontend/react-native-skills/rules/navigation-native-navigators.md +188 -0
- package/library/frontend/react-native-skills/rules/react-compiler-destructure-functions.md +50 -0
- package/library/frontend/react-native-skills/rules/react-compiler-reanimated-shared-values.md +48 -0
- package/library/frontend/react-native-skills/rules/react-state-dispatcher.md +91 -0
- package/library/frontend/react-native-skills/rules/react-state-fallback.md +56 -0
- package/library/frontend/react-native-skills/rules/react-state-minimize.md +65 -0
- package/library/frontend/react-native-skills/rules/rendering-no-falsy-and.md +74 -0
- package/library/frontend/react-native-skills/rules/rendering-text-in-text-component.md +36 -0
- package/library/frontend/react-native-skills/rules/scroll-position-no-state.md +82 -0
- package/library/frontend/react-native-skills/rules/state-ground-truth.md +80 -0
- package/library/frontend/react-native-skills/rules/ui-expo-image.md +66 -0
- package/library/frontend/react-native-skills/rules/ui-image-gallery.md +104 -0
- package/library/frontend/react-native-skills/rules/ui-measure-views.md +78 -0
- package/library/frontend/react-native-skills/rules/ui-menus.md +174 -0
- package/library/frontend/react-native-skills/rules/ui-native-modals.md +77 -0
- package/library/frontend/react-native-skills/rules/ui-pressable.md +61 -0
- package/library/frontend/react-native-skills/rules/ui-safe-area-scroll.md +65 -0
- package/library/frontend/react-native-skills/rules/ui-scrollview-content-inset.md +45 -0
- package/library/frontend/react-native-skills/rules/ui-styling.md +87 -0
- package/library/frontend/tailwindcss/LICENSE.txt +21 -0
- package/library/frontend/tailwindcss/NOTICE.md +7 -0
- package/library/frontend/tailwindcss/SKILL.md +83 -0
- package/library/frontend/tailwindcss/luci.json +39 -0
- package/library/frontend-frameworks/react-best-practices/NOTICE.md +6 -0
- package/library/frontend-frameworks/react-best-practices/SKILL.md +151 -0
- package/library/frontend-frameworks/react-best-practices/luci.json +39 -0
- package/library/general/algorithmic-art/LICENSE.txt +202 -0
- package/library/general/algorithmic-art/NOTICE.md +6 -0
- package/library/general/algorithmic-art/SKILL.md +409 -0
- package/library/general/algorithmic-art/luci.json +27 -0
- package/library/general/algorithmic-art/templates/generator_template.js +223 -0
- package/library/general/algorithmic-art/templates/viewer.html +599 -0
- package/library/general/canvas-design/LICENSE.txt +202 -0
- package/library/general/canvas-design/NOTICE.md +6 -0
- package/library/general/canvas-design/SKILL.md +134 -0
- package/library/general/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -0
- package/library/general/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/Italiana-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/Jura-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/PoiretOne-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -0
- package/library/general/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
- package/library/general/canvas-design/luci.json +29 -0
- package/library/index.json +2507 -0
- package/library/interaction/animation-on-scroll/LICENSE.txt +21 -0
- package/library/interaction/animation-on-scroll/NOTICE.md +7 -0
- package/library/interaction/animation-on-scroll/SKILL.md +115 -0
- package/library/interaction/animation-on-scroll/luci.json +38 -0
- package/library/micro-interactions/masked-reveal/LICENSE.txt +21 -0
- package/library/micro-interactions/masked-reveal/NOTICE.md +7 -0
- package/library/micro-interactions/masked-reveal/SKILL.md +187 -0
- package/library/micro-interactions/masked-reveal/luci.json +63 -0
- package/library/micro-interactions/micro-interaction/NOTICE.md +6 -0
- package/library/micro-interactions/micro-interaction/SKILL.md +177 -0
- package/library/micro-interactions/micro-interaction/luci.json +52 -0
- package/library/micro-interactions/micro-interaction/references/css-recipes.md +142 -0
- package/library/micro-interactions/micro-interaction/references/framer-motion-recipes.md +187 -0
- package/library/micro-interactions/micro-interaction/scripts/README.md +42 -0
- package/library/micro-interactions/micro-interaction/scripts/contact-sheet.sh +17 -0
- package/library/micro-interactions/micro-interaction/scripts/seek-shot.sh +21 -0
- package/library/performance/fixing-motion-performance/NOTICE.md +6 -0
- package/library/performance/fixing-motion-performance/SKILL.md +156 -0
- package/library/performance/fixing-motion-performance/luci.json +30 -0
- package/library/seo/fixing-metadata/NOTICE.md +6 -0
- package/library/seo/fixing-metadata/SKILL.md +111 -0
- package/library/seo/fixing-metadata/luci.json +36 -0
- package/library/shadcn-ui/migrate-radix-to-base/NOTICE.md +6 -0
- package/library/shadcn-ui/migrate-radix-to-base/SKILL.md +178 -0
- package/library/shadcn-ui/migrate-radix-to-base/class-mapping.md +62 -0
- package/library/shadcn-ui/migrate-radix-to-base/consumer-props.md +58 -0
- package/library/shadcn-ui/migrate-radix-to-base/disclosure.md +353 -0
- package/library/shadcn-ui/migrate-radix-to-base/display-misc.md +410 -0
- package/library/shadcn-ui/migrate-radix-to-base/form-controls.md +390 -0
- package/library/shadcn-ui/migrate-radix-to-base/luci.json +33 -0
- package/library/shadcn-ui/migrate-radix-to-base/menus.md +409 -0
- package/library/shadcn-ui/migrate-radix-to-base/overlays.md +459 -0
- package/library/shadcn-ui/migrate-radix-to-base/universal-patterns.md +286 -0
- package/library/shadcn-ui/migrate-radix-to-base/wrapper-shapes.md +110 -0
- package/library/shadcn-ui/shadcn/NOTICE.md +6 -0
- package/library/shadcn-ui/shadcn/SKILL.md +187 -0
- package/library/shadcn-ui/shadcn/agents/openai.yml +5 -0
- package/library/shadcn-ui/shadcn/assets/shadcn-small.png +0 -0
- package/library/shadcn-ui/shadcn/assets/shadcn.png +0 -0
- package/library/shadcn-ui/shadcn/assets/showcase/color-pair.tsx +126 -0
- package/library/shadcn-ui/shadcn/assets/showcase/preview-states.css +14 -0
- package/library/shadcn-ui/shadcn/assets/showcase/state-matrix.tsx +72 -0
- package/library/shadcn-ui/shadcn/cli.md +290 -0
- package/library/shadcn-ui/shadcn/customization.md +211 -0
- package/library/shadcn-ui/shadcn/design-system-page.md +268 -0
- package/library/shadcn-ui/shadcn/design-system.md +386 -0
- package/library/shadcn-ui/shadcn/evals/evals.json +126 -0
- package/library/shadcn-ui/shadcn/luci.json +34 -0
- package/library/shadcn-ui/shadcn/mcp.md +105 -0
- package/library/shadcn-ui/shadcn/references/updating-components.md +91 -0
- package/library/shadcn-ui/shadcn/references/workflow.md +31 -0
- package/library/shadcn-ui/shadcn/registry.md +277 -0
- package/library/shadcn-ui/shadcn/rules/base-vs-radix.md +306 -0
- package/library/shadcn-ui/shadcn/rules/chat.md +507 -0
- package/library/shadcn-ui/shadcn/rules/composition.md +213 -0
- package/library/shadcn-ui/shadcn/rules/forms.md +192 -0
- package/library/shadcn-ui/shadcn/rules/icons.md +101 -0
- package/library/shadcn-ui/shadcn/rules/styling.md +185 -0
- package/library/shadcn-ui/shadcn/scripts/showcase-coverage.mjs +53 -0
- package/library/systems/baseline-ui/NOTICE.md +6 -0
- package/library/systems/baseline-ui/SKILL.md +90 -0
- package/library/systems/baseline-ui/luci.json +35 -0
- package/library/testing/tdd/NOTICE.md +6 -0
- package/library/testing/tdd/SKILL.md +43 -0
- package/library/testing/tdd/agents/openai.yaml +3 -0
- package/library/testing/tdd/luci.json +29 -0
- package/library/testing/tdd/mocking.md +59 -0
- package/library/testing/tdd/tests.md +77 -0
- package/library/testing/webapp-testing/LICENSE.txt +202 -0
- package/library/testing/webapp-testing/NOTICE.md +6 -0
- package/library/testing/webapp-testing/SKILL.md +100 -0
- package/library/testing/webapp-testing/examples/console_logging.py +35 -0
- package/library/testing/webapp-testing/examples/element_discovery.py +40 -0
- package/library/testing/webapp-testing/examples/static_html_automation.py +33 -0
- package/library/testing/webapp-testing/luci.json +33 -0
- package/library/testing/webapp-testing/scripts/with_server.py +106 -0
- package/library/ui-ux/improve-ui/NOTICE.md +6 -0
- package/library/ui-ux/improve-ui/SKILL.md +127 -0
- package/library/ui-ux/improve-ui/agents/openai.yaml +13 -0
- package/library/ui-ux/improve-ui/luci.json +47 -0
- package/library/ui-ux/improve-ui/references/plan-template.md +55 -0
- package/library/ui-ux/landing-page/LICENSE.txt +21 -0
- package/library/ui-ux/landing-page/NOTICE.md +7 -0
- package/library/ui-ux/landing-page/SKILL.md +213 -0
- package/library/ui-ux/landing-page/luci.json +47 -0
- package/library/ui-ux/pricing-page/LICENSE.txt +21 -0
- package/library/ui-ux/pricing-page/NOTICE.md +7 -0
- package/library/ui-ux/pricing-page/SKILL.md +217 -0
- package/library/ui-ux/pricing-page/luci.json +47 -0
- package/library/ui-ux/prototype/LOGIC.md +67 -0
- package/library/ui-ux/prototype/NOTICE.md +6 -0
- package/library/ui-ux/prototype/SKILL.md +31 -0
- package/library/ui-ux/prototype/UI.md +112 -0
- package/library/ui-ux/prototype/agents/openai.yaml +3 -0
- package/library/ui-ux/prototype/luci.json +33 -0
- package/library/ui-ux/theme-factory/LICENSE.txt +202 -0
- package/library/ui-ux/theme-factory/NOTICE.md +6 -0
- package/library/ui-ux/theme-factory/SKILL.md +62 -0
- package/library/ui-ux/theme-factory/luci.json +35 -0
- package/library/ui-ux/theme-factory/themes/arctic-frost.md +19 -0
- package/library/ui-ux/theme-factory/themes/botanical-garden.md +19 -0
- package/library/ui-ux/theme-factory/themes/desert-rose.md +19 -0
- package/library/ui-ux/theme-factory/themes/forest-canopy.md +19 -0
- package/library/ui-ux/theme-factory/themes/golden-hour.md +19 -0
- package/library/ui-ux/theme-factory/themes/midnight-galaxy.md +19 -0
- package/library/ui-ux/theme-factory/themes/modern-minimalist.md +19 -0
- package/library/ui-ux/theme-factory/themes/ocean-depths.md +19 -0
- package/library/ui-ux/theme-factory/themes/sunset-boulevard.md +19 -0
- package/library/ui-ux/theme-factory/themes/tech-innovation.md +19 -0
- package/package.json +21 -3
- package/packs/design-system-build.json +10 -0
- package/packs/design-system.json +16 -0
- package/packs/marketing.json +11 -0
- package/packs/motion.json +12 -0
- package/packs/ui.json +13 -0
- package/README.md +0 -3
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lss": 1,
|
|
3
|
+
"lastVerified": "2026-11-09",
|
|
4
|
+
"source": {
|
|
5
|
+
"repo": "arla6ka/design.how",
|
|
6
|
+
"path": "skills/migrate-design-system/SKILL.md",
|
|
7
|
+
"licenseVerified": true,
|
|
8
|
+
"licenseStatus": "open",
|
|
9
|
+
"licenseEvidence": "repository license",
|
|
10
|
+
"licenseUrl": "https://github.com/arla6ka/design.how/blob/main/LICENSE",
|
|
11
|
+
"licenseCheckedAt": "2026-11-09"
|
|
12
|
+
},
|
|
13
|
+
"permissions": [
|
|
14
|
+
"shell"
|
|
15
|
+
],
|
|
16
|
+
"summary": "Use when an app has to move onto a design system that already exists, such as \"migrate the app to our design system\", \"move every screen onto the new components\", a rollout, or an adoption audit. Not for making the system or for swapping raw values for tokens, which are build-design-system.",
|
|
17
|
+
"whenToUse": [
|
|
18
|
+
"Use when an app has to move onto a design system that already exists, such as \"migrate the app to our design system\", \"move every screen onto the new components\", a rollout, or an adoption audit."
|
|
19
|
+
],
|
|
20
|
+
"whenNotToUse": [
|
|
21
|
+
"Not for making the system or for swapping raw values for tokens, which are build-design-system."
|
|
22
|
+
],
|
|
23
|
+
"domains": [
|
|
24
|
+
"design",
|
|
25
|
+
"web"
|
|
26
|
+
],
|
|
27
|
+
"derived": [
|
|
28
|
+
"domains",
|
|
29
|
+
"summary",
|
|
30
|
+
"whenNotToUse",
|
|
31
|
+
"whenToUse"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Correct
|
|
2
|
+
|
|
3
|
+
Run at close, and whenever the person says a mistake came back. Assume every contributor is an agent that sees only the files it opened, copies the nearest example and takes the shortest path that compiles. Make a change that looks right from one file be right for the whole repo.
|
|
4
|
+
|
|
5
|
+
## Find the classes
|
|
6
|
+
|
|
7
|
+
Read the run's reverts, `blocked` and rework rows, review comments, `decisions.tsv`, and comments that explain a workaround. Group them. A class counts once it has happened twice. One-offs are ignored.
|
|
8
|
+
|
|
9
|
+
## Fix each class at the highest level that works
|
|
10
|
+
|
|
11
|
+
1. **Architecture.** One owner per piece of state, one supported way per task, internals unreachable so the wrong import fails, one source of truth instead of hand-synced lists, the old module deleted so no one copies it.
|
|
12
|
+
2. **Types, then a lint rule** whose message names the fix ("use `Text`, see docs"). If the pattern is already common, fail only when a change adds more.
|
|
13
|
+
3. **A test** of the behaviour.
|
|
14
|
+
4. **Docs or brief text last**, and only for judgment calls. Nothing fails when an agent skips them.
|
|
15
|
+
|
|
16
|
+
Each ban ships with its check in the same change. The check is proven to fail on a real past case before it counts. Exceptions go on the offending line with a reason, an expiry date and the name of the person who allowed it. A ban that exists only as a line in a brief is listed as unenforced.
|
|
17
|
+
|
|
18
|
+
## The rule table
|
|
19
|
+
|
|
20
|
+
Keep it in the system's agent instructions.
|
|
21
|
+
|
|
22
|
+
| Rule | Enforced by | Proven against |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| Exact edits, no `sed -i` | hook, `land.mjs` named paths | a run where most agents used it after a prose ban |
|
|
25
|
+
| No curly quotes in payload strings | element exemption, byte compare with base | a copied prompt with a curly apostrophe |
|
|
26
|
+
| Table controls reachable inside the scroller | verifier measurement at four widths | no row control in view while a window-based script passed |
|
|
27
|
+
| Named page widths (wide, hub) equal legacy at 1280 | width table plus a measured content box | a visible shift from two different wide tokens |
|
|
28
|
+
| Upload `accept` matches MIME as well as extension | `parity.mjs` class, a lint on `accept=` | a file refused for having no extension |
|
|
29
|
+
| Request bodies equal before and after, or an announced change | `land.mjs --bodies-check` with intended change rows | a pair joined from two runs that passed and was reverted |
|
|
30
|
+
| A shared file changes only its own rows | `land.mjs --also` | a ratchet recomputed over a folder that carried other workers' files |
|
|
31
|
+
| No live run before every write is seen blocked | `capture.mjs --writes`, `capture-guard.mjs prove` | an abort filter on the wrong URL shape that created real records |
|
|
32
|
+
|
|
33
|
+
When a rule is already in the table and nothing enforces it, that is a repeat. Fix it at a higher level in the same change. Drop a rule once its mistake cannot happen.
|
|
34
|
+
|
|
35
|
+
## Reply
|
|
36
|
+
|
|
37
|
+
Each class with its evidence, the level chosen, and why a higher level did not work. Proposals for token or lint changes wait for a person, except ratcheted additions.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Lessons
|
|
2
|
+
|
|
3
|
+
Eight lessons, each from a failure in a real migration. A lesson counts here only if it happened and a check can see it. Each says when to apply it, why, where to stop, and what enforces it.
|
|
4
|
+
|
|
5
|
+
## 1. An edit is the size of its change
|
|
6
|
+
|
|
7
|
+
**Apply when** a worker edits a shared checkout, or runs a formatter or codemod.
|
|
8
|
+
**Why** most workers in one run used `sed -i` after a prose ban, and BSD and GNU forms differ. A formatter on the wrong config rewrote whole files nobody meant to touch.
|
|
9
|
+
**Stop** if `git diff --stat` shows a file rewritten whole for a small change. Keep only the real hunks, and run the formatter and config the repo has now, which can change mid-run. A regex over many files is a codemod you diff.
|
|
10
|
+
**Enforced by** the host hook or the brief's BANS block, and `land.mjs`, which commits only named paths.
|
|
11
|
+
|
|
12
|
+
## 2. Payload strings are not copy
|
|
13
|
+
|
|
14
|
+
**Apply when** a copy rule, formatter or codemod touches a copied prompt, a model prompt, an API example, a clipboard value, text that must stay verbatim (quotes, terms, version strings), data-layer strings or a string a test pins.
|
|
15
|
+
**Why** a curly apostrophe landed in a prompt users copy into an assistant. Nothing on the page showed it.
|
|
16
|
+
**Stop** before rewording. A migration never changes data-layer or model-prompt text. Flag it for its owner.
|
|
17
|
+
**Enforced by** element-scoped exemptions in the check, and a byte comparison of each payload string with the base commit after every sweep.
|
|
18
|
+
|
|
19
|
+
## 3. A control swap needs a parity table
|
|
20
|
+
|
|
21
|
+
**Apply when** a number, amount, percent, date or upload control changes.
|
|
22
|
+
**Why** an integer field saved 25 for `2.5`, and an upload control refused a file by its extension though its MIME type matched. Every visual check passed.
|
|
23
|
+
**Stop** on any differing row nobody approved.
|
|
24
|
+
**Enforced by** `parity.mjs` and the classes in `parity.md`, including MIME with and without extension, upper-case extension and a wrong MIME.
|
|
25
|
+
|
|
26
|
+
## 4. A date-only value is not a moment
|
|
27
|
+
|
|
28
|
+
**Apply when** a surface shows, parses or sends a date.
|
|
29
|
+
**Why** a date-only value serialized through a local-midnight `Date` shifted a day west of UTC, more than once, and some dates were already a day early before the run.
|
|
30
|
+
**Stop** on any `new Date("YYYY-MM-DD")` or local-midnight `Date` in a date-only path. Keep the value a string or a UTC date. A bug legacy already had is fixed in its own commit as an `intended change` row and named in the report, never silently.
|
|
31
|
+
**Enforced by** `parity.mjs date` under `America/Los_Angeles` and `Asia/Tokyo`.
|
|
32
|
+
|
|
33
|
+
## 5. Write bodies come from one run
|
|
34
|
+
|
|
35
|
+
**Apply when** a diff adds, moves or rewraps `mutate(`, `mutateAsync(`, `onSubmit`, `execute(` or a non-GET `fetch`.
|
|
36
|
+
**Why** two real runs joined by script produced a pair that passed and had to be reverted.
|
|
37
|
+
**Stop** if one logged run did not produce both body files.
|
|
38
|
+
**How.** Serve two builds at once on two local ports: the base commit's, from its own worktree, and the run branch's. Wrap both captures in one logged run, each driving the changed write with the same `--states` step, so the guard blocks it and keeps its body:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
rc=0; node <this skill>/scripts/bodies-check.mjs log .design-system/runs.log start RUN-7
|
|
42
|
+
node build-design-system/scripts/capture.mjs --base http://localhost:5183 --kind before --out .design-system/captures/before --surfaces <tsv> --states <steps.mjs> --writes <file> --run RUN-7 --bodies .design-system/evidence/<surface>/bodies.before.json || rc=1
|
|
43
|
+
node build-design-system/scripts/capture.mjs --base http://localhost:5173 --kind after --out .design-system/captures/after --surfaces <tsv> --states <steps.mjs> --writes <file> --run RUN-7 --bodies .design-system/evidence/<surface>/bodies.after.json || rc=1
|
|
44
|
+
node <this skill>/scripts/bodies-check.mjs log .design-system/runs.log end RUN-7 $rc
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Then land with `--bodies-check "node <this skill>/scripts/bodies-check.mjs .design-system/evidence/$SURFACE --expect <procedures> --before-ports 5183 --after-ports 5173 --log .design-system/runs.log"`. Bodies that differ print `DIFF`. An announced data fix lands only with an `intended change` row in `decisions.tsv` that names the surface and the procedure. Any other difference holds the surface.
|
|
48
|
+
**Enforced by** `land.mjs --bodies-check`, which refuses a write diff with no valid pair and any `DIFF` no row explains.
|
|
49
|
+
|
|
50
|
+
## 6. Capture behind the guard
|
|
51
|
+
|
|
52
|
+
**Apply when** any script drives a live app.
|
|
53
|
+
**Why** a capture leaked a real update call and changed real data. Another script's abort filter matched the wrong URL shape and created real records. Reads are POST in many RPC APIs, so blocking non-GET blocks the app.
|
|
54
|
+
**Stop** before any run that can reach a backend until a dry run sent every known write, in the shape the app sends it, and saw each one blocked. Writes are denied by default and reads pass by exact name only.
|
|
55
|
+
**Enforced by** `build-design-system/scripts/capture-guard.mjs prove --writes <file> --read-procedures <names>` (exact names are its default), and `capture.mjs`, which installs the guard before the first navigation, refuses to start without `--writes <file>` or `--no-backend`, refuses while the file has a leak, and writes `guard.log`, with each write's body, beside the captures.
|
|
56
|
+
|
|
57
|
+
## 7. No write surface on a code read
|
|
58
|
+
|
|
59
|
+
**Apply when** a verifier cannot run the surface in a browser.
|
|
60
|
+
**Why** a grid landed on a code read alone, with no browser pass, and broke.
|
|
61
|
+
**Stop** and return `blocked` with the missing evidence and the command to rerun.
|
|
62
|
+
**Enforced by** the glossary: only `verified` at the surface's fingerprint lands a write surface.
|
|
63
|
+
|
|
64
|
+
## 8. Widths are measured inside the scroller
|
|
65
|
+
|
|
66
|
+
**Apply when** a table, grid or row layout changes.
|
|
67
|
+
**Why** no row control was in view while a window-based script passed.
|
|
68
|
+
**Stop** if any control reachable before is not reachable at 390, 768, 1280 or 1920. Each width is a fresh navigation, with a long title and more rows than fit.
|
|
69
|
+
**Enforced by** the verifier's measurements in its verdict, and `capture.mjs`, which reports a capture under 700 bytes as a blank render, not a capture.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Behaviour parity
|
|
2
|
+
|
|
3
|
+
Dozens of behaviour regressions in one migration passed typecheck, lint, unit tests and the system's check. A verifier driving a browser caught them, and many first verdicts were not clean. Each class below is a table you run on the old control and the new one with the same inputs. Every differing row is approved by a person or fixed.
|
|
4
|
+
|
|
5
|
+
`parity.mjs number|date --old <module or json> --new <module or json>` runs the first two classes. A results file needs a result for every input (and a date file every zone) on both sides, or the row fails. For the rest, drive the app and fill the table by hand or with the host's browser tool.
|
|
6
|
+
|
|
7
|
+
## The classes
|
|
8
|
+
|
|
9
|
+
**Numbers and amounts.** Type and paste these 19 into each control: `2.5`, `-3`, `1e3`, `12.50`, `0.123456789`, `1,234.56`, ` 42 `, empty, `abc`, `12abc`, `007`, `-0`, a 20-digit number, `1.2.3`, `.5`, `5.`, `+3`, a Unicode minus, `1 000`. Compare what the box shows, what the control commits, and whether submit is enabled.
|
|
10
|
+
Wrong: an integer field commits 25 for `2.5`, 3 for `-3`, 13 for `1e3`, and sends `12.50` as `12.5`. Wrong: a box holding `abc` submits the last good value. Right: the same answers as before, a rejected row a person approved, and submit refused while the text does not parse.
|
|
11
|
+
|
|
12
|
+
**Dates.** Run every date surface under `TZ=America/Los_Angeles` and `TZ=Asia/Tokyo` at least, and compare the payload, not the label. If legacy already answers differently per zone, report it and fix it only as an `intended change` row.
|
|
13
|
+
Wrong: a date entered as `2025-03-15` shows `03/14/2025` west of UTC. Right: it comes back as the same calendar day.
|
|
14
|
+
|
|
15
|
+
**Upload inputs.** Test extension only, MIME only, an upper-case extension, a wrong MIME and a rejected type.
|
|
16
|
+
Wrong: `accept` checks the extension, so a file delivered with the right MIME type and no extension is refused.
|
|
17
|
+
|
|
18
|
+
**Enter and Space on open.** For a picker that writes on select, press Enter and Space immediately after it opens, at 0 and 300 ms. Expect no write.
|
|
19
|
+
Wrong: the first enabled option fires a switch write.
|
|
20
|
+
|
|
21
|
+
**Accessible names.** Diff the accessibility tree before and after: names, roles, headings, `aria-current`. A shortened visible label keeps its full accessible name.
|
|
22
|
+
Wrong: size buttons announced as "S", "M", "L".
|
|
23
|
+
|
|
24
|
+
**Focus.** For each dialog read `document.activeElement` after Escape, Cancel, confirm success, confirm failure and when the opener disappears. Record the old value first.
|
|
25
|
+
Wrong: a confirmed row delete leaves focus on `body`.
|
|
26
|
+
|
|
27
|
+
**Refetch error.** Force the next fetch of a loaded record to 500 and dispatch focus events on `window`. The page keeps its data.
|
|
28
|
+
Wrong: a background refetch replaces a loaded record with an error page.
|
|
29
|
+
|
|
30
|
+
**Filter values.** Assert the stored value for every filter operator, not the chip that shows it.
|
|
31
|
+
Wrong: "is" stores the complement.
|
|
32
|
+
|
|
33
|
+
**Widths inside the scroller.** Measure row controls and headers inside the scroll container at 390, 768, 1280 and 1920. A control reachable before stays reachable.
|
|
34
|
+
Wrong: no row control in view while a window-based script passed.
|
|
35
|
+
|
|
36
|
+
**Fixtures.** Use a long title (over 100 characters), a long file name and more rows than fit at 1920. Short fixtures hid truncation and unreachable pages on several surfaces.
|
|
37
|
+
|
|
38
|
+
## Reading the table
|
|
39
|
+
|
|
40
|
+
Columns: case, old result, new result, expectation, verdict. Expectations are `same`, `rejected`, `intended change` and `preexisting`. An `intended change` row that does not change fails, so a fix that quietly did not land is caught. Exit 0 only when every row is as expected, which makes the table one a person can approve.
|
|
41
|
+
|
|
42
|
+
## When there is no browser
|
|
43
|
+
|
|
44
|
+
Run the pure functions with `parity.mjs` and say in the verdict that the control itself was `blocked`. A write surface is never `verified` on that.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Running many agents
|
|
2
|
+
|
|
3
|
+
One migration ran hundreds of workers over several days. The limit was never the number of agents. It was load, wedged servers and waiting. These are the few rules that paid for themselves. The one script is `scripts/land.mjs`. The rest is judgement and a few shell lines.
|
|
4
|
+
|
|
5
|
+
## Load valve
|
|
6
|
+
|
|
7
|
+
Do not spawn and do not start a browser run while the 5-minute load average is above 24 (adjust to the machine's cores) or free-plus-inactive memory is under 1 GB.
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
uptime # the second load number is the 5-minute average
|
|
11
|
+
vm_stat | head -4 # macOS; on Linux, head -3 /proc/meminfo
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
When blocked, wait and recheck every 30 seconds up to 30 minutes, then spawn nothing and say so. Name the three busiest processes to the person and kill none of them. Read memory as pressure and swap, because a reading of a few hundred MB free was file cache the OS would drop. The migration ran at several times the cap for long stretches, and every worker slowed down.
|
|
15
|
+
|
|
16
|
+
## Browser slots
|
|
17
|
+
|
|
18
|
+
Run at most 3 browsers at a time. A slot is a folder made with `mkdir` that holds the owner's pid. Reclaim a slot only if `kill -0 <pid>` fails. Never `rm -rf` slot folders, because two workers then share one. A hung holder is reported with its pid and age, never killed. Bound every wait to 20 minutes and return `blocked (timed out)` with the rerun command. Unbounded waits of an hour and more happened, and one verifier deleted its only loaded run to escape one.
|
|
19
|
+
|
|
20
|
+
## Backend health
|
|
21
|
+
|
|
22
|
+
Probe with a signed-in call. An unauthenticated 401 that came back at once proved the web server was up while authenticated reads hung. If the probe fails for 60 seconds, the worker returns `blocked: server down` with a rerun script. It does not restart a shared server. One owner (the coordinator) restarts it, and the brief says who.
|
|
23
|
+
|
|
24
|
+
## Two sessions on one repo
|
|
25
|
+
|
|
26
|
+
Give each session its own id and its own MAY EDIT lists, and write the lists to a shared file. A file dirty at the start and unchanged is the other session's. Never settle a conflict by overwriting. Send the path of the other version to the coordinator. A scratch folder inside a package once broke the project build for both sessions, so scratch stays under `.design-system/tmp/<id>/`.
|
|
27
|
+
|
|
28
|
+
## Permission refusals
|
|
29
|
+
|
|
30
|
+
A refused call stops that worker's piece. Report the exact command and the refusal text, leave the files as they are, and finish whatever does not depend on the call. Do not retry with another flag, tool or script. The coordinator never runs the refused command for the worker. It asks the person with three options: allow it, skip the check that needed it, or hold the piece. Hold is the default. A refused health probe was reworded and retried for hours while write pieces stayed unverified.
|
|
31
|
+
|
|
32
|
+
## Coordinators and resume
|
|
33
|
+
|
|
34
|
+
- Judge every return from files, never from a message. An implementer's work is what `git diff` shows, and some stopped early or wrote nothing. A verifier writes its verdict file (one verdict per item, with evidence paths) before its final message, because verifiers died before reporting and coordinators waited forever. No file means rerun once, then judge the evidence yourself and say so.
|
|
35
|
+
- Keep each lane resumable from its brief, backlog, ledger and verdicts on disk. Spend limits, agent caps and machine load stopped lanes many times, and a fresh coordinator rebuilt each from the folder in minutes. One id per surface or cluster, never reused.
|
|
36
|
+
- Resume by fingerprint. If the verified commit equals the surface's fingerprint, land it. If equal and unverified, verify. If the files changed, rerun the checks.
|
|
37
|
+
- A coordinator hands back after 25 landings or 6 hours. One that ran past that degraded and looped as its context filled.
|
|
38
|
+
- Never end a turn with a worker running. A background worker left alive keeps writing into a repo nobody checks. Spawn waves as foreground calls, several in one message, and drain before handing back.
|
|
39
|
+
- Cap live agents well below the host's limit. A window of about half the cap held.
|
|
40
|
+
- The person's standing preferences ("never delete files, list them instead") go in every brief word for word, so each new worker has them.
|
|
41
|
+
|
|
42
|
+
## Shared files
|
|
43
|
+
|
|
44
|
+
A file every lane writes, such as a ratchet, a baseline, a registry or a docs index, is where landings leak. Recompute a ratchet or baseline for your own files only and pass it with `--also`, which refuses a changed row that names another worker's file. In a JSON file a row is a key or an array element, so a one-line ratchet works. A generated docs index spans every page, so one lane owns docs. Feature lanes queue their docs text and the docs lane lands it in one commit, so no commit in between carries a stale index.
|
|
45
|
+
|
|
46
|
+
## Landing
|
|
47
|
+
|
|
48
|
+
`land.mjs --help` has the flags. It refuses the default branch and the branch the run started on, takes a lock, builds the commit in a private index from HEAD, asserts the commit's file list lies inside the named paths, then resets only those paths in the shared index. A stale shared index once reverted a landed route, and a shared list file committed whole once carried another worker's uncommitted changes. Name exact files, and read `git show --stat HEAD` after every landing. The repo's git hooks run on each landing. Read them first, because a hook that formats or stages files makes `land.mjs` exit 3. `--no-verify` skips them only when the person allowed it, and the report says so.
|
|
49
|
+
|
|
50
|
+
## When the base moves
|
|
51
|
+
|
|
52
|
+
Merge upstream in a separate worktree. Never run merge, stash or checkout in the shared tree. Re-merge right before integrating, update the shared tree with a two-tree read (`git read-tree -m -u <old> <new>`), which refuses when it would touch a file someone has uncommitted, then move the branch ref. Move the before build to the new base too, rebuild its packages and recapture with a fresh cache, or every before and after diff mixes in the merge.
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// bodies-check.mjs: accepts a before/after request-body pair only when one logged browser run produced both files.
|
|
3
|
+
// Node 18+, no dependencies.
|
|
4
|
+
import { createHash } from "node:crypto";
|
|
5
|
+
import { appendFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
6
|
+
import { tmpdir } from "node:os";
|
|
7
|
+
import { join } from "node:path";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
import { spawnSync } from "node:child_process";
|
|
10
|
+
|
|
11
|
+
const HELP = `bodies-check.mjs log <run log> start|end <RUN_ID> [rc] append one run-log line around a browser run
|
|
12
|
+
bodies-check.mjs <dir> --expect <procs> --before-ports a,b --after-ports c,d --log <run log> [--slack 5]
|
|
13
|
+
|
|
14
|
+
Reads <dir>/bodies.before.json and <dir>/bodies.after.json, each {"run": "<RUN_ID>", "rows": [{url, proc, body, capturedAt}]}.
|
|
15
|
+
Rejects (exit 2) unless all of these hold
|
|
16
|
+
1. both files exist, are not byte-identical, and have a non-empty rows array of complete rows
|
|
17
|
+
2. before rows are on the before ports and after rows on the after ports (any local host)
|
|
18
|
+
3. both files name one RUN_ID, and the run log shows that id with a start and an end with rc 0
|
|
19
|
+
4. every capturedAt lies inside the run window plus --slack seconds (default 5)
|
|
20
|
+
5. every procedure in --expect (comma list) has rows in both files
|
|
21
|
+
The expected list comes from the verifier brief, written from the diff's write lines before the run.
|
|
22
|
+
Exit 0 when valid and every procedure's bodies match between before and after. Exit 1 when valid and some
|
|
23
|
+
procedure's bodies differ, printed as "DIFF <proc> <before count> <after count>". land.mjs lands a DIFF only when
|
|
24
|
+
decisions.tsv (or its --intended file) holds an intended change row naming the surface and that procedure.
|
|
25
|
+
|
|
26
|
+
Making the two files: serve the base commit's build (a separate worktree) and the run branch's build at the same
|
|
27
|
+
time on different ports, then wrap both captures in one logged run:
|
|
28
|
+
rc=0; node bodies-check.mjs log runs.log start RUN-7
|
|
29
|
+
node capture.mjs --base http://localhost:5183 --kind before ... --run RUN-7 --bodies <dir>/bodies.before.json || rc=1
|
|
30
|
+
node capture.mjs --base http://localhost:5173 --kind after ... --run RUN-7 --bodies <dir>/bodies.after.json || rc=1
|
|
31
|
+
node bodies-check.mjs log runs.log end RUN-7 $rc
|
|
32
|
+
capture.mjs is in build-design-system's scripts. Drive the changed write in both captures with the same --states
|
|
33
|
+
step, so both runs send it.
|
|
34
|
+
|
|
35
|
+
Run log: tab separated, one line per event: <event>\\t<iso time>\\t<slot>\\t<RUN_ID>\\t<rc>
|
|
36
|
+
where event is start or end and rc is only read on end. Wrap the browser run with the log subcommand: start before it, end with its exit code after it.
|
|
37
|
+
Residual risk that stays: a script can still write a pair inside a real run, and a fixture may not exercise the changed path.
|
|
38
|
+
Options: --self-test, --help`;
|
|
39
|
+
|
|
40
|
+
class Reject extends Error {}
|
|
41
|
+
const die = (m) => { throw new Reject(m); };
|
|
42
|
+
|
|
43
|
+
export function check(dir, o) {
|
|
44
|
+
const pb = join(dir, "bodies.before.json");
|
|
45
|
+
const pa = join(dir, "bodies.after.json");
|
|
46
|
+
for (const p of [pb, pa]) if (!existsSync(p)) die(`missing ${p}`);
|
|
47
|
+
if (readFileSync(pb).equals(readFileSync(pa))) die("before and after files are byte-identical");
|
|
48
|
+
const load = (p, ports) => {
|
|
49
|
+
let f;
|
|
50
|
+
try { f = JSON.parse(readFileSync(p, "utf8")); } catch (e) { die(`${p}: not JSON (${e.message})`); }
|
|
51
|
+
if (!f || typeof f !== "object" || !("run" in f) || !Array.isArray(f.rows)) die(`${p}: needs {"run", "rows"}`);
|
|
52
|
+
if (!f.rows.length) die(`${p}: no rows`);
|
|
53
|
+
const groups = new Map();
|
|
54
|
+
const times = [];
|
|
55
|
+
for (const r of f.rows) {
|
|
56
|
+
for (const k of ["url", "proc", "body", "capturedAt"]) if (typeof r?.[k] !== "string") die(`${p}: row without ${k}`);
|
|
57
|
+
let u;
|
|
58
|
+
try { u = new URL(r.url); } catch { die(`${p}: bad url ${r.url}`); }
|
|
59
|
+
if (!/^(localhost|127\.0\.0\.1|\[::1\])$|\.localhost$/.test(u.hostname)) die(`${p}: url ${r.url} is not on a local host`);
|
|
60
|
+
if (!ports.includes(u.port)) die(`${p}: url ${r.url} is not on port ${ports.join("/")}`);
|
|
61
|
+
const t = Date.parse(r.capturedAt);
|
|
62
|
+
if (Number.isNaN(t)) die(`${p}: bad capturedAt ${r.capturedAt}`);
|
|
63
|
+
times.push(t);
|
|
64
|
+
if (!groups.has(r.proc)) groups.set(r.proc, new Set());
|
|
65
|
+
groups.get(r.proc).add(createHash("sha256").update(r.body).digest("hex"));
|
|
66
|
+
}
|
|
67
|
+
return { run: f.run, groups, times };
|
|
68
|
+
};
|
|
69
|
+
const B = load(pb, o.beforePorts);
|
|
70
|
+
const A = load(pa, o.afterPorts);
|
|
71
|
+
if (B.run !== A.run) die(`runs differ: ${B.run} vs ${A.run}. One browser run must produce both files; merge nothing`);
|
|
72
|
+
if (!o.log || !existsSync(o.log)) die(`no run log at ${o.log}`);
|
|
73
|
+
let start = null;
|
|
74
|
+
let end = null;
|
|
75
|
+
for (const line of readFileSync(o.log, "utf8").split("\n")) {
|
|
76
|
+
const c = line.split("\t");
|
|
77
|
+
if (c.length >= 5 && c[3] === B.run) {
|
|
78
|
+
if (c[0] === "start") start = Date.parse(c[1]);
|
|
79
|
+
if (c[0] === "end" && c[4].trim() === "0") end = Date.parse(c[1]);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (start === null || end === null) die(`run ${B.run} has no start and end rc 0 in ${o.log}`);
|
|
83
|
+
const slack = (o.slack ?? 5) * 1000;
|
|
84
|
+
if ([...B.times, ...A.times].some((t) => t < start - slack || t > end + slack)) die(`capturedAt outside run ${B.run} window ${new Date(start).toISOString()}..${new Date(end).toISOString()}`);
|
|
85
|
+
for (const p of o.expect) {
|
|
86
|
+
if (!B.groups.has(p)) die(`expected procedure ${p} has no rows in bodies.before.json`);
|
|
87
|
+
if (!A.groups.has(p)) die(`expected procedure ${p} has no rows in bodies.after.json`);
|
|
88
|
+
}
|
|
89
|
+
const lines = [];
|
|
90
|
+
let differ = false;
|
|
91
|
+
for (const k of [...new Set([...B.groups.keys(), ...A.groups.keys()])].sort()) {
|
|
92
|
+
const b = B.groups.get(k);
|
|
93
|
+
const a = A.groups.get(k);
|
|
94
|
+
const same = b && a && b.size === a.size && [...b].every((h) => a.has(h));
|
|
95
|
+
if (!same) differ = true;
|
|
96
|
+
lines.push(`${same ? "same" : "DIFF"} ${k} ${b?.size ?? 0} ${a?.size ?? 0}`);
|
|
97
|
+
}
|
|
98
|
+
return { lines, differ };
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function parse(argv) {
|
|
102
|
+
const o = { _: [], expect: [], beforePorts: [], afterPorts: [] };
|
|
103
|
+
for (let i = 0; i < argv.length; i++) {
|
|
104
|
+
const a = argv[i];
|
|
105
|
+
const next = () => argv[++i];
|
|
106
|
+
if (a === "--expect") o.expect = next().split(",").filter(Boolean);
|
|
107
|
+
else if (a === "--before-ports") o.beforePorts = next().split(",");
|
|
108
|
+
else if (a === "--after-ports") o.afterPorts = next().split(",");
|
|
109
|
+
else if (a === "--log") o.log = next();
|
|
110
|
+
else if (a === "--slack") o.slack = Number(next());
|
|
111
|
+
else if (a === "--help" || a === "-h") o.help = true;
|
|
112
|
+
else if (a === "--self-test") o.selfTest = true;
|
|
113
|
+
else if (a.startsWith("--")) { console.error(`bodies-check: unknown flag ${a}. See --help`); process.exit(2); }
|
|
114
|
+
else o._.push(a);
|
|
115
|
+
}
|
|
116
|
+
return o;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function selfTest() {
|
|
120
|
+
const root = mkdtempSync(join(tmpdir(), "bc-"));
|
|
121
|
+
let failed = 0;
|
|
122
|
+
const t0 = Date.parse("2026-01-01T10:00:00Z");
|
|
123
|
+
const iso = (s) => new Date(t0 + s * 1000).toISOString();
|
|
124
|
+
const row = (port, proc, body, s) => ({ url: `http://localhost:${port}/rpc/${proc}`, proc, body, capturedAt: iso(s) });
|
|
125
|
+
const log = join(root, "runs.log");
|
|
126
|
+
writeFileSync(log, [`start\t${iso(0)}\tslot1\tRUN-A\t`, `end\t${iso(60)}\tslot1\tRUN-A\t0`, `start\t${iso(100)}\tslot1\tRUN-B\t`, `end\t${iso(160)}\tslot1\tRUN-B\t0`, `start\t${iso(200)}\tslot1\tRUN-C\t`, `end\t${iso(210)}\tslot1\tRUN-C\t1`, ""].join("\n"));
|
|
127
|
+
const opts = (extra = {}) => ({ beforePorts: ["5183", "5184"], afterPorts: ["5173", "5174"], log, expect: ["items/update"], ...extra });
|
|
128
|
+
const mk = (name, before, after) => {
|
|
129
|
+
const d = join(root, name);
|
|
130
|
+
mkdirSync(d);
|
|
131
|
+
if (before) writeFileSync(join(d, "bodies.before.json"), JSON.stringify(before));
|
|
132
|
+
if (after) writeFileSync(join(d, "bodies.after.json"), JSON.stringify(after));
|
|
133
|
+
return d;
|
|
134
|
+
};
|
|
135
|
+
const expectReject = (name, dir, o, re) => {
|
|
136
|
+
try { check(dir, o); failed++; console.error(`FAIL ${name}: accepted`); } catch (e) {
|
|
137
|
+
if (e instanceof Reject && re.test(e.message)) console.log(`ok ${name}`);
|
|
138
|
+
else { failed++; console.error(`FAIL ${name}: ${e.message}`); }
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
const good = (run) => ({
|
|
142
|
+
b: { run, rows: [row(5183, "items/update", '{"count":2}', 10), row(5184, "items/create", '{"a":1}', 12)] },
|
|
143
|
+
a: { run, rows: [row(5173, "items/update", '{"count":2}', 11), row(5174, "items/create", '{"a":1}', 13)] },
|
|
144
|
+
});
|
|
145
|
+
const g = good("RUN-A");
|
|
146
|
+
let r = check(mk("good", g.b, g.a), opts());
|
|
147
|
+
if (!r.differ && r.lines.every((l) => l.startsWith("same"))) console.log("ok valid pair passes"); else { failed++; console.error("FAIL valid pair"); }
|
|
148
|
+
const dif = good("RUN-A");
|
|
149
|
+
dif.a.rows[0].body = '{"count":3}';
|
|
150
|
+
r = check(mk("diff", dif.b, dif.a), opts());
|
|
151
|
+
if (r.differ && r.lines.some((l) => l.startsWith("DIFF items/update"))) console.log("ok differing bodies reported as DIFF"); else { failed++; console.error("FAIL diff"); }
|
|
152
|
+
// Two files merged from two different real runs: each run is valid alone, the pair is not.
|
|
153
|
+
const m = { b: good("RUN-A").b, a: good("RUN-B").a };
|
|
154
|
+
m.a.rows.forEach((x) => (x.capturedAt = iso(105)));
|
|
155
|
+
expectReject("merged pair from two runs", mk("merged", m.b, m.a), opts(), /runs differ/);
|
|
156
|
+
const inside = good("RUN-A"); inside.b.rows[0].capturedAt = iso(500);
|
|
157
|
+
expectReject("capturedAt outside the run window", mk("late", inside.b, inside.a), opts(), /outside run/);
|
|
158
|
+
const g2 = good("RUN-A"); g2.b.rows[0].capturedAt = iso(63);
|
|
159
|
+
r = check(mk("slack", g2.b, g2.a), opts()); console.log("ok inside slack accepted");
|
|
160
|
+
expectReject("slack zero rejects the same row", mk("slack0", g2.b, g2.a), opts({ slack: 0 }), /outside run/);
|
|
161
|
+
const bad = good("RUN-C");
|
|
162
|
+
expectReject("run that ended rc 1", mk("rc1", bad.b, bad.a), opts(), /no start and end rc 0/);
|
|
163
|
+
const unk = good("RUN-Z");
|
|
164
|
+
expectReject("run id not in the log", mk("unk", unk.b, unk.a), opts(), /no start and end/);
|
|
165
|
+
expectReject("empty rows", mk("empty", { run: "RUN-A", rows: [] }, g.a), opts(), /no rows/);
|
|
166
|
+
const gi = good("RUN-A");
|
|
167
|
+
expectReject("byte-identical files", mk("ident", gi.b, gi.b), opts(), /byte-identical/);
|
|
168
|
+
const swapped = good("RUN-A");
|
|
169
|
+
swapped.b.rows[0].url = "http://localhost:5173/rpc/items/update";
|
|
170
|
+
expectReject("before row on an after port", mk("ports", swapped.b, swapped.a), opts(), /not on port/);
|
|
171
|
+
const remote = good("RUN-A");
|
|
172
|
+
remote.a.rows[0].url = "https://app.example.com:5173/rpc/items/update";
|
|
173
|
+
expectReject("a row from a non-local host", mk("remote", remote.b, remote.a), opts(), /not on a local host/);
|
|
174
|
+
const miss = good("RUN-A");
|
|
175
|
+
miss.a.rows = miss.a.rows.filter((x) => x.proc !== "items/update");
|
|
176
|
+
expectReject("expected procedure missing in after", mk("miss", miss.b, miss.a), opts(), /expected procedure items\/update has no rows in bodies.after/);
|
|
177
|
+
expectReject("expected procedure never run in either file", mk("miss2", g.b, g.a), opts({ expect: ["items/delete"] }), /items\/delete/);
|
|
178
|
+
expectReject("missing file", mk("nofile", g.b, null), opts(), /missing/);
|
|
179
|
+
// The log subcommand writes lines this checker accepts.
|
|
180
|
+
const lg = join(root, "made.log");
|
|
181
|
+
const me = fileURLToPath(import.meta.url);
|
|
182
|
+
spawnSync(process.execPath, [me, "log", lg, "start", "RUN-L"]);
|
|
183
|
+
spawnSync(process.execPath, [me, "log", lg, "end", "RUN-L", "0"]);
|
|
184
|
+
const now = Date.now();
|
|
185
|
+
const lrow = (port, at) => ({ url: `http://localhost:${port}/rpc/items/update`, proc: "items/update", body: "{}", capturedAt: new Date(at).toISOString() });
|
|
186
|
+
const lb = { run: "RUN-L", rows: [lrow(5183, now)] };
|
|
187
|
+
const la = { run: "RUN-L", rows: [lrow(5173, now + 1)] };
|
|
188
|
+
r = check(mk("logged", lb, la), opts({ log: lg }));
|
|
189
|
+
if (!r.differ) console.log("ok run log written by the log subcommand is accepted"); else { failed++; console.error("FAIL log subcommand"); }
|
|
190
|
+
rmSync(root, { recursive: true, force: true });
|
|
191
|
+
if (failed) { console.error(`${failed} self-test failure(s)`); process.exit(1); }
|
|
192
|
+
console.log("all as expected");
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
|
196
|
+
const o = parse(process.argv.slice(2));
|
|
197
|
+
if (o.help) console.log(HELP);
|
|
198
|
+
else if (o.selfTest) selfTest();
|
|
199
|
+
else if (o._[0] === "log") {
|
|
200
|
+
const [, file, event, id, rc = ""] = o._;
|
|
201
|
+
if (!file || !["start", "end"].includes(event) || !id) { console.error("usage: bodies-check.mjs log <run log> start|end <RUN_ID> [rc]"); process.exit(2); }
|
|
202
|
+
appendFileSync(file, `${event}\t${new Date().toISOString()}\tmain\t${id}\t${event === "end" ? rc : ""}\n`);
|
|
203
|
+
} else {
|
|
204
|
+
if (!o._[0] || !o.beforePorts.length || !o.afterPorts.length || !o.log) { console.error("needs <dir> --before-ports --after-ports --log (and --expect). See --help"); process.exit(2); }
|
|
205
|
+
if (!o.expect.length) { console.error("--expect is required: the verifier brief lists the procedures the diff's write lines call"); process.exit(2); }
|
|
206
|
+
try {
|
|
207
|
+
const { lines, differ } = check(o._[0], o);
|
|
208
|
+
console.log(lines.join("\n"));
|
|
209
|
+
process.exit(differ ? 1 : 0);
|
|
210
|
+
} catch (e) {
|
|
211
|
+
if (e instanceof Reject) { console.log(`REJECT ${e.message}`); process.exit(2); }
|
|
212
|
+
throw e;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|