From cwf
Checks and updates CWF plugin across scopes to align with latest marketplace versions and fixes. Triggers: 'cwf:update', 'update cwf', 'check for updates'.
npx claudepluginhub corca-ai/claude-plugins --plugin cwfThis skill uses the workspace's default tool permissions.
Keep installed CWF behavior aligned with the latest marketplace version and fixes, with scope-aware reconciliation for Codex integration paths.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Keep installed CWF behavior aligned with the latest marketplace version and fixes, with scope-aware reconciliation for Codex integration paths.
cwf:update # Check + auto-update selected scope if newer version exists
cwf:update --check # Version/scope/reconcile check only (no install, no mutation)
Resolve active scope using the safe parsing flow in scope-reconcile.md (no eval).
Mandatory behavior:
none, do not default to user; ask for explicit target scope.project/local and project root is missing, resolve fallback root via git top-level (or current cwd).Use scope selection prompt/options from scope-reconcile.md.
Safety guard:
user, require a second explicit confirmation before update/reconcile mutation.Resolve current installed entry from claude plugin list --json for selected scope:
plugin_list_json="$(claude plugin list --json 2>/dev/null || printf '[]')"
current_install_path="$(
printf '%s' "$plugin_list_json" \
| jq -r --arg scope "$selected_scope" \
'[.[] | select(.id | startswith("cwf@")) | select(.scope == $scope) | .installPath] | first // empty'
)"
[ -n "$current_install_path" ] || {
echo "CWF is not installed in scope: $selected_scope"
exit 1
}
current_plugin_json="$current_install_path/.claude-plugin/plugin.json"
[ -f "$current_plugin_json" ] || {
echo "plugin.json not found for selected scope: $current_plugin_json"
exit 1
}
current_plugin_root="$current_install_path"
current_version="$(jq -r '.version' "$current_plugin_json")"
baseline_root="$(mktemp -d "${TMPDIR:-/tmp}/cwf-before.XXXXXX")"
cp -a "$current_plugin_root"/. "$baseline_root"/
old_diff_root="$baseline_root"
Always refresh marketplace metadata first:
claude plugin marketplace update corca-plugins
Run authoritative consistency checker after marketplace refresh:
consistency_json="$(
bash {CWF_PLUGIN_DIR}/scripts/check-update-latest-consistency.sh \
--mode top-level \
--scope "$selected_scope" \
--json
)"
Parse result:
verdict="$(printf '%s' "$consistency_json" | jq -r '.verdict // "UNVERIFIED"')"
consistency_reason="$(printf '%s' "$consistency_json" | jq -r '.reason // "UNKNOWN"')"
checked_current_version="$(printf '%s' "$consistency_json" | jq -r '.current_version // empty')"
authoritative_latest_version="$(printf '%s' "$consistency_json" | jq -r '.authoritative_latest // empty')"
Fail-closed rule:
if [ "$verdict" = "UNVERIFIED" ]; then
echo "Latest-version verification is UNVERIFIED (reason: $consistency_reason)."
echo "Do not emit success-style no-update verdicts in this state."
echo "Re-run from a top-level environment where marketplace update + authoritative fetch are available."
exit 2
fi
Then set compare values and post-marketplace snapshot:
[ -n "$checked_current_version" ] || {
echo "Current version missing from consistency check output."
exit 1
}
[ -n "$authoritative_latest_version" ] || {
echo "Authoritative latest version missing from consistency check output."
exit 1
}
current_version="$checked_current_version"
latest_version="$authoritative_latest_version"
authoritative_snapshot_root="$(mktemp -d "${TMPDIR:-/tmp}/cwf-after-marketplace.XXXXXX")"
cp -a "$current_install_path"/. "$authoritative_snapshot_root"/
new_diff_root="$authoritative_snapshot_root"
Report:
Target scope: user|project|local
Current version: 0.6.0
Latest version: 0.7.0
Verdict: UP_TO_DATE|OUTDATED
Persist for later phases: old_diff_root, new_diff_root, current_version, latest_version, verdict, selected_scope, selected_project_root.
Skip this phase if --check was used or verdict=UP_TO_DATE, and report that no update mutation was applied when the skip reason is parity. verdict=UNVERIFIED never enters this phase (fail-closed in Phase 1.3).
Run scope-aware update:
echo "Updating CWF in scope $selected_scope from $current_version to $latest_version..."
claude plugin update "cwf@corca-plugins" --scope "$selected_scope"
If update command is unavailable in current runtime, fallback:
claude plugin install "cwf@corca-plugins" --scope "$selected_scope"
Re-resolve selected-scope install path after update and overwrite new_diff_root:
post_list_json="$(claude plugin list --json 2>/dev/null || printf '[]')"
installed_install_path="$(
printf '%s' "$post_list_json" \
| jq -r --arg scope "$selected_scope" \
'[.[] | select(.id | startswith("cwf@")) | select(.scope == $scope) | .installPath] | first // empty'
)"
[ -n "$installed_install_path" ] || {
echo "Installed CWF metadata not found after update for scope: $selected_scope"
exit 1
}
installed_plugin_json="$installed_install_path/.claude-plugin/plugin.json"
installed_version="$(jq -r '.version' "$installed_plugin_json")"
post_install_root="$(mktemp -d "${TMPDIR:-/tmp}/cwf-after-install.XXXXXX")"
cp -a "$installed_install_path"/. "$post_install_root"/
new_diff_root="$post_install_root"
latest_version="$installed_version"
CWF updated in scope {selected_scope} to {installed_version}. Restart Claude Code for changes to take effect.
Goal: repair stale Codex symlink/wrapper targets when plugin install paths change across versions.
Detect integration signals using the detailed flow in scope-reconcile.md.
Detection output must track:
skills_link_presentwrapper_activewrapper_link_present (wrapper link exists even when Active is false)--check: never mutate; report detection only and print recommended reconcile commands.skills_link_present=true, run sync-skills.sh for selected scope.wrapper_link_present=true or wrapper_active=true, run install-wrapper.sh --enable for selected scope (without --add-path) to repoint stale wrapper links.Command templates are maintained in scope-reconcile.md.
Always report:
type -a codex for command-resolution visibilitybash {CWF_PLUGIN_DIR}/scripts/codex/install-wrapper.sh --scope "$selected_scope" ${selected_project_root:+--project-root "$selected_project_root"} --disable
For skill-link rollback, direct user to scope backup roots:
~/.agents/.skill-sync-backup/*{projectRoot}/.codex/.skill-sync-backup/*Include alias boundary note:
codex by command name inherit wrapper behaviorAfter update/check, ask whether to summarize diff evidence.
Use AskUserQuestion:
Show change summary for differences between {current_version} and {latest_version}?
Options: Yes, summarize / No, skip
No, skip, do not run diff commands and continue.Yes, summarize, collect and summarize diff evidence with stable roots:git --no-pager diff --no-index --name-status "$old_diff_root" "$new_diff_root" || true
git --no-pager diff --no-index \
"$old_diff_root/README.md" \
"$new_diff_root/README.md" || true
SKILL.md/script/manifest changes from name-status diff.Add update to cwf-state.yaml current session's stage_checkpoints list if lessons were recorded during the update process.
--scope.--check), apply update immediately without a separate update-confirmation prompt.none, require explicit scope selection before mutation.cwf:update --check must not install/update/reconcile; it reports status and suggested commands only.No update needed when verdict is UNVERIFIED.contract, top-level)