Every premium and members-only resource for $9.99/month, as a no-commitment subscription. See the plans

PalateKit

Menu

Request a resource

Describe the resource you are missing in one sentence. We will email you when it is published.

0 / 280

Unlock PalateKit

Unlock everything

Plan

Paying means accepting our terms of sale.

Secure payment by Stripe. Receipts and invoices sent by email.

Welcome back

Sign in to install, download or save this resource. A free account is enough for free resources.

Code clone detection and refactoring v1.0.0

Use this resource to detect and refactor duplicated code blocks

New

  • 540 downloads
  • 113 likes
  • 139 saves

Free

Install with the CLI

In a terminal, from the folder you want:

npx --yes palatekit@latest install code-clone-detection

With no option, the skill goes to ~/.agents/skills/; add --agent claude-code (or codex, cursor…) to target an agent.

First time: connect the CLI with

npx --yes palatekit@latest login

The agent combines PMD CPD, which finds exact duplicates, with Semgrep, which flags repeated patterns. It ranks the findings by severity, then proposes shared functions once you approve. You get a duplicate report and a refactoring checked against the tests.

Mostly picked by

Updated November 2, 2026

Card for the “Code clone detection and refactoring” skill

Details

Generates with
Your agent's model
Licence
MIT

Similar resources

View all

What you get

  • SKILL.md: four-step workflow, from detection to refactoring
  • references/: detection commands and refactoring strategies
  • clone-rules.yaml: detection rules file

Good fit for

  • Your codebase has copy-pasted functions
  • You want to consolidate code before a review

Not for

    Tags

    • code duplication
    • refactoring
    • pmd cpd
    • code quality

    About

    You say

    “Find duplicate code in src/ with PMD CPD and propose a refactor.”

    Card for the “Code clone detection and refactoring” skill

    Skill published by terrylica under the MIT license, delivered in its original version.

    Show more

    How to use it

    1. Install the skill in your agent's skills folder
    2. Ask your agent to detect and refactor duplicated code blocks
    3. Review and adjust the result

    Content preview

    Files

    • clone-rules.yaml6.3 KB
    • LICENSE1 KB
    • NOTICE-PALATEKIT.md0.5 KB
    • references/complete-workflow.md3.4 KB
    • references/detection-commands.md1.2 KB
    • references/evolution-log.md0.7 KB
    • references/refactoring-strategies.md1.7 KB
    • SKILL.md8.6 KB

    Origin and licence

    Listed unmodified

    Author
    terrylica
    Source
    github.com/terrylica/cc-skills/tree/0ca36f7260a3eb5de13a1b684509c4ecd5fe819b/plugins/quality-tools/skills/code-clone-assistant
    Licence
    MIT

    Notice

    « code-clone-assistant » (terrylica, MIT) livré dans sa version d'origine : fiche en français et en anglais par PalateKit.

    User reviews

    –

    No ratings yet

    Loading reviews…

    Delete your review?

    Your rating and comment will be removed from the page.