kiro-spec-engine 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,21 +7,70 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.2.0] - 2026-01-23
11
+
10
12
  ### Added
11
- - Initial project structure
12
- - CLI implementation with Node.js
13
- - Ultrawork quality enhancement tool (Python)
14
- - Multi-language support (English and Chinese)
15
- - Project initialization command (`kse init`)
16
- - Spec creation command (`kse create-spec`)
17
- - Status checking command (`kse status`)
18
- - Document enhancement command (`kse enhance`)
13
+ - **Project Adoption System**: Intelligent project adoption with three modes
14
+ - Fresh adoption: Create complete .kiro/ structure from scratch
15
+ - Partial adoption: Add missing components to existing .kiro/
16
+ - Full adoption: Upgrade existing complete .kiro/ to current version
17
+ - **Version Upgrade System**: Smooth version migration with migration scripts
18
+ - Incremental upgrades through intermediate versions
19
+ - Migration script support for breaking changes
20
+ - Automatic backup before upgrades
21
+ - **Backup and Rollback System**: Safe operations with automatic backups
22
+ - Automatic backup creation before destructive operations
23
+ - Backup validation and integrity checking
24
+ - Easy rollback to previous states
25
+ - **New CLI Commands**:
26
+ - `kse adopt`: Adopt existing projects into Kiro Spec Engine
27
+ - `kse upgrade`: Upgrade project to newer version
28
+ - `kse rollback`: Restore project from backup
29
+ - **Core Components**:
30
+ - DetectionEngine: Analyzes project structure and determines adoption strategy
31
+ - AdoptionStrategy: Implements fresh, partial, and full adoption modes
32
+ - MigrationEngine: Plans and executes version upgrades
33
+ - BackupSystem: Creates, manages, and restores backups
34
+
35
+ ### Enhanced
36
+ - Version management with upgrade history tracking
37
+ - File system utilities with backup support
38
+ - Project structure detection (Node.js, Python, mixed)
39
+ - Conflict detection and resolution
40
+
41
+ ### Infrastructure
42
+ - Created lib/adoption/ directory for adoption strategies
43
+ - Created lib/upgrade/ directory for migration engine
44
+ - Created lib/backup/ directory for backup system
45
+ - Created lib/commands/ directory for CLI commands
46
+ - Migration script template and loader system
47
+
48
+ ### Documentation
49
+ - Comprehensive adoption and upgrade system design
50
+ - Migration script interface documentation
51
+ - User guides for adoption, upgrade, and rollback workflows
52
+
53
+ ## [1.1.0] - 2026-01-23
54
+
55
+ ### Added
56
+ - Version management system for project adoption and upgrades
57
+ - VersionManager class for tracking project versions
58
+ - Compatibility matrix for version compatibility checking
59
+ - Upgrade path calculation for incremental upgrades
60
+ - Safe file system utilities with atomic operations
61
+ - Path validation to prevent path traversal attacks
62
+ - Project structure for future adoption/upgrade features
63
+
64
+ ### Infrastructure
65
+ - Added semver dependency for version comparison
66
+ - Created lib/version/ directory for version management
67
+ - Created lib/utils/ directory for shared utilities
68
+ - Prepared foundation for kse adopt and kse upgrade commands
19
69
 
20
70
  ### Documentation
21
- - README.md (English)
22
- - README.zh.md (Chinese)
23
- - CONTRIBUTING.md
24
- - LICENSE (MIT)
71
+ - Created spec 02-00-project-adoption-and-upgrade
72
+ - Comprehensive design for project adoption system
73
+ - Detailed requirements for smooth upgrade experience
25
74
 
26
75
  ## [1.0.0] - 2026-01-23
27
76
 
package/README.md CHANGED
@@ -83,12 +83,32 @@ kse enhance requirements .kiro/specs/01-00-user-authentication/requirements.md
83
83
  # Initialize project
84
84
  kse init [project-name]
85
85
 
86
+ # Adopt existing project
87
+ kse adopt # Interactive adoption
88
+ kse adopt --auto # Skip confirmations
89
+ kse adopt --dry-run # Show what would change
90
+ kse adopt --mode fresh # Force specific mode
91
+
92
+ # Upgrade project version
93
+ kse upgrade # Interactive upgrade
94
+ kse upgrade --auto # Skip confirmations
95
+ kse upgrade --dry-run # Show upgrade plan
96
+ kse upgrade --to 1.2.0 # Upgrade to specific version
97
+
98
+ # Rollback to previous state
99
+ kse rollback # Interactive rollback
100
+ kse rollback --auto # Skip confirmations
101
+ kse rollback --backup <id> # Restore specific backup
102
+
86
103
  # Check project status
87
104
  kse status
88
105
 
89
106
  # Create new spec
90
107
  kse create-spec <spec-name>
91
108
 
109
+ # System diagnostics
110
+ kse doctor
111
+
92
112
  # Set language
93
113
  kse --lang zh <command> # Chinese
94
114
  kse --lang en <command> # English (default)
@@ -143,6 +163,74 @@ kse enhance design .kiro/specs/01-00-user-auth/design.md --requirements .kiro/sp
143
163
  - **Ultrawork Motivation**: Provide Sisyphus spirit motivation and suggestions
144
164
  - **Next Steps Guidance**: Suggest specific execution strategies
145
165
 
166
+ ## 🔄 Project Adoption and Upgrade
167
+
168
+ ### Adopting Existing Projects
169
+
170
+ KSE can intelligently adopt existing projects with three modes:
171
+
172
+ **Fresh Adoption** (no `.kiro/` directory):
173
+ ```bash
174
+ kse adopt
175
+ # Creates complete .kiro/ structure from scratch
176
+ ```
177
+
178
+ **Partial Adoption** (`.kiro/` exists but incomplete):
179
+ ```bash
180
+ kse adopt
181
+ # Preserves existing specs/ and steering/
182
+ # Adds missing components
183
+ ```
184
+
185
+ **Full Adoption** (complete `.kiro/` from older version):
186
+ ```bash
187
+ kse adopt
188
+ # Upgrades components to current version
189
+ # Preserves all user content
190
+ # Creates backup before changes
191
+ ```
192
+
193
+ ### Upgrading to New Versions
194
+
195
+ When a new version of KSE is released:
196
+
197
+ ```bash
198
+ # Check current version
199
+ kse --version
200
+
201
+ # Upgrade to latest version
202
+ kse upgrade
203
+
204
+ # Upgrade to specific version
205
+ kse upgrade --to 1.2.0
206
+
207
+ # Preview upgrade plan
208
+ kse upgrade --dry-run
209
+ ```
210
+
211
+ **Incremental Upgrades**: KSE automatically handles version gaps by upgrading through intermediate versions (e.g., 1.0.0 → 1.1.0 → 1.2.0).
212
+
213
+ ### Rollback and Safety
214
+
215
+ All destructive operations create automatic backups:
216
+
217
+ ```bash
218
+ # List available backups
219
+ kse rollback
220
+
221
+ # Restore from specific backup
222
+ kse rollback --backup adopt-2026-01-23-100000
223
+
224
+ # Quick rollback (interactive)
225
+ kse rollback
226
+ ```
227
+
228
+ **Safety Features**:
229
+ - ✅ Automatic backup before adoption/upgrade
230
+ - ✅ Backup validation and integrity checking
231
+ - ✅ Easy rollback to previous states
232
+ - ✅ Dry-run mode to preview changes
233
+
146
234
  ## 🛠️ Project Structure
147
235
 
148
236
  After initialization, your project will have:
package/README.zh.md CHANGED
@@ -83,12 +83,32 @@ kse enhance requirements .kiro/specs/01-00-user-authentication/requirements.md
83
83
  # 初始化项目
84
84
  kse init [项目名称]
85
85
 
86
+ # 接管现有项目
87
+ kse adopt # 交互式接管
88
+ kse adopt --auto # 跳过确认
89
+ kse adopt --dry-run # 显示将要改变的内容
90
+ kse adopt --mode fresh # 强制指定模式
91
+
92
+ # 升级项目版本
93
+ kse upgrade # 交互式升级
94
+ kse upgrade --auto # 跳过确认
95
+ kse upgrade --dry-run # 显示升级计划
96
+ kse upgrade --to 1.2.0 # 升级到指定版本
97
+
98
+ # 回滚到之前的状态
99
+ kse rollback # 交互式回滚
100
+ kse rollback --auto # 跳过确认
101
+ kse rollback --backup <id> # 恢复指定备份
102
+
86
103
  # 检查项目状态
87
104
  kse status
88
105
 
89
106
  # 创建新 Spec
90
107
  kse create-spec <spec-名称>
91
108
 
109
+ # 系统诊断
110
+ kse doctor
111
+
92
112
  # 设置语言
93
113
  kse --lang zh <命令> # 中文
94
114
  kse --lang en <命令> # 英文
@@ -143,6 +163,74 @@ kse enhance design .kiro/specs/01-00-user-auth/design.md --requirements .kiro/sp
143
163
  - **Ultrawork 激励**:提供 Sisyphus 精神激励和建议
144
164
  - **下一步指导**:建议具体的执行策略
145
165
 
166
+ ## � 项目接管和升级
167
+
168
+ ### 接管现有项目
169
+
170
+ KSE 可以智能接管现有项目,支持三种模式:
171
+
172
+ **全新接管**(无 `.kiro/` 目录):
173
+ ```bash
174
+ kse adopt
175
+ # 从头创建完整的 .kiro/ 结构
176
+ ```
177
+
178
+ **部分接管**(`.kiro/` 存在但不完整):
179
+ ```bash
180
+ kse adopt
181
+ # 保留现有的 specs/ 和 steering/
182
+ # 添加缺失的组件
183
+ ```
184
+
185
+ **完整接管**(来自旧版本的完整 `.kiro/`):
186
+ ```bash
187
+ kse adopt
188
+ # 将组件升级到当前版本
189
+ # 保留所有用户内容
190
+ # 更改前创建备份
191
+ ```
192
+
193
+ ### 升级到新版本
194
+
195
+ 当 KSE 发布新版本时:
196
+
197
+ ```bash
198
+ # 检查当前版本
199
+ kse --version
200
+
201
+ # 升级到最新版本
202
+ kse upgrade
203
+
204
+ # 升级到指定版本
205
+ kse upgrade --to 1.2.0
206
+
207
+ # 预览升级计划
208
+ kse upgrade --dry-run
209
+ ```
210
+
211
+ **渐进式升级**:KSE 自动处理版本差距,通过中间版本升级(例如 1.0.0 → 1.1.0 → 1.2.0)。
212
+
213
+ ### 回滚和安全性
214
+
215
+ 所有破坏性操作都会自动创建备份:
216
+
217
+ ```bash
218
+ # 列出可用备份
219
+ kse rollback
220
+
221
+ # 从指定备份恢复
222
+ kse rollback --backup adopt-2026-01-23-100000
223
+
224
+ # 快速回滚(交互式)
225
+ kse rollback
226
+ ```
227
+
228
+ **安全特性**:
229
+ - ✅ 接管/升级前自动备份
230
+ - ✅ 备份验证和完整性检查
231
+ - ✅ 轻松回滚到之前的状态
232
+ - ✅ 预览模式查看更改
233
+
146
234
  ## 🛠️ 项目结构
147
235
 
148
236
  初始化后,你的项目将包含:
@@ -8,6 +8,9 @@ const path = require('path');
8
8
  const { spawn } = require('child_process');
9
9
  const { getI18n } = require('../lib/i18n');
10
10
  const doctorCommand = require('../lib/commands/doctor');
11
+ const adoptCommand = require('../lib/commands/adopt');
12
+ const upgradeCommand = require('../lib/commands/upgrade');
13
+ const rollbackCommand = require('../lib/commands/rollback');
11
14
 
12
15
  const i18n = getI18n();
13
16
  const t = (key, params) => i18n.t(key, params);
@@ -157,6 +160,38 @@ program
157
160
  doctorCommand();
158
161
  });
159
162
 
163
+ // 项目接管命令
164
+ program
165
+ .command('adopt')
166
+ .description('Adopt existing project into Kiro Spec Engine')
167
+ .option('--auto', 'Skip confirmations (use with caution)')
168
+ .option('--dry-run', 'Show what would change without making changes')
169
+ .option('--mode <mode>', 'Force specific adoption mode (fresh/partial/full)')
170
+ .action((options) => {
171
+ adoptCommand(options);
172
+ });
173
+
174
+ // 项目升级命令
175
+ program
176
+ .command('upgrade')
177
+ .description('Upgrade project to newer version')
178
+ .option('--auto', 'Skip confirmations (use with caution)')
179
+ .option('--dry-run', 'Show upgrade plan without making changes')
180
+ .option('--to <version>', 'Target version (default: current kse version)')
181
+ .action((options) => {
182
+ upgradeCommand(options);
183
+ });
184
+
185
+ // 回滚命令
186
+ program
187
+ .command('rollback')
188
+ .description('Restore project from backup')
189
+ .option('--auto', 'Skip confirmations (use with caution)')
190
+ .option('--backup <id>', 'Specific backup ID to restore')
191
+ .action((options) => {
192
+ rollbackCommand(options);
193
+ });
194
+
160
195
  // 状态检查命令
161
196
  program
162
197
  .command('status')