crap-analyzer SKILL.md skillA
crap-analyzer from swingerman/engineer is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add swingerman/engineer/crap-analyzer@git:20260525.78c79dePins git:20260525.78c79de in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- swingerman/engineer
- Path
crap-analyzer/skills/crap-analyzer/SKILL.md- Versions recorded
- 2
- Latest version
- git:20260525.78c79de, committed May 25, 2026
- First version recorded
- May 14, 2026
- Size
- 4,792 bytes
- Repository stars
- 162
- License
- MIT
Use to produce a risk-based refactor + test plan for recently-changed code on a diff/branch/PR by computing CRAP (complexity × untested) on changed methods. Multi-language — TypeScript, JavaScript, Python, Java, Kotlin, Go, Ruby, C#, Rust, PHP — auto-discovers how the repo generates coverage. Triggers — "/crap-analyzer", "analyze CRAP", "compute CRAP", "find risky methods", "find complex untested methods".
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# CRAP Analyzer CRAP (Change Risk Anti-Patterns) flags functions that are both **complex** and **poorly tested** — the worst-risk code to ship. ``` CRAP(m) = comp(m)² × (1 − cov(m))³ + comp(m) ``` This skill scopes analysis to a diff, ranks findings worst-first, and turns each finding into a concrete refactor + test-stub proposal. ## Workflow 1. **Determine the diff.** First that works: - `gh pr diff` / `gh pr diff <number>` if a GitHub PR is referenced. - `git diff --merge-base <main-branch>` — detect the main branch with `git remote show origin | grep 'HEAD branch'`. - `git diff --cached` for staged changes. - `git diff HEAD~N..HEAD` for a named commit range. - Explicit file list if the user names files. Pipe the diff to `scripts/compute_crap.py --diff -`. 2. **Locate or generate coverage.** Let the script auto-discover coverage files first (lcov, Cobertura, JaCoCo, Clover, Go `coverage.out`, coverage.py JSON). If nothing is found, follow [references/coverage-discovery.md](references/coverage-discovery.md) to detect the toolchain, then ask before running it. On decline, proceed with coverage=0% and flag it in the report header. 3. **Run the analyzer.** …
Read the whole file at its exact version.
How to install
mdr add swingerman/engineer/crap-analyzer@sha256:7ad02cce7eed634cThe line at the top of this page pins the label git:20260525.78c79de, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_jv2e5trxeuxiuvb5)
3 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 2 versions of this file, between May 14, 2026 and May 25, 2026, about one every 11 days.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20260525.78c79de latest | 2026-05-25 | 78c79de | 4,792 B | A | view · diff |
| git:20260514.b485f22 | 2026-05-14 | b485f22 | 4,785 B | A | view |
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (4792 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
swingerman/engineer · 162 stars · license MIT · pushed 2026-10-27 · branch master
API
GET https://markdownregistry.com/api/v1/artifacts/art_jv2e5trxeuxiuvb5 GET https://markdownregistry.com/api/v1/resolve?ref=swingerman/engineer/crap-analyzer GET https://markdownregistry.com/api/v1/blob/7ad02cce7eed634ca3dcd514e4d6538703d83a6ef7ddb1510baaae8d2eb2169b
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.