duplicates-analyst

An analysis role that finds repeated or copied code in a project. Code clones are duplicate implementations that can drift apart when only one copy is fixed.

In plain words
What is it for?
Use it to review clone groups, find duplication across packages, suggest utilities or shared libraries, and estimate how much code an extraction would remove.
Why use it?
Duplication increases maintenance effort and can let bugs remain in one copy after another is changed. The analysis points to shared abstractions that could replace repeated code.

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/panbanda/omen/duplicates-analyst
Clone the repo
git clone --depth 1 https://github.com/panbanda/omen
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 195 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.00019 $0.00195
Opus 5 $0.00010 $0.00097
Sonnet 5 $0.00004 $0.00039
Haiku 4.5 $0.00002 $0.00019

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

Security

Grade A, and why

duplicates-analyst 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.

plugins/reporting/agents/duplicates-analyst.md · 26 lines

What it actually says

Duplicates Analyst

Analyze clone data to find duplication that matters.

What Matters

Clone risk: When one copy of duplicated code gets a bug fix, the others often don't. This causes real bugs.

High-value patterns to extract:

  • Error handling clones: Same try/catch repeated = extract utility
  • Validation clones: Same checks in multiple places = extract validator
  • API call patterns: Same setup/teardown = create client wrapper
  • Cross-package clones: Same code in unrelated packages = missing shared library

What to Report

  • Largest clone groups and what abstraction they're missing
  • Cross-package duplication (strongest signal for missing shared code)
  • Specific extraction suggestions: "Extract handleAPIError() to pkg/errors/"
  • Lines of code that would be eliminated by each extraction
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 · 26 lines · 19 tokens per session scan A 0dc004335859

Subscribe to this mod's changes

duplicates-analyst is an agent published in the GitHub repository panbanda/omen (18 stars, last pushed 9d ago), licensed Apache-2.0. It adds 19 tokens to every session and 195 once invoked, about $0.0001 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

docs-researcher

Lightweight agent for fetching library documentation without cluttering your main conversation context.

upstash/context7 · 20 tokens

standards-enforcer

Analyzes the codebase for coding-standards violations (file/function length, nesting depth, parameter counts, TODO/FIXME markers) using the scopewalker tools, then refactors to fix them while keeping checks and tests green. Use proactively after significant code changes or for a full standards audit.

timohaa/scopewalker-mcp · 65 tokens

comment-fixer

Scans source files and fixes code comments; adds missing one-line JSDoc, improves existing JSDoc, and cleans up inline comments (WHY not WHAT, removes obvious or stale ones). Defaults to recently changed files; prompt with full for a whole-src sweep. Use when asked to clean up, fix, or standardize comments.

timohaa/scopewalker-mcp · 74 tokens

smart-test-fixer

Runs checks and tests, then fixes all warnings, errors, and failing tests, consulting recent git changes to decide whether the code under test or the test itself is wrong. Use proactively after code changes to confirm everything still passes.

timohaa/scopewalker-mcp · 50 tokens

lint-type-format-fixer

Runs lint, typecheck, and prettier, then fixes all warnings and errors until every check passes. Use proactively after writing or modifying code and before commits.

timohaa/scopewalker-mcp · 37 tokens

markdown-quality-fixer

Finds changed markdown files via git status and fixes all markdownlint warnings and table formatting. Use proactively after creating or modifying .md files and before commits.

timohaa/scopewalker-mcp · 36 tokens