一键导入
update
Check and update CWF plugin to keep installed behavior aligned with latest contracts and fixes. Triggers: "cwf:update", "update cwf", "check for updates"
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Check and update CWF plugin to keep installed behavior aligned with latest contracts and fixes. Triggers: "cwf:update", "update cwf", "check for updates"
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Initial CWF configuration to standardize environment/tool contracts before workflow execution: hook group selection, external tool detection, setup-contract bootstrap, project config bootstrap, optional Agent Team mode setup, optional Codex integration, optional git hook gate installation, optional CWF capability index generation, and optional repository index generation. Triggers: "cwf:setup", "setup hooks", "configure cwf"
Implementation orchestration from a plan to execute approved scope predictably without losing constraints. Decomposes steps into parallelizable work items, spawns domain-appropriate agents, and verifies completion against BDD success criteria. Triggers: "cwf:impl", "implement this plan"
Multi-mode code and skill review for controlling drift as capability surface grows. Quick scan all plugins, commit-based tidying, contract-driven codebase quick scan, deep-review a single skill, holistic cross-plugin analysis, or docs consistency check. Triggers: "cwf:refactor", "/refactor", "tidy", "review skill", "cleanup code", "check docs consistency"
Comprehensive session retrospective that turns one session's outcomes into persistent improvements. Adaptive depth: deep by default, with light mode via --light (and tiny-session auto-light). Triggers: "cwf:retro", "retro", "retrospective", "회고"
Full CWF pipeline auto-chaining for end-to-end delegation without manual stage sequencing. Orchestrates: gather → clarify → plan → review(plan) → impl → review(code) → refactor → retro → ship. Respects Decision #19: human gates pre-impl, autonomous post-impl. Triggers: "cwf:run", "run workflow"
Automate GitHub workflow so validated session artifacts become ship-ready issue/PR/merge actions with explicit human control points. Triggers: "/ship"
| name | update |
| description | Check and update CWF plugin to keep installed behavior aligned with latest contracts and fixes. Triggers: "cwf:update", "update cwf", "check for updates" |
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)