Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/lukebennett88/luke-ui. ui.lukebennett.dev
Something went wrong. Try again.
luke-ui AGENTS.md
4.0 kB
Markdown
Luke UI agent guide #
- Use
catalog:dependency versions inpackage.json. The catalog lives inpnpm-workspace.yaml. Do not add raw versions. See docs/DEPENDENCIES.md. - Read docs/CONVENTIONS.md, docs/COMPONENTS.md, docs/DOCUMENTATION.md, docs/PUBLIC_API.md, docs/STYLING.md, and docs/TESTING.md before changing code, styles, docs, or tests.
- Read docs/TESTING.md before adding or changing tests. It is the only normative testing guide.
- Run tasks through Turbo from the repo root, for example
pnpm run checkorpnpm run build. Package-local scripts can skip Turbogeneratedependencies, which can leave generated files missing. - Scaffold components non-interactively:
pnpm run generate:component --args <name> <docs-group>. - Scaffold primitives non-interactively:
pnpm run generate:primitive --args <name>. - When you change code, update or delete the docs that describe it in the same change. This includes
comments, JSDoc, MDX files in
apps/docs/content/docs/,README.md, package READMEs, and files indocs/. See docs/DOCUMENTATION.md. - docs/DOCUMENTATION.md is the only normative documentation guide. It decides what belongs in documentation as well as how to word MDX prose, JSDoc, and code comments.
- For JavaScript and TypeScript code style, follow docs/CONVENTIONS.md#code-style.
Dev loop #
- Run
pnpm run checkfrom the repo root before committing.checkcovers barrels, format, lint, types, and docs but not tests. Runpnpm run testseparately.test.ymlruns component, docs, and consumer tests. Visual regression has its own workflow. - Run
pnpm run test:consumerwhen a change touches the published package, its dependencies, or its exports. It packs the workspace build and installs it with npm outside the repository. Those installs need network access, sopnpm run testleaves it out. - Component prose lives in MDX files in
apps/docs/content/docs/, not.docs.mdfiles in the package. Update the relevant MDX page in the same change as component code. - Do not add or edit
.docs.mdfiles inpackages/@luke-ui/react/src/.
Verification traps #
- A package-local
check:*run is not what CI runs. Only the rootpnpm run checkrunscheck:format-root, which covers files outside packages such asdocs/*.md, and knip (check:cycles,check:unused). Ifcheck:format-rootfails on Markdown wrapping, runpnpm run fix:format-root. Do not re-wrap by hand. - The Turbo cache is shared across worktrees, so
FULL TURBOcan replay another branch's result. For a real run, useTURBO_FORCE=true pnpm run test. Do not usepnpm run test -- --force, because the flag goes to the package script. - publint runs on every build through
publint: trueinpackages/@luke-ui/react/vite.config.ts. Do not add acheck:publintscript. - Lint rules live in the
lintblock of the rootvite.config.ts. A.oxlintrc.jsonfile is ignored, and oxlint has nono-restricted-syntaxrule. Twolint.overridesentries matching the same file and rule do not merge: the later entry wins. - In
apps/docs, asrc/lib/module imported by a client component must not importnode:fsornode:path. If it does, the page returns HTTP 200 but its MDX body renders empty.
Turborepo #
- Turbo configuration, tasks, and CLI behaviour can vary with the installed version; do not rely on training data alone.
- Before changing Turbo config or commands, resolve the installed
turbopackage (for examplenode -p "require.resolve('turbo/package.json')"from a workspace that depends onturbo). - Read that package's bundled
docs/README.mdand relevant files underdocs/; those docs match the installed version and are available offline.