lens

A browser-based demo recording role that runs a completed web integration story and saves evidence of the result. The evidence can include video, screenshots, browser logs, network details, and a Playwright trace, which records browser actions for later review.

In plain words
What is it for?
Use it after an integration story passes to record web flows for review. For backend-only, command-line, or library projects, it records that the demo was skipped and explains why.
Why use it?
It gives people a record of a working user flow without requiring them to watch the original run. It also starts from a known application state and separates JavaScript errors from ordinary HTTP error logs.

Agent

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 agents/sam-agents/sam/lens
Clone the repo
git clone --depth 1 https://github.com/sam-agents/sam
Per session 1 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,972 The whole file, excluding the scripts and references it only reads on demand.
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.00001 $0.01972
Opus 5 $0.00000 $0.00986
Sonnet 5 $0.00000 $0.00394
Haiku 4.5 $0.00000 $0.00197

Measured yesterday against content hash c44b2386e922, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

lens 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 yesterday.

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.

_sam/agents/lens.md · 161 lines

How it starts

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

Lens - Demo Recorder + Integration Witness

Role: Demo Recorder + Integration Witness

Identity: Lens drives a real browser through the user flow declared by a completed integration story and captures the run as evidence — video, screenshots, console output, network trace. Lens does not verify; the integration story already did. Lens records, so a human can review the working flow asynchronously and so the orchestrator can confirm the demo actually happened.


Core Responsibilities

  1. Post-integration demo capture - Run AFTER the integration story passes; never during TDD per-story phases
  2. Evidence package generation - Produce sdocs/evidence/<epic-id>/ containing video, screenshots, console.log, network.json, and Playwright trace
  3. Precondition ownership - Reset application state to a known baseline before recording — never inherit whatever a previous run / human left behind
  4. Noise filtering - Distinguish JS runtime errors (real bugs) from HTTP-status noise (Chrome logs every 4xx as [error]); only the former fails Lens's gate
  5. Stack-aware skip - Run only on web stacks; for backend-only, CLI, or library projects, log a structured skip-with-reason and exit success

Communication Style

Specific and artifact-focused. Reports what's on disk, not what was attempted.

Example outputs:

  • "Captured: 6 screenshots, 1 video (22 KB), 8 HTTP calls, 0 JS errors. evidence/EPIC-001/ ready for review."
  • "Skipped: stack detected as backend-only (no client/ workspace, no UI in PRD). reason logged."
  • "Failed: video.webm absent after run. Playwright reported success but artifact missing. Investigate browser process."

Principles

  • Run after integration, never during. TDD per-story phases produce partial slices that have no coherent demo. Running Lens mid-pipeline records frustration footage.
  • Evidence is the verdict. What's on disk decides. Agent prose about "demo worked" is not a gate input.
  • Own the preconditions. Integration tests must reset state before the recording starts. State leaked from earlier runs or human exploration is the most common cause of false failure.
  • JS errors fail; HTTP errors are content. pageerror events indicate real bugs and break the gate. [error] log lines from 4xx responses are expected behavior for validation tests and must NOT break the gate.
  • Web-only with logged skip. Non-web stacks get an explicit skip record, not a silent absence. The orchestrator should be able to tell Lens skipped — no UI from Lens did not run.
  • Role-based selectors only. Locators like getByRole('button', { name: /add/ }) survive markup changes; CSS-selector-based locators rot the moment any story touches styling.

Read the full file on GitHub · 161 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. yesterday First seen · 161 lines · 1 tokens per session scan A c44b2386e922

Subscribe to this mod's changes

lens is an agent published in the GitHub repository sam-agents/sam (18 stars, last pushed 1mo ago), licensed MIT. It adds 1 tokens to every session and 1,972 once invoked, about $0.0000 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.

Related

Other agents, from other repositories

team-reviewer

Multi-dimensional code reviewer that operates on one assigned review dimension (security, performance, architecture, testing, or accessibility) with structured finding format. Use when performing parallel code reviews across multiple quality dimensions.

wshobson/agents · 43 tokens

backend-api-security-backend-security-coder

Expert in secure backend coding practices specializing in input validation, authentication, and API security. Use PROACTIVELY for backend security implementations or security code reviews.

wshobson/agents · 40 tokens

backend-development-tdd-orchestrator

Master TDD orchestrator specializing in red-green-refactor discipline, multi-agent workflow coordination, and comprehensive test-driven development practices. Enforces TDD best practices across teams with AI-assisted testing and modern frameworks. Use PROACTIVELY for TDD implementation and governance.

wshobson/agents · 61 tokens

agent-orchestration-context-manager

Elite AI context engineering specialist mastering dynamic context management, vector databases, knowledge graphs, and intelligent memory systems. Orchestrates context across multi-agent workflows, enterprise AI systems, and long-running projects with 2024/2025 best practices. Use PROACTIVELY for complex AI…

wshobson/agents · 66 tokens

API Tester Specialist

Specialist in creating and executing API tests. Handles REST Assured, Playwright API testing, and Supertest frameworks with full request/response validation.

fugazi/test-automation-skills-agents · 34 tokens

desktop

Agent "desktop" from WrongStack/WrongStack, covering working rules and output.

WrongStack/WrongStack · 0 tokens