chore: Block manual CHANGELOG.md edits#3810
Merged
Merged
Conversation
Changelogs are auto-generated by craft from PR titles, but agents repeatedly add manual CHANGELOG.md entries. The AGENTS.md guidance was a soft pointer and its "custom entries" wording invited editing the file. Add a PreToolUse deny-hook that blocks Edit/Write/MultiEdit on any CHANGELOG.md, and rewrite the AGENTS.md changelog rule as an explicit prohibition (custom entries go in the PR description, not the file). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog. FeaturesDart
Enhancements
DependenciesDeps
Internal Changes
🤖 This preview updates automatically when you update the PR. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds guardrails to prevent manual CHANGELOG.md edits by agents, aligning workflow with craft’s release-time changelog generation from PR titles.
Changes:
- Documents a strict “never edit
CHANGELOG.md” rule inAGENTS.md, including where to place custom changelog entries (PR description) and how to exclude entries (skip-changelog). - Adds a
.claude/settings.jsonPreToolUsedeny hook intended to blockEdit/Write/MultiEditoperations targeting anyCHANGELOG.md.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| AGENTS.md | Clarifies policy and directs custom changelog entries to PR description instead of editing files. |
| .claude/settings.json | Adds a PreToolUse hook to deny tool-based edits to CHANGELOG.md. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
denrase
approved these changes
Jun 30, 2026
This was referenced Jul 2, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Agents repeatedly add manual entries to
CHANGELOG.mdeven though craft generates the changelog from PR titles at release time. This adds enforcement plus clearer guidance so it stops happening.PreToolUsedeny-hook in.claude/settings.json: blocksEdit/Write/MultiEditon anyCHANGELOG.md(the root file and the per-package symlinks) and returns the reason. Enforced by the harness, so it does not depend on an agent reading docs. craft's release-time writes are unaffected — it does not edit through Claude Code.AGENTS.md: the changelog line previously read "see CONTRIBUTING.md for policy and custom entries", which invited editing the file. Replaced with an explicit "never editCHANGELOG.md" rule in the early Conventions section, and rewrote the Pull Requests line. Custom entries belong in the PR description's## Changelog Entrysection, not the file.The hook takes effect once these settings are loaded (next session start or
/hooksreload).