u/Affectionate-Blood92

jscpd — Copy-paste detector for 223 programming languages, with CI integration, HTML reports, and an AI-optimized output mode

jscpd — Copy-paste detector for 223 programming languages, with CI integration, HTML reports, and an AI-optimized output mode

Copy-paste is one of the most common sources of technical debt, and jscpd is the most language-comprehensive tool I've found for hunting it down.

What it does

Finds duplicated code blocks across your codebase using the Rabin-Karp algorithm. You point it at a directory, it tells you exactly where you (or your teammates) copy-pasted.

npx jscpd ./src

That's it. No install required.

Why it stands out

  • 223 supported formats — JS, TS, Python, Go, Rust, Java, C/C++, PHP, Ruby, Vue, Svelte, Astro, Terraform, SQL, Markdown, YAML... even Brainfuck and APL
  • Cross-file detection — a <script> block in a .vue file can match a .ts file
  • CI-friendly--threshold 5 fails the build if duplication exceeds 5%
  • Multiple reportershtml, json, xml, sarif (GitHub Code Scanning), markdown, csv
  • AI reporter — compact output with ~79% fewer tokens, designed for piping into LLM prompts
  • MCP server — works as a Model Context Protocol tool for AI assistants
  • Ignore blocks — wrap noisy code with /* jscpd:ignore-start */ comments
  • Git blame integration — find out who wrote the duplicated blocks
  • Self-dogfoods — the repo runs jscpd on itself in CI

Sample output (silent mode)

Found 60 exact clones with 3414 (46.81%) duplicated lines in 100 files.
Execution Time: 1381ms

Links

u/Affectionate-Blood92 — 17 hours ago

I stopped organizing AI agents like an Agile team and built a Mafia instead

Gangsta Agents (GitHub), a skills framework for spec-driven AI development. I wanted to share it here because the community actually cares about the problem it solves.


Why a Mafia family, not an Agile team

A lot of SDD frameworks organize agents to mimic Agile teams — standups, sprints, backlogs, story points. I think that's the wrong metaphor. Agile was designed around human coordination costs. AI agents don't need standups. They need hierarchy, discipline, and enforced pipelines.

Gangsta Agents is inspired by the structure of a Mafia family. There's a Don (you) at the top who approves every phase gate. An Underboss decomposes work. Crew Leads orchestrate. Workers execute in parallel. No one freelances outside their role. No one skips a step.

A well-run Mob moves faster than a committee — and so do agents when you stop pretending they need Agile rituals.


The core idea

Every feature goes through a 6-phase pipeline called The Heist:

  1. Reconnaissance — gather intel before any design decisions
  2. The Grilling — adversarial debate (more on this below)
  3. The Sit-Down — produce a signed Contract spec; no code without one
  4. Resource Development — execution planning
  5. Execution (The Hit) — code runs against the spec, never the other way around
  6. The Delivery — wrap up and update institutional memory

Each phase is gated. The Don (you) approves before anything moves forward.


What makes it different — The Grilling

Most spec-driven frameworks get you to write a spec before coding. Gangsta Agents adds a step most frameworks skip: adversarial validation before the spec is finalized.

The Grilling runs two agents in structured debate — a Proposer argues for the best approach from the Dossier, a Devil's Advocate attacks every assumption, identifies edge cases, and proposes alternatives. Multiple rounds run until positions stabilize, then the Grilling Conclusions are documented and approved before you ever write a Contract.

The result: weak assumptions get caught through debate, not production failures. I've found this is where single-perspective design silently goes wrong — no one challenges the obvious approach until it's too late.


What makes it different — The Ledger

AI sessions are stateless. Every session starts from zero unless you do something about it. Most frameworks don't.

The Ledger is persistent institutional memory stored in docs/gangsta/ in your project. It tracks:

  • Insights — successful patterns worth reusing
  • Fails — documented mistakes and why they happened
  • Constitution — project-specific rules that accumulate over time

The Ledger is updated at the end of every Heist. Any new session can read it and pick up where the last one left off — the agent knows the codebase's quirks, the gotchas, and the agreed-upon rules without you re-explaining them.

Without this, every session re-discovers the same things. Insights don't compound. Fails repeat.


Who it supports

Native integrations for Claude Code, GitHub Copilot, Gemini CLI, OpenCode, and Codex. Cursor supported via npx skills add. Skills are pure markdown files — no vendor lock-in, any agent can read them.


Happy to answer questions about the design decisions. The spec-is-law principle (Omerta rule #5: code contradicts spec → revise the spec first, never the reverse) was the hardest constraint to enforce in practice, and The Grilling emerged directly from watching LLMs confidently pick the wrong approach with no one to push back.

🔗 https://gangsta.page 🐙 https://github.com/kucherenko/gangsta

reddit.com
u/Affectionate-Blood92 — 4 days ago
▲ 5 r/vuejs

jscpd 4.2.0 released with enhanced Vue duplication detection

Hi everyone! 👋

I'm fairly new here, so I hope this kind of post is okay - please let me know if there's a better place for it.

I wanted to share that jscpd v4.2.0 now includes a completely rewritten Vue support 🎉

One of the biggest improvements is cross-format duplication detection for Vue Single File Components.
This means code inside .vue files can now be checked for duplication against:

  • JavaScript / TypeScript
  • CSS / SCSS
  • and other supported formats

So if the same logic or styles appear across Vue components and regular source files, jscpd can now detect it correctly.

The goal was to make duplication detection much more useful for real-world Vue projects where logic, templates, and styles are often mixed together.

Changelog: https://github.com/kucherenko/jscpd/blob/master/CHANGELOG.md

Feedback and suggestions are very welcome 🙂

reddit.com
u/Affectionate-Blood92 — 6 days ago

Detect Duplicate Code in Astro Projects with jscpd 4.2.0

Hi everyone! 👋

Just wanted to share that jscpd v4.2.0 now includes Astro support 🚀

If you haven’t used it before, jscpd is a copy/paste detector for source code that helps find duplicated code blocks and reduce technical debt in large projects. It already supports 223+ formats, and now .astro files are officially supported as well. (jscpd.dev)

Why this is useful for Astro projects:

  • detect duplicated layouts/components
  • catch repeated template sections across pages
  • spot copy-pasted client scripts/styles
  • keep growing content-heavy projects cleaner over time

Quick example:

npm install -g jscpd
jscpd --format astro ./src

Or use it in CI:

jscpd --format astro ./src

Would love feedback from the Astro community — especially from people using large content or component-driven codebases.

Changelog: jscpd v4.2.0 changelog

Project: jscpd GitHub repository

u/Affectionate-Blood92 — 6 days ago

jscpd v4.2.0 just landed with Svelte support — thought this community might find it useful! 🧹

Hi everyone! 👋

I'm fairly new here, so I hope this kind of post is welcome — please let me know if there's a better place to share it!

I just wanted to give a heads-up that jscpd v4.2.0 has landed with official Svelte support, and I thought the community might find it genuinely useful.


What is jscpd?

If you haven't come across it before, jscpd is a copy/paste detector for source code. It scans your project, finds duplicated blocks across files, and reports them — a really handy tool for spotting technical debt before it piles up. It supports 150+ languages and formats, and now .svelte is officially one of them.


Why does this matter for us?

Svelte's component model makes it wonderfully easy to build UIs quickly — but in larger projects it's easy to accidentally duplicate logic across components: repeated event handlers, similar reactive declarations, copy-pasted template sections. Having a tool that understands .svelte file structure (rather than just treating them as plain text) means you can actually catch those patterns automatically.


Getting started is pretty simple:

npm install -g jscpd
jscpd --format svelte ./src

You can also add it to your CI pipeline with a threshold to fail the build if duplication gets too high:

jscpd --format svelte --threshold 5 ./src

I've been wanting this for a while in my own Svelte projects, so I was really happy to see it land. Huge thanks to the maintainers for making it happen! 🙏

Full changelog here if you're curious: https://github.com/kucherenko/jscpd/blob/master/CHANGELOG.md

Hope this is helpful to someone — happy to answer any questions if I can! 😊

u/Affectionate-Blood92 — 6 days ago