|
| 1 | +--- |
| 2 | +description: Weekly scan of agents, instructions, and skills to identify potential duplicate resources and report them for review |
| 3 | +on: |
| 4 | + schedule: weekly |
| 5 | +permissions: |
| 6 | + contents: read |
| 7 | + issues: read |
| 8 | +tools: |
| 9 | + github: |
| 10 | + toolsets: [repos, issues] |
| 11 | +safe-outputs: |
| 12 | + create-issue: |
| 13 | + max: 1 |
| 14 | + close-older-issues: true |
| 15 | + labels: |
| 16 | + - duplicate-review |
| 17 | + noop: |
| 18 | +--- |
| 19 | + |
| 20 | +# Duplicate Resource Detector |
| 21 | + |
| 22 | +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. |
| 23 | + |
| 24 | +## Your Task |
| 25 | + |
| 26 | +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**: |
| 27 | + |
| 28 | +- `agents/` (`.agent.md` files) |
| 29 | +- `instructions/` (`.instructions.md` files) |
| 30 | +- `skills/` (folders — check `SKILL.md` inside each) |
| 31 | + |
| 32 | +### Step 1: Gather Resource Metadata |
| 33 | + |
| 34 | +For each resource, extract: |
| 35 | + |
| 36 | +1. **File name** (the path) |
| 37 | +2. **Front matter `description`** field |
| 38 | +3. **Front matter `name`** field (if present) |
| 39 | +4. **First ~20 lines of body content** (the markdown after the front matter) |
| 40 | + |
| 41 | +Use bash to read files efficiently. For skills, read `skills/<name>/SKILL.md`. |
| 42 | + |
| 43 | +### Step 2: Identify Potential Duplicates |
| 44 | + |
| 45 | +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: |
| 46 | + |
| 47 | +- **Similar names** — file names or `name` fields that share key terms (e.g., `react-testing.agent.md` and `react-unit-testing.agent.md`) |
| 48 | +- **Similar descriptions** — descriptions that describe the same task, technology, or domain with only minor wording differences |
| 49 | +- **Overlapping scope** — resources that target the same language/framework/tool and the same activity (e.g., two separate "Python best practices" instructions) |
| 50 | +- **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 |
| 51 | + |
| 52 | +Be pragmatic. Resources that cover related but distinct topics are NOT duplicates. For example: |
| 53 | +- `react.instructions.md` (general React coding standards) and `react-testing.agent.md` (React testing agent) are **not** duplicates — they serve different purposes. |
| 54 | +- `python-fastapi.instructions.md` and `python-flask.instructions.md` are **not** duplicates — they target different frameworks. |
| 55 | +- `code-review.agent.md` and `code-review.instructions.md` that both do the same style of code review **are** potential duplicates worth flagging. |
| 56 | + |
| 57 | +### Step 3: Check for Known Accepted Duplicates |
| 58 | + |
| 59 | +Before finalizing the report, search for **previous issues** labeled `duplicate-review` in this repository: |
| 60 | + |
| 61 | +``` |
| 62 | +Search for issues with label "duplicate-review" that are closed |
| 63 | +``` |
| 64 | + |
| 65 | +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: |
| 66 | +- "accepted as-is" |
| 67 | +- "not duplicates" |
| 68 | +- "intentionally separate" |
| 69 | +- "keep both" |
| 70 | +- checked task list items (i.e., `- [x]`) |
| 71 | + |
| 72 | +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>)`. |
| 73 | + |
| 74 | +### Step 4: Produce the Report |
| 75 | + |
| 76 | +Create an issue titled: `🔍 Duplicate Resource Review` |
| 77 | + |
| 78 | +Format the body as follows: |
| 79 | + |
| 80 | +```markdown |
| 81 | +### Summary |
| 82 | + |
| 83 | +- **Potential duplicate groups found:** N |
| 84 | +- **Resources involved:** M |
| 85 | +- **Known accepted (excluded):** K pairs from previous reviews |
| 86 | + |
| 87 | +### How to Use This Report |
| 88 | + |
| 89 | +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. |
| 90 | + |
| 91 | +### Potential Duplicates |
| 92 | + |
| 93 | +#### Group 1: <Short description of what they share> |
| 94 | + |
| 95 | +- [ ] Reviewed — these are intentionally separate |
| 96 | + |
| 97 | +| Resource | Type | Description | |
| 98 | +|----------|------|-------------| |
| 99 | +| `agents/foo.agent.md` | Agent | Does X for Y | |
| 100 | +| `instructions/foo.instructions.md` | Instruction | Also does X for Y | |
| 101 | + |
| 102 | +**Why flagged:** <Brief explanation of the similarity> |
| 103 | + |
| 104 | +--- |
| 105 | + |
| 106 | +#### Group 2: ... |
| 107 | + |
| 108 | +<repeat for each group> |
| 109 | +``` |
| 110 | + |
| 111 | +Use `<details>` blocks to collapse groups if there are more than 10. |
| 112 | + |
| 113 | +### Safe Output Guidance |
| 114 | + |
| 115 | +- If you find potential duplicates: use `create-issue` to file the report. |
| 116 | +- 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." |
| 117 | + |
| 118 | +## Guidelines |
| 119 | + |
| 120 | +- Be conservative — only flag resources where there is a genuine risk of redundancy. |
| 121 | +- Group related duplicates together (don't list the same pair twice in separate groups). |
| 122 | +- Sort groups by confidence (strongest duplicate signals first). |
| 123 | +- Include cross-type duplicates (e.g., an agent and an instruction doing the same thing). |
| 124 | +- Limit the report to the top 20 most likely duplicate groups to keep it actionable. |
| 125 | +- For skills, use the folder name and description from `SKILL.md`. |
| 126 | +- Process resources in batches to stay within time limits — prioritize name and description comparison, then spot-check content for top candidates. |
0 commit comments