--- description: Sync Potion (../potion) to Plate's newest packages (platejs, plitejs) and every Plate UI component (src/registry) from a Plate session. Use for "sync Potion", "sync Plate into Potion", "update Potion's Plate packages or UI", or 同步 Potion. Potion syncs here, not through sync-plate-ui. argument-hint: '[plate-path] [--no-pull] [--packages-only | --ui-only] [--style ] [--no-add]' --- # Sync Potion Handle $ARGUMENTS. Potion's Plate packages and UI components follow Plate. Potion may restyle a component and change its interaction once the owner calls that component ready, and a sync keeps those changes and merges in only Plate's bug fixes. This skill runs one Potion command, then checks what it wrote. Potion's own `.claude/skills/sync-plate` has the same method for a session that runs in Potion. This skill runs it from a Plate session. It does not use `sync-plate-ui`'s state: `.plate-ui-sync/status.json`, `forks/` and `runs/`. ## Paths - Potion's main checkout is `potion` beside Plate's main checkout, which is the parent of `git rev-parse --path-format=absolute --git-common-dir`. Read every Potion file named below by its absolute path there. When that folder does not exist, say so and stop. - Before any change, read Potion's `AGENTS.md`, `VISION.md` and `.claude/rules/plate-sync.mdc`. - Deliver as Plate `AGENTS.md`'s **Potion delivery** rule says: sync and commit in a Potion worktree of its own, merge it into Potion's current branch with `git merge --ff-only`, and never push. ## Before you run it - By default the command reads Plate's main checkout beside Potion, which must be on `next` with a clean tree. To use a Plate fix that has not landed, pass the current Plate worktree's path and `--no-pull`. - The Potion worktree needs no `bun install` first. The command syncs the packages, which writes `tmp/plate-local/*.tgz` and runs `bun install`, then syncs the UI. `--ui-only` needs `node_modules/.bin/biome` to exist already. - Copy into the Potion worktree, from Potion's main checkout, the tarballs in `tmp/plate-local/`, which `package.json` names through `file:` specs, and the env files git ignores. ## Command Run it in the Potion worktree: ```bash bun run sync:plate-local ``` Arguments: - `[plate-path]`: the Plate checkout. It defaults to `../plate` beside Potion's main checkout, also from a worktree. A relative path resolves from Potion's root. - `--no-pull`: skip `git pull` and use Plate's current tree. - `--packages-only` or `--ui-only`: sync one half. - `--style `: the registry style overlay, `radix-nova` by default. - `--no-add`: list the npm packages Potion lacks without running `bun add`. ## What it does 1. Runs `git pull --ff-only` in Plate, then `pnpm install`. 2. Builds and runs `pnpm pack` for every `file:./tmp/plate-local/*.tgz` package in Potion's `package.json`. Each tarball's name carries a content hash, such as `platejs-54.0.0-beta.1-f44336d5.tgz`, so after the command rewrites the spec in `package.json`, `bun install` resolves it as a new package and installs any new dependency. It then runs `bun add` for each optional peer Potion lacks, such as mammoth or jszip, at the version Plate's `apps/www`, or the package's own devDependencies, uses. 3. Reads Plate's `apps/www/public/r/*.json`, applies `src/__registry__/overlays/