cargo-coupling: Skill for Claude Code

.agents/skills/similarity/SKILL.md

similarity is a skill for Claude Code from nwiizo/cargo-coupling. It costs 27 tokens per session (390 once invoked), scanned A, original, MIT.

A command-line tool that finds code sections with similar meaning or structure and suggests how to combine duplicates.

In plain words
What is it for?
Use it to scan source folders, review duplicate code, and prepare refactoring plans or CI checks.
Why use it?
It helps reveal repeated code that can make a project harder to change and maintain.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: installed under .agents/ (shared by several agents).

This is nwiizo/cargo-coupling's own configuration. It tells Claude Code how to work on cargo-coupling itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cargo-coupling configures →

Reuse

Borrowing it

Nothing to install: this file belongs to nwiizo/cargo-coupling. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/nwiizo/cargo-coupling/main/.agents/skills/similarity/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/nwiizo/cargo-coupling

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for similarity

README.md
[![agentmods](https://agentmods.dev/badge/skills/nwiizo/cargo-coupling/similarity/github.svg)](https://agentmods.dev/skills/nwiizo/cargo-coupling/similarity)
Your own site
<a href="https://agentmods.dev/skills/nwiizo/cargo-coupling/similarity"><img src="https://agentmods.dev/badge/skills/nwiizo/cargo-coupling/similarity/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for similarity

Your own site · 80×15
<a href="https://agentmods.dev/skills/nwiizo/cargo-coupling/similarity"><img src="https://agentmods.dev/badge/skills/nwiizo/cargo-coupling/similarity.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 390 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 7 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 4
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 25
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 31
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 37
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 48
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 65
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 76
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00027 $0.00390
Opus 5.5 $0.00011 $0.00156
Sonnet 5.5 $0.00005 $0.00078
Haiku 4.5 $0.00003 $0.00039

Measured 20d ago against content hash a0ff6043a303, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

similarity scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 20d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/similarity/SKILL.md · 37 lines

What it actually says

Rust Code Similarity

Scan the requested scope (default ./src) with similarity-rs. Start with one scan and inspect the reported code; thresholds rank candidates, not required actions:

rtk proxy similarity-rs ./src --skip-test --threshold 0.90 --min-lines 10

Honor requested options. Use --print for source detail or --experimental-types when comparing types is relevant. Consult similarity-rs --help for other options; do not run several threshold sweeps without an unresolved question.

Record the analyzed scope, tool options, and candidate locations. Check callers, semantics, and intentional differences. Recommend shared code only when the same rule should change together and sharing it reduces maintenance cost. Similar AST traversal, translations, or collection pipelines can serve different rules; do not merge them based on syntax alone. Explain why consequential candidates are selected or retained. A high similarity percentage does not justify generics, traits, or extraction.

When assessing a structural change, use cargo-coupling on the relevant scope to check its effect on boundaries. Launch visualization only when requested or needed to answer the task. Report locations, the shared responsibility (if any), and the recommendation, including cases where duplication should remain. Implement fixes when requested, preserve affected behavior with existing or focused regression tests, and rerun similarity and coupling with the same scope and settings. Report which candidates were resolved and which remain; a lower duplicate count is supporting evidence, not the goal.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 20d ago Changed · +8 lines · +5 tokens per session a0ff6043a303
  2. 1mo ago Changed · -50 lines · +22 tokens per session b6e7942af3f3
  3. 1mo ago First seen · 79 lines · 0 tokens per session scan A d01aa9372438

Subscribe to this mod's changes

similarity is a skill published in the GitHub repository nwiizo/cargo-coupling (116 stars, last pushed 2d ago), licensed MIT. It adds 27 tokens to every session and 390 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.

Related

Other skills, from other repositories

autoreview

Structured code review through the shared OpenClaw agent-skills installation.

openclaw/clawhub · 17 tokens

omh-code-review

This is an OMH code-review workflow skill, projected for Agent Skills hosts (Claude Code, Codex, Cursor, opencode, OpenClaw, pi).

rlaope/oh-my-hermes · 48 tokens

revdiff-plan

Review the last Codex assistant message (plan, analysis, or proposal) with inline annotations in a TUI overlay. Extracts the most recent response from Codex rollout files and opens it in revdiff for review and annotation. Activates on "revdiff-plan", "review plan with revdiff", "annotate plan", "review last response"…

umputun/revdiff · 84 tokens

explore-unknowns

Guide the user through a quadrant walk that maps the unknowns of a task — open by listing the known knowns, then work through known unknowns, unknown knowns, and unknown unknowns one stage at a time, ending with a complete four-quadrant map in the user's hands. Use when a request is ambiguous or underspecified, the…

dzhng/skills · 162 tokens

re0-merge

Review and land an external contribution the way this suite does: gate it against the thesis, land it with the author's credit intact, complete a new skill rather than merging it raw, then approve, credit, and explain before closing. Use when reviewing a pull request, as any collaborator or maintainer, not only the…

LilMGenius/paperthin · 70 tokens

asplos-writing-style

Use when drafting or revising ASPLOS prose — engineering the first two pages that rapid review actually reads, stating the cross-layer insight as one quotable sentence, structuring per-layer mechanism sections, writing bounded claims, and fitting everything into 11 self-contained pages that include figures and…

brycewang-stanford/Awesome-Journal-Skills · 65 tokens