yusyus
67c3ab9574
feat(cli): Implement formal preset system for analyze command (Phase 4)
Replaces hardcoded preset logic with a clean, maintainable PresetManager
architecture. Adds comprehensive deprecation warnings to guide users toward
the new --preset flag while maintaining backward compatibility.
## What Changed
### New Files
- src/skill_seekers/cli/presets.py (200 lines)
* AnalysisPreset dataclass
* PRESETS dictionary (quick, standard, comprehensive)
* PresetManager class with apply_preset() logic
- tests/test_preset_system.py (387 lines)
* 24 comprehensive tests across 6 test classes
* 100% test pass rate
### Modified Files
- src/skill_seekers/cli/parsers/analyze_parser.py
* Added --preset flag (recommended way)
* Added --preset-list flag
* Marked --quick/--comprehensive/--depth as [DEPRECATED]
- src/skill_seekers/cli/codebase_scraper.py
* Added _check_deprecated_flags() function
* Refactored preset handling to use PresetManager
* Replaced 28 lines of if-statements with 7 lines of clean code
### Documentation
- PHASE4_COMPLETION_SUMMARY.md - Complete implementation summary
- PHASE1B_COMPLETION_SUMMARY.md - Phase 1B chunking summary
## Key Features
### Formal Preset Definitions
- **Quick** ⚡: 1-2 min, basic features, enhance_level=0
- **Standard** 🎯: 5-10 min, core features, enhance_level=1 (DEFAULT)
- **Comprehensive** 🚀: 20-60 min, all features + AI, enhance_level=3
### New CLI Interface
```bash
# Recommended way (no warnings)
skill-seekers analyze --directory . --preset quick
skill-seekers analyze --directory . --preset standard
skill-seekers analyze --directory . --preset comprehensive
# Show available presets
skill-seekers analyze --preset-list
# Customize presets
skill-seekers analyze --directory . --preset quick --enhance-level 1
```
### Backward Compatibility
- Old flags still work: --quick, --comprehensive, --depth
- Clear deprecation warnings with migration paths
- "Will be removed in v3.0.0" notices
### CLI Override Support
Users can customize preset defaults:
```bash
skill-seekers analyze --preset quick --skip-patterns false
skill-seekers analyze --preset standard --enhance-level 2
```
## Testing
All tests passing:
- 24 preset system tests (test_preset_system.py)
- 16 CLI parser tests (test_cli_parsers.py)
- 15 upload integration tests (test_upload_integration.py)
Total: 55/55 PASS
## Benefits
### Before (Hardcoded)
```python
if args.quick:
args.depth = "surface"
args.skip_patterns = True
# ... 13 more assignments
elif args.comprehensive:
args.depth = "full"
# ... 13 more assignments
else:
# ... 13 more assignments
```
**Problems:** 28 lines, repetitive, hard to maintain
### After (PresetManager)
```python
preset_name = args.preset or ("quick" if args.quick else "standard")
preset_args = PresetManager.apply_preset(preset_name, vars(args))
for key, value in preset_args.items():
setattr(args, key, value)
```
**Benefits:** 7 lines, clean, maintainable, extensible
## Migration Guide
Deprecation warnings guide users:
```
⚠️ DEPRECATED: --quick → use --preset quick instead
⚠️ DEPRECATED: --comprehensive → use --preset comprehensive instead
⚠️ DEPRECATED: --depth full → use --preset comprehensive instead
💡 MIGRATION TIP:
--preset quick (1-2 min, basic features)
--preset standard (5-10 min, core features, DEFAULT)
--preset comprehensive (20-60 min, all features + AI)
⚠️ Deprecated flags will be removed in v3.0.0
```
## Architecture
Strategy Pattern implementation:
- PresetManager handles preset selection and application
- AnalysisPreset dataclass ensures type safety
- Factory pattern makes adding new presets easy
- CLI overrides provide customization flexibility
## Related Changes
Phase 4 is part of the v2.11.0 RAG & CLI improvements:
- Phase 1: Chunking Integration ✅
- Phase 2: Upload Integration ✅
- Phase 3: CLI Refactoring ✅
- Phase 4: Preset System ✅ (this commit)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-08 01:56:01 +03:00
..
2025-10-29 23:19:32 +03:00
2026-02-08 01:30:04 +03:00
2025-10-19 02:08:58 +03:00
2026-01-17 23:02:11 +03:00
2026-02-07 22:55:02 +03:00
2025-10-19 17:01:37 +03:00
2026-02-07 22:51:06 +03:00
2026-02-03 21:37:54 +03:00
2026-01-31 21:30:00 +03:00
2026-01-17 17:48:15 +00:00
2026-01-18 00:01:30 +03:00
2026-01-18 00:01:30 +03:00
2026-02-07 20:59:03 +03:00
2026-01-17 23:02:11 +03:00
2026-01-29 22:56:33 +03:00
2026-01-17 23:25:12 +03:00
2026-02-08 00:59:22 +03:00
2026-02-08 01:39:16 +03:00
2026-02-03 21:00:34 +03:00
2026-02-07 20:59:03 +03:00
2026-01-17 17:29:21 +00:00
2026-02-05 21:27:41 +03:00
2026-01-17 23:02:11 +03:00
2026-01-31 21:30:00 +03:00
2026-01-17 17:48:15 +00:00
2026-01-17 17:48:15 +00:00
2026-01-17 22:54:40 +03:00
2026-01-17 23:02:11 +03:00
2026-02-07 13:48:05 +03:00
2026-02-07 20:59:03 +03:00
2026-02-04 10:14:20 +01:00
2026-01-17 17:48:15 +00:00
2026-01-17 23:02:11 +03:00
2026-02-05 22:02:06 +03:00
2026-01-17 17:48:15 +00:00
2026-01-17 23:02:11 +03:00
2026-01-17 23:02:11 +03:00
2026-01-17 23:02:11 +03:00
2026-01-18 00:01:30 +03:00
2026-01-18 00:01:30 +03:00
2026-01-31 21:30:00 +03:00
2026-02-07 13:42:14 +03:00
2026-01-18 00:01:30 +03:00
2026-01-17 17:48:15 +00:00
2026-01-17 23:02:11 +03:00
2026-01-17 17:48:15 +00:00
2026-02-07 22:55:02 +03:00
2026-01-31 14:58:09 +03:00
2026-01-18 12:11:01 +03:00
2026-02-04 21:20:23 +03:00
2026-01-17 17:29:21 +00:00
2026-01-17 23:02:11 +03:00
2026-01-18 00:01:30 +03:00
2026-01-17 17:29:21 +00:00
2026-01-17 23:33:34 +03:00
2026-01-17 23:02:11 +03:00
2026-01-17 23:02:11 +03:00
2026-01-17 23:02:11 +03:00
2026-02-07 20:59:03 +03:00
2026-01-17 17:48:15 +00:00
2026-01-17 17:48:15 +00:00
2026-02-07 13:45:01 +03:00
2026-01-17 17:48:15 +00:00
2026-02-03 21:00:34 +03:00
2026-01-17 17:48:15 +00:00
2026-01-17 17:48:15 +00:00
2026-01-17 22:54:40 +03:00
2026-02-04 21:00:49 +03:00
2026-01-27 21:11:04 +03:00
2026-01-17 17:29:21 +00:00
2026-02-08 01:56:01 +03:00
2026-01-17 17:48:15 +00:00
2026-02-07 13:54:44 +03:00
2026-02-07 20:53:44 +03:00
2026-01-17 17:48:15 +00:00
2026-01-17 23:02:11 +03:00
2026-01-17 17:48:15 +00:00
2026-01-17 23:25:12 +03:00
2026-01-18 13:48:37 +03:00
2026-01-18 00:01:30 +03:00
2026-01-17 23:02:11 +03:00
2026-01-17 23:02:11 +03:00
2026-02-07 13:39:43 +03:00
2026-01-17 23:02:11 +03:00
2026-01-17 23:02:11 +03:00
2026-02-02 23:08:25 +03:00
2026-01-17 23:02:11 +03:00
2026-01-17 22:54:40 +03:00
2026-01-17 23:25:12 +03:00
2026-02-08 01:30:04 +03:00
2026-01-17 17:48:15 +00:00
2026-02-04 21:16:13 +03:00
2026-01-17 17:29:21 +00:00