Gojiberry AI
AI agents that find and contact high-intent leads for you
Try Gojiberry free →
Hermes Agent
Run your Hermes agent, fully managed
Launch on Hostinger →
Hostinger VPS
Spin up a VPS in one click, 20% off
Launch on Hostinger →
Firecrawl
Crawl and scrape any site into clean data
Try Firecrawl free →
Runable
One AI agent to build, run, and grow your business
Try Runable free →
Context.dev
One API to scrape, enrich, and extract the web
Start building free →
Jotform
Forms, workflows, and AI Agents for your team
Try Jotform free →
Runable
One AI agent to build, run, and grow your business
Try Runable free →
OpenClaw
Deploy a managed OpenClaw agent in 60 seconds
Launch on Hostinger →
Sponsor here
9/10 sponsor slots taken — 1 left
Claim it →
Claude Market
Menu
SkillsMCPPluginsMarketplacesNewsletterSubmit MCPSkillPluginMCPMCP, plugin, or skillAdvertise
Claude Market
SkillsMCPPluginsMarketplacesNewsletterSubmit MCPSkillPluginMCPMCP, plugin, or skillAdvertise
Skills/kucherenko/jscpd/dry-refactoring
dry-refactoring logo

dry-refactoring

kucherenko/jscpd
871 installs6K stars
Run it on Hostinger, 20% off →Your friend gets 20% off too, using this linkFree API →|View on GitHub|Create your own skill →

Installation

npx skills add https://github.com/kucherenko/jscpd --skill dry-refactoring

Summary

Guided workflow to eliminate copy-paste duplication detected by jscpd. Refactor clones using extract function, module, constant, or base class strategies.

SKILL.md

dry-refactoring

Guided workflow to eliminate copy-paste duplication in source code. Use after running jscpd to detect clones.

Prerequisites

First, run jscpd to identify duplications:

npx jscpd --reporters ai <path>

In codebases that mix related formats (e.g. JavaScript and TypeScript), add --cross-formats so clones spanning both are detected too:

npx jscpd --reporters ai --cross-formats "js-ts" <path>

See the jscpd skill for full option reference, including cross-format group syntax.

Workflow

  1. Run jscpd with --reporters ai on the target path
  2. Parse each clone line to identify the two duplicated locations (file + line range)
  3. Read both code fragments from the source files
  4. Understand what the duplicated code does
  5. Design a refactoring: extract a shared function, class, module, or constant
  6. Apply the refactoring — update both locations and all other usages
  7. Re-run jscpd to confirm the clone is eliminated
  8. Repeat for remaining clones, highest-impact first

Refactoring Strategies

Extract 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:

  • All call sites are updated, not just the two reported by jscpd
  • Tests still pass after refactoring
  • The extracted abstraction has a clear, descriptive name

Tips

  • Start with clones that have the highest line count — they have the most impact
  • A clone between test files may indicate a missing test helper
  • Clones across unrelated modules may signal a missing shared utility
  • A cross-format clone (same logic in a .js and a .ts file, found with --cross-formats) often means code was ported without deleting the original — consolidate into one implementation (usually the TypeScript one) and update imports, rather than extracting a third shared copy
  • Use --min-lines 10 to filter noise and focus on meaningful duplications

Score

0–100
65/ 100

Grade

C

Popularity17/30

871 installs — growing adoption. Source repo has 5,983 GitHub stars.

Completeness27/30

Documented: full SKILL.md body, description, one-line install. Missing: category/license metadata.

Trust15/25

Community skill with a public GitHub source repository you can review.

Freshness6/15

No update timestamp is tracked for this skill in our catalog.

Scored automatically from popularity, completeness, trust, and freshness — computed only from data in our catalog, never fabricated.

Proud of your score? Add this badge to your README.

Paste a snippet into your GitHub README. The badge updates automatically and links back to this page.

Dry Refactoring skill score badge previewScore badge

Markdown

[![Dry Refactoring skill](https://www.claudemarket.ai/skills/kucherenko/jscpd/dry-refactoring/badges/score.svg)](https://www.claudemarket.ai/skills/kucherenko/jscpd/dry-refactoring)

HTML

<a href="https://www.claudemarket.ai/skills/kucherenko/jscpd/dry-refactoring"><img src="https://www.claudemarket.ai/skills/kucherenko/jscpd/dry-refactoring/badges/score.svg" alt="Dry Refactoring skill"/></a>

Dry Refactoring FAQ

How do I install the Dry Refactoring skill?

Run “npx skills add https://github.com/kucherenko/jscpd --skill dry-refactoring” in your terminal. The skill is added to your agent's skills directory and picked up automatically on the next run — no restart or extra configuration needed.

What does the Dry Refactoring skill do?

Guided workflow to eliminate copy-paste duplication detected by jscpd. Refactor clones using extract function, module, constant, or base class strategies. The full SKILL.md on this page shows the exact instructions the skill gives your agent.

Is the Dry Refactoring skill free?

Yes. Dry Refactoring is a free, open-source skill published from kucherenko/jscpd. As with any third-party skill, review the source repository before installing it into an agent with sensitive access.

Does Dry Refactoring work with Claude Code and OpenClaw?

Yes. Skills use the portable SKILL.md format, so Dry Refactoring works with Claude Code, OpenClaw, Codex, Hermes, and any other agent that reads SKILL.md skills.

Recommended skills

Browse all →
find-skills logo

find-skills

vercel-labs/skills

2.9M installsInstall
grill-me logo

grill-me

mattpocock/skills

817K installsInstall
frontend-design logo

frontend-design

anthropics/skills

762K installsInstall
grill-with-docs logo

grill-with-docs

mattpocock/skills

696K installsInstall
improve-codebase-architecture logo

improve-codebase-architecture

mattpocock/skills

671K installsInstall
agent-browser logo

agent-browser

vercel-labs/agent-browser

652K installsInstall

Related guides

Hand-picked reading to help you choose, install, and use agent skills.

Guide10 Openclaw Skills Every Nextjs Developer NeedsGuideBest Openclaw Skills 2026GuideHow To Evaluate Openclaw Skill Before Installing

Skills by category

FrontendBackend & APIsTesting & QASecurityDevOps & CI/CDMCP & ToolingAutomationData & Analysis+27 more

MCP servers by category

MCP & ToolingBackend & APIsData & AnalysisDevOps & CI/CDAutomationSecurityDocsTesting & QA+24 more

Plugins by category

AutomationDevOps & CI/CDData & AnalysisDesign & CreativeSecurityBackend & APIsFrontendTesting & QA+16 more

Marketplaces by category

AutomationData & AnalysisDevOps & CI/CDDesign & CreativeFrontendBackend & APIsTesting & QASecurity+21 more

The Agent Stack

Weekly Claude Code, Agent SDK, and MCP moves worth your time — free.

Claude Market

AI agent skills directory, marketplace, and workflow hub for OpenClaw, Hermes Agent, Claude Code, Codex, and MCP-powered operator stacks.

Independent project, not affiliated with Anthropic.

Resources

  • Browse Skills
  • Browse MCP Servers
  • Browse Plugins
  • Browse Marketplaces
  • Newsletter

More

  • Submit a Tool
  • Create a Skill
  • Advertise
  • Free Tools
  • API
  • Shipping
  • Contact
  • Terms
  • Privacy
© 2026 Claude Market · Not affiliated with Anthropic
Fazier badgeFeatured on Twelve ToolsFeatured on Wired BusinessRemote OpenClaw - Featured on AI Agents DirectoryListed on Turbo0Featured on Uneed