claude-update-wizard
Smart update for SDLC wizard — shows changelog, compares files, lets you selectively adopt changes while preserving customizations.
BaseInfinity · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add BaseInfinity/claude-sdlc-harness --skill claude-update-wizard技能说明
name: claude-update-wizard description: Smart update for SDLC wizard — shows changelog, compares files, lets you selectively adopt changes while preserving customizations. argument-hint: "[optional: check-only | force-all]" effort: high
Update Wizard - Smart SDLC Update
Task
$ARGUMENTS
Purpose
Guided update assistant. Check what version the user has, show what changed, walk them through selectively adopting updates while preserving their customizations. DO NOT blindly overwrite files. Show diffs and let the user decide.
MANDATORY FIRST ACTION: Read the Wizard Doc
Before doing ANYTHING else, use Read on CLAUDE_CODE_SDLC_WIZARD.md — specifically the "Staying Updated (Idempotent Wizard)" section near the end. This contains update URLs, version tracking format, and step registry. Do NOT proceed without reading it first.
Execution Checklist
Follow steps IN ORDER. Do not skip or combine.
Step 1: Read Installed Version
Read SDLC.md and extract from the metadata comment:
<!-- SDLC Harness Version: X.X.X -->
<!-- Completed Steps: ... -->
No version comment → treat as 0.0.0 (suggest /claude-setup-wizard instead).
Step 1.5: Check CLI Version (ROADMAP #232)
The wizard files in the user's project are one half of the install. The other half is the npm CLI (agentic-sdlc-wizard) — the binary powering npx agentic-sdlc-wizard init/check/complexity. If init ran months ago, npx cache (or global install) can be stuck on an old version even after /claude-update-wizard patches project files in-session. This step closes that gap.
Detection — try both paths:
-
Global install (rare):
npm ls -g agentic-sdlc-wizard --json --depth=0 2>/dev/null | jq -r '.dependencies["agentic-sdlc-wizard"].version // empty' -
npx cache (common): find every
package.jsonunder~/.npm/_npxmatching*agentic-sdlc-wizard*, extract.version, pick the largest by semver (do NOT usesort -u | tail -1— lexicographic treats1.9.0 > 1.10.0). Use a Nodecmp()helper: split on-for prerelease tag, comparemajor.minor.patchnumerically, then prerelease order. Track max across stdin lines; empty input → empty output.
If both paths return empty, the user may be running from a custom install or never used npx. Treat as undetectable — note in the report but do not block. Skip the CLI bump prompt; continue to Step 2.
Registry comparison:
curl -fsS "https://registry.npmjs.org/agentic-sdlc-wizard/latest" | jq -r '.version'
Cache the result (also used in Step 3).
Compare with semver-aware logic — sort -V does NOT correctly order prereleases. Reuse the Node cmp() helper to produce exit 0 (installed < latest), 1 (installed > latest), 2 (equal).
Surface the result:
installed == latest→ silent, continue.installed < latest→ show the gap with the upgrade options below.installed > latest(rare — pre-release/local dev) → silent, continue.
Upgrade options when behind:
Your
agentic-sdlc-wizardCLI is at {installed}, npm has {latest}. Step 6 refreshes project files, butnpxcache keeps the old CLI on disk fornpx agentic-sdlc-wizard check/init/complexity.A. Refresh just the CLI cache (recommended). No project changes; Step 6 handles the rest with diffs:
npx -y agentic-sdlc-wizard@latest --versionB. One-shot CLI + project re-init. Refreshes CLI AND overwrites non-settings managed files (skills, hooks, templates) with latest.
settings.jsonis smart-merged (custom hooks + permissions preserved); other managed files are NOT smart-merged — local edits are lost unless committed. Use only if no local skill/hook customizations:npx -y agentic-sdlc-wizard@latest init --forceC. Skip the CLI bump. Keep stale CLI; this session's file updates apply but
npx ... checkkeeps using old drift logic.Pick A, B, or C:
[A/B/C](default A)
If A: prompt the user to run the one-liner, then re-invoke /claude-update-wizard. If B: same with the warning. If C: log the choice and continue.
check-only precedence: if passed, Step 1.5 runs report-only — print the gap if found, but do NOT prompt or run init --force. Fallback when CLI undetectable: skip the bump prompt, surface unknown-state in the report, continue to Step 2.
Why Step 1.5, not later: subsequent steps shell out to npx agentic-sdlc-wizard check (Step 4). If the CLI is stale, Step 4 reports based on the OLD definition of managed files and may miss new templates entirely.
Step 2: Fetch Latest CHANGELOG
WebFetch:
https://raw.githubusercontent.com/BaseInfinity/claude-sdlc-harness/main/CHANGELOG.md
Extract latest version from the first ## [X.X.X] line.
Step 3: Compare Versions and Show What Changed
Resolve "latest installable" from npm registry (#405): Compare the npm registry version (Step 1.5 cache) to the CHANGELOG heading version (Step 2). Use the lower of the two as "latest installable" — avoids showing a version not yet published to npm during the publish window. If CHANGELOG is ahead, note it's on GitHub but not yet published.
Parse CHANGELOG entries between the user's installed version and the resolved latest installable. Present a clear summary:
Installed: 1.42.0
Latest: 1.99.2
What changed:
- [1.92.0] Cowork `Stop` hook REMOVED — it fired 12 times in one session and was wrong 11; Cowork now has no completion enforcement (documented in cowork/README.md).
- [1.91.0] TDD hook fixed for monorepos — it had been silently dead since Claude Code 2.1.214 for any repo whose source is not at root `src/`; driver effort default is now `high` (complex) / `medium` (routine web/CRUD).
- [1.90.0] Stop hook no longer blocks on in-flight background work; the documented Cowork install URL is corrected (it could not have worked); review-loop, convergence and TDD RED-per-assertion guidance added
- [1.89.0] Stop ho
阅读完整来源 ↗