This section assumes you have never used Normascope before. Copy the commands exactly, then replace only the paths, URLs and page names that belong to your project.
Example A
First setup for a pricing page
You have a web app in a folder called storefront. Your app runs on port 3000 and the page you care about is /pricing.
cd ~/projects/storefront
npx norma-scope init
During the prompts, choose the Figma frame named Pricing Page and enter http://localhost:3000. Then open .bridge/config.json and make sure the frame contains “route”: “/pricing” and “capture”: “fullPage”.
npm run dev
npx norma-scope doctor
If doctor reports that the route is reachable, the project is ready for the next example.
Example B
Automatic screenshot and compare
You changed the pricing page and want Normascope to capture it and compare it with Figma. Keep the app running in one terminal and run the check in another.
npm run dev
npx norma-scope check
open .bridge/reports/report.html
The report should show the current pricing screenshot, the Figma reference, the diff, and the mismatch score. If no screenshot appears, check that the route is /pricing and that the app is still running.
Example C
Manual screenshot of a login modal
The login modal appears only after a human clicks Sign in, so automatic capture is not suitable.
- 1.Open the login page in your browser.
- 2.Click Sign in until the modal is visible.
- 3.Set the browser width to the width printed by init.
- 4.Use the browser command Capture full size screenshot.
- 5.Rename the downloaded file to login-modal.png.
- 6.Move it into .bridge/screenshots/.
npx norma-scope compare
open .bridge/reports/report.html
If the report says no screenshot found, the filename is probably different from the name in .bridge/config.json. Rename the file; do not invent a new name.
Example D
Only compare a screenshot that already exists
You already have dashboard.png in .bridge/screenshots/ and do not need a new browser capture.
npx norma-scope compare
Do not run auto first. Compare reads the screenshot already on disk.
Example E
The designer changed Figma
You compared the page yesterday, but the designer changed the Figma hero section today.
npx norma-scope compare --fresh
Fresh means “download the current Figma export now”. The ordinary compare command may use the cached export from yesterday.
Example F
Fail a pull request when the UI regresses
Run the check in strict mode.
npx norma-scope check --strict
Exit code 0 means every compared frame stayed within the threshold. Exit code 1 means at least one compared frame exceeded it. If the command succeeds but you expected a failure, look for skipped frames. A skipped frame was not actually tested.
Example G
Make a known-good browser page a regression baseline
You have approved the current checkout page and want future changes checked against this exact browser rendering. Add mode baseline to the frame in .bridge/config.json, then:
npx norma-scope auto
npx norma-scope baseline
# after future code changes
npx norma-scope check --strict
Commit the generated baseline files. If a change is intentional, review the report and run baseline again to approve the new version. Do not approve a baseline before looking at the report.
Example H
Compare staging with production
Production is the reference. Staging is the version you want to test. In .bridge/config.json, use:
"source": {
"type": "url",
"baseUrl": "https://www.example.com"
},
"app": {
"baseUrl": "https://staging.example.com"
}
npx norma-scope doctor
npx norma-scope check
Both sites must show comparable content. If production has five products and staging has two, the diff may be caused by different data, not different CSS.
Example I
Create a report for a PR
Run the comparison and create machine-readable output, then create the PR comment.
npx norma-scope compare --json --strict
npx norma-scope comment > pr-comment.md
The order matters. comment reads the summary created by compare --json; it does not perform a comparison itself.
Example J
Ask AI why one frame differs
First create a comparison, then explain one frame.
npx norma-scope compare
npx norma-scope explain pricing-page.png
The result is a suggestion such as “the heading may have moved because the font size changed”. Check the CSS yourself. To analyse every frame use explain --all; to use the deeper model use explain --deep. Both can make more provider calls, so use them deliberately.
Example K
Save design references for CI
Run this on a machine that has Figma access.
npx norma-scope snapshot
git add .bridge/design
git commit -m "Add visual design snapshot"
After that, CI can compare against the committed design export without needing a Figma token on every run.
Example L
Remove stale generated files
You switched to another Figma file and old screenshots are confusing you.
npx norma-scope clean
npx norma-scope auto
npx norma-scope compare
Clean removes generated screenshots, diffs, reports and cache. It does not remove .bridge/config.json. If you only want a new Figma export, use compare --fresh instead.
Example M
Use a coding agent with MCP
After starting your app, ask the coding agent to compare the configured page after making a UI change. The safe loop is:
change code
compare current page
read the diff regions
fix code
compare again
If capture is refused, configure the exact allowed app origin. Do not disable the origin policy just because an agent asks.