Skip to content

Add skill versioning and version management (#44)#67

Merged
devrimcavusoglu merged 2 commits intomainfrom
feature/skill-versioning
Mar 17, 2026
Merged

Add skill versioning and version management (#44)#67
devrimcavusoglu merged 2 commits intomainfrom
feature/skill-versioning

Conversation

@devrimcavusoglu
Copy link
Copy Markdown
Owner

Summary

  • Add internal/skill/version.go with semver parsing, bumping (patch/minor/major), and comparison — stdlib only
  • Add skern skill version <name> command to show current version
  • Add skern skill version <name> --bump patch|minor|major to bump and persist
  • Add --version flag to skern skill create for setting initial version (validates semver format)
  • Add SkillVersionResult and VersionCompareResult output types for --json support

Test plan

  • 35 unit tests for version parsing, string conversion, bump operations, and comparison (including edge cases)
  • 14 CLI tests for show, bump (all levels), invalid input, sequential bumps, scoped resolution, create with version
  • make build passes
  • make test passes (all packages)
  • make lint — 0 issues

Closes #44

🤖 Generated with Claude Code

@devrimcavusoglu
Copy link
Copy Markdown
Owner Author

Review Findings & Changes

Reviewed the PR comprehensively — overall well-structured with good test coverage and clean separation of concerns. Two issues identified and fixed in commit f090062:

1. Default skill version was 0.1.0, should be 0.0.1

The original code set new skills' default version to 0.1.0, which was confused with the CLI tool's own release version (v0.1.0). Skills should start at 0.0.1. Fixed in scaffold.go and updated the --version flag help text, AGENTS.md spec example, and all dependent test assertions.

2. Leading zeros accepted by ParseVersion

strconv.Atoi silently strips leading zeros, so "01.02.03" parsed as 1.2.3. Strict semver rejects leading zeros. Added a parseVersionPart helper that validates this, and 3 new test cases for coverage.

Not changed (confirmed correct)

  • VersionCompareResult defined but unused — intentional forward scaffolding for upgrade detection
  • Pre-release/build metadata not supported — correct for the SKILL.md spec's strict MAJOR.MINOR.PATCH format
  • Bump level validated twice (CLI layer + BumpVersion) — intentional for proper exit code semantics

All checks pass locally: make lint (0 issues), make test (all packages), make test-smoke (51/51).

devrimcavusoglu and others added 2 commits March 17, 2026 18:33
Add semver parsing, bumping, and comparison in internal/skill/version.go.
Add `skern skill version` command with --bump patch|minor|major support.
Add --version flag to `skern skill create` for setting initial version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Change default skill version from 0.1.0 to 0.0.1 (skills should
  start at 0.0.1, distinct from the CLI's own v0.1.0 release version)
- Reject leading zeros in ParseVersion per strict semver spec
  (e.g. "01.2.3" is now invalid)
- Update all tests and docs accordingly

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@devrimcavusoglu devrimcavusoglu force-pushed the feature/skill-versioning branch from e9ed082 to 830adb9 Compare March 17, 2026 15:35
@devrimcavusoglu devrimcavusoglu merged commit a4d66db into main Mar 17, 2026
4 checks passed
@devrimcavusoglu devrimcavusoglu deleted the feature/skill-versioning branch March 17, 2026 15:36
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.

Skill versioning and history management

1 participant