/notfair:upgrade runs instead · from notfair
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.
This skill never runs in Claude Code
It ships in notfair at notfair-upgrade-skill/, but /notfair:upgrade (a command, or a skill Claude Code finds first) has the same name: typing it, or Claude choosing it, runs that one instead.
Upgrade the NotFair plugin to the latest version and show what's new.
| What | Path |
|---|---|
| Marketplace repo | ~/.claude/plugins/marketplaces/swastik-agnihotri/ |
| Plugin cache | ~/.claude/plugins/cache/swastik-agnihotri/notfair/<version>/ |
| Installed plugins | ~/.claude/plugins/installed_plugins.json |
| Update state | ~/.toprank/ (intentionally preserved — see CHANGELOG 0.24.0) |
This section is used when a skill preamble outputs UPGRADE_AVAILABLE.
Log "Upgrading NotFair v{old} → v{new}..." and proceed to Step 2.
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/swastik-agnihotri/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/swastik-agnihotri"
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"
OLD_VERSION=$(cat "$INSTALLED_DIR/VERSION" 2>/dev/null | tr -d '[:space:]' || echo "unknown")
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/swastik-agnihotri/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.
Read ~/.claude/plugins/installed_plugins.json, then update the notfair@swastik-agnihotri 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@swastik-agnihotri'] = [{
'scope': 'user',
'installPath': os.path.expanduser('~/.claude/plugins/cache/swastik-agnihotri/notfair/$NEW_VERSION'),
'version': '$NEW_VERSION',
'installedAt': data['plugins'].get('notfair@swastik-agnihotri', [{}])[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@swastik-agnihotri -> v$NEW_VERSION')
"
Remove old versioned cache directories (keep only the new one). Never remove a dev symlink:
for dir in ~/.claude/plugins/cache/swastik-agnihotri/notfair/*/; do
ver=$(basename "$dir")
if [ "$ver" != "$NEW_VERSION" ] && [ "$ver" != "dev" ]; then
rm -rf "$dir"
echo "Removed old cache: $ver"
fi
done
mkdir -p ~/.toprank
echo "$OLD_VERSION" > ~/.toprank/just-upgraded-from
rm -f ~/.toprank/last-update-check
rm -f ~/.toprank/update-snoozed
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.
After showing What's New, continue with whatever skill the user originally invoked.
Before upgrading, check if the installed cache directory is a symlink named dev:
CACHE_DIR=$(ls -d ~/.claude/plugins/cache/swastik-agnihotri/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.
When invoked directly as /notfair:upgrade:
Check for dev symlink (see "Dev symlink detection" above). If detected, stop.
Force a fresh update check (bypass cache and snooze):
_UPD_BIN=$(ls ~/.claude/plugins/cache/swastik-agnihotri/notfair/*/bin/notfair-update-check 2>/dev/null | head -1)
[ -n "$_UPD_BIN" ] && _UPD=$("$_UPD_BIN" --force 2>/dev/null || true) || _UPD=""
echo "$_UPD"
If UPGRADE_AVAILABLE <old> <new>: follow Steps 2–8 above.
If no UPGRADE_AVAILABLE output: tell the user "You're already on the latest version (v{LOCAL})."
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub swastik023/marketing-api-automation-mcp --plugin notfair96 skills in this plugin
/google-analyticsAnalyze connected Google Analytics 4 traffic, acquisition, engagement, landing pages, ecommerce, events, and conversions, and safely manage supported GA4 key events or custom dimensions through NotFair MCP. Use for GA4, Google Analytics, traffic or conversion drops, channel attribution, realtime activity, report requests, measurement configuration, or Analytics MCP setup./search-consoleQuery and operate connected Google Search Console properties through NotFair MCP. Use for live GSC query or page performance, clicks, impressions, CTR, position, traffic changes, indexing status, URL inspection, sitemap reads or approved sitemap submission/removal, and Search Console MCP setup. Route full-site SEO audits to seo-analysis./