lang-clojure
Skill0 starsChanged 7 days agoMITView on GitHub
Use when writing, reviewing, testing or setting up Clojure backend code in a loops run (the clojure language pack) - toolchain, layout, race policy, coverage, idioms and footguns.
In this repository35 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skills/work/platforms/claude.mdCLAUDE.md
- llms.txtllms.txt
- clarifySkill
- consistencySkill
- debuggingSkill
- documentationSkill
- featureSkill
- hexagonalSkill
- initSkill
- jobs-and-state-machinesSkill
- lang-cppSkill
- lang-csharpSkill
- lang-elixirSkill
- lang-erlangSkill
- lang-goSkill
- lang-javaSkill
- lang-kotlinSkill
- lang-phpSkill
- lang-pythonSkill
- lang-rubySkill
- lang-rustSkill
- lang-scalaSkill
- lang-swiftSkill
- lang-typescriptSkill
- memorySkill
- parallel-workSkill
- performanceSkill
- qualitySkill
- reportSkill
- review-integrationSkill
- statusSkill
- testingSkill
- workSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 37
Never use --no-randomize, retries or a fixed seed in the gate.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Clojure backend (JVM, deps.edn)
Applies when loops lang detect reports clojure (deps.edn, project.clj or workspace.edn). Rules: specs/languages/clojure/RULES.md (IDs CLJ-<SEC>-NN). Pack data: specs/languages/clojure/pack.json (loops lang show clojure). Layering and SOLID are language-neutral: specs/ARCHITECTURE.md, specs/SOLID.md.
Project rules first
The project's own config wins over this skill: deps.edn aliases, .clj-kondo/config.edn, .cljfmt.edn, tests.edn, .editorconfig, framework conventions (Ring/Reitit, Pedestal, Integrant, Component, Polylith). When you follow one over a loops rule, record it: loops run override --rule "<loops rule>" --project "<project rule, file:line>" --note "<what you did>" (ROLES.md "Project rules first"). The practices-researcher reads config_files from the pack.
Toolchain the gate runs
loops gate runs these in order; while iterating run a single one. deps.edn is the base; a project with only project.clj gets the lein variant (lein deps, lein cljfmt check, lein cloverage, lein kaocha).
| Check | Command | Notes |
| deps (required) | clojure -P -M:test | prefetch only; never edits deps.edn |
cljfmt (required if .cljfmt.edn) | clojure -Tcljfmt check | install: clojure -Ttools install-latest :lib io.github.weavejester/cljfmt :as cljfmt |
| clj-kondo (required) | clj-kondo --lint src test --parallel | exit 2 = warnings, 3 = errors, both fail (CLJ-TOOL-03) |
| poly (Polylith) | clojure -M:poly check | when workspace.edn exists |
| arch (optional) | loops arch | scans ns forms, - to _ resolver |
| test (required) | clojure -M:cov -o {coverage_dir} | cloverage on clojure.test; lcov at {coverage_dir}/lcov.info |
| test-repeat (required) | clojure -M:test --randomize --seed {seed}, 3 times | race substitute, see below |
| coverage (required) | loops parses the lcov file | new code at least 70% |
| nvd (off by default) | clojure -Tnvd nvd.task/check :classpath ... | --vuln; needs NVD_API_TOKEN and the nvd tool installed |
Narrow while working: clojure -M:test --focus my.ns-test/my-test, --fail-fast, or a REPL (clojure.test/run-tests 'my.ns-test) (CLJ-TEST-11). Never run the full gate as an implementer; the lead and QA do (ROLES.md).
Caches (D15): keep ~/.m2 and ~/.gitlibs shared; the gate scopes only the JVM tmp dir (JAVA_TOOL_OPTIONS=-Djava.io.tmpdir). CLJ_CACHE does nothing with a project deps.edn: .cpcache/ is cleaned after the run instead (CLJ-OPS-05/06).
Race policy (WORKFLOW §6)
The JVM and Clojure have no race detector, so the pack's mode is none. The gate still requires the substitute and never skips it:
test-repeatruns the Kaocha suite three times with--randomize --seed {seed}; each run prints a new seed. Any failure in any run fails the gate; reproduce with--seed N.- Never use
--no-randomize, retries or a fixed seed in the gate. - Shared state lives in one
atom(orref);swap!anddosyncfunctions are pure (CLJ-CONC-01). Tests tagged^:concurrencyare repeated 20 times in review (--focus-meta :concurrency,CLJ-CONC-08). - Missing
:testalias ortests.ednmakes the gate fail with the snippet intesting.md.
Coverage recipe and wave-0 prerequisites (D13)
The architect or clojure-engineer adds these in wave 0 and logs each as an override if the project already differs:
:testalias: Kaocha (lambdaisland/kaocha) with:main-opts ["-m" "kaocha.runner"], plustests.edn(#kaocha/v1,:ns-patterns ["-test$"], randomize on).:covalias: cloverage with:main-opts ["-m" "cloverage.coverage" "-p" "src" "-s" "test" "--lcov" "--no-html"]and:extra-paths ["test"]. loops appends-o {coverage_dir}; do not put-oin the alias.- Exact version pins everywhere (
CLJ-REPO-05),.clj-kondo/config.edn,.cljfmt.edn,.gitignore(.cpcache/,target/).
Details and snippets: testing.md, repo.md.
How the loops layers map
src/my_service/domain/ pure maps and functions; requires only clojure.* and domain
src/my_service/app/ use cases (deps map as first arg) + ports (protocols, consumer-owned)
src/my_service/adapters/ inbound (Ring/Reitit handlers) and outbound (next.jdbc, hato); depend on app
src/my_service/system.clj composition root (Integrant); core.clj holds -main
test/my_service/ mirrors src; files end in _test.cljDomain stays pure: no slurp, Instant/now, rand, future or next.jdbc (CLJ-ARCH-06); time and ids come in as data or ports. Polylith repos: components expose an interface namespace and poly check enforces it (CLJ-ARCH-03).
Ten footguns
- Reflection:
(set! *warn-on-reflection* true)per namespace and type hints. - Lazy sequences escaping
with-openor a transaction:doall,into,reduceinside. - Side effects in
swap!/dosync: they retry; pure function first, effect after. mapfor side effects:run!ordoseq.- Blocking calls inside a core.async
goblock:a/threadora/io-thread, bounded channels. read-stringor runtime code evaluation on input:clojure.edn/read-stringor JSON.nilvsfalsewithor:(get cfg :enabled true).RELEASE, branches or ranges indeps.edn: exact versions and full git SHAs.- Namespace-level
(def conn ...)state and Mount globals: lifecycle map via Integrant. - Mixed numerics (
(= 1 1.0), long overflow, doubles for money):+',bigdec, normalise keys.
Load on demand
repo.md: layout, namespaces, deps pinning, tools.build, Polylith, CI, release.architecture.md: namespaces as layers, ports, DI with Integrant, purity, kondo boundaries.idioms.md: errors as data, nil, immutability, specs, resources, laziness, reflection.testing.md: Kaocha,tests.edn, cloverage:cov, fakes, test.check, flakiness.concurrency.md: atoms, refs, agents, futures, core.async, executors, the race substitute.security.md: injection, deserialization, secrets, crypto, supply chain, SAST.data-api.md: next.jdbc, migrations, Ring/Reitit, outbound calls, observability, ops.frameworks.md: Ring, Reitit, Pedestal, Integrant, Component, Mount, Polylith conventions.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

