-
Notifications
You must be signed in to change notification settings - Fork 27
fix: kit uninstall, HOME directory handling, and legacy migration improvements #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixes #288 - legacy migration was counting 82K+ files because scanFiles() didn't apply SKIP_DIRS_ALL exclusions.
Same bug pattern - getAllFiles() in hash-calculator.ts and skills-manifest.ts only skipped node_modules, not .venv etc. Now uses BUILD_ARTIFACT_DIRS for consistent exclusion.
- Fix getInstalledKits() to return ALL matching kits in legacy format (was returning early after first match, missing merged kits) - Add PathResolver.isAtHomeDirectory(), getLocalClaudeDir(), isLocalSameAsGlobal() - Uninstall: skip scope prompt at HOME (auto-select global), block --local at HOME - Init: warn when installing at HOME, prompt for global confirmation - New: warn when creating project at HOME, prompt for global confirmation - Add tests for HOME directory detection and multi-kit legacy detection
fix: skip node_modules/.venv in legacy migration scan
- installation-detector: skip local when local===global (avoid duplicates) - claudekit-scanner: skip project population when same as global path - conflict-handler: use PathResolver.isLocalSameAsGlobal() for consistency
fix: kit-scoped uninstall and HOME directory edge cases (#287)
Pull Request ReviewThis PR successfully merges accumulated fixes from ✅ Strengths1. Well-Structured Changes
2. Excellent Test Coverage
3. Security & Robustness
4. User Experience Improvements
5. Performance Optimization
📋 Code Quality Observations1. PathResolver Enhancements (src/shared/path-resolver.ts:345-381) isAtHomeDirectory(cwd?: string): boolean
getLocalClaudeDir(baseDir?: string): string
isLocalSameAsGlobal(cwd?: string): boolean
2. Legacy Migration Improvements (src/domains/migration/metadata-migration.ts:232-259) // Legacy format - detect ALL kits from name using word boundaries
const kits: KitType[] = [];
if (/\bengineer\b/i.test(nameToCheck)) kits.push("engineer");
if (/\bmarketing\b/i.test(nameToCheck)) kits.push("marketing");
3. Skip Directories Consolidation (src/shared/skip-directories.ts)
This prevents permission issues and unnecessary scanning. 🔍 Minor Observations1. Deduplication Logic (src/commands/uninstall/installation-detector.ts:33) if (setup.project.path && setup.project.metadata && !isLocalSameAsGlobal) {Consider adding a debug log when skipping due to deduplication to help with troubleshooting. 2. Comment Numbering (src/commands/uninstall/uninstall-command.ts) 3. Error Messages (src/commands/new/phases/directory-setup.ts:132-134) logger.warning(`You're creating a project at HOME directory (${home}).`);🎯 Best Practices AdherenceQuality Gate: ✅ All checks pass Code Standards: ✅ Follows project conventions
Documentation: ✅ Well-documented
🚀 Performance ConsiderationsNo performance concerns identified:
🔒 Security ReviewNo security concerns:
📊 Overall AssessmentRating: Excellent ⭐⭐⭐⭐⭐ This is a well-crafted PR that addresses important edge cases while maintaining code quality and test coverage. The HOME directory handling is particularly thoughtful - it prevents user confusion and potential data loss while providing clear guidance. Recommendation: APPROVE & MERGE The changes are production-ready and improve both the robustness and user experience of the CLI tool. 🎉 Highlights
Great work on this PR! The attention to detail and thorough testing demonstrates strong engineering practices. 🚀 |
|
🎉 This PR is included in version 3.22.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
Merges accumulated fixes from dev to main, including:
PR #290: Kit-scoped uninstall and HOME directory edge cases
isAtHomeDirectory(),isLocalSameAsGlobal()helpersPR #289: Legacy migration skip directories
node_modules/and.venv/during scanFiles Changed (15 files, +275/-30)
uninstall-command.ts,selection-handler.ts,directory-setup.ts,conflict-handler.tsmetadata-migration.ts,legacy-migration.tsskills-manifest.ts,hash-calculator.tsinstallation-detector.ts,claudekit-scanner.tspath-resolver.ts,prompts.tsmetadata-migration.test.ts,path-resolver.test.ts,legacy-migration.test.tsTest Plan