Code Deduplication Detection

VerifiedCaution

Systematic methodology for detecting code duplication, dead code, and dependency bloat. Designed for Flutter and Firebase projects but adaptable to any codebase. Process includes project discovery, multi-phase scanning, severity classification, and structured report output with file locations and recommendations.

Sby Skills Guide Bot
DevelopmentIntermediate
1006/2/2026
Claude Code
#duplicate-code#dead-code#dependency-bloat#technical-debt#code-cleanup

Recommended for

Our review

Detects code duplication, dead code, and dependency bloat in software projects, providing a structured report.

Strengths

  • Comprehensive multi-phase analysis
  • Severity-based classification
  • Language-agnostic
  • Project context awareness

Limitations

  • Requires source file access
  • Depends on project configuration quality
  • May miss some indirect duplication patterns
When to use it

During a code quality audit, before a major refactor, or to reduce technical debt.

When not to use it

For very small projects or one-off changes that do not warrant a full analysis.

Security analysis

Caution
Quality score80/100

The skill employs Bash for analysis tasks like grepping and scanning, which introduces a level of risk if inputs are not sanitized. However, there is no indication of destructive commands, exfiltration, or disabling safety features. The purpose is legitimate (code duplication detection), so the risk is manageable.

Findings
  • Uses Bash, which is a powerful tool capable of executing arbitrary commands. Although the described usage is for benign code analysis, improper input handling could lead to command injection.

Examples

Full deduplication scan
Run a code deduplication analysis on this Flutter project. Identify duplicate code, dead code, and unused dependencies. Provide a report with severity levels and file locations.
Quick duplicate check
Scan for duplicate code blocks in the lib/ folder. Classify findings as Critical, Warning, or Suggestion.
Dead code detection
Find dead code and unused imports in this Firebase project. List files and suggest removals.

name: dedup-code-agent description: Code duplication detection and technical debt analysis skill. Provides methodology for finding duplicate code, dead code, and dependency bloat. allowed-tools: Read, Glob, Grep, Bash agent: dedup-code-agent context: fork metadata: triggers: duplicate code, dead code, code duplication, dependency bloat, technical debt, unused code, code cleanup related-skills: code-reviewer, systematic-debugging, receiving-code-review domain: quality role: specialist scope: analysis output-format: report

Code Deduplication Skill

Purpose

Provides systematic methodology for detecting code duplication, unused code, and dependency bloat -- primarily in Flutter + Firebase codebases but applicable to any project.

Process

  1. Discover -- Map project structure, features, shared utilities, and test coverage
  2. Scan -- Run multi-phase analysis for duplicates, dead code, and unused dependencies
  3. Classify -- Categorize findings by severity (Critical / Warning / Suggestion)
  4. Report -- Output structured report with file locations, counts, and recommendations

For the complete analysis methodology, detection patterns, and report format:

Read reference/dedup-analysis-methodology.md

Error Handling

If the target directory does not exist, report "Target not found" with the path searched. If no duplication is found, report "No duplicates detected" with the scan scope and file count.

Related skills