‹ 首页

upgrade

@nowork-studio · 收录于 1 周前 · 上游提交 今天

Upgrade the NotFair plugin to the latest version. Updates the marketplace repo, installs the new version to the plugin cache, and updates installed_plugins.json. Use when asked to "upgrade notfair", "update notfair", or "get latest version". Also handles inline upgrade prompts when a skill detects UPGRADE_AVAILABLE at startup.

适合你,如果正在使用 NotFair 插件并需要保持最新

/ 下载安装
upgrade.skill双击,或拖进 Claude 桌面版 / Cowork,即完成安装↓ .skill↓ .zip
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code~/.claude/skills/(项目级 .claude/skills/)
Codex CLI~/.codex/skills/
Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add nowork-studio/notfair/upgrade
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- nowork-studio/notfair/upgrade
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify nowork-studio/notfair/upgrade
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
3143GitHub stars
~1.3K最小装载
~1.3K含声明引用
~1.6K文本包总量
镜像托管

怎么用

商店整理自技能原文 · 版本 3e8e47f · 表述以原文为准
它做什么

装上后,当 Claude 检测到 NotFair 插件有新版本时,会自动下载并安装最新版,更新插件缓存和已安装插件列表,然后显示更新内容。

什么时候触发

当你说“升级 notfair”、“更新 notfair”或“获取最新版本”时触发;或者当某个技能启动时检测到 UPGRADE_AVAILABLE 标记时自动触发。

装好后可以这样说
手动触发升级流程
另一种触发方式
触发升级检查
技能原文 SKILL.md作者撰写 · MIT · 3e8e47f

/notfair:upgrade

Upgrade the NotFair plugin to the latest version and show what's new.

Key paths

| What | Path | |------|------| | Marketplace repo | ~/.claude/plugins/marketplaces/nowork-studio/ | | Plugin cache | ~/.claude/plugins/cache/nowork-studio/notfair/<version>/ | | Installed plugins | ~/.claude/plugins/installed_plugins.json | | Update state | ~/.toprank/ (intentionally preserved — see CHANGELOG 0.24.0) |


Inline upgrade flow

This section is used when a skill preamble outputs UPGRADE_AVAILABLE.

Step 1: Auto-upgrade

Log "Upgrading NotFair v{old} → v{new}..." and proceed to Step 2.


Step 2: Detect current install

First check for dev symlink (see "Dev symlink detection" section). If detected, stop — do not upgrade.

# Find the currently installed plugin path
INSTALLED_DIR=$(ls -d ~/.claude/plugins/cache/nowork-studio/notfair/*/ 2>/dev/null | grep -v '.bak' | head -1)
if [ -z "$INSTALLED_DIR" ]; then
  echo "ERROR: NotFair plugin not found in cache"; exit 1
fi
MARKETPLACE_DIR="$HOME/.claude/plugins/marketplaces/nowork-studio"
if [ ! -d "$MARKETPLACE_DIR/.git" ]; then
  echo "ERROR: marketplace repo not found at $MARKETPLACE_DIR"; exit 1
fi
echo "Current install: $INSTALLED_DIR"
echo "Marketplace repo: $MARKETPLACE_DIR"
Step 3: Save old version
OLD_VERSION=$(cat "$INSTALLED_DIR/VERSION" 2>/dev/null | tr -d '[:space:]' || echo "unknown")
Step 4: Update marketplace repo and install
cd "$MARKETPLACE_DIR"
git fetch origin
git reset --hard origin/main
NEW_VERSION=$(cat VERSION | tr -d '[:space:]')
GIT_SHA=$(git rev-parse HEAD)

# Create new versioned cache directory
NEW_CACHE_DIR="$HOME/.claude/plugins/cache/nowork-studio/notfair/$NEW_VERSION"
if [ -d "$NEW_CACHE_DIR" ]; then
  rm -rf "$NEW_CACHE_DIR"
fi
mkdir -p "$NEW_CACHE_DIR"

# Copy plugin files (exclude .git to save space)
rsync -a --exclude='.git' "$MARKETPLACE_DIR/" "$NEW_CACHE_DIR/"

If the copy fails, warn: "Upgrade failed — the old version is still active. Run /notfair:upgrade manually." and stop.

Step 5: Update installed_plugins.json

Read ~/.claude/plugins/installed_plugins.json, then update the notfair@nowork-studio entry:

python3 -c "
import json, os
from datetime import datetime, timezone

path = os.path.expanduser('~/.claude/plugins/installed_plugins.json')
with open(path) as f:
    data = json.load(f)

data['plugins']['notfair@nowork-studio'] = [{
    'scope': 'user',
    'installPath': os.path.expanduser('~/.claude/plugins/cache/nowork-studio/notfair/$NEW_VERSION'),
    'version': '$NEW_VERSION',
    'installedAt': data['plugins'].get('notfair@nowork-studio', [{}])[0].get('installedAt', datetime.now(timezone.utc).isoformat()),
    'lastUpdated': datetime.now(timezone.utc).isoformat(),
    'gitCommitSha': '$GIT_SHA'
}]

with open(path, 'w') as f:
    json.dump(data, f, indent=4)
print('Updated installed_plugins.json: notfair@nowork-studio -> v$NEW_VERSION')
"
Step 6: Clean up old cache versions

Remove old versioned cache directories (keep only the new one). Never remove a dev symlink:

for dir in ~/.claude/plugins/cache/nowork-studio/notfair/*/; do
  ver=$(basename "$dir")
  if [ "$ver" != "$NEW_VERSION" ] && [ "$ver" != "dev" ]; then
    rm -rf "$dir"
    echo "Removed old cache: $ver"
  fi
done
Step 7: Write marker + clear update state
mkdir -p ~/.toprank
echo "$OLD_VERSION" > ~/.toprank/just-upgraded-from
rm -f ~/.toprank/last-update-check
rm -f ~/.toprank/update-snoozed
Step 8: Show What's New

Read $NEW_CACHE_DIR/CHANGELOG.md. Find all version entries between the old version and the new version. Summarize as 3-7 bullets grouped by theme — focus on user-facing changes, skip internal refactors.

Format:

NotFair v{new} — upgraded from v{old}!

What's new:
- [bullet 1]
- [bullet 2]
- ...

The new version will be fully active on your next Claude Code session.
Step 9: Continue

After showing What's New, continue with whatever skill the user originally invoked.


Dev symlink detection

Before upgrading, check if the installed cache directory is a symlink named dev:

CACHE_DIR=$(ls -d ~/.claude/plugins/cache/nowork-studio/notfair/*/ 2>/dev/null | head -1)
if [ -L "${CACHE_DIR%/}" ] && [ "$(basename "$CACHE_DIR")" = "dev" ]; then
  echo "DEV_SYMLINK"
fi

If DEV_SYMLINK: tell the user "NotFair is installed as a dev symlink — it always points to your local source (v$(cat "$CACHE_DIR/VERSION" 2>/dev/null | tr -d '[:space:]')). No upgrade needed." and stop. Do not proceed with Steps 2–8.


Standalone usage

When invoked directly as /notfair:upgrade:

  1. Check for dev symlink (see "Dev symlink detection" above). If detected, stop.
  1. Force a fresh update check (bypass cache and snooze):
_UPD_BIN=$(ls ~/.claude/plugins/cache/nowork-studio/notfair/*/bin/notfair-update-check 2>/dev/null | head -1)
[ -n "$_UPD_BIN" ] && _UPD=$("$_UPD_BIN" --force 2>/dev/null || true) || _UPD=""
echo "$_UPD"
  1. If UPGRADE_AVAILABLE <old> <new>: follow Steps 2–8 above.
  1. If no UPGRADE_AVAILABLE output: tell the user "You're already on the latest version (v{LOCAL})."
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。