From 61a8abba62f96935008e63ed5dd40a1b6d6ed3e8 Mon Sep 17 00:00:00 2001 From: "Lingling Ye (from Dev Box)" Date: Thu, 9 Apr 2026 14:36:33 +0800 Subject: [PATCH] agent skill for release --- .github/skills/prepare-release/SKILL.md | 113 ++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 .github/skills/prepare-release/SKILL.md diff --git a/.github/skills/prepare-release/SKILL.md b/.github/skills/prepare-release/SKILL.md new file mode 100644 index 0000000..b889cf3 --- /dev/null +++ b/.github/skills/prepare-release/SKILL.md @@ -0,0 +1,113 @@ +--- +name: prepare-release +description: Prepare a release for the JavaScript Feature Management packages. Use when user mentions release preparation, version bump, creating merge PRs, preview release, or stable release for this project. +--- + +# Prepare Release + +This skill automates the release preparation workflow for the [JavaScript Feature Management](https://github.com/microsoft/FeatureManagement-JavaScript) project. + +## When to Use This Skill + +Use this skill when you need to: +- Bump the package version for a new stable or preview release +- Create merge PRs to sync branches (main → release, preview → release) +- Prepare all the PRs needed before publishing a new release + +## Background + +### Repository Information +- **GitHub Repo**: https://github.com/microsoft/FeatureManagement-JavaScript +- **Packages**: + - `@microsoft/feature-management` + - `@microsoft/feature-management-applicationinsights-browser` + - `@microsoft/feature-management-applicationinsights-node` + +### Branch Structure +- `main` – primary development branch for stable releases +- `preview` – development branch for preview releases +- `release/v{major}` – release branch (e.g., `release/v2`) + +### Version Files +The version must be updated in **all 7 files** simultaneously. Some files have multiple locations that need updating: + +1. `src/feature-management/src/version.ts` – line 4: `export const VERSION = "";` +2. `src/feature-management/package.json` – line 3: `"version": "",` +3. `src/feature-management/package-lock.json` – line 3: `"version": "",` +4. `src/feature-management/package-lock.json` – line 9: `"version": "",` +5. `src/feature-management-applicationinsights-browser/src/version.ts` – line 4: `export const VERSION = "";` +6. `src/feature-management-applicationinsights-browser/package.json` – line 3: `"version": "",` AND the `@microsoft/feature-management` dependency version +7. `src/feature-management-applicationinsights-node/src/version.ts` – line 4: `export const VERSION = "";` +8. `src/feature-management-applicationinsights-node/package.json` – line 3: `"version": "",` AND the `@microsoft/feature-management` dependency version + +### Version Format +- **Stable**: `{major}.{minor}.{patch}` (e.g., `2.4.0`) +- **Preview**: `{major}.{minor}.{patch}-preview.{prerelease}` (e.g., `2.4.0-preview.1`) + +## Quick Start + +Ask the user whether this is a **stable** or **preview** release, and what the **new version number** should be. Then follow the appropriate workflow below. + +--- + +### Workflow A: Stable Release + +#### Step 1: Version Bump PR + +Create a version bump PR targeting `main`: + +1. Fetch the latest `main` branch. +2. Create a new branch from `main` named `/version-` +3. Read the current version from `src/feature-management/src/version.ts`. +4. Update the version in all 7 files (see [Version Files](#version-files) section above) by directly editing each file +5. Commit all changes with message: `Version bump `. +6. Push the branch and create a PR targeting `main` with title: `Version bump `. + +**Sample PR**: https://github.com/microsoft/FeatureManagement-JavaScript/pull/120 + +#### Step 2: Merge Main to Release Branch + +After the version bump PR is merged, create a PR to merge `main` into the release branch: + +1. Fetch the latest `main` branch. +2. Create a new branch from `main` named `/merge-main-to-release`. +3. Push the branch and create a PR targeting `release/v{major}` (e.g., `release/v2`) with title: `Merge main to release/v{major}`. + +> **Important**: Use "Merge commit" (not squash) when merging this PR to preserve commit history. + +--- + +### Workflow B: Preview Release + +#### Step 1: Version Bump PR + +Create a version bump PR targeting `preview`: + +1. Fetch the latest `preview` branch. +2. Create a new branch from `preview` named `/version-` +3. Read the current version from `src/feature-management/src/version.ts`. +4. Update the version in all 7 files (see [Version Files](#version-files) section above) by directly editing each file +5. Commit all changes with message: `Version bump `. +6. Push the branch and create a PR targeting `preview` with title: `Version bump `. + +#### Step 2: Merge Preview to Release Branch + +After the version bump PR is merged, create a PR to merge `preview` into the release branch: + +1. Fetch the latest `preview` branch. +2. Create a new branch from `preview` named `/merge-preview-to-release`. +3. Push the branch and create a PR targeting `release/v{major}` (e.g., `release/v2`) with title: `Merge preview to release/v{major}`. + +> **Important**: Use "Merge commit" (not squash) when merging this PR to preserve commit history. + +--- + +## Review Checklist + +Each PR should be reviewed with the following checks: +- [ ] Version is updated consistently across all 7 files +- [ ] The `@microsoft/feature-management` dependency version in both applicationinsights packages matches the new version +- [ ] No unintended file changes are included +- [ ] Merge PRs use **merge commit** strategy (not squash) +- [ ] Branch names follow the naming conventions +- [ ] All CI checks pass