Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions plugins/magpie-setup/skills/setup/upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,26 @@ Copy the files, not a link to them.
same package, so a plain `cp -R` from it leaves a link in the personal
layer that points nowhere.
Copy from the skill's directory, or follow the link with `cp -RL`.
For marketplace installs, the source is
`<plugin-cache>/magpie-setup/<version>/skills/setup/setup_preflight`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<plugin-cache>, <installed-skill-dir> and <personal_dir from …> are not used anywhere else; AGENTS.md asks not to invent placeholders. The section already names both directories in prose, so the snippet can refer to those.

Check the new copy before replacing the old one:

```bash
source_dir="<installed-skill-dir>/setup_preflight"
personal_dir="<personal_dir from setup_preflight.layers>"
target="$personal_dir/setup_preflight"

if [ -e "$target" ] || [ -L "$target" ]; then
temp="$(mktemp -d "$personal_dir/.preflight.XXXXXX")" || exit 1
cp -RL "$source_dir" "$temp/setup_preflight" &&

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a marketplace install source_dir is under ~/.claude/plugins/cache/, which config.md Step 2a notes is read-denied to a sandboxed shell. This cp -RL then fails and the refresh never happens on exactly the setup it is for. Please say how the copy is made there (the file tool, or a command for the user).

PYTHONPATH="$temp" python3 -c 'import setup_preflight.cli' ||

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run the same check config does, without the cwd on sys.path: PYTHONPATH="$temp" python3 -P -m setup_preflight --skill magpie-setup --no-welcome. -c puts the working directory ahead of $temp, and an import alone does not prove the checker runs.

{ rm -rf "$temp"; exit 1; }
mv "$target" "$temp/old" || { rm -rf "$temp"; exit 1; }
mv "$temp/setup_preflight" "$target" ||
{ mv "$temp/old" "$target"; exit 1; }
rm -rf "$temp"
fi
```

The fresh copy also carries the new version's isolated-setup
fingerprint. When the secure-setup files changed in this upgrade, the
Expand Down