Skip to content

Commit 33f9a60

Browse files
authored
Add generate-changelog skill and changelog for v2.7.0 (#98)
Adapt the glsp-client generate-changelog skill for this repository and generate the v2.7.0 changelog entries from PRs merged since v2.6.0.
1 parent 7fe78ba commit 33f9a60

2 files changed

Lines changed: 291 additions & 0 deletions

File tree

Lines changed: 275 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,275 @@
1+
---
2+
name: generate-changelog
3+
description: Generate changelog entries from merged PRs since the last release. Fetches PR data, classifies changes as normal or breaking, presents for user review, and optionally creates a PR with the updates.
4+
---
5+
6+
# Changelog Generator
7+
8+
Generate changelog entries by analyzing merged PRs since the last release.
9+
10+
This repository is `eclipse-glsp/glsp-vscode-integration`. PR links and `gh` queries
11+
must target that repo. Note that the local clone may have multiple git remotes (e.g. a
12+
personal fork plus `origin`); always resolve PR data against the canonical
13+
`eclipse-glsp/glsp-vscode-integration` repo. If `gh` cannot infer the right repo, pass
14+
`--repo eclipse-glsp/glsp-vscode-integration` explicitly.
15+
16+
Execute these phases in order:
17+
18+
1. **Data Gathering** — find last release, fetch PRs, classify, generate entries
19+
2. **Changelog Update** — write entries into CHANGELOG.md
20+
3. **Review & Approval** — present the actual diff to the user for review
21+
4. **PR Creation** (optional) — push and create PR, only if the user requests it
22+
23+
---
24+
25+
## Phase 1: Data Gathering
26+
27+
### Step 1.1: Find the latest release tag
28+
29+
Run:
30+
31+
```bash
32+
git tag --sort=-creatordate | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1
33+
```
34+
35+
Record as `LAST_TAG` (e.g. `v2.6.0`). Get the tag's date:
36+
37+
```bash
38+
git log -1 --format=%aI $LAST_TAG
39+
```
40+
41+
Record as `TAG_DATE`.
42+
43+
### Step 1.2: Extract category tags from existing CHANGELOG.md
44+
45+
Read `CHANGELOG.md` and extract all unique `[tag]` patterns from changelog entries (pattern: `- [tag] ...`). Build a deduplicated vocabulary list preserving original casing.
46+
47+
Common tags in this repo include: `[api]`, `[diagram]`, `[launch]`, `[protocol]`, `[deps]`, `[node]`, `[build]`.
48+
49+
### Step 1.3: Fetch merged PRs since the last release
50+
51+
```bash
52+
gh pr list --repo eclipse-glsp/glsp-vscode-integration --state merged --search "merged:>TAG_DATE" --json number,title,author,body,labels,mergedAt --limit 100
53+
```
54+
55+
Use the date portion only from `TAG_DATE` (e.g. `2026-02-10`).
56+
57+
### Step 1.4: Filter PRs
58+
59+
**Skip rules** (in order):
60+
61+
1. PR has the `changelog` label → skip (already tracked in a previous changelog update)
62+
2. Author login is `dependabot` or `dependabot[bot]` → skip
63+
3. Title matches version bump patterns → skip:
64+
- Starts with `Switch to` and contains `-next`
65+
- Title is a bare version like `vX.Y.Z`
66+
- Title starts with `Release v`
67+
4. Title contains `update changelog` (case insensitive) → skip
68+
5. Title is purely CI/metadata (readme badges, workflow config) AND body does NOT contain `[x] This PR should be mentioned in the changelog` → skip
69+
70+
**Override**: If the PR body contains `[x] This PR should be mentioned in the changelog`, always include it regardless of rules 3-5. PRs with the `changelog` label (rule 1) and dependabot PRs (rule 2) are always skipped.
71+
72+
### Step 1.5: Classify each PR
73+
74+
1. If body contains `[x] This PR introduces a breaking change`**breaking**
75+
2. If body contains `[ ] This PR introduces a breaking change`**normal**
76+
3. If no checkbox info, analyze title and body:
77+
- Breaking keywords: "refactor", "rename", "remove", "replace", "migrate", "breaking", "deprecate"
78+
- Clearly non-breaking (bug fix, docs, minor enhancement) → **normal**
79+
- Uncertain → flag for user review
80+
81+
### Step 1.6: Assign category tags
82+
83+
Pick the most fitting tag from the vocabulary (Step 1.2) based on PR title and body. If no tag fits, mark as uncertain: `[???/best-guess]`.
84+
85+
### Step 1.7: Generate changelog entries
86+
87+
#### Entry Format
88+
89+
**Normal changes:**
90+
91+
```
92+
- [tag] Description [#N](https://github.com/eclipse-glsp/glsp-vscode-integration/pull/N)
93+
```
94+
95+
**Breaking changes** with migration sub-items:
96+
97+
```
98+
- [tag] Description [#N](https://github.com/eclipse-glsp/glsp-vscode-integration/pull/N)
99+
- Migration detail 1
100+
- Migration detail 2
101+
```
102+
103+
**Multiple PRs for the same change:**
104+
105+
```
106+
- [tag] Description [#N](url) [#M](url)
107+
```
108+
109+
#### Style Guide
110+
111+
**Formatting:**
112+
113+
- Entry prefix: `- ` (dash + exactly 3 spaces)
114+
- Sub-item indent: 4 spaces + `- ` (4 spaces from parent dash)
115+
- Sub-sub-item indent: 8 spaces + `- `
116+
- Single space between `[tag]` and description text
117+
- Single space before PR link at end of line
118+
- PR links are mandatory, full URLs: `[#123](https://github.com/eclipse-glsp/glsp-vscode-integration/pull/123)`
119+
120+
**Wording:**
121+
122+
- Always start with a **present tense imperative verb** (not past tense)
123+
- Common verbs: Fix, Improve, Add, Update, Extend, Ensure, Introduce, Remove, Refactor, Rename, Provide, Allow, Support
124+
- **Bug fixes**: "Fix a bug that caused/prevented...", "Fix X behavior"
125+
- **Features**: "Introduce...", "Add support for...", "Provide..."
126+
- **Enhancements**: "Improve...", "Extend...", "Ensure that..."
127+
- **Refactors**: "Refactor...", "Rework...", "Rename..."
128+
- Be specific — never "Fix various issues"
129+
130+
**Capitalization:**
131+
132+
- Tags are always lowercase: `[diagram]`, not `[Diagram]`
133+
- Description starts lowercase after the tag (unless proper noun or code element)
134+
- Section headers: Title Case (`### Potentially Breaking Changes`)
135+
136+
**Description cleanup from PR title:**
137+
138+
- Remove issue tracker prefixes (e.g. `GLSP-1234:`, `GH-123:`, `ISSUE-456:`)
139+
- Remove conventional commit prefixes: `fix:`, `feat:`, `chore:`
140+
- Rephrase bug-report style to changelog style:
141+
- BAD: "Edit label UI does not resize on graph zoom"
142+
- GOOD: "Fix edit label UI not resizing on graph zoom"
143+
- Keep concise — one line
144+
145+
**Breaking changes:**
146+
147+
- Describe what changed, why it's breaking, and how to migrate
148+
- Extract migration sub-items from the PR body's "What it does" section
149+
150+
---
151+
152+
## Phase 2: Changelog Update
153+
154+
### Step 2.1: Determine the version section
155+
156+
Read `CHANGELOG.md` in the repository root.
157+
158+
This repo's released section headings look like:
159+
160+
```markdown
161+
## [v2.6.0 - 10/02/2026](https://github.com/eclipse-glsp/glsp-vscode-integration/releases/tag/v2.6.0)
162+
```
163+
164+
**Active section detection:**
165+
166+
- An active section has the `- active` suffix (e.g. `## v2.7.0 - active`) instead of a release date
167+
- If an active section exists → merge new entries into it
168+
- If the topmost section is a released version (has a date, no `- active` suffix) → create a new active section above it
169+
170+
**Creating a new section:**
171+
172+
- Bump the minor version of `LAST_TAG` (e.g. `v2.6.0``v2.7.0`)
173+
- Insert after the title line (`# Eclipse GLSP VSCode Integration Changelog`), before the first `## ` heading:
174+
175+
```markdown
176+
## v2.7.0 - active
177+
178+
### Changes
179+
180+
- [tag] Entry [#N](url)
181+
182+
### Potentially Breaking Changes
183+
184+
- [tag] Entry [#N](url)
185+
- Sub-item detail
186+
```
187+
188+
Only include "Potentially Breaking Changes" if there are breaking entries.
189+
190+
**Merging into existing active section:**
191+
192+
- Check PR numbers against existing entries to avoid duplicates
193+
- Append new entries to the appropriate subsection
194+
- Create missing subsections as needed
195+
196+
### Step 2.2: Write the updated CHANGELOG.md
197+
198+
Use the Edit tool to update `CHANGELOG.md` directly in the current working tree. Match existing formatting conventions.
199+
200+
---
201+
202+
## Phase 3: Review & Approval
203+
204+
### Step 3.1: Show the diff
205+
206+
```bash
207+
git diff CHANGELOG.md
208+
```
209+
210+
Present the diff to the user.
211+
212+
### Step 3.2: Prompt for uncertain items
213+
214+
List any entries flagged as uncertain (category or breaking status) and ask the user to resolve them.
215+
216+
Even if nothing is uncertain, ask:
217+
218+
> "Does everything look correct, or would you like to adjust any entries?"
219+
220+
### Step 3.3: Collect user feedback
221+
222+
- **Approve as-is** → done (or proceed to Phase 4 if PR was requested)
223+
- **Request edits** → apply changes, show updated diff, ask again
224+
- **Resolve uncertain items** → apply, show updated diff
225+
226+
**Do NOT proceed to Phase 4 unless the user explicitly requests a PR.**
227+
228+
---
229+
230+
## Phase 4: PR Creation (Optional)
231+
232+
Only execute this phase if the user explicitly requests a PR (either in their initial prompt or after reviewing the changelog). If the user hasn't mentioned a PR, ask after approval:
233+
234+
> "Would you like me to create a PR for this changelog update, or are you done?"
235+
236+
### Step 4.1: Determine the branch name
237+
238+
Check if `changelog-update` exists on remote:
239+
240+
```bash
241+
git ls-remote --heads origin changelog-update
242+
```
243+
244+
If it exists, increment: `changelog-update-2`, `changelog-update-3`, etc.
245+
246+
### Step 4.2: Create branch, commit, and push
247+
248+
Push to the canonical `origin` remote (`eclipse-glsp/glsp-vscode-integration`):
249+
250+
```bash
251+
git checkout -b BRANCH_NAME
252+
git add CHANGELOG.md
253+
git commit -m "Update changelog"
254+
git push -u origin BRANCH_NAME
255+
```
256+
257+
### Step 4.3: Create the PR
258+
259+
If the repo has a `.github/PULL_REQUEST_TEMPLATE.md`, use its structure to fill in the PR body. Otherwise use a simple body describing the changelog update.
260+
261+
```bash
262+
gh pr create --repo eclipse-glsp/glsp-vscode-integration --title "Update changelog" --body "..."
263+
```
264+
265+
Report the PR URL.
266+
267+
### Step 4.4: Label referenced PRs
268+
269+
Add the `changelog` label to every PR mentioned in the new entries:
270+
271+
```bash
272+
gh pr edit PR_NUMBER --repo eclipse-glsp/glsp-vscode-integration --add-label "changelog"
273+
```
274+
275+
Report which PRs were labeled.

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Eclipse GLSP VSCode Integration Changelog
22

3+
## v2.7.0 - active
4+
5+
### Changes
6+
7+
- [build] Switch to ESLint 9.x [#87](https://github.com/eclipse-glsp/glsp-vscode-integration/pull/87)
8+
- [example] Align the codicon version used in the example with the version expected by `@eclipse-glsp/client` [#90](https://github.com/eclipse-glsp/glsp-vscode-integration/pull/90)
9+
- [diagram] Fix spurious "No Custom Document found" errors by forwarding `onDidChangeCustomDocument` events only for documents owned by the provider when multiple `GlspEditorProvider` instances share a `GlspVscodeConnector` [#92](https://github.com/eclipse-glsp/glsp-vscode-integration/pull/92)
10+
- [mcp] Add support for Model Context Protocol integration, bridging the GLSP-announced MCP server into the VS Code MCP definition provider API [#91](https://github.com/eclipse-glsp/glsp-vscode-integration/pull/91)
11+
- Opt-in via an MCP server configuration on the connector; the announced endpoint is registered on startup and deregistered on extension dispose.
12+
- The Workflow example demonstrates the end-to-end wiring, including a copy-URL action and client-side PNG export.
13+
14+
### Potentially Breaking Changes
15+
16+
- [deps] Update the minimum required Node version to `22` [#88](https://github.com/eclipse-glsp/glsp-vscode-integration/pull/88)
17+
- [deps] Raise the minimum required VS Code version to `1.101`, needed for the stabilized MCP definition provider API; installing in earlier versions will fail [#95](https://github.com/eclipse-glsp/glsp-vscode-integration/pull/95)
18+
319
## [v2.6.0 - 10/02/2026](https://github.com/eclipse-glsp/glsp-vscode-integration/releases/tag/v2.6.0)
420

521
## [v2.5.0 - 07/09/2025](https://github.com/eclipse-glsp/glsp-vscode-integration/releases/tag/v2.5.0)

0 commit comments

Comments
 (0)