feat: marker-aware merge for export-rules#32
Open
eyeondrive wants to merge 1 commit intovinilana:mainfrom
Open
feat: marker-aware merge for export-rules#32eyeondrive wants to merge 1 commit intovinilana:mainfrom
eyeondrive wants to merge 1 commit intovinilana:mainfrom
Conversation
exportRules previously used fs.writeFile to overwrite single-format targets (CLAUDE.md, AGENTS.md, .cursorrules, etc.), destroying any hand-written content. The <!-- GENERATED:AI-CONTEXT:START/END --> marker convention existed as a manual workaround but the tool didn't honor it. Now: single-format exports detect markers in existing files and replace only the generated section. Hand-written content outside markers is preserved. New files are automatically wrapped in markers so future exports merge safely. Also adds generated tool export directories to .gitignore — these are per-user artifacts from export-rules --preset all, not project source. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
exportRulesnow detects<!-- GENERATED:AI-CONTEXT:START/END -->markers in existing target files and replaces only the generated section.deepagent-desktop/,.agent/,.antigravity/) to.gitignoreas these are per-user artifactsProblem
exportRulesusedfs.writeFileto overwrite single-format targets (CLAUDE.md,AGENTS.md,.cursorrules, etc.), destroying any hand-written content. Users who maintained both hand-written rules and generated documentation in the same file had to manually re-add their content after every export.The
<!-- GENERATED:AI-CONTEXT:START/END -->marker convention existed as a documented workaround but the tool itself didn't honor it.Test plan
CLAUDE.mdthat has hand-written content above/below markers — hand-written content preserved🤖 Generated with Claude Code