code-duplication
Skill1 starsChanged 30 days agoMITView on GitHub
Instructions for upstream Policy A6 analysis of duplicated Python bodies using normalized AST hashes and an optional semantic mode; the documented minimum is six statements. Use to plan duplication review and examine five-field findings. Not for complexity (code-complexity) or skill-description overlap (skill-finder); verify equivalence before merging code.
In this repository114 other files it gives its agents.
- agent-cacheSkill
- agent-compressionSkill
- agent-intelSkill
- agent-overlapSkill
- agent-stateSkill
- ambient-hudSkill
- app-testSkill
- audit-dagSkill
- auto-distillSkill
- auto-memorySkill
- auto-routerSkill
- benchSkill
- bootstrapSkill
- botte-learnSkill
- botte-nnSkill
- botte-proxySkill
- botte-wrapSkill
- cacheSkill
- call-chainsSkill
- capabilitiesSkill
- cardinalSkill
- checkupSkill
- clarificationSkill
- clusterSkill
- code-complexitySkill
- code-fingerprintSkill
- code-rulesSkill
- code-stateSkill
- code-wrappersSkill
- comfyuiSkill
- completion-proofSkill
- conductorSkill
- context-budgetSkill
- context-compressorSkill
- context-profilerSkill
- context-slicerSkill
- context-windowsSkill
- control-loopSkill
- cost-estimatorSkill
- dag-optimizerSkill
- dashboardSkill
- decision-ladderSkill
- demoSkill
- diff-languageSkill
- directives-auditSkill
- docgenSkill
- docs-stewardSkill
- dynamic-workflowsSkill
- efficiencySkill
- eventsSkill
- fallow-likeSkill
- fallowSkill
- fast-contextSkill
- fixSkill
- fleetSkill
- hailo-visionSkill
- harness-deltaSkill
- harvestSkill
- hermes-bridgeSkill
- hermes-second-brainSkill
- The first 60 shown.
The file
Files
code-duplication — anomaly A6 detector (exact + semantic)
Package scope and prerequisites
This catalog ships instructions, not the executable runtime. Python modules, scripts, local services and optional tools named below must be installed separately from the upstream project. Check their availability before running commands; if they are missing, explain the prerequisite instead of claiming execution or results. The host agent may use model tokens while following these instructions.
Commands, APIs and runtime behavior described below are conditional examples for a compatible upstream installation; they are not evidence of execution in this package.
When NOT to use
- The problem is a function that is too complex or too long — use code_complexity.
- The duplication is between two skill descriptions rather than two code bodies — the catalog-level overlap check belongs with skill_finder.
The upstream detector describes both halves of A6 of
the upstream docs/local-analysis-policy.md (not bundled here): two function bodies are duplicates
when their statement sequences produce identical hashes (comments and
formatting ignored; function names irrelevant — the exact half), or when
their AST shape is identical after identifier normalization (same operators,
same call shapes, constants preserved — the semantic half, opt-in via
--semantic). Only bodies of >= 6 statements (nested blocks included) are
considered.
python -m skills.code_duplication.cli [path] # human-readable report
python -m skills.code_duplication.cli skills --json # compact JSON
python -m skills.code_duplication.cli . --semantic # exact + semantic report
python -m skills.code_duplication.test_code_duplicationSemantic findings are reported separately (dup_semantique) and never
duplicate an exact group. Because two similar bodies can differ
intentionally, the policy requires a line-by-line equivalence diff before any
merge; findings carry that caveat in risque and refactoring_minimal.
The documented upstream mode is report-only; verify the installed command exit status and CI integration. Pairs with code_complexity (A1) which
shares the five-field finding shape.
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.

