Typescript Best Practices
jwynia/agent-skills
Guide AI agents through TypeScript coding best practices including type safety, error handling, code organization, and architecture patterns.
Finds duplicated code in 220+ languages with jscpd, reports exact, renamed and near-miss clones in a compact agent-friendly format and measures duplication.
$ npx skills add kucherenko/jscpd --skill jscpd -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install kucherenko/jscpd jscpd --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/kucherenko/jscpd.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/jscpd .claude/skills/jscpd && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "jscpd" agent skill from https://github.com/kucherenko/jscpd/tree/master/skills/jscpd into .claude/skills/jscpd/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "jscpd", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/kucherenko/jscpd/tree/master/skills/jscpdType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add kucherenko/jscpd --skill jscpd -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install kucherenko/jscpd jscpd --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/kucherenko/jscpd.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/jscpd .agents/skills/jscpd && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "jscpd" agent skill from https://github.com/kucherenko/jscpd/tree/master/skills/jscpd into .agents/skills/jscpd/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "jscpd", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add kucherenko/jscpd --skill jscpd -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install kucherenko/jscpd jscpd --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/kucherenko/jscpd.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/jscpd .cursor/skills/jscpd && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "jscpd" agent skill from https://github.com/kucherenko/jscpd/tree/master/skills/jscpd into .cursor/skills/jscpd/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "jscpd", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/kucherenko/jscpd.git --path skills/jscpd--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add kucherenko/jscpd --skill jscpd -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install kucherenko/jscpd jscpd --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/kucherenko/jscpd.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/jscpd .gemini/skills/jscpd && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "jscpd" agent skill from https://github.com/kucherenko/jscpd/tree/master/skills/jscpd into .gemini/skills/jscpd/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "jscpd", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install kucherenko/jscpd jscpdInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add kucherenko/jscpd --skill jscpd -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/kucherenko/jscpd.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/jscpd .github/skills/jscpd && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "jscpd" agent skill from https://github.com/kucherenko/jscpd/tree/master/skills/jscpd into .github/skills/jscpd/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "jscpd", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add kucherenko/jscpd --skill jscpd -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install kucherenko/jscpd jscpd --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/kucherenko/jscpd.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/jscpd .opencode/skills/jscpd && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "jscpd" agent skill from https://github.com/kucherenko/jscpd/tree/master/skills/jscpd into .opencode/skills/jscpd/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "jscpd", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
jscpdFinds duplicated code in 220+ languages with jscpd, reports exact, renamed and near-miss clones in a compact agent-friendly format and measures duplication.
The skill runs `npx jscpd --reporters ai` on a path and explains the output. The ai reporter prints one line per clone pair as file and line ranges, with shared path prefixes factored out to save tokens. A suffix marks the kind: none for an exact copy, `(renamed)` when only identifiers, literals or annotations differ, a gap marker when exact clones are merged across a few unmatched lines, and an AST marker when two functions or classes share syntax-tree structure above a similarity threshold.
Options include HTML and JSON reporters, `--min-tokens` (default 50) and `--min-lines` (default 5) for the smallest clone counted, `--threshold` to exit with an error when duplication exceeds a percentage, `--ignore` globs, `--format` to limit languages and `--cross-formats` for clones across related formats such as JavaScript and TypeScript. It also reports duplication percentages and a codebase summary to find refactoring hotspots, and the number beside an AST match should be read with the run's similarity options in mind.
Read from SKILL.md and the folder at commit 14bc176. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
npxFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
jscpd Duplicate Code Detector loads about 4.5k tokens when it runs. Until then it costs about 47 tokens; SKILL.md has 1,899 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from kucherenko/jscpd at commit 14bc176, republished under its MIT licence (© kucherenko). 1,899 words, ~4,481 tokens.
.claude/skills/jscpd/SKILL.md (or your agent's skills folder).Copy-paste detector for programming source code, supports 220+ languages. Use this skill to run jscpd and understand its output.
# 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>
# Second pass, noisier: copies that only differ in names and values (Type-2, "renamed").
# Review each hit before acting on it.
npx jscpd --reporters ai --ignore-identifiers --min-tokens 70 <path>
# Third pass, noisier still: copies with a few edited lines or the same function
# structure (Type-3, "similar"). Keep the settings tight.
npx jscpd --reporters ai --max-gap-lines 1 --similarity <path>
# Where to refactor first: clone list plus a hotspot summary
npx jscpd --reporters ai --summary <path>
# Most complex files only, without clone detection
npx jscpd --complexity --reporters ai <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
src/cart/ basket.js:1-9 ~ cart.js:1-9 (renamed)
src/api/ save-account.js:1-12 ~ save-user.js:1-11 [~0.91 gap]
src/billing/ orders.ts:1-14 ~ refunds.ts:1-15 [~0.85 ast]
---
5 clones · 4.2% duplicationEach 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-57A suffix tells the kind of clone; no suffix means an exact copy:
(renamed): the two blocks differ only in identifier names, literal values or annotations (Type-2). Only appears with --ignore-identifiers, --ignore-literals or --ignore-annotations.[~0.91 gap]: two exact clones merged across up to --max-gap-lines unmatched lines (Type-3). The number is matched tokens over the merged span.[~0.85 ast]: two functions whose normalized syntax trees share at least --similarity of their subtrees (Type-3). The number is that share. The names of called functions and methods and the operators count, local names and literal values do not, so a renamed copy with other constants scores 1 and a copy that calls other methods scores lower.| Option | Description |
|---|---|
--reporters ai | Use the AI-optimized reporter (compact clone list for agents) |
--reporters html | Generate HTML report |
--reporters json | Output JSON report |
--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) |
--cross-formats "groups" | Detect clones across related formats (e.g. javascript,typescript or the js-ts preset) |
--ignore-identifiers | Treat all identifiers as equal, so blocks that differ only in variable, function or type names match (Type-2, reported as renamed) |
--ignore-literals | Treat all string literals as equal and all numeric literals as equal (Type-2) |
--ignore-annotations | Drop @Name / @Name(...) annotations and decorators before matching, in languages where @ means one (Type-2) |
--max-gap-lines N | Merge clones of one file pair separated by at most N unmatched lines into one similar clone (Type-3, default: 0 = off) |
--similarity [RATIO] | Report pairs of functions whose normalized syntax trees share at least RATIO of their subtrees, in (0, 1], as similar clones (Type-3, 0.8 without a value). JavaScript, TypeScript, Python, Java, Kotlin, Scala, C#, Go, Rust, C, C++, PHP, Ruby, Swift and Clojure; test files are left out |
--min-nodes N | The fewest nodes of a normalized syntax tree a function needs for --similarity (default: 20) |
--summary | Append a codebase summary: top files/folders by tokens, lines, size, complexity, with duplication share |
--summary-top N | Number of entries in each summary top list (default: 10) |
--summary-by metric | Summary ranking metric: tokens, lines, size, complexity (default: tokens) |
--kind list | Report only these clone kinds: exact, renamed, similar, gap, ast (never enables a detector) |
--complexity | Complexity tables only, without clone detection (reporters: console, ai, json) |
--dead-code | Find unused files, exports, module-private declarations and imports — JavaScript, TypeScript, JSX, TSX, Vue, Svelte, Astro, Python. Each finding carries a 0-100 confidence score |
--dead-code-categories list | Limit --dead-code/--dashboard to categories: unused-file, unused-export, unused-symbol, unused-import |
--min-confidence N | Floor for --dead-code/--dashboard findings, 0-100 (default: 60) |
--entry "glob" | Extra entry points for dead-code analysis, beyond what's inferred from package.json/pyproject.toml/framework conventions |
--include-tests | Count test-only usage as "used" for dead-code analysis (excluded by default) |
--include-entry-exports | Also flag an entry file's own unused exports (excluded by default: its exports are the public API) |
--dashboard | One screen: health badge, project size and largest code files, duplication, complexity, dead code (JS/TS/Python); -r json writes jscpd-dashboard.json |
--health | Project health badge only: 0-100 score and grade from duplication, dead code and complexity (-r ai one line, -r json, -r badge) |
--health-input FILE | Add metrics from other tools (coverage, tests, security) to the health score |
--pattern "glob" | Glob pattern to select files |
--no-gitignore | Do not respect .gitignore (it is respected by default) |
--output "path" | Directory to write reports to |
--silent | Suppress console output (useful with file reporters and --output) |
--list | List all supported formats and exit |
--no-tips | Disable tips in output (skipped automatically when stdout is not a TTY or CI or JSCPD_NO_TIPS is set) |
--config "path" | Path to .jscpd.json config file |
By default jscpd reports exact clones only: the token sequences are identical (whitespace, layout and, depending on the mode, comments do not count). Two opt-in families widen the net. Run them as separate passes after the default scan, because they find more and longer clones and change what a "clone" means.
These passes are noisy by design. An exact clone is almost always a real copy. A renamed or similar clone is a candidate: the flags deliberately ignore the very things (names, values, a statement or two) that often make two blocks different in meaning. Expect false positives from:
describe/it blocks, fixtures and setup code repeat the same shape on purposereduce loops or two switch statements that share structure but not logic--ignore-identifiers a 50-token block is mostly placeholders, so raise --min-tokensRules that keep the noise manageable:
--ignore-identifiers alone (add --ignore-literals only when constants are the known problem), --max-gap-lines 1 or 2, --similarity 0.85 or higher, and --min-tokens 70 or more for the identifier pass. Widen only when the tight run comes back empty.(renamed) or [~…] line as a lead to read, not a defect to fix. Do not gate CI (--threshold, --fail-on-new-clones) on these passes unless the team has reviewed what they report on the codebase.--ignore-identifiers, --ignore-literals, --ignore-annotations)Copies where someone renamed the variables or changed the constants:
npx jscpd --reporters ai --ignore-identifiers <path> # function a(x) {…} matches function b(y) {…}
npx jscpd --reporters ai --ignore-identifiers --ignore-literals <path> # …and 10 matches 25, 'dev' matches 'prod'
npx jscpd --reporters ai --ignore-annotations <path> # @Override / @Deprecated no longer split a cloneClones:
basket.js:1-9 ~ cart.js:1-9 (renamed)
limits-dev.js:1-13 ~ limits-prod.js:1-13 (renamed)
---return never matches retry), so structure still has to match.--ignore-annotations only acts in Java, Kotlin, Scala, Groovy, Python, Dart, Swift, JavaScript and TypeScript; in Ruby, Perl, T-SQL, Razor and CSS @ means something else and is left alone.ignoreIdentifiers, ignoreLiterals, ignoreAnnotations.--max-gap-lines, --similarity)Copies with a few edited lines, or functions rewritten with the same shape:
npx jscpd --reporters ai --max-gap-lines 2 <path> # a copy with up to 2 inserted/changed lines becomes one clone
npx jscpd --reporters ai --similarity <path> # functions whose normalized syntax trees share ≥82% of their subtreesClones:
save-account.js:1-12 ~ save-user.js:1-11 [~0.91 gap]
orders.ts:1-14 ~ refunds.ts:1-15 [~0.85 ast]
-----max-gap-lines N only joins clones the exact run already found, so it removes fragmentation rather than inventing matches; it works in every language. A merge is refused when the gap holds more tokens than the halves share (similarity would drop under 0.5).--similarity normalizes the syntax tree of every function (local names and literals become markers, called names and operators stay) and scores the share of subtrees two trees have in common, so a renamed copy scores 1.0, one inserted statement in a function of ten about 0.85, a copy that calls other methods less. It applies to JavaScript, TypeScript, Python, Java, Kotlin, Scala, C#, Go, Rust, C, C++, PHP, Ruby, Swift and Clojure, and to their code blocks in Markdown and in Vue, Svelte and Astro files; other formats are a silent no-op. A function nested in another is part of it, and test files are left out. Start at the default 0.8 and lower to 0.7 only when looking for leads; read both functions before believing a low score.similar takes precedence over renamed when both apply (a merged clone is no longer identical even after normalization).maxGapLines, similarity, minNodes.console: Clone found (javascript, renamed), Clone found (javascript, similar (gap) ~0.91), Clone found (javascript, similar (ast) ~0.75).json: "kind": "exact" | "renamed" | "similar", plus "similarity" and "method": "gap" | "ast" for similar clones, and the size of each normalized tree as "nodes" in firstFile and secondFile for ast ones.sarif: rules jscpd/duplicate-code, jscpd/renamed-code, jscpd/similar-code (clones merged across a gap), jscpd/similar-function (functions and classes paired by --similarity) and jscpd/semantic-code (--semantic); Code Climate uses the same check_name values.exact clones and its output is unchanged by these features.--baseline file per configuration.--summary)--summary appends a refactoring-hotspot overview to the run output — use it to decide where to refactor first before diving into individual clones:
# Compact clone list + compact summary, optimized for agents
npx jscpd --reporters ai --summary --no-tips <path>
# Rank by complexity instead of tokens, top 5 lists
npx jscpd --reporters ai --summary --summary-by complexity --summary-top 5 <path>With the ai reporter the summary is one line per entry:
Summary by tokens (321 files, 129 folders):
files (tokens/lines/size/cx/dup%):
src/files.ts 2052/363/11662/80/0.0%
long-line/theme-branded.js 498/15/2.5K/10/93.3%
...
folders (files/tokens/lines/size):
src/core 8/5264/843/27136
...How to read it:
--summary-by metric, but every row carries all metrics — tokens/lines/size/cx/dup%.if/while/&&); treat it as a ranking signal, not an exact metric.dup% is the best refactoring target. It reflects the clones of the current run, so with the Type-2/Type-3 flags it rises accordingly.console reporters the summary renders as aligned tables; in the json report it appears as an additive summary key (absent when the flag is off).Config file equivalents: "summary": true, "summaryTop": 10, "summaryBy": "tokens".
By default each format is compared only against itself. --cross-formats defines groups of related formats that share one comparison pool, so a block duplicated between a .js and a .ts file is reported as a clone:
# One group: compare JavaScript and TypeScript files together
npx jscpd --reporters ai --cross-formats "javascript,typescript" <path>
# Preset covering javascript, jsx, typescript, tsx
npx jscpd --reporters ai --cross-formats "js-ts" <path>
# Multiple groups are separated by ";"
npx jscpd --reporters ai --cross-formats "javascript,typescript;css,scss" <path>Notes:
function f(a: number): void matches function f(a). Reported positions still reference the original source.crossFormats (or cross-formats) and accepts a string ("javascript,typescript;css,scss"), an array of strings (["javascript,typescript", "css,scss"]), or an array of arrays ([["javascript","typescript"],["css","scss"]]).--compare)--compare SOURCE TARGET pairs the functions of two folders with the --semantic embedding model and lists which functions of each side have a counterpart in the other: the progress of a port to another language or framework, or the parity of two implementations of one app. It takes exactly two paths that do not overlap, needs the model once (--semantic-download), and runs no clone detection.
npx jscpd --compare python-lib/ rust-lib/ # progress of a port and what is left
npx jscpd --compare ios/ android/ -r console-full # parity, with every pair and its similarity
npx jscpd --compare python-lib/ rust-lib/ -r json -o .jscpd-compare --silent # jscpd-compare.json for an agentFunctions pair by code first (each is the other's closest match), then by name when the names match once case and underscores are ignored and the code is similar enough. Every pair has its similarity and a level (high, medium, low) on the scale of the model, and the default report lists the pairs under other names on their own. jscpd measures tests and code in two blocks and pairs a test only with a test. --min-tokens defaults to 30 here. Reporters: console, console-full, json, markdown. See the compare-codebases skill for how the comparison works and how to check it, and code-migration for porting code with it.
Create a .jscpd.json in your project root:
{
"threshold": 0,
"reporters": ["ai"],
"ignore": ["**/node_modules/**", "**/dist/**", "**/*.min.*"],
"format": ["typescript", "javascript"],
"minLines": 5,
"minTokens": 50,
"ignoreIdentifiers": false,
"ignoreLiterals": false,
"maxGapLines": 0,
"similarity": 1,
"summary": false,
"output": "./reports/jscpd"
}Once you've detected clones, use the dry-refactoring skill for a guided workflow to eliminate them, with a strategy per clone kind:
→ dry-refactoring — step-by-step refactoring strategies and workflow for removing duplication. Install with:
npx skills add https://github.com/kucherenko/jscpd --skill dry-refactoringFor a broader "clean up this codebase" pass — duplication, then dead code, then the largest/most complex files, prioritized from --health/--dashboard and re-measured at the end — use codebase-refactoring:
npx skills add https://github.com/kucherenko/jscpd --skill codebase-refactoring© kucherenko, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/jscpd of kucherenko/jscpd.
Open the folder on GitHubat commit 14bc176
jscpd Duplicate Code Detector next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| jscpd Duplicate Code Detector this skillkucherenko/jscpd | 6.4k | — | ~4.5k | Automated safety check: Pass | MIT | |
| Typescript Best Practicesjwynia/agent-skills | 169 | — | ~2.5k | Automated safety check: Pass | MIT | |
| Code ReviewerLeoYeAI/openclaw-master-skills | 2.2k | 1 repos | ~1.2k | Automated safety check: Pass | MIT | |
| Typescript Writeaiskillstore/marketplace | 430 | 2 repos | ~1.7k | Automated safety check: Pass | None | |
| Code Reviewerborghei/Claude-Skills | 886 | — | ~1.7k | Automated safety check: Pass | MIT | |
| Systematic Code Refactoringluongnv89/claude-howto | 42k | — | ~3k | Automated safety check: Pass | MIT |
jwynia/agent-skills
Guide AI agents through TypeScript coding best practices including type safety, error handling, code organization, and architecture patterns.
LeoYeAI/openclaw-master-skills
Code review automation for TypeScript, JavaScript, Python, Go, Swift, Kotlin.
aiskillstore/marketplace
Write TypeScript and JavaScript code following Metabase coding standards and best practices.
borghei/Claude-Skills
Code review automation for TypeScript, JavaScript, Python, Go, Swift, and Kotlin.
luongnv89/claude-howto
Guides refactoring in phases based on Martin Fowler's method: research, test coverage check, planning and small tested steps, with your approval at each phase.
dmmulroy/anti-slop
Installs, updates or migrates the vendored anti-slop Oxlint plugin in a repository, keeping local rule changes and the plugin's license and provenance files.
kucherenko/jscpd
Measures a code port between languages or frameworks with jscpd's function-level comparison, porting tests before code and tracking what is left unmatched.
kucherenko/jscpd
Compares two folders function by function with jscpd --compare, across languages if needed, and explains which functions match and which have no counterpart.
kucherenko/jscpd
A three-part cleanup guided by jscpd: measure health, then fix duplicated code, remove dead code and simplify the most complex files, finishing by re-measuring the score.
kucherenko/jscpd
Removes copy-paste duplication found by jscpd, starting with exact clones and hotspots, then renamed and near-miss copies, using proven refactoring strategies.
Works with
Categories
Finds duplicated code in 220+ languages with jscpd, reports exact, renamed and near-miss clones in a compact agent-friendly format and measures duplication. The skill runs `npx jscpd --reporters ai` on a path and explains the output. The ai reporter prints one line per clone pair as file and line ranges, with shared path prefixes factored out to save tokens.
jscpd Duplicate Code Detector fits situations like: finding copy-pasted code before a refactor; measuring duplication percentage and failing a check above a threshold; spotting near-miss clones where only names or constants changed; locating duplication hotspots to prioritize cleanup.
Run `npx skills add kucherenko/jscpd --skill jscpd -a claude-code`. Or copy the skill folder (skills/jscpd in kucherenko/jscpd) into .claude/skills/jscpd in your project. Claude Code loads it when a task matches its description.
Run `npx skills add kucherenko/jscpd --skill jscpd -a codex`. Or copy the skill folder (skills/jscpd in kucherenko/jscpd) into .agents/skills/jscpd in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add kucherenko/jscpd --skill jscpd -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/jscpd, .gemini/skills/jscpd, .github/skills/jscpd and .opencode/skills/jscpd in your project.
Going by SKILL.md and its folder, jscpd Duplicate Code Detector needs the command-line tools its instructions call (npx). Our summary lists: Node.js with npx.
SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
jscpd Duplicate Code Detector is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 4.5k tokens (SKILL.md is roughly 18k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with jscpd Duplicate Code Detector: Typescript Best Practices (jwynia/agent-skills, 169 stars), Code Reviewer (LeoYeAI/openclaw-master-skills, 2.2k stars), Typescript Write (aiskillstore/marketplace, 430 stars) and Code Reviewer (borghei/Claude-Skills, 886 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
kucherenko (a GitHub user) maintains it in kucherenko/jscpd, which has 6,361 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 9, 2026.
Source: kucherenko/jscpd on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.