openbridge-webcomponents testing-visual.instructions.md

Visual testing and Storybook configuration instructions for checking how web components look and behave. Storybook is a tool for viewing components separately, while visual tests compare screenshots with saved reference images.

In plain words
What is it for?
Use them when changing a component, updating its Storybook setup, or intentionally regenerating its visual reference images. They describe how to test one component and verify updated baselines.
Why use it?
They help avoid running the slow full test suite and prevent accidentally rewriting unrelated screenshot baselines. They also explain that committed Linux baselines may differ from results produced on macOS.

Instructions file for GitHub Copilot

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/ocean-industries-concept-lab/openbridge-webcomponents/testing-visual
Clone the repo
git clone --depth 1 https://github.com/Ocean-Industries-Concept-Lab/openbridge-webcomponents

Made for: GitHub Copilot.

Per session 1,571 This file is loaded in full into every session.
When invoked 1,571 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01571 $0.01571
Opus 5 $0.00785 $0.00785
Sonnet 5 $0.00314 $0.00314
Haiku 4.5 $0.00157 $0.00157

Measured 3d ago against content hash 57429f97fbb7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

openbridge-webcomponents testing-visual.instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/instructions/testing-visual.instructions.md · 144 lines

How it starts

The opening of the file, as written. The whole thing — 144 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Visual Testing and Storybook Config

Run one component, not the suite

The full snapshot suite is slow and its failures are hard to attribute. Always scope to the component you changed:

npx vitest run --project storybook 'component-name'

Updating baselines — the filter must come BEFORE --update:

npx vitest run --project storybook 'component-name' --update   # correct
npx vitest run --project storybook --update 'component-name'   # WRONG

Written after the flag, the name is consumed as the flag's value and the full suite runs in update mode, silently rewriting unrelated flaky baselines. This is the single most damaging mistake in this area.

Always re-run without --update afterwards to confirm the new baselines are stable.

Baselines are environment-sensitive

__vis__/linux/__baselines__/    committed — what CI compares against
__vis__/linux/__results__/      local output, gitignored
__vis__/darwin/__baselines__/   macOS, NOT committed

Only the Linux baselines ship. Regenerating on macOS produces diffs CI will reject.

Prefer the CI path: comment /update-snapshots on the pull request. The update-snapshots.yml workflow regenerates inside the same Docker image CI uses and pushes the result to the PR branch. Locally, the Docker route is npm run test-storybook:docker — see IMPLEMENTATION_GUIDELINES.md § Docker Testing and ci-and-release.md.

Storybook config

.storybook/ holds main.ts, preview.tsx, manager.ts (sidebar badges for the lifecycle tags), openbridgeTheme.ts, and vitest.setup.ts, which wires the snapshot project.

Two facts that bite:

  • Run npm run analyze before testing a new component's stories. Storybook resolves story args to element properties through custom-elements.json; without it the args silently never reach the element.
  • Lifecycle badges are derived, never hand-written. meta.tags mirrors the class JSDoc — see jsdoc.md. Tooling tags (autodocs, skip-test, !snapshot) and version tags (6.0, 6.1) stay hand-written.

Read the full file on GitHub · 144 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 144 lines · 1,571 tokens per session scan A 57429f97fbb7

Subscribe to this mod's changes

openbridge-webcomponents testing-visual.instructions.md is an instructions file published in the GitHub repository Ocean-Industries-Concept-Lab/openbridge-webcomponents (91 stars, last pushed 4d ago), licensed Apache-2.0. It adds 1,571 tokens to every session, about $0.0079 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.