clojure-symbols
Clojure Symbols Skill
Use clj-kondo for static analysis and clj-nrepl-eval for REPL introspection to find Clojure symbols.
For non-Clojure languages, use the code-symbols skill instead.
Prerequisites
clj-kondo
# Arch Linux
sudo pacman -S clj-kondo
# Homebrew
brew install borkdude/brew/clj-kondo
# Script
curl -sLO https://raw.githubusercontent.com/clj-kondo/clj-kondo/master/script/install-clj-kondo
chmod +x install-clj-kondo && ./install-clj-kondo
clj-nrepl-eval
Discover running nREPL servers:
clj-nrepl-eval --discover-ports
Quick Reference
| Task | Tool | Command |
|---|---|---|
| List symbols in file | clj-kondo | clj-kondo --lint file.clj --config '{...}' |
| Find definition | clj-kondo | Filter var-definitions by name |
| Find usages | clj-kondo | Filter var-usages by name |
| Get var metadata | REPL | (meta #'ns/var) |
| Get source | REPL | (clojure.repl/source fn) |
Core clj-kondo Commands
Note: JSON keys use hyphens (e.g., var-definitions), so use bracket notation in jq.
Find Symbol Definition
clj-kondo --lint src components bases \
--config '{:output {:format :json}, :analysis {:var-definitions true}}' \
| jq '.analysis["var-definitions"][] | select(.name == "my-function")'
Find Symbol Usages
clj-kondo --lint src components bases \
--config '{:output {:format :json}, :analysis {:var-usages true}}' \
| jq '.analysis["var-usages"][] | select(.name == "my-function")'
List Symbols in File
clj-kondo --lint path/to/file.clj \
--config '{:output {:format :json}, :analysis {:var-definitions true}}' \
| jq '.analysis["var-definitions"]'
Output Fields
var-definitions:
filename,row,col,end-row,end-col- Locationns,name- Identitydefined-by- Defining form (e.g.,clojure.core/defn)fixed-arities,doc,private
var-usages:
from,to- Source and target namespacesname,arity- Symbol name and call arityfrom-var- Containing functionrow,col- Location
Core REPL Commands
# Get var metadata
clj-nrepl-eval -p PORT "(meta #'my.namespace/my-function)"
# Get source code
clj-nrepl-eval -p PORT "(clojure.repl/source my-function)"
# List namespace contents
clj-nrepl-eval -p PORT "(dir my.namespace)"
# Search by pattern
clj-nrepl-eval -p PORT "(clojure.repl/apropos \"pattern\")"
Common Workflow
Find Definition and All Usages
# Find definition
clj-kondo --lint . \
--config '{:output {:format :json}, :analysis {:var-definitions true}}' \
| jq '.analysis["var-definitions"][] | select(.name == "target-fn") | {ns, name, filename, row}'
# Find all usages
clj-kondo --lint . \
--config '{:output {:format :json}, :analysis {:var-usages true}}' \
| jq '.analysis["var-usages"][] | select(.name == "target-fn") | {from, "from-var", filename, row}'
Find Usages of a Namespace
clj-kondo --lint bases components \
--config '{:output {:format :json}, :analysis {:var-usages true}}' \
| jq '.analysis["var-usages"][] | select(.to == "my.namespace") | {from, name, filename, row}'
Additional References
- clj-kondo details: See references/kondo.md for full analysis options
- REPL introspection: See references/repl.md for REPL commands
- Editing/renaming: See references/editing.md for rename workflows
More from brettatoms/agent-skills
alpinejs
AlpineJS best practices and patterns. Use when writing HTML with Alpine.js directives to avoid common mistakes like long inline JavaScript strings.
106janet
Write idiomatic Janet code. Use when writing, refactoring, or reviewing Janet (.janet) code. Covers functional patterns, performance tradeoffs, common gotchas, data structure idioms, PEG parsing, and Janet-specific pitfalls.
10playwright
Browser automation for web testing and interaction. Use for navigating pages, filling forms, clicking elements, taking screenshots, and inspecting page content. Maintains stateful browser session across commands.
9code-symbols
Find and edit symbols in code using ast-grep (tree-sitter based). Use when finding function definitions, class definitions, symbol usages, renaming symbols, or replacing code in JavaScript, TypeScript, Python, Go, Rust, and other languages. NOT for Clojure - use clj-symbols instead.
8browser-tools
Interactive browser automation via Chrome DevTools Protocol. Use when you need to interact with web pages, test frontends, or when user interaction with a visible browser is required.
8github
Work with GitHub using the gh CLI. Use when creating/managing pull requests, reviewing code, managing issues, viewing GitHub Actions runs, creating releases, or making API requests. Triggers on GitHub-related tasks like "create a PR", "list open issues", "check CI status", "merge this PR", or "create a release".
7