duplication-audit
Skill319 starsChanged 58 days agoApache-2.0View on GitHub
Find duplicated functionality across the codebase and propose minimal, safe generalizations.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/mindroom-docs/references/llms-full.txtllms.txt
- skills/mindroom-docs/references/llms.txtllms.txt
- address-pr-review-commentsSkill
- agent-cli-devSkill
- agent-cli-tmux-supervisionSkill
- code-debateSkill
- docs-reviewSkill
- live-testSkill
- native-subagent-pr-loopSkill
- pr-reviewSkill
- mindroom-docsSkill
- open-knowledge-formatSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 15 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Keep it simple and avoid adding features.
- Distinctive: line 15
Read project-specific instructions (AGENTS.md or similar) and follow them.
- Distinctive: line 16
Ask a brief clarification if the request is ambiguous (for example: report only vs refactor).
- Distinctive: line 35
Look for cross-module patterns: same steps, different files.
- Distinctive: line 38
Use fast search tools to find repeated keywords and patterns.
- Distinctive: line 39
Check for repeated parsing, IO, validation, or response formatting.
- Distinctive: line 47
Avoid over-engineering. If only two call sites exist, keep the helper small.
- Distinctive: line 48
Prefer pure functions. Keep IO at the edges.
- Distinctive: line 66
If the user asked you to implement changes:
- Distinctive: line 68
Keep the public API stable unless explicitly requested.
- Distinctive: line 69
Add small comments only when the logic is non-obvious.
- Very specific: line 71
Run pytest to verify nothing broke.
- Distinctive: line 75
Start with a short summary of the top 1-3 duplications.
- Distinctive: line 82
Do not add new features or change behavior beyond deduplication.
- Distinctive: line 83
Avoid deep refactors without explicit request.
- Distinctive: line 85
If a duplication is better left alone (e.g., clarity, single usage), say so.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Duplication audit and generalization prompt
You are a coding agent working inside a repository. Your job is to find duplicated functionality (not just identical code) and propose a minimal, safe generalization. Keep it simple and avoid adding features.
First steps
- Read project-specific instructions (AGENTS.md or similar) and follow them.
- Ask a brief clarification if the request is ambiguous (for example: report only vs refactor).
Objective
Identify and consolidate duplicated functionality across the codebase. Duplication includes:
- Multiple functions that parse or validate the same data in slightly different ways
- Repeated config parsing or data model manipulation
- Similar external service calls across different modules
- Near-identical error handling or logging patterns
- Repeated setup/teardown logic
- Similar data transforms that can become a shared helper
The goal is to propose a general, reusable abstraction that reduces duplication while preserving behavior. Keep changes minimal and easy to review.
Search strategy
- Map the hot paths
- Scan entry points (CLI, main loops, API handlers) to see what they do repeatedly.
- Look for cross-module patterns: same steps, different files.
- Find duplicate operations
- Use fast search tools to find repeated keywords and patterns.
- Check for repeated parsing, IO, validation, or response formatting.
- Validate duplication is real
- Confirm the functional intent matches (not just similar code).
- Note any subtle differences that must be preserved.
- Propose a minimal generalization
- Suggest a shared helper, utility, or wrapper.
- Avoid over-engineering. If only two call sites exist, keep the helper small.
- Prefer pure functions. Keep IO at the edges.
Deliverables
Provide a concise report with:
- Findings
- List duplicated behaviors with file references and a short description of the shared functionality.
- Explain why these are functionally the same (or nearly the same).
- Proposed generalizations
- For each duplication, propose a shared helper and where it should live.
- Outline any behavior differences that need to be parameterized.
- Impact and risk
- Note any behavior risks, test needs, or migration steps.
If the user asked you to implement changes:
- Make only the minimal edits needed to dedupe behavior.
- Keep the public API stable unless explicitly requested.
- Add small comments only when the logic is non-obvious.
- Summarize what changed and why.
- Run
pytestto verify nothing broke.
Output format
- Start with a short summary of the top 1-3 duplications.
- Then provide a list of findings, ordered by impact.
- Include a small proposed refactor plan (step-by-step, no more than 5 steps).
- End with any questions or assumptions.
Guardrails
- Do not add new features or change behavior beyond deduplication.
- Avoid deep refactors without explicit request.
- Preserve existing style conventions and import rules.
- If a duplication is better left alone (e.g., clarity, single usage), say so.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

