@majiayu000/clojure-guardrails
BReference for Guardrails library with Malli in Clojure. Use when working with `>defn`, `>defn-`, `>def`, `>fdef` macros, gspec syntax, or function validation. Triggers on guardrails imports, `com.fulcrologic.guardrails.malli`, function specs with `=>` operator, or questions about runtime validation in Clojure.
Install
agr install @majiayu000/clojure-guardrails --target claudeWrites 2 files into .claude/skills/, pinned to git-c2dc504d.
- .claude/skills/clojure-guardrails/SKILL.md
- .claude/skills/clojure-guardrails/metadata.json
Document
name: clojure-guardrails
description: Reference for Guardrails library with Malli in Clojure. Use when working with >defn, >defn-, >def, >fdef macros, gspec syntax, or function validation. Triggers on guardrails imports, com.fulcrologic.guardrails.malli, function specs with => operator, or questions about runtime validation in Clojure.
Clojure Guardrails (Malli)
Detection
Check if guardrails is in use:
grep -r "guardrails.enabled" deps.edn shadow-cljs.edn 2>/dev/null
Setup
deps.edn:
{:deps {com.fulcrologic/guardrails {:mvn/version "1.2.16"}
metosin/malli {:mvn/version "0.20.0"}}
:aliases {:dev {:jvm-opts ["-Dguardrails.enabled=true"]}}}
See https://clojars.org/com.fulcrologic/guardrails for the latest version.
Enable at runtime: -Dguardrails.enabled=true
Import
(require '[com.fulcrologic.guardrails.malli.core :refer [>defn >defn- >def >fdef | ? =>]])
Core Macros
| Macro | Purpose |
|---|---|
>defn | Define function with inline spec |
>defn- | Private function with spec |
>def | Register malli schema |
>fdef | Declare spec without body |
? | Nilable shorthand [:maybe schema] |
| | "Such that" constraints |
=> | Separates args from return |
Gspec Syntax
[arg-specs* (| arg-preds+)? => ret-spec (| ret-preds+)?]
Basic:
(>defn add [a b]
[:int :int => :int]
(+ a b))
With constraints:
(>defn ranged-rand [start end]
[:int :int | #(< start end)
=> :int | #(>= % start) #(< % end)]
(+ start (long (rand (- end start)))))
Nilable:
(>defn find-user [id]
[:int => (? :map)]
(get users id))
Multi-arity:
(>defn greet
([name]
[:string => :string]
(str "Hello, " name))
([greeting name]
[:string :string => :string]
(str greeting ", " name)))
Variadic:
(>defn sum [x & more]
[:int [:* :int] => :int]
(apply + x more))
Map schemas:
(>defn process-user [user]
[[:map [:name :string] [:age :int]] => :string]
(str (:name user) " is " (:age user)))
Schema Registry
This is an optional feature.
(require '[com.fulcrologic.guardrails.malli.registry :as gr.reg])
;; Register schemas
(>def :user/name :string)
(>def :user/age :int)
(>def :user/record [:map :user/name :user/age])
;; Use in functions
(>defn get-user [id]
[:int => (? :user/record)]
(lookup id))
Detailed Reference
See gspec-syntax.md for complete syntax documentation.
Repository README
Describes majiayu000/claude-skill-registry-data as a whole, which may contain artifacts other than this one. Where this artifact had no useful description of its own, its summary was taken from here.
Claude Skill Registry (Data)
This repo contains the archived skill contents (the heavy, browsable skill files).
Canonical layout
- Category folders at repo root (e.g.
development/,documents/,data/, ...) - Each skill lives under a category:
<category>/<skill>/SKILL.md+<category>/<skill>/metadata.json - Case conflicts are resolved with
{name}-{owner}-{repo}suffixes (fallback:-{short-hash}).
Archive status
- Live badges above are sourced from
claude-skill-registry-corestats.json. - Counts in this README are intentionally dynamic, not hardcoded.
- If the badges look stale, refresh the
corebuild/index pipeline rather than editing numbers here.
Where the index + site live
- Core repo: https://github.com/majiayu000/claude-skill-registry-core
- Main repo (merged publish artifact): https://github.com/majiayu000/claude-skill-registry
Trustgrade B
- passBody integrity
Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.
- passType matchnot applicable to this artifact type
Whether the artifact is really the kind of thing its metadata claims it is.
- passFreshness
How long since the source repository was last pushed to.
- passPrompt injection
Scans the artifact's own text for instructions aimed at your agent rather than at you.
- warnLicenseno SPDX license detected
Whether the source repository declares an SPDX license permissive enough to redistribute.
How the grade is calculated
Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:
- Aevery check passed
- Bone warning
- Ctwo warnings
- Dprompt injection or body integrity failed, or three warnings
- Fone of those failed, and something else is wrong
These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged — not that the artifact is safe.
Versions
git-c2dc504dbc412026-07-31