kiro-spec-engine 1.2.2 → 1.3.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 +91 -0
- package/README.md +172 -0
- package/bin/kiro-spec-engine.js +62 -0
- package/docs/adoption-guide.md +506 -0
- package/docs/agent-hooks-analysis.md +815 -0
- package/docs/architecture.md +706 -0
- package/docs/cross-tool-guide.md +554 -0
- package/docs/developer-guide.md +615 -0
- package/docs/manual-workflows-guide.md +417 -0
- package/docs/steering-strategy-guide.md +196 -0
- package/docs/upgrade-guide.md +632 -0
- package/lib/adoption/detection-engine.js +14 -4
- package/lib/commands/adopt.js +117 -3
- package/lib/commands/context.js +99 -0
- package/lib/commands/prompt.js +105 -0
- package/lib/commands/status.js +225 -0
- package/lib/commands/task.js +199 -0
- package/lib/commands/watch.js +569 -0
- package/lib/commands/workflows.js +240 -0
- package/lib/commands/workspace.js +189 -0
- package/lib/context/context-exporter.js +378 -0
- package/lib/context/prompt-generator.js +482 -0
- package/lib/steering/adoption-config.js +164 -0
- package/lib/steering/steering-manager.js +289 -0
- package/lib/task/task-claimer.js +430 -0
- package/lib/utils/tool-detector.js +383 -0
- package/lib/watch/action-executor.js +458 -0
- package/lib/watch/event-debouncer.js +323 -0
- package/lib/watch/execution-logger.js +550 -0
- package/lib/watch/file-watcher.js +499 -0
- package/lib/watch/presets.js +266 -0
- package/lib/watch/watch-manager.js +533 -0
- package/lib/workspace/workspace-manager.js +370 -0
- package/lib/workspace/workspace-sync.js +356 -0
- package/package.json +4 -1
- package/template/.kiro/tools/backup_manager.py +295 -0
- package/template/.kiro/tools/configuration_manager.py +218 -0
- package/template/.kiro/tools/document_evaluator.py +550 -0
- package/template/.kiro/tools/enhancement_logger.py +168 -0
- package/template/.kiro/tools/error_handler.py +335 -0
- package/template/.kiro/tools/improvement_identifier.py +444 -0
- package/template/.kiro/tools/modification_applicator.py +737 -0
- package/template/.kiro/tools/quality_gate_enforcer.py +207 -0
- package/template/.kiro/tools/quality_scorer.py +305 -0
- package/template/.kiro/tools/report_generator.py +154 -0
- package/template/.kiro/tools/ultrawork_enhancer_refactored.py +0 -0
- package/template/.kiro/tools/ultrawork_enhancer_v2.py +463 -0
- package/template/.kiro/tools/ultrawork_enhancer_v3.py +606 -0
- package/template/.kiro/tools/workflow_quality_gate.py +100 -0
|
@@ -0,0 +1,632 @@
|
|
|
1
|
+
# Project Upgrade Guide
|
|
2
|
+
|
|
3
|
+
This guide explains how to upgrade your Kiro Spec Engine (KSE) project to newer versions.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Overview](#overview)
|
|
8
|
+
- [Before You Upgrade](#before-you-upgrade)
|
|
9
|
+
- [Upgrade Process](#upgrade-process)
|
|
10
|
+
- [Upgrade Scenarios](#upgrade-scenarios)
|
|
11
|
+
- [Migration Scripts](#migration-scripts)
|
|
12
|
+
- [Troubleshooting](#troubleshooting)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Overview
|
|
17
|
+
|
|
18
|
+
The `kse upgrade` command safely upgrades your project to newer KSE versions. It handles version gaps, runs migration scripts, and preserves all your content.
|
|
19
|
+
|
|
20
|
+
**Key Features**:
|
|
21
|
+
- ✅ Automatic version gap detection
|
|
22
|
+
- ✅ Incremental upgrades through intermediate versions
|
|
23
|
+
- ✅ Migration script execution
|
|
24
|
+
- ✅ Automatic backup before upgrade
|
|
25
|
+
- ✅ Dry-run mode to preview changes
|
|
26
|
+
- ✅ Easy rollback if needed
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Before You Upgrade
|
|
31
|
+
|
|
32
|
+
### Check Current Version
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Check project version
|
|
36
|
+
kse version-info
|
|
37
|
+
|
|
38
|
+
# Output:
|
|
39
|
+
# 📦 Version Information
|
|
40
|
+
#
|
|
41
|
+
# Project:
|
|
42
|
+
# kse version: 1.0.0
|
|
43
|
+
# Template version: 1.0.0
|
|
44
|
+
# Created: 2026-01-20 10:00:00
|
|
45
|
+
# Last upgraded: 2026-01-20 10:00:00
|
|
46
|
+
#
|
|
47
|
+
# Installed:
|
|
48
|
+
# kse version: 1.2.1
|
|
49
|
+
#
|
|
50
|
+
# ⚠️ Upgrade available
|
|
51
|
+
# Run kse upgrade to update to v1.2.1
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Check for Version Mismatch
|
|
55
|
+
|
|
56
|
+
KSE automatically warns you when versions don't match:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
kse status
|
|
60
|
+
|
|
61
|
+
# Output:
|
|
62
|
+
# ⚠️ Version Mismatch Detected
|
|
63
|
+
# Project initialized with kse v1.0.0
|
|
64
|
+
# Current kse version: v1.2.1
|
|
65
|
+
#
|
|
66
|
+
# 💡 Tip: Run kse upgrade to update project templates
|
|
67
|
+
# Or use --no-version-check to suppress this warning
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Prerequisites
|
|
71
|
+
|
|
72
|
+
1. **Commit your changes** (if using version control):
|
|
73
|
+
```bash
|
|
74
|
+
git add -A
|
|
75
|
+
git commit -m "Before KSE upgrade"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
2. **Ensure no pending work**:
|
|
79
|
+
- Save all open files
|
|
80
|
+
- Complete any in-progress specs
|
|
81
|
+
|
|
82
|
+
3. **Check disk space**:
|
|
83
|
+
- Upgrades create backups
|
|
84
|
+
- Ensure sufficient disk space
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Upgrade Process
|
|
89
|
+
|
|
90
|
+
### Basic Upgrade (Interactive)
|
|
91
|
+
|
|
92
|
+
1. **Run the upgrade command**:
|
|
93
|
+
```bash
|
|
94
|
+
kse upgrade
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
2. **Review the upgrade plan**:
|
|
98
|
+
```
|
|
99
|
+
📦 Checking project version...
|
|
100
|
+
Current version: 1.0.0
|
|
101
|
+
Target version: 1.2.1
|
|
102
|
+
|
|
103
|
+
📋 Planning upgrade...
|
|
104
|
+
|
|
105
|
+
Upgrade Plan:
|
|
106
|
+
From: 1.0.0
|
|
107
|
+
To: 1.2.1
|
|
108
|
+
Path: 1.0.0 → 1.1.0 → 1.2.0 → 1.2.1
|
|
109
|
+
Estimated time: 30 seconds
|
|
110
|
+
|
|
111
|
+
Migrations:
|
|
112
|
+
1. 1.0.0 → 1.1.0 [safe]
|
|
113
|
+
Script: 1.0.0-to-1.1.0.js
|
|
114
|
+
2. 1.1.0 → 1.2.0 [safe]
|
|
115
|
+
No migration script needed
|
|
116
|
+
3. 1.2.0 → 1.2.1 [safe]
|
|
117
|
+
No migration script needed
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
3. **Confirm the upgrade**:
|
|
121
|
+
```
|
|
122
|
+
Proceed with upgrade? (Y/n)
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
4. **Wait for completion**:
|
|
126
|
+
```
|
|
127
|
+
📦 Creating backup...
|
|
128
|
+
✅ Backup created: upgrade-2026-01-23-110000
|
|
129
|
+
|
|
130
|
+
🚀 Executing upgrade...
|
|
131
|
+
[1/3] Migrating 1.0.0 → 1.1.0
|
|
132
|
+
[2/3] Migrating 1.1.0 → 1.2.0
|
|
133
|
+
[3/3] Migrating 1.2.0 → 1.2.1
|
|
134
|
+
|
|
135
|
+
🔍 Validating upgrade...
|
|
136
|
+
|
|
137
|
+
✅ Upgrade complete!
|
|
138
|
+
|
|
139
|
+
Upgraded from 1.0.0 to 1.2.1
|
|
140
|
+
|
|
141
|
+
Migrations executed:
|
|
142
|
+
✅ 1.0.0 → 1.1.0
|
|
143
|
+
- Created backups/ directory
|
|
144
|
+
- Verified version.json structure
|
|
145
|
+
✅ 1.1.0 → 1.2.0
|
|
146
|
+
- No migration script needed
|
|
147
|
+
✅ 1.2.0 → 1.2.1
|
|
148
|
+
- No migration script needed
|
|
149
|
+
|
|
150
|
+
📦 Backup: upgrade-2026-01-23-110000
|
|
151
|
+
Run kse rollback if you encounter issues
|
|
152
|
+
|
|
153
|
+
🔥 Upgrade complete!
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Dry Run (Preview Upgrade)
|
|
157
|
+
|
|
158
|
+
Preview the upgrade plan without making changes:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
kse upgrade --dry-run
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Output**:
|
|
165
|
+
```
|
|
166
|
+
🔍 Dry run mode - no changes will be made
|
|
167
|
+
|
|
168
|
+
Migrations that would be executed:
|
|
169
|
+
1. 1.0.0 → 1.1.0
|
|
170
|
+
- Created backups/ directory
|
|
171
|
+
- Verified version.json structure
|
|
172
|
+
2. 1.1.0 → 1.2.0
|
|
173
|
+
- No migration script needed
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Automatic Mode (No Prompts)
|
|
177
|
+
|
|
178
|
+
Skip all confirmations:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
kse upgrade --auto
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**Use cases**:
|
|
185
|
+
- CI/CD pipelines
|
|
186
|
+
- Automated deployment scripts
|
|
187
|
+
- When you're confident about the upgrade
|
|
188
|
+
|
|
189
|
+
### Upgrade to Specific Version
|
|
190
|
+
|
|
191
|
+
Target a specific version instead of latest:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
kse upgrade --to 1.2.0
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Upgrade Scenarios
|
|
200
|
+
|
|
201
|
+
### Scenario 1: Single Version Upgrade
|
|
202
|
+
|
|
203
|
+
**Situation**: Upgrade from 1.2.0 to 1.2.1 (adjacent versions)
|
|
204
|
+
|
|
205
|
+
**Command**:
|
|
206
|
+
```bash
|
|
207
|
+
kse upgrade
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**What happens**:
|
|
211
|
+
- Direct upgrade (no intermediate versions)
|
|
212
|
+
- Quick and simple
|
|
213
|
+
- Usually no migration scripts needed
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
### Scenario 2: Multiple Version Gap
|
|
218
|
+
|
|
219
|
+
**Situation**: Upgrade from 1.0.0 to 1.2.1 (multiple versions behind)
|
|
220
|
+
|
|
221
|
+
**Command**:
|
|
222
|
+
```bash
|
|
223
|
+
kse upgrade
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**What happens**:
|
|
227
|
+
- Incremental upgrade: 1.0.0 → 1.1.0 → 1.2.0 → 1.2.1
|
|
228
|
+
- Each migration runs sequentially
|
|
229
|
+
- Ensures all changes are applied correctly
|
|
230
|
+
|
|
231
|
+
**Why incremental?**
|
|
232
|
+
- Safer: Each step is tested
|
|
233
|
+
- Traceable: Clear upgrade history
|
|
234
|
+
- Reversible: Can rollback to any point
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
### Scenario 3: Breaking Changes
|
|
239
|
+
|
|
240
|
+
**Situation**: Upgrade involves breaking changes (e.g., 1.x → 2.0)
|
|
241
|
+
|
|
242
|
+
**Command**:
|
|
243
|
+
```bash
|
|
244
|
+
kse upgrade
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
**What happens**:
|
|
248
|
+
```
|
|
249
|
+
📦 Upgrade Plan:
|
|
250
|
+
From: 1.2.1
|
|
251
|
+
To: 2.0.0
|
|
252
|
+
Path: 1.2.1 → 2.0.0
|
|
253
|
+
|
|
254
|
+
Migrations:
|
|
255
|
+
1. 1.2.1 → 2.0.0 [⚠️ BREAKING]
|
|
256
|
+
Script: 1.2.1-to-2.0.0.js
|
|
257
|
+
|
|
258
|
+
⚠️ Warning: This upgrade contains breaking changes
|
|
259
|
+
Review the migration details carefully
|
|
260
|
+
|
|
261
|
+
Proceed with upgrade? (Y/n)
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
**After upgrade**:
|
|
265
|
+
- Review migration changes
|
|
266
|
+
- Test your specs
|
|
267
|
+
- Update any custom code if needed
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
### Scenario 4: Already Up to Date
|
|
272
|
+
|
|
273
|
+
**Situation**: Your project is already at the latest version
|
|
274
|
+
|
|
275
|
+
**Command**:
|
|
276
|
+
```bash
|
|
277
|
+
kse upgrade
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
**Output**:
|
|
281
|
+
```
|
|
282
|
+
📦 Checking project version...
|
|
283
|
+
Current version: 1.2.1
|
|
284
|
+
Target version: 1.2.1
|
|
285
|
+
|
|
286
|
+
✅ Already up to date (1.2.1)
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
### Scenario 5: Upgrade Failed
|
|
292
|
+
|
|
293
|
+
**Situation**: Upgrade fails during migration
|
|
294
|
+
|
|
295
|
+
**What happens**:
|
|
296
|
+
```
|
|
297
|
+
🚀 Executing upgrade...
|
|
298
|
+
[1/3] Migrating 1.0.0 → 1.1.0
|
|
299
|
+
[2/3] Migrating 1.1.0 → 1.2.0
|
|
300
|
+
|
|
301
|
+
❌ Upgrade failed
|
|
302
|
+
Migration 1.1.0 → 1.2.0 failed: File not found
|
|
303
|
+
|
|
304
|
+
📦 Backup available: upgrade-2026-01-23-110000
|
|
305
|
+
Run kse rollback to restore
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
**Solution**:
|
|
309
|
+
```bash
|
|
310
|
+
# Rollback to previous state
|
|
311
|
+
kse rollback
|
|
312
|
+
|
|
313
|
+
# Check what went wrong
|
|
314
|
+
kse doctor
|
|
315
|
+
|
|
316
|
+
# Try again or report issue
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## Migration Scripts
|
|
322
|
+
|
|
323
|
+
### What Are Migration Scripts?
|
|
324
|
+
|
|
325
|
+
Migration scripts handle version-specific changes:
|
|
326
|
+
- Update file structures
|
|
327
|
+
- Modify configurations
|
|
328
|
+
- Add new features
|
|
329
|
+
- Fix compatibility issues
|
|
330
|
+
|
|
331
|
+
### Migration Script Locations
|
|
332
|
+
|
|
333
|
+
```
|
|
334
|
+
lib/upgrade/migrations/
|
|
335
|
+
├── 1.0.0-to-1.1.0.js
|
|
336
|
+
├── 1.1.0-to-1.2.0.js
|
|
337
|
+
└── 1.2.0-to-2.0.0.js
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### Migration Script Structure
|
|
341
|
+
|
|
342
|
+
```javascript
|
|
343
|
+
module.exports = {
|
|
344
|
+
version: "1.1.0",
|
|
345
|
+
breaking: false,
|
|
346
|
+
description: "Add version management foundation",
|
|
347
|
+
|
|
348
|
+
async migrate(projectPath, context) {
|
|
349
|
+
// Migration logic
|
|
350
|
+
const changes = [];
|
|
351
|
+
|
|
352
|
+
// Example: Create backups directory
|
|
353
|
+
await ensureDirectory(path.join(projectPath, '.kiro/backups'));
|
|
354
|
+
changes.push('Created backups/ directory');
|
|
355
|
+
|
|
356
|
+
return { success: true, changes };
|
|
357
|
+
},
|
|
358
|
+
|
|
359
|
+
async rollback(projectPath, context) {
|
|
360
|
+
// Rollback logic (optional)
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### Viewing Migration Details
|
|
366
|
+
|
|
367
|
+
Check what a migration will do:
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
# Dry run shows migration details
|
|
371
|
+
kse upgrade --dry-run
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
## Troubleshooting
|
|
377
|
+
|
|
378
|
+
### Problem: "No version.json found"
|
|
379
|
+
|
|
380
|
+
**Cause**: Project not initialized with KSE
|
|
381
|
+
|
|
382
|
+
**Solution**:
|
|
383
|
+
```bash
|
|
384
|
+
# Use adopt instead of upgrade
|
|
385
|
+
kse adopt
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
### Problem: "Cannot downgrade versions"
|
|
391
|
+
|
|
392
|
+
**Cause**: Trying to upgrade to an older version
|
|
393
|
+
|
|
394
|
+
**Solution**:
|
|
395
|
+
```bash
|
|
396
|
+
# Check current version
|
|
397
|
+
kse version-info
|
|
398
|
+
|
|
399
|
+
# Upgrade only works forward
|
|
400
|
+
# To go back, use rollback:
|
|
401
|
+
kse rollback
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
406
|
+
### Problem: Migration script fails
|
|
407
|
+
|
|
408
|
+
**Cause**: Migration script encountered an error
|
|
409
|
+
|
|
410
|
+
**Solution**:
|
|
411
|
+
|
|
412
|
+
**Step 1**: Check the error message
|
|
413
|
+
```
|
|
414
|
+
❌ Migration 1.0.0 → 1.1.0 failed: Cannot read property 'version' of undefined
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
**Step 2**: Rollback
|
|
418
|
+
```bash
|
|
419
|
+
kse rollback
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
**Step 3**: Report the issue
|
|
423
|
+
- Go to: https://github.com/heguangyong/kiro-spec-engine/issues
|
|
424
|
+
- Include:
|
|
425
|
+
- Error message
|
|
426
|
+
- Current version
|
|
427
|
+
- Target version
|
|
428
|
+
- Backup ID
|
|
429
|
+
|
|
430
|
+
---
|
|
431
|
+
|
|
432
|
+
### Problem: Upgrade interrupted (Ctrl+C)
|
|
433
|
+
|
|
434
|
+
**Cause**: User interrupted the upgrade process
|
|
435
|
+
|
|
436
|
+
**What happens**:
|
|
437
|
+
```
|
|
438
|
+
⚠️ Operation interrupted by user
|
|
439
|
+
🔄 Rolling back changes...
|
|
440
|
+
✅ Rollback complete
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
**Solution**:
|
|
444
|
+
- Automatic rollback protects your project
|
|
445
|
+
- Try upgrade again when ready
|
|
446
|
+
|
|
447
|
+
---
|
|
448
|
+
|
|
449
|
+
### Problem: Disk space full during upgrade
|
|
450
|
+
|
|
451
|
+
**Cause**: Insufficient disk space for backup
|
|
452
|
+
|
|
453
|
+
**Solution**:
|
|
454
|
+
```bash
|
|
455
|
+
# Check disk space
|
|
456
|
+
df -h
|
|
457
|
+
|
|
458
|
+
# Clean old backups
|
|
459
|
+
ls .kiro/backups/
|
|
460
|
+
rm -rf .kiro/backups/old-backup-id
|
|
461
|
+
|
|
462
|
+
# Try upgrade again
|
|
463
|
+
kse upgrade
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
---
|
|
467
|
+
|
|
468
|
+
### Problem: Want to skip version check warnings
|
|
469
|
+
|
|
470
|
+
**Cause**: Warnings are annoying during development
|
|
471
|
+
|
|
472
|
+
**Solution**:
|
|
473
|
+
|
|
474
|
+
**Temporary**:
|
|
475
|
+
```bash
|
|
476
|
+
kse status --no-version-check
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
**Permanent** (not recommended):
|
|
480
|
+
```bash
|
|
481
|
+
# Add to your shell profile
|
|
482
|
+
export KIRO_NO_VERSION_CHECK=1
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
---
|
|
486
|
+
|
|
487
|
+
## Best Practices
|
|
488
|
+
|
|
489
|
+
### 1. Regular Upgrades
|
|
490
|
+
|
|
491
|
+
Don't fall too far behind:
|
|
492
|
+
```bash
|
|
493
|
+
# Check for updates monthly
|
|
494
|
+
kse version-info
|
|
495
|
+
|
|
496
|
+
# Upgrade when available
|
|
497
|
+
kse upgrade
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
### 2. Test After Upgrade
|
|
501
|
+
|
|
502
|
+
Verify everything works:
|
|
503
|
+
```bash
|
|
504
|
+
# Check status
|
|
505
|
+
kse status
|
|
506
|
+
|
|
507
|
+
# Run doctor
|
|
508
|
+
kse doctor
|
|
509
|
+
|
|
510
|
+
# Test your specs
|
|
511
|
+
kse enhance requirements .kiro/specs/your-spec/requirements.md
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
### 3. Keep Upgrade History
|
|
515
|
+
|
|
516
|
+
Don't delete backups immediately:
|
|
517
|
+
```bash
|
|
518
|
+
# Keep last 5 backups
|
|
519
|
+
ls -lt .kiro/backups/ | head -6
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
### 4. Read Release Notes
|
|
523
|
+
|
|
524
|
+
Check what changed:
|
|
525
|
+
- See CHANGELOG.md in KSE repository
|
|
526
|
+
- Review breaking changes
|
|
527
|
+
- Understand new features
|
|
528
|
+
|
|
529
|
+
### 5. Upgrade in Stages
|
|
530
|
+
|
|
531
|
+
For large version gaps:
|
|
532
|
+
```bash
|
|
533
|
+
# Instead of 1.0.0 → 2.0.0 directly
|
|
534
|
+
# Let KSE handle incremental upgrades
|
|
535
|
+
kse upgrade # Automatically: 1.0.0 → 1.1.0 → 1.2.0 → 2.0.0
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
---
|
|
539
|
+
|
|
540
|
+
## Version Compatibility
|
|
541
|
+
|
|
542
|
+
### Compatibility Matrix
|
|
543
|
+
|
|
544
|
+
| From Version | To Version | Compatible | Breaking | Migration Required |
|
|
545
|
+
|--------------|------------|------------|----------|-------------------|
|
|
546
|
+
| 1.0.0 | 1.1.0 | ✅ Yes | No | Optional |
|
|
547
|
+
| 1.0.0 | 1.2.0 | ✅ Yes | No | Optional |
|
|
548
|
+
| 1.1.0 | 1.2.0 | ✅ Yes | No | No |
|
|
549
|
+
| 1.x.x | 2.0.0 | ⚠️ Yes | Yes | Required |
|
|
550
|
+
|
|
551
|
+
### Checking Compatibility
|
|
552
|
+
|
|
553
|
+
```bash
|
|
554
|
+
# KSE automatically checks compatibility
|
|
555
|
+
kse upgrade
|
|
556
|
+
|
|
557
|
+
# If incompatible, you'll see:
|
|
558
|
+
# ❌ Error: Incompatible versions
|
|
559
|
+
# Cannot upgrade from 1.0.0 to 3.0.0
|
|
560
|
+
# Please upgrade incrementally
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
---
|
|
564
|
+
|
|
565
|
+
## Rollback Guide
|
|
566
|
+
|
|
567
|
+
If upgrade fails or causes issues:
|
|
568
|
+
|
|
569
|
+
### Quick Rollback
|
|
570
|
+
|
|
571
|
+
```bash
|
|
572
|
+
# List backups
|
|
573
|
+
kse rollback
|
|
574
|
+
|
|
575
|
+
# Select the upgrade backup
|
|
576
|
+
# Restore to previous state
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
### Manual Rollback
|
|
580
|
+
|
|
581
|
+
If automatic rollback fails:
|
|
582
|
+
|
|
583
|
+
```bash
|
|
584
|
+
# Backups are in .kiro/backups/
|
|
585
|
+
cd .kiro/backups/
|
|
586
|
+
|
|
587
|
+
# Find the upgrade backup
|
|
588
|
+
ls -lt
|
|
589
|
+
|
|
590
|
+
# Manually restore
|
|
591
|
+
cp -r upgrade-2026-01-23-110000/* ..
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
---
|
|
595
|
+
|
|
596
|
+
## Next Steps
|
|
597
|
+
|
|
598
|
+
After successful upgrade:
|
|
599
|
+
|
|
600
|
+
1. **Verify the upgrade**:
|
|
601
|
+
```bash
|
|
602
|
+
kse version-info
|
|
603
|
+
kse status
|
|
604
|
+
```
|
|
605
|
+
|
|
606
|
+
2. **Test your specs**:
|
|
607
|
+
- Run existing specs
|
|
608
|
+
- Check for any issues
|
|
609
|
+
|
|
610
|
+
3. **Explore new features**:
|
|
611
|
+
- Check CHANGELOG.md
|
|
612
|
+
- Try new commands
|
|
613
|
+
|
|
614
|
+
4. **Clean old backups** (optional):
|
|
615
|
+
```bash
|
|
616
|
+
# Keep last 3 backups
|
|
617
|
+
ls .kiro/backups/
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
---
|
|
621
|
+
|
|
622
|
+
## Getting Help
|
|
623
|
+
|
|
624
|
+
- **Documentation**: Check README.md
|
|
625
|
+
- **Issues**: https://github.com/heguangyong/kiro-spec-engine/issues
|
|
626
|
+
- **Version Info**: `kse version-info`
|
|
627
|
+
- **System Check**: `kse doctor`
|
|
628
|
+
- **Rollback**: `kse rollback`
|
|
629
|
+
|
|
630
|
+
---
|
|
631
|
+
|
|
632
|
+
**Happy upgrading! 🔥**
|
|
@@ -11,6 +11,7 @@ const {
|
|
|
11
11
|
listFiles,
|
|
12
12
|
readJSON
|
|
13
13
|
} = require('../utils/fs-utils');
|
|
14
|
+
const SteeringManager = require('../steering/steering-manager');
|
|
14
15
|
|
|
15
16
|
class DetectionEngine {
|
|
16
17
|
constructor() {
|
|
@@ -19,6 +20,7 @@ class DetectionEngine {
|
|
|
19
20
|
this.specsDir = 'specs';
|
|
20
21
|
this.steeringDir = 'steering';
|
|
21
22
|
this.toolsDir = 'tools';
|
|
23
|
+
this.steeringManager = new SteeringManager();
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
/**
|
|
@@ -37,6 +39,7 @@ class DetectionEngine {
|
|
|
37
39
|
let hasSteering = false;
|
|
38
40
|
let hasTools = false;
|
|
39
41
|
let existingVersion = null;
|
|
42
|
+
let steeringDetection = null;
|
|
40
43
|
|
|
41
44
|
if (hasKiroDir) {
|
|
42
45
|
// Check for version.json
|
|
@@ -57,9 +60,9 @@ class DetectionEngine {
|
|
|
57
60
|
const specsPath = path.join(kiroPath, this.specsDir);
|
|
58
61
|
hasSpecs = await pathExists(specsPath);
|
|
59
62
|
|
|
60
|
-
// Check for steering/
|
|
61
|
-
|
|
62
|
-
hasSteering =
|
|
63
|
+
// Check for steering/ using SteeringManager
|
|
64
|
+
steeringDetection = await this.steeringManager.detectSteering(projectPath);
|
|
65
|
+
hasSteering = steeringDetection.hasExistingSteering;
|
|
63
66
|
|
|
64
67
|
// Check for tools/
|
|
65
68
|
const toolsPath = path.join(kiroPath, this.toolsDir);
|
|
@@ -80,7 +83,8 @@ class DetectionEngine {
|
|
|
80
83
|
hasTools,
|
|
81
84
|
projectType,
|
|
82
85
|
existingVersion,
|
|
83
|
-
conflicts
|
|
86
|
+
conflicts,
|
|
87
|
+
steeringDetection // Add steering detection details
|
|
84
88
|
};
|
|
85
89
|
} catch (error) {
|
|
86
90
|
throw new Error(`Failed to analyze project: ${error.message}`);
|
|
@@ -225,6 +229,12 @@ class DetectionEngine {
|
|
|
225
229
|
}
|
|
226
230
|
lines.push(` specs/: ${result.hasSpecs ? 'Yes' : 'No'}`);
|
|
227
231
|
lines.push(` steering/: ${result.hasSteering ? 'Yes' : 'No'}`);
|
|
232
|
+
|
|
233
|
+
// Show steering details if available
|
|
234
|
+
if (result.steeringDetection && result.steeringDetection.hasExistingSteering) {
|
|
235
|
+
lines.push(` Files: ${result.steeringDetection.count} file(s)`);
|
|
236
|
+
}
|
|
237
|
+
|
|
228
238
|
lines.push(` tools/: ${result.hasTools ? 'Yes' : 'No'}`);
|
|
229
239
|
|
|
230
240
|
if (result.conflicts.length > 0) {
|