一键导入
clojure-eval
Evaluate Clojure code via nREPL using clj-nrepl-eval. Always load this skill
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Evaluate Clojure code via nREPL using clj-nrepl-eval. Always load this skill
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Control a browser programmatically. Use for integration testing, manual validation, and experimentation.
Style components with daisy-ui. Use any time styled html components are used.
Repair Clojure reader syntax errors caused by unbalanced delimiters ((), [], {}) to fix errors like "EOF while reading", "Unexpected EOF", "Unmatched delimiter", or "Unbalanced delimiter".
Datastar framework guidance for adding data-* attributes, frontend actions, reactive signals, and backend SSE/SDK usage (including Clojure). Use when modifying HTML/Hiccup with Datastar attributes, handling Datastar requests, patching elements/signals, or tracing signal updates.
See what the program is doing with logs. Use when using the development http server or to see the value of log or trace statements
基于 SOC 职业分类
| name | clojure-eval |
| description | Evaluate Clojure code via nREPL using clj-nrepl-eval. Always load this skill |
Use this skill when you need to:
The command is run with devenv shell clj-nrepl-eval. (The prefix devenv shell is on purpose and specific to this repository.)
The devenv shell clj-nrepl-eval command evaluates Clojure code against an nREPL server. Session state persists between evaluations, so you can require a namespace in one evaluation and use it in subsequent calls. Each host:port combination maintains its own session file.
First, discover what nREPL servers are running in the current directory:
devenv shell clj-nrepl-eval --discover-ports
This will show all nREPL servers (Clojure, Babashka, shadow-cljs, etc.) running in the current project directory.
Then use the AskUserQuestion tool:
If ports are discovered:
If no ports are discovered:: stop and ask the user to start one, and tell you the port
IMPORTANT: IF you start a REPL do not supply a port let the nREPL start and return the port that it was started on.
Evaluation automatically connects to the given port
Use the -p flag to specify the port and pass your Clojure code.
Recommended: Pass code as a command-line argument:
devenv shell clj-nrepl-eval -p <PORT> "(+ 1 2 3)"
For multiple expressions (single line):
devenv shell clj-nrepl-eval -p <PORT> "(def x 10) (+ x 20)"
Alternative: Using heredoc (may require permission approval for multiline commands):
devenv shell clj-nrepl-eval -p <PORT> <<'EOF'
(def x 10)
(+ x 20)
EOF
Alternative: Via stdin pipe:
echo "(+ 1 2 3)" | devenv shell clj-nrepl-eval -p <PORT>
Discover all nREPL servers in current directory:
devenv shell clj-nrepl-eval --discover-ports
Shows all running nREPL servers in the current project directory, including their type (clj/bb/basilisp) and whether they match the current working directory.
Check previously connected sessions:
devenv shell clj-nrepl-eval --connected-ports
Shows only connections you have made before (appears after first evaluation on a port).
Require a namespace (always use :reload to pick up changes):
devenv shell clj-nrepl-eval -p <PORT> "(require '[my.namespace :as ns] :reload)"
Test a function after requiring:
devenv shell clj-nrepl-eval -p <PORT> "(ns/my-function arg1 arg2)"
Check if a file compiles:
devenv shell clj-nrepl-eval -p <PORT> "(require 'my.namespace :reload)"
Multiple expressions:
devenv shell clj-nrepl-eval -p <PORT> "(def x 10) (* x 2) (+ x 5)"
Complex multiline code (using heredoc):
devenv shell clj-nrepl-eval -p <PORT> <<'EOF'
(def x 10)
(* x 2)
(+ x 5)
EOF
Note: Heredoc syntax may require permission approval.
With custom timeout (in milliseconds):
devenv shell clj-nrepl-eval -p <PORT> --timeout 5000 "(long-running-fn)"
Reset the session (clears all state):
devenv shell clj-nrepl-eval -p <PORT> --reset-session
devenv shell clj-nrepl-eval -p <PORT> --reset-session "(def x 1)"
-p, --port PORT - nREPL port (required)-H, --host HOST - nREPL host (default: 127.0.0.1)-t, --timeout MILLISECONDS - Timeout (default: 120000 = 2 minutes)-r, --reset-session - Reset the persistent nREPL session-c, --connected-ports - List previously connected nREPL sessions-d, --discover-ports - Discover nREPL servers in current directory-h, --help - Show help messagedevenv shell clj-nrepl-eval -p <PORT> "(+ 1 2 3)" - works with existing permissions<<'EOF' ... EOF) for truly multiline code, but note it may require permission approval--reset-session is used:reload to pick up recent changesdevenv shell clj-nrepl-eval --discover-portsdevenv shell clj-nrepl-eval -p <PORT> "(require '[my.ns :as ns] :reload)"
devenv shell clj-nrepl-eval -p <PORT> "(ns/my-fn ...)"
:reload, test again