[{"data":1,"prerenderedAt":923},["ShallowReactive",2],{"navigation_docs":3,"-getting-started-agent-skill":129,"-getting-started-agent-skill-surround":918},[4,45,62,88,108],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Getting Started",false,"\u002Fgetting-started","1.getting-started",[10,15,20,25,30,35,40],{"title":11,"path":12,"stem":13,"icon":14},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F2.introduction","i-lucide-house",{"title":16,"path":17,"stem":18,"icon":19},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F3.installation","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Configuration","\u002Fgetting-started\u002Fconfiguration","1.getting-started\u002F4.configuration","i-lucide-settings",{"title":26,"path":27,"stem":28,"icon":29},"Supported Formats","\u002Fgetting-started\u002Fsupported-formats","1.getting-started\u002F5.supported-formats","i-lucide-file-code",{"title":31,"path":32,"stem":33,"icon":34},"Agent Skill","\u002Fgetting-started\u002Fagent-skill","1.getting-started\u002F6.agent-skill","i-lucide-cpu",{"title":36,"path":37,"stem":38,"icon":39},"Changelog","\u002Fgetting-started\u002Fchangelog","1.getting-started\u002F7.changelog","i-lucide-scroll-text",{"title":41,"path":42,"stem":43,"icon":44},"Migrating from v4 to v5","\u002Fgetting-started\u002Fmigration","1.getting-started\u002F8.migration","i-lucide-arrow-right-left",{"title":46,"path":47,"stem":48,"children":49,"icon":6},"CI & Hooks","\u002Fci-and-hooks","2.ci-and-hooks\u002F1.index",[50,52,57],{"title":46,"path":47,"stem":48,"icon":51},"i-lucide-git-pull-request",{"title":53,"path":54,"stem":55,"icon":56},"Use jscpd in CI","\u002Fci-and-hooks\u002Fci","2.ci-and-hooks\u002F2.ci","i-lucide-github",{"title":58,"path":59,"stem":60,"icon":61},"Use jscpd in Pre-Commit Hook","\u002Fci-and-hooks\u002Fpre-commit","2.ci-and-hooks\u002F3.pre-commit","i-lucide-git-commit",{"title":63,"path":64,"stem":65,"children":66,"icon":68},"Reporters","\u002Freporters","3.reporters\u002F1.index",[67,69,73,78,83],{"title":63,"path":64,"stem":65,"icon":68},"i-lucide-file-chart-column",{"title":70,"path":71,"stem":72,"icon":29},"HTML Reporter","\u002Freporters\u002Fhtml","3.reporters\u002F2.html",{"title":74,"path":75,"stem":76,"icon":77},"JSON Reporter","\u002Freporters\u002Fjson","3.reporters\u002F3.json","i-lucide-braces",{"title":79,"path":80,"stem":81,"icon":82},"Badge Reporter","\u002Freporters\u002Fbadge","3.reporters\u002F4.badge","i-lucide-award",{"title":84,"path":85,"stem":86,"icon":87},"SARIF Reporter","\u002Freporters\u002Fsarif","3.reporters\u002F5.sarif","i-lucide-shield-check",{"title":89,"icon":6,"path":90,"stem":91,"children":92,"page":6},"Benchmarks","\u002Fbenchmarks","4.benchmarks",[93,98,103],{"title":94,"path":95,"stem":96,"icon":97},"Detection Speed","\u002Fbenchmarks\u002Fdetection-speed","4.benchmarks\u002F1.detection-speed","i-lucide-zap",{"title":99,"path":100,"stem":101,"icon":102},"Multi-Format Detection","\u002Fbenchmarks\u002Fcross-format","4.benchmarks\u002F2.cross-format","i-lucide-layers",{"title":104,"path":105,"stem":106,"icon":107},"AI Token Efficiency","\u002Fbenchmarks\u002Fai-token-efficiency","4.benchmarks\u002F3.ai-token-efficiency","i-lucide-sparkles",{"title":109,"path":110,"stem":111,"children":112,"icon":114},"API","\u002Fapi","5.api\u002F1.index",[113,115,120,125],{"title":109,"path":110,"stem":111,"icon":114},"i-lucide-code",{"title":116,"path":117,"stem":118,"icon":119},"Rust Crates (v5)","\u002Fapi\u002Fcore","5.api\u002F2.core","i-lucide-box",{"title":121,"path":122,"stem":123,"icon":124},"Server API","\u002Fapi\u002Fserver","5.api\u002F3.server","i-lucide-server",{"title":126,"path":127,"stem":128,"icon":119},"MCP Server","\u002Fapi\u002Fmcp-server","5.api\u002F4.mcp-server",{"id":130,"title":31,"body":131,"description":910,"extension":911,"links":912,"meta":913,"navigation":914,"path":32,"seo":915,"stem":33,"__hash__":917},"docs\u002F1.getting-started\u002F6.agent-skill.md",{"type":132,"value":133,"toc":896},"minimark",[134,139,156,172,175,259,262,266,272,287,292,509,513,704,708,713,742,746,800,804,823,827,833,854,857,865,868,872,892],[135,136,138],"h2",{"id":137},"overview","Overview",[140,141,142,143,147,148,155],"p",{},"jscpd ships ",[144,145,146],"strong",{},"two agent skills"," for ",[149,150,154],"a",{"href":151,"rel":152},"https:\u002F\u002Fskills.sh",[153],"nofollow","skills.sh"," that teach AI coding assistants (Claude, Copilot, Gemini, Cursor, and others) how to detect and eliminate code duplication:",[157,158,159,166],"ol",{},[160,161,162,165],"li",{},[144,163,164],{},"jscpd"," — tool reference skill. Covers all CLI options, the AI reporter output format, and configuration file syntax.",[160,167,168,171],{},[144,169,170],{},"dry-refactoring"," — refactoring workflow skill. A guided process for reading clone output, choosing the right extraction strategy, applying the refactor, and verifying the clone is eliminated.",[135,173,16],{"id":174},"installation",[176,177,183],"pre",{"className":178,"code":179,"filename":180,"language":181,"meta":182,"style":182},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# Install both skills\nnpx skills add kucherenko\u002Fjscpd\n\n# Or install individually\nnpx skills add kucherenko\u002Fjscpd --skill jscpd\nnpx skills add kucherenko\u002Fjscpd --skill dry-refactoring\n","Terminal","bash","",[184,185,186,195,212,219,225,243],"code",{"__ignoreMap":182},[187,188,191],"span",{"class":189,"line":190},"line",1,[187,192,194],{"class":193},"sHwdD","# Install both skills\n",[187,196,198,202,206,209],{"class":189,"line":197},2,[187,199,201],{"class":200},"sBMFI","npx",[187,203,205],{"class":204},"sfazB"," skills",[187,207,208],{"class":204}," add",[187,210,211],{"class":204}," kucherenko\u002Fjscpd\n",[187,213,215],{"class":189,"line":214},3,[187,216,218],{"emptyLinePlaceholder":217},true,"\n",[187,220,222],{"class":189,"line":221},4,[187,223,224],{"class":193},"# Or install individually\n",[187,226,228,230,232,234,237,240],{"class":189,"line":227},5,[187,229,201],{"class":200},[187,231,205],{"class":204},[187,233,208],{"class":204},[187,235,236],{"class":204}," kucherenko\u002Fjscpd",[187,238,239],{"class":204}," --skill",[187,241,242],{"class":204}," jscpd\n",[187,244,246,248,250,252,254,256],{"class":189,"line":245},6,[187,247,201],{"class":200},[187,249,205],{"class":204},[187,251,208],{"class":204},[187,253,236],{"class":204},[187,255,239],{"class":204},[187,257,258],{"class":204}," dry-refactoring\n",[140,260,261],{},"Once installed, ask your agent to \"find and fix code duplication\" and it will invoke jscpd with the right options and act on the results.",[135,263,265],{"id":264},"jscpd-skill","jscpd Skill",[140,267,268,269,271],{},"The ",[144,270,164],{}," skill instructs the agent to:",[157,273,274,281,284],{},[160,275,276,277,280],{},"Run jscpd with the ",[184,278,279],{},"ai"," reporter on the target path",[160,282,283],{},"Parse the detected clone pairs (file paths + line ranges)",[160,285,286],{},"Report back with a summary of duplications",[288,289,291],"h3",{"id":290},"key-options","Key Options",[293,294,295,308],"table",{},[296,297,298],"thead",{},[299,300,301,305],"tr",{},[302,303,304],"th",{},"Option",[302,306,307],{},"Description",[309,310,311,322,332,342,352,362,372,382,392,406,420,430,450,460,469,479,489,499],"tbody",{},[299,312,313,319],{},[314,315,316],"td",{},[184,317,318],{},"--reporters ai",[314,320,321],{},"Use the AI-optimized reporter (compact clone list)",[299,323,324,329],{},[314,325,326],{},[184,327,328],{},"--reporters html",[314,330,331],{},"Generate HTML report",[299,333,334,339],{},[314,335,336],{},[184,337,338],{},"--min-tokens N",[314,340,341],{},"Minimum tokens for a duplication (default: 50)",[299,343,344,349],{},[314,345,346],{},[184,347,348],{},"--min-lines N",[314,350,351],{},"Minimum lines for a duplication (default: 5)",[299,353,354,359],{},[314,355,356],{},[184,357,358],{},"--ignore \"glob\"",[314,360,361],{},"Ignore patterns (comma-separated)",[299,363,364,369],{},[314,365,366],{},[184,367,368],{},"--format \"list\"",[314,370,371],{},"Limit to specific languages",[299,373,374,379],{},[314,375,376],{},[184,377,378],{},"--store \"type\"",[314,380,381],{},"Accepted for compatibility; external stores not available in v5 (detection is fast enough)",[299,383,384,389],{},[314,385,386],{},[184,387,388],{},"--store-path \"path\"",[314,390,391],{},"Accepted for compatibility; not used in v5",[299,393,394,399],{},[314,395,396],{},[184,397,398],{},"--noTips",[314,400,401,402,405],{},"Disable tips in output (also suppressed by ",[184,403,404],{},"--silent",")",[299,407,408,413],{},[314,409,410],{},[184,411,412],{},"--skipComments",[314,414,415,416,419],{},"Alias for ",[184,417,418],{},"--mode weak"," (strip comments before detection)",[299,421,422,427],{},[314,423,424],{},[184,425,426],{},"--formats-names \"map\"",[314,428,429],{},"Map filenames to formats",[299,431,432,437],{},[314,433,434],{},[184,435,436],{},"--mode \"mode\"",[314,438,439,440,443,444,443,447],{},"Detection quality: ",[184,441,442],{},"strict",", ",[184,445,446],{},"mild",[184,448,449],{},"weak",[299,451,452,457],{},[314,453,454],{},[184,455,456],{},"--blame",[314,458,459],{},"Blame authors of duplications from git",[299,461,462,466],{},[314,463,464],{},[184,465,404],{},[314,467,468],{},"Do not write detection progress and results to console",[299,470,471,476],{},[314,472,473],{},[184,474,475],{},"--absolute",[314,477,478],{},"Use absolute paths in reports",[299,480,481,486],{},[314,482,483],{},[184,484,485],{},"--ignoreCase",[314,487,488],{},"Ignore case of symbols in code (experimental)",[299,490,491,496],{},[314,492,493],{},[184,494,495],{},"--exitCode N",[314,497,498],{},"Exit code when duplications are detected",[299,500,501,506],{},[314,502,503],{},[184,504,505],{},"--verbose",[314,507,508],{},"Show full information during detection process",[288,510,512],{"id":511},"example-configuration","Example Configuration",[176,514,519],{"className":515,"code":516,"filename":517,"language":518,"meta":182,"style":182},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"threshold\": 0,\n  \"reporters\": [\"ai\"],\n  \"ignore\": [\"**\u002Fnode_modules\u002F**\", \"**\u002Fdist\u002F**\", \"**\u002F*.min.*\"],\n  \"format\": [\"typescript\", \"javascript\"],\n  \"minLines\": 5,\n  \"minTokens\": 50,\n  \"output\": \".\u002Freports\u002Fjscpd\"\n}\n",".jscpd.json","json",[184,520,521,527,549,572,614,645,661,678,698],{"__ignoreMap":182},[187,522,523],{"class":189,"line":190},[187,524,526],{"class":525},"sMK4o","{\n",[187,528,529,532,536,539,542,546],{"class":189,"line":197},[187,530,531],{"class":525},"  \"",[187,533,535],{"class":534},"spNyl","threshold",[187,537,538],{"class":525},"\"",[187,540,541],{"class":525},":",[187,543,545],{"class":544},"sbssI"," 0",[187,547,548],{"class":525},",\n",[187,550,551,553,556,558,560,563,565,567,569],{"class":189,"line":214},[187,552,531],{"class":525},[187,554,555],{"class":534},"reporters",[187,557,538],{"class":525},[187,559,541],{"class":525},[187,561,562],{"class":525}," [",[187,564,538],{"class":525},[187,566,279],{"class":204},[187,568,538],{"class":525},[187,570,571],{"class":525},"],\n",[187,573,574,576,579,581,583,585,587,590,592,595,598,601,603,605,607,610,612],{"class":189,"line":221},[187,575,531],{"class":525},[187,577,578],{"class":534},"ignore",[187,580,538],{"class":525},[187,582,541],{"class":525},[187,584,562],{"class":525},[187,586,538],{"class":525},[187,588,589],{"class":204},"**\u002Fnode_modules\u002F**",[187,591,538],{"class":525},[187,593,594],{"class":525},",",[187,596,597],{"class":525}," \"",[187,599,600],{"class":204},"**\u002Fdist\u002F**",[187,602,538],{"class":525},[187,604,594],{"class":525},[187,606,597],{"class":525},[187,608,609],{"class":204},"**\u002F*.min.*",[187,611,538],{"class":525},[187,613,571],{"class":525},[187,615,616,618,621,623,625,627,629,632,634,636,638,641,643],{"class":189,"line":227},[187,617,531],{"class":525},[187,619,620],{"class":534},"format",[187,622,538],{"class":525},[187,624,541],{"class":525},[187,626,562],{"class":525},[187,628,538],{"class":525},[187,630,631],{"class":204},"typescript",[187,633,538],{"class":525},[187,635,594],{"class":525},[187,637,597],{"class":525},[187,639,640],{"class":204},"javascript",[187,642,538],{"class":525},[187,644,571],{"class":525},[187,646,647,649,652,654,656,659],{"class":189,"line":245},[187,648,531],{"class":525},[187,650,651],{"class":534},"minLines",[187,653,538],{"class":525},[187,655,541],{"class":525},[187,657,658],{"class":544}," 5",[187,660,548],{"class":525},[187,662,664,666,669,671,673,676],{"class":189,"line":663},7,[187,665,531],{"class":525},[187,667,668],{"class":534},"minTokens",[187,670,538],{"class":525},[187,672,541],{"class":525},[187,674,675],{"class":544}," 50",[187,677,548],{"class":525},[187,679,681,683,686,688,690,692,695],{"class":189,"line":680},8,[187,682,531],{"class":525},[187,684,685],{"class":534},"output",[187,687,538],{"class":525},[187,689,541],{"class":525},[187,691,597],{"class":525},[187,693,694],{"class":204},".\u002Freports\u002Fjscpd",[187,696,697],{"class":525},"\"\n",[187,699,701],{"class":189,"line":700},9,[187,702,703],{"class":525},"}\n",[135,705,707],{"id":706},"dry-refactoring-skill","dry-refactoring Skill",[140,709,268,710,712],{},[144,711,170],{}," skill guides the agent through eliminating duplications:",[157,714,715,721,724,727,730,733,736,739],{},[160,716,717,718,720],{},"Run jscpd with ",[184,719,318],{}," on the target path",[160,722,723],{},"Parse each clone line to identify the two duplicated locations (file + line range)",[160,725,726],{},"Read both code fragments from the source files",[160,728,729],{},"Understand what the duplicated code does",[160,731,732],{},"Design a refactoring — extract a shared function, class, module, or constant",[160,734,735],{},"Apply the refactoring — update both locations and all other usages",[160,737,738],{},"Re-run jscpd to confirm the clone is eliminated",[160,740,741],{},"Repeat for remaining clones, highest-impact first",[288,743,745],{"id":744},"refactoring-strategies","Refactoring Strategies",[293,747,748,758],{},[296,749,750],{},[299,751,752,755],{},[302,753,754],{},"Strategy",[302,756,757],{},"When to use",[309,759,760,770,780,790],{},[299,761,762,767],{},[314,763,764],{},[144,765,766],{},"Extract function",[314,768,769],{},"Duplicate is a block of logic",[299,771,772,777],{},[314,773,774],{},[144,775,776],{},"Extract module\u002Futility",[314,778,779],{},"Duplicate spans multiple files in different domains",[299,781,782,787],{},[314,783,784],{},[144,785,786],{},"Extract constant\u002Fconfig",[314,788,789],{},"Duplicate is repeated data or configuration",[299,791,792,797],{},[314,793,794],{},[144,795,796],{},"Template\u002Fbase class",[314,798,799],{},"Duplicate has a repeated class shape",[288,801,803],{"id":802},"tips","Tips",[805,806,807,810,813,816],"ul",{},[160,808,809],{},"Start with clones that have the highest line count — most impact",[160,811,812],{},"A clone between test files may indicate a missing test helper",[160,814,815],{},"Clones across unrelated modules may signal a missing shared utility",[160,817,818,819,822],{},"Use ",[184,820,821],{},"--min-lines 10"," to filter noise and focus on meaningful duplications",[135,824,826],{"id":825},"how-it-uses-the-ai-reporter","How It Uses the AI Reporter",[140,828,829,830,832],{},"The skills use the ",[184,831,279],{}," reporter, which produces compact, token-efficient output:",[176,834,836],{"className":178,"code":835,"filename":180,"language":181,"meta":182,"style":182},"npx jscpd --reporters ai .\u002Fsrc\n",[184,837,838],{"__ignoreMap":182},[187,839,840,842,845,848,851],{"class":189,"line":190},[187,841,201],{"class":200},[187,843,844],{"class":204}," jscpd",[187,846,847],{"class":204}," --reporters",[187,849,850],{"class":204}," ai",[187,852,853],{"class":204}," .\u002Fsrc\n",[140,855,856],{},"Example output:",[176,858,863],{"className":859,"code":861,"language":862},[860],"language-text","Clones:\nsrc\u002Futils\u002F auth.ts:10-25 ~ helpers.ts:40-55\nsrc\u002Futils\u002Fauth.ts 30-45 ~ 80-95\n---\n2 clones · 3.1% duplication\n","text",[184,864,861],{"__ignoreMap":182},[140,866,867],{},"This format uses ~79% fewer tokens than the default reporter, keeping context usage low while giving the agent everything it needs to locate and fix each duplication.",[135,869,871],{"id":870},"more-information","More Information",[805,873,874,882,887],{},[160,875,876,877],{},"Skill page: ",[149,878,881],{"href":879,"rel":880},"https:\u002F\u002Fskills.sh\u002Fkucherenko\u002Fjscpd",[153],"skills.sh\u002Fkucherenko\u002Fjscpd",[160,883,884,885],{},"AI Reporter docs: ",[149,886,63],{"href":64},[160,888,889,890],{},"Configuration: ",[149,891,21],{"href":22},[893,894,895],"style",{},"html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":182,"searchDepth":197,"depth":197,"links":897},[898,899,900,904,908,909],{"id":137,"depth":197,"text":138},{"id":174,"depth":197,"text":16},{"id":264,"depth":197,"text":265,"children":901},[902,903],{"id":290,"depth":214,"text":291},{"id":511,"depth":214,"text":512},{"id":706,"depth":197,"text":707,"children":905},[906,907],{"id":744,"depth":214,"text":745},{"id":802,"depth":214,"text":803},{"id":825,"depth":197,"text":826},{"id":870,"depth":197,"text":871},"Use jscpd with AI coding assistants to automatically detect and refactor code duplications.","md",null,{},{"icon":34},{"title":31,"description":916},"Install the jscpd agent skill to let AI assistants detect and refactor code duplications automatically.","B0aKMbYbKm-5BDavJedCyCz0SUnmqWdEppg-_X-c1jY",[919,921],{"title":26,"path":27,"stem":28,"description":920,"icon":29,"children":-1},"Languages and formats supported by jscpd.",{"title":36,"path":37,"stem":38,"description":922,"icon":39,"children":-1},"Release history and what's new in jscpd.",1782123770547]