|
1 | 1 | # Changelog |
2 | 2 |
|
| 3 | +## [0.2.0] - 2025-09-30 |
| 4 | + |
| 5 | +### 🚀 **Major Release: Folder-Based Prompts & Comprehensive Version Management** |
| 6 | + |
| 7 | +This is a **major architectural release** that fundamentally transforms how Promptix manages prompts, introducing a Git-native, folder-based structure and comprehensive version management system. This release enhances developer experience, improves Git integration, and provides professional version control for AI prompts. |
| 8 | + |
| 9 | +### 🎯 Breaking Changes |
| 10 | + |
| 11 | +#### **Folder-Based Prompt Storage** |
| 12 | +- **Migration from `prompts.yaml` to `prompts/` directory structure** |
| 13 | +- Each prompt now lives in its own folder with dedicated configuration and version history |
| 14 | +- **Migration is automatic** - existing `prompts.yaml` files are automatically migrated to the new structure |
| 15 | +- New structure provides: |
| 16 | + - Better Git diffs (changes to individual files instead of large YAML) |
| 17 | + - Clearer version history with dedicated version files |
| 18 | + - Improved readability and organization |
| 19 | + - Easier collaboration and code review |
| 20 | + |
| 21 | +**New Structure:** |
| 22 | +``` |
| 23 | +prompts/ |
| 24 | +├── CustomerSupport/ |
| 25 | +│ ├── config.yaml # Prompt metadata and configuration |
| 26 | +│ ├── current.md # Current active version |
| 27 | +│ └── versions/ |
| 28 | +│ ├── v1.md # Version history |
| 29 | +│ ├── v2.md |
| 30 | +│ └── v3.md |
| 31 | +``` |
| 32 | + |
| 33 | +**Old Structure (deprecated):** |
| 34 | +``` |
| 35 | +prompts.yaml # All prompts in one file |
| 36 | +``` |
| 37 | + |
| 38 | +### Added |
| 39 | + |
| 40 | +#### **Comprehensive Version Management System** |
| 41 | +- **Automatic Version Creation**: Pre-commit hooks automatically create new versions when `current.md` changes |
| 42 | +- **Version Switching**: Switch between different prompt versions with CLI or config |
| 43 | +- **Version Tracking**: `current_version` field in `config.yaml` tracks active version |
| 44 | +- **Version Header Removal**: Automatic removal of version metadata from prompt content |
| 45 | +- **Dual Support**: Backward compatibility with legacy `is_live` flags while supporting new `current_version` tracking |
| 46 | + |
| 47 | +#### **Enhanced CLI Tools** |
| 48 | +- **`promptix version` command group**: |
| 49 | + - `promptix version list <agent>` - List all versions for an agent |
| 50 | + - `promptix version create <agent>` - Manually create a new version |
| 51 | + - `promptix version switch <agent> <version>` - Switch to a specific version |
| 52 | + - `promptix version get <agent>` - Get current active version |
| 53 | + |
| 54 | +- **`promptix hooks` command group**: |
| 55 | + - `promptix hooks install` - Install pre-commit hook for automatic versioning |
| 56 | + - `promptix hooks uninstall` - Remove pre-commit hook |
| 57 | + - `promptix hooks status` - Check hook installation status |
| 58 | + - Automatic backup/restore of existing hooks |
| 59 | + - Safe hook installation with error handling |
| 60 | + |
| 61 | +#### **Git Pre-commit Hook** |
| 62 | +- **Automatic version creation** when `current.md` files are modified |
| 63 | +- **Automatic version deployment** when `current_version` changes in `config.yaml` |
| 64 | +- Intelligent file detection and processing |
| 65 | +- Rich console output with clear status messages |
| 66 | +- Comprehensive error handling and edge case coverage |
| 67 | +- **Hooks directory** at repository root for easy version control |
| 68 | + |
| 69 | +#### **Enhanced Prompt Loader** |
| 70 | +- Automatic version header removal from prompt content |
| 71 | +- Metadata integration from version headers |
| 72 | +- Improved error messages and handling |
| 73 | +- Support for both legacy and new version formats |
| 74 | +- Better caching and performance optimization |
| 75 | + |
| 76 | +#### **Workspace Manager** |
| 77 | +- New `workspace_manager.py` module for prompt workspace operations |
| 78 | +- Handles migration from `prompts.yaml` to folder structure |
| 79 | +- Validates prompt configurations |
| 80 | +- Manages workspace consistency and integrity |
| 81 | + |
| 82 | +#### **Comprehensive Documentation** |
| 83 | +- **VERSIONING_GUIDE.md**: Complete guide to the auto-versioning system |
| 84 | + - Quick start instructions |
| 85 | + - Architecture overview |
| 86 | + - Workflow examples |
| 87 | + - Git integration details |
| 88 | + - Troubleshooting guide |
| 89 | + |
| 90 | +- **TESTING_VERSIONING.md**: Comprehensive testing documentation |
| 91 | + - Test structure overview |
| 92 | + - How to run tests |
| 93 | + - Coverage information |
| 94 | + - Test categories and examples |
| 95 | + |
| 96 | +#### **Extensive Test Suite** |
| 97 | +- **21 new test files** with over 5,100 lines of test code |
| 98 | +- **Unit tests**: |
| 99 | + - `test_precommit_hook.py` - Pre-commit hook functionality (439 lines) |
| 100 | + - `test_enhanced_prompt_loader.py` - Enhanced prompt loader (414 lines) |
| 101 | + - `test_version_manager.py` - Version manager CLI (421 lines) |
| 102 | + - `test_hook_manager.py` - Hook manager CLI (508 lines) |
| 103 | + |
| 104 | +- **Integration tests**: |
| 105 | + - `test_versioning_integration.py` - Full workflow tests (491 lines) |
| 106 | + |
| 107 | +- **Functional tests**: |
| 108 | + - `test_versioning_edge_cases.py` - Edge cases and error conditions (514 lines) |
| 109 | + |
| 110 | +- **Test helpers**: |
| 111 | + - `precommit_helper.py` - Testable pre-commit hook wrapper (325 lines) |
| 112 | + |
| 113 | +#### **Cross-Platform Testing Improvements** |
| 114 | +- **Windows CI fixes** for Git repository cleanup |
| 115 | +- Cross-platform directory removal utilities in test suite |
| 116 | +- Safe file handling for read-only files on Windows |
| 117 | +- Improved test reliability across Ubuntu, Windows, and macOS |
| 118 | + |
| 119 | +#### **CI/CD Enhancements** |
| 120 | +- Updated GitHub Actions dependencies: |
| 121 | + - `actions/checkout` from v3 to v5 |
| 122 | + - `actions/setup-python` from v4 to v6 |
| 123 | + - `codecov/codecov-action` from v4 to v5 |
| 124 | +- Improved CI reliability and performance |
| 125 | +- Better dependency management with Dependabot |
| 126 | + |
| 127 | +### Changed |
| 128 | + |
| 129 | +- **Version Update**: Bumped from 0.1.16 to 0.2.0 (major version bump for breaking changes) |
| 130 | +- **CLI Architecture**: Enhanced CLI with command groups for better organization |
| 131 | +- **Prompt Loading**: Improved prompt loader with version management integration |
| 132 | +- **Configuration Management**: Enhanced config handling with version tracking |
| 133 | +- **Error Messages**: More descriptive error messages with actionable guidance |
| 134 | +- **Git Integration**: Better Git workflow with automatic version management |
| 135 | + |
| 136 | +### Improved |
| 137 | + |
| 138 | +- **Developer Experience**: |
| 139 | + - Clearer prompt organization with folder structure |
| 140 | + - Better Git diffs for prompt changes |
| 141 | + - Easier code review process |
| 142 | + - Automated version management |
| 143 | + - Rich console output with formatting |
| 144 | + |
| 145 | +- **Version Control**: |
| 146 | + - Professional version management for prompts |
| 147 | + - Automatic version creation on changes |
| 148 | + - Easy switching between versions |
| 149 | + - Full version history tracking |
| 150 | + |
| 151 | +- **Documentation**: |
| 152 | + - Comprehensive guides for new features |
| 153 | + - Clear migration instructions |
| 154 | + - Extensive testing documentation |
| 155 | + - Better README with updated examples |
| 156 | + |
| 157 | +- **Testing**: |
| 158 | + - Extensive test coverage for new features |
| 159 | + - Cross-platform test reliability |
| 160 | + - Comprehensive edge case coverage |
| 161 | + - Better test organization and helpers |
| 162 | + |
| 163 | +- **Code Quality**: |
| 164 | + - Enhanced error handling throughout |
| 165 | + - Better logging and debugging support |
| 166 | + - Improved code organization |
| 167 | + - More maintainable architecture |
| 168 | + |
| 169 | +### Fixed |
| 170 | + |
| 171 | +- **Windows Testing Issues**: Fixed `PermissionError` when cleaning up Git repositories in tests |
| 172 | +- **File Handling**: Improved cross-platform file operations |
| 173 | +- **Version Migration**: Smooth migration from legacy to new version system |
| 174 | +- **Git Integration**: Better Git hook handling and installation |
| 175 | +- **Error Recovery**: Improved error recovery in version management operations |
| 176 | + |
| 177 | +### Migration Guide |
| 178 | + |
| 179 | +**From `prompts.yaml` to Folder Structure:** |
| 180 | + |
| 181 | +The migration is **automatic** when you first run Promptix after upgrading: |
| 182 | + |
| 183 | +1. **Upgrade Promptix**: |
| 184 | + ```bash |
| 185 | + pip install --upgrade promptix |
| 186 | + ``` |
| 187 | + |
| 188 | +2. **Run any Promptix command**: |
| 189 | + ```bash |
| 190 | + promptix studio # or any other command |
| 191 | + ``` |
| 192 | + |
| 193 | +3. **Your prompts are automatically migrated**: |
| 194 | + - `prompts.yaml` → `prompts/` directory structure |
| 195 | + - All existing prompts preserved |
| 196 | + - Version history maintained |
| 197 | + |
| 198 | +4. **Install automatic versioning** (optional but recommended): |
| 199 | + ```bash |
| 200 | + promptix hooks install |
| 201 | + ``` |
| 202 | + |
| 203 | +5. **Commit changes**: |
| 204 | + ```bash |
| 205 | + git add prompts/ |
| 206 | + git commit -m "Migrate to folder-based prompt structure" |
| 207 | + ``` |
| 208 | + |
| 209 | +**The old `prompts.yaml` file is preserved** for reference but no longer used. |
| 210 | + |
| 211 | +### Technical Improvements |
| 212 | + |
| 213 | +- **Modular Architecture**: Better separation of concerns with dedicated managers |
| 214 | +- **Type Safety**: Enhanced type annotations throughout new code |
| 215 | +- **Performance**: Improved caching and file handling |
| 216 | +- **Reliability**: Comprehensive error handling and edge case coverage |
| 217 | +- **Maintainability**: Cleaner code structure and better documentation |
| 218 | + |
| 219 | +### Developer Experience Enhancements |
| 220 | + |
| 221 | +- **Automated Workflows**: Pre-commit hooks handle version management automatically |
| 222 | +- **Clear Console Output**: Rich formatting for CLI commands |
| 223 | +- **Better Error Messages**: Actionable error messages with clear guidance |
| 224 | +- **Comprehensive Documentation**: Guides for all new features |
| 225 | +- **Extensive Examples**: Real-world usage examples in documentation |
| 226 | + |
| 227 | +### Backward Compatibility |
| 228 | + |
| 229 | +- **Legacy support** for `is_live` flags in configurations |
| 230 | +- **Automatic migration** from old to new structure |
| 231 | +- **Dual format support** during transition period |
| 232 | +- **No breaking changes** to existing API methods |
| 233 | +- **Existing code continues to work** without modifications |
| 234 | + |
| 235 | +### Acknowledgments |
| 236 | + |
| 237 | +This release represents a significant evolution of Promptix, bringing professional version control practices to AI prompt management. Special thanks to all contributors and users who provided feedback and testing assistance. |
| 238 | + |
| 239 | +--- |
| 240 | + |
3 | 241 | ## [0.1.16] - 2025-09-21 |
4 | 242 |
|
5 | 243 | ### 🚀 **Major Development Infrastructure & Documentation Overhaul** |
|
0 commit comments