Skip to content

Instantly share code, notes, and snippets.

@dcj
Created March 22, 2026 20:16
Show Gist options
  • Select an option

  • Save dcj/7fda34341c40ac71d7e08bcce7f82aac to your computer and use it in GitHub Desktop.

Select an option

Save dcj/7fda34341c40ac71d7e08bcce7f82aac to your computer and use it in GitHub Desktop.
Claude Code /deps-docs skill — browse Clojure dependency docs embedded in JARs

Browse dependency documentation embedded in Clojure library JARs

Query Markdown API documentation that libraries embed in their JARs via codox-md. Requires a running nREPL connection (via clojure-mcp) with io.github.dcj/clj-doc-browse on the classpath.

Arguments

Optional: a namespace name, library name, search query, or the word setup.

  • No args: list all libraries with embedded docs
  • Namespace name (e.g. mdns.core): show API docs for that namespace
  • Library name (e.g. energy.grid-coordination/clj-mdns): list namespaces in that library
  • search <query>: full-text search across all docs
  • setup: add clj-doc-browse to the current project's :nrepl alias and add a "Dependency Documentation" section to the project's CLAUDE.md

How to execute

If argument is setup

  1. Read the project's deps.edn
  2. Add io.github.dcj/clj-doc-browse {:mvn/version "0.1.0"} to the :nrepl alias :extra-deps (create the key if needed, don't duplicate if already present)
  3. Read the project's CLAUDE.md (via shadow repo symlink or directly)
  4. If it doesn't already contain "doc.browse", append this section:
## Dependency Documentation
This project has `doc.browse` on the REPL classpath. When you need to understand
a dependency's API, use the nREPL to query embedded docs:
- `(require '[doc.browse :as docs])`
- `(docs/libraries)` — list deps that have embedded docs
- `(docs/show "namespace.name")` — read API docs for a namespace
- `(docs/search "query")` — search across all docs
Prefer this over web search or guessing at APIs.
  1. Tell the user to restart their nREPL to pick up the new dep.

If no argument (list libraries)

Use the clojure-mcp eval tool to run:

(do (require 'doc.browse) (doc.browse/libraries))

Display the results to the user. If eval fails with "Could not locate doc/browse", tell the user to run /deps-docs setup first.

If argument looks like a namespace (contains dots, no slash)

Use the clojure-mcp eval tool to run:

(do (require 'doc.browse) (doc.browse/show "<namespace>"))

Display the returned Markdown content. This is especially useful when YOU (the AI assistant) need to understand a dependency's API while working on code. Read the returned docs carefully to understand available functions, arglists, and behavior.

If argument looks like a library (contains a slash)

Use the clojure-mcp eval tool to run:

(do (require 'doc.browse) (doc.browse/namespaces "<library>"))

Display the list of documented namespaces.

If argument starts with search

Extract the query (everything after search ), then use the clojure-mcp eval tool to run:

(do (require 'doc.browse)
    (doc.browse/search "<query>"))

Display the search results.

When to use proactively

When working on a Clojure project and you need to understand how a dependency works:

  1. First check if doc.browse is available: try (require 'doc.browse) via eval
  2. If available, use (doc.browse/show "the.namespace") to read the API docs
  3. This is faster and more reliable than web search or relying on training data
  4. Especially useful for the user's own libraries (energy.grid-coordination/, io.github.dcj/) which may not be in your training data

ARGUMENTS: $ARGUMENTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment