Migrate ck-era .claude drift in /sd:setup - #14
Merged
Conversation
/sd:setup classified a project as `complete` on file presence alone and exited, so projects scaffolded under the old `ck` engine name kept stale `.claude/*` references - most critically three hooks pointing at the non-existent ~/.claude/hooks/ck/ dir, silently not firing. Add Phase 1.5 (drift check & migrate): rule-based detection against the loaded templates (seeded by the ck->sd rename) covering hook paths, $schema, /ck:* names in _use docs, missing fields (ticket.snapshot, paths.layers), pinned model IDs, and stale settings.local.json perms. Runs in `complete` and `partial`, previews every change in one batch gate, backs up each file, and verifies hook paths resolve on disk (also added to Phase 7). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Closes #13
Problem
/sd:setupclassified a project ascompleteon file presence alone and exited, so projects scaffolded under the oldck(ck-spec-system) engine name kept stale.claude/*references that were never migrated. Most critically, all three Claude Code hooks pointed at the non-existent~/.claude/hooks/ck/directory and were silently not firing.Change
Adds Phase 1.5 - Drift check & migrate to
commands/setup.md:<<placeholder>>and project-specific values are preserved) against the templates loaded in Phase 0, seeded by theck->sdrename but generic in shape so future renames / new fields are caught too:settings.json: hook namespace dirs (hooks/ck->hooks/sd), missing_bash_adaptation/_schema_notesblocks, stale_comment_top.project-config.json:$schemaURL,/ck:*//ck:*names in_usedocs, missingticket.snapshot/paths.layers, pinned model IDs -> aliases.settings.local.json: stale...\templates\ck\permission paths.completeandpartialstates (whenever.claude/project-config.jsonor.claude/settings.jsonexists) - thecompleteearly exit now happens only after a clean drift check.commandpath resolves on disk and warns loudly otherwise (the symptom that made the bug invisible). Also added to Phase 7..bak.<timestamp>, then applies targeted, value-preserving patches.No flag (decided against - automatic-but-gated is what actually fixes the silent gap). Stays zero-argument.
Verification
scripts\validate.ps1- all 6 checks pass, including the real install-to-temp count (commands/sd= 10 files, so the edited command installs cleanly) and the CHANGELOG[Unreleased]gate. Manual/sd:setupwalkthrough against a staleck-era fixture is documented in the plan (requires interactive slash-command execution; not CI-runnable).🤖 Generated with Claude Code