Files
awesome-copilot/.github/workflows/duplicate-resource-detector.md
T
Copilot 3bd22bc0f4 Fix PR duplicate check not running on external contributor submissions (#2188)
* Initial plan

* Fix PR duplicate check not running on external contributor submissions

Add forks: [\"*\"] and roles: all to pr-duplicate-check.md so the
agentic workflow runs for all PR authors, including external contributors
submitting from forks. Previously, the generated lock.yml contained:
- A fork repository check blocking all fork PRs from running
- A team membership check (admin/maintainer/write) blocking external contributors

Recompiled with gh aw compile to regenerate pr-duplicate-check.lock.yml.
The pre_activation job (which held the membership gate) is now removed,
and the activation job runs unconditionally for all pull_request events.

Closes #2121

Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fixing a bunch of warnings on all the agentic workflows

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
Co-authored-by: Aaron Powell <me@aaron-powell.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-03 10:08:42 +10:00

5.1 KiB

description, on, permissions, tools, safe-outputs
description on permissions tools safe-outputs
Weekly scan of agents, instructions, and skills to identify potential duplicate resources and report them for review
schedule
weekly
contents issues copilot-requests
read read write
github
toolsets
repos
issues
create-issue noop
max close-older-issues labels
1 true
duplicate-review

Duplicate Resource Detector

You are an AI agent that audits the resources in this repository to find potential duplicates — resources that appear to serve the same or very similar purpose.

Your Task

Scan all resources in the following directories and identify groups of resources that may be duplicates or near-duplicates based on their name, description, and content:

  • agents/ (.agent.md files)
  • instructions/ (.instructions.md files)
  • skills/ (folders — check SKILL.md inside each)

Step 1: Gather Resource Metadata

For each resource, extract:

  1. File name (the path)
  2. Front matter description field
  3. Front matter name field (if present)
  4. First ~20 lines of body content (the markdown after the front matter)

Use bash to read files efficiently. For skills, read skills/<name>/SKILL.md.

Step 2: Identify Potential Duplicates

Compare resources and flag groups that look like potential duplicates. Consider resources as potential duplicates when they share two or more of the following signals:

  • Similar names — file names or name fields that share key terms (e.g., react-testing.agent.md and react-unit-testing.agent.md)
  • Similar descriptions — descriptions that describe the same task, technology, or domain with only minor wording differences
  • Overlapping scope — resources that target the same language/framework/tool and the same activity (e.g., two separate "Python best practices" instructions)
  • Cross-type overlap — an agent and an instruction (or instruction and skill) that cover the same topic so thoroughly that one may make the other redundant

Be pragmatic. Resources that cover related but distinct topics are NOT duplicates. For example:

  • react.instructions.md (general React coding standards) and react-testing.agent.md (React testing agent) are not duplicates — they serve different purposes.
  • python-fastapi.instructions.md and python-flask.instructions.md are not duplicates — they target different frameworks.
  • code-review.agent.md and code-review.instructions.md that both do the same style of code review are potential duplicates worth flagging.

Step 3: Check for Known Accepted Duplicates

Before finalizing the report, search for previous issues labeled duplicate-review in this repository:

Search for issues with label "duplicate-review" that are closed

Read the comments and body of those past issues to find any pairs or groups that reviewers have explicitly marked as "accepted" or "not duplicates". Look for phrases like:

  • "accepted as-is"
  • "not duplicates"
  • "intentionally separate"
  • "keep both"
  • checked task list items (i.e., - [x])

Exclude those known-accepted pairs from the current report. If you include a group that was previously reviewed, add a note: (previously reviewed — see #<issue-number>).

Step 4: Produce the Report

Create an issue titled: 🔍 Duplicate Resource Review

Format the body as follows:

### Summary

- **Potential duplicate groups found:** N
- **Resources involved:** M
- **Known accepted (excluded):** K pairs from previous reviews

### How to Use This Report

Review each group below. If the resources are intentionally separate, check the box to mark them as accepted. These will be excluded from future reports.

### Potential Duplicates

#### Group 1: <Short description of what they share>

- [ ] Reviewed — these are intentionally separate

| Resource | Type | Description |
|----------|------|-------------|
| `agents/foo.agent.md` | Agent | Does X for Y |
| `instructions/foo.instructions.md` | Instruction | Also does X for Y |

**Why flagged:** <Brief explanation of the similarity>

---

#### Group 2: ...

<repeat for each group>

Use <details> blocks to collapse groups if there are more than 10.

Safe Output Guidance

  • If you find potential duplicates: use create-issue to file the report.
  • If no potential duplicates are found (after excluding known accepted ones): call noop with the message: "No potential duplicate resources detected. All resources appear to serve distinct purposes."

Guidelines

  • Be conservative — only flag resources where there is a genuine risk of redundancy.
  • Group related duplicates together (don't list the same pair twice in separate groups).
  • Sort groups by confidence (strongest duplicate signals first).
  • Include cross-type duplicates (e.g., an agent and an instruction doing the same thing).
  • Limit the report to the top 20 most likely duplicate groups to keep it actionable.
  • For skills, use the folder name and description from SKILL.md.
  • Process resources in batches to stay within time limits — prioritize name and description comparison, then spot-check content for top candidates.