원클릭으로
clojure
always use for authoring clojure code; also use for reviewing, auditing, or scanning Clojure code conformity
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
always use for authoring clojure code; also use for reviewing, auditing, or scanning Clojure code conformity
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
work through final design decisions
Style gate for human-facing prose (README, docs/, guides, release notes). Use when writing or reviewing any human-facing documentation to strip LLM-writing tells and keep the voice plain, warm, and factual. Not needed for API reference generated from docstrings.
opt-in autonomous coordinator mode - act AFK on my behalf with delegated sign-off authority
| name | clojure |
| description | always use for authoring clojure code; also use for reviewing, auditing, or scanning Clojure code conformity |
Use clojure.spec.alpha as a selective contract and generative-testing tool, not as mandatory ceremony for every non-trivial function.
Prefer specs for:
s/fdef clarifies a contract or enables useful generative tests.Usually skip specs for:
A good default rule:
Spec data contracts broadly; spec function contracts selectively where generated inputs or API documentation will catch real bugs.
clojure.spec.test.alpha/check is most valuable when the :fn relation states a property between inputs and outputs, not merely when :args and :ret check shape.
Good property candidates:
Do not add property tests with weak generators just to claim coverage. A few concrete regression examples may be better than a shallow generator.
Docstrings are expected for public API vars more often than specs are.
Use docstrings for:
defn, defmacro, protocol, record/type, and important public def.For audits, treat a top-level var as public unless it has ^:private, is defined with defn-, or the namespace clearly marks it as internal. Missing docstrings on public vars are reportable conformity issues, especially for API, DB, query, REPL, and namespace entry-point functions.
Docstring style:
Return ..., Create ..., Evaluate ....Example:
(defn ready
"Return open strands whose blocking dependencies are closed.
Traverses only declared structural dependency relations. Annotation edges do not
affect readiness."
[db]
...)
Hard limit: no docstring or string literal line may extend past column 180. Long lines break IDE viewports and diff review. This is a reportable conformity issue wherever it appears — source, tests, config.
When a value is prose (op payloads, about surfaces, rule descriptions, delegation bodies), do not build it from (str ...) fragments or one long literal. Author it as a |-margin block and reflow it with the shipped helpers:
skein.api.format.alpha — the blessed surface for every tier, spools included: trusted config (.skein/), userland, core. (skein.spools.format is deleted; SPEC-005.C3.)(fill block) returns a vector of item strings (bare | line separates items; indented-past-the-bar lines keep an item verbatim for command samples). (reflow block) soft-wraps one paragraph into one string. Contract: docs/spools/writing-shared-spools.md.
(format-alpha/reflow
"|One rule sentence that would otherwise be an unreadable
|single source line, soft-wrapped at authoring time.")
Docstrings cannot use runtime helpers: wrap them by hand well short of the limit (match the surrounding namespace, usually ~80). Converted skein.api.* modules carry a hard 96-column bound on every source line, enforced by quality.api-form (SPEC-003.C19a).
When scanning Clojure conformity, actively look for and report these before listing positives:
(str ...) fragments instead of a |-margin block through skein.api.format.alpha.ns docstring and has a non-trivial public role.defn, defmacro, protocol, record/type, or important public def lacks a useful docstring.def values appear unused, under-tested, or accidentally public. Constants, SQL fragments, dynamic compiler state, and implementation tables should normally be ^:private unless they are intentional API and documented.A public namespace should read as a story: the promised fns lead, and each body shows the meat of its algorithm as named, composed steps. Placement of helpers — file-local privates below the publics, or a sibling internal namespace — is taste; what is not negotiable is that the public body surfaces the shape of the problem. SPEC-003.C19a holds converted skein.api.* modules to this.
;; GOOD: the public fn IS the pipeline; helpers are named steps below it.
(defn link!
"Link every configured project's dotfiles into place; return the
projects that changed."
[config-path]
(->> (load-configs config-path)
(pmap project-files-to-link)
(assert-no-conflicts!)
(mapv relink-project!)
(filterv changed?)))
;; BAD: a delegation husk — the story has been exiled to another file,
;; and the reader learns nothing here.
(defn link!
"Link every configured project's dotfiles into place."
[config-path]
(internal/link! config-path))
Concurrency shape is part of the story. Where calls run in sequence, where they fan out, and where the code blocks must read in the public body — a helper that hides a future, pmap, or blocking deref hides exactly the thing a review should question ("could we have started that fetch sooner?").
;; BAD - the fan-out and the blocking joins are buried in the helper.
(defn load-dashboard
"Assemble the dashboard for `ctx`."
[ctx]
(fetch-everything ctx))
;; GOOD - sequence, parallelism, and joins read at the top level.
(defn load-dashboard
"Assemble the dashboard for `ctx`."
[ctx]
(let [profile (future (fetch-profile ctx)) ; starts now
boards (future (fetch-boards ctx)) ; runs alongside profile
prefs (fetch-prefs ctx)] ; must resolve before the join
(render-dashboard @profile @boards prefs)))
Method: write the split first, merge back by measurement. Draft the module as alpha composing internal/<concern> files — the compiler exposes coupling that imagination fudges — and write tests against the public surface only. Then measure: at roughly 500 lines or under, fold the concerns back into one story-ordered file (publics leading, section-commented private clusters, leaf mechanics last, one declare block as the accepted cost); over that, the split stands. The public-surface tests must pass unchanged through the fold, and watch for names that only made sense behind an alias (case* is a compiler special form someone hit this way). Recursion clusters stay together on whichever side they live; a public fn may run long when that keeps one story in one place. The worked example is skein.api.return-shape.alpha, folded to a single file after living as per-concern files.
Do not make a public var private just because it has lower-level mechanics. Classify visibility before changing it.
Keep a var public and add a docstring when:
Make a var private when:
If uncertain, prefer documenting over privatizing and report the visibility question as a follow-up.
Follow common Clojure community style unless local code establishes a stronger pattern:
kebab-case vars/functions/namespaces.?; mutating/side-effecting operations may use ! when that communicates danger or state change.let, threading macros, and small named helpers over dense nested forms.:refer :all outside tests/REPL-oriented namespaces.clj-kondo/editor diagnostics as the baseline style and correctness feedback.Entry state: CLASSIFY_CHANGE
s/fdef if the contract is non-obvious or useful for generated checks.s/fdef only where properties or public contracts earn it.stest/check coverage or generator-backed tests for the specific invariant.defn/defmacro/protocol/record/type/important def, including functions declared earlier with declare and defined later.^:private, especially dynamic compiler state, SQL fragments, schema constants, helper tables, and internal defaults.^:private.ex-info or equivalent, not silently no-op, coerce, default, or produce misleading results.::strand, ::edge, ::query.s/fdef, include :args and :ret; include :fn when a meaningful input/output relation exists.doc output.|-margin blocks via skein.api.format.alpha.Before reporting success on Clojure code changes, verify as applicable:
|-margin format helpers.s/fdef is used selectively for public contracts or property-testable pure functions.:fn or explicit property assertions.