macalbert/envilder/code-quality-crap
Claude Code and agent skill by macalbert/envilder
- community
Checking that the SKILL.md file is still in the repository.
CRAP score quality gate for code complexity and test coverage. Use when reviewing methods for complexity risk, deciding whether to split methods, or interpreting complexity and coverage risk without manufacturing tests.
Install
npx vskill@latest install macalbert/envilder/code-quality-crapSKILL.md
Code Quality: CRAP Score
CRAP (Change Risk Anti-Patterns) measures the risk of a method based on cyclomatic complexity and test coverage.
When to Use
- Reviewing new or changed methods for complexity risk
- Deciding whether a method needs splitting
- Interpreting coverage risk for a given complexity
- During
PURE_REFACTORimplementation or candidate review
Formula
$$\text{CRAP}(m) = \text{comp}(m)^2 \times (1 - \text{cov}(m))^3 + \text{comp}(m)$$
Where:
- $\text{comp}(m)$ = cyclomatic complexity of method $m$
- $\text{cov}(m)$ = test coverage ratio (0 to 1) of method $m$
Quality Gate
Every method MUST have a CRAP score below 6.
Coverage Thresholds
These thresholds are intentionally stricter than the mathematical minimum, providing a safety margin:
| Complexity | Recommended coverage for CRAP < 6 | |
|---|---|---|
| 1 | 0% (any) | |
| 2 | > 0% | |
| 3 | 40%+ | |
| 4 | 60%+ | |
| 5 | 80%+ | |
| 6+ | Not achievable: must split to reduce complexity |
Actions by Scenario
| Scenario | Action | |
|---|---|---|
| CRAP >= 6 due to high complexity | Extract complex branches into smaller methods | |
| CRAP >= 6 due to low coverage | First reduce complexity; if important behavior lacks evidence, route a separate verification contract rather than adding coverage-only tests | |
| Complexity 6+ regardless of coverage | Must split: CRAP floor equals complexity |
Severity Classification
- Medium: complexity 4–5 without proportional test coverage
- High: complexity 6+ (must split, no amount of testing fixes it)
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/code-quality-crap/SKILL.md
Popularity
- Repository stars
- 135
- Repository forks
- 4
- 7-day trend score
- 25
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/macalbert/envilder/code-quality-crap)