anti-duplication

anti-duplication is a skill for Claude Code from marcusgoll/Spec-Flow. It costs 56 tokens per session (7,663 once invoked), scanned A, original, MIT.

A code-search check that looks for existing implementations before new code is written. It searches for similar endpoints, components, services, or models so new work can build on what already exists.

In plain words
What is it for?
Use it when adding or building functionality to find reusable code, extend an existing implementation, or explain why a new implementation is needed.
Why use it?
It reduces duplicate code, which otherwise makes fixes, maintenance, and future changes harder. It also encourages new features to follow patterns already used in the project.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it when adding or building functionality to find reusable code, extend an existing implementation, or explain why a new implementation is needed.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/marcusgoll/spec-flow/anti-duplication
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 marcusgoll/Spec-Flow --skill anti-duplication
Clone the repo
git clone --depth 1 https://github.com/marcusgoll/Spec-Flow

Made for: Claude Code.

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 anti-duplication

README.md
[![agentmods](https://agentmods.dev/badge/skills/marcusgoll/spec-flow/anti-duplication/github.svg)](https://agentmods.dev/skills/marcusgoll/spec-flow/anti-duplication)
Your own site
<a href="https://agentmods.dev/skills/marcusgoll/spec-flow/anti-duplication"><img src="https://agentmods.dev/badge/skills/marcusgoll/spec-flow/anti-duplication/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 anti-duplication

Your own site · 80×15
<a href="https://agentmods.dev/skills/marcusgoll/spec-flow/anti-duplication"><img src="https://agentmods.dev/badge/skills/marcusgoll/spec-flow/anti-duplication.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,663 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.00056 $0.07663
Opus 5 $0.00028 $0.03832
Sonnet 5 $0.00011 $0.01533
Haiku 4.5 $0.00006 $0.00766

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

Security

Grade A, and why

anti-duplication 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 9d 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/skills/anti-duplication/SKILL.md · 955 lines

How it starts

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

Code duplication creates maintenance nightmares:

  • Bug fixes must be applied in multiple places
  • Features evolve inconsistently across duplicates
  • Refactoring becomes exponentially harder
  • Codebase grows unnecessarily large
  • Onboarding takes longer (more code to learn)

This skill transforms "implement X" requests into a two-phase workflow:

  1. Search phase: Find existing similar implementations (endpoints, components, services, models)
  2. Reuse or justify: Either reuse/extend existing code OR justify why new implementation is necessary

The result: Codebases stay DRY, maintainable, and consistent.

<quick_start> <trigger_pattern> When user says "create", "implement", "add", or "build" new functionality, IMMEDIATELY search for existing similar code before writing anything new.

Trigger phrases:

  • "Create a new API endpoint for..."
  • "Implement a component that..."
  • "Add a service to handle..."
  • "Build a model for..."
  • "Write a function that..." </trigger_pattern>

<basic_workflow> Step 1: Extract search keywords from request

  • User: "Create an API endpoint to fetch user profile"
  • Keywords: "API endpoint", "fetch", "user", "profile", "GET"

Step 2: Search codebase for similar patterns

PRIMARY: Semantic search (mgrep)

  • mgrep for: "API endpoints that fetch user data", "profile retrieval handlers"
  • Finds similar implementations by meaning, not exact text

SECONDARY: Literal search (Grep/Glob)

  • Grep for: "router.get", "app.get", "/api/user", "profile"
  • Glob for: "/user.ts", "/profile.ts", "/routes/"

Step 3: Analyze findings

  • Found 3 similar endpoints: GET /api/user/:id, GET /api/user/settings, GET /api/admin/users
  • All use same auth middleware, validation pattern, error handling

Step 4: Present reuse options

  • Option A: Extend existing GET /api/user/:id to include profile data
  • Option B: Create new endpoint using same patterns as existing user endpoints
  • Option C: Justify why completely new approach is needed

Step 5: Implement chosen option (with existing patterns as template) </basic_workflow>

<immediate_value> Before anti-duplication skill: User: "Create an API endpoint to update user email" Claude: Writes new endpoint from scratch with different auth, validation, error handling Result: 5th variation of similar endpoint, inconsistent patterns

After anti-duplication skill: User: "Create an API endpoint to update user email" Claude: Searches codebase, finds 4 existing user endpoints with consistent patterns Claude: "Found 4 similar user endpoints. They all use: authMiddleware, validateUserInput, standardErrorHandler. I'll create the new endpoint following this established pattern." Result: Consistent implementation, reused middleware, maintainable code </immediate_value> </quick_start>

Extract key information:

  • Type: What are they building? (endpoint, component, service, model, function, utility)
  • Domain: What business domain? (user, product, order, payment, auth)
  • Operation: What action? (create, read, update, delete, fetch, validate, transform)
  • Technology: What stack? (React, Express, TypeScript, SQL, GraphQL)

Example parsing:

Request: "Create a React component to display product details"

Parsed:
- Type: React component
- Domain: Product
- Operation: Display/render
- Technology: React, TypeScript (likely)

Create multiple search approaches to maximize coverage:

PRIMARY: Semantic search (mgrep) Use mgrep FIRST for pattern discovery - finds similar code by meaning:

  • "components that display product information"
  • "services that handle email sending"
  • "validation logic for user input"
  • "error handling patterns in API routes"

Read the full file on GitHub · 955 lines

Files

What ships with it

3 files 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. 9d ago First seen · 955 lines · 56 tokens per session scan A d5f82dc10cb6

Subscribe to this mod's changes

anti-duplication is a skill published in the GitHub repository marcusgoll/Spec-Flow (92 stars, last pushed 4mo ago), licensed MIT. It adds 56 tokens to every session and 7,663 once invoked, about $0.0003 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 skills, from other repositories

android-ui-journey-testing

XML-specified Android UI journey testing, interactive step execution, assertion verification, and JSON outcome reporting.

sickn33/agentic-awesome-skills · 27 tokens

agent-self-scheduling

Schedule AI agent runs with cron, loops, or external clocks while avoiding unsafe tight autonomous timers.

sickn33/agentic-awesome-skills · 24 tokens

clawd-animation-lite

A lightweight generator for short, 1–3 second pixel animations featuring Clawd, the Claude Code mascot, shown as a small coral-orange crab. It creates a complete HTML file that can be opened in a browser.

YiShu5/claude-skills · 190 tokens

clawd-animation

A generator for self-contained HTML pixel animations featuring Clawd, the pixel-style crab mascot of Claude Code. It turns a natural-language scene into a short looping browser animation with a background, character actions, props, and effects.

YiShu5/claude-skills · 208 tokens

self-improving-agent

Low-noise self-improvement skill. Captures learnings, errors, and corrections into a local .learnings/ cache layer. Never auto-promotes to long-term memory files (SOUL.md, MEMORY.md, AGENTS.md, TOOLS.md). Promotion requires explicit user approval after repeated validation.

YiShu5/claude-skills · 68 tokens

HTMLHero.skill

A workflow for building a working, previewable first-page hero section—a prominent opening area of a website—from a prompt, brand direction, and visual requirements. It can work with HTML or React projects and treats the hero as the visual template for later pages.

YiShu5/claude-skills · 107 tokens