feat(cli): init nudges when local CLI is behind npm latest (#358)#361
Merged
Conversation
3 tasks
BaseInfinity
added a commit
that referenced
this pull request
May 26, 2026
The original #358 PR (#361) shipped with three tests (nudge-fires-when-stale, silent-when-current, silent-when-cache-poisoned) but didn't explicitly cover the silent-when-offline path. Fault-injects a fake `npm` that always exits 1 to catch regressions where someone removes the try/catch wrapping execSync. Verified locally: test-cli.sh 92/92 (4 #358 tests, all green).
`npx agentic-sdlc-wizard init` (no @latest pin) silently serves whatever version is cached on disk, sometimes months old. The /update Step 1.5 pattern already catches this — but only at /update time, after the user has already installed stale templates. This moves the same check to init time so the gap surfaces immediately: - cli/init.js: new maybeEmitStaleCliNudge() called before planOperations. Reuses SDLC_WIZARD_CACHE_DIR/latest-version (24h TTL, #239 poison check), falls back to `npm view` with 5s timeout, silent on offline/error. - README.md + CLAUDE_CODE_SDLC_WIZARD.md: install command recommends `npx -y agentic-sdlc-wizard@latest init` so first-time users skip the cache trap by default. - tests/test-cli.sh: 3 quality tests covering nudge-fires-when-stale, silent-when-current, no-reverse-nudge-when-poisoned. Bundled: ROADMAP #347 + #350 status flip from "Actionable now" to DONE with PR citations (#351/#355/#354). Both shipped this week — paperwork was stale. Verified locally: test-cli.sh 91/91, test-doc-consistency 40/40, test-docs-usability 29/29, test-update-skill-cli-version 8/8, test-hooks 156/156, test-setup-path 83/83, test-self-update 153/153.
5 tasks
BaseInfinity
added a commit
that referenced
this pull request
May 26, 2026
(#363) PR #361 shipped 3 #358 tests where Test C was silent-when-cache-poisoned rather than the goal-named silent-when-offline. The /goal Haiku evaluator counted tests by file presence and approved completion. Caught only at post-merge self-review, fixed in PR #362 (added the real offline test via fake-npm PATH override). Promoted to SDLC.md ## Lessons Learned → ### Testing so future sessions inherit the rule: when a /goal condition enumerates test cases by name, self-review must verify each named test exists by reading assertions, not by counting matching `test_` functions. This is the per-test-fidelity layer beneath PR #355's HIGH-95%-confidence and DLC-binding gates — those work at the macro level, but enumerated- condition fidelity is the author's responsibility. Verified locally: test-doc-consistency 40/40, test-postmortem-lessons 7/7, test-memory-audit-protocol 12/12.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cli/init.jsaddsmaybeEmitStaleCliNudge()— called beforeplanOperations, reuses theSDLC_WIZARD_CACHE_DIR/latest-versioncache the session-start hook already populates ([LOW] Auto-Update: Claude Code v2.1.66 #64/fix(ci): resolve persist-to-PR-branch push race (closes ROADMAP #193) #196), falls back tonpm view(5s timeout), silent on offline/error. Mirrors the/updateStep 1.5 pattern but at init time, where stale-npx-cache bites hardest.README.md+CLAUDE_CODE_SDLC_WIZARD.mdinstall commands now recommendnpx -y agentic-sdlc-wizard@latest initso first-time users skip the cache trap by default.tests/test-cli.shadds 3 quality tests covering: nudge-fires-when-stale (sentinel999.999.999), silent-when-current, no-reverse-nudge-when-cache-poisoned (mirrors hooks: instructions-loaded-check.sh serves stale cache when npm view silently fails (EPERM) #239 sanity).Bundled paperwork
ROADMAP.mdflips Research Claude equivalent for goal-mode checkpoint workflow #347 + docs(roadmap): correct #347 — native /goal exists; add #350 cadence-gap fix #350 from "Actionable now" to DONE with PR citations (feat(cc-features): document new CC features + ship /goal /sdlc wrapper (closes #347) #351 / feat(sdlc): /goal SDLC-discipline gates — 95% confidence floor + DLC binding (PR-D) #355 / feat(ci): cc-version-drift.yml — open issue when CC baseline drifts >5 patch releases (closes #350) #354). Both shipped this week — ROADMAP was stale.Closes
Test plan
tests/test-cli.sh— 91/91 (3 new [feature] init should detect when npx cache serves stale CLI version (no @latest pin) #358 tests + 88 pre-existing)tests/test-doc-consistency.sh— 40/40tests/test-docs-usability.sh— 29/29 (release-accuracy check passes)tests/test-update-skill-cli-version.sh— 8/8 (Step 1.5 pattern unchanged)tests/test-hooks.sh— 156/156 (cache contract still compatible)tests/test-setup-path.sh— 83/83 (init exercised across 7 fixture types)tests/test-self-update.sh— 153/153 (version detection unchanged)validateWhy this is the right shape
fs,require,execSync) is wrapped — the nudge never breaks init.cli/init.jsandtests/test-cli.sh; no new hooks, no new skills, no plugin manifest changes.