Claude
Skills
Sign in
Back

check

Included with Lifetime
$97 forever

Check and fix version number consistency across the repository

Code Review

What this skill does


You are checking version numbers.

Your main purpose is to check the correct configuration of version numbers in the current workspace repository. The task will be to go through all files and check if there is somewhere any version number of the project mentioned, e.g. via UI element, config files for deployment and packaging, assembly version, Dockerfile etc.

The focus is the check version numbers of the final product and its consistency throughout the repository. So there is always a relation of `Product Name` and version number in the format `x.x.x`. Version numbers of dependencies like 3rd party packages and modules should not be touched and ignored.

# Execution plan

Each phase should be executed separately. Before continuing with the next step, ask the user before so that a review of the results can happen and an optional re-execution of the phase can be done.

## Phase 0: Target version number

Check if the user has passed in `$ARGUMENTS` a valid target version number. If no target version was provided (empty `$ARGUMENTS`), ask the user to specify the expected version number before proceeding. Maintain the user input in a file called `version-numbers.md` in the project root folder.

## Phase 1: Gather version numbers

Go through all repository files and scan for any mentioned version number. If possible try to also figure out to which product this number relates to.

The below formats are accepted to be identified as a version number:

- `x.x`
- `x.x.x`
- `x.x.x.x`

Files and folders mentioned in `.gitignore` should be also excluded during this phase and in all follow up work.

Document all findings in `version-numbers.md` with below format. The last line contains an example. The last column `In scope` should be left empty, as it will be filled in the next step.

| File | Path | Line number | Product name | Current version | In scope |
| ---- | ---- | ----------: | ------------ | --------------: | :------: |
| version.json | myapp/.package | 5 | My Product Name | 1.0.4 | [ ] |

## Phase 2: Scoping

Ask the user now which Product name should be considered as in-scope for this analysis. In case there are multiple variants, the user should enter each variant comma separated.

Take then the findings from `version-numbers.md` and check if they relate to the provided Product name of the repository. Mark all items in scope accordingly in column `In scope`.

## Phase 3: Identify mismatch

In `version-numbers.md` for all items in scope compare now the value in column `Current version` with the target version number. Append a column named `Mismatch` to the table and mark all items where such a mismatch was identified.

Mismatches are all version numbers which do not have the same structure and value. Only allowed exception is a missing 4th level, like below example:

- `1.5.3` vs. `1.5.3.87` # No mismatch
- `1.5.4` vs. `1.5.3.87` # Mismatch

## Phase 4: Fix mismatches

Check with the user if identified mismatches should be fixed by you or not.

If yes take all mismatches from `version-numbers.md` based on column `Mismatch` and overwrite the version numbers with the target version number. After that, update the column `Mismatch` for all these items.

If no just stop your work and keep the file `version-numbers.md` as-is.

Related in Code Review