AgentSkillsCN

clojure-debug

Clojure/ClojureScript 代码的调试流程。当您在 Clojure/CLJS 代码中遇到意外的测试失败、异常行为,或数据流模糊不清时,可尽早运用此技能。建议在执行路径中尽早插入 `prn` 输出语句,并通过 clojure/node CLI 的 `eval` 功能,对小型假设进行快速验证。

SKILL.md
--- frontmatter
name: clojure-debug
description: Debugging workflow for Clojure/ClojureScript code. Use early on any unexpected test failure, unexpected behavior, or unclear data flow in Clojure/CLJS. Emphasize early insertion of `prn` in the execution path and validating small hypotheses with `clojure/node` CLI `eval`.

Clojure Debug

Core workflow

  • Insert prn (or prn + labels) as early as possible in the suspected execution path.
  • Prefer multiple small prn checkpoints over one large dump.
  • Keep prn output focused on inputs, branch decisions, and key transforms.
  • Remove or guard debug prints after validation.

clojure/node CLI validation

  • Use clojure/node CLI eval to validate small snippets or hypotheses.
  • Keep eval expressions minimal and deterministic.
  • Use it to confirm parsing, coercion, and data-shape assumptions before editing more code.

Tips

  • Favor prn over println to preserve readable EDN.
  • When debugging async flows, print at boundaries: before request, after response, before transform, after transform.
  • Add labels to output to correlate logs with branches.