diff --git a/.claude/commands/version.md b/.claude/commands/version.md new file mode 100644 index 0000000..07e8642 --- /dev/null +++ b/.claude/commands/version.md @@ -0,0 +1,59 @@ +# Version Management Command + +Manage the project version across all configuration files. + +## Arguments: $ARGUMENTS + +## Instructions + +1. Read the current version from `src/Keystone.Cli/Keystone.Cli.csproj` (the `` tag) + +2. **If arguments are empty or "show"**: Display the current version and exit + +3. **If a version is provided**: Validate and update the version + +### Validation + +The new version MUST match the pattern `X.Y.Z` where X, Y, and Z are non-negative integers +(e.g., `0.1.0`, `1.0.0`, `2.3.14`). If the pattern doesn't match, show an error and exit. + +### Files to Update + +When bumping the version, update these files: + +#### 1. `src/Keystone.Cli/Keystone.Cli.csproj` + +Update ALL five version properties to the new value: + +- `X.Y.Z` +- `X.Y.Z` +- `X.Y.Z` +- `X.Y.Z` +- `X.Y.Z` + +#### 2. `docs/man/man1/keystone-cli.1` + +Update the VERSION section. Find the line that starts with `keystone-cli` under the +`.Sh VERSION` section and update it to `keystone-cli X.Y.Z`. + +#### 3. `tests/Keystone.Cli.UnitTests/Application/Commands/Info/InfoCommandTests.cs` + +Update the version assertion. Find the line containing `Does.StartWith("X.Y.Z")` and update +it to use the new version. + +### Verify + +After updating all files, run the unit tests to ensure everything still passes: + +```bash +dotnet test +``` + +### Output + +After updating and verifying, confirm the changes by showing: + +- The old version +- The new version +- List of files updated +- Test results (passed/failed) diff --git a/docs/RELEASE.md b/docs/RELEASE.md index 11ce726..d087028 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -17,6 +17,34 @@ Keystone CLI uses **tag-driven releases**. --- +## Version management + +Use the `/version` command in Claude Code to view or update the project version. + +### View current version + +```text +/version +``` + +This displays the current version from `Keystone.Cli.csproj`. + +### Update to a new version + +```text +/version X.Y.Z +``` + +This updates the version in all required files: + +- `src/Keystone.Cli/Keystone.Cli.csproj` (all five version properties) +- `docs/man/man1/keystone-cli.1` (VERSION section) +- `tests/Keystone.Cli.UnitTests/Application/Commands/Info/InfoCommandTests.cs` (version assertion) + +The version must follow semantic versioning format (`X.Y.Z`). + +--- + ## Release flows Keystone CLI supports two release flows: @@ -38,11 +66,7 @@ This is the **recommended** way to publish a new version. ### Steps -1. Update the project version: - - ```xml - X.Y.Z - ``` +1. Update the project version using `/version X.Y.Z` in Claude Code (see [Version management](#version-management)). This value **must match** the git tag that will be created (`vX.Y.Z`). @@ -101,7 +125,7 @@ Use this flow **only** if GitHub Actions is unavailable or requires debugging. dotnet test ./tests/Keystone.Cli.UnitTests/Keystone.Cli.UnitTests.csproj -c Release ``` -2. Ensure `` in `Keystone.Cli.csproj` matches the intended release. +2. Ensure the version matches the intended release (use `/version` to check, `/version X.Y.Z` to update). 3. Build and package release assets locally: diff --git a/docs/man/man1/keystone-cli.1 b/docs/man/man1/keystone-cli.1 index 9a51162..9d703be 100644 --- a/docs/man/man1/keystone-cli.1 +++ b/docs/man/man1/keystone-cli.1 @@ -186,7 +186,7 @@ To switch a project at a specific path to use the `core` template: .Dl keystone-cli project switch-template --project-path /path/to/my-project core .Sh VERSION -keystone-cli 0.1.0 +keystone-cli 0.1.1 .Sh AUTHOR Knight Owl LLC diff --git a/src/Keystone.Cli/Keystone.Cli.csproj b/src/Keystone.Cli/Keystone.Cli.csproj index ca0a5cc..566758b 100644 --- a/src/Keystone.Cli/Keystone.Cli.csproj +++ b/src/Keystone.Cli/Keystone.Cli.csproj @@ -12,11 +12,11 @@ © 2025 Knight Owl LLC. All rights reserved. A command-line interface for Keystone. MIT - 0.1.0 - 0.1.0 - 0.1.0 - 0.1.0 - 0.1.0 + 0.1.1 + 0.1.1 + 0.1.1 + 0.1.1 + 0.1.1 diff --git a/tests/Keystone.Cli.UnitTests/Application/Commands/Info/InfoCommandTests.cs b/tests/Keystone.Cli.UnitTests/Application/Commands/Info/InfoCommandTests.cs index 8e9defb..1b4c170 100644 --- a/tests/Keystone.Cli.UnitTests/Application/Commands/Info/InfoCommandTests.cs +++ b/tests/Keystone.Cli.UnitTests/Application/Commands/Info/InfoCommandTests.cs @@ -33,7 +33,7 @@ public void GetInfo_ReturnsModel() using (Assert.EnterMultipleScope()) { - Assert.That(actual.Version, Does.StartWith("0.1.0")); + Assert.That(actual.Version, Does.StartWith("0.1.1")); Assert.That(actual.Description, Is.EqualTo("A command-line interface for Keystone.")); Assert.That(actual.Copyright, Is.EqualTo("© 2025 Knight Owl LLC. All rights reserved.")); Assert.That(actual.DefaultTemplateTarget, Is.EqualTo(defaultTemplateTarget));