Skip to content

Commit 604dcaa

Browse files
jeffhandleyCopilot
andauthored
Add release-notes, breaking-changes, and bump-version Copilot skills (#1328)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2846430 commit 604dcaa

File tree

7 files changed

+585
-19
lines changed

7 files changed

+585
-19
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
name: breaking-changes
3+
description: Audit pull requests for breaking changes in the C# MCP SDK. Examines PR descriptions, review comments, and diffs to identify API and behavioral breaking changes, then reconciles labels with user confirmation. Use when asked to audit breaking changes, check for breaking changes, or review a set of PRs for breaking impact.
4+
compatibility: Requires gh CLI with repo access and GitHub API access for PR details, review history, and labels.
5+
---
6+
7+
# Breaking Change Audit
8+
9+
Audit pull requests in the `modelcontextprotocol/csharp-sdk` repository for breaking changes. This skill examines a range of commits, identifies API and behavioral breaking changes, assesses their impact, reconciles `breaking-change` labels, and returns structured results.
10+
11+
## Input
12+
13+
The user provides a commit range in any of these forms:
14+
- `tag..HEAD` (e.g. `v0.8.0-preview.1..HEAD`)
15+
- `tag..tag` (e.g. `v0.8.0-preview.1..v0.9.0-preview.1`)
16+
- `sha..sha`
17+
- `tag..sha` or `sha..HEAD`
18+
19+
If no range is provided, ask the user to specify one.
20+
21+
Use the GitHub API to get the full list of PRs merged within the specified range.
22+
23+
## Process
24+
25+
### Step 1: Examine Every PR
26+
27+
For each PR in the range, study:
28+
- PR description and linked issues
29+
- Full review and comment history
30+
- Complete code diff
31+
32+
Look for both categories of breaking changes:
33+
- **API (compile-time)** — changes to public type signatures, parameter types, return types, removed members, sealed types, new obsoletion attributes, etc.
34+
- **Behavioral (runtime)** — new/changed exceptions, altered return values, changed defaults, modified event ordering, serialization changes, etc.
35+
36+
See [references/classification.md](references/classification.md) for the full classification guide, including SDK-specific versioning policies (pre-1.0 preview flexibility, experimental APIs, obsoletion lifecycle, and spec-driven changes) that influence how breaks are assessed.
37+
38+
### Step 2: Assess Impact
39+
40+
For each identified breaking change, assess:
41+
- **Breadth** — how many consumers are likely affected (widely-used type vs. obscure API)
42+
- **Severity** — compile-time break (immediate build failure) vs. behavioral (subtle runtime difference)
43+
- **Migration** — straightforward fix vs. significant code changes required
44+
45+
This assessment informs how breaking changes are ordered when presented (most impactful first).
46+
47+
### Step 3: Reconcile Labels
48+
49+
Compare findings against existing `breaking-change` labels on PRs.
50+
51+
Present mismatches to the user interactively:
52+
53+
- **Unlabeled but appears breaking** → explain why the PR appears breaking, ask user to confirm. If confirmed: apply the `breaking-change` label and ask the user whether to comment on the PR explaining the addition.
54+
- **Labeled but does not appear breaking** → explain why, ask user to confirm removal. If confirmed: remove the label and ask the user whether to comment on the PR explaining the removal.
55+
56+
### Step 4: Present Results
57+
58+
Present the final list of confirmed breaking changes, sorted from most impactful to least, with:
59+
- PR number and title
60+
- Classification (API or behavioral)
61+
- Impact assessment summary
62+
- 1-2 bullet description of what breaks and migration guidance
63+
64+
## Output
65+
66+
The audit produces a structured list of breaking changes that can be consumed by other skills (e.g. the release-notes skill) or presented directly to the user.
67+
68+
Each entry contains:
69+
- PR number and description
70+
- Impact ranking (most → least impactful)
71+
- Detail bullets describing the break and migration path
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Breaking Change Classification Guide
2+
3+
This guide defines how to identify and classify breaking changes in the C# MCP SDK. It is derived from the [dotnet/runtime breaking change guidelines](https://github.com/dotnet/runtime/blob/main/docs/coding-guidelines/breaking-changes.md).
4+
5+
## Two Categories of Breaking Changes
6+
7+
### API Breaking Changes (Compile-Time)
8+
Changes that alter the public API surface in ways that break existing code at compile time:
9+
10+
- **Renaming or removing** a public type, member, or parameter
11+
- **Changing the return type** of a method or property
12+
- **Changing parameter types, order, or count** on a public method
13+
- **Sealing** a type that was previously unsealed (when it has accessible constructors)
14+
- **Making a virtual member abstract**
15+
- **Adding `abstract` to a member** when the type has accessible constructors and is not sealed
16+
- **Removing an interface** from a type's implementation
17+
- **Changing the value** of a public constant or enum member
18+
- **Changing the underlying type** of an enum
19+
- **Adding `readonly` to a field**
20+
- **Removing `params` from a parameter**
21+
- **Adding/removing `in`, `out`, or `ref`** parameter modifiers
22+
- **Renaming a parameter** (breaks named arguments and late-binding)
23+
- **Adding the `[Obsolete]` attribute** or changing its diagnostic ID
24+
- **Adding the `[Experimental]` attribute** or changing its diagnostic ID
25+
- **Removing accessibility** (making a public/protected member less visible)
26+
27+
### Behavioral Breaking Changes (Runtime)
28+
Changes that don't break compilation but alter observable behavior:
29+
30+
- **Throwing a new/different exception type** in an existing scenario (unless it's a more derived type)
31+
- **No longer throwing an exception** that was previously thrown
32+
- **Changing return values** for existing inputs
33+
- **Decreasing the range of accepted values** for a parameter
34+
- **Changing default values** for properties, fields, or parameters
35+
- **Changing the order of events** being fired
36+
- **Removing the raising of an event**
37+
- **Changing timing/order** of operations
38+
- **Changing parsing behavior** and throwing new errors
39+
- **Changing serialization format** or adding new fields to serialized types
40+
41+
## Classification Buckets
42+
43+
### Bucket 1: Clear Public Contract Violation
44+
Obvious breaking changes to the public API shape. **Always flag these.**
45+
46+
### Bucket 2: Reasonable Grey Area
47+
Behavioral changes that customers would have reasonably depended on. **Flag and discuss with user.**
48+
49+
### Bucket 3: Unlikely Grey Area
50+
Behavioral changes that customers could have depended on but probably wouldn't (e.g., corner case corrections). **Flag with lower confidence.**
51+
52+
### Bug Fixes (Exclude)
53+
Changes that correct incorrect behavior, fix spec compliance, or address security issues are **not breaking changes** even if they alter observable behavior. Examples:
54+
- Fixing encoding to match a specification requirement
55+
- Correcting a logger category or metric name that was wrong
56+
- Fixing exception message leaks that were a security concern
57+
- Moving data to the correct location per protocol spec evolution
58+
- Setting a flag that should have been set automatically (e.g., `IsError` for error content)
59+
- Returning a more specific/informative exception for better diagnostics
60+
61+
If a change is primarily a bug fix or spec compliance correction, exclude it from the breaking changes list even though the observable behavior changes.
62+
63+
### Bucket 4: Clearly Non-Public
64+
Changes to internal surface or behavior (e.g., internal APIs, private reflection). **Generally not flagged** unless they could affect ecosystem tools.
65+
66+
## SDK Versioning Policy
67+
68+
The classification rules above are derived from the dotnet/runtime breaking change guidelines, but the MCP SDK has its own versioning policy (see `docs/versioning.md`) that provides additional context for classification decisions.
69+
70+
### Pre-1.0 Preview Status
71+
72+
Prior to a stable 1.0.0 release, the SDK is in preview and breaking changes can be introduced without prior notice. This does **not** change how breaks are classified — they should still be flagged, labeled, and documented — but it affects the **severity assessment**. Preview consumers expect breaks, so migration guidance matters more than avoidance.
73+
74+
### Experimental APIs
75+
76+
APIs annotated with `[Experimental]` (using `MCP`-prefixed diagnostic codes) can change at any time, including within PATCH or MINOR updates. Changes to experimental APIs should still be **noted** in the audit, but classified as **Bucket 3 (Unlikely Grey Area)** or lower unless the API has been widely adopted despite its experimental status.
77+
78+
### Obsoletion Lifecycle
79+
80+
The SDK follows a three-step obsoletion process:
81+
82+
1. **MINOR update**: API marked `[Obsolete]` producing _build warnings_ with migration guidance
83+
2. **MAJOR update**: API marked `[Obsolete]` producing _build errors_ (API throws at runtime)
84+
3. **MAJOR update**: API removed entirely (expected to be rare)
85+
86+
When auditing, classify each step appropriately:
87+
- Step 1 (adding `[Obsolete]` warning) → API breaking change (new build warning)
88+
- Step 2 (escalating to error) → API breaking change (previously working code now fails)
89+
- Step 3 (removal) → API breaking change; migration guidance should note prior deprecation
90+
91+
In exceptional circumstances — especially during the pre-1.0 preview period — the obsoletion lifecycle may be compressed (e.g., marking obsolete and removing in the same MINOR release). This should still be flagged as a breaking change but the migration guidance should explain the rationale.
92+
93+
### Spec-Driven Changes
94+
95+
Breaking changes necessitated by MCP specification evolution should be flagged and documented normally, but the migration guidance should reference the spec change. If a spec change forces an incompatible API change, preference is given to supporting the most recent spec version.
96+
97+
## Compatibility Switches
98+
99+
When a breaking change includes an `AppContext` switch or other opt-in/opt-out mechanism, always note it in the migration guidance. Search for `AppContext.TryGetSwitch`, `DOTNET_` environment variables, and similar compat patterns in the diff. Include the switch name and the value that alters the behavior:
100+
101+
```
102+
* Compat switch: `ModelContextProtocol.AspNetCore.AllowNewSessionForNonInitializeRequests` = `true` restores previous behavior
103+
```
104+
105+
## What to Study for Each PR
106+
107+
For every PR in the range, examine:
108+
109+
1. **PR description** — Authors often describe breaking changes here
110+
2. **Linked issues** — May contain discussion about breaking impact
111+
3. **Review comments** — Reviewers may have flagged breaking concerns
112+
4. **Code diff** — Look at changes to:
113+
- Public type/member signatures
114+
- Exception throwing patterns
115+
- Default values and constants
116+
- Return value changes
117+
- Parameter validation changes
118+
- Attribute changes (`[Obsolete]`, `[Experimental]`, etc.)
119+
- `AppContext.TryGetSwitch` or environment variable compat switches
120+
5. **Labels** — Check if `breaking-change` is already applied
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: bump-version
3+
description: Bump the SDK version after publishing a release. Reads the current version from src/Directory.Build.props, suggests the next minor version, and creates a pull request with the change. Use when asked to bump the version, prepare for the next release, or increment the version number.
4+
compatibility: Requires gh CLI with repo access for creating branches and pull requests.
5+
---
6+
7+
# Bump Version
8+
9+
Bump the SDK version in `src/Directory.Build.props` after publishing a release and create a pull request with the change.
10+
11+
## Process
12+
13+
### Step 1: Read Current Version
14+
15+
Read `src/Directory.Build.props` on the default branch and extract:
16+
- `<VersionPrefix>` — the `MAJOR.MINOR.PATCH` version
17+
- `<VersionSuffix>` — the prerelease suffix (e.g. `preview.1`), if present
18+
19+
Display the current version to the user: `{VersionPrefix}-{VersionSuffix}` or `{VersionPrefix}` if no suffix.
20+
21+
### Step 2: Determine Next Version
22+
23+
If the user provided a target version in their prompt, use it. Otherwise, suggest the next **minor** version with the same suffix pattern:
24+
25+
- Current `0.9.0` with suffix `preview.1` → suggest `0.10.0-preview.1`
26+
- Current `1.0.0` with no suffix → suggest `1.1.0`
27+
- Current `1.2.3` with suffix `rc.1` → suggest `1.3.0-rc.1`
28+
29+
Present the suggestion and let the user confirm or provide an alternative. Parse the confirmed version into its `VersionPrefix` and `VersionSuffix` components.
30+
31+
### Step 3: Create Pull Request
32+
33+
1. Create a new branch named `bump-version-to-{version}` (e.g. `bump-version-to-0.10.0-preview.1`) from the default branch
34+
2. Update `src/Directory.Build.props`:
35+
- Set `<VersionPrefix>` to the new prefix
36+
- Set `<VersionSuffix>` to the new suffix, or remove the element if there is no suffix
37+
3. Commit with message: `Bump version to {version}`
38+
4. Push the branch and create a pull request:
39+
- **Title**: `Bump version to {version}`
40+
- **Label**: `infrastructure`
41+
- **Base**: default branch
42+
43+
### Step 4: Confirm
44+
45+
Display the pull request URL to the user.

0 commit comments

Comments
 (0)