-
Notifications
You must be signed in to change notification settings - Fork 382
Add a Skill to create release notes #9711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kenzieschmoll
merged 7 commits into
flutter:master
from
kenzieschmoll:release-notes-skill
Mar 16, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4c35476
Add an agent skill for adding release notes
kenzieschmoll f1dfdc8
Merge branch 'master' of github.com:flutter/devtools into release-not…
kenzieschmoll 1ddb7eb
update skill
kenzieschmoll 393cd63
update skill
kenzieschmoll f76bc06
update skill
kenzieschmoll 3571ed6
Merge branch 'master' of github.com:flutter/devtools into release-not…
kenzieschmoll 4fa2985
update skill to find pr number
kenzieschmoll File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| --- | ||
| name: adding-release-notes | ||
| description: Adds user-facing change descriptions to DevTools release notes. Use when documenting improvements, fixes, or new features in the NEXT_RELEASE_NOTES.md file. | ||
| --- | ||
|
|
||
| # Adding Release Notes | ||
|
|
||
| This skill helps automate adding release notes to `packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md`. | ||
|
|
||
| ## Workflow | ||
| Copy this checklist into your response to track progress: | ||
|
|
||
| ```markdown | ||
| Release Notes Progress: | ||
| - [ ] Step 1: Formulate the entry (past tense) | ||
| - [ ] Step 2: Find the PR number (if not already known) | ||
| - [ ] Step 3: Determine the section (Inspector, Memory, etc.) | ||
| - [ ] Step 4: Add the entry (use scripts/add_note.dart) | ||
| - [ ] Step 5: Add images (if applicable) | ||
| ``` | ||
|
|
||
| ## Guidelines | ||
|
|
||
| ### 1. Identify the PR Number | ||
| If the PR number is unknown, use the following methods to find it: | ||
| - **Local Branch**: Identify the branch name using `git branch` or `git log`. If the branch is pushed to origin, it often has a linked PR. | ||
| - **GitHub CLI (`gh`)**: Use the GitHub CLI to find the PR associated with the current branch. | ||
| - **IMPORTANT**: Always use `PAGER=cat` to prevent `gh` from hanging in non-interactive terminals. | ||
| - Command: `PAGER=cat gh pr list --head <branch_name> --json number,title` | ||
| - **Search by Change Description**: Search open PRs using keywords from your change title or description. | ||
| - Command: `PAGER=cat gh pr list --search "<keywords>" --limit 5` | ||
| - **Web Search**: If CLI tools fail, use `search_web` to find the PR on GitHub: | ||
| - Query: `site:github.com/flutter/devtools "Add support for searching within the log details view"` | ||
|
|
||
| ### 2. Formulate the Entry | ||
| - **Tense**: Always use **past tense** (e.g., "Added", "Improved", "Fixed"). | ||
| - **Punctuation**: Always end entries with a **period**. | ||
| - **Template**: `* <Description>. [#<PR_NUMBER>](https://github.com/flutter/devtools/pull/<PR_NUMBER>)` | ||
| - **Placeholder**: Use `TODO` if you have exhausted all search methods and the PR has not been created yet. | ||
| - **Images**: If adding an image, indent it by two spaces to align with the bullet point, and ensure there is only one newline between the text and the image. | ||
| - Correct Format: | ||
| ```markdown | ||
| - Added support for XYZ. [#TODO](https://github.com/flutter/devtools/pull/TODO) | ||
|  | ||
| ``` | ||
| - **Examples**: | ||
| - `* Added support for XYZ. [#12345](https://github.com/flutter/devtools/pull/12345)` | ||
| - `* Fixed a crash in the ABC screen. [#67890](https://github.com/flutter/devtools/pull/67890)` | ||
|
|
||
| ### 3. User-Facing Changes Only | ||
| - **Criteria**: Focus on **what** changed for the user, not **how** it was implemented. | ||
| - **Avoid**: Technical details like "Implemented XYZ with a new controller", "Updated the build method", or naming internal classes. | ||
| - **Example (Bad)**: `* Implemented log details search using SearchControllerMixin. [#TODO](https://github.com/flutter/devtools/pull/TODO)` | ||
| - **Example (Good)**: `* Added search support to the log details view. [#TODO](https://github.com/flutter/devtools/pull/TODO)` | ||
|
|
||
| ### 4. Determine Section | ||
| Match the change to the section in `NEXT_RELEASE_NOTES.md`: | ||
| - `General updates` | ||
| - `Inspector updates` | ||
| - `Performance updates` | ||
| - `CPU profiler updates` | ||
| - `Memory updates` | ||
| - `Debugger updates` | ||
| - `Network profiler updates` | ||
| - `Logging updates` | ||
| - `App size tool updates` | ||
| - `Deep links tool updates` | ||
| - `VS Code sidebar updates` | ||
| - `DevTools extension updates` | ||
| - `Advanced developer mode updates` | ||
|
|
||
| ### 5. Add to NEXT_RELEASE_NOTES.md | ||
| Use the provided utility script to insert the note safely. The script handles replacing the TODO placeholder if it's the first entry in that section. | ||
|
|
||
| ```bash | ||
| dart .agents/skills/adding-release-notes/scripts/add_note.dart "Inspector updates" "Added XYZ support" TODO | ||
| ``` | ||
|
|
||
| ### 6. Optional: Images | ||
| Add images to `packages/devtools_app/release_notes/images/` and reference them: | ||
| ```markdown | ||
|  | ||
| ``` | ||
| **Constraint**: Use **dark mode** for screenshots. | ||
|
|
||
| ## Resources | ||
| - [README.md](../../packages/devtools_app/release_notes/README.md): Official project guidance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| // Copyright 2019 The Flutter Authors | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd. | ||
|
|
||
| import 'dart:io'; | ||
|
|
||
| void main(List<String> args) { | ||
| if (args.length < 3) { | ||
| print('Usage: dart add_note.dart <section> <note> <pr_number>'); | ||
| exit(1); | ||
| } | ||
|
|
||
| final section = args[0].trim(); | ||
| final note = args[1].trim(); | ||
| final pr = args[2].trim(); | ||
|
|
||
| final prLink = pr == 'TODO' | ||
| ? '[TODO](https://github.com/flutter/devtools/pull/TODO)' | ||
| : '[#$pr](https://github.com/flutter/devtools/pull/$pr)'; | ||
|
|
||
| final filePath = 'packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md'; | ||
| final file = File(filePath); | ||
|
|
||
| if (!file.existsSync()) { | ||
| print('Error: $filePath not found.'); | ||
| exit(1); | ||
| } | ||
|
|
||
| var content = file.readAsStringSync(); | ||
|
|
||
| if (!content.contains('## $section')) { | ||
| print("Error: Section '$section' not found."); | ||
| exit(1); | ||
| } | ||
|
|
||
| final noteWithPeriod = note.endsWith('.') ? note : '$note.'; | ||
| final newEntry = '- $noteWithPeriod $prLink\n'; | ||
|
|
||
| // Check for TODO placeholder. | ||
| const todoText = 'TODO: Remove this section if there are not any updates.'; | ||
| final todoPattern = RegExp( | ||
| '## ${RegExp.escape(section)}\\s*\\n\\s*${RegExp.escape(todoText)}\\s*\\n*', | ||
| ); | ||
|
|
||
| if (todoPattern.hasMatch(content)) { | ||
| content = content.replaceFirst(todoPattern, '## $section\n\n$newEntry\n'); | ||
| } else { | ||
| // Append to existing list in the section. | ||
| final sectionHeader = '## $section'; | ||
| final sectionStart = content.indexOf(sectionHeader); | ||
|
|
||
| // Find the next section start or the end of the file. | ||
| var nextSectionStart = content.indexOf('\n## ', sectionStart + 1); | ||
| if (nextSectionStart == -1) { | ||
| nextSectionStart = | ||
| content.indexOf('\n# Full commit history', sectionStart + 1); | ||
| } | ||
| if (nextSectionStart == -1) { | ||
| nextSectionStart = content.length; | ||
| } | ||
|
|
||
| var sectionContent = | ||
| content.substring(sectionStart, nextSectionStart).trimRight(); | ||
| sectionContent += '\n$newEntry'; | ||
|
|
||
| content = | ||
| '${content.substring(0, sectionStart)}$sectionContent\n${content.substring(nextSectionStart).trimLeft()}'; | ||
| } | ||
|
|
||
| file.writeAsStringSync(content); | ||
| print('Successfully added note to $section.'); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.