Skip to content

Using the Diff Stage agent skill

Ask your coding agent to record a local feature demo with a throwaway test, or prepare browser recordings for PR review. Install the skills with Laravel Boost.

Guide 4 of 44 min read

On this page

Ask your coding agent to show a feature working. Diff Stage's bundled skills help it record a one-off local demo or prepare browser tests for PR review.

Complete the recorder setup first. Local demos use your existing browser test environment. For videos published on PRs by CI, also complete the GitHub Actions workflow.

What the skill does#

The diff-stage-evidence skill reads the diff and your existing browser tests. It picks the smallest journeys that demonstrate the change, and adds or adjusts tests when the task calls for it. It names each one with vendor/bin/diff-stage-show and a short note for the reviewer, then watches the recording before pushing.

If no browser journey demonstrates the change, it names nothing and says which checks cover the change instead. You still review the evidence and decide whether to merge.

Install for your agent#

The recorder ships diff-stage-demo, diff-stage-evidence and pest-browser-testing, plus a short guideline for Laravel Boost. Local demos need recorder v0.3.3 or later. If you already have the recorder installed, update it and refresh your agent's skills:

Laravel Boostshell
composer update diff-stage/recorder
php artisan boost:update

Accept diff-stage/recorder when Boost offers it. Every agent Boost manages then shows its browser changes without being asked.

Without Boost, copy the skills into your agent's skills directory. For Codex:

Codexshell
mkdir -p .agents/skills
cp -r vendor/diff-stage/recorder/resources/boost/skills/* .agents/skills/

For Claude Code:

Claude Codeshell
mkdir -p .claude/skills
cp -r vendor/diff-stage/recorder/resources/boost/skills/* .claude/skills/

That copies all three skills. Copy them again after upgrading the recorder.

Record a one-off demo#

Ask your agent in plain language:

Demo prompttext
Use Diff Stage to demo the new booking flow.

The agent reads the diff-stage-demo skill and your existing browser tests. It writes a temporary Pest browser test with disposable data, then runs only that test with recording enabled:

Local recordingshell
vendor/bin/pest tests/Browser/TemporaryDemoTest.php --record-videos=/tmp/booking-demo

The test clicks through the real app and asserts the visible outcome. The agent checks that it passed, reviews the video, and removes the temporary test. It keeps the recording outside your checkout with the commit details and explains any faked services. You get a video without adding a test to your permanent suite.

The skill is an instruction file the agent reads. It guides the agent's file edits and terminal commands; the recorder captures the browser session. You do not need to name the skill yourself.

Share the demo on a PR#

You can also ask: "Use Diff Stage to demo this change and attach the recording to the PR." The agent needs an available authenticated video upload workflow or artifact host to attach an accessible video or link. A local file path cannot be used as a PR attachment.

Local demo uploads to the hosted Diff Stage player are not supported yet. Its upload endpoints require GitHub Actions identity. If the agent cannot attach the demo, it gives you the local video and says that attachment is still pending.

For CI to rerun the journey and publish it through Diff Stage, keep the test in the pushed commit and use the diff-stage-evidence workflow below.

Ask the agent for a change#

With Boost, ask for the change as usual:

Agent prompttext
Fix the checkout decline message and open a PR.

Without the guideline, mention the skill: "Use the diff-stage-evidence skill to show the change." The agent should reuse your working browser environment and disposable fixtures.

Name a test for reviewers#

Given a Pest test named it('shows why a card was declined', ...) in tests/Browser/CheckoutTest.php, the agent runs this before pushing:

Name a testshell
vendor/bin/diff-stage-show "tests/Browser/CheckoutTest.php::it shows why a card was declined" \
    --why "The decline reason now appears under the card field. Watch the retry reach the confirmation screen."

The command checks that Pest finds the test, then saves it on Diff Stage for the branch. Nothing is added to your commits. The first time on a computer, it opens your browser so you can approve the sign-in, then carries on:

Terminaltext
Sign in to Diff Stage by approving this code in your browser:

  BCDF-GHJK  https://diffstage.com/cli/BCDF-GHJK

Waiting for approval…
✓ Signed in as Sam Taylor

✓ CheckoutTest › it shows why a card was declined
  1 video · shown on fix-decline-message
  The decline reason now appears under the card field. Watch the retry reach the confirmation screen.

Diff Stage records it when you push.

Include describe() groups in the name exactly as Pest reports them. A dataset test records every variant under one note. Name only the file to record every test in it. Run the command again to change a note, with no arguments to list everything the branch shows, or with --clear to start over.

Opening a PR yourself#

  1. Choose the browser tests that show your change. Run your regression checks separately, then commit.
  2. Record each test locally and watch it through its final result. Check for private information.
  3. Name each test with vendor/bin/diff-stage-show and a note that tells the reviewer where to look.
  4. Push and open the PR. Follow the Diff Stage comment, check its commit matches the PR head, and watch the videos next to the approved main baseline.

Tests named after your latest push are recorded on the next push. For changes without useful browser evidence, name nothing and explain which checks cover the change.

See Comparing browser test videos before merging for the review controls and missing-baseline behavior.

Show your reviewers what changed

Add the recorder to your test suite, and your next pull request gets a video.