clojure-eval
Evaluate Clojure code via nREPL using clj-nrepl-eval. Use this when you need to test code, check if edited files compile, verify function behavior, or interact with a running REPL session.
Install
mkdir -p .claude/skills/clojure-eval && curl -L -o skill.zip "https://mcp.directory/api/skills/download/5790" && unzip -o skill.zip -d .claude/skills/clojure-eval && rm skill.zipInstalls to .claude/skills/clojure-eval
About this skill
Clojure REPL Evaluation
When to Use This Skill
Use this skill when you need to:
- Verify that edited Clojure files compile and load correctly
- Test function behavior interactively
- Check the current state of the REPL
- Debug code by evaluating expressions
- Require or load namespaces for testing
- Validate that code changes work before committing
How It Works
The 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.
Instructions
0. Discover and select nREPL server
First, discover what nREPL servers are running in the current directory:
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: Prompt user to select which nREPL port to use:
- question: "Which nREPL port would you like to use?"
- header: "nREPL Port"
- options: Present each discovered port as an option with:
- label: The port number
- description: The server type and status (e.g., "Clojure nREPL server in current directory")
- Include up to 4 discovered ports as options
- The user can select "Other" to enter a custom port number
-
If no ports are discovered: Prompt user how to start an nREPL server:
- question: "No nREPL servers found. How would you like to start one?"
- header: "Start nREPL"
- options:
- label: "deps.edn alias", description: "Find and use an nREPL alias in deps.edn"
- label: "Leiningen", description: "Start nREPL using 'lein repl'"
- The user can select "Other" for alternative methods or if they already have a server running on a specific 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.
1. Evaluate Clojure Code
Evaluation automatically connects to the given port
Use the -p flag to specify the port and pass your Clojure code.
Recommended: Use heredoc via stdin to avoid shell escaping issues. The single-quoted delimiter (<<'EOF') passes all characters through literally.
clj-nrepl-eval -p <PORT> <<'EOF'
(+ 1 2 3)
EOF
For multiple expressions:
clj-nrepl-eval -p <PORT> <<'EOF'
(def x 10)
(+ x 20)
EOF
2. Display nREPL Sessions
Discover all nREPL servers in current directory:
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:
clj-nrepl-eval --connected-ports
Shows only connections you have made before (appears after first evaluation on a port).
3. Common Patterns
Require a namespace (always use :reload to pick up changes):
clj-nrepl-eval -p <PORT> "(require '[my.namespace :as ns] :reload)"
Test a function after requiring:
clj-nrepl-eval -p <PORT> "(ns/my-function arg1 arg2)"
Check if a file compiles:
clj-nrepl-eval -p <PORT> "(require 'my.namespace :reload)"
Multiple expressions:
clj-nrepl-eval -p <PORT> "(def x 10) (* x 2) (+ x 5)"
Complex multiline code:
clj-nrepl-eval -p <PORT> <<'EOF'
(def x 10)
(* x 2)
(+ x 5)
EOF
With custom timeout (in milliseconds):
clj-nrepl-eval -p <PORT> --timeout 5000 "(long-running-fn)"
Reset the session (clears all state):
clj-nrepl-eval -p <PORT> --reset-session
clj-nrepl-eval -p <PORT> --reset-session "(def x 1)"
Available Options
-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 message
Important Notes
- Prefer heredoc via stdin: Use
clj-nrepl-eval -p <PORT> <<'EOF' ... EOFto avoid shell escaping issues - Sessions persist: State (vars, namespaces, loaded libraries) persists across invocations until the nREPL server restarts.
--reset-sessiononly resets the nREPL session (clearing dynamic vars like*e,*1), notdef'd vars or loaded namespaces - Automatic delimiter repair: The tool automatically repairs missing or mismatched parentheses
- Always use :reload: When requiring namespaces, use
:reloadto pick up recent changes - Default timeout: 2 minutes (120000ms) - increase for long-running operations
- Input precedence: Command-line arguments take precedence over stdin
Typical Workflow
- Discover nREPL servers:
clj-nrepl-eval --discover-ports - Use AskUserQuestion tool to prompt user to select a port
- Require namespace:
clj-nrepl-eval -p <PORT> "(require '[my.ns :as ns] :reload)" - Test function:
clj-nrepl-eval -p <PORT> "(ns/my-fn ...)" - Iterate: Make changes, re-require with
:reload, test again
You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
fastapi-templates
wshobson
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
Related MCP Servers
Browse all serversEasily convert markdown to PDF using Markitdown MCP server. Supports HTTP, STDIO, and SSE for fast converting markdown t
Unlock AI-ready web data with Firecrawl: scrape any website, handle dynamic content, and automate web scraping for resea
Build persistent semantic networks for enterprise & engineering data management. Enable data persistence and memory acro
Browser Use lets LLMs and agents access and scrape any website in real time, making web scraping and web page scraping e
Enhance software testing with Playwright MCP: Fast, reliable browser automation, an innovative alternative to Selenium s
Use Chrome DevTools for web site test speed, debugging, and performance analysis. The essential chrome developer tools f
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.