layout-extractor

layout-extractor is an agent for Claude Code from Blazity/nextjs-migration-plugin. It costs 41 tokens per session (531 once invoked), scanned A, original, MIT.

A specialised helper that examines summaries of crawled web pages to identify shared header, footer, and navigation layouts. It writes the qualifying results into a layouts file.

In plain words
What is it for?
Use it when analysing a website crawl and need to find which page clusters represent the reusable header, footer, or navigation.
Why use it?
It avoids treating page-specific content as part of the site's common shell. Coverage and home-page checks make the selection based on the crawl rather than assumptions.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions subagents.

Part of the nextjs-migration-plugin plugin — 18 skills, 4 commands, 16 agents shipped together

Good fit Use it when analysing a website crawl and need to find which page clusters represent the reusable header, footer, or navigation.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/blazity/nextjs-migration-plugin/layout-extractor
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.

Clone the repo
git clone --depth 1 https://github.com/Blazity/nextjs-migration-plugin

Made for: Claude Code.

Or install nextjs-migration-plugin, the plugin that ships this one along with the rest of its 18 skills, 4 commands, 16 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for layout-extractor

README.md
[![agentmods](https://agentmods.dev/badge/agents/blazity/nextjs-migration-plugin/layout-extractor/github.svg)](https://agentmods.dev/agents/blazity/nextjs-migration-plugin/layout-extractor)
Your own site
<a href="https://agentmods.dev/agents/blazity/nextjs-migration-plugin/layout-extractor"><img src="https://agentmods.dev/badge/agents/blazity/nextjs-migration-plugin/layout-extractor/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for layout-extractor

Your own site · 80×15
<a href="https://agentmods.dev/agents/blazity/nextjs-migration-plugin/layout-extractor"><img src="https://agentmods.dev/badge/agents/blazity/nextjs-migration-plugin/layout-extractor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 531 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00041 $0.00531
Opus 5.5 $0.00016 $0.00212
Sonnet 5.5 $0.00008 $0.00106
Haiku 4.5 $0.00004 $0.00053

Measured 2mo ago against content hash e514ba74982d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

layout-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 2mo 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/layout-extractor.md · 46 lines

What it actually says

Layout Extractor Agent

You receive cluster summaries (id, tagSkeleton, member-page list) from the algorithmic first-pass produced by lib/cluster.ts and decide which clusters are layout shells.

Inputs

  • clusters — array of { id, tagSkeleton, memberIds[], representative: { tagSkeleton, pathShingles } }
  • pageCount — total number of crawled pages
  • homeUrl — the root/home page URL from the crawl, when available
  • existingLayouts — current layouts.json contents (may be empty for an initial run)

Rules

  1. A cluster qualifies as a layout shell when:
    • For header/footer, its tagSkeleton starts with header or footer.
    • For nav, its tagSkeleton may start with nav OR contain a nested nav tag inside a wrapper such as div>...nav....
    • It appears on ≥ 90% of crawled pages.
    • Its memberIds include the root/home page. Reject page-hero clusters that miss the home page even if they use a <header> tag and have high coverage.
  2. Promote the highest-coverage candidate per slot (header, footer, nav) to layouts.json. If no cluster qualifies for a slot, set that slot to null.
  3. Never invent shells that the cluster output did not surface. If the page has no <footer>, leave footer: null.
  4. When in doubt, return null for the slot rather than guessing.

Output

Return a Layouts object matching schemas/layouts.ts:

{
  "header": { "id": "cluster-...", "signature": "...", "appearsOn": ["..."], "memberIds": ["https://example.com/#p0-s0"], "tagSkeleton": "..." },
  "footer": { ... } | null,
  "nav": { ... } | null,
  "updatedAt": "<ISO timestamp>"
}

You MUST NOT

  • Inspect full DOM specs. You only see cluster summaries.
  • Modify components.json or routes.json — those are other agents' jobs.
  • Invent cluster IDs that don't exist in the input.
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. 2mo ago First seen · 46 lines · 41 tokens per session scan A e514ba74982d

Subscribe to this mod's changes

layout-extractor is an agent published in the GitHub repository Blazity/nextjs-migration-plugin (2 stars, last pushed 2mo ago), licensed MIT. It adds 41 tokens to every session and 531 once invoked, about $0.0002 per session on Opus 5.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-09-23.

Related

layout-extractor compared with agents from other repositories

layout-extractor next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
layout-extractorBlazity/nextjs-migration-pluginAgent22mo agoMITA41Claude Code
website-clonervibeeval/vibecosystemAgent55322d agoMITA31Claude Code
e2e-runnerKaelSensei/MagicAIBuilderAgent2yesterdayMITA87Claude Code
verify-browser-opusyacb2/aidexAgent211d agoMITA129Claude Code
typographydatabayt/hogwartsAgent19yesterdaynoneA11Claude Code
frontend-performance-investigatorjiamaozheng/awesome-claude-codeAgent1yesterdaynoneA36Claude Code
docs-scraperlroy-stack/ai-pod-storeAgent21mo agononeA24Claude Code