ce-update

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Check & Fix Plugin Version

检查并修复插件版本

Verify the installed compound-engineering plugin version matches the latest released version, and fix stale marketplace/cache state if it doesn't. Claude Code only.
验证已安装的compound-engineering插件版本是否与最新发布版本匹配,若不匹配则修复过期的市场/缓存状态。仅适用于Claude Code。

Pre-resolved context

预解析上下文

The three sections below contain pre-resolved data. Only the Plugin root path determines whether this session is Claude Code — if it contains an error sentinel, an empty value, or a literal
${CLAUDE_PLUGIN_ROOT}
string, tell the user this skill only works in Claude Code and stop. The other two sections may contain error sentinels even in valid Claude Code sessions; the decision logic below handles those cases.
Plugin root path: !
echo "${CLAUDE_PLUGIN_ROOT}" 2>/dev/null || echo '__CE_UPDATE_ROOT_FAILED__'
Latest released version: !
gh release list --repo Everyinc/compound-engineering-plugin --limit 30 --json tagName --jq '[.[] | select(.tagName | startswith("compound-engineering-v"))][0].tagName | sub("compound-engineering-v";"")' 2>/dev/null || echo '__CE_UPDATE_VERSION_FAILED__'
Cached version folder(s): !
ls "${CLAUDE_PLUGIN_ROOT}/cache/every-marketplace/compound-engineering/" 2>/dev/null || echo '__CE_UPDATE_CACHE_FAILED__'
以下三个部分包含预解析的数据。只有插件根路径能确定当前会话是否为Claude Code——如果它包含错误标记、空值或字面量
${CLAUDE_PLUGIN_ROOT}
字符串,请告知用户此功能仅在Claude Code中可用并停止操作。即使在有效的Claude Code会话中,另外两个部分也可能包含错误标记;下方的决策逻辑会处理这些情况。
插件根路径: !
echo "${CLAUDE_PLUGIN_ROOT}" 2>/dev/null || echo '__CE_UPDATE_ROOT_FAILED__'
最新发布版本: !
gh release list --repo Everyinc/compound-engineering-plugin --limit 30 --json tagName --jq '[.[] | select(.tagName | startswith("compound-engineering-v"))][0].tagName | sub("compound-engineering-v";"")' 2>/dev/null || echo '__CE_UPDATE_VERSION_FAILED__'
缓存版本文件夹: !
ls "${CLAUDE_PLUGIN_ROOT}/cache/every-marketplace/compound-engineering/" 2>/dev/null || echo '__CE_UPDATE_CACHE_FAILED__'

Decision logic

决策逻辑

1. Platform gate

1. 平台校验

If Plugin root path contains
__CE_UPDATE_ROOT_FAILED__
, a literal
${CLAUDE_PLUGIN_ROOT}
string, or is empty: tell the user this skill requires Claude Code and stop. No further action.
如果插件根路径包含
__CE_UPDATE_ROOT_FAILED__
、字面量
${CLAUDE_PLUGIN_ROOT}
字符串或为空:告知用户此功能需要Claude Code并停止操作,无需进一步动作。

2. Compare versions

2. 版本对比

If Latest released version contains
__CE_UPDATE_VERSION_FAILED__
: tell the user the latest release could not be fetched (gh may be unavailable or rate-limited) and stop.
If Cached version folder(s) contains
__CE_UPDATE_CACHE_FAILED__
: no marketplace cache exists. Tell the user: "No marketplace cache found — this appears to be a local dev checkout or fresh install." and stop.
Take the latest released version and the cached folder list.
Up to date — exactly one cached folder exists AND its name matches the latest version:
  • Tell the user: "compound-engineering v{version} is installed and up to date."
Out of date or corrupted — multiple cached folders exist, OR the single folder name does not match the latest version. Use the Plugin root path value from above to construct the delete path.
Clear the stale cache:
bash
rm -rf "<plugin-root-path>/cache/every-marketplace/compound-engineering"
Tell the user:
  • "compound-engineering was on v{old} but v{latest} is available."
  • "Cleared the plugin cache. Now run
    /plugin marketplace update
    in this session, then restart Claude Code to pick up v{latest}."
如果最新发布版本包含
__CE_UPDATE_VERSION_FAILED__
:告知用户无法获取最新版本(gh可能不可用或达到请求限制)并停止操作。
如果缓存版本文件夹包含
__CE_UPDATE_CACHE_FAILED__
:表示不存在市场缓存。告知用户:“未找到市场缓存——这似乎是本地开发检出或全新安装。”并停止操作。
获取最新发布版本缓存文件夹列表
已为最新版本——仅存在一个缓存文件夹,且其名称与最新版本匹配:
  • 告知用户:“compound-engineering v{version} 已安装且为最新版本。”
版本过期或已损坏——存在多个缓存文件夹,或单个文件夹名称与最新版本不匹配。使用上方的插件根路径值构建删除路径。
清除过期缓存:
bash
rm -rf "<plugin-root-path>/cache/every-marketplace/compound-engineering"
告知用户:
  • "compound-engineering 当前版本为v{old},最新可用版本为v{latest}。"
  • "已清除插件缓存。请在当前会话中运行
    /plugin marketplace update
    ,然后重启Claude Code以获取v{latest}版本。"