Repository navigation
chore(harness): use harnesspm in UI Kit's own repo - #1655
Conversation
Agents that work on UI Kit now get the harnesses of the packages it builds on, from the installed versions, through the same block consumers get. - `harnesspm init` adds `harnesspm sync` to `prepare` (after `husky install`), `harnesspm.json`, the lock, and `CLAUDE.md` with `@AGENTS.md`. - `harnesspm.json` trusts `@tenphi/tasty`, `@tenphi/glaze` and `@tenphi/eslint-plugin-tasty`, so their tools and the lint hook run here. - Its patches fit the shipped rules to this repo. They name `dist/`, which is missing or stale here, a consumer's own Glaze theme, and the plugin's own lint, which ignores UI Kit's `oxlint-disable` comments and settings. The block now points at `pnpm probe`, `src/tokens/palette.ts` and `pnpm exec oxlint`. - A root `CLAUDE.md` makes Claude Code skip nested `AGENTS.md` files, so each folder that has one gets a `CLAUDE.md` that imports it. - `update-tasty` and `update-glaze` sync after `pnpm add`, which runs no `prepare`. - The block is wrapped in prettier-ignore: Prettier adds blank lines inside it, and `harnesspm sync --check` then fails. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Gr8S7Ed6WF7j8cpXBKzCuV
The hand-made `docs/tasty` and `docs/glaze` symlinks into `node_modules` are gone. AGENTS.md points at the docs indexes in the harnesspm block, which `pnpm install` writes for the pinned versions, and names the pages to start with. The review and probe rules link the same pages through harnesspm's stable package paths (`node_modules/.harnesspm/pkgs/...`). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Gr8S7Ed6WF7j8cpXBKzCuV
`pnpm install` runs `harnesspm sync` in `prepare`, and with `CI=true` it still rewrites the committed outputs. So a later `harnesspm sync --check` passes on a PR that forgot to sync. The lint job now checks right after the install that `AGENTS.md`, `CLAUDE.md`, `harnesspm.json` and the lock did not change, and tells the author to run `pnpm exec harnesspm sync`. It uses `git status`, so a file the sync created also counts. The CI planner reads `harnesspm.json`, its lock and `harnesspm/` as repository notes: only the lint job checks them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Gr8S7Ed6WF7j8cpXBKzCuV
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
📦 NPM canary releaseDeployed canary version 0.0.0-canary-f7776c2. |
🏋️ Size limit report
Third-party packages✅ No third-party package entered or left the bundle, and none grew more than 10 KB past its approved size. No module-level report for this run — Statoscope needs a baseline build to diff against. |
🧪 Storybook is successfully deployed!
|
Describe changes
Agents that work on
@cube-dev/ui-kitnow get the harnesses of the packages it builds on (Tasty, Glaze and the Tasty lint plugin) from the installed versions, through harnesspm. They replace the hand-madedocs/tastyanddocs/glazesymlinks. UI Kit's ownharness/becomes the project layer here, so contributors see what consumers see, plus four patches for this repo.Stacked on #1643. Retarget to
mainafter #1643 merges.What changed
harnesspm init, run as a person:prepareis nowhusky install && harnesspm sync, plusharnesspm.json,harnesspm.lock.json, andCLAUDE.mdwith@AGENTS.md.@tenphi/tasty,@tenphi/glazeand@tenphi/eslint-plugin-tasty, astrue, since@tenphi/*packages are ours. Their tools (tasty:styles,glaze:*,tasty-lint:check) and the lint-on-edit hook now run here.uikit:tokenscomes from the project layer, which is trusted already.harnesspm/patches/, for this repo only (see the decisions below).CLAUDE.mdfiles. A rootCLAUDE.mdturns off Claude Code's reading of nestedAGENTS.mdfiles: with aCLAUDE.mdin the working folder or above, it reads onlyCLAUDE.mdfiles (docs). So each of the five folders that has one gets aCLAUDE.mdwith@AGENTS.md.docs/rules/review.mdanddocs/rules/probe.mdlink the pages through harnesspm's stable paths (node_modules/.harnesspm/pkgs/@tenphi/…).update-tasty/update-glazekeep the version bump, then runharnesspm sync, becausepnpm addruns noprepare. They had no symlink steps.<!-- prettier-ignore-start -->/-end -->, outside harnesspm's markers. Prettier adds a blank line afterBEGIN:harnesspmand beforeEND:harnesspm, andharnesspm sync --checkthen fails. harnesspm leaves text outside its markers alone.No changeset: consumers get nothing new.
filesis unchanged, andpreparedoes not run when a package is installed from the registry.What agents working on UI Kit now get
The managed block at the end of
AGENTS.md:@tenphi/eslint-plugin-tasty1.19.0tasty-lint:rules/usage(patched here), the rule-page index,tasty-lint:check, thePostToolUselint hook@tenphi/glaze3.1.0glaze:rules/colors(UI Kit's patch, then this repo's), the docs index, theglaze-themeskill,glaze:inspect/glaze:color/glaze:contrast@tenphi/harnesspm0.3.0harnesspm:rules/generated-files, the file-scopedharnesspm-configrule, the docs index, theharnesspm-import/-export/-improveskills@tenphi/tasty3.19.1tasty:rules/usage(UI Kit's patch, then this repo's), the docs index,tasty:styles@cube-dev/ui-kit(this project)uikit:rules/usage(patched here), the docs index,uikit:tokensIn this repo, UI Kit's docs index lists every page in
src/, not only the shipped ones: specs, READMEs and the nestedAGENTS.mdfiles too. For contributors that helps.Decisions about the project layer
Each shipped text is right for consumers and misleads only here, so the fixes live in
harnesspm.jsonpatches, not inharness/.uikit:rules/usage, Componentsuikit:rules/usage, Stylinguikit:tokensdist/. In a fresh checkout:cannot find UI Kit's build at …/dist/tokens/palette.js. After a build, it can be out of date.pnpm probe tokens --filter <part>glaze:rules/colors, Where colors come fromglaze.color()"src/tokens/palette.tsbuilds it with Glaze. A theme of a component's own is the wrong fix.glaze:rules/colors, Checking a themeglaze:inspecton the theme's fileglaze:inspect src/tokens/palette.tsfails (Cannot find module …/lazy-styles: imports without extensions).dist/tokens/palette.jsexports no palette object either:getPalette()builds it.pnpm probe tokens --jsonacross all four schemes, andpnpm test -- src/tokens.glaze:colorandglaze:contrastwork and stay.tasty:rules/usage, Checking stylestasty:styles … --setup @cube-dev/ui-kit/dist/components/Root.jsdist/:cannot resolve --setup. With it, it may be out of date. AGENTS.md already sayspnpm probe.pnpm probe styles '<json>'tasty:rules/usage, Writing stylesai-agents.md; project tokens only; nostyleproptasty-lint:rules/usage, both sectionstasty-lint:check; exceptions aseslint-disable-next-lineButton.tsx,tasty-lint:checkreports 6 problems (1 error) andpnpm exec oxlintreports none. Each flagged line carries// oxlint-disable-next-line tasty/… -- <reason>, which ESLint ignores (src/has 79 of those and 4 in theeslintspelling). The tools also run withouttypeAwareJSXandmergeFunctions. Fed a file with such a directive, the hook exits 2.pnpm exec oxlint <files>decides; exceptions in UI Kit's spelling. The hook stays: it reports only problems an edit adds.Size
pnpm exec harnesspm status: Codex 47.1 KiB of 32 KiB · Claude Code 368 lines.AGENTS.mdUI Kit's
AGENTS.mdwas over Codex's 32 KiB already. Codex cuts it in "Tasty and Glaze Documentation", so it misses the harness section, Stack, i18n, TypeScript & Exports, Testing and the whole block. Claude Code reads all of it. This PR cuts none of UI Kit's rules. Proposal, for a follow-up: move these sections into on-demand pages indocs/rules/, each with a one-line pointer in the "Rules" list:docs/rules/commands.md, keeping the five most-used commandsdocs/rules/harness.mddocs/rules/coding.md, keeping a two-line summarydocs/rules/linear.mddocs/rules/ci.mdstorybook.mdhas them in full already: one line eachThat moves about 18 KiB and brings
AGENTS.mdto about 30 KiB with the block. It also brings Claude Code nearer the vendor's advice of about 200 lines. Until then, a Codex user can raiseproject_doc_max_bytesin their own~/.codex/config.toml.CI
The lint job now runs this right after
pnpm install --frozen-lockfile:Why not
harnesspm sync --check: the install runsharnesspm syncinprepare, and withCI=trueit still rewrites the committed outputs. So--checkpasses on a PR that forgot to sync. Checked locally with harnesspm 0.3.0: after a patch edit without a sync,CI=true pnpm install --frozen-lockfilewas followed bysync --check→ ✅ "up to date", while this step failed with the message. It usesgit status, so a file the sync created counts too.scripts/ci/plan-jobs.mjs:harnesspm.json,harnesspm.lock.jsonandharnesspm/arerepo-notes. Only the lint job checks them, and nothing else reads them.CLAUDE.mdfiles fall undernotes.plan-jobs.test.mjscovers each path.Agent runs
Headless Claude Code 2.1.323 in the worktree, with the session variables unset. The task never mentions harnesspm, docs or tools: "The inline-size Badge looks cramped: give it more horizontal padding, about 1x instead of .5x. Also, the label of a disabled Badge is hard to read: pick a palette text color that reads better on its fill in both light and dark mode. Change only
Badge.tsx, and check the CSS your change produces before you finish."--permission-mode acceptEditsonly (13 tool calls). It made the padding edit, and the lint hook fired (PostToolUse:Edit, exit 0: no new problem). Then it stopped.pnpm install,pnpm probe tokens --filter surface-text(the patch's wording) andnode scripts/probe.mjsall need approval, and this repo allows none of them. It did not try the trusted harness tools, which are allowed.pnpm install,pnpm rebuild esbuild,pnpm probe *andpnpm exec oxlint *allowed, as a person would approve them (20 tool calls, 87 s):pnpm install:prepare→harnesspm sync, "Nothing changed";pnpm probe tokens --filter surface(the UI Kit patch), thenglaze:contrast(Glaze's rule) on the literal values: 8 measurements across the schemes;pnpm probe render(the Tasty patch points atprobe styles), and linted withpnpm exec oxlint(the lint patch): clean;#surfaceon that fill in dark mode (4.55:1). It proposed changing the fill instead (#surface-text-soft: 9.54:1 light, 7.17:1 dark).ai-agents.md, and never used theglaze-themeskill,uikit:tokensortasty:styles.The edits of both runs were discarded.
Checklist
Other information
Verification
pnpm lint,pnpm test:typesandpnpm check:harnesspass.scripts/ci/plan-jobs.test.mjsandsrc/harness.test.tspass (63 tests), and so does the full suite (pre-push).pnpm exec harnesspm sync --check: ✅ outputs up to date.pnpm exec harnesspm doctor, after a sync as a person: ✅ ready. 12 per-machine files are ignored and untracked, 17 per-machine outputs are in place, and nothing waits for trust..claude/content (theimplement,ui-review,entropy-review,create-ticketandmodern-web-guidanceskills, andlaunch.json) is untouched. harnesspm adds links next to it (.claude/skills/glaze-theme,harnesspm-*) and.claude/settings.local.json, all listed in.git/info/exclude.harnesspm syncin a copy without.git, like a deploy that installs without one: exit 0.Found along the way (for harnesspm and the lint plugin, not this PR)
BEGINor beforeEND), so a Prettier-formatted repo needs the ignore wrapper.harnesspm statussays "close to Codex's 32 KiB limit" at 47.1 KiB.harnesspm initadds a rootCLAUDE.md, which silences nestedAGENTS.mdfiles for Claude Code. It could add the sameCLAUDE.mdnext to each, as it does for workspaces.synccreates.git/harnesspm/state.json.harnesspm fetchhas nothing to download.eslint-plugin-tasty's tool and hook ignoreoxlint-disablecomments and the project'ssettings.tasty. In an Oxlint project they report lines its lint accepts.Generated by Claude Code