Skip to content

Commit 9fb9681

Browse files
justin808claude
andauthored
Enhance changelog documentation with react_on_rails improvements (#801)
## Summary Following [react_on_rails PR #1867](shakacode/react_on_rails#1867), this enhances the changelog documentation in both the `/update-changelog` command and `CLAUDE.md`. ## Changes ### `/update-changelog` command enhancements: - **Version management section added** with `bundle exec rake update_changelog` reference - **Enhanced category organization** distinguishing standard (keepachangelog.com) vs custom headings - **Real examples command** added: `grep -A 3 "^### " CHANGELOG.md | head -30` - **Additional entry examples** including sub-bullets format - **Format clarification** noting Shakapacker uses `#` in PR links unlike React on Rails ### `CLAUDE.md` improvements: - **Streamlined changelog section** with more concise bullet points - **Added slash command reference** pointing to `/update-changelog` for guided updates - **Added version management** with rake task reference - **Added examples command** for viewing real formatting - **Clarified PR format** noting Shakapacker uses `#` in links ## Impact This ensures consistent, high-quality changelog maintenance across the project, making it easier for contributors to understand changelog requirements and formatting. ## Comparison with React on Rails The main difference preserved is the PR link format: - React on Rails uses: `[PR 1867]` (no hash) - Shakapacker uses: `[PR #1867]` (with hash) All other improvements from the react_on_rails PR have been adapted for Shakapacker. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
1 parent afcad76 commit 9fb9681

File tree

2 files changed

+52
-21
lines changed

2 files changed

+52
-21
lines changed

.claude/commands/update-changelog.md

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Each changelog entry MUST follow this exact format:
3636
- Start with a dash and space: `- `
3737
- Use **bold** for the main description
3838
- End the bold description with a period before the link
39-
- Always link to the PR: `[PR #123](https://github.com/shakacode/shakapacker/pull/123)`
39+
- Always link to the PR: `[PR #123](https://github.com/shakacode/shakapacker/pull/123)` - **Note: Shakapacker uses `#` in PR links, unlike React on Rails**
4040
- Always link to the author: `by [username](https://github.com/username)`
4141
- End with a period after the author link
4242
- Additional details can be added after the main entry, using proper indentation for multi-line entries
@@ -51,19 +51,42 @@ For breaking changes, use this format:
5151

5252
### Category Organization
5353

54-
Entries should be organized under these section headings in order of priority:
54+
Entries should be organized under these section headings. The project uses both standard and custom headings:
5555

56-
1. `### ⚠️ Breaking Changes` - Breaking changes only
57-
2. `### Added` - New features
58-
3. `### Changed` - Changes to existing functionality
59-
4. `### Improved` - Improvements to existing features
60-
5. `### Security` - Security-related changes
61-
6. `### Fixed` - Bug fixes
62-
7. `### Deprecated` - Deprecation notices
63-
8. `### Removed` - Removed features
56+
**Standard headings** (from keepachangelog.com) - use these for most changes:
57+
58+
- `### Added` - New features
59+
- `### Changed` - Changes to existing functionality
60+
- `### Deprecated` - Deprecation notices
61+
- `### Removed` - Removed features
62+
- `### Fixed` - Bug fixes
63+
- `### Security` - Security-related changes
64+
- `### Improved` - Improvements to existing features
65+
66+
**Custom headings** (project-specific) - use sparingly when standard headings don't fit:
67+
68+
- `### ⚠️ Breaking Changes` - Breaking changes only (Shakapacker uses emoji in heading)
69+
- `### API Improvements` - API changes and improvements
70+
- `### Developer Experience` - Developer workflow improvements
71+
- `### Performance` - Performance improvements
72+
73+
**Prefer standard headings.** Only use custom headings when the change needs more specific categorization.
6474

6575
**Only include section headings that have entries.**
6676

77+
### Version Management
78+
79+
After adding entries, use the rake task to manage version headers:
80+
81+
```bash
82+
bundle exec rake update_changelog
83+
```
84+
85+
This will:
86+
87+
- Add headers for the new version
88+
- Update version diff links at the bottom of the file
89+
6790
### Version Links
6891

6992
After adding an entry to the `## [Unreleased]` section, ensure the version diff links at the bottom of the file are correct.
@@ -114,7 +137,7 @@ When a new version is released:
114137
- **CRITICAL**: When moving entries from "Unreleased" to a version section, merge them with existing entries under the same category heading
115138
- **NEVER create duplicate section headings** (e.g., don't create two "### Fixed" sections)
116139
- If the version section already has a category heading (e.g., "### Fixed"), add the moved entries to that existing section
117-
- Maintain the category order: Breaking Changes, Added, Changed, Improved, Security, Fixed, Deprecated, Removed
140+
- Maintain the category order as defined above
118141

119142
7. **Verify formatting**:
120143
- Bold description with period
@@ -165,6 +188,12 @@ After the user chooses, proceed with that approach.
165188

166189
## Examples
167190

191+
Run this command to see real formatting examples from the codebase:
192+
193+
```bash
194+
grep -A 3 "^### " CHANGELOG.md | head -30
195+
```
196+
168197
### Good Entry Example
169198

170199
```markdown
@@ -174,6 +203,12 @@ After the user chooses, proceed with that approach.
174203
- Improved security by only catching ENOENT errors in path resolution, rethrowing permission and access errors
175204
```
176205

206+
### Entry with Sub-bullets Example
207+
208+
```markdown
209+
- **HTTP 103 Early Hints support** for faster asset loading. [PR #722](https://github.com/shakacode/shakapacker/pull/722) by [justin808](https://github.com/justin808). Automatically sends early hints when `early_hints: enabled: true` in `shakapacker.yml`. Works with `append_javascript_pack_tag`/`append_stylesheet_pack_tag`, supports per-controller/action configuration, and includes helpers like `configure_pack_early_hints` and `skip_send_pack_early_hints`. Requires Rails 5.2+ and HTTP/2-capable server. See [Early Hints Guide](docs/early_hints.md).
210+
```
211+
177212
### Breaking Change Example
178213

179214
```markdown

CLAUDE.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,12 @@
2929

3030
## Changelog
3131

32-
- **Update CHANGELOG.md for user-visible changes only**
33-
- User-visible changes include: new features, bug fixes, breaking changes, deprecations, performance improvements
34-
- **Do NOT add changelog entries for**: linting fixes, code formatting, internal refactoring, test updates, documentation fixes
35-
- Non-user-visible changes don't need changelog entries even if they modify code
36-
- **Format requirements**:
37-
- Always link to the PR: `[PR #123](https://github.com/shakacode/shakapacker/pull/123)`
38-
- Always link to the author: `by [username](https://github.com/username)`
39-
- Keep formatting consistent with existing entries
40-
- When releasing a version, update the version diff links at the bottom of CHANGELOG.md
41-
- **For breaking changes**: Use bold formatting and link to migration documentation (e.g., `**Breaking**: Description. See [Migration Guide](docs/vX_upgrade.md)`)
32+
- **Update CHANGELOG.md for user-visible changes only** (features, bug fixes, breaking changes, deprecations, performance improvements)
33+
- **Do NOT add entries for**: linting, formatting, refactoring, tests, or documentation fixes
34+
- **Format**: `[PR #123](https://github.com/shakacode/shakapacker/pull/123) by [username](https://github.com/username)` (Shakapacker uses `#` in PR links)
35+
- **Use `/update-changelog` command** for guided changelog updates with automatic formatting
36+
- **Version management**: Run `bundle exec rake update_changelog` after releases to update version headers
37+
- **Examples**: Run `grep -A 3 "^### " CHANGELOG.md | head -30` to see real formatting examples
4238

4339
## Shakapacker-Specific
4440

0 commit comments

Comments
 (0)