code-clone-assistant

Detect duplicate code across Python and JavaScript projects using PMD CPD and Semgrep.

62|10|Updated Dec 4, 2025
One-click install
npx skills add https://github.com/terrylica/cc-skills --skill code-clone-assistant
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-clone-assistant
Source: https://github.com/terrylica/cc-skills/tree/main/plugins/quality-tools/skills/code-clone-assistant
Command: npx skills add https://github.com/terrylica/cc-skills --skill code-clone-assistant

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pmd, semgrep, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Detects code clones using PMD CPD and Semgrep, guiding DRY refactors.

Core Features & Use Cases

  • Exact duplicate detection with PMD CPD
  • Pattern-based detection with Semgrep
  • Combined output for comprehensive refactoring plan

Quick Start

Run a DRY check across a Python project

Frequently Asked Questions about code-clone-assistant

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect duplicate code across my Python and JavaScript projects?

Duplicate code detection uses PMD CPD for exact matches and Semgrep for pattern-based clones across files. This identifies DRY violations in multi-language codebases, enabling you to plan refactoring with combined results from both tools.

What's the difference between exact duplicates and pattern-based code clones?

Exact duplicates are identical code blocks PMD CPD finds line-for-line; pattern-based clones are structurally similar code Semgrep detects with variations in variable names or logic flow. Combined detection catches both violation types for comprehensive refactoring planning.

Can I use this to find code clones across multiple repositories?

Yes. The Skill applies PMD CPD and Semgrep across repositories and files in multi-language projects, synthesizing results to surface clones at any scale and guide safe edits with test preservation.

How do I safely refactor detected clones without breaking tests?

The Skill guides user-driven refactoring with detection, analysis, and safe edits that preserve test history. You review presented clones, plan extractions, and apply changes while maintaining test coverage.

Does this work with languages beyond Python and JavaScript?

This Skill is tuned for Python and JavaScript. PMD CPD and Semgrep support additional languages; coverage depends on tool-specific language support and your project setup.