potion-yjs-dev-browser-test

Tests Slate Yjs collaboration behavior against Potion as a live reference using per-page CDP offline control.

16.5k|997|Updated Dec 2, 2019
One-click install
npx skills add https://github.com/udecode/plate --skill potion-yjs-dev-browser-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: potion-yjs-dev-browser-test
Source: https://github.com/udecode/plate/tree/main/.agents/skills/potion-yjs-dev-browser-test
Command: npx skills add https://github.com/udecode/plate --skill potion-yjs-dev-browser-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When a Slate Yjs collaboration bug appears (offline edits, reconnect, selection, or history issues), it is hard to tell whether the behavior is a real defect or expected conflict semantics. This Skill uses Potion as a live behavioral oracle in a persistent debug Chrome browser to compare against your local Slate Yjs implementation.

Core Features & Use Cases

  • Per-Page Offline Isolation: Uses CDP Network.emulateNetworkConditions on a single page instead of context-wide setOffline, so only tab B goes offline while tab A stays connected.
  • Structured Repro Workflow: Opens two named Potion pages on the same document, runs B-offline edits, A-online edits, reconnects B, then compares convergence, selection, history, and presence state.
  • One-Off Script Discipline: Explicitly forbids stale reusable scripts; each bug gets a fresh dev-browser script written from the current repro steps.
  • Use Case: A user reports that offline edits lose history after reconnect. You open two Potion tabs, take one offline via CDP, replay the exact edit sequence, reconnect, and compare Potion's result with your local Slate Yjs behavior to decide if the local behavior is suspicious.

Quick Start

Ask the AI to use the Potion Yjs dev browser test to reproduce your current offline/reconnect collaboration bug against the shared Potion document in the debug Chrome at 127.0.0.1:9222.

Frequently Asked Questions about potion-yjs-dev-browser-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test Yjs offline and reconnect behavior in a browser?

Open two pages on the same collaborative document, then use a per-page CDP session with Network.emulateNetworkConditions to take only one page offline. Make edits on both sides, reconnect, and compare the converged document state.

Why does page.context().setOffline(true) break multi-tab collaboration tests?

setOffline applies to the entire browser context, so it disconnects every tab sharing that context. For isolating a single tab, create a CDP session on that page and call Network.emulateNetworkConditions with offline set to true.

How do I verify a Slate Yjs bug against a reference editor?

Replay the identical repro steps in a reference implementation like Potion and compare convergence, selection, and history outcomes. If Potion preserves what local Slate Yjs loses, treat the local behavior as suspicious, then compare schema and operation ordering before fixing.

Can I reuse one script for all collaboration bug repros?

No. Each collaboration bug has different setup, operations, waits, and assertions, so a fixed script goes stale quickly. Write a small one-off dev-browser script from the current repro steps and keep it in the terminal or a temp directory.

What should I do if the Potion editor is not found during a test?

Stop and ask the user to log in to Potion in the persistent debug Chrome. If the document does not exist, request a valid shared document URL; if navigation is interrupted, force both pages online via CDP and retry once.