/repl-ui:repl-ui-mocksfrom repl-ui
Builds live UI mocks in a running Clojure(Script) app via REPL, reusing real views, data, and styles. Use when someone asks to preview, prototype, or screenshot a proposed screen, modal, or redesign.
Ships in repl-ui. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
When someone asks "what would this look like?", show them in the app they already use. A live mock is view code you develop in the REPL and the running app draws. It reads whatever the app has loaded and reuses the app's own views, labels and styles, so it looks native and costs little code. The human sees the idea in context with real data, takes screenshots, and shares them. Nothing in the app's source changes.
Build a static mock (canvas, image, hand-written HTML) only when the human asks for one, or when there is no running app to render into.
This skill stands on the clojure skill, in the clojure plugin, for REPL-first work, and on the backseat-driver skill, which comes with Backseat Driver, for evaluating in the running app. repl-ui-coexploration, in this plugin, annotates the UI that exists today. This skill shows UI that does not exist yet. A project skill may add where mock namespaces live and which app pieces to reuse.
Wired into the app (default). Redefine the view function the app's render calls, and, when the view needs more data, the props or view-model function that feeds it. The app's own render loop then draws the mock in the real place. The real button opens it, clicks go through the app's own actions and dispatch, and real actions can work. When the app runs on a Uniflow loop, the uniflow skill, in the uniflow plugin, says how its actions are written and dispatched. In ClojureScript, set! the namespaced function or re-evaluate its defn in its own namespace. In Clojure, alter-var-root or re-def it. This works in dev builds, where calls look the function up each time; direct-linked or advanced-compiled code keeps the original.
The dev namespace keeps the originals and has an install! and an uninstall!. Mark the functions install! puts in place (a property on the function works), and let install! take the current function as the original only when it is not marked. Running install! again then never captures the mock, and after a source save it picks up the fresh original. Three things to say plainly to the human:
install! again.uninstall!.Separate render root (when it fits). Render into a node of your own, outside the app's root. Use it when the UI has no home in the app yet, when you want it side by side with the current view, or when it must not disturb what the user is doing. The mock's view state is then a plain map passed to show!. Its event handlers are functions that call show! again. hide! unmounts and removes the node. This mode leaves app state alone.
Both from one namespace. The view code can serve both modes. Put a :wired? flag in the view state and send clicks through two small functions. view-action returns data actions that set the mock's keys in app state when wired, and a function that calls show! with the updated view state otherwise. close-action returns the app's own close action when wired, and a function that calls hide! otherwise.
A mock that spans several views. Redefine the props or view-model function for the whole screen. Call the original and add keys to its output for every view the mock touches, so the derivations run once and the views agree. Then redefine the views one by one. Each draws the original and changes the hiccup it returns, or composes the original's own pieces. The same item can then show up in several views with the same number, mark or state.
Library mechanics for both, with skeletons: references/render-targets.md.
uninstall! or hide! leaves the app as it was, including any state keys the mock added. No new app atoms.:title "Mock: does nothing"). A small caption names the source, e.g. "Mock · data from the loaded order".When the people who should try a mock can't run the app, package it: a folder, and a zip of it, that opens in a browser from disk and runs the mock on a snapshot of real data. Develop it live first. references/packaged-mocks.md covers what a folder holds, the release build, the page namespace, cleaning the data for its recipients, and a headless check of every folder.
- [ ] 1. Orient: find the view, props builder, translation fn and state the mock will reuse
- [ ] 2. Pick where the mock lives, and probe it with a throwaway
- [ ] 3. Derive view data from live state, REPL-tested
- [ ] 4. Build the view in the REPL, verify by reading and clicking
- [ ] 5. Save as a dev namespace, reload, re-verify
- [ ] 6. Hand over: how to bring it up, the caveats, and what the mock revealed
1. Orient. Find the function the app's render calls for the screen the mock redesigns, and the props function that feeds it. Read live state rather than trusting docs: (sort (keys @app-state)), then sample one entry of each key you need.
2. Probe. Check the mechanics before building the whole view. Wired in: redefine the view with a wrapper that puts a visible marker around the original, open it with the app's real button (.click from the REPL), read the text back, restore. Separate root: render a button whose handler re-renders with a counter, click it, read the text, unmount and remove the node.
3. Derive. Write small pure functions from app state to view data and run each against the live state. When a value surprises you, check it against the raw data before you build on it or call it a bug. A jump that looks wrong is often what the data says. When a derivation guesses (the data does not say it outright), write that in its docstring.
4. Build the view. Evaluate the ns form with its requires first, then the derivations, then the view functions, then install!/uninstall! or show!/hide!. Bring it up, then verify with the REPL: read .-innerText of the view's element, click inside it with .click on a selector, read again. You check structure and text; the human looks at it and screenshots.
5. Save. Put the namespace in the project's dev source path, somewhere on the REPL classpath that no build entry point requires. End the file with a (comment ...) block with the calls that bring the mock up and take it away, unqualified, e.g. (install!) and (uninstall!). The human evaluates them in the file's own namespace after loading the file, so the block needs no require and no alias. Edit the file structurally, as the clojure skill says. Then, from a namespace of your own, require it with :reload and an alias and bring it up again, so the version you hand over is the saved one. With shadow-cljs, the shadow-cljs skill, in the shadow-cljs plugin, says why that namespace isn't cljs.user. Dev files are usually off the test path, so check editor diagnostics after saving.
6. Hand over. Tell the human how to bring the mock up and take it away, and, when it is wired in, the three caveats above. Leave it up when they are about to look. Report what the mock revealed: data the client does not have, values the derivations had to guess, labels with no translation. Those findings are often worth as much as the picture.
def that calls the translation function, or reads state, runs once at load. Put it in a function.declare near the top.for is lazy, so errors surface during render, far from their cause. While building, call the view yourself first: (try (pr-str (mock-view props)) (catch :default e (.-stack e))). With Replicant before 2026.11.1, the render only logs such an exception to the browser console, and the replicant skill, in the replicant plugin, says what to do then.NodeList is not countable. Use .-length."{Missing key ...}") rather than nil. Check what the translation function returns and fall back to a humanized keyword.# or ... are cut by *print-level* / *print-length*. Bind them to nil when reading data.defn at a time.install! puts the mock's function objects in place. After reloading the mock's own namespace, run install! again, or the app keeps calling the functions from before the reload.set! replaces a private function from another namespace without a compiler warning. clj-kondo reports a direct reference as :private-call, so annotate that form with #_{:clj-kondo/ignore [:private-call]}. A call through the var, (#'other.ns/f ...), needs no annotation.DragEvents sharing one DataTransfer, and space the drags out, since a synthetic drag runs start to end in one tick.setPointerCapture throws for a synthetic pointer, so wrap it in a try.history.replaceState. The REPL keeps its runtime, and the panel can install the mock again after each load.innerText of a hidden element is empty. A check that reads the DOM uses textContent.When the work shows that this skill is wrong, or leaves out something it should have said, tell the human what you found. They can open an issue on awesome-backseat-driver, where the skill is maintained. The installed skill is a copy that the plugin's next update replaces, so the fix belongs there, not in this file.
What SKILL.md sets; muted values are Claude Code's defaults
2 skills in this plugin
npx claudepluginhub betterthantomorrow/awesome-backseat-driver --plugin repl-uiOther plugins' skills for the same job