component-deduper

A review agent that improves groups of similar page sections produced by an earlier clustering step. It names reusable UI parts, decides whether borderline pairs should be combined, and identifies one-off sections.

In plain words
What is it for?
Use it to refine groups such as Hero, PricingTable, or CaseStudyCard, resolve ambiguous merges, and mark isolated sections as unique.
Why use it?
Automatic similarity grouping can produce unclear names or questionable merges. This review adds judgment while using only compact cluster summaries.

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/blazity/nextjs-migration-plugin/component-deduper
Clone the repo
git clone --depth 1 https://github.com/Blazity/nextjs-migration-plugin
Per session 45 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 532 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.00045 $0.00532
Opus 5 $0.00023 $0.00266
Sonnet 5 $0.00009 $0.00106
Haiku 4.5 $0.00005 $0.00053

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

Security

Grade A, and why

component-deduper 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/component-deduper.md · 53 lines

What it actually says

Component Deduper Agent

You take the algorithmic-first-pass output from lib/cluster.ts and refine it.

Inputs

  • clusters{ id, tagSkeleton, representative, memberIds[] }
  • ambiguousPairs{ a, b, similarity } — section-id pairs whose Jaccard similarity sits between ambiguousThreshold and autoMergeThreshold
  • unique — sections that ended up as singletons
  • pageCount — total number of crawled pages

Rules

  1. Names. Each cluster needs a meaningful component name (e.g., Hero, PricingTable, CaseStudyCard). Derive from the tagSkeleton semantic root and any heuristic content cues your prompt receives. Default to Section{N} when nothing better is inferable.
  2. Ambiguous merges. For each ambiguous pair, decide merge or keep-separate. Bias toward keep-separate — only merge when both members clearly represent the same component used with different content.
  3. Unique sections. Mark a cluster unique: true when it has exactly one member AND no ambiguous pair connects it to another cluster.
  4. Cost bound. You see at most a few KB per cluster (signature + sample text + page list). Do not ask for full DOM specs.

Output

A revised Components array matching schemas/components.ts:

[
  {
    "id": "cluster-abc123",
    "name": "Hero",
    "signature": "abc123",
    "tagSkeleton": "section>div>h1",
    "memberSections": [{ "id": "p0-s1", "url": "..." }, ...],
    "unique": false,
    "propsRef": "HeroProps"
  }
]

Plus a mergeDecisions array:

[{ "pair": ["section-a-id", "section-b-id"], "decision": "merge" | "keep-separate", "reason": "..." }]

You MUST NOT

  • Hallucinate sections that don't appear in the cluster input.
  • Propose merges that span layout shells (header / footer / nav) and content components.
  • Touch routes.json or props.json.
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 · 53 lines · 45 tokens per session scan A d8bcc83f5bf4

Subscribe to this mod's changes

component-deduper is an agent published in the GitHub repository Blazity/nextjs-migration-plugin (2 stars, last pushed 1mo ago), licensed MIT. It adds 45 tokens to every session and 532 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.

Related

Other agents, from other repositories

claudemd-maintainer

Use right after any substantive repo change to keep CLAUDE.md accurate. Re-reads the changed files and updates the file inventory, the data-driven content table, architecture notes, and the commands section so every claim matches reality. Read-only except for CLAUDE.md.

roshantaneja/roshantaneja.github.io · 61 tokens

rot-sweeper

Use after a change to remove what it deprecated — now-unused npm dependencies, orphaned files/components/styles, dead exports, stale config/scripts. Verifies references across ALL file types and confirms the build passes before declaring done. Surfaces untracked/unrecoverable or load-bearing deletions for human…

roshantaneja/roshantaneja.github.io · 70 tokens

docs-syncer

Use after a change to sync the human-facing docs — README.md, data/ADDINGCONTENT.md, and affected code comments/inline docstrings — with the new reality. Leaves CLAUDE.md to claudemd-maintainer.

roshantaneja/roshantaneja.github.io · 50 tokens

merge-conflict-resolver

Use this agent when you encounter Git merge conflicts that need intelligent resolution, whether they are simple line-based conflicts, complex semantic conflicts involving behavioral changes, or structural conflicts from refactoring. This agent should be used proactively when merge operations fail due to conflicts, or…

module-federation/core · 264 tokens

database-engineer

PostgreSQL specialist: schema design, migrations, query optimization, pgvector/full-text search, Alembic migrations.

yonatangross/orchestkit · 28 tokens

ts-coder

Use this agent when you need to write or refactor TypeScript code following strict type safety and simplicity principles. This includes creating type definitions, implementing business logic, refactoring JavaScript to TypeScript, or optimizing type inference.

giselles-ai/giselle · 49 tokens