Get the FREE Ultimate OpenClaw Setup Guide →

asdf-runtime-version-updater

Scanned
npx machina-cli add skill tylercannon/agent-skills/asdf-runtime-version-updater --openclaw
Files (1)
SKILL.md
4.5 KB

ASDF Runtime Version Updater

Update language runtime versions consistently across your project.

Workflow

  1. Parse current versions - Read .tool-versions to get current runtime versions
  2. Find latest version - Run asdf latest <runtime> to get the latest available version
  3. Update .tool-versions - Update the version in .tool-versions
  4. Install new version - Run asdf install to install the runtime
  5. Find version references - Search for files referencing the old version
  6. Update all references - Update versions consistently across all files
  7. Verify project - Install deps, build, format check, and run tests

Version Lookup

# Get latest version for a runtime
asdf latest nodejs      # e.g., 22.13.1
asdf latest python      # e.g., 3.13.2
asdf latest ruby        # e.g., 3.4.2
asdf latest elixir      # e.g., 1.19.5-otp-28
asdf latest erlang      # e.g., 28.3.1

File Patterns

.tool-versions Format

nodejs 22.13.1
python 3.13.2
ruby 3.4.2
elixir 1.19.5-otp-28
erlang 28.3.1

Dockerfile Patterns

# Node.js
FROM node:22.13.1-alpine
FROM node:22-alpine

# Python
FROM python:3.13.2-slim
FROM python:3.13-slim

# Ruby
FROM ruby:3.4.2-alpine

# Elixir (often uses erlang base)
FROM elixir:1.19.5-otp-28
FROM hexpm/elixir:1.19.5-erlang-28.3.1-alpine-3.21.0

Dockerfile ARG Patterns

Some Dockerfiles use ARG for version configuration:

ARG ELIXIR_VERSION=1.19.5
ARG OTP_VERSION=28.3.1
ARG DEBIAN_VERSION=trixie-20260112-slim

ARG BUILDER_IMAGE="docker.io/hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}"

Search for these patterns:

grep -E "^ARG\s+(ELIXIR|OTP|ERLANG|NODE|PYTHON|RUBY)_VERSION=" Dockerfile*

GitHub Workflows (.github/workflows/*.yml)

# Node.js
- uses: actions/setup-node@v4
  with:
    node-version: '22.13.1'
    node-version-file: '.tool-versions'

# Python
- uses: actions/setup-python@v5
  with:
    python-version: '3.13.2'

# Ruby
- uses: ruby/setup-ruby@v1
  with:
    ruby-version: '3.4.2'

# Elixir
- uses: erlef/setup-beam@v1
  with:
    elixir-version: '1.19.5'
    otp-version: '28.0'

GitHub Workflow Job Containers

Jobs can also specify container images directly:

jobs:
  test:
    runs-on: ubuntu-latest
    container:
      image: hexpm/elixir:1.19.5-erlang-28.3.1-alpine-3.23.3
    
  build:
    runs-on: ubuntu-latest
    container: node:22.13.1-alpine

Search for these patterns:

grep -rE "^\s*(image:|container:)" .github/workflows/

Other Version Files

RuntimeFiles
Node.js.nvmrc, .node-version, package.json (engines, @types/node)
Python.python-version, pyproject.toml, setup.py
Ruby.ruby-version, Gemfile

Search Patterns

Use these patterns to find version references:

# Find version references in project
grep -r "22.13.1" .             # Specific version
grep -rE "node[:-]?22" .         # Node.js major version patterns
grep -rE "python[:-]?3\.13" .    # Python minor version patterns

Example Update

Before (.tool-versions):

elixir 1.18.0-otp-27
erlang 27.2.4

Steps:

# Check latest versions
asdf latest elixir  # 1.19.5-otp-28
asdf latest erlang  # 28.3.1

# Update .tool-versions, then:
asdf install

After (.tool-versions):

elixir 1.19.5-otp-28
erlang 28.3.1

Then update all other files (Dockerfile, GitHub workflows, etc.) to match.

Verification

After updating versions, verify the project still works:

Elixir/Phoenix

mix deps.clean --all
mix deps.get
mix compile --warnings-as-errors
mix format --check-formatted
mix test

Node.js

npm install
npm run build
npm run lint
npm test

Python

pip install -e ".[dev]"
python -m build
ruff check .
pytest

Ruby

bundle install
bundle exec rake build
bundle exec rubocop
bundle exec rspec

Go

go mod download
go build ./...
go fmt ./...
go test ./...

Resources

For detailed patterns per runtime, see runtime-patterns.md.

Source

git clone https://github.com/tylercannon/agent-skills/blob/main/skills/asdf-runtime-version-updater/SKILL.mdView on GitHub

Overview

asdf-runtime-version-updater harmonizes runtime versions across your project by updating .tool-versions and propagating changes to Dockerfiles, GitHub Actions workflows, and other version-referencing files. It reads current versions, fetches the latest with asdf latest, applies updates, installs the new runtimes, and verifies the project by building and running tests.

How This Skill Works

The tool parses .tool-versions to capture current runtimes, runs asdf latest for each runtime to get the newest version, updates .tool-versions, and executes asdf install to install the updates. It then scans repository files for references to old versions (Dockerfiles, workflows, and other version files) and updates them consistently, finally verifying the result by installing dependencies, building, formatting, and running tests.

When to Use It

  • Updating a project's language runtime version(s).
  • Synchronizing versions across .tool-versions, Dockerfiles, and CI/CD configs.
  • Migrating to a new runtime version across multiple services.
  • Preparing a release with harmonized runtime versions.
  • Auditing and harmonizing runtime references in Dockerfiles, workflows, and other files.

Quick Start

  1. Step 1: Parse current versions from .tool-versions.
  2. Step 2: Use asdf latest to fetch the newest versions, update .tool-versions, and run asdf install.
  3. Step 3: Find and update all references in Dockerfiles, GitHub Workflows, and other version files, then verify by installing dependencies, building, and running tests.

Best Practices

  • Test the updated runtime in a local or dev environment before committing.
  • Run asdf install after updating .tool-versions to verify the new version installs cleanly.
  • Search broadly for version references (Dockerfiles, ARGs, workflows, and other version files) and update them consistently.
  • Review diffs and add a descriptive commit message explaining the runtime changes.
  • Run full verification: install dependencies, build, format check, and tests to confirm nothing regresses.

Example Use Cases

  • Update Node.js from 22.13.0 to 22.13.1 across a Node app, Dockerfile, and GH actions.
  • Synchronize Python 3.13.2 across .tool-versions, Dockerfile, and workflows in a Django project.
  • Migrate Elixir from 1.19.3 to 1.19.5-otp-28 in a monorepo with multiple services.
  • Upgrade Ruby 3.4.0 to 3.4.2 in Rails app, Docker images, and CI workflows.
  • Harmonize Erlang version across toolchain and workflows in a microservices project.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers