Skip to content

update skill step 11 runs rm -rf on $SNAP, which the skill defines as the whole session scratchpad #227

Description

@realmarcin

From the round-1 review of #216 (issue #174).

Where: .claude/skills/update-xmech-page/SKILL.md:56-57 and step 11 (rm -rf "${SNAP:?}").

The skill's only definition of SNAP is "Put the snapshot and logs in the session scratchpad, here $SNAP". Read literally, that names the scratchpad itself, and no step assigns SNAP or creates a directory for it. The :? guard catches an unset variable, but not SNAP set to the scratchpad root.

Failure scenario: a later refresh sets SNAP to the scratchpad. Step 11 then deletes the whole scratchpad. In this session that would have included the git worktrees of five open PRs (wt-148, wt-149, wt-173, wt-174, and wt-150 before it merged), taking any uncommitted changes with them, plus about 200 unrelated working files.

Fix:

  • In step 1, create a dedicated directory, SNAP=<scratchpad>/xmech-refresh-<date>, and refuse if it already exists.
  • In step 11, remove only a directory that is recognizably the snapshot: revisions.json and mechs/ present.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions