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 — 41 skills 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 41 skills.

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.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.svg" alt="Measured on agentmods" 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 $0.00039 $0.00497
Sonnet 5 $0.00015 $0.00199
Haiku 4.5 $0.00008 $0.00099

Measured 7d ago against content hash 3c78cda32553, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-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 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 2d ago), licensed MIT. It adds 77 tokens to every session and 994 once invoked, about $0.0004 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-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

gentle-ai-bench

Trigger: bench, journey, journeys, driven mode, gentle-ai-bench, journey corpus, j-numbers, bench axis. Author and verify gentle-ai bench journeys; go test ./bench never proves driven execution.

Gentleman-Programming/gentle-ai · 49 tokens

memstack-development-test-writer

Use this skill when the user says 'write tests', 'add tests', 'test coverage', 'unit tests', 'integration tests', 'component tests', 'mocking', 'edge cases', or needs to generate tests with proper mocking and edge case coverage. Do NOT use for refactoring plans or database migrations.

cwinvestments/memstack · 70 tokens

typescript

TypeScript strict mode with eslint and jest.

alinaqi/maggy · 10 tokens

ring:adding-multi-tenancy

Adding database-per-tenant isolation into a Go service end-to-end via an 11-gate cycle: detects the stack, audits compliance, then dispatches backend agents to implement tenantId-from-JWT routing through the lib-commons v5 dispatch layer (config, middleware, repositories, metrics, tests) and runs reviewers. Use when…

LerianStudio/ring · 95 tokens

ring:writing-skills

Writing or editing a Ring skill: SKILL.md structure, frontmatter and Agent-Search-Optimization rules, token-efficiency targets, and bulletproofing (Iron Law, rationalization tables, Red Flags) so discipline-enforcing skills resist excuses. Use when creating or revising a skill. Delegates pressure-testing to…

LerianStudio/ring · 100 tokens