feat(install): manage global Claude Code instructions#30
Merged
Conversation
Add claude/CLAUDE.md to version-control the global Claude Code instructions, and wire install.sh to symlink ~/.claude/CLAUDE.md to it. If ~/.claude/CLAUDE.md already exists, install prompts [n/Y] before replacing it (default Yes); an existing correct link is left untouched. Covered by sanity tests: fresh link, idempotent re-run, keep-on-decline, replace-on-accept, and replace-on-default.
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
Version-controls the global Claude Code instructions and wires them into the install flow.
claude/CLAUDE.md(new) — the global Claude Code instructions, now tracked in the repo.install.sh— newinstall_claude_global()symlinks~/.claude/CLAUDE.md→claude/CLAUDE.md, called from the main install flow.~/.claude/CLAUDE.mdalready exists, it prompts[n/Y]before replacing it (default Yes: deletes the existing file and links; No keeps the user's file untouched).CLAUDE.md— documents the newclaude/directory and install behavior.Behavior notes
update_profile(git pull + submodule update) does not touch~/.claude/CLAUDE.md; wiring happens only when./install.shis run.Tests
Added sanity tests covering every branch (TDD, RED first):
test_claude_global_linked— fresh install creates the symlinktest_claude_global_idempotent— re-run against a correct link is a silent no-optest_claude_global_keep_existing— existing file +nkeeps it untouchedtest_claude_global_replace_existing— existing file +Yreplaces with the linktest_claude_global_default_replaces— existing file + Enter defaults to replaceAll 22 tests pass locally (
make test).