Swift Crap Check — Testing skill for Claude Code
Agent skill that ranks Swift functions by the CRAP metric - cyclomatic complexity weighted against test coverage - and drives the risky ones under threshold.
How to install Swift Crap Check
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open n0an/swift-crap-check and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Swift Crap Check does
Agent skill that ranks Swift functions by the CRAP metric - cyclomatic complexity weighted against test coverage - and drives the risky ones under threshold. Install with npx skills add n0an/swift-crap-check.
Alternatives in Testing
- Swift Testing Agent Skill — Swift Testing agent skill for Claude Code, Codex, and other AI tools 289 ★
- Superpowers Evals — Behavioral eval lab (Quorum) for the superpowers project that drives real coding-agent CLIs (Claude, Codex, Ge 107 ★
- Install Local — Bump version and install both extensions locally (VS Code + spec-kit) 85 ★
README
Swift CRAP Check
**📐 "Complex" is not actionable. "Dangerous to change" is.** Based on Robert C. Martin's (Uncle Bob) description of how he codes with agents ([interview, 2026](https://www.youtube.com/live/zcLPGC-tvgk)).
An agent skill that helps AI coding agents like Claude Code, Codex, Cursor, and Gemini find the Swift functions that are genuinely risky to modify, and then drive that risk down - by writing the missing tests or splitting the function, whichever the number says.
It uses the [Agent Skills](https://agentskills.io/home) format, so it works smoothly with Claude Code, Codex, Gemini, Cursor, and more.
CRAP (Change Risk Anti-Patterns, Agitar Software, 2007) weighs cyclomatic complexity against test coverage:
crap = complexity² × (1 − coverage)³ + complexity
The cube is the whole idea. A function of complexity 12 scores **156** with no tests and exactly **12** with full coverage. Same code, same complexity - but one of them you can refactor tonight and the other one will bite you. The metric does not say the code is bad, it says the code is *unsafe to touch*, and that is something an agent can actually act on.
CRAP CX COV LOCATION
Related Skills
Code Quality Skill
Deterministic code quality gate for AI coding agents (Claude Code, Codex, pi): git hooks that block test tampe
Debug Kit
🧩 Agent Skill: drive, inspect & test apps across 9 platforms (macOS/iOS/Android/Web/Electron/Flutter/RN/Tauri
Estimate Spec
Add complexity estimates to existing spec file
Assumption Check
Surfaces the 5 riskiest untested assumptions in a feature or product bet, ranks them by risk, identifies the c
AI Review Pipeline
AI code review pipeline — review, auto-fix, test generation & HTML report in one command. Zero dependencies, 6
Claude Researcher
Structured research skill for Claude — parallel web search, test solutions, weighted scoring decisions
Related Agents
Gauntlet Cleaner
Stage 3 of the agent gauntlet. Runs CRAP analysis (coverage × cyclomatic complexity) and a general code review
Gads Anomalies
Day-level metric anomaly detector. Flags spend, conversions, clicks, or impressions that swing more than a z-s
Rule Reviewer
Internal agent for reviewing draft rules. Promotes good rules to proven, merges similar rules, archives stale