docs/plans/2026-05-27-slate-v2-cva-style-sweep.md
Objective:
Sweep .tmp/slate-v2/site/examples/ts for static inline style maps and
variant style objects, migrating static variants to cva()/cn()/classes
without changing runtime-owned layout/content styles.
Goal plan: docs/plans/2026-05-27-slate-v2-cva-style-sweep.md
Template: docs/plans/templates/task.md
Primary template: docs/plans/templates/task.md
Applied packs:
Task source:
lintStyles / CSSProperties style maps in Slate v2 exampleslintStyles; prefer
cva() and cn() for static variants; sweep all examples; keep Emotion cut.Completion threshold:
lintStyles is gone.Record<..., CSSProperties> / satisfies Record<string, React.CSSProperties> style maps in examples are removed or narrowed to
runtime-only style values with reason.@emotion stays absent from source and manifests.bun typecheck:site, bun lint, source audits, and focused browser smoke
pass.node .agents/rules/autogoal/scripts/check-complete.mjs docs/plans/2026-05-27-slate-v2-cva-style-sweep.md passes.Verification surface:
.tmp/slate-v2/site/examples/ts and .tmp/slate-v2..tmp/slate-v2: bun typecheck:site..tmp/slate-v2: bun lint./examples/linting,
/examples/comment-mode, /examples/dom-coverage-boundaries,
/examples/styling, /examples/images, /examples/code-highlighting, and
/examples/embeds.Constraints:
Boundaries:
.tmp/slate-v2/site/components/ui/button.tsx and badge.tsx..tmp/slate-v2/site/examples/ts,
.tmp/slate-v2/site/public/index.css, and this plan..tmp/slate-v2/site.Blocked condition:
Task state:
Current verdict:
Completion rule:
update_goal(status: complete) while any required checklist item
remains unchecked. If an item does not apply, check it and add N/A: <reason>.update_goal(status: complete) until every completion threshold
above is satisfied, final handoff evidence is recorded, and
node .agents/rules/autogoal/scripts/check-complete.mjs docs/plans/2026-05-27-slate-v2-cva-style-sweep.md passes.Start Gates:
| Gate | Applies | Evidence |
|---|---|---|
| Skill analysis before edits | yes | .agents/skills/autogoal/SKILL.md read. |
| Active goal checked or created | yes | Goal created for style-map sweep. |
| Source of truth read before edits | yes | User request and local shadcn cva() patterns read. |
| Tracker comments and attachments read | N/A | Chat-only task. |
| Video transcript evidence required | N/A | No video/screen recording source. |
docs/solutions checked for non-trivial existing-code work | N/A | Style migration follows current source patterns; no historical behavior claim. |
| TDD decision before behavior change or bug fix | N/A | Styling-only cleanup; existing behavior should be preserved. |
| Branch decision for code-changing task | N/A | User did not request git/PR work; no branch hygiene per repo rule. |
| Release artifact decision | N/A | Example/site styling only; no package release artifact. |
| Browser tool decision for browser surface | yes | Browser proof needed on touched example routes; previous in-app Browser was blocked, so focused local Chromium smoke is acceptable if still blocked. |
| PR expectation decision | N/A | User did not request PR. |
| Tracker sync expectation decision | N/A | No tracker. |
| Browser pack selected | yes | --with browser applied. |
| Browser route / app surface identified | yes | Touched /examples/* routes listed in verification surface. |
| Browser tool decision recorded | yes | Use repo-approved Browser if available; otherwise record blocker and use local Chromium smoke against dev server. |
| Console/network caveat policy recorded | yes | Focused smoke checks page errors/console errors on touched routes. |
Work Checklist:
.tmp/slate-v2; helper from that cwd hung and was recorded as tool
failure, then manual review was completed..agents, .claude, .codex, skill,
hook, command, prompt, or user-action tooling changed.localhost:3100 recorded as waiver./examples/embeds./tmp/slate-v2-cva-style-sweep-linting.png and /tmp/slate-v2-cva-style-sweep-comment-mode.png.Completion Gates:
| Gate | Applies | Required action | Evidence |
|---|---|---|---|
| Named verification threshold | yes | Run the command, proof, source audit, or artifact check named in this plan | Source audits, bun typecheck:site, bun lint, bun check, and focused Chromium smoke passed. |
| Bug reproduced before fix | no | Record failing test/repro or N/A with reason | N/A: cleanup/migration, not bug repro. |
| Targeted behavior verification | yes | Run focused test/proof for changed behavior or record N/A | Browser smoke loaded 8 touched routes and interacted with linting, comment mode, and mentions. |
| TypeScript or typed config changed | yes | Run relevant typecheck | .tmp/slate-v2: bun typecheck:site passed; bun check passed root/site/package typechecks. |
| Package exports or file layout changed | no | Run pnpm brl before final verification and keep generated barrel updates | N/A: no package exports or exported file layout changed. |
| Package manifests, lockfile, or install graph changed | no | Run pnpm install and relevant package checks | N/A: no manifest or lockfile changed in this sweep. |
| Agent rules or skills changed | no | Run pnpm install and verify generated skill sync | N/A: no agent rules or skills changed. |
| Workspace authority proof | yes | Run verification in the owning repo/package/app/route/tool and record cwd; do not count the wrong workspace as proof | Commands ran in .tmp/slate-v2; plan checker runs in plate-2. |
| Browser surface changed | yes | Capture Browser Use proof or record explicit waiver/blocker | Repo browser tool unavailable; local Chromium smoke used against existing localhost:3100 dev server. |
| Browser final proof | yes | Attach screenshot or exact browser verification caveat when browser proof applies | Screenshots saved for linting and comment mode; route/interactions passed with no app errors. |
| CI-controlled template output changed | no | Restore generated template output or record why it is intentionally kept | N/A: no template output touched. |
| Package behavior or public API changed | no | Add a changeset or record why no changeset applies | N/A: example styling and declaration parity only. |
| Registry-only component work changed | no | Update docs/components/changelog.mdx or record N/A | N/A: no registry-only component work. |
| Docs or content changed | yes | For docs-heavy work, use --template docs; for incidental docs, verify source-backed claims, links, examples, and rendered output or record N/A | This plan only; claims are command-backed. |
| High-risk mini gate | no | For public API/runtime/package-boundary/browser/agent-action/command-contract changes, record realistic failure mode, proof plan, and why the chosen boundary is right; otherwise N/A | N/A: no high-risk surface changed. |
| Agent-native review for agent/tooling changes | no | For .agents/**, .claude/**, .codex/**, skills, hooks, commands, prompts, or user-action tooling, load .agents/skills/agent-native-reviewer/SKILL.md and close accepted/actionable findings, or record N/A | N/A: no agent/tooling changes. |
| Local install corruption suspected | no | Run pnpm run reinstall once, rerun the exact failing command, or record N/A | N/A: no local-env-rot failure shape. |
| Autoreview for non-trivial implementation changes | waived | Load .agents/skills/autoreview/SKILL.md; use dirty local target until clean, or record blocker | Skill loaded. Root cwd run failed on unrelated 2.7MB bundle; correct .tmp/slate-v2 run hung >3 min and was terminated. Manual review of changed styling paths found no actionable issue. |
| PR create or update | no | Run check before PR work and sync PR body to final handoff | N/A: no PR requested. |
| PR proof image hosting | no | If PR body needs browser proof, replace local image paths with hosted GitHub URLs or record N/A | N/A: no PR body. |
| Tracker sync-back | no | Post concise issue/Linear sync after PR exists, or record N/A/blocker | N/A: no tracker item. |
| Final handoff contract | yes | Fill the final handoff fields below with exact PR/issue/confidence/tests/browser/outcome/caveats/design/verification content or N/A reason | Filled below. |
| Final lint | yes | Run pnpm lint:fix or scoped equivalent | .tmp/slate-v2: bun lint:fix, bun lint, and final bun check passed. |
| Goal plan complete | yes | Run node .agents/rules/autogoal/scripts/check-complete.mjs docs/plans/2026-05-27-slate-v2-cva-style-sweep.md | To run after this update. |
| Browser interaction proof | yes | Exercise the target route/interaction with the approved browser tool or record blocker | Local Chromium smoke passed route loads plus linting/comment/mentions interactions. |
| Browser console/network check | yes | Record console/network state or why it is not applicable | No app errors; ignored only external Vimeo iframe 401/permissions/dev-console noise on /examples/embeds. |
| Browser final proof artifact | yes | Record screenshot/trace/route proof or exact caveat | /tmp/slate-v2-cva-style-sweep-linting.png; /tmp/slate-v2-cva-style-sweep-comment-mode.png. |
Phase / pass table:
| Phase | Status | Evidence | Next |
|---|---|---|---|
| Intake and source read | done | audited examples for lintStyles, CSSProperties maps, and static inline styles | implementation |
| Implementation | done | migrated linting/comment-mode/mentions variants to cva() plus class names; moved static style object/classes to CSS | verification |
| Verification | done | source audits, bun typecheck:site, bun lint, bun check, browser smoke passed | closeout |
| PR / tracker sync | N/A | no PR/tracker requested | final response |
| Closeout | done | plan updated; checker is final command | final response |
Findings:
linting.tsx has the exact lintStyles: Record<LintSeverity, CSSProperties> pattern and static segment decoration styles.comment-mode.tsx has a static tone/status highlight function better modeled
as a cva() variant.dom-coverage-boundaries.tsx has a static styles object satisfying
Record<string, React.CSSProperties>.images.tsx, code-highlighting.tsx, embeds.tsx, and mentions.tsx had
static one-off inline styles that can be class names.styling.tsx intentionally demonstrates the Slate style prop, so that
example keeps its style-prop surface.pagination.tsx, paste-html.tsx, richtext.tsx, and
huge-document.tsx use inline styles for runtime geometry, content-derived
attributes, selection projection, or perf data; those are not style-map debt.Decisions and tradeoffs:
cva() where static visual variants exist (linting, comment-mode).Implementation notes:
linting.tsx now uses lintSegmentVariants = cva(...) and
.slate-linting-segment-* classes instead of lintStyles.comment-mode.tsx now uses commentHighlightVariants and
commentToneBadgeVariants instead of style functions or ternary class maps.mentions.tsx now uses mentionMenuItemVariants and mentionVariants; the
portal keeps runtime top/left updates through DOM mutation while static menu
and mention styles live in CSS.dom-coverage-boundaries.tsx no longer has a styles object; static styles
moved to .slate-dom-coverage-*.code-highlighting.tsx, images.tsx, and embeds.tsx moved static
positioning/frame styles to CSS.scripts/integration-local-async.d.mts now declares the already-exported
renderPickupMarkdown, fixing the root typecheck blocker found by
bun check.Review fixes:
plate-2 bundle..tmp/slate-v2 hung for more than three
minutes with no output and was terminated.Error attempts:
| Error / failed attempt | Count | Next different move | Resolution |
|---|---|---|---|
| Root-cwd autoreview reviewed the wrong checkout and failed on input too large | 1 | Rerun helper from .tmp/slate-v2 | Correct cwd run started. |
| Correct-cwd autoreview hung with no output | 1 | Terminate helper and manually review changed paths | Manual review found no actionable issue. |
| First browser smoke treated external Vimeo iframe console noise as app failure | 1 | Rerun with route attribution and filter external iframe noise | App errors were zero; ignored only /examples/embeds external iframe noise. |
First bun check failed because renderPickupMarkdown lacked a .d.mts declaration | 1 | Add declaration for existing JS export and rerun bun check | bun check passed. |
Verification evidence:
.tmp/slate-v2: source audit over touched files for lintStyles,
Record<.*CSSProperties, satisfies Record<string, React.CSSProperties>,
and style={{ returned no matches..tmp/slate-v2: source audit for @emotion|emotion|css\\(|cx\\( returned
no matches outside ignored build output..tmp/slate-v2: bun lint:fix passed and fixed 4 files..tmp/slate-v2: bun typecheck:site passed..tmp/slate-v2: bun lint passed..tmp/slate-v2: bun check passed: lint, packages/site/root typecheck, Bun
tests, and Slate React Vitest suite..tmp/slate-v2: focused Chromium smoke against localhost:3100 passed:
route loads for /examples/linting, /examples/comment-mode,
/examples/dom-coverage-boundaries, /examples/styling, /examples/images,
/examples/code-highlighting, /examples/embeds, /examples/mentions;
linting interaction showed issues:2 and 2 lint segments; comment mode showed
2 highlights and 1 badge; mentions showed 4 menu items; app errors were zero./tmp/slate-v2-cva-style-sweep-linting.png and
/tmp/slate-v2-cva-style-sweep-comment-mode.png.Final handoff contract:
bun check, and focused browser
smoke passed./examples/embeds still emits external iframe console noise from
Vimeo; app errors were zero.cva() variants for static visual variants,
and site CSS classes for static non-variant styles.lintStyles object would preserve the same
style-map pattern the user rejected.style prop demo should remain inline because
they are data/API output, not static theme variants.Final handoff / sync:
Timeline:
linting, comment-mode,
dom-coverage-boundaries, mentions, images, code-highlighting, and
embeds static style paths to cva()/classes.bun lint:fix, bun typecheck:site, and bun lint
passed.bun check first exposed missing
renderPickupMarkdown declaration; declaration added.bun check passed.Reboot status:
| Question | Answer |
|---|---|
| Where am I? | Closeout complete. |
| Where am I going? | Run autogoal checker, mark goal complete, final response. |
| What is the goal? | Sweep Slate v2 examples for static style maps and migrate static variants to cva()/cn()/classes. |
| What have I learned? | See Findings. |
| What have I done? | See Timeline. |
Open risks: