Skip to content

Make install additive by default; add --force for clean reinstall - #7

Merged
monty-sei merged 4 commits into
mainfrom
fix/additive-install
May 22, 2026
Merged

Make install additive by default; add --force for clean reinstall#7
monty-sei merged 4 commits into
mainfrom
fix/additive-install

Conversation

@monty-sei

Copy link
Copy Markdown
Collaborator

Summary

  • Default install is now additive (merge)cp -r src/. dest/ copies new and updated files in without removing anything in the destination. Re-running the installer is safe.
  • --force flag — does the old wipe-and-replace behaviour, but requires confirmation before removing the existing directory
  • No message on fresh install — the "already exists" warning is gone; a fresh install just says "Installing..."
  • Merge install prints a clear message — "Merging Sei Skill (...) into existing install → path"
  • Success message varies — "Successfully updated" vs "Successfully installed" depending on whether a prior install existed
  • README updated — explains merge behaviour, documents --force with examples

Behaviour matrix

Scenario Before After
Fresh install Silent copy Silent copy (unchanged)
Re-install (no flag) Prompt → wipe → copy Merge (no prompt)
Re-install --force N/A Confirm prompt → wipe → copy
Non-interactive re-install Silent wipe → copy Silent merge
Non-interactive --force N/A Warning logged → wipe → copy

Test plan

  • Fresh install on a path with no existing directory — no warnings, installs cleanly
  • Re-run installer on existing install — prints "Merging..." and "Successfully updated", files present from prior install that aren't in source are preserved
  • --force on existing install — shows confirmation prompt, y proceeds with clean replace, n cancels
  • --force on non-existing path — skips confirmation (nothing to remove), installs fresh
  • Non-interactive --force (piped stdin) — prints warning, proceeds without hanging

…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.
@cursor

cursor Bot commented May 21, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes installer semantics from overwrite-on-reinstall to merge-by-default, which may leave stale files in existing installs unless users opt into --force. Also removes interactive overwrite prompts for flattened/agent outputs, which could clobber files if users reuse paths unintentionally.

Overview
Installer behavior changes: Claude Code directory installs now merge into an existing skill directory instead of wiping/prompting, preserving user-added files; a new --force flag enables the previous clean reinstall behavior with a confirmation prompt and non-interactive warning.

Output/UX updates: Flatten/agent installs now always overwrite the single output file (no prompt), --force is rejected for these modes, and success messaging is updated to distinguish installed vs updated vs already up to date (via before/after checksums). Documentation in README.md is updated with merge/--force behavior and Windows-specific install guidance (Git Bash/WSL).

Reviewed by Cursor Bugbot for commit 73f3b32. Bugbot is set up for automated code reviews on this repo. Configure here.

monty-sei added 3 commits May 22, 2026 09:43
--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.
@monty-sei
monty-sei merged commit f9bfe7f into main May 22, 2026
1 check passed
@monty-sei
monty-sei deleted the fix/additive-install branch May 22, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant