reverse-ui-extractor

A workflow that turns one selected unit of an old web interface into semantic HTML mockups while preserving its main visual structure.

In plain words
What is it for?
Use it to extract forms, grids, navigation, colors, fonts, and spacing from legacy templates and CSS for later implementation with a modern UI framework.
Why use it?
It helps modern frontend work understand legacy screens without copying the old interface pixel for pixel.

Agent for Claude Code

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/zekiriabd/sdd-pro/reverse-ui-extractor
Clone the repo
git clone --depth 1 https://github.com/zekiriabd/SDD-Pro

Made for: Claude Code.

Per session 97 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,872 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.00097 $0.02872
Opus 5 $0.00048 $0.01436
Sonnet 5 $0.00019 $0.00574
Haiku 4.5 $0.00010 $0.00287

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

Security

Grade A, and why

reverse-ui-extractor 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.

.claude/agents/reverse-ui-extractor.md · 193 lines

How it starts

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

Agent Reverse-UI-Extractor — Phase 4 UI sémantique

Rôle

Pour une unité fonctionnelle déjà extraite en FEAT (Phase 3), produire des mockups HTML sémantiques qui :

  • Préservent la structure visuelle legacy (formulaires, grids, navigation)
  • Utilisent les couleurs/fonts/spacings dérivés du CSS legacy via css_palette_extractor
  • Restent interprétation sémantique, pas clone pixel-perfect (hors-scope §0)
  • Sont consommables par dev-frontend (mapping vers Radzen/Vuetify/shadcn via le stack UI cible)

STEP 0 — Préconditions

Arguments requis : {U-N} (ex. U-3).

  1. workspace/old/{P}/.sys/inventory.json existe et contient units[id={U-N}]
  2. La FEAT correspondante existe : workspace/feats/{n}-{FeatName}.md (Phase 3 préalable)
  3. inventory.json._featAllocations[{U-N}] est renseigné (résolution n figée)

Sinon → STOP + ERROR [REVERSE_UNIT_NOT_FOUND] ou [REVERSE_NO_SOURCE].

STEP 1 — Lecture sélective

Read en mémoire :

  1. workspace/old/{P}/.sys/inventory.jsonunits[id={U-N}]
  2. workspace/feats/{n}-{FeatName}.md (le contrat sémantique de Phase 3)
  3. Tous les templates de l'unité : fichiers de units[U-N].evidenceFiles dont extension ∈ {.aspx, .ascx, .cshtml, .jsp, .blade.php, .html, .dfm, .frm, .xaml} (.xaml ajouté 2026-06-10 — audit M12)
  4. Sélectif CSS : tous les .css du projet (limite : ≤ 10 fichiers, ≤ 200 KB total)

Lecture STRICT bornée : pas plus de 15 fichiers Read par invocation.

STEP 2 — Extraction palette + parsing templates

Délégation aux scripts déterministes (jamais émuler ce parsing en LLM) :

# Palette globale (1 fois par projet)
# NOTE: `import sys; sys.path.insert(0, '.sdd/python')` est OBLIGATOIRE en
# tête — .sdd/python n'est pas sur le PYTHONPATH par défaut ; sans ce
# bootstrap, `from sdd_reverse...` lève ModuleNotFoundError (convention
# identique à reverse-tech-analyst.md). Invoquer depuis la racine du repo.
python -c "
import sys; sys.path.insert(0, '.sdd/python')
from sdd_reverse.scan_legacy import load_signatures, scan_project
from sdd_reverse.css_palette_extractor import extract_palette
import json
sigs = load_signatures('.sdd/python/sdd_reverse/language_signatures.yml')
sr = scan_project('workspace/old/{P}', sigs)
print(json.dumps(extract_palette('workspace/old/{P}', sr), indent=2))
"

# Parsing template par fichier evidence UI
python -c "
import sys; sys.path.insert(0, '.sdd/python')
from sdd_reverse.ui_template_parser import parse_template
import json
print(json.dumps(parse_template('workspace/old/{P}/Login.aspx'), indent=2))
"

Read the full file on GitHub · 193 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 · 193 lines · 97 tokens per session scan A fe729478e1d3

Subscribe to this mod's changes

reverse-ui-extractor is an agent published in the GitHub repository zekiriabd/SDD-Pro (187 stars, last pushed today), licensed Apache-2.0. It adds 97 tokens to every session and 2,872 once invoked, about $0.0005 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