PluginBench
Skill
Review
Audit score 70

dbskill-upgrade

dontbesilent2025/dbskill

Upgrade dbskill to the latest version with automatic backup and rollback.

What is dbskill-upgrade?

This skill upgrades dbskill to the newest version available on GitHub. It detects the current installation, compares versions, backs up the old version, downloads and installs the latest release, and displays changelog information. Use it when you want to update dbskill with safety guarantees.

  • Detects current dbskill installation location and version
  • Fetches remote version from GitHub repository
  • Compares versions and skips upgrade if already latest
  • Creates automatic backup before upgrading
  • Downloads latest version via git clone
  • Replaces old version with new files

How to install dbskill-upgrade

npx skills add https://github.com/dontbesilent2025/dbskill --skill dbskill-upgrade
Prerequisites
  • dbskill already installed in ~/.claude/skills/
  • Git installed and accessible in PATH
  • Network connectivity to reach GitHub repository
  • curl command available for version checking
Claude Code
Cursor
Windsurf
Cline

How to use dbskill-upgrade

  1. 1.Trigger the skill with /dbskill-upgrade, /升级dbskill, or say '升级 dbskill'
  2. 2.Skill checks current installation location and version
  3. 3.Skill fetches remote version from GitHub
  4. 4.If versions match, upgrade completes (already latest)
  5. 5.If update available, automatic backup is created
  6. 6.Latest version downloads and replaces old installation
  7. 7.Changelog displays showing updates from old to new version
  8. 8.Decide whether to keep or delete the backup directory

Use cases

Good for
  • User manually triggers upgrade via /dbskill-upgrade command
  • Staying current with latest dbskill features and bug fixes
  • Safe version updates with automatic rollback capability
  • Reviewing what changed between versions before committing to upgrade
Who it's for
  • dbskill users wanting to stay updated
  • Developers managing Claude Code or Cursor agent skills
  • Users who need safe upgrade paths with backup protection

dbskill-upgrade FAQ

What happens if the upgrade fails?

The skill automatically restores from the backup created before the upgrade attempt, ensuring your previous version remains functional.

Where is the backup stored?

Backups are stored in ~/.claude/skills/.dbskill-backup-YYYYMMDD-HHMMSS with a timestamp. You can manually delete them or they auto-delete after 7 days if unused.

Do I need to have Git installed?

Yes, the skill uses git clone to download the latest version from the GitHub repository.

What if I'm already on the latest version?

The skill compares versions and notifies you that dbskill is already up-to-date, then exits without making changes.

Can I upgrade if installed in a custom location?

No, this skill only supports dbskill installations in the standard ~/.claude/skills/ directory.

Full instructions (SKILL.md)

Source of truth, from dontbesilent2025/dbskill.


name: dbskill-upgrade description: 升级 dbskill 到最新版本 trigger: /dbskill-upgrade、/升级dbskill、「升级 dbskill」

dbskill-upgrade

升级 dbskill 到最新版本,显示更新内容。

使用场景

  • 用户主动调用 /dbskill-upgrade 升级
  • 显示版本变化和更新内容

升级流程

Step 1: 检测安装位置

if [ -d "$HOME/.claude/skills/dbs" ]; then
  INSTALL_DIR="$HOME/.claude/skills"
  echo "Install location: $INSTALL_DIR"
else
  echo "ERROR: dbskill not found in ~/.claude/skills/"
  exit 1
fi

Step 2: 获取当前版本

OLD_VERSION=$(cat "$HOME/.claude/skills/dbskill-upgrade/../../VERSION" 2>/dev/null || echo "unknown")
echo "Current version: $OLD_VERSION"

Step 3: 获取远程版本

REMOTE_VERSION=$(curl -sL https://raw.githubusercontent.com/dontbesilent2025/dbskill/main/VERSION || echo "")
if [ -z "$REMOTE_VERSION" ]; then
  echo "ERROR: Cannot fetch remote version"
  exit 1
fi
echo "Remote version: $REMOTE_VERSION"

Step 4: 比较版本

如果 OLD_VERSION 等于 REMOTE_VERSION,告诉用户已是最新版本,结束。

否则继续升级。

Step 5: 备份当前版本

BACKUP_DIR="$HOME/.claude/skills/.dbskill-backup-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BACKUP_DIR"
cp -r "$HOME/.claude/skills"/dbs* "$BACKUP_DIR/" 2>/dev/null || true
echo "Backup created: $BACKUP_DIR"

Step 6: 下载最新版本

TMP_DIR=$(mktemp -d)
git clone --depth 1 https://github.com/dontbesilent2025/dbskill.git "$TMP_DIR/dbskill"
if [ $? -ne 0 ]; then
  echo "ERROR: Failed to clone repository"
  exit 1
fi
echo "Downloaded to: $TMP_DIR/dbskill"

Step 7: 替换旧版本

rm -rf "$HOME/.claude/skills"/dbs*
cp -r "$TMP_DIR/dbskill/skills"/dbs* "$HOME/.claude/skills/"
rm -rf "$TMP_DIR"
echo "Upgrade completed"

如果复制失败,从备份恢复:

if [ $? -ne 0 ]; then
  echo "ERROR: Upgrade failed, restoring from backup..."
  rm -rf "$HOME/.claude/skills"/dbs*
  cp -r "$BACKUP_DIR"/* "$HOME/.claude/skills/"
  echo "Restored from backup"
  exit 1
fi

Step 8: 显示更新内容

读取 $HOME/.claude/skills/dbs/../../README.md(如果存在),提取从 OLD_VERSIONREMOTE_VERSION 之间的更新内容。

格式:

dbskill v{REMOTE_VERSION} — 从 v{OLD_VERSION} 升级成功!

更新内容:
- [从 README 提取的更新要点]

升级完成!

Step 9: 清理备份

询问用户是否删除备份:

echo "Backup location: $BACKUP_DIR"
echo "Keep backup? (will be auto-deleted in 7 days if not used)"

不强制删除,让用户自己决定。

错误处理

  • 网络失败:提示用户检查网络连接
  • Git clone 失败:从备份恢复
  • 文件复制失败:从备份恢复

注意事项

  • 只支持通过 ~/.claude/skills/ 安装的版本
  • 升级前自动备份,失败时自动恢复
  • 不需要用户手动操作 git