docs(bin): clarify fm-ensure-agents-md relocates content, never removes it - #2860
Open
pramendra wants to merge 4 commits into
Open
docs(bin): clarify fm-ensure-agents-md relocates content, never removes it#2860pramendra wants to merge 4 commits into
pramendra wants to merge 4 commits into
Conversation
added 2 commits
August 23, 2026 19:41
Two callers independently misread the promotion of a real CLAUDE.md as a data-loss operation and one declined to run the helper on that false premise. Document in the header and --help that promotion relocates every CLAUDE.md line into AGENTS.md, appends the canonical self-governance section, and replaces the original with the two-line pointer, so callers can anticipate the root-file side effects before running it where CI gates check doc placement or a doc budget. Add a behavior test pinning the --help wording.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (3): Last reviewed commit: "chore: drop Serena MCP auto-generated co..." | Re-trigger Greptile |
added 2 commits
August 23, 2026 22:05
Remove .serena/project.yml and .serena/.gitignore swept into the branch by the no-mistakes document step (globally-registered Serena MCP server). Not part of the task.
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.
Intent
Clarify bin/fm-ensure-agents-md.sh so its interface cannot be misread as data loss. The helper relocates a real CLAUDE.md into AGENTS.md: it moves every line, appends the canonical '## Maintaining this file' section, and replaces the original with the two-line @AGENTS.md pointer; nothing is removed. The task is to add a note to --help (and the header comment) stating that content is relocated rather than removed, and to surface the root-file side effects (AGENTS.md grows by the appended section, CLAUDE.md shrinks to the pointer) so a caller can anticipate a project CI gate that checks doc placement or a doc budget. Add a behavior test pinning the --help wording.
What Changed
helproutine tobin/fm-ensure-agents-md.shand expanded its header comment so--helpand the script header now state that promotion relocates everyCLAUDE.mdline intoAGENTS.mdrather than removing content, and surfaces the side effects:AGENTS.mdgrows by the appended self-governance section whileCLAUDE.mdshrinks to the two-line pointer.test_help_states_relocation_not_removal) pinning the--helpwording..serena/project.ymland.serena/.gitignore).Risk Assessment
✅ Low: The change is purely additive documentation and a help-wording behavior test with no functional logic changes, and it satisfies every required constraint in the authoritative intent.
Testing
Ran the targeted test suite (all 17 tests pass, including the new --help wording test), exercised --help directly to confirm it states content is relocated rather than removed and surfaces the AGENTS.md-grows/CLAUDE.md-shrinks side effects, and performed an end-to-end promotion showing a 3-line CLAUDE.md is fully relocated into AGENTS.md with the canonical section appended while CLAUDE.md shrinks to the two-line pointer; no failures or actionable findings.
Evidence: --help wording and end-to-end relocation transcript
Source: --help wording and end-to-end relocation transcript
usage: fm-ensure-agents-md.sh [repo-or-worktree-dir] ...its content is relocated, never removed: every line moves into AGENTS.md... Promotion appends the canonical "## Maintaining this file" section to AGENTS.md and replaces the real CLAUDE.md with the two-line pointer... Promotion run: 'promoted: moved CLAUDE.md to AGENTS.md and wrote CLAUDE.md @AGENTS.md pointer' -> AGENTS.md: 11 lines (3 original content lines + appended section), CLAUDE.md: 2 lines (pointer).Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-ensure-agents-md.test.sh (17 tests, incl. new test_help_states_relocation_not_removal, all pass)./bin/fm-ensure-agents-md.sh --help (manual check of the relocation wording and side-effect disclosure)Manual end-to-end promotion: ran ./bin/fm-ensure-agents-md.sh against a repo with a 3-line CLAUDE.md, confirmed every line moved into AGENTS.md, the canonical section was appended, and CLAUDE.md became the 2-line pointerRegression check: base commit 505c819 bin/fm-ensure-agents-md.sh --help emitted only the one-line usage (missing relocation wording), confirming the new test fails before and passes after the changebash -n syntax check on bin/fm-ensure-agents-md.sh and tests/fm-ensure-agents-md.test.sh✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.