Clojure Coding Practices
Application skill for Clojure style learning (from the archived awesome-guidelines style capsules). For ClojureScript-specific tooling, follow project shadow-cljs / cljs conventions.
Core Principle
Clojure readability is consistent layout + idiomatic expressions, namespaces explicit, names conventional, data as maps/vectors, side effects marked.
When to Use / NOT
- Clojure/ClojureScript application and library code.
- Setting up clj-kondo, cljfmt, clojure.test in CI.
NOT when:
- Non-Clojure code.
- Generated
cljs from macros, validate generator output.
Workflow
- Layout & ns, indent, parens,
ns hygiene (clojure-style-layout-namespaces.md).
- Naming, lisp-case,
?, !, dynamics (clojure-style-naming-types.md).
- Functions, when/if-let, threading, arity (
clojure-style-functions-idioms.md).
- Data & safety, collections, errors, macros (
clojure-style-data-safety.md).
- Verify, cljfmt, clj-kondo,
clojure -M:test on changed namespaces.
Red Flags
:use or :refer :all
- Single-segment library namespace
- camelCase/snake_case function names
def inside function for local state
- Shadowing
clojure.core without exclude
- List literals for sequential app data
- Index-based collection loops
- Catching
Throwable
- Macro where function suffices
- Missing docstring on public API
Verification
cljfmt check / project formatter
clj-kondo --lint on changed paths
clojure -M:test or lein test / bb test
- Capsule checklist on namespace review
References
awesome-guidelines/references/clojure-style-learning-note.md
awesome-guidelines/references/clojure-style-layout-namespaces.md
awesome-guidelines/references/clojure-style-naming-types.md
awesome-guidelines/references/clojure-style-functions-idioms.md
awesome-guidelines/references/clojure-style-data-safety.md
1---2name: clojure-coding-practices3description: Use when authoring or reviewing Clojure, 2-space layout, gathered parens, sorted ns requires, lisp-case naming,?/! conventions, threading idioms, keyword maps, ex-info errors, and clj-kondo/cljfmt in CI.4---56# Clojure Coding Practices78Application skill for Clojure style learning (from the archived `awesome-guidelines` style capsules). For ClojureScript-specific tooling, follow project `shadow-cljs` / `cljs` conventions.910## Core Principle1112Clojure readability is **consistent layout + idiomatic expressions**, namespaces explicit, names conventional, data as maps/vectors, side effects marked.1314## When to Use / NOT1516- Clojure/ClojureScript application and library code.17- Setting up clj-kondo, cljfmt, clojure.test in CI.1819**NOT when:**2021- Non-Clojure code.22- Generated `cljs` from macros, validate generator output.2324## Workflow25261. **Layout & ns**, indent, parens, `ns` hygiene (`clojure-style-layout-namespaces.md`).272. **Naming**, lisp-case, `?`, `!`, dynamics (`clojure-style-naming-types.md`).283. **Functions**, when/if-let, threading, arity (`clojure-style-functions-idioms.md`).294. **Data & safety**, collections, errors, macros (`clojure-style-data-safety.md`).305. **Verify**, cljfmt, clj-kondo, `clojure -M:test` on changed namespaces.3132## Red Flags3334- `:use` or `:refer :all`35- Single-segment library namespace36- camelCase/snake_case function names37- `def` inside function for local state38- Shadowing `clojure.core` without exclude39- List literals for sequential app data40- Index-based collection loops41- Catching `Throwable`42- Macro where function suffices43- Missing docstring on public API4445## Verification4647- `cljfmt check` / project formatter48- `clj-kondo --lint` on changed paths49- `clojure -M:test` or `lein test` / `bb test`50- Capsule checklist on namespace review515253## References5455- `awesome-guidelines/references/clojure-style-learning-note.md`56- `awesome-guidelines/references/clojure-style-layout-namespaces.md`57- `awesome-guidelines/references/clojure-style-naming-types.md`58- `awesome-guidelines/references/clojure-style-functions-idioms.md`59- `awesome-guidelines/references/clojure-style-data-safety.md`