|
| 1 | +--- |
| 2 | +name: generate-release-notes |
| 3 | +description: Generate comprehensive release notes for Bit from git commits and pull requests. Use when creating release notes, building changelogs, documenting version releases, or preparing a new Bit release. |
| 4 | +--- |
| 5 | + |
| 6 | +# Generate Release Notes for Bit |
| 7 | + |
| 8 | +This skill helps generate release notes for Bit following the established patterns and guidelines. |
| 9 | + |
| 10 | +## Important: Intermediate Files |
| 11 | + |
| 12 | +All intermediate steps must be saved to `releases-docs/temp-files/` for review. This folder is gitignored. |
| 13 | + |
| 14 | +**Required intermediate files:** |
| 15 | + |
| 16 | +1. `raw-commits.md` - Raw commit data from GitHub API |
| 17 | +2. `filtered-commits.md` - Two sections: filtered out commits and kept commits |
| 18 | + |
| 19 | +## Workflow |
| 20 | + |
| 21 | +Follow these steps to generate release notes: |
| 22 | + |
| 23 | +### Step 1: Setup Temp Directory |
| 24 | + |
| 25 | +First, ensure the temp directory exists: |
| 26 | + |
| 27 | +```bash |
| 28 | +mkdir -p releases-docs/temp-files |
| 29 | +``` |
| 30 | + |
| 31 | +### Step 2: Determine the Commit Range |
| 32 | + |
| 33 | +1. **Get the latest release tag and commit:** |
| 34 | + |
| 35 | + ```bash |
| 36 | + # Get latest release tag |
| 37 | + gh release view --repo teambit/bit --json tagName -q '.tagName' |
| 38 | + |
| 39 | + # Get the commit SHA for the tag (handles annotated tags) |
| 40 | + TAG="v1.12.158" # Replace with actual tag |
| 41 | + TAG_REF=$(gh api "repos/teambit/bit/git/refs/tags/$TAG" -q '.object.sha') |
| 42 | + TAG_TYPE=$(gh api "repos/teambit/bit/git/refs/tags/$TAG" -q '.object.type') |
| 43 | + |
| 44 | + if [ "$TAG_TYPE" = "tag" ]; then |
| 45 | + # Annotated tag - get the commit it points to |
| 46 | + RELEASE_COMMIT=$(gh api "repos/teambit/bit/git/tags/$TAG_REF" -q '.object.sha') |
| 47 | + else |
| 48 | + # Lightweight tag - already have the commit |
| 49 | + RELEASE_COMMIT=$TAG_REF |
| 50 | + fi |
| 51 | + ``` |
| 52 | + |
| 53 | +2. **Determine the starting point:** |
| 54 | + - If user provides a specific commit hash, use that as `FROM_COMMIT` |
| 55 | + - If not provided, use `HEAD` (latest commit on master) |
| 56 | + |
| 57 | +### Step 3: Fetch Commits and Save to raw-commits.md |
| 58 | + |
| 59 | +Use the GitHub API to get commits between the release and the starting point: |
| 60 | + |
| 61 | +```bash |
| 62 | +# Compare commits between release and HEAD (or specific commit) |
| 63 | +gh api "repos/teambit/bit/compare/${RELEASE_COMMIT}...${FROM_COMMIT}" \ |
| 64 | + --jq '.commits[] | "\(.sha[0:7]) | \(.commit.message | split("\n")[0]) | \(.commit.author.name)"' |
| 65 | +``` |
| 66 | + |
| 67 | +**Save the output to `releases-docs/temp-files/raw-commits.md`** with the following format: |
| 68 | + |
| 69 | +```markdown |
| 70 | +# Raw Commits |
| 71 | + |
| 72 | +Generated: {DATE} |
| 73 | +From: {FROM_COMMIT or HEAD} |
| 74 | +To: {RELEASE_TAG} ({RELEASE_COMMIT}) |
| 75 | +Total commits: {COUNT} |
| 76 | + |
| 77 | +## Commits |
| 78 | + |
| 79 | +| Hash | Message | Author | |
| 80 | +| ------- | ---------------------------- | ----------- | |
| 81 | +| abc1234 | feat: add new feature (#123) | Author Name | |
| 82 | +| def5678 | fix: resolve bug (#456) | Author Name | |
| 83 | + |
| 84 | +... |
| 85 | +``` |
| 86 | + |
| 87 | +### Step 4: Filter Commits and Save to filtered-commits.md |
| 88 | + |
| 89 | +Analyze each commit and categorize into two groups: |
| 90 | + |
| 91 | +**FILTER OUT (do not include in release notes):** |
| 92 | + |
| 93 | +- Version bump commits: `bump teambit version to X.X.X [skip ci]` |
| 94 | +- CI-only changes: commits that only modify CircleCI config |
| 95 | +- Skip CI markers: commits with `[skip ci]` in the message |
| 96 | +- Auto-merge commits: `Merge branch 'X' into master` |
| 97 | + |
| 98 | +**KEEP (include in release notes):** |
| 99 | + |
| 100 | +- All feature commits (`feat:`) |
| 101 | +- All fix commits (`fix:`) |
| 102 | +- All performance commits (`perf:`) |
| 103 | +- Dependency updates (go in Internal section) |
| 104 | +- Refactoring commits (go in Internal section) |
| 105 | + |
| 106 | +**Save to `releases-docs/temp-files/filtered-commits.md`** with the following format: |
| 107 | + |
| 108 | +```markdown |
| 109 | +# Filtered Commits |
| 110 | + |
| 111 | +Generated: {DATE} |
| 112 | + |
| 113 | +## Filtered Out ({COUNT} commits) |
| 114 | + |
| 115 | +These commits are excluded from the release notes: |
| 116 | + |
| 117 | +| Hash | Message | Reason | |
| 118 | +| ------- | ----------------------------------------- | ------------ | |
| 119 | +| abc1234 | bump teambit version to 1.13.5 [skip ci] | Version bump | |
| 120 | +| def5678 | ci, temporarily set tag to increment by 2 | CI change | |
| 121 | + |
| 122 | +... |
| 123 | + |
| 124 | +## Kept for Release Notes ({COUNT} commits) |
| 125 | + |
| 126 | +These commits will be included in the release notes: |
| 127 | + |
| 128 | +| Hash | Message | Category | |
| 129 | +| ------- | ------------------------------- | ------------ | |
| 130 | +| ghi9012 | feat: add new command (#123) | New Features | |
| 131 | +| jkl3456 | fix: resolve issue (#456) | Bug Fixes | |
| 132 | +| mno7890 | chore(deps): bump lodash (#789) | Internal | |
| 133 | + |
| 134 | +... |
| 135 | +``` |
| 136 | + |
| 137 | +### Step 5: Enrich Commit Information |
| 138 | + |
| 139 | +For commits that are merge commits or have unclear messages, fetch PR details: |
| 140 | + |
| 141 | +```bash |
| 142 | +# Get PR details by number |
| 143 | +gh pr view 12345 --repo teambit/bit --json title,body,labels |
| 144 | + |
| 145 | +# Search for PR by commit |
| 146 | +gh pr list --repo teambit/bit --search "SHA_HERE" --state merged --json number,title,body |
| 147 | +``` |
| 148 | + |
| 149 | +Look for: |
| 150 | + |
| 151 | +- PR title and description |
| 152 | +- Labels (feat, fix, perf, etc.) |
| 153 | +- Related issues |
| 154 | + |
| 155 | +### Step 6: Categorize Changes |
| 156 | + |
| 157 | +Group the KEPT commits into these categories based on content: |
| 158 | + |
| 159 | +| Category | Indicators | |
| 160 | +| ---------------- | --------------------------------------------------------------------------------- | |
| 161 | +| **New Features** | New commands, new major functionality, "Introduce", "feat:" prefix | |
| 162 | +| **Improvements** | Enhancements, "Support", "Allow", "Add option", improvements to existing features | |
| 163 | +| **Performance** | "Optimize", "perf:", "Reduce memory", "Speed up", "Improve performance" | |
| 164 | +| **Bug Fixes** | "Fix", "fix:", bug corrections, issue resolutions | |
| 165 | +| **Internal** | Dependency updates, refactoring, CI changes, code cleanup, test improvements | |
| 166 | + |
| 167 | +### Step 7: Write Release Notes |
| 168 | + |
| 169 | +Follow the guidelines in `releases-docs/guideline.md`: |
| 170 | + |
| 171 | +1. **Section Order:** New Features → Improvements → Performance → Bug Fixes → Internal |
| 172 | +2. **Only include sections that have content** |
| 173 | +3. **Format each item:** |
| 174 | + - Start with a verb (Fix, Add, Support, Improve, Introduce) |
| 175 | + - Include PR numbers at the end: `(#1234)` or `(#1234, #1235)` |
| 176 | + - Use backticks for: commands, flags, file names, config properties |
| 177 | + - Use **bold** for major feature names |
| 178 | + |
| 179 | +### Step 8: Save the Release Notes |
| 180 | + |
| 181 | +Save to `releases-docs/releases/` folder: |
| 182 | + |
| 183 | +- If version provided: `releases-docs/releases/v{VERSION}.md` |
| 184 | +- If no version: `releases-docs/releases/new-release.md` |
| 185 | + |
| 186 | +**Important:** Do NOT include the header metadata (title, tag, draft, etc.) - only the release content starting from the sections. |
| 187 | + |
| 188 | +## Example Output Format |
| 189 | + |
| 190 | +```markdown |
| 191 | +### New Features |
| 192 | + |
| 193 | +- New `bit validate` command to run a complete `test`, `lint`, `compile` and `typecheck` for a project (#10022) |
| 194 | +- **Bit Scripts** for simple shell commands or function execution for components (#10028) |
| 195 | + |
| 196 | +### Improvements |
| 197 | + |
| 198 | +- `bit recover` command now supports component and glob patterns (#10033) |
| 199 | +- Improve error messages in CLI (#10027, #9983) |
| 200 | + |
| 201 | +### Performance |
| 202 | + |
| 203 | +- Don't read and parse the lockfile multiple times for calculating deps graph (#10019) |
| 204 | + |
| 205 | +### Bug Fixes |
| 206 | + |
| 207 | +- Fix an issue where test duration had incorrect format (#9940) |
| 208 | +- Fix an issue where `bit new` wasn't resolving a remote env (#9981) |
| 209 | + |
| 210 | +### Internal |
| 211 | + |
| 212 | +- Update dependencies (#10018, #10015, #10006) |
| 213 | +- Modernize some legacy code (#10024, #10014) |
| 214 | +``` |
| 215 | + |
| 216 | +## Output Files Summary |
| 217 | + |
| 218 | +| File | Location | Purpose | |
| 219 | +| ----------------------------------- | --------------------------- | -------------------------------- | |
| 220 | +| `raw-commits.md` | `releases-docs/temp-files/` | Raw commit data for review | |
| 221 | +| `filtered-commits.md` | `releases-docs/temp-files/` | Filtered/kept commits for review | |
| 222 | +| `v{VERSION}.md` or `new-release.md` | `releases-docs/releases/` | Final release notes | |
| 223 | + |
| 224 | +## Reference Files |
| 225 | + |
| 226 | +- **Guidelines:** `releases-docs/guideline.md` - Detailed formatting and style guidelines |
| 227 | +- **Examples:** `releases-docs/releases/` - Previous release notes for reference patterns |
| 228 | + |
| 229 | +## Helper Scripts (Optional) |
| 230 | + |
| 231 | +The `releases-docs/scripts/` directory contains shell scripts for manual use: |
| 232 | + |
| 233 | +- `get-release-commits.sh [FROM_COMMIT] [TO_TAG]` - Fetches commits between releases |
| 234 | +- `filter-commits.sh` - Filters out uninteresting commits (pipe input to it) |
| 235 | + |
| 236 | +These scripts are provided for manual/CLI use. When using this skill, Claude uses the `gh` API commands directly as they work from any directory without needing the local git repository. |
| 237 | + |
| 238 | +## Tips |
| 239 | + |
| 240 | +1. **Group related PRs** - Multiple PRs for the same feature should be one line item |
| 241 | +2. **Be concise** - Users scan release notes; keep items short and clear |
| 242 | +3. **Focus on user impact** - Describe what changed for the user, not implementation details |
| 243 | +4. **Check for typos** - Common in commit messages; fix them in release notes |
| 244 | +5. **Verify PR numbers** - Ensure all referenced PRs exist and are correct |
0 commit comments