setup-asdf
Skill0 starsChanged 2 months agoMITView on GitHub
Install and configure asdf (v0.16+) and the workspace's toolchains for the current machine. Ensures asdf is present, installs/updates the blessed plugins, wires shims onto PATH idempotently, and runs `asdf install` against .tool-versions. Use when onboarding a machine, when `asdf`/a toolchain is missing, or when `make setup` reports asdf is not configured.
- Installs packages
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-projectSkill
- setup-beadsSkill
- setup-homebrewSkill
- setup-projectsSkill
- update-workspaceSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Every workspace has all of these asdf plugins installed (adding a plugin is cheap — it just registers where to fetch versions from):
- Distinctive: line 85
Use this marker so re-runs are idempotent — if the block already exists, leave it (or replace it), never append a duplicate:
- Very specific: line 96
Check first: grep -q 'managed by /setup-asdf' <rc> — only write if absent.
- Very specific: line 107
If any is absent, pin the latest stable (skip free-threaded …t python builds.
- Distinctive: line 116
Only pin when missing — never bump an existing pin unless the user asks.
- Very specific: line 138
Never downgrade to classic asdf or source an asdf.sh — this is v0.16+ only.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Set up asdf for this workspace
asdf is a hard requirement for every agent workspace: node, pnpm, python, uv, go, ruby, and rust are all managed through it. This skill provisions asdf and the workspace's toolchains on the current machine.
You are an agent running this end-to-end. Inspect state at each step, adapt to the OS/shell, and debug failures yourself rather than handing them back to the user. Work through the steps in order; each depends on the previous.
Blessed plugin set
Every workspace has all of these asdf plugins installed (adding a plugin is cheap — it just registers where to fetch versions from):
| Tool | asdf plugin name |
| Node.js | nodejs |
| pnpm | pnpm |
| Python | python |
| uv | uv |
| Go | golang |
| Ruby | ruby |
| Rust | rust |
python, uv, and nodejs are given a version (installed) in every
workspace — nodejs because npx drives external skill management (see
docs/adr/0002). The rest are added as plugins but only installed in a
workspace that pins a version in its .tool-versions.
Steps
0. Prerequisite: Homebrew
asdf is installed via Homebrew, which is a hard requirement on the same level as
asdf. If brew is missing, run /setup-homebrew first, then continue here.
1. Ensure asdf v0.16+ is installed
Require the Go-rewrite era (v0.16+); classic shell-based asdf is not supported.
asdf --version # expect v0.16.0 or newer- Missing →
brew install asdf. - Present but < v0.16 →
brew upgrade asdf. Do not try to make classic (git-cloned, shell-sourced) asdf work; if that's what's installed, remove it and install via brew.
(Homebrew always ships current asdf, so brew is the single install path.)
Note the data dir: ASDF_DATA_DIR (default ~/.asdf). Shims live in
$ASDF_DATA_DIR/shims.
2. Ensure all blessed plugins are present and current
For each plugin in the blessed set: add it if missing, update it if present.
for p in nodejs pnpm python uv golang ruby rust; do
asdf plugin list | grep -qx "$p" && asdf plugin update "$p" || asdf plugin add "$p"
doneReport which were added vs updated. If a plugin add fails (network, missing build deps), surface the specific error and the fix (e.g. python needs build dependencies on some Linux distros) rather than silently skipping.
3. Wire shims onto PATH (idempotent, marker-guarded)
On v0.16+ there is no asdf.sh to source. Put $ASDF_DATA_DIR/shims on
PATH in the user's shell rc, exactly once.
- Detect the shell and target rc file:
zsh→~/.zshrcbash→~/.bashrc(also ensure it's sourced from~/.bash_profileon macOS login shells)fish→~/.config/fish/config.fish(usefish_add_path)
Use this marker so re-runs are idempotent — if the block already exists, leave it (or replace it), never append a duplicate:
# >>> asdf shims — managed by /setup-asdf >>> export ASDF_DATA_DIR="${ASDF_DATA_DIR:-$HOME/.asdf}" export PATH="$ASDF_DATA_DIR/shims:$PATH" # <<< asdf shims — managed by /setup-asdf <<<(fish equivalent:
set -gx ASDF_DATA_DIR $HOME/.asdf; fish_add_path $ASDF_DATA_DIR/shims.)- Check first:
grep -q 'managed by /setup-asdf' <rc>— only write if absent. - Also export for the current session so the next steps work without a new
shell:
export ASDF_DATA_DIR="${ASDF_DATA_DIR:-$HOME/.asdf}" export PATH="$ASDF_DATA_DIR/shims:$PATH"
4. Pin python + uv if missing, then install
The workspace .tool-versions should already pin python, uv, and nodejs.
If any is absent, pin the latest stable (skip free-threaded …t python builds;
prefer the current nodejs LTS):
grep -q '^python ' .tool-versions || asdf set python "$(asdf latest python)"
grep -q '^uv ' .tool-versions || asdf set uv "$(asdf latest uv)"
grep -q '^nodejs ' .tool-versions || asdf set nodejs "$(asdf latest nodejs)"Only pin when missing — never bump an existing pin unless the user asks.
Then install everything the workspace declares:
asdf install # reads .tool-versions, installs each pinned version
asdf reshim5. Verify
asdf which python && python --version
asdf which uv && uv --versionConfirm the shims resolve. If python/uv aren't found, the PATH step didn't
take effect in this session — re-check step 3. Then hand back to onboarding
(typically: run make setup for the mechanical steps).
Rules
- Never downgrade to classic asdf or source an
asdf.sh— this is v0.16+ only. - Edit exactly one rc file, guarded by the marker; keep it idempotent.
- Adding plugins is universal; installing versions is driven solely by
.tool-versions. - On any failure, diagnose and fix in place — you're the agent, not the user.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

