code-deduplicator

code-deduplicator is a skill for Codex from jqaisystems/jqai-ai-skills. It costs 29 tokens per session (992 once invoked), scanned A, original, MIT.

A code-review workflow that finds duplicated code added or changed during the current work session and consolidates only safe, low-risk repetitions. Duplicated code means the same logic appears in more than one place.

In plain words
What is it for?
Use it to inspect recent changes, compare components and layouts, find repeated functions or inline logic, and safely extract shared code where the behavior is clear.
Why use it?
It reduces repeated maintenance work while protecting existing behavior and public interfaces. Risky or broad refactors are reported instead of being forced.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Use it to inspect recent changes, compare components and layouts, find repeated functions or inline logic, and safely extract shared code where the behavior is clear.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jqaisystems/jqai-ai-skills/code-deduplicator
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.

Any agent
npx skills add jqaisystems/jqai-ai-skills --skill code-deduplicator
Clone the repo
git clone --depth 1 https://github.com/jqaisystems/jqai-ai-skills

Made for: Codex.

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 code-deduplicator

README.md
[![agentmods](https://agentmods.dev/badge/skills/jqaisystems/jqai-ai-skills/code-deduplicator/github.svg)](https://agentmods.dev/skills/jqaisystems/jqai-ai-skills/code-deduplicator)
Your own site
<a href="https://agentmods.dev/skills/jqaisystems/jqai-ai-skills/code-deduplicator"><img src="https://agentmods.dev/badge/skills/jqaisystems/jqai-ai-skills/code-deduplicator/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 code-deduplicator

Your own site · 80×15
<a href="https://agentmods.dev/skills/jqaisystems/jqai-ai-skills/code-deduplicator"><img src="https://agentmods.dev/badge/skills/jqaisystems/jqai-ai-skills/code-deduplicator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 992 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.00029 $0.00992
Opus 5 $0.00015 $0.00496
Sonnet 5 $0.00006 $0.00198
Haiku 4.5 $0.00003 $0.00099

Measured 10d ago against content hash 640e04ad90e1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

code-deduplicator 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 10d 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.

skills/code-deduplicator/SKILL.md · 80 lines

How it starts

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

Code Deduplicator

You are a careful deduplication agent. Find duplication introduced or touched in the current session, then consolidate only when the refactor is low-risk and preserves existing behavior.

Do not rewrite unrelated code, change public APIs casually, or revert user work. If a duplication finding is risky or broad, report it instead of forcing a refactor.

Step 1: Identify What Changed

Run git diff HEAD and git status to get the full picture of what was added or modified in this session. Parse the diff to extract:

  • New functions, components, hooks, constants, types, and utilities
  • New inline logic patterns (string manipulation, fetch calls, validation, type guards, env checks, path handling)
  • New API route handlers and middleware

If the diff is empty (everything is committed), run git diff HEAD~5..HEAD to cover recent session commits.

Step 2: Scan for Duplication (Run 3 Tasks in Parallel)

Task 1: Component & Layout Duplication

Search for duplication in components and layouts:

  • Glob for **/*.tsx, **/*.jsx files
  • For each new component from the diff, Grep the codebase for components with similar names, similar prop signatures, or similar JSX structure
  • Check for copy-pasted layout components (layout.tsx files with near-identical structure)
  • Check for duplicated page-level patterns (similar data fetching, similar error boundaries, similar loading states)
  • Flag components that wrap the same underlying element with minor style/prop differences

Task 2: Logic & Utility Duplication

Search for duplication in functions and utilities:

  • Glob for **/*.ts, **/*.tsx, **/*.js files
  • For each new utility/hook/function from the diff, Grep the codebase for similar implementations
  • Look for inline logic that duplicates existing utilities (e.g., hand-rolled formatDate when one exists in lib/)
  • Check for duplicated fetch patterns, error handling wrappers, and auth checks
  • Flag near-identical hooks that differ only in endpoint or return shape

Read the full file on GitHub · 80 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 10d ago First seen · 80 lines · 29 tokens per session scan A 640e04ad90e1

Subscribe to this mod's changes

code-deduplicator is a skill published in the GitHub repository jqaisystems/jqai-ai-skills (3 stars, last pushed 1mo ago), licensed MIT. It adds 29 tokens to every session and 992 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-31.

Related

Other skills, from other repositories

understand-diff

Use when you need to analyze git diffs or pull requests to understand what changed, affected components, and risks.

Egonex-AI/Understand-Anything · 27 tokens

resolve-pr-comments

Evaluate, fix, answer, and reply to GitHub pull request review comments and conversation comments. Handles both change requests (fix or skip) and reviewer questions (explain using reasoning recalled from past Claude Code transcripts). Use when the user asks to "resolve PR comments", "fix review comments", "address PR…

tobihagemann/turbo · 95 tokens

review-code

Review code for bugs, security vulnerabilities, API misuse, consistency issues, simplicity problems, or test coverage gaps by running internal reviews and a peer review in parallel and returning combined findings. Single-concern with a type argument, or full review with no argument. Use when the user asks to "review…

tobihagemann/turbo · 144 tokens

assess-technical-debt

Assess project-wide structural technical debt: complexity hotspots, deprecated API usage, duplication clusters, and architecture rot. Ranks findings by impact and refactor effort into a report at .turbo/technical-debt.md. Use when the user asks to "assess technical debt", "find technical debt", "review technical…

tobihagemann/turbo · 108 tokens

map-codebase

Deep architecture report that fans out parallel inspections across different aspects of the codebase (structure, tech stack, APIs, patterns, data flow, dependencies, testing) and synthesizes findings into a comprehensive document at .turbo/codebase-map.md and .turbo/codebase-map.html. Use when the user asks to "map…

tobihagemann/turbo · 106 tokens

peer-review

Run an independent peer review via Codex. Use when the user asks to "peer review", "peer review my code", "peer review my plan", "get a second opinion", or "independent review".

tobihagemann/turbo · 46 tokens