crap-index-assess

crap-index-assess is a skill for Claude Code from yarlson/yarstack. It costs 77 tokens per session (994 once invoked), scanned A, original, MIT.

An assessment of method-level code risk using the CRAP index, a score based on cyclomatic complexity and automated test coverage. Cyclomatic complexity estimates how many independent paths a method can take.

In plain words
What is it for?
Use it to measure configured CRAP data, interpret risky methods, and decide whether focused tests or reduced complexity are appropriate.
Why use it?
It highlights methods that may be difficult to change or insufficiently tested, without treating the score as a final judgment of code quality.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the yarstack plugin — 46 skills, 1 agent shipped together

Good fit Use it to measure configured CRAP data, interpret risky methods, and decide whether focused tests or reduced complexity are appropriate.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yarlson/yarstack/crap-index-assess
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add yarlson/yarstack --skill crap-index-assess
Clone the repo
git clone --depth 1 https://github.com/yarlson/yarstack

Made for: Claude Code.

Or install yarstack, the plugin that ships this one along with the rest of its 46 skills, 1 agent.

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 crap-index-assess

README.md
[![agentmods](https://agentmods.dev/badge/skills/yarlson/yarstack/crap-index-assess/github.svg)](https://agentmods.dev/skills/yarlson/yarstack/crap-index-assess)
Your own site
<a href="https://agentmods.dev/skills/yarlson/yarstack/crap-index-assess"><img src="https://agentmods.dev/badge/skills/yarlson/yarstack/crap-index-assess/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 crap-index-assess

Your own site · 80×15
<a href="https://agentmods.dev/skills/yarlson/yarstack/crap-index-assess"><img src="https://agentmods.dev/badge/skills/yarlson/yarstack/crap-index-assess.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 994 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.
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.00077 $0.00994
Opus 5.5 $0.00031 $0.00398
Sonnet 5.5 $0.00015 $0.00199
Haiku 4.5 $0.00008 $0.00099

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

Security

Grade A, and why

crap-index-assess 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 7d 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.

plugins/yarstack/skills/crap-index-assess/SKILL.md · 53 lines

How it starts

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

CRAP Index Assessment

Use the CRAP index as a method-level risk signal, not as a verdict on code quality or a target to game.

Measure

  1. Confirm the source revision and the methods in scope.
  2. Read repository instructions, command entrypoints, scripts, manifests, analysis configuration, and CI needed to find an existing CRAP measurement and its documented prerequisites.
  3. When the repository configures a CRAP command, run that command with its existing defaults and any documented project-native prerequisite that produces its coverage input. Preserve its complexity and coverage definitions, exclusions, precision, aggregation, and configured threshold. Do not replace it with an ad hoc command, install a tool, or change its configuration.
  4. If the configured command fails, report the command and failure. Do not use partial or stale output. Use a manual fallback only when reliable method-level complexity and coverage from the same revision remain available, and label the result as a fallback rather than a successful tool run.
  5. Use the manual calculation only when the repository has no configured CRAP measurement or the preceding fallback condition applies.

Manual Calculation

  1. Record how the available measurement defines cyclomatic complexity and coverage. Treat complexity as one plus the decisions in a method unless the measurement defines it differently. Prefer branch or basis-path coverage from automated, repeatable tests; when only another coverage type is available, name it and state the limit.

  2. Validate cyclomatic complexity c >= 1 and coverage percentage 0 <= cov <= 100. Do not estimate missing values, mix incompatible reports, or substitute class averages for method data.

  3. Calculate uncovered proportion u = 1 - cov / 100, then calculate:

    CRAP(m) = c² × u³ + c

  4. Show the inputs and substituted calculation with enough precision to reproduce the result. At full coverage the score equals complexity; at zero coverage it equals c² + c.

  5. Rank methods by score. State the chosen boundary: > 30 is a common fallback, while some definitions and tools use >= 30. Do not hide the boundary choice. For a larger scope, report the count and percentage of methods beyond it as well as the highest-risk methods; an average alone can hide hotspots.

Read the full file on GitHub · 53 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. 7d ago Changed 65bfb7a71e74
  2. 1mo ago First seen · 53 lines · 77 tokens per session scan A 3c78cda32553

Subscribe to this mod's changes

crap-index-assess is a skill published in the GitHub repository yarlson/yarstack (3 stars, last pushed 6d ago), licensed MIT. It adds 77 tokens to every session and 994 once invoked, about $0.0003 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-08-31.

Related

Other skills, from other repositories

go-testing

Trigger: Go tests, go test coverage, Bubbletea teatest, golden files. Apply focused Go testing patterns.

Gentleman-Programming/gentle-ai · 26 tokens

coverage

Compute code coverage for active track or module. Targets 95%+ coverage with report and justification for uncovered lines. Complements TDD workflow.

drafthq/draft · 31 tokens

improving-tests

Improve test design, speed, and coverage with behavior-focused tests, useful seams, characterization tests, TDD, and test refactoring. Use when improving tests, optimizing slow suites, adding coverage, refactoring brittle tests, or removing test waste. NOT for fixing production bugs (use fixing-code), or reviewing…

alexei-led/cc-thingz · 75 tokens

write-tests

Write tests for existing production code. Processes ONE file at a time through a full pipeline: analyze, inventory (frozen BEFORE writing), write, executable coverage gate, verify, blind coverage audit, adversarial review, log. Uses CodeSift for discovery and analysis when available. Modes: [path] (specific target)…

greglas75/zuvo · 87 tokens

wicked-garden-qe-coverage-archaeologist

Find dark corners in legacy code — untested, unreferenced, or low-confidence paths. Prioritizes by risk using coverage + git history + call-graph. Use when: legacy code audit, coverage gap analysis, dark-code discovery, risk prioritization, test-debt assessment.

mikeparcewski/wicked-garden · 72 tokens

test-audit

Batch audit of test files against Q1-Q25 quality gates and AP1-AP32 anti-patterns. Detects orphan tests, phantom mocks, untested public methods. Tiered output (A/B/C/D) with critical gate enforcement and optional post-audit fix workflow. Flags: zuvo:test-audit all | [path] | [file] | --deep | --quick | --include-e2e |…

greglas75/zuvo · 100 tokens