Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .claude/commands/version.md
Original file line number Diff line number Diff line change
@@ -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 `<Version>` 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:

- `<Version>X.Y.Z</Version>`
- `<ApplicationVersion>X.Y.Z</ApplicationVersion>`
- `<AssemblyVersion>X.Y.Z</AssemblyVersion>`
- `<FileVersion>X.Y.Z</FileVersion>`
- `<InformationalVersion>X.Y.Z</InformationalVersion>`

#### 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)
36 changes: 30 additions & 6 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -38,11 +66,7 @@ This is the **recommended** way to publish a new version.

### Steps

1. Update the project version:

```xml
<Version>X.Y.Z</Version>
```
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`).

Expand Down Expand Up @@ -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 `<Version>` 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:

Expand Down
2 changes: 1 addition & 1 deletion docs/man/man1/keystone-cli.1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/Keystone.Cli/Keystone.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
<Copyright>© 2025 Knight Owl LLC. All rights reserved.</Copyright>
<Description>A command-line interface for Keystone.</Description>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Version>0.1.0</Version>
<ApplicationVersion>0.1.0</ApplicationVersion>
<AssemblyVersion>0.1.0</AssemblyVersion>
<FileVersion>0.1.0</FileVersion>
<InformationalVersion>0.1.0</InformationalVersion>
<Version>0.1.1</Version>
<ApplicationVersion>0.1.1</ApplicationVersion>
<AssemblyVersion>0.1.1</AssemblyVersion>
<FileVersion>0.1.1</FileVersion>
<InformationalVersion>0.1.1</InformationalVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down