Skip to main content

clojure-debug

Use when a Clojure, ClojureScript, or ClojureDart program, REPL evaluation, build, or test fails with an error: a stack trace, an exception, a compiler or macroexpansion error, or `ex-info` data in output. Triggers: "Syntax error compiling", "Syntax error macroexpanding", "Syntax error reading source", "Execution error", "Error printing return value", "Unable to resolve symbol", "Could not locate ... on classpath", "did not conform to spec", "Full report at", `ExceptionInfo`, `CompilerException`, `ex-data`, `ex-cause`, `*e`, a `NullPointerException` or `ClassCastException` in Clojure code, or a failing test that reports an error rather than a failed assertion. Covers keeping the original evidence, separating the error phase and wrapper exceptions from the root cause, reading `ex-data`, finding the first application frame, reproducing the failure, and verifying a focused fix.

v1.0.0New

Unsigned, install at your own risk

Unverified

This skill has no cryptographic signature attached. We can't verify the contents match what the publisher intended.

Install this skill

No account required. Pick your tool, or use the command that detects it for you.

Run in your terminal. It detects your AI tool.

npx @skills-hub-ai/cli install clojure-brackendev-clojure-debug
Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/clojure-brackendev-clojure-debug/SKILL.md

Setup guide →
0Save

Instructions

Clojure Debugging

This skill covers finding the cause of a Clojure family error. The procedure applies on every host. The host notes at the end point to the host skills for error formats and tools.

Key Rules

  1. Keep the original evidence. Save the full error output before changing anything, for example with 2>&1 | tee /tmp/error.log. A rerun after an edit can produce a different error and erase the first one.
  2. Find the phase before the cause. A Clojure error happens while reading source, while expanding a macro, while compiling, or while executing. Each phase has different causes, so a fix that suits one phase does not suit another.
  3. Read the whole cause chain. An exception can wrap another exception. The outermost message often describes where the error surfaced, and the innermost cause describes what went wrong. Read every message and every ex-data map in the chain before deciding.
  4. Start from the first frame in the project's own code. Stack traces are dominated by clojure.core, the compiler, and library frames. The first frame in a project namespace is where to start reading, though the defect can still be in the data that reached it.
  5. Reproduce before fixing. Reproduce the failure with the smallest call that shows it: one REPL evaluation, one test, or one command. A fix that cannot be shown to change the reproduction is a guess.
  6. Change one thing, then rerun the reproduction. Confirm the original error is gone and no new error appeared, then run the surrounding tests.
  7. Report what the evidence shows. Separate what the error output proves from what you infer, and do not describe a hypothesis as the cause until the reproduction confirms it.

Error phases

A Clojure error happens in one of these phases:

  • Read. The reader cannot parse the source, usually because of unbalanced delimiters or an invalid literal.
  • Macroexpansion. A macro call has the wrong shape, for example an odd number of let bindings, or the macro itself threw while expanding.
  • Compile. A symbol cannot be resolved, often because of a missing :require or :refer, a typo, or a use before definition.
  • Execution. The code ran and threw. The location in the message is where the error surfaced, not necessarily where the defect is.
  • Printing. At a REPL, the expression returned, and the error came while printing the result. A common cause is a lazy sequence that is realized only when printed, and then the defect is in the code that produced the sequence. JVM Clojure reports this phase as "Error printing return value".

The host's error format names the phase. The host notes below say where to read it. The messages this skill's description quotes, such as "Syntax error compiling", "Execution error", and "Full report at", are the JVM Clojure format, and NullPointerException and ClassCastException are JVM exception types. cljs.main runs its compiler on the JVM and reports compiler errors in the same format, as in "Unexpected error (ExceptionInfo) compiling at (REPL:1)." ClojureDart reports a compiler error as "Compilation error" followed by sections such as "Faulty subform and/or expansion".

Inspecting exceptions

These functions exist on every Clojure host:

(ex-message e)  ; the message
(ex-data e)     ; the data map of an ex-info exception, or nil
(ex-cause e)    ; the wrapped exception, or nil

Walk the chain with ex-cause until it returns nil, and read ex-message and ex-data at every level:

(->> e (iterate ex-cause) (take-while some?) (map (juxt ex-message ex-data)))

When the code throws its own errors, use ex-info with a data map that names the inputs that failed, and pass the original exception as the third argument when rethrowing so the chain keeps the root cause.

Host notes

  • JVM Clojure. clojure-jvm/references/debugging.md in the clojure-jvm skill covers the Clojure CLI error format and its phases, the "Full report at" file, *e and Throwable->map, classpath errors, and the common JVM exception types.
  • ClojureScript. Compiler errors and warnings come from the build tool (shadow-cljs, figwheel-main, or cljs.main). Runtime errors appear in the browser console or the node output, and source maps map their frames back to ClojureScript. The clojurescript skill covers source maps and catch :default.
  • ClojureDart. Compiler dynamic warnings exit with status 0 but signal type problems. The clojuredart skill's Gotchas describe how to tell an inference failure from a resolution failure.
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

More from Clojure Skills (brackendev)

View source →
clj-fixFix a Clojure project with lint, format, test, and dry (duplicate-form) steps. Applies safe lint fixes and formatting by default. Use when asked to lint, format, test, or check a Clojure project, or to fix clj-kondo warnings or cljfmt formatting in Clojure code. For ClojureScript, Electric, Fulcro, ClojureDart, and Babashka projects, prefer /cljs-fix, /electric-fix, /fulcro-fix, /cljd-fix, or /bb-fix when installed. Use --report to preview the lint and format changes without writing.0 installsclj-smells-fixFix Clojure code against the clj-smells catalog of Clojure-specific code smells. Auto-applies Stage 1 mechanical findings and Stage 2 DEFECT-tier findings, and reports SMELL and HINT findings. Use when asked to find or fix Clojure code smells, or to fix namespace problems such as `:refer :all`, `:use`, or unused requires. Use --report to disable writes.0 installsclojure-replUse when evaluating Clojure, ClojureScript, or ClojureDart code in a running REPL: checking how a function behaves, reproducing a bug interactively, reloading a changed namespace, inspecting live application state, or running a test namespace from the REPL. Triggers: nREPL, `.nrepl-port`, `.shadow-cljs/nrepl.port`, `clj-nrepl-eval`, clojure-mcp, `clojure_eval`, `list_nrepl_ports`, `shadow/repl`, the ClojureDart socket REPL, `:reload`, "try it in the REPL", "evaluate this", or REPL-driven development. Covers finding and verifying the right REPL, choosing a client, evaluating small forms with bounded output, reloading, and confirming REPL results against the saved source.0 installsclojureUse when writing, editing, reviewing, or discussing Clojure family code. Triggers: .clj, .cljs, .cljc, and .cljd files; deps.edn projects; shadow-cljs.edn; bb.edn; project.clj; build.clj; clojure.test, cljs.test, cljd.test; clojure.core forms (`defn`, `let`, `ns`, threading macros, destructuring, multimethods, protocols, transducers, specs, atoms); REPL usage; or any mention of Clojure, ClojureScript, ClojureDart, or a Clojure dialect. Covers idiomatic style, naming conventions, threading macros, collection idioms, atom-based state, dispatch, formatting, namespaces, and common anti-patterns.0 installsclojure-depsUse when choosing, checking, or researching a dependency of a Clojure, ClojureScript, or ClojureDart project: which version the project uses, what the latest release is, whether a newer version is compatible, or how a library's API works in the installed version. Triggers: `deps.edn` `:deps` and `:extra-deps` coordinates, `:mvn/version`, `:git/tag`, `:git/sha`, `project.clj` `:dependencies`, `shadow-cljs.edn` `:dependencies`, Clojars, Maven Central, cljdoc, `find-versions`, "latest version of", "which version", "is this outdated", "add a library", or "how do I use" a Clojure library. Covers reading the resolved version, finding source and documentation for that exact version, looking up releases, and separating the latest release from a compatible one.0 installs

More Build skills

Browse category →
senior-frontendBuild and review React, Next.js, TypeScript or Tailwind frontends: components, scaffolding, performance and bundle size. Use whenever the user wants a new component or app, a page feels slow, the bundle is too big, or asks for a frontend code review.635 installsui-design-systemUse when building a design system: tokens, component docs, responsive scales or developer handoff. Generates tokens with design_token_generator.py.535 installsfrontend-designGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.346 installssenior-backendBuild and fix backend services: REST or GraphQL APIs, auth, microservices, PostgreSQL queries, migrations and load tests. Use whenever the user's API is slow or broken, needs login or auth added, a schema change, or a new endpoint or service scaffolded.246 installsself-improving-agentCurate what the agent has learned into durable project knowledge. Reviews Claude Code auto-memory (MEMORY.md and its topic files) for learnings worth keeping, promotes proven ones into CLAUDE.md or .claude/rules/, records a correction as a lesson that persists across sessions, prunes stale or duplicate entries, and turns a recurring fix into a reusable skill. Use whenever the user asks what you have learned or saved about the project, which memories should become permanent rules, to remember a lesson or stop repeating a mistake, or to clean up, audit or check memory health.173 installsusing-superpowersUse when starting any conversation - establishes how to find and use skills, requiring skill invocation before ANY response including clarifying questions145 installs

Frequently asked questions about clojure-debug

What does the clojure-debug skill do?

Use when a Clojure, ClojureScript, or ClojureDart program, REPL evaluation, build, or test fails with an error: a stack trace, an exception, a compiler or macroexpansion error, or `ex-info` data in output. Triggers: "Syntax error compiling", "Syntax error macroexpanding", "Syntax error reading source", "Execution error", "Error printing return value", "Unable to resolve symbol", "Could not locate ... on classpath", "did not conform to spec", "Full report at", `ExceptionInfo`, `CompilerException`, `ex-data`, `ex-cause`, `*e`, a `NullPointerException` or `ClassCastException` in Clojure code, or a failing test that reports an error rather than a failed assertion. Covers keeping the original evidence, separating the error phase and wrapper exceptions from the root cause, reading `ex-data`, finding the first application frame, reproducing the failure, and verifying a focused fix. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the clojure-debug skill?

Run `npx @skills-hub-ai/cli install clojure-brackendev-clojure-debug` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/clojure-brackendev-clojure-debug/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does clojure-debug work with?

clojure-debug runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the clojure-debug skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use clojure-debug after installing it?

In Claude Code, type `/clojure-brackendev-clojure-debug` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the clojure-debug skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.