Skip to content
artemjasanPublic

About

Turn visual UI feedback into actionable tasks for coding agents.

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

visdiff

Give your coding agent visual feedback on your app.

Visdiff connects a running web page to the source code behind it. Select an element, describe the change in the built-in Agent chat, and review the source diff before applying it. The visual task queue and CLI/MCP handoff remain available for external coding agents.

Watch the Visdiff workflow

CI Node.js License: MIT

Documentation: explore the Visdiff guide or read its source in docs/.

How it works

flowchart LR
    Browser["Running app<br/>Select · move · resize · layout"]
    Chat["Built-in agent chat<br/>Describe · clarify"]
    Queue["Optional task queue<br/>CLI or MCP"]
    Source["Source code<br/>Implement · verify"]
    Review["Diff review<br/>Apply or reject"]

    Browser -->|"Fresh element context"| Chat
    Chat -->|"Proposed edit"| Source
    Source -->|"Changed files + diff"| Review
    Browser -.->|"Optional visual task"| Queue
Loading

The built-in Agent works from rendered element context and source anchors rather than a screenshot-only guess. It writes a reviewable proposal into the development working tree; Reject restores the original files, while Apply changes keeps the proposal and runs configured checks.

Quick start with Vite

Requirements: Node.js >=22.12.0.

npm install -D visdiff

Register the plugin before your framework plugin in the existing Vite configuration:

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { visdiffVite } from 'visdiff/vite'

export default defineConfig({
  plugins: [visdiffVite(), react()],
})

Start your development server, configure a model provider, open the app, and click visdiff.

  1. Click visdiff, then select an element.
  2. Click Add to Agent and describe the result in plain language.
  3. Review the proposed files and diff.
  4. Choose Apply changes or Reject.

For a no-model workflow, drag, resize, or move elements visually and click Apply to queue a task. Click Copy to paste it into any external agent. Edits collect in the change panel until applied. Reset restores the current preview; Esc or ✕ cancels the selection; Clear discards the unsent batch.

Connect an agent

Run from the project root to read tasks and agent instructions:

npx -y visdiff tasks
npx -y visdiff instructions

Clear only the task IDs the agent implemented and verified:

npx -y visdiff clear <task-id> [task-id ...]

Or connect through MCP. For Claude Code:

claude mcp add visdiff -- npx -y visdiff mcp

Other MCP clients can launch npx -y visdiff mcp over local stdio. See the agent workflow for implementation and verification rules.

Framework and bundler support

Vite provides the integrated overlay, endpoint, and source anchors for React, Vue, and Svelte. visdiff/webpack supports these frameworks through Webpack; visdiff/next supports Next.js with Turbopack and webpack. See the support matrix for details. Integrations run in development only.

Development

npm run check
npm run build
npm run docs:build

npm run check runs ESLint, TypeScript checks, and package tests. CI runs unit tests on Node 22.12 and 24; lint, typecheck, builds, documentation, and browser tests run on Node 24.

License

MIT. See LICENSE.

About

Turn visual UI feedback into actionable tasks for coding agents.

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages