Skip to content
Back to skills

Clojure Deps

BSecurity

Clojure CLI and deps.edn — use when adding a dependency, library, or alias, choosing -M/-X/-T exec modes, inspecting the classpath or dependency tree, or building a jar or uberjar with tools.build.

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentsjavabashtestinggitapi

Works with

  • cli
  • api

Security analysis

B85/100
  • highPerforms destructive filesystem operations

Pro scans all 8 files and shows the line behind each finding

Scanned December 3, 2026

npx -y skills add just-sultanov/clojure-skills --skill clojure-deps --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Clojure Deps?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Clojure Deps
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/just-sultanov-clojure-deps/badge)](https://www.skillsdirectory.com/skills/just-sultanov-clojure-deps)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: clojure-deps
description: Clojure CLI and deps.edn — use when adding a dependency, library, or alias, choosing -M/-X/-T exec modes, inspecting the classpath or dependency tree, or building a jar or uberjar with tools.build.
license: EPL-1.0
---

# Clojure Deps

Owns `deps.edn`, the Clojure CLI, `tools.deps`, and `tools.build`: coordinates,
aliases, exec modes, tool invocation, classpath inspection, and artifact
builds. Version gates and JDK upgrades live in `clojure-versions`; tool
installation and format/lint configuration live in `clojure-tooling`; a running
REPL and `add-lib` live in `clojure-repl`. The text is adapted from the Clojure
site, `tools.deps`, and `tools.build` under EPL 1.0; see [NOTICE.md](NOTICE.md).

## Ground rules

- **The CLI owns the classpath.** Declare paths and coordinates; let `clj`
  resolve, download, and cache. Never hand-assemble a classpath for a build,
  and never commit `.cpcache/`.
- **An alias is data with one purpose.** One alias per task, one exec mode per
  invocation. Do not hide a `-main` in an alias you also call with `-X`.
- **The project is the source of truth.** Read its `deps.edn`, build script,
  and CI before changing anything; match its CLI version and alias names.

## Workflow

### 1. Read the dependency environment

Read the project `deps.edn`, the user `deps.edn` when it affects the run,
`build.clj`, and every CI job that runs `clj`. List the paths, direct deps,
aliases, exec modes, and the entry point of each alias. Note the CLI version
from `clj --version`.

Done when you can state, for each command the project runs, its alias, exec
mode, entry point, and resolved lib list.

### 2. Add or change a coordinate

Choose the procurer from the source of the lib: `:mvn/version` for a published
artifact, `:git/tag` plus `:git/sha` (or a full `:git/sha`) for source, and
`:local/root` for a sibling directory or jar. Add it to `:deps` for the project
or to an alias's `:extra-deps` for an optional use, then inspect:

```bash
clj -Stree                              # every selected version
clj -X:deps tree :aliases '[:test]'     # tree with an alias applied
```

The coordinate types and their settings are in
[deps-edn.md](references/deps-edn.md).

Done when `-Stree` shows the intended version with no unexplained duplicate,
and the lib appears in `clj -Spath`.

### 3. Add or change an alias

Pick the exec mode first, then the keys that mode reads: `:extra-deps`,
`:extra-paths`, `:jvm-opts`, and `:main-opts` for `-M`; `:exec-fn`,
`:exec-args`, and `:ns-default` for `-X`; a self-contained `:deps` plus
`:ns-default` for a `-T` build. Read [cli.md](references/cli.md) for the exec
modes and [deps-edn.md](references/deps-edn.md) for the merge rules.

Done when the alias runs the intended entry point from the project root after
`rm -rf .cpcache`, and a second alias applied with it does not silently change
the entry point.

### 4. Inspect the classpath and resolution

Use `-Spath` for the final classpath, `-Stree` for selection, `-X:deps list`
for libs and licenses, `-X:deps find-versions` for available versions,
`-Sverbose` for the config and cache directories, and `-Strace` when the tree
does not explain a choice. Read
[troubleshooting.md](references/troubleshooting.md) when a version, path, or
repository is not what you expect.

Done when you can point to the classpath entry or the tree edge that supplies
each namespace the program requires.

### 5. Build artifacts

Write or extend `build.clj` with `clean`, `jar`, and, for an application,
`uber`. Keep the version in one place: a var, `git-count-revs`, or the CI tag.
Assemble the class dir with `copy-dir`, write `pom.xml` with `write-pom`, and
package with `jar` or `uber`. Read [build.md](references/build.md) for the
recipes.

Done when `clj -T:build jar` (and `uber`) builds from a clean checkout, the jar
carries `pom.xml` and sources, and `java -jar` starts the application jar.

### 6. Wire CI

Run the same commands with a pinned CLI version: prepare deps with
`clj -P -M:test`, run tests, then build. Cache `~/.m2/repository` and
`~/.gitlibs`, upload the jar or uberjar, and never run a `fix` or an
interactive command. Read [cli.md](references/cli.md) for the option order.

Done when a clean CI run produces the same artifact as the local command, and
the log shows the pinned CLI version.

## Checklist

- [ ] Every coordinate has exactly one procurer and a version or sha.
- [ ] Every git coordinate names a tag plus sha or a full sha.
- [ ] Every alias has one purpose and one exec mode.
- [ ] `clj -Stree` shows the intended versions with no unexplained duplicate.
- [ ] `clj -Spath` includes every path and lib the program requires.
- [ ] The project runs after `rm -rf .cpcache`.
- [ ] `build.clj` has `clean` and `jar`; an application also has `uber`.
- [ ] The jar carries `pom.xml`; the uberjar starts with `java -jar`.
- [ ] `.cpcache/`, `target/`, and `classes/` are ignored.
- [ ] CI pins the CLI version and runs the same commands as local.

## Related skills

- `clojure-versions` — which release first has a form or API, the
  `invoke-tool` 1.12 gate, the JDK baseline, and the upgrade procedure.
- `clojure-testing` — the `:test` alias recipes and runner choice; this
  skill owns the alias mechanics, the classpath, and the CI sequence.
- `clojure-tooling` — installing and pinning cljfmt, clj-kondo, and
  clojure-lsp, and the alias recipes that run them.
- `clojure-repl` — starting or connecting a REPL, reloading namespaces, and
  `add-lib`/`add-libs`/`sync-deps`.
- `clojure-style` — naming and layout for the Clojure code the build program
  contains.

## References

| File                                                | Read when                                                     |
| --------------------------------------------------- | ------------------------------------------------------------- |
| [deps-edn.md](references/deps-edn.md)               | choosing a coordinate, alias key, or procurer setting         |
| [cli.md](references/cli.md)                         | choosing an exec mode or CLI option, reading classpath config |
| [tools.md](references/tools.md)                     | installing a tool, invoking one from Clojure, `-T` rules      |
| [build.md](references/build.md)                     | writing `build.clj`, packaging, or computing a version        |
| [troubleshooting.md](references/troubleshooting.md) | a version, path, repository, or cache is not as expected      |

Files in this skill

  • LICENSE11.1 KB
  • NOTICE.md2.4 KB
  • SKILL.md6.4 KB
  • references/build.md7.4 KB
  • references/cli.md7.1 KB
  • references/deps-edn.md7.6 KB
  • references/tools.md4.9 KB
  • references/troubleshooting.md5.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.