home / skills / barefootford / buttercut / update-buttercut

update-buttercut skill

/.claude/skills/update-buttercut

This skill updates ButterCut to the latest version by pulling from git or downloading, preserving libraries and verifying backups.

npx playbooks add skill barefootford/buttercut --skill update-buttercut

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.5 KB
---
name: update-buttercut
description: A skill to automatically download and install the latest ButterCut version from GitHub while preserving libraries. Use when user wants to check for updates or update their installation for new features.
---

# Skill: Update ButterCut

Updates ButterCut to the latest version. Uses git pull if available, otherwise downloads from GitHub.

Before updating, always make a backup and encourage the user to save it to a location outside the ButterCut directory. Verify the most recent backup exists and offer to copy it to their Desktop or iCloud Drive.

## Workflow

**1. Check current version:**
```bash
cat lib/buttercut/version.rb
```

**2. Check if git repo:**
```bash
git rev-parse --git-dir 2>/dev/null
```

**3a. If git repo exists:**
```bash
# Check for uncommitted changes
git status --porcelain

# If changes exist, STOP and inform user to commit/stash first

# Pull latest
git pull origin main
bundle install
```

**3b. If not git repo:**
```bash
# Download latest
curl -L https://github.com/barefootford/buttercut/archive/refs/heads/main.zip -o /tmp/buttercut-latest.zip
unzip -q /tmp/buttercut-latest.zip -d /tmp/

# Update files (excludes libraries/)
rsync -av --exclude 'libraries/' --exclude '.git/' /tmp/buttercut-main/ ./
bundle install
rm -rf /tmp/buttercut-latest.zip /tmp/buttercut-main
```

**4. Verify:**
```bash
cat lib/buttercut/version.rb
bundle exec rspec
```

If tests fail, STOP and report issue. Show old and new version numbers.

Overview

This skill automates downloading and installing the latest ButterCut release from GitHub while preserving the libraries folder and existing dependencies. It checks whether the installation is a git repository and uses git pull when possible, or downloads and syncs the latest source otherwise. The skill verifies versions and runs tests, and it stops on uncommitted changes or failing test runs.

How this skill works

First it reads the current version from lib/buttercut/version.rb and detects if the directory is a git repository. If git is present and clean, it runs git pull and bundle install. If not a git repo, it downloads the main branch zip from GitHub, rsyncs files into the project while excluding the libraries folder and .git, then runs bundle install. Finally it shows old and new version numbers and runs the test suite; any failure halts the process and reports the issue.

When to use it

  • You want to check if ButterCut has a newer release available.
  • You plan to update your local ButterCut to get new features or bug fixes.
  • You need to update a non-git installation safely while preserving libraries.
  • Before shipping a project that depends on the latest ButterCut behavior.
  • When you want an automated, repeatable update workflow including verification tests.

Best practices

  • Always create a backup outside the ButterCut directory before updating (Desktop, iCloud Drive, etc.).
  • Verify the backup exists and optionally copy it to a safe location before proceeding.
  • Commit or stash any local changes if the directory is a git repository; the updater will stop if uncommitted changes exist.
  • Exclude libraries/ from overwrites to preserve local plugins, extensions, and compiled assets.
  • Run the included test suite after updating and address failures before continuing development or deployment.

Example use cases

  • A developer pulls the latest ButterCut enhancements using git pull and bundle install, then runs rspec to confirm compatibility.
  • A user with a manual install downloads the latest ZIP, syncs files while keeping libraries/, and updates gems.
  • A CI job or local script invokes the skill to ensure a ButterCut checkout is up to date before running integration tests.
  • A designer needs a quick update to benefit from a recent codec fix without losing custom libraries or plugins.

FAQ

Will my libraries or plugins be overwritten?

No. The updater excludes the libraries/ directory when syncing files, so local plugins and custom libraries are preserved.

What happens if there are uncommitted changes?

The process stops and informs you to commit or stash changes first; this prevents accidental loss of work when using git pull.

What if the test suite fails after the update?

If tests fail the updater stops and reports the failures. Restore from your backup or inspect the failing tests before proceeding.