Skip to content

Add batch install mode with lock file support - #2

Merged
shannah merged 3 commits into
mainfrom
claude/add-skills-versions-file-uQJ7b
Apr 12, 2026
Merged

shannah merged 3 commits into
mainfrom
claude/add-skills-versions-file-uQJ7b

Conversation

@shannah

@shannah shannah commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds batch installation mode to install-skill, allowing users to install multiple skills from a .skills-versions file with reproducible resolution via a .skills-versions.lock file. The CLI now supports two modes: single-skill install (existing behavior) and batch install from a versions file (new).

Key Changes

  • Batch install mode: When invoked with no arguments, install-skill reads .skills-versions from the current directory and installs all listed skills sequentially.

  • Lock file support: A .skills-versions.lock file (JSON format) records resolved Maven coordinates for reproducible installs across machines and CI environments. Subsequent runs reuse locked versions for unchanged entries, only re-resolving new or modified entries.

  • New classes:

    • SkillVersionsFile — Parser for .skills-versions files (one entry per line as name[@version])
    • SkillLockFile — Reader/writer for .skills-versions.lock with hand-rolled JSON serialization (no external dependency)
    • SkillCoordinates — Immutable value class for resolved Maven coordinates
  • Resolution plan computation: SkillLockFile.computeResolutionPlan() compares desired vs. locked state, categorizing entries as reusable, needing re-resolution, or removed.

  • CLI enhancements:

    • Made the skill parameter optional (arity = "0..1")
    • Added --update / -u flag to force re-resolution of all versions, ignoring the lock file
    • Added workingDirectory field for testability
  • Refactored coordinate resolution: Extracted resolveSkillCoordinates() and resolveRegistryName() methods to support both single-skill and batch modes.

  • Comprehensive tests: Added SkillVersionsFileTest, SkillLockFileTest, and integration tests in InstallSkillIT covering batch install, lock reuse, and update scenarios.

  • Documentation: Updated README with usage examples, .skills-versions format, lock file behavior, and added CLAUDE.md for developer guidance.

Implementation Details

  • Lock file uses JSON with a lockVersion field for forward compatibility
  • requestedVersion field in lock entries tracks what was requested (null means latest/RELEASE was requested)
  • Resolution plan reuses locked entries only when requestedVersion matches the current request
  • Hand-rolled JSON parsing avoids adding external dependencies
  • Batch mode preserves file order of entries from .skills-versions

https://claude.ai/code/session_01S2WwJRMhqBfPyeM117hD6J

claude added 3 commits April 12, 2026 12:59
Enable batch skill installation from a declarative .skills-versions file
(similar to asdf's .tool-versions). When install-skill is invoked with no
arguments, it reads .skills-versions from the current directory and installs
all listed skills. A .skills-versions.lock file (JSON) records resolved
versions for reproducible installs, similar to composer.lock.

Key changes:
- Make <skill> positional parameter optional (arity 0..1)
- Add -u/--update flag to force re-resolution ignoring lock file
- Add SkillCoordinates value class for resolved Maven coordinates
- Add SkillVersionsFile parser (.skills-versions format)
- Add SkillLockFile read/write with resolution plan computation
- Refactor InstallSkillCommand: extract resolveSkillCoordinates(),
  installResolved(), installSingleSkill() for reuse in batch flow
- Add installFromVersionsFile() batch install method
- Add unit tests for SkillVersionsFile and SkillLockFile
- Add integration tests for batch install, lock reuse, --update,
  no-arg error, and Maven coordinates in .skills-versions

https://claude.ai/code/session_01S2WwJRMhqBfPyeM117hD6J
Document the full CLI usage including single-skill install, batch install
from .skills-versions, lock file behavior, all CLI options, and examples.
Add CLAUDE.md with architecture overview, key files, method flow, file
formats, build commands, and testing patterns.

https://claude.ai/code/session_01S2WwJRMhqBfPyeM117hD6J
- Test on Java 11 (project target) and Java 17 (current LTS)
- Upgrade actions/checkout and actions/setup-java to v4
- Enable Maven dependency caching for faster builds

https://claude.ai/code/session_01S2WwJRMhqBfPyeM117hD6J
@shannah
shannah merged commit ec17788 into main Apr 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants