Skip to content

Commit b281820

Browse files
rhoerrclaude
andauthored
Add Claude Code skill for managing supported versions (mage-os#318)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0590231 commit b281820

1 file changed

Lines changed: 129 additions & 0 deletions

File tree

  • .claude/skills/add-supported-version
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
---
2+
name: add-supported-version
3+
description: >
4+
Add a new Mage-OS or Magento Open Source release to the supported-version CI matrix.
5+
Use this skill when the user wants to add a new release version, update the version matrix,
6+
or register a new patch/minor release for either Mage-OS or Magento Open Source.
7+
Triggers on phrases like "add version", "new release", "add 2.2.1", "add 2.4.8-p5",
8+
"update supported versions", or any mention of adding a release to the CI matrix.
9+
---
10+
11+
# Add Supported Version
12+
13+
This skill walks through adding a new release to the `supported-version` CI matrix in the `mage-os.github-actions` repository.
14+
15+
## What you need from the user
16+
17+
Before starting, confirm these inputs:
18+
19+
1. **Project**: `mage-os` or `magento-open-source` (or both, if releasing simultaneously)
20+
2. **Version string**: e.g. `2.2.1`, `2.4.8-p5`
21+
3. **Release date**: defaults to today if not specified
22+
4. **Service versions**: same as previous release unless the user specifies otherwise
23+
5. **Upstream version** (Mage-OS only): the `upstream` field value (e.g. `2.4.8-p4`)
24+
25+
If the user doesn't specify service versions, copy them from the most recent version in the same minor line.
26+
27+
## File locations
28+
29+
All paths are relative to the repo root (`supported-version/src/versions/`):
30+
31+
| File | Purpose |
32+
|------|---------|
33+
| `<project>/individual.json` | One entry per exact version with full service config, release date, and EOL |
34+
| `<project>/composite.json` | Version range entries (`>=X.Y <X.Z`), plus `default` and `next` entries |
35+
| `../kind/get-currently-supported.spec.ts` | Tests that verify which versions are supported at given dates |
36+
| `../dist/index.js` | Built output — regenerated via `npm run build` |
37+
38+
Where `<project>` is `mage-os` or `magento-open-source`.
39+
40+
## Step-by-step process
41+
42+
### 1. Read current state
43+
44+
Read both `individual.json` and `composite.json` for the relevant project. Identify:
45+
- The most recent version **in the same minor line** (this is the "previous version")
46+
- Its service versions, release date, and EOL
47+
48+
The "same minor line" means the same `X.Y` — for example, when adding `2.2.2`, the previous version is `2.2.1` (not `2.2.0` or `2.1.0`). Scan all entries to find the highest patch number within the minor. For Magento, this means the highest `-pN` suffix (e.g. `2.4.8-p4` is previous when adding `2.4.8-p5`).
49+
50+
### 2. Update individual.json
51+
52+
**a. Set the previous version's EOL** to the new release date. This marks it as superseded. Only change this one entry — the immediately preceding patch in the same minor line. Do not touch any other version's EOL.
53+
54+
**b. Add the new version entry** immediately after the previous version, with:
55+
- All service fields copied from the previous version (unless the user specifies different ones)
56+
- `release`: the new release date formatted as `YYYY-MM-DDT00:00:00+0000`
57+
- `eol`: release date + 3 years, same format
58+
- For Mage-OS entries, include the `upstream` field
59+
60+
### Scope rules — what NOT to change
61+
62+
Each version only affects its own minor line (`X.Y`). When adding a version:
63+
- Only update the EOL of the immediately prior patch in the **same** minor line
64+
- Never modify entries in other minor lines. For example, adding `2.3.0` must NOT change anything about `2.2.x` entries — they have their own independent lifecycle and EOL dates
65+
- A new minor line (e.g. `2.3.0` when only `2.2.x` exists) has no "previous version" to update — just add the new entry
66+
67+
### 3. Update composite.json
68+
69+
The composite file has three kinds of entries that may need updating:
70+
71+
**a. Version range entry** (e.g. `>=2.2 <2.3`):
72+
- If the range already exists (adding a patch): update only the `eol` to match the new version's EOL. Do NOT change the `release` date — it reflects when the minor line first shipped.
73+
- If this is a new minor line (e.g. adding `2.3.0`): add a new range entry with the new release and EOL dates. Do NOT modify the existing range for the previous minor line.
74+
75+
**b. Default entry** (bare package name, e.g. `mage-os/project-community-edition`):
76+
- Update `release` to the new release date
77+
- Update `eol` to the new EOL date
78+
- Update service versions if they changed
79+
80+
**c. Next entry** (`package:next`):
81+
- Same updates as the default entry
82+
83+
### 4. Update tests
84+
85+
Edit `supported-version/src/kind/get-currently-supported.spec.ts`:
86+
- Add a test case for the new version's release date showing it as the currently supported version
87+
- The pattern is: `['YYYY-MM-DDT00:00:01Z', 'Release of X.Y.Z', ['project:X.Y.Z']]`
88+
89+
### 5. Build and test
90+
91+
```bash
92+
cd supported-version
93+
npm run build # rebuilds dist/index.js
94+
npm test # all tests must pass
95+
```
96+
97+
If tests fail, diagnose and fix before proceeding.
98+
99+
### 6. Git workflow
100+
101+
```bash
102+
git checkout main
103+
git pull
104+
git checkout -b chore/<project>-<version> # e.g. chore/mage-os-2.2.1
105+
git add supported-version/src/versions/<project>/individual.json \
106+
supported-version/src/versions/<project>/composite.json \
107+
supported-version/src/kind/get-currently-supported.spec.ts \
108+
supported-version/dist/index.js
109+
git commit -m "Add supported version for <Project> <Version>"
110+
git push -u origin <branch>
111+
```
112+
113+
## Date formatting
114+
115+
All dates use the format `YYYY-MM-DDT00:00:00+0000`. EOL is always release date + 3 years exactly (same month and day).
116+
117+
## Key differences between projects
118+
119+
| | Mage-OS | Magento Open Source |
120+
|---|---------|---------------------|
121+
| Package prefix | `mage-os/project-community-edition` | `magento/project-community-edition` |
122+
| Has `upstream` field | Yes | No |
123+
| Version format | `X.Y.Z` (e.g. `2.2.1`) | `X.Y.Z-pN` (e.g. `2.4.8-p5`) |
124+
| Search key (2.4.8+) | `opensearch` | `opensearch` |
125+
| Search key (older) | `elasticsearch` | `elasticsearch` |
126+
127+
## Multiple simultaneous releases
128+
129+
When adding multiple versions at once (e.g. a Magento patch round releasing 2.4.7-p9 + 2.4.8-p4 simultaneously), process each version independently following the same steps. They typically share the same release date. Each version only affects its own minor line's entries.

0 commit comments

Comments
 (0)