ワンクリックで
crap4clj
Use when the user asks for a CRAP report, cyclomatic complexity analysis, or code quality metrics on a Clojure project
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use when the user asks for a CRAP report, cyclomatic complexity analysis, or code quality metrics on a Clojure project
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Bootstrap and run bean work from a hail delivery when session cwd, skills catalog, or checkout layout are ambiguous. Use for isaac-work hails, orchestration/process-test beans, or when list_skills returns empty.
Use this skill when working with c3kit.apron.schema — defining schemas, calling coerce/validate/conform/present, handling errors, or writing custom spec functions. Covers the full API including nested types, entity-level specs, and error handling.
Use this skill when working in projects that depend on c3kit libraries (apron, bucket, wire, scaffold). Covers the schema system, database API, web layer, app lifecycle, and conventions specific to the c3kit ecosystem.
Use when mutation-testing Clojure code, assessing test quality beyond coverage, or investigating surviving mutations to strengthen specs
Use this skill when writing, reviewing, or refactoring Clojure or ClojureScript code. Covers naming, formatting, function design, state management, error handling, threading, and cross-platform conventions.
Use this skill when implementing gherclj feature steps, working on beads that reference .feature files, or writing defgiven/defwhen/defthen definitions and their helpers. Ensures step definitions follow gherclj conventions — especially that defthen helpers assert results.
| name | crap4clj |
| description | Use when the user asks for a CRAP report, cyclomatic complexity analysis, or code quality metrics on a Clojure project |
Computes the CRAP (Change Risk Anti-Pattern) score for every defn and defn- in a Clojure project. CRAP combines cyclomatic complexity with test coverage to identify functions that are both complex and under-tested.
Add both a :cov alias (Cloverage) and a :crap alias to the project's deps.edn:
:cov {:extra-deps {cloverage/cloverage {:mvn/version "1.2.4"}}
:main-opts ["-m" "speclj.cloverage" "--" "-p" "src" "-s" "spec"]}
:crap {:extra-deps {io.github.unclebob/crap4clj
{:git/url "https://github.com/unclebob/crap4clj"
:git/sha "<current-sha>"}}
:main-opts ["-m" "crap4clj.core"]}
The example above uses speclj.cloverage as the runner. For clojure.test projects, use cloverage.coverage instead:
:cov {:extra-deps {cloverage/cloverage {:mvn/version "1.2.4"}}
:main-opts ["-m" "cloverage.coverage" "-p" "src" "-s" "test"]}
Adjust the -p (source path) and -s (test path) flags in :cov to match your project layout.
# Analyze all source files under src/
clj -M:crap
# Filter to specific modules
clj -M:crap combat movement
crap4clj automatically deletes stale coverage reports, runs clj -M:cov, and then analyzes the results.
A table sorted by CRAP score (worst first):
CRAP Report
===========
Function Namespace CC Cov% CRAP
-------------------------------------------------------------------------------------
complex-fn my.namespace 12 45.0% 130.2
simple-fn my.namespace 1 100.0% 1.0
| CRAP Score | Meaning |
|---|---|
| 1-5 | Clean — low complexity, well tested |
| 5-30 | Moderate — consider refactoring or adding tests |
| 30+ | Crappy — high complexity with poor coverage |
clj -M:cov).clj and .cljc files under src/defn/defn- functions with line rangesCC² × (1 - cov)³ + CC