Sync plate ui

From udecode/plate · View interactive version

Sync plate ui is an AI agent skill from the GitHub repository udecode/plate. Sync Plate registry UI into downstream apps with fork-aware comparison, scoped apply and changelog tracking. Not for Potion, which syncs through sync-potion.

How to use this skill

Skill file

Sync Plate UI

Handle $ARGUMENTS.

Goal: sync Plate UI registry components from this repo into a downstream app

without flattening that app's product forks. The workflow reads Plate registry

source, generated changelog JSON, and downstream local files; classifies

upstream-owned versus target-owned hunks; writes reviewable artifacts; then

applies only accepted sync rows.

This is not sync-shadcn. sync-shadcn compares upstream shadcn docs with

Plate docs. sync-plate-ui compares Plate UI registry source with a target app

that copied and customized Plate UI. Potion syncs through sync-potion

instead, so send a Potion request there.

This skill is consumer-side only. It reads generated Plate UI changelog JSON;

it does not create upstream Plate changelog entries. Upstream Plate devs author

those through changeset and

apps/www/src/registry/changelog/entries/*.mdx.

Core Take

Downstream Plate UI files are usually mixed ownership. One hunk can be a local

product fork, the next hunk can be a Plate bugfix the target should receive.

Never treat an entire file as forked or safe to overwrite unless the source

evidence proves it.

The right model is a three-way sync:

If the base is unknown, run bootstrap planning and stop. Do not pretend an LLM

can safely reconstruct fork ownership from vibes.

File-plan contract

Each run keeps its plan at <target>/.plate-ui-sync/runs/<date>-<scope>/plan.md;

read it and the mode before mutation. The plan lists every scoped row as a

checkbox that closes with its decision or apply evidence. This skill runs in

downstream apps, so it depends on no Plate-repo workflow file.

Flow Modes

Planning mode is the default. It may read the target repo and write artifacts

under the target's .plate-ui-sync/**, but it must not mutate target source.

Apply mode needs current user authorization for the named plan, dashboard

payload, component or rows. Existing authorization is sufficient; do not

require a later message or reinvocation. Apply only the accepted rows.

Collaborative planning is for policy decisions, such as whether a downstream

app should keep a local UX fork or follow Plate.

No direct micro-merge exception by default. For downstream product repos,

"small" is not enough. Exact-match upstream-only files can be applied in apply

mode without user-by-hunk review, but planning still records the row first.

Command Parsing

Supported commands:

If the first token is a command, dispatch to that command. Otherwise treat the

argument as planning scope. Examples:

sync-plate-ui ../app code-block
sync-plate-ui plan ../app code-block
sync-plate-ui status ../app
sync-plate-ui apply ../app

If the target repo is omitted and cannot be inferred from the current working

directory, ask one focused question. Do not guess a target the user did not

name and the active plan does not name.

Target State

The target repo owns its sync state:

<target>/.plate-ui-sync/status.json
<target>/.plate-ui-sync/forks/<component>.json
<target>/.plate-ui-sync/runs/<date>-<scope>/
<target>/.plate-ui-sync/dashboard.json
<target>/.plate-ui-sync/dashboard.md

status.json tracks what has actually landed:

{
  "sourceRepo": "<absolute path of the Plate checkout>",
  "targetRepo": "<absolute path of the target app>",
  "lastReviewedAt": "YYYY-MM-DD",
  "components": {
    "code-block": {
      "lastAppliedPr": 4989,
      "lastAppliedSourceRef": "<plate-git-sha>",
      "lastAppliedSourceHash": "<sha256-of-transformed-source>",
      "targetFiles": ["src/registry/ui/code-block-node.tsx"],
      "forks": ["toolbar-style"]
    }
  }
}

If status.json is missing, bootstrap from direct source evidence:

Bootstrap mode may write a plan and fork ledger. It must not apply changes until

the user accepts the baseline.

Plate Source Inputs

Prefer generated changelog JSON:

/registry/changelog/index.json
/registry/changelog/components.json
/registry/changelog/<event-id>.json

When working from the local Plate repo, read the same files at

apps/www/src/registry/changelog. components.json maps registry item ids to

event JSON. Each event should expose id, change source, release, affected

registry items, source files, migration notes, and diagnostics.

If generated JSON is missing or incomplete, treat that as weak evidence. Prove

the sync from Plate registry source and PR-level or merge-base diffs before

recommending apply. Prose alone is not enough.

Plate registry sources to inspect first:

Do not run build:registry. Do not edit generated registry output.

Sync list UI through the standard list registry graph. Reject rows that would

create another persisted list model or copied list UI family.

Target Mapping

Read target config before path assumptions:

For a target like Potion, expect:

Existing target scripts are evidence, not authority. Audit them before relying

on them.

Three-Way Classification

For every component/file row, compute:

base -> upstream
base -> local
upstream -> local

Apply target transforms before comparing when the target uses different import

aliases. Record every transform in the plan.

Classify at hunk or symbol level:

Never collapse these into a single file-level decision unless every hunk has

the same classification.

Decisions

Use these decision labels:

Every smart-merge row must state:

Planning Mode

Planning mode may:

Planning mode must not:

Planning artifacts:

<run>/plan.md
<run>/inventory.json
<run>/inventory.md
<run>/component-diffs.md
<run>/target-files.txt
<run>/decision-counts.json

Do not persist .patch files. Inspect focused diffs and summarize the relevant

hunks.

Plan Shape

Every plan must include:

# Sync Plate UI <target> <scope>

## Range
- Plate source ref
- target repo
- component scope
- changelog entries or fallback evidence

## Target Config
- package manager
- registry paths
- aliases
- existing sync scripts and whether they are trusted

## Inventory
| Component | Plate file | Target file | Base | Class | Decision | Evidence |

## Fork Ledger
| Component | File | Hunk/symbol | Keep/Pull/Ask | Reason |

## Apply Rows
| Row | Action | Files | Why | Verification |

## Questions

## Verification Plan

## Status Update Rule

Dashboard Mode

Dashboard mode renders unresolved rows for user review. It writes:

<target>/.plate-ui-sync/dashboard.json
<target>/.plate-ui-sync/dashboard.md

If a target later adds an HTML dashboard script, use it. Do not invent a local

browser dependency for the first version.

Dashboard rows support these actions:

Copied apply payload:

$sync-plate-ui apply ../app

Rows:
- code-block/4989/language-label: Pull note: safe upstream-only render hunk
- code-block/4989/toolbar-style: Keep Fork note: the app's toolbar owns layout

Questions:
- ai-menu/streaming: Should the app keep its custom stream controls?

Rows mutate state only under Rows. Question rows are answered in chat and do

not mutate structured state.

Apply Mode

Apply mode may mutate target source only for accepted rows.

Before applying:

  1. Re-read the plan and target files.
  2. Recompute the row classification.
  3. Confirm the row is still valid against current Plate and target source.
  4. Record target package manager and verification commands.

Apply rules:

accepted row asks to harden the fork.

target-owned hunks.

manager and lockfile.

Never overwrite a whole target file unless all of these are true:

After applying:

Status Mode

Status mode is read-only. It summarizes:

Output shape:

Status: <fresh | needs-plan | stale-source | stale-target | bootstrap-needed | blocked>
Target: <path>
Components tracked: <count>
Open decisions: <count>
Next: <command>

Review Mode

Review mode checks whether an existing plan is still true.

It may:

It must not apply changes.

Verdicts:

Agent-Native Requirements

The workflow must be agent-actionable:

If the component changelog is prose-only, record that as a blocker for perfect

agent-native sync and fall back to source diffs plus explicit user acceptance.

Start Gates

Resolve these before broad planning:

Completion Gates

Planning completion requires:

Apply completion requires:

Final Output

Planning output:

Target: <path>
Scope: <component/range>
Plan: <target>/.plate-ui-sync/runs/.../plan.md
Dashboard: <path or N/A>

| Decision | Count |
| --- | ---: |
| pull-upstream | ... |
| keep-fork | ... |
| smart-merge | ... |
| needs-question | ... |

Next: review the plan; accepted rows apply under the existing apply authority without a second invocation.

Apply output:

Applied: <rows>
Kept forks: <rows>
Target verification: <commands/results>
Open decisions: <count or none>
Status: <target>/.plate-ui-sync/status.json updated
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.