一键导入
babashka-nrepl
Write Clojure (Babashka) scripts using REPL-driven development. Start an nREPL server and send code to it for evaluation as you develop.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Write Clojure (Babashka) scripts using REPL-driven development. Start an nREPL server and send code to it for evaluation as you develop.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
| name | babashka-nrepl |
| description | Write Clojure (Babashka) scripts using REPL-driven development. Start an nREPL server and send code to it for evaluation as you develop. |
To proceed with REPL-driven development, you first need to start an nREPL server.
If additional libraries are needed, create bb.edn in the working directory before starting the nREPL server.
{:deps
{ ;; Declare required dependencies here
}}
If you add libraries, you need to restart the nREPL server each time.
The nREPL server can be started with the following command:
bb nrepl-server ${port}
The port is arbitrary, but 1667 is used by default.
Since you will send code from another process using an nREPL client, it's recommended to start this process asynchronously.
Terminate the entire process when you're done.
You can send Clojure (Babashka) code to the nREPL server with the following command:
bb nrepl-eval ${port} '${code}'
However, this command requires a pre-defined bb.edn, so execute it in the directory where this skill exists.
As you write functions, send them to the REPL one by one to verify their behavior. It's recommended to verify behavior in the smallest possible units.
On RDD, it is encouraged to run and verify as many functions and code snippets as possible. Don't be lazy to eval your code.
$ bb nrepl-eval 1667 '(defn double [x] (* x 1)'
clojure.lang.ExceptionInfo: EOF while reading, expected ) to match ( at [1,1] user REPL:1:25
Fix the number of parentheses.
$ bb nrepl-eval 1667 '(defn double [x] (* x 1))'
#'user/double
Then, execute the defined function double.
$ bb nrepl-eval 1667 '(double 3)'
3
It is not expected behavior. Fix it.
$ bb nrepl-eval 1667 '(defn double [x] (* x 2))'
#'user/double
Verify the behavior again.
$ bb nrepl-eval 1667 '(double 3)'
6