Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@ npm run smoke

For a reviewer-facing walkthrough, see [`docs/tutorials/review-agent-tool-expansion.md`](docs/tutorials/review-agent-tool-expansion.md). It demonstrates a prompt revision that expands browser and shell tool language, removes an explicit secret-handling guardrail, and changes the output contract.

For a release-gate style demo that writes review artifacts to a temporary directory, run:

```bash
npm run build
bash examples/release-gate-demo.sh
```

The demo intentionally expects the compare command to exit `2` because `--fail-on high` catches the risky prompt expansion. See [`docs/tutorials/prompt-release-gate.md`](docs/tutorials/prompt-release-gate.md) for the walkthrough and [`docs/promo/release-gate-social-hooks.md`](docs/promo/release-gate-social-hooks.md) for grounded launch copy.

To generate the walkthrough evidence in one command:

```bash
Expand Down
21 changes: 21 additions & 0 deletions docs/promo/release-gate-social-hooks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# PromptDiff Release Gate Social Hooks

Use these only with the checked-in `examples/release-gate-demo.sh` workflow.

## Short posts

1. Prompt changes can add tool access, remove guardrails, or change output contracts without looking dramatic in a normal diff. PromptDiff turns that into a local report reviewers can inspect.
2. A small release gate for prompts: compare old/new files, fail on high-severity findings, and attach the Markdown report to the review.
3. PromptDiff is deliberately boring: local files in, deterministic Markdown or JSON out, no telemetry or hidden network calls.

## Demo thread

1. Start with the risky prompt pair in `examples/prompts/tool-expansion-old.md` and `examples/prompts/tool-expansion-new.md`.
2. Run `bash examples/release-gate-demo.sh`.
3. Show the exit code of `2` from `--fail-on high`, then open the generated Markdown report.
4. Point at the concrete categories: broader tool language, removed secret handling, and output contract changes.
5. Close with the safe check command against `examples/prompts/safe.md` and `examples/rules.json`.

## Video beat

Open on a normal prompt diff, then switch to the generated report. The useful moment is not "AI review"; it is the named checklist that a human reviewer can act on before a prompt ships.
26 changes: 26 additions & 0 deletions docs/tutorials/prompt-release-gate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Prompt Release Gate

This recipe shows how to use PromptDiff as a local prompt release gate before a prompt revision reaches review.

## Inputs

- Old prompt: `examples/prompts/tool-expansion-old.md`
- New prompt: `examples/prompts/tool-expansion-new.md`
- Rules file: `examples/rules.json`

The new prompt intentionally expands tool language, changes the expected output shape, and removes a secret-handling guardrail. That makes it useful as a deterministic fixture for demos and CI examples.

## Run the demo

```sh
npm run build
bash examples/release-gate-demo.sh
```

The compare command is expected to exit `2` because `--fail-on high` is enabled. The script treats that as the correct gate behavior and verifies that the Markdown report was written.

## What to attach to a review

Attach the generated `tool-expansion-review.md` report when the gate fails. It gives reviewers a stable summary of the risky changes without requiring them to infer policy impact from a text diff alone.

Use the rules check output when you want to show that a known-safe prompt still satisfies required phrases, forbidden phrases, and required sections.
33 changes: 33 additions & 0 deletions examples/release-gate-demo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
set -euo pipefail

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
OUT_DIR="${TMPDIR:-/tmp}/promptdiff-release-gate-demo"

rm -rf "$OUT_DIR"
mkdir -p "$OUT_DIR"
cd "$ROOT_DIR"

npm run build

set +e
node dist/cli.js compare \
examples/prompts/tool-expansion-old.md \
examples/prompts/tool-expansion-new.md \
--out "$OUT_DIR/tool-expansion-review.md" \
--fail-on high
COMPARE_STATUS=$?
set -e

test "$COMPARE_STATUS" -eq 2
test -s "$OUT_DIR/tool-expansion-review.md"
grep -qi "tool" "$OUT_DIR/tool-expansion-review.md"
grep -qi "high" "$OUT_DIR/tool-expansion-review.md"

node dist/cli.js check examples/prompts/safe.md --rules examples/rules.json --out "$OUT_DIR/rules-check.md"
test -s "$OUT_DIR/rules-check.md"
grep -qi "PromptDiff" "$OUT_DIR/rules-check.md"

echo "Review report: $OUT_DIR/tool-expansion-review.md"
echo "Rules check: $OUT_DIR/rules-check.md"
echo "Gate exit: $COMPARE_STATUS"