with one click
jscpd
// Detect and eliminate copy-paste duplication in source code using jscpd with the AI reporter.
// Detect and eliminate copy-paste duplication in source code using jscpd with the AI reporter.
Translate strings across all locales (readme-src and src/shared/i18n/locales). Use when adding or updating translatable strings that need to be propagated to all languages. Dispatches Sonnet sub-agents in parallel, with each agent handling up to 5 locales.
Finds missing or weak tests across the full Electron codebase, focusing on stability, integrations, edge cases, and production-readiness rather than only current PR changes.
Identify underspecified areas in a document (spec, requirements, PRD, brief, etc.) by asking targeted clarification questions and encoding answers back into the document. Use when the user has a document with ambiguities, missing decisions, or gaps that need resolution before implementation begins.
Analyzes conversations for valuable insights and updates AGENTS.md or docs/ when patterns, gotchas, domain knowledge, or project-specific rules emerge. Use when you discover something important that Claude should remember across sessions.
| name | jscpd |
| description | Detect and eliminate copy-paste duplication in source code using jscpd with the AI reporter. |
Copy-paste detector for programming source code, supports 150+ languages. Use this skill to find duplicated code and refactor it away.
# Run with ai reporter (compact output optimized for agents)
npx jscpd --reporters ai <path>
# With ignore patterns
npx jscpd --reporters ai --ignore "**/node_modules/**,**/dist/**" <path>
# Scope to specific formats
npx jscpd --reporters ai --format "javascript,typescript" <path>
The ai reporter produces compact, token-efficient output designed for agent consumption:
Clones:
src/ foo.ts:10-25 ~ bar.ts:42-57
src/utils/helpers.ts:100-120 ~ src/utils/other.ts:5-25
---
3 clones ยท 4.2% duplication
Each line represents one clone pair:
path/file.ts 10-25 ~ 45-60 (shared path shown once)shared/prefix/ file-a.ts:10-25 ~ file-b.ts:42-57 (common prefix factored out)path/a.ts:10-25 ~ path/b.ts:42-57| Option | Description |
|---|---|
--reporters ai | Use the AI-optimized reporter (required for this skill) |
--min-tokens N | Minimum tokens to consider a duplication (default: 50) |
--min-lines N | Minimum lines to consider a duplication (default: 5) |
--threshold N | Exit with error if duplication % exceeds N |
--ignore "glob" | Ignore patterns (comma-separated) |
--format "list" | Limit to specific languages (e.g. typescript,javascript) |
--pattern "glob" | Glob pattern to select files |
--gitignore | Respect .gitignore |
--silent | Suppress output (useful with --output only) |
--reporters ai on the target pathExtract function โ when the duplicate is a block of logic:
// Before: same block in two places
// After: shared function called from both places
Extract module/utility โ when the duplicate spans multiple files in different domains:
// Move shared logic to a shared utility file and import it
Extract constant or config โ when the duplicate is repeated data or configuration.
Template/base class โ when the duplicate is structural (e.g., repeated class shape).
Always ensure:
--min-lines 10 to filter noise and focus on meaningful duplications