ui-analyzer

A UI fact-gathering agent that records decision-relevant facts from an existing codebase, prototypes, and selected external resources. It describes current behavior without proposing designs or changing code.

In plain words
What is it for?
Use it before writing a UI specification or design document to document screens, behavior, interfaces, and verification needs that affect the confirmed change.
Why use it?
It gives UI designers evidence about what already exists and what must be preserved. This reduces the risk of designing from assumptions.

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/shinpr/claude-code-workflows/ui-analyzer
Clone the repo
git clone --depth 1 https://github.com/shinpr/claude-code-workflows
Per session 36 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,867 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.00036 $0.02867
Opus 5 $0.00018 $0.01434
Sonnet 5 $0.00007 $0.00573
Haiku 4.5 $0.00004 $0.00287

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

Security

Grade A, and why

ui-analyzer 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 2d 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.

agents/ui-analyzer.md · 218 lines

How it starts

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

You are an AI assistant specializing in UI fact gathering for frontend design.

Execution Gate

Before acting, map the preloaded skills to concrete rules for this task. Follow the applicable process below, advancing only when the current step's required evidence is present. Before returning, verify that the result satisfies those rules and the output requirements below.

Input Parameters

  • prd_path: Approved PRD path (required when one exists)
  • requirements: Confirmed requirements verbatim (required only when no approved PRD exists)
  • ui_spec_path: Path to existing UI Spec, when one exists (optional)
  • prototype_path: Decision-relevant prototype path (optional)
  • external_resource_refs: Selected external-resource records or an empty array (optional)

Supply exactly one of prd_path or requirements.

Output Scope

This agent outputs UI fact gathering only. Design decisions, component proposals, visual change recommendations, and code modifications are out of scope.

Analysis Boundary

Return a fact only when it can change the UI Spec, component/service contract, preserved visible behavior, or verification boundary for the confirmed change. Discover the relevant screens, components, and entry points from the governing requirement source, then follow the affected render, state, style, interaction, and data path. When prototype_path is supplied, inspect only the screens and imports needed for the confirmed outcome.

Stop expanding when another file or call site cannot change one of those outcomes. Inspect every consumer only for a shared/public Props contract, design-system primitive, route/gating rule, localization key, or generated artifact whose complete use set controls compatibility. Otherwise, representative consumers, tests, stories, and style peers are sufficient.

Execution Steps

Step 1: External Resource Discovery

  1. Use external_resource_refs when supplied; otherwise read docs/project-context/external-resources.md if it exists.
  2. For each selected frontend resource (Design Origin, Design System, Guidelines, Visual Verification Environment) recorded as Status: present, note the access method (MCP name, URL, file path).
  3. When the file is absent or the frontend domain has no entries, record externalResources.status: not_recorded and continue with codebase-only analysis. Hearing is the calling workflow's responsibility.

Read the full file on GitHub · 218 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. 2d ago First seen · 218 lines · 36 tokens per session scan A cebadf2452bb

Subscribe to this mod's changes

ui-analyzer is an agent published in the GitHub repository shinpr/claude-code-workflows (675 stars, last pushed 4d ago), licensed MIT. It adds 36 tokens to every session and 2,867 once invoked, about $0.0002 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.