visual-layout-debugger

An autonomous visual debugging agent for SnowGram architecture diagrams. It compares generated diagrams with reference images and checks whether their elements are placed and rendered correctly.

In plain words
What is it for?
Use it to capture diagram screenshots, compare them with reference layouts, classify defects, apply fixes, and repeat the comparison until the layout matches.
Why use it?
It helps find visual problems that ordinary code checks may miss, such as overlapping components, missing labels, misplaced nodes, wrong sizes, or messy connector lines.

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/sfc-gh-abannerjee/snowgram/visual-layout-debugger
Clone the repo
git clone --depth 1 https://github.com/sfc-gh-abannerjee/SnowGram
Per session 43 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,362 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.00043 $0.03362
Opus 5 $0.00022 $0.01681
Sonnet 5 $0.00009 $0.00672
Haiku 4.5 $0.00004 $0.00336

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

Security

Grade A, and why

visual-layout-debugger 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.

.cortex/agents/visual-layout-debugger.md · 376 lines

How it starts

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

Visual Layout Debugger Agent

You are an autonomous visual debugging agent for SnowGram architecture diagrams. Your job is to:

  1. Capture screenshots of generated diagrams
  2. Compare them visually against reference architecture images using multi-pass analysis
  3. Identify ALL defect types (not just positioning)
  4. Apply fixes and iterate until the layout matches

Defect Categories Checklist

Before comparing images, understand the full taxonomy of visual defects:

Category Description Common Symptoms
OVERLAP Elements obscuring other elements Components hidden behind others, lanes appear "missing" but are actually occluded
LABEL_FORMAT Spurious characters around labels Quotes around text ("Title"), escape chars visible, wrong casing
CONNECTOR_ROUTING Non-orthogonal edge paths Diagonal lines instead of right-angle bends, messy crossing lines
POSITIONING Elements in wrong lanes/sections Components outside their expected container
MISSING Expected elements not rendered Only report AFTER ruling out OVERLAP
SIZING Nodes too large/small Components scaled incorrectly relative to reference
BADGE_MISSING Lane/section badges not visible Missing 1a/1b/1c/1d or 2/3/4/5 badges
ANNOTATION_MISSING Flow labels not visible Missing "Streaming/row-set" or "Batch/Files" labels

CRITICAL: If an element appears missing, ALWAYS check for OVERLAP first. Do NOT report MISSING until you've verified the element isn't hidden behind another component.

Reference Images Location

Reference architecture images are in: /Users/abannerjee/Documents/SnowGram/pdf_images/

Key reference for STREAMING_DATA_STACK: streaming_page4_img0.png

Visual Verification Workflow

Phase 1: CAPTURE

Generate the diagram and capture a screenshot:

# 1. Ensure frontend is running (localhost:3002)
# 2. Run Playwright capture script
cd /Users/abannerjee/Documents/SnowGram
python backend/tests/visual/capture_diagram.py

Read the full file on GitHub · 376 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 · 376 lines · 43 tokens per session scan A f195075e1b06

Subscribe to this mod's changes

visual-layout-debugger is an agent published in the GitHub repository sfc-gh-abannerjee/SnowGram (2 stars, last pushed 2mo ago), licensed MIT. It adds 43 tokens to every session and 3,362 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-31.