Open source · Prompt & Agent Workflows

Prompt Version Diff

Show prompt changes as readable diffs with affected tests and variables.

v0.1.0 · Node.js 22+ · MIT

Browse the public repository · View releases

A line diff of a prompt tells you which characters moved. It does not tell you that must became should in the grounding section, that the template stopped accepting repository, that the output format changed from JSON to Markdown, or that three test cases now point at something that no longer exists. Those are the changes that break callers, and they are exactly the ones a reflowed paragraph hides.

This walkthrough uses the tool's public README and checked-in example files. Run the command from a repository checkout with Node.js 22+; inspect the source before using it on your own files.

Run the checked-in example

# an additive revision: exits 0
node bin/prompt-version-diff.mjs --root examples \
  examples/v1-release-notes.json examples/v2-additive.json

# the same, human-readable
node bin/prompt-version-diff.mjs --root examples --format text \
  examples/v1-release-notes.json examples/v2-additive.json

# a revision with breaking changes: exits 1
node bin/prompt-version-diff.mjs --root examples --format text \
  examples/v1-release-notes.json examples/v3-breaking.json

# report every text difference, whitespace included
node bin/prompt-version-diff.mjs --root examples --no-ignore-whitespace \
  examples/v1-release-notes.json examples/v2-additive.json

# everything the repository checks before a commit
npm run check

Read the result

stdout carries the JSON report and nothing else, so it can be piped straight into a parser. --format text swaps stdout to the human summary instead. Operational diagnostics go to stderr.

Where this check stops

Every limit is enforced from the command line, and exceeding one produces a finding naming it and an incomplete run — never a silent truncation and never a pass.

Before adapting the command to your own workflow, review the accepted inputs, exit codes and safety boundaries in the README.

Compiled with AI assistance from checked-in public documentation and example scripts. Run the example and review the repository's current documentation before relying on its result.