Sign in
Explore
Workflows · WorkflowEveryday codingRefactoringGit & pull requestsReviewed

Duplicate Code Detector

Finds duplicate code patterns across the codebase and suggests refactoring opportunities.

Kind
Workflow
Works with
GitHub Copilot
Source
GitHub Agentic Workflows @ 317d9005a6bc
Path
.github/workflows/duplicate-code-detector.md
Jobs
Review
Topics
Refactoring, Git & pull requests

Credit

Made by
github
Original
github.com/github/gh-aw/blob/317d9005a6bca5ae586c3c3dcc0acf3a…
License
MIT

Listed by Skill Manifest; not made by us.

InstallCopy it from the source repository, or sign in and let the assistant adapt it for your project.
Install factsScanned 3 Nov 2026
Adds
  • Steps in the source's README; what they create is not stated in the catalog
Runs scripts
Unknown
Uses the network
None found
Needs secrets
None found
Calls other skills
  • /summary
  • /details
Source revision
317d9005a6bc
Licence
MIT
Last activity
27 Nov 2026
Source changed after the scan
Yes
  • Last push 27 Nov 2026, scanned 3 Nov 2026; read it again before you rely on this scan
Review
Reviewed

Found by a static scan of the stored text; nothing is run. “None found” is not a guarantee, so read what you install before you run it.

  • What this adds depends on the source's own instructions
# Duplicate Code Detection

Analyze code to identify duplicated patterns using Serena's semantic code analysis capabilities. Report significant findings that require refactoring.

## Task

Detect and report code duplication by:

1. **Analyzing Recent Commits**: Review changes in the latest commits
2. **Detecting Duplicated Code**: Identify similar or duplicated code patterns using semantic analysis
3. **Reporting Findings**: Create a detailed issue if significant duplication is detected (threshold: >10 lines or 3+ similar patterns)

## Context

- **Repository**: ${{ github.repository }}
- **Commit ID**: ${{ github.event.head_commit.id }}
- **Triggered by**: @${{ github.actor }}

## Analysis Workflow

### 1. Project Activation

Activate the project in Serena:
- Use `activate_project` tool with workspace path `${{ github.workspace }}` (mounted repository directory)
- This sets up the semantic code analysis environment

### 2. Changed Files Analysis

Identify and analyze modified files:
- Determine files changed in the recent commits
- **ONLY analyze .go and .cjs files** - exclude all other file types
…