Back to Plate

Simplify Plate Registry Shadcn Semantics

docs/plans/2026-06-02-simplify-plate-registry-shadcn-semantics.md

53.0.818.5 KB
Original Source

Simplify Plate Registry Shadcn Semantics

Objective: Normalize Plate registry delivery around shadcn namespace semantics: Plate self-dependencies resolve as @plate/*, install docs present @plate as the default path, /init stays a convenience preset, and local-file compatibility remains intact.

Goal plan: docs/plans/2026-06-02-simplify-plate-registry-shadcn-semantics.md

Template: docs/plans/templates/task.md with docs and browser packs.

Task source:

  • type: user request
  • id / link: current Codex thread
  • title: Use latest shadcn registry semantics for Plate registry
  • acceptance criteria: @plate/* source normalization, install/MCP docs updated, shadcn parity rule updated, no generated registry output committed, focused tests/source checks/typecheck/lint/browser proof pass.

Completion threshold:

  • Registry source normalization maps bare Plate item dependencies to @plate/<name>.
  • Local template sync still accepts @plate/<name> and legacy Plate URL dependencies.
  • Install docs and /init/md present @plate as the default existing-project path.
  • /r/registries.json advertises the Plate namespace with central-index-aligned metadata.
  • Verification commands and Browser proof listed below pass.
  • node .agents/skills/autogoal/scripts/check-complete.mjs docs/plans/2026-06-02-simplify-plate-registry-shadcn-semantics.md passes.

Verification surface:

  • pnpm install
  • pnpm --filter www exec bun test src/lib/registry-install.test.ts src/lib/plate-init.test.ts src/app/r/registries.json/route.test.ts scripts/registry-dependencies.test.mts
  • pnpm --filter www exec tsx --tsconfig ./scripts/tsconfig.scripts.json scripts/check-registry-source.mts
  • pnpm --filter www exec tsx --tsconfig ./scripts/tsconfig.scripts.json scripts/check-docs-source-parity.mts
  • pnpm --filter www typecheck
  • pnpm lint:fix
  • Browser proof on http://localhost:3003/docs/installation/mcp, /docs/installation/docs, /init, /init/md, and /r/registries.json.

Constraints:

  • Do not run build:registry outside CI.
  • Do not manually edit generated apps/www/public/r, apps/www/public/rd, or template output.
  • Keep Plate source authoring custom where Plate content is genuinely custom.
  • Keep shadcn CLI as the installer and use shadcn registry semantics at the public boundary.

Boundaries:

  • Source of truth: [email protected], ../shadcn/apps/v4/content/docs/registry/*, apps/www/scripts/*registry*, apps/www/src/lib/plate-*.ts, content/docs/installation/*, .agents/rules/shadcn-parity.mdc.
  • Allowed edit scope: registry dependency normalization, registry source checks/tests, Plate init markdown, install/MCP docs, shadcn parity rule and generated skill mirror.
  • Browser surface: local www dev server at http://localhost:3003.
  • Tracker sync: N/A; no issue or PR was requested.
  • Non-goals: no registry build output, no Rhea/style registry adoption, no shadcn CLI fork, no template hand edits.

Output budget strategy:

  • Searches were scoped to registry/install surfaces and capped with max_output_tokens; broad rg output was followed by focused file reads and focused diffs.

Blocked condition:

  • Blocked only if [email protected] namespace APIs could not validate @plate/*, local-file sync broke, or Browser/dev server proof was unavailable.

Task state:

  • task_type: implementation
  • task_complexity: normal
  • current_phase: closeout
  • current_phase_status: completed
  • next_phase: final response
  • goal_status: active

Current verdict:

  • verdict: complete after final autogoal checker
  • confidence: high
  • next owner: none
  • reason: source contract, docs, rule mirror, tests, typecheck, lint, and Browser proof are complete.

Start Gates:

GateAppliesEvidence
Skill analysis before editsyesLoaded autogoal, sync-shadcn, docs-creator, browser skill, and shadcn parity rule.
Active goal checked or createdyesCreated active goal for Plate registry shadcn semantics.
Source of truth read before editsyesRead shadcn registry docs, shadcn registry route/validation, Plate registry scripts, init routes, install docs, and tests.
Tracker comments and attachments readN/ACurrent task is a direct thread instruction with no tracker.
Video transcript evidence requiredN/ANo video or recording supplied.
docs/solutions checked for non-trivial existing-code workN/AExisting source and shadcn upstream docs directly owned the decision.
TDD decision before behavior change or bug fixyesUpdated focused tests for registry dependency normalization and init docs.
Branch decision for code-changing taskN/AUser did not request branch, commit, push, or PR.
Release artifact decisionyesNo changeset: docs/app registry delivery behavior only, no package release surface.
Browser tool decision for browser surfaceyesUsed in-app Browser through repo-approved browser skill.
PR expectation decisionN/ANo PR requested.
Tracker sync expectation decisionN/ANo tracker.
Output budget strategy recordedyesScoped/capped command output recorded above.
Docs pack selectedyesInstall docs and MCP docs changed.
docs-creator loadedyesLoaded .agents/skills/docs-creator/SKILL.md.
Docs lane selectedyesInstallation/MCP docs lane.
Target docs and nearest sibling docs readyesRead installation.mdx, installation/plate-ui.mdx, installation/docs.mdx, installation/mcp.mdx, and React/Next install siblings.
Docs style doctrine readyesdocs-creator current-state and shadcn-dense rules loaded.
Documented source owner identifiedyesRegistry source owner is apps/www/scripts/*registry* plus apps/www/src/lib/plate-*.ts.
Browser pack selectedyesDocs and app route browser proof required by repo rule.
Browser route / app surface identifiedyes/docs/installation/mcp, /docs/installation/docs, /init, /init/md, /r/registries.json.
Browser tool decision recordedyesBrowser plugin used; no standalone Playwright substitute.
Console/network caveat policy recordedyesBrowser runtime did not expose console/resource APIs; route status and dev-server 200 logs were recorded.

Work Checklist:

  • Objective includes outcome, completion threshold, verification surface, constraints, boundaries, and blocked condition.
  • Task source classified with source type, title, task type, acceptance criteria, likely files/routes, browser surface, and root-cause layer.
  • Required video or screen-recording evidence is marked N/A with reason.
  • Nearby repo instructions and implementation patterns read before edits.
  • Implementation fixes the ownership boundary: namespace semantics in registry source normalization instead of installer workarounds.
  • Release artifact requirement recorded as N/A with reason.
  • Final handoff shape decided: concise implementation summary plus verification.
  • Branch handling recorded as N/A with reason.
  • Local-env-rot retry policy recorded as N/A; failures matched assertions/tool limitations, not install corruption.
  • Workspace authority recorded: every proof command runs from /Users/zbeyens/git/plate against apps/www.
  • High-risk note recorded: public registry delivery contract changed; source checks, tests, typecheck, and Browser route proof cover it.
  • Review/autoreview target selected: direct source-backed review plus command gates; separate autoreview marked N/A because patch is narrow and command-verified.
  • Agent-native review decision recorded: shadcn parity rule changed; source file edited and pnpm install regenerated skill mirror.
  • Output budget discipline recorded and followed.
  • Docs pack: docs lane, target docs, nearest sibling docs, and source owner are recorded.
  • Docs pack: named commands, routes, and registry config are source-backed.
  • Docs pack: docs use current-state reference voice, not changelog voice.
  • Docs pack: links and routes target real pages or are marked N/A with reason.
  • Browser pack: route, interaction path, and expected visible outcome are recorded before proof.
  • Browser pack: browser proof uses repo-approved Browser tool.
  • Browser pack: console/network caveat recorded.
  • Browser pack: exact browser verification route proof is ready for final handoff.

Completion Gates:

GateAppliesRequired actionEvidence
Named verification thresholdyesRun named commands and Browser proofAll listed command and Browser proofs completed.
Bug reproduced before fixN/ARecord N/AThis is registry contract simplification, not a bug repro.
Targeted behavior verificationyesRun focused tests/source assertionsBun tests, registry source check, docs source parity check passed.
TypeScript or typed config changedyesRun relevant typecheckpnpm --filter www typecheck passed.
Package exports or file layout changedN/ARecord N/ANo exports or file layout changed.
Package manifests, lockfile, or install graph changedyesRun installpnpm install passed to regenerate skills; lockfile was already up to date.
Agent rules or skills changedyesRun pnpm install and verify generated skill syncpnpm install passed; rg confirmed generated shadcn-parity/SKILL.md includes @plate/* rule.
Workspace authority proofyesVerify in owning appAll commands ran in /Users/zbeyens/git/plate with www filters or apps/www script ownership.
Browser surface changedyesCapture Browser proofBrowser verified MCP docs, Local Docs, /init, /init/md, and /r/registries.json.
Browser final proofyesRecord exact browser verification caveatBrowser proof recorded; console/resource API unavailable, dev-server 200 route logs recorded.
CI-controlled template output changedN/ARecord N/ANo template output edited.
Package behavior or public API changedN/ARecord N/ANo package release API changed.
Registry-only component work changedN/ARecord N/ARegistry delivery scripts changed, not a component registry item.
Docs or content changedyesVerify source-backed claims, links, and rendered outputDocs source parity and Browser docs page proof passed.
High-risk mini gateyesRecord failure mode and proof planFailure mode: self-deps resolve as stale URLs or local-file sync breaks; tests/checks cover both.
Agent-native review for agent/tooling changesyesSource/generation review.agents/rules/shadcn-parity.mdc source edited, generated skill mirror verified.
Local install corruption suspectedN/ARecord N/ANo local install corruption signal.
Autoreview for non-trivial implementation changesN/ARecord N/ANarrow source-backed change with focused tests, typecheck, lint, browser proof.
PR create or updateN/ARecord N/AUser did not request PR.
Task-style PR body verifiedN/ARecord N/ANo PR.
PR proof image hostingN/ARecord N/ANo PR.
Tracker sync-backN/ARecord N/ANo tracker.
Final handoff contractyesFill final handoff fieldsCompleted below.
Final lintyesRun pnpm lint:fixpnpm lint:fix passed; fixed two formatting/newline issues.
Output budget disciplineyesVerify scoped/capped outputBroad output was capped; follow-up reads were focused.
Goal plan completeyesRun completion checkernode .agents/skills/autogoal/scripts/check-complete.mjs docs/plans/2026-06-02-simplify-plate-registry-shadcn-semantics.md passed.
Docs source-backed claim audityesVerify docs claims against sourceSource-backed by shadcn registry docs and Plate registry config/tests.
Docs links / routes / previewsyesVerify routesBrowser verified docs routes; no preview changed.
Docs MDX/content parseryesRun docs source parserpnpm --filter www typecheck ran build:source and docs parity.
Plugin page specificsN/ARecord N/ANo plugin page changed.
Browser interaction proofyesExercise routes with BrowserCompleted through in-app Browser.
Browser console/network checkpartialRecord caveatRuntime console/resource APIs unavailable; route status and dev-server 200 logs recorded.
Browser final proof artifactyesRecord route proofExact Browser JSON/text checks recorded below.

Phase / pass table:

PhaseStatusEvidenceNext
Intake and source readcompletedRead upstream shadcn registry docs and Plate registry/install source.implementation
ImplementationcompletedPatched registry dependency normalization, init/docs copy, parity rule, and directory description.verification
VerificationcompletedFocused tests, source checks, typecheck, lint, Browser route proof.closeout
PR / tracker syncN/ANo PR or tracker requested.final response
CloseoutcompletedGoal ledger filled; completion checker next.final response

Findings:

  • Plate source normalization used absolute Plate item URLs for internal registry dependencies. The public contract should use @plate/* and reserve absolute URLs for direct URL installs and compatibility input.
  • MCP docs made manual components.json registry configuration look required. Existing shadcn projects can install from @plate directly.

Decisions and tradeoffs:

  • Keep static registry output and CI-owned generation; do not switch Plate to dynamic loadRegistryItem route handlers because Plate’s registry is large and docs-heavy.
  • Keep Plate’s TS-authored registry source; only normalize the shadcn-facing dependency semantics.
  • Keep /init as a convenience preset, not the main install story.

Implementation notes:

  • toRegistryDependencySpecifier('toolbar') now returns @plate/toolbar.
  • toLocalRegistryDependency('@plate/toolbar') still returns toolbar.json, preserving local-file template sync.
  • plateInitRegistryItem still writes components.json registry config for preset installs.
  • /r/registries.json now matches the central shadcn directory description for @plate.

Review fixes:

  • Aligned PLATE_REGISTRY_DESCRIPTION with shadcn central index wording.
  • Ran pnpm install after editing .agents/rules/shadcn-parity.mdc and verified generated SKILL.md.

Error attempts:

Error / failed attemptCountNext different moveResolution
Browser networkidle unsupported1Use supported load stateBrowser proof continued.
Browser page fetch unavailable1Navigate to routes directlyRoute JSON/markdown proof completed.
Browser resource API unavailable1Use route status and dev-server logsRecorded caveat and 200 logs.

Verification evidence:

  • pnpm install passed; Skiller regenerated agent guidance.
  • rg -n 'prefer \@plate|old generated registry output' .agents/skills/shadcn-parity/SKILL.md .agents/rules/shadcn-parity.mdc` confirmed source and generated skill mirror.
  • pnpm --filter www exec bun test src/lib/registry-install.test.ts src/lib/plate-init.test.ts src/app/r/registries.json/route.test.ts scripts/registry-dependencies.test.mts passed: 11 tests, 32 assertions.
  • After directory wording change, pnpm --filter www exec bun test src/app/r/registries.json/route.test.ts src/lib/plate-init.test.ts scripts/registry-dependencies.test.mts passed: 8 tests, 25 assertions.
  • pnpm --filter www exec tsx --tsconfig ./scripts/tsconfig.scripts.json scripts/check-registry-source.mts passed.
  • pnpm --filter www exec tsx --tsconfig ./scripts/tsconfig.scripts.json scripts/check-docs-source-parity.mts passed.
  • pnpm --filter www exec node assertion showed plate-ui -> @plate/plate-ui, editor-base-kit -> @plate/editor-base-kit, @shadcn/button preserved, direct URL preserved.
  • pnpm --filter www typecheck passed.
  • pnpm lint:fix passed.
  • node .agents/skills/autogoal/scripts/check-complete.mjs docs/plans/2026-06-02-simplify-plate-registry-shadcn-semantics.md passed.
  • Browser proof on /docs/installation/mcp: code blocks render @plate/editor-basic, preset command remains, manual registry config block absent.
  • Browser proof on /docs/installation/docs: renders @plate/fumadocs, mentions @plate registry, stale replace https://platejs.org/r/ instruction absent, raw file URL guidance present.
  • Browser proof on /init: name=plate, type=registry:base, dependency @plate/editor-basic, registry URL https://platejs.org/r/{name}.json.
  • Browser proof on /init/md: namespaced add command and preset command present; add command appears before config block.
  • Browser proof on /r/registries.json: one @plate entry with homepage https://platejs.org, URL https://platejs.org/r/{name}.json, description AI-powered rich text editor for React.
  • Dev server logged 200 responses for /docs/installation/mcp, /docs/installation/docs, /init, /init/md, and /r/registries.json.

Reboot status:

  • Not needed. Work stayed in the active thread and the www dev server stayed running on http://localhost:3003.

Open risks:

  • Generated registry output under apps/www/public/r, apps/www/public/rd, and apps/www/src/__registry__/index.tsx still contains old absolute Plate URLs until CI runs build:registry. This is intentional under repo policy; source checks prove the next generated output contract.

Final handoff contract:

  • PR line: N/A, no PR requested.
  • Issue / tracker line: N/A, no tracker.
  • Confidence line: high.
  • Flow table:
    • Reproduced: source audit found absolute Plate self-dependencies.
    • Verified: tests, source checks, typecheck, lint, Browser route proof passed.
  • Browser check: completed on http://localhost:3003.
  • Outcome: Plate registry source now uses shadcn namespace semantics for self-dependencies and docs present @plate as the default install path.
  • Caveat: generated registry JSON output is CI-owned and was not rebuilt locally.
  • Design:
    • Chosen boundary: source registry normalization plus docs/init copy.
    • Why not quick patch: changing docs alone would leave generated output source contract wrong.
    • Why not broader change: dynamic shadcn loader routes and Rhea/style registry adoption are unnecessary and worse for Plate’s large docs-heavy registry.
  • Verified: commands and Browser proof listed above.
  • PR body verified: N/A.

Task-style PR body contract:

  • N/A; no PR requested.

Final handoff / sync:

  • PR: N/A.
  • Issue / tracker: N/A.
  • Browser proof: completed.
  • Caveats: generated registry output remains CI-owned.

Timeline:

  • 2026-06-02: Goal created, source audited, implementation completed, verification completed.