Cursor Skill

comparing-branches-visually

Check out two branches in separate worktrees, start both dev servers on different ports, screenshot the same pages, and produce a visual diff.

LLM Mart · 0 points · 20 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download spencerpauly-awesome-cursor-skills-resources_comparing-branches-visually-99cd265.zip · 1 KB
Part of spencerpauly/awesome-cursor-skills — 65 skills

Install

skills CLI npx skills add https://github.com/spencerpauly/awesome-cursor-skills/tree/main/resources/comparing-branches-visually
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install spencerpauly-awesome-cursor-skills@llmmart
Git git clone https://github.com/spencerpauly/awesome-cursor-skills.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole spencerpauly/awesome-cursor-skills collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

Comparing Branches Visually

Create a visual before/after comparison of UI changes between two branches.

Workflow

1. Set Up Two Worktrees

Use best-of-n-runner subagents or git worktrees to run both branches simultaneously:

# Create a worktree for the base branch
git worktree add /tmp/branch-compare-base main

# The current working directory has the feature branch

2. Start Both Servers

Start the base branch server on a different port:

# In the base worktree
cd /tmp/branch-compare-base && PORT=3001 npm run dev

# Current branch is already on the default port (3000)

3. Identify Pages to Compare

Determine which pages are affected by the changes:

git diff main --name-only | grep -E '\.(tsx?|jsx?|vue|svelte|css)'

Map changed files to their routes (e.g. app/dashboard/page.tsx/dashboard).

4. Screenshot Both Versions

For each affected page:

  1. browser_navigate to http://localhost:3001/<page> (base branch)
  2. browser_take_screenshot → save as "before"
  3. browser_navigate to http://localhost:3000/<page> (feature branch)
  4. browser_take_screenshot → save as "after"

5. Report

Present the comparison:

Visual Diff: feature/redesign-header vs main

/dashboard:
  Before: [screenshot from main]
  After:  [screenshot from feature branch]
  Changes: Header height reduced, nav links repositioned, new avatar dropdown

/settings:
  Before: [screenshot]
  After:  [screenshot]
  Changes: No visual differences detected

6. Clean Up

# Stop the base branch server
# Remove the worktree
git worktree remove /tmp/branch-compare-base

Tips

  • Test at a consistent viewport size (1280×800 is a good default)
  • For mobile-first changes, also compare at 375px width
  • If the app requires auth, log in on both ports first
  • This pairs well with screenshotting-changelog for PR descriptions
Files (awesome-cursor-skills)
  • SKILL.md 2.1 KB
    ---
    name: comparing-branches-visually
    description: Check out two branches in separate worktrees, start both dev servers on different ports, screenshot the same pages, and produce a visual diff.
    user-invocable: true
    ---
    
    # Comparing Branches Visually
    
    Create a visual before/after comparison of UI changes between two branches.
    
    ## Workflow
    
    ### 1. Set Up Two Worktrees
    
    Use `best-of-n-runner` subagents or git worktrees to run both branches simultaneously:
    
    ```bash
    # Create a worktree for the base branch
    git worktree add /tmp/branch-compare-base main
    
    # The current working directory has the feature branch
    ```
    
    ### 2. Start Both Servers
    
    Start the base branch server on a different port:
    
    ```bash
    # In the base worktree
    cd /tmp/branch-compare-base && PORT=3001 npm run dev
    
    # Current branch is already on the default port (3000)
    ```
    
    ### 3. Identify Pages to Compare
    
    Determine which pages are affected by the changes:
    
    ```bash
    git diff main --name-only | grep -E '\.(tsx?|jsx?|vue|svelte|css)'
    ```
    
    Map changed files to their routes (e.g. `app/dashboard/page.tsx` → `/dashboard`).
    
    ### 4. Screenshot Both Versions
    
    For each affected page:
    
    1. `browser_navigate` to `http://localhost:3001/<page>` (base branch)
    2. `browser_take_screenshot` → save as "before"
    3. `browser_navigate` to `http://localhost:3000/<page>` (feature branch)
    4. `browser_take_screenshot` → save as "after"
    
    ### 5. Report
    
    Present the comparison:
    
    ```
    Visual Diff: feature/redesign-header vs main
    
    /dashboard:
      Before: [screenshot from main]
      After:  [screenshot from feature branch]
      Changes: Header height reduced, nav links repositioned, new avatar dropdown
    
    /settings:
      Before: [screenshot]
      After:  [screenshot]
      Changes: No visual differences detected
    ```
    
    ### 6. Clean Up
    
    ```bash
    # Stop the base branch server
    # Remove the worktree
    git worktree remove /tmp/branch-compare-base
    ```
    
    ## Tips
    
    - Test at a consistent viewport size (1280×800 is a good default)
    - For mobile-first changes, also compare at 375px width
    - If the app requires auth, log in on both ports first
    - This pairs well with `screenshotting-changelog` for PR descriptions
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related