refactor: shared onboarding helper + consistent init/update output#961
Draft
1code-async[bot] wants to merge 1 commit intomainfrom
Draft
refactor: shared onboarding helper + consistent init/update output#9611code-async[bot] wants to merge 1 commit intomainfrom
1code-async[bot] wants to merge 1 commit intomainfrom
Conversation
…date The init and update commands had divergent "getting started" messages, duplicated WORKFLOW_TO_SKILL_DIR constants, and copy-pasted skill/command removal methods. This caused update to hardcode /opsx:new regardless of the active profile, while init correctly showed /opsx:propose for core. Extract shared helpers so both commands produce consistent, profile-aware onboarding output and share a single implementation for artifact removal. - Add src/core/shared/onboarding.ts (formatGettingStarted, printOnboardingFooter) - Add src/core/shared/artifact-removal.ts (removeAll/Unselected SkillDirs/CommandFiles) - Remove duplicate WORKFLOW_TO_SKILL_DIR from init.ts (canonical source: profile-sync-drift.ts) - Remove 4 private removal methods from UpdateCommand, 2 from InitCommand - Fix update legacy-upgrade onboarding to respect active profile - Add shared-onboarding.test.ts and output-consistency.test.ts Co-Authored-By: Claude Opus 4.6 <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.
Summary
initandupdatehad divergent onboarding output —updatehardcoded/opsx:newregardless of profile, whileinitcorrectly chose/opsx:proposefor core profile. Both commands also copy-pastedremoveSkillDirs/removeCommandFilesand theWORKFLOW_TO_SKILL_DIRconstant independently.onboarding.ts,artifact-removal.ts) so both commands produce consistent, profile-aware output from a single source of truth.What changed
src/core/shared/onboarding.tsformatGettingStarted,printOnboardingFooter,formatIdeRestart,formatLinkssrc/core/shared/artifact-removal.tsremoveAllSkillDirs,removeUnselectedSkillDirs,removeAllCommandFiles,removeUnselectedCommandFilessrc/core/shared/index.tssrc/core/init.tsWORKFLOW_TO_SKILL_DIR, 2 private removal methods, inline onboarding footersrc/core/update.tstest/core/update.test.ts/opsx:new→/opsx:propose(matches corrected behavior)test/core/shared-onboarding.test.tsformatGettingStarted,formatLinks,formatIdeRestart,printOnboardingFootertest/core/output-consistency.test.tsNet effect
Follow-ups (not in this PR)
formatUpdateSummary()would make these consistent too.ToolSelectorclass would prevent future drift.Test plan
shared-onboarding.test.ts: All profile combinations produce correct commandsoutput-consistency.test.ts: init and update produce identical IDE-restart wording, correct links, profile-aware getting-startedinit.test.ts: All 26 existing tests pass (no regressions)update.test.ts: All 42 tests pass (1 assertion updated to match fixed behavior)migration.test.ts: All 7 tests pass🤖 Generated with Claude Code