
from clj-surgeon24
A babashka CLI toolbox for structural edits on Clojure/ClojureScript: extract forms, reorder, rename namespaces, merge/split CLJC, and analyze deps and extracts
clj-surgeon is a babashka-based CLI tool and skill for structural operations on Clojure/ClojureScript code. It performs AST-aware edits such as extracting forms to a new namespace, fixing unnecessary declares, reordering definitions, topological sorting, and deterministic CLJ/CLJS ↔ CLJC merges and splits. The tool is designed for safe, test-driven edits: destructive operations have ! variants and users are advised to run tests after changes.
Use clj-surgeon when you need to perform reliable, large-scale refactors or surgical edits in Clojure code: before reading a very large file (use :ls to orient), when extracting code to a new namespace, when resolving declare issues, or when merging CLJ and CLJS sources into a single CLJC. Typical triggers: "extract forms", "fix declares", "cljc-merge", "ls-deps", or preparing a file for extraction.
Agents that can run local CLIs and shell commands (Claude Code, local automation agents, CI scripts) will benefit most. The tool expects a POSIX environment with babashka installed.
This skill has not been reviewed by our automated audit pipeline yet.