Make install additive by default; add --force for clean reinstall - #7
Conversation
…einstall Default behaviour now merges — new and updated files are copied into an existing skill directory without removing anything. Fresh installs are silent. Re-installs print a "Merging into existing install" message. --force does the old wipe-and-replace, but prompts for confirmation before removing the existing directory (TTY-gated, same pattern as the existing overwrite guards). Non-interactive --force logs a warning and proceeds. Switches cp from `cp -r src dest` (requires dest to not exist) to `cp -r src/. dest/` (merges into dest), with mkdir -p for both new and existing paths. README updated with merge behaviour explanation and --force examples.
PR SummaryMedium Risk Overview Output/UX updates: Flatten/agent installs now always overwrite the single output file (no prompt), Reviewed by Cursor Bugbot for commit 73f3b32. Bugbot is set up for automated code reviews on this repo. Configure here. |
--force is now invalid with --agent or --flatten and errors immediately with a clear explanation. Agent/flatten installs produce a single file and always overwrite — no merge concept applies, no prompt needed. Remove the overwrite prompt from the flatten path entirely. It was the only interactive prompt left in that code path and was inconsistent with how every agent tool handles config file writes. mkdir -p still runs to create the output directory if it doesn't exist. README updated to explain the distinction: Claude Code installs are directory-based and merge by default (--force for clean reinstall); agent/flatten installs are single-file and always overwrite.
Snapshot the install directory with cksum before and after the full merge (copy + variant SKILL.md swap + SKILL-*.md cleanup). If the state is identical, report "Skill already up to date" instead of "Successfully updated". Fresh installs are unaffected. cksum is POSIX — available on macOS, Linux, and Git Bash on Windows.
Summary
cp -r src/. dest/copies new and updated files in without removing anything in the destination. Re-running the installer is safe.--forceflag — does the old wipe-and-replace behaviour, but requires confirmation before removing the existing directory--forcewith examplesBehaviour matrix
--force--forceTest plan
--forceon existing install — shows confirmation prompt,yproceeds with clean replace,ncancels--forceon non-existing path — skips confirmation (nothing to remove), installs fresh--force(piped stdin) — prints warning, proceeds without hanging