Nw Fp Clojure logo

Nw Fp Clojure

Organization
nWave-ai
nw-fp-clojure

Clojure language-specific patterns, data-first modeling, REPL-driven development, and spec

Overview

PublishernWave-ai
RepositorynWave
Skill namenw-fp-clojure
Stars
616
Forks
65
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by nWave-ai on GitHub. Read the source before you install it.

Installation

Install the Nw Fp Clojure AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/nWave-ai/nWave/tree/main/nWave/skills/nw-fp-clojure
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/nWave-ai/nWave.git /tmp/nWave
mkdir -p .claude/skills
cp -r /tmp/nWave/nWave/skills/nw-fp-clojure .claude/skills/nw-fp-clojure
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Nw Fp Clojure in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Nw Fp Clojure on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Nw Fp Clojure is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

FP in Clojure -- Functional Software Crafter Skill

Cross-references: fp-principles | fp-domain-modeling

When to Choose Clojure

  • Best for: data-centric domains | REPL-driven exploration | rapid prototyping | frequently evolving data shapes
  • Not ideal for: teams wanting compile-time type safety | Android | teams unfamiliar with Lisp syntax

[STARTER] Quick Setup

bash
# Install Clojure CLI
brew install clojure/tools/clojure  # macOS
# Create project
mkdir -p order-service/src/order_service order-service/test/order_service
# Run REPL: clj | Run tests: clj -X:test

Namespace caveat: Clojure namespaces use - but filenames use _ (JVM requirement). order-service.core lives in order_service/core.clj.

[STARTER] Domain Modeling with Spec

Clojure is dynamically typed. Domain modeling uses maps with qualified keywords, validated at runtime.

clojure
(require '[clojure.spec.alpha :as s])

;; Domain wrappers as specs
(s/def ::order-id pos-int?)
(s/def ::email (s/and string? #(clojure.string/includes? % "@")))
(s/def ::customer-name (s/and string? #(> (count %) 0)))

;; Record types as spec'd maps
(s/def ::customer (s/keys :req [::customer-name ::email] :opt [::phone]))

;; Choice types as spec alternatives
(s/def ::payment-method
  (s/or :credit-card (s/keys :req [::card-number ::expiry-date])
        :bank-transfer (s/keys :req [::account-number])
        :cash #{:cash}))

[STARTER] Validated Construction

clojure
(defn make-email [raw-email]
  (if (s/valid? ::email raw-email)
    {:ok raw-email}
    {:error (str "Invalid email: " raw-email)}))

[INTERMEDIATE] Auto-Generated Test Data from Specs

clojure
(require '[clojure.spec.gen.alpha :as gen]
         '[clojure.spec.test.alpha :as stest])

(gen/sample (s/gen ::customer) 5)  ;; random valid customers

;; Auto-test functions against their specs
(s/fdef validate-order
  :args (s/cat :raw-order ::raw-order)
  :ret (s/or :ok ::validated-order :error ::validation-error))
(stest/check `validate-order)

Define specs, get generators and function tests for free.

[INTERMEDIATE] Composition Style

Threading Macros

clojure
;; Thread-first (data through first arg) / Thread-last (for collections)
(-> raw-order validate-order price-order confirm-order)
(->> orders (filter active?) (map :customer-name) (sort))

;; comp composes right-to-left; partial for partial application
(def process-order (comp confirm-order price-order validate-order))

Error-Track Pipeline (Convention-Based)

clojure
(defn bind-result [result f]
  (if (:ok result) (f (:ok result)) result))

(defn place-order [raw-order]
  (-> {:ok raw-order}
      (bind-result validate-order)
      (bind-result price-order)
      (bind-result confirm-order)))

No stdlib Result/Either -- by convention using {:ok v} / {:error r} maps.

[INTERMEDIATE] Effect Management

Side effects managed by convention and architecture, not the type system.

Pure Core / Imperative Shell

clojure
;; Pure domain logic (no I/O, no state)
(defn calculate-discount [order]
  (if (> (count (:lines order)) 10) {:rate 0.1} {:rate 0.0}))

;; Imperative shell (I/O at edges)
(defn place-order-handler! [deps raw-order]
  (let [result (-> raw-order
                   validate-order
                   (bind-result (partial price-order (:get-price deps)))
                   (bind-result confirm-order))]
    (when (:ok result)
      ((:save-order! deps) (:ok result)))
    result))

[ADVANCED] Hexagonal Architecture with Functions

clojure
;; Functions as dependencies (idiomatic Clojure)
(defn make-place-order-handler [find-order-fn save-order-fn!]
  (fn [raw-order]
    (let [result (validate-and-price raw-order)]
      (when (:ok result) (save-order-fn! (:ok result)))
      result)))

;; Composition root
(def handler
  (make-place-order-handler
    (partial find-order-in-db datasource)
    (partial save-order-in-db! datasource)))

For lifecycle management, use Component, Integrant, or Mount:

clojure
(require '[integrant.core :as ig])

(defmethod ig/init-key ::order-repo [_ {:keys [datasource]}]
  (->PostgresOrderRepo datasource))

[INTERMEDIATE] Testing

Frameworks: clojure.test (built-in) | test.check (PBT) | Kaocha (test runner).

Property Test with test.check

clojure
(require '[clojure.test.check.clojure-test :refer [defspec]]
         '[clojure.test.check.generators :as gen]
         '[clojure.test.check.properties :as prop])

(defspec serialization-round-trips 100
  (prop/for-all [order (s/gen ::order)]
    (= order (deserialize (serialize order)))))

Custom Generator

clojure
(def gen-valid-email
  (gen/fmap (fn [[user domain]] (str user "@" domain ".com"))
    (gen/tuple
      (gen/such-that not-empty (gen/string-alphanumeric))
      (gen/such-that not-empty (gen/string-alphanumeric)))))

[ADVANCED] Idiomatic Patterns

Data-First Domain Modeling

clojure
(def order
  {::order-id 42
   ::customer {::customer-name "Alice" ::email "alice@example.com"}
   ::lines [{::product-code "W-1234" ::quantity 10 ::price 25.0}]
   ::status :validated})

"Data is better than types." Domain models are maps. Validation happens at boundaries.

Multimethods for State Machines

clojure
(defmulti handle-command (fn [state _command] (:status state)))

(defmethod handle-command :empty [_state {:keys [item]}]
  {:status :active :lines [item]})

(defmethod handle-command :active [state {:keys [action] :as command}]
  (case action
    :add-item (update state :lines conj (:item command))
    :pay (assoc state :status :paid)
    state))

(defmethod handle-command :paid [state _command]
  state)

Maturity and Adoption

  • Dynamic typing trade-offs: No compile-time type checking; typos in keywords are silent until runtime. Spec instrumentation helps but is opt-in.
  • Spec limitations: Powerful for data validation but lacks expressiveness of static type systems for complex invariants. Spec 2 in development for years.
  • Discipline needed for test coverage: Without compiler catching type errors, comprehensive tests are essential.
  • Smaller ecosystem: Fewer libraries than Java/Kotlin. Good JVM interop compensates but Java interop code is verbose.

Common Pitfalls

  1. Silent nil propagation: Missing key returns nil, propagates silently. Use some-> and explicit nil checks at boundaries.
  2. Learning curve for non-Lispers: Parenthesis-heavy syntax is a barrier. Invest in Paredit/Parinfer and REPL workflow first.
  3. Spec verbosity: Large spec definitions become unwieldy. Extract into focused namespaces and use s/merge.
  4. Convention-based error handling: Without stdlib Result, teams use inconsistent patterns. Standardize on {:ok v} / {:error r} early.

Frequently asked questions

What does the Nw Fp Clojure AI skill do?

Clojure language-specific patterns, data-first modeling, REPL-driven development, and spec

Why use Nw Fp Clojure on TypingMind?

Because you install it once and use it with any model. Nw Fp Clojure is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Nw Fp Clojure in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/nWave-ai/nWave/tree/main/nWave/skills/nw-fp-clojure. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Nw Fp Clojure?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Nw Fp Clojure?

As many as you like. As long as a model supports skills, you can use Nw Fp Clojure with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Nw Fp Clojure AI skill free?

Yes. It is published on GitHub by nWave-ai under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇