prompts/skills/clojure-eval/SKILL.md
Use this skill BEFORE using writing any Clojure code or using brepl. It teaches how to use the Clojure REPL (via brepl) so you can test code, check if edited files compile, verify function behavior, or interact with a running REPL session.
npx skillsauth add ramblurr/nix-devenv clojure-evalInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when you need to:
Before evaluating code, you need a running nREPL server. Follow these steps in order:
Check if a REPL is already running by trying a quick eval:
brepl '(+ 1 2)'
If this returns 3, a REPL is already running. Skip to the evaluation sections below.
If no REPL is running, check if the project has a bb.edn file (indicates one of our Clojure projects):
ls bb.edn
If bb.edn exists, start the REPL with:
bb dev
Run this as a background process since it blocks. Wait for .nrepl-port to appear, then verify with brepl '(+ 1 2)'.
If there is no bb.edn, fall back to starting the REPL directly:
clojure -M:dev:repl/dev
Run this as a background process since it blocks. Wait for .nrepl-port to appear, then verify with brepl '(+ 1 2)'.
brepl is a REPL client for evaluating Clojure expressions. This skill teaches the heredoc pattern for reliable code evaluation.
The brepl command evaluates Clojure code against an nREPL server. It auto-detects the port from the .nrepl-port file in your project directory, so explicit port configuration is usually unnecessary.
Always use the heredoc pattern for brepl evaluation. This eliminates quoting issues, works for all cases, and provides a consistent approach.
brepl "$(cat <<'EOF'
(your clojure code here)
EOF
)"
Note: Use <<'EOF' (with single quotes) to prevent shell variable expansion.
<<'EOF' and EOF is literalbrepl '(+ 1 2 3)'
brepl "$(cat <<'EOF'
(require '[clojure.string :as str])
(str/join ", " ["a" "b" "c"])
EOF
)"
brepl "$(cat <<'EOF'
(println "String with 'single' and \"double\" quotes")
EOF
)"
brepl "$(cat <<'EOF'
(require '[my.namespace :as ns] :reload)
EOF
)"
brepl "$(cat <<'EOF'
(require '[myapp.core] :reload-all)
EOF
)"
brepl "$(cat <<'EOF'
(require '[myapp.core] :reload)
(myapp.core/some-function "test" 123)
EOF
)"
brepl "$(cat <<'EOF'
(def config
{:database {:host "localhost"
:port 5432}
:api {:key "secret-key"}})
(println (:database config))
EOF
)"
brepl "$(cat <<'EOF'
(require '[clojure.test :refer [run-tests]])
(require '[myapp.core-test] :reload)
(run-tests 'myapp.core-test)
EOF
)"
brepl "$(cat <<'EOF'
(require '[clojure.repl :refer [doc source]])
(doc map)
(source filter)
EOF
)"
brepl "$(cat <<'EOF'
*e
(require '[clojure.repl :refer [pst]])
(pst)
EOF
)"
To load an entire file into the REPL:
brepl -f src/myapp/core.clj
-e, --e <expr> - Expression to evaluate-f, --f <file> - File to load and execute-p, --p <port> - nREPL port (auto-detects from .nrepl-port if not specified)-h, --h <host> - nREPL host (default: localhost or BREPL_HOST)--verbose - Show raw nREPL messages instead of parsed output--help - Show help messageThe port is resolved in this order:
-p 7888.nrepl-port file in project directoryBREPL_PORT=7888# Auto-detect from .nrepl-port (most common)
brepl -e '(+ 1 2)'
# Explicit port
brepl -p 7888 -e '(+ 1 2)'
# Using environment variable
BREPL_PORT=7888 brepl -e '(+ 1 2)'
<<'EOF' not <<EOF to prevent shell expansion:reload to pick up recent changes-e flag is optional: brepl '(+ 1 2)' works the same as brepl -e '(+ 1 2)'brepl "$(cat <<'EOF'
(require '[my.ns :as ns] :reload)
EOF
)"
brepl "$(cat <<'EOF'
(ns/my-fn ...)
EOF
)"
:reload, test againbrepl documentation: https://github.com/licht1stein/brepl (check extra/)
tools
Use when working with Nixbot CI, forge commit statuses, Nix flake checks, nixbot.toml, Nixbot effects, or nixbot-cli - explains how Nixbot runs flake CI and how to inspect builds and logs.
testing
Use this OCP when executing or preparing to execute commands that change a live or important system, service reloads/restarts, package changes, deployments, migrations, firewall/network/access changes, credential rotation, NixOS switch/test/boot/deploy, or incident mitigation. It guides safe operations with a persisted ledger for scope, preflight, baseline, rollback, validation, and evidence.
development
Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill.
documentation
Naming conventions for workflow documents in prompts/. Use when creating plans, PRDs, research reports, idea capture or other workflow documents. Triggers on (1) creating new planning documents, (2) naming PRDs or research reports, (3) questions about document organization in prompts/.