crap-score
Skill4 starsChanged 33 days agoMITView on GitHub
Use when changing Go code in claude-resume and checking whether a function is too complex for its test coverage, when asked for CRAP scores, or when looking for the riskiest functions to test or split.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- przemyslawkowalski-dashdevs/claude-code-setuptheir own version, first seen Nov 29, 2026
- microsoft/testfxtheir own version, first seen Oct 9, 2026
- foomoon/crap-scoretheir own version, first seen Aug 18, 2026
- VincentH-Net/dotnet-agentic-engineeringtheir own version, first seen May 12, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- microsoft/testfx★ 1.1ksame name
- VincentH-Net/dotnet-agentic-engineering★ 11same name
- foomoon/crap-score★ 0same name
- przemyslawkowalski-dashdevs/claude-code-setup★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
Run it before the change and keep the rows for the functions you will touch.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CRAP score
tools/crap gives each function in the main package a CRAP score:
CRAP = CC² × (1 − coverage)³ + CCCC is cyclomatic complexity: 1, plus one for each if, for, range, case or select clause other than default, && and ||. The rules are the Go rules of crapper. Coverage is the function's statement coverage from go test.
Below 5 is low risk, 5 to 30 is worth a look, and above 30 is complex and under-tested.
Run
From the repository root:
go run ./tools/crapIt runs go test -coverprofile on the main package, so the tests must pass; on a failure it prints the test output and exits 1. The table goes to stdout, worst score first, with the go test output on stderr. Only files that build on the current OS are scored: sys_windows.go on Windows, sys_unix.go elsewhere.
Using the scores
- Run it before the change and keep the rows for the functions you will touch.
- Make the change, run it again, and compare those rows.
- A function you touched that is at 10 or more: test it, split it, or both. A test calls the function the way its caller does and checks the result the caller sees.
- Report the before and after scores of the touched functions in the PR description.
There is no CI threshold. The 44 functions at 10 or more on 0.0.13-alpha (measured on Linux) predate the tool, so lower them when you are already changing them rather than in a separate cleanup.
Functions that read the terminal (pick, command) or the network (update, download) score high because tests cannot reach them. Lowering those means moving the logic into functions that take plain values and return results, then testing those.
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.

