Skip to content
Agentmart
Submit a tool

duplicate-code-detector

Detect significant duplicate code patterns in recently changed files using semantic analysis and open focused remediation issues (one per pattern, up to 3).

Skill by veverkap

IndexedMIT
Write a review

Chalk Labs

Need help deploying duplicate-code-detector?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/veverkap-duplicate-code-detector

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Detect significant duplicate code patterns in recently changed files using semantic analysis and open focused remediation issues (one per pattern, up to 3). Use when asked to find duplication, copy-paste code, or refactoring opportunities.

Use cases: writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/duplicate-code-detector

Tools it pre-approves 5

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • Read
  • Glob
  • Grep
  • Bash
  • Agent

What's inside

Skill name
duplicate-code-detector
Description
Detect significant duplicate code patterns in recently changed files using semantic analysis and open focused remediation issues (one per pattern, up to 3). Use when asked to find duplication, copy-paste code, or refactoring opportunities.
License
MIT
Allowed tools
Read, Glob, Grep, Bash, Agent
Instructions
173 lines in SKILL.md · view on GitHub

Before installing

  • Pre-approves any shell command

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Duplicate Code Detector

Analyze recently changed source files, detect meaningful duplicate code patterns with semantic judgment, and open focused remediation issues (one issue per pattern, up to 3).

## Mission

Detect significant duplicate code patterns in recently changed files using semantic analysis and open focused remediation issues (one per pattern, up to 3).

## Scope

- Prioritize files changed recently (default: last 3 days).
- Analyze source code only.
- Exclude generated files, lock files, vendored dependencies, build outputs, and workflow/config boilerplate unless explicitly requested.
- Exclude tests by default unless the user asks to include them.

## Workflow

### 1. Discover Recently Changed Files

Use git to build a candidate set from recent commits:

```bash
git log --since="3 days ago" --name-only --pretty=format: | sort -u | sed '/^$/d'
```

Then filter to source files likely to contain business logic (for example: `.go`, `.py`, `.rb`, `.java`, `.js`, `.ts`, `.tsx`, `.cjs`, `.cs`, `.php`, `.cpp`, `.c`, `.rs`).

If no recent source files exist, stop and report:

```text
No recently changed source files found for duplicate analysis.
```

### 2. Build Semantic Context

For each candidate file:
- Read file content.
- Identify major functions, methods, classes, and helpers.
- Capture intent-level summaries of each significant symbol.

Use semantic comparison, not just string matching:
- Similar control flow and branching.
- Similar error-handling logic.
- Similar data transformation pipelines.
- Copy-paste with renamed variables.

### 3. Detect and Cluster Duplicate Patterns

Group findings into distinct patterns. A pattern is issue-worthy only when it is significant:
- More than 10 lines of materially duplicated logic, or
- 3 or more similar occurrences.

Classify each pattern:
- Exact duplication.
- Structural duplication.
- Functional duplication.

### 4. Deduplicate Against Existing Local Findings

Before creating each finding draft, check prior local duplicate-code reports and skip noisy repeats.

Create metadata for the finding:
- `pattern_key`: derive from involved file paths by taking `{parent-dir}-{stem}` for each file, sorting, joining with `-`, and truncating to 60 chars.
- `file_paths`: normalized, sorted file paths.

Query existing local reports:

```bash
ls reports/duplicate-code-detector/*.md 2>/dev/null
```

Skip creating a new issue when any rule matches:
- File recency rule (30 days): exact same `file_paths` set found in an issue created in the last 30 days.
- Pattern frequency rule: at least 2 open issues already contain the same `pattern_key`.
- File cooldown rule (7 days): any file in the current finding appears in an issue created in the last 7 days.

### 5. Produce Focused Remediation Drafts (Max 3)

Create at most 3 finding drafts for the highest-impact patterns.

Use this title format:

```text
[duplicate-code] Duplicate Code: <short pattern name>
```

Use this body template:

```markdown
# Duplicate Code Detected: <Pattern Name>

## Summary
<Brief description of the duplicate pattern and why it matters>

## Duplication Details
- Severity: High | Medium | Low
- Occurrences: <N>
- Locations:
  - <path1> (lines X-Y)
  - <path2> (lines A-B)

## Impact
- Maintainability: <impact>
- Bug Risk: <risk>
- Code Bloat: <impact>

## Refactoring Recommendations
1. <recommendation>
2. <recommendation>

## Implementation Checklist
- [ ] Review findings
- [ ] Agree extraction target or shared utility
- [ ] Implement refactor
- [ ] Update tests
- [ ] Verify behavior parity

## Analysis Metadata
- Analyzed Files: <count>

From veverkap/skills, MIT.

More from veverkap/skills

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Jul 28, 2026 (3 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from veverkap

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get duplicate-code-detector running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying duplicate-code-detector?

CallGet help
Cite this page

duplicate-code-detector skill. Agent Mart. https://agentmart.dev/skills/veverkap-duplicate-code-detector (last updated 2026-10-24)