mcp-contrast: Skill for Claude Code

.claude/skills/fix-crap/SKILL.md

fix-crap is a skill for Claude Code from Contrast-Security-OSS/mcp-contrast. It costs 70 tokens per session (1,331 once invoked), scanned A, original, Apache-2.0.

A guide for fixing methods that fail a CRAP code-quality check. CRAP flags code that is both complicated and not sufficiently covered by automated tests.

In plain words
What is it for?
Use it to inspect flagged methods, read their test coverage, decide whether to add tests or simplify the code, and manage the recorded baseline of known violations.
Why use it?
It helps identify whether the problem is missing tests, overly complicated code, or both, so you can clear the check without guessing.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md.

This is Contrast-Security-OSS/mcp-contrast's own configuration. It tells Claude Code how to work on mcp-contrast 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 mcp-contrast configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Contrast-Security-OSS/mcp-contrast. 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/Contrast-Security-OSS/mcp-contrast/main/.claude/skills/fix-crap/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/Contrast-Security-OSS/mcp-contrast

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 fix-crap

README.md
[![agentmods](https://agentmods.dev/badge/skills/contrast-security-oss/mcp-contrast/fix-crap/github.svg)](https://agentmods.dev/skills/contrast-security-oss/mcp-contrast/fix-crap)
Your own site
<a href="https://agentmods.dev/skills/contrast-security-oss/mcp-contrast/fix-crap"><img src="https://agentmods.dev/badge/skills/contrast-security-oss/mcp-contrast/fix-crap/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 fix-crap

Your own site · 80×15
<a href="https://agentmods.dev/skills/contrast-security-oss/mcp-contrast/fix-crap"><img src="https://agentmods.dev/badge/skills/contrast-security-oss/mcp-contrast/fix-crap.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,331 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: 1 finding, up to medium

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 →

  • medium Excessive Agency · line 42
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
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.00070 $0.01331
Opus 5 $0.00035 $0.00665
Sonnet 5 $0.00014 $0.00266
Haiku 4.5 $0.00007 $0.00133

Measured 9d ago against content hash 28f87326abdd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

fix-crap 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 9d 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.

.claude/skills/fix-crap/SKILL.md · 105 lines

How it starts

The opening of the file, as written. The whole thing — 105 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Fixing CRAP Violations

CRAP (Change Risk Anti-Patterns) flags methods that are both complex and under-tested. The formula is cc^2 * (1 - coverage)^3 + cc where cc is cyclomatic complexity and coverage is branch coverage (0 to 1). A method fails at CRAP > 15 with complexity capped at 15.

When this skill applies

  • crapCheck fails during make check
  • A method appears in a module's crap4j-baseline.json
  • The user asks to reduce a CRAP score or clear the baseline

Diagnosis

Run the advisory report first to see all flagged methods and their scores:

./gradlew :<module>:crapReport

For each flagged method, open the JaCoCo HTML report at <module>/build/reports/jacoco/test/html/ and find the method. Lines marked pc bpc (partial branch coverage) or nc (not covered) are the missed branches. Count them. This tells you whether the fix is testing, simplification, or both.

The decision: test, simplify, or both

CRAP has two levers: complexity and coverage. Pick the right one.

Test when the method is readable as-is

A configuration method, a builder, or a mapping function may have moderate complexity from iteration and null guards, but no confusing control flow. The complexity is structural, not cognitive. Adding tests is the right fix because the method does not need to change.

Indicators that testing is the right fix:

  • The method is a flat sequence of similar operations (registrations, field mappings, guard clauses)
  • The complexity comes from forEach loops, null checks, or switch/if chains over a known set
  • A reader can understand the method top to bottom without backtracking
  • Only a few branches are uncovered in JaCoCo

Calculate the coverage needed: solve cc^2 * (1 - cov)^3 + cc < 15 for your method's cc. For cc=14, you need >83% branch coverage. For cc=10, you need >68%. For cc=6, any coverage clears it.

Write tests that verify real behavior. Each test should assert something meaningful about the method's output or side effects. Do not write tests that exist only to execute a branch without checking the result.

Read the full file on GitHub · 105 lines

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. 9d ago First seen · 105 lines · 70 tokens per session scan A 28f87326abdd

Subscribe to this mod's changes

fix-crap is a skill published in the GitHub repository Contrast-Security-OSS/mcp-contrast (23 stars, last pushed 5d ago), licensed Apache-2.0. It adds 70 tokens to every session and 1,331 once invoked, about $0.0003 per session on Opus 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-08-30.

Related

Other skills, from other repositories

debug-optimize-lcp

Guides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions…

ChromeDevTools/chrome-devtools-mcp · 99 tokens

systematic-debugging

Use when debugging a failing test, build error, or runtime issue that isn't immediately obvious. Guides a 4-phase root cause analysis instead of random fix attempts.

open-metadata/OpenMetadata · 37 tokens

diagnose

Trace from a reproduced symptom to the source code that causes it. Pin the specific file and approximate line, rate confidence in the cause and clarity of the fix independently, and always propose a concrete fix.

emdash-cms/emdash · 43 tokens

repro-admin

Reproduce an EmDash admin UI bug. Attach a container, start the demo dev server, drive the admin with agent-browser using the dev-bypass session, and capture the reproduction as screenshots plus a replayable transcript.

emdash-cms/emdash · 48 tokens

log-error-digest

Analyze log files to troubleshoot errors, identify peak error periods, and produce error clustering, frequency statistics, and time distribution reports. Supports JSON, syslog, and Nginx formats with automatic detection. Use when a user uploads a .log file and asks to analyze errors, find patterns, debug issues, or…

zebbern/claude-code-guide · 71 tokens

byted-util-volcengine-detect-retry

An orchestration workflow for Volcengine Cloud Detect, a service that checks websites or network endpoints from test locations.

bytedance/agentkit-samples · 101 tokens