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
- Deslop Reborn — One iteration of the IronClaw Reborn de-slop loop — take ONE Reborn crate, fan out parallel review sub-agents 12.6k ★
- AI Contribution Skills (Engram) — branch-pr: clean branch and PR workflow 2.5k ★
- Add Plugin — Integrate a spec-driven/skill framework as a bundled agtx plugin 1.5k ★
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
Estimate Spec
Add complexity estimates to existing spec file
Write Tests
Generate unit and integration tests for existing code. Triggers on "write tests", "add tests", "test this", "t
Doesitwork
Does it work? Quick health check for any feature - validates API endpoints, frontend-backend integration, test
Six
Use this skill to run test coverage analysis and write tests for uncovered code. Run it when asked to improve
Amby.Analyze
Cross-check spec, plan, and tasks for coverage, consistency, and dependency-graph health.
Check Coverage
Deprecated forwarding alias for Codex test coverage review.
Related Agents
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
Byoh Guide
Guides the user through building a personalized AI agent harness using BYOH MCP tools. Drives the full profile