scene-capability-engine 3.0.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 +2513 -0
- package/LICENSE +21 -0
- package/README.md +765 -0
- package/README.zh.md +630 -0
- package/bin/kiro-spec-engine.js +796 -0
- package/bin/kse.js +3 -0
- package/bin/sce.js +3 -0
- package/bin/sco.js +3 -0
- package/docs/331-poc-adaptation-roadmap.md +156 -0
- package/docs/331-poc-dual-track-integration-guide.md +120 -0
- package/docs/331-poc-weekly-delivery-checklist.md +52 -0
- package/docs/OFFLINE_INSTALL.md +96 -0
- package/docs/README.md +279 -0
- package/docs/adopt-migration-guide.md +599 -0
- package/docs/adoption-guide.md +616 -0
- package/docs/agent-hooks-analysis.md +815 -0
- package/docs/architecture.md +733 -0
- package/docs/articles/ai-driven-development-philosophy-and-practice-review.md +208 -0
- package/docs/articles/ai-driven-development-philosophy-and-practice.en.md +459 -0
- package/docs/articles/ai-driven-development-philosophy-and-practice.md +492 -0
- package/docs/autonomous-control-guide.md +851 -0
- package/docs/command-reference.md +1368 -0
- package/docs/community.md +115 -0
- package/docs/cross-tool-guide.md +555 -0
- package/docs/developer-guide.md +619 -0
- package/docs/document-governance.md +865 -0
- package/docs/environment-management-guide.md +526 -0
- package/docs/examples/add-export-command/design.md +194 -0
- package/docs/examples/add-export-command/requirements.md +110 -0
- package/docs/examples/add-export-command/tasks.md +88 -0
- package/docs/examples/add-rest-api/design.md +855 -0
- package/docs/examples/add-rest-api/requirements.md +323 -0
- package/docs/examples/add-rest-api/tasks.md +355 -0
- package/docs/examples/add-user-dashboard/design.md +192 -0
- package/docs/examples/add-user-dashboard/requirements.md +143 -0
- package/docs/examples/add-user-dashboard/tasks.md +91 -0
- package/docs/faq.md +697 -0
- package/docs/handoffs/evidence/ontology/moqui-template-baseline-2026-02-17-232922.json +156 -0
- package/docs/handoffs/evidence/ontology/moqui-template-baseline-2026-02-17-232922.md +24 -0
- package/docs/images/wechat-qr.png +0 -0
- package/docs/integration-modes.md +529 -0
- package/docs/integration-philosophy.md +313 -0
- package/docs/knowledge-management-guide.md +263 -0
- package/docs/manual-workflows-guide.md +418 -0
- package/docs/moqui-capability-matrix.md +73 -0
- package/docs/moqui-template-core-library-playbook.md +109 -0
- package/docs/multi-agent-coordination-guide.md +553 -0
- package/docs/multi-repo-management-guide.md +1344 -0
- package/docs/quick-start-with-ai-tools.md +375 -0
- package/docs/quick-start.md +146 -0
- package/docs/release-checklist.md +121 -0
- package/docs/releases/README.md +13 -0
- package/docs/releases/v1.46.2-validation.md +45 -0
- package/docs/releases/v1.46.2.md +50 -0
- package/docs/scene-runtime-guide.md +347 -0
- package/docs/spec-collaboration-guide.md +369 -0
- package/docs/spec-locking-guide.md +225 -0
- package/docs/spec-numbering-guide.md +348 -0
- package/docs/spec-workflow.md +519 -0
- package/docs/steering-strategy-guide.md +196 -0
- package/docs/team-collaboration-guide.md +465 -0
- package/docs/testing-strategy.md +272 -0
- package/docs/tools/claude-guide.md +654 -0
- package/docs/tools/cursor-guide.md +706 -0
- package/docs/tools/generic-guide.md +446 -0
- package/docs/tools/kiro-guide.md +308 -0
- package/docs/tools/vscode-guide.md +445 -0
- package/docs/tools/windsurf-guide.md +391 -0
- package/docs/troubleshooting.md +1135 -0
- package/docs/upgrade-guide.md +639 -0
- package/docs/value-observability-guide.md +127 -0
- package/docs/zh/README.md +341 -0
- package/docs/zh/quick-start.md +764 -0
- package/docs/zh/release-checklist.md +121 -0
- package/docs/zh/releases/README.md +13 -0
- package/docs/zh/releases/v1.46.2-validation.md +45 -0
- package/docs/zh/releases/v1.46.2.md +50 -0
- package/docs/zh/spec-numbering-guide.md +348 -0
- package/docs/zh/tools/claude-guide.md +349 -0
- package/docs/zh/tools/cursor-guide.md +281 -0
- package/docs/zh/tools/generic-guide.md +499 -0
- package/docs/zh/tools/kiro-guide.md +342 -0
- package/docs/zh/tools/vscode-guide.md +449 -0
- package/docs/zh/tools/windsurf-guide.md +378 -0
- package/docs/zh/value-observability-guide.md +127 -0
- package/docs//344/272/244/344/273/230/346/270/205/345/215/225.md +75 -0
- package/lib/adoption/adoption-logger.js +487 -0
- package/lib/adoption/adoption-strategy.js +538 -0
- package/lib/adoption/backup-manager.js +420 -0
- package/lib/adoption/conflict-resolver.js +410 -0
- package/lib/adoption/detection-engine.js +275 -0
- package/lib/adoption/diff-viewer.js +226 -0
- package/lib/adoption/error-formatter.js +509 -0
- package/lib/adoption/file-classifier.js +385 -0
- package/lib/adoption/progress-reporter.js +534 -0
- package/lib/adoption/smart-orchestrator.js +470 -0
- package/lib/adoption/strategy-selector.js +218 -0
- package/lib/adoption/summary-generator.js +493 -0
- package/lib/adoption/template-sync.js +605 -0
- package/lib/auto/autonomous-engine.js +485 -0
- package/lib/auto/checkpoint-manager.js +300 -0
- package/lib/auto/close-loop-runner.js +2476 -0
- package/lib/auto/config-schema.js +176 -0
- package/lib/auto/decision-engine.js +344 -0
- package/lib/auto/error-recovery-manager.js +580 -0
- package/lib/auto/goal-decomposer.js +278 -0
- package/lib/auto/progress-tracker.js +502 -0
- package/lib/auto/safety-manager.js +186 -0
- package/lib/auto/semantic-decomposer.js +137 -0
- package/lib/auto/state-manager.js +126 -0
- package/lib/auto/task-queue-manager.js +340 -0
- package/lib/backup/backup-system.js +372 -0
- package/lib/backup/selective-backup.js +207 -0
- package/lib/collab/agent-registry.js +240 -0
- package/lib/collab/collab-manager.js +285 -0
- package/lib/collab/contract-manager.js +320 -0
- package/lib/collab/coordinator.js +370 -0
- package/lib/collab/dependency-manager.js +280 -0
- package/lib/collab/index.js +20 -0
- package/lib/collab/integration-manager.js +202 -0
- package/lib/collab/merge-coordinator.js +252 -0
- package/lib/collab/metadata-manager.js +233 -0
- package/lib/collab/multi-agent-config.js +120 -0
- package/lib/collab/spec-lifecycle-manager.js +304 -0
- package/lib/collab/sync-barrier.js +88 -0
- package/lib/collab/visualizer.js +208 -0
- package/lib/commands/adopt.js +749 -0
- package/lib/commands/auto.js +19559 -0
- package/lib/commands/collab.js +275 -0
- package/lib/commands/context.js +99 -0
- package/lib/commands/docs.js +808 -0
- package/lib/commands/doctor.js +273 -0
- package/lib/commands/env.js +420 -0
- package/lib/commands/knowledge.js +309 -0
- package/lib/commands/lock.js +235 -0
- package/lib/commands/ops.js +409 -0
- package/lib/commands/orchestrate.js +446 -0
- package/lib/commands/prompt.js +105 -0
- package/lib/commands/repo.js +118 -0
- package/lib/commands/rollback.js +219 -0
- package/lib/commands/scene.js +15549 -0
- package/lib/commands/spec-bootstrap.js +147 -0
- package/lib/commands/spec-gate.js +157 -0
- package/lib/commands/spec-pipeline.js +205 -0
- package/lib/commands/status.js +321 -0
- package/lib/commands/task.js +199 -0
- package/lib/commands/templates.js +654 -0
- package/lib/commands/upgrade.js +231 -0
- package/lib/commands/value.js +569 -0
- package/lib/commands/watch.js +684 -0
- package/lib/commands/workflows.js +240 -0
- package/lib/commands/workspace-multi.js +325 -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/data/moqui-capability-lexicon.json +45 -0
- package/lib/environment/backup-system.js +189 -0
- package/lib/environment/environment-manager.js +379 -0
- package/lib/environment/environment-registry.js +168 -0
- package/lib/gitignore/gitignore-backup.js +229 -0
- package/lib/gitignore/gitignore-detector.js +239 -0
- package/lib/gitignore/gitignore-integration.js +267 -0
- package/lib/gitignore/gitignore-transformer.js +193 -0
- package/lib/gitignore/layered-rules-template.js +42 -0
- package/lib/governance/archive-tool.js +284 -0
- package/lib/governance/cleanup-tool.js +237 -0
- package/lib/governance/config-manager.js +186 -0
- package/lib/governance/diagnostic-engine.js +271 -0
- package/lib/governance/doc-reference-checker.js +200 -0
- package/lib/governance/execution-logger.js +243 -0
- package/lib/governance/file-scanner.js +285 -0
- package/lib/governance/hooks-manager.js +333 -0
- package/lib/governance/reporter.js +337 -0
- package/lib/governance/validation-engine.js +181 -0
- package/lib/i18n.js +79 -0
- package/lib/knowledge/entry-manager.js +208 -0
- package/lib/knowledge/index-manager.js +261 -0
- package/lib/knowledge/knowledge-manager.js +273 -0
- package/lib/knowledge/template-manager.js +191 -0
- package/lib/lock/index.js +21 -0
- package/lib/lock/lock-file.js +192 -0
- package/lib/lock/lock-manager.js +321 -0
- package/lib/lock/machine-identifier.js +135 -0
- package/lib/lock/steering-file-lock.js +207 -0
- package/lib/lock/task-lock-manager.js +345 -0
- package/lib/operations/audit-logger.js +293 -0
- package/lib/operations/feedback-manager.js +1147 -0
- package/lib/operations/index.js +23 -0
- package/lib/operations/models/index.js +170 -0
- package/lib/operations/operations-manager.js +151 -0
- package/lib/operations/operations-validator.js +280 -0
- package/lib/operations/permission-manager.js +354 -0
- package/lib/operations/template-loader.js +143 -0
- package/lib/orchestrator/agent-spawner.js +629 -0
- package/lib/orchestrator/bootstrap-prompt-builder.js +236 -0
- package/lib/orchestrator/index.js +19 -0
- package/lib/orchestrator/orchestration-engine.js +1270 -0
- package/lib/orchestrator/orchestrator-config.js +173 -0
- package/lib/orchestrator/status-monitor.js +591 -0
- package/lib/python-checker.js +209 -0
- package/lib/repo/config-manager.js +580 -0
- package/lib/repo/errors/config-error.js +13 -0
- package/lib/repo/errors/git-error.js +15 -0
- package/lib/repo/errors/repo-error.js +14 -0
- package/lib/repo/git-operations.js +181 -0
- package/lib/repo/handlers/.gitkeep +1 -0
- package/lib/repo/handlers/exec-handler.js +155 -0
- package/lib/repo/handlers/health-handler.js +169 -0
- package/lib/repo/handlers/init-handler.js +197 -0
- package/lib/repo/handlers/status-handler.js +176 -0
- package/lib/repo/output-formatter.js +184 -0
- package/lib/repo/path-resolver.js +178 -0
- package/lib/repo/repo-manager.js +514 -0
- package/lib/scene-runtime/audit-emitter.js +59 -0
- package/lib/scene-runtime/binding-plugin-loader.js +351 -0
- package/lib/scene-runtime/binding-registry.js +349 -0
- package/lib/scene-runtime/eval-bridge.js +44 -0
- package/lib/scene-runtime/index.js +19 -0
- package/lib/scene-runtime/moqui-adapter.js +620 -0
- package/lib/scene-runtime/moqui-client.js +606 -0
- package/lib/scene-runtime/moqui-extractor.js +2029 -0
- package/lib/scene-runtime/plan-compiler.js +208 -0
- package/lib/scene-runtime/policy-gate.js +58 -0
- package/lib/scene-runtime/runtime-executor.js +358 -0
- package/lib/scene-runtime/scene-loader.js +96 -0
- package/lib/scene-runtime/scene-ontology.js +959 -0
- package/lib/scene-runtime/scene-template-linter.js +852 -0
- package/lib/scene-runtime/templates/scene-template-erp-query-v0.1.yaml +28 -0
- package/lib/scene-runtime/templates/scene-template-hybrid-shadow-v0.1.yaml +34 -0
- package/lib/spec/bootstrap/context-collector.js +48 -0
- package/lib/spec/bootstrap/draft-generator.js +158 -0
- package/lib/spec/bootstrap/questionnaire-engine.js +70 -0
- package/lib/spec/bootstrap/trace-emitter.js +59 -0
- package/lib/spec/multi-spec-orchestrate.js +93 -0
- package/lib/spec/pipeline/constants.js +6 -0
- package/lib/spec/pipeline/stage-adapters.js +118 -0
- package/lib/spec/pipeline/stage-runner.js +146 -0
- package/lib/spec/pipeline/state-store.js +119 -0
- package/lib/spec-gate/engine/gate-engine.js +165 -0
- package/lib/spec-gate/policy/default-policy.js +22 -0
- package/lib/spec-gate/policy/policy-loader.js +103 -0
- package/lib/spec-gate/result-emitter.js +81 -0
- package/lib/spec-gate/rules/default-rules.js +156 -0
- package/lib/spec-gate/rules/rule-registry.js +51 -0
- package/lib/steering/adoption-config.js +164 -0
- package/lib/steering/compliance-auto-fixer.js +204 -0
- package/lib/steering/compliance-cache.js +99 -0
- package/lib/steering/compliance-error-reporter.js +70 -0
- package/lib/steering/context-sync-manager.js +273 -0
- package/lib/steering/index.js +92 -0
- package/lib/steering/spec-steering.js +230 -0
- package/lib/steering/steering-compliance-checker.js +73 -0
- package/lib/steering/steering-loader.js +144 -0
- package/lib/steering/steering-manager.js +289 -0
- package/lib/task/index.js +12 -0
- package/lib/task/task-claimer.js +489 -0
- package/lib/task/task-status-store.js +418 -0
- package/lib/templates/cache-manager.js +440 -0
- package/lib/templates/content-generalizer.js +247 -0
- package/lib/templates/frontmatter-generator.js +128 -0
- package/lib/templates/git-handler.js +471 -0
- package/lib/templates/metadata-collector.js +328 -0
- package/lib/templates/path-utils.js +144 -0
- package/lib/templates/registry-parser.js +505 -0
- package/lib/templates/spec-reader.js +216 -0
- package/lib/templates/template-applicator.js +249 -0
- package/lib/templates/template-creator.js +256 -0
- package/lib/templates/template-error.js +143 -0
- package/lib/templates/template-exporter.js +502 -0
- package/lib/templates/template-manager.js +782 -0
- package/lib/templates/template-validator.js +361 -0
- package/lib/upgrade/migration-engine.js +382 -0
- package/lib/upgrade/migrations/.gitkeep +52 -0
- package/lib/upgrade/migrations/1.0.0-to-1.1.0.js +78 -0
- package/lib/utils/file-diff.js +177 -0
- package/lib/utils/fs-utils.js +274 -0
- package/lib/utils/tool-detector.js +383 -0
- package/lib/utils/validation.js +324 -0
- package/lib/value/gate-summary-emitter.js +99 -0
- package/lib/value/metric-contract-loader.js +210 -0
- package/lib/value/risk-evaluator.js +117 -0
- package/lib/value/weekly-snapshot-builder.js +61 -0
- package/lib/version/version-checker.js +156 -0
- package/lib/version/version-manager.js +327 -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/multi/global-config.js +150 -0
- package/lib/workspace/multi/index.js +22 -0
- package/lib/workspace/multi/path-utils.js +173 -0
- package/lib/workspace/multi/workspace-context-resolver.js +244 -0
- package/lib/workspace/multi/workspace-registry.js +196 -0
- package/lib/workspace/multi/workspace-state-manager.js +537 -0
- package/lib/workspace/multi/workspace.js +90 -0
- package/lib/workspace/workspace-manager.js +370 -0
- package/lib/workspace/workspace-sync.js +356 -0
- package/locales/en.json +114 -0
- package/locales/zh.json +114 -0
- package/package.json +102 -0
- package/template/.kiro/README.md +247 -0
- package/template/.kiro/hooks/check-spec-on-create.kiro.hook +17 -0
- package/template/.kiro/hooks/run-tests-on-save.kiro.hook +13 -0
- package/template/.kiro/hooks/sync-tasks-on-edit.kiro.hook +16 -0
- package/template/.kiro/specs/SPEC_WORKFLOW_GUIDE.md +134 -0
- package/template/.kiro/steering/CORE_PRINCIPLES.md +133 -0
- package/template/.kiro/steering/CURRENT_CONTEXT.md +30 -0
- package/template/.kiro/steering/ENVIRONMENT.md +35 -0
- package/template/.kiro/steering/RULES_GUIDE.md +46 -0
- package/template/.kiro/templates/operations/default/change-impact.md +112 -0
- package/template/.kiro/templates/operations/default/deployment.md +91 -0
- package/template/.kiro/templates/operations/default/feedback-response.md +269 -0
- package/template/.kiro/templates/operations/default/migration-plan.md +172 -0
- package/template/.kiro/templates/operations/default/monitoring.md +135 -0
- package/template/.kiro/templates/operations/default/operations.md +135 -0
- package/template/.kiro/templates/operations/default/rollback.md +143 -0
- package/template/.kiro/templates/operations/default/tools.yaml +364 -0
- package/template/.kiro/templates/operations/default/troubleshooting.md +123 -0
- 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.py +676 -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
- package/template/README.md +111 -0
|
@@ -0,0 +1,526 @@
|
|
|
1
|
+
# Environment Configuration Management Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The Environment Configuration Management feature provides a lightweight solution for managing multiple environment configurations (development, staging, production, etc.) within your kse projects.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
### Installation and Project Adoption
|
|
10
|
+
|
|
11
|
+
**⚠️ Important**: When you install kse in a project, it automatically adopts the project and operates in autonomous mode by default. This means:
|
|
12
|
+
|
|
13
|
+
- ✅ kse takes ownership of the project structure
|
|
14
|
+
- ✅ AI assistants can make changes autonomously without frequent confirmations
|
|
15
|
+
- ✅ Faster development workflow with less interruption
|
|
16
|
+
- ✅ All changes are tracked and can be rolled back if needed
|
|
17
|
+
|
|
18
|
+
**Recommended Workflow**:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Install kse globally or in your project
|
|
22
|
+
npm install -g kiro-spec-engine
|
|
23
|
+
|
|
24
|
+
# Navigate to your project
|
|
25
|
+
cd your-project
|
|
26
|
+
|
|
27
|
+
# Check project status first (recommended)
|
|
28
|
+
kse status
|
|
29
|
+
|
|
30
|
+
# If issues are detected, run diagnostics
|
|
31
|
+
kse doctor
|
|
32
|
+
|
|
33
|
+
# Adopt the project (creates .kiro/ directory)
|
|
34
|
+
kse adopt
|
|
35
|
+
|
|
36
|
+
# kse is now managing your project autonomously
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Note**: Future versions of kse will automatically check project status after installation/upgrade and prompt for diagnostics if needed.
|
|
40
|
+
|
|
41
|
+
### 1. Register an Environment
|
|
42
|
+
|
|
43
|
+
Create a configuration file (e.g., `env-local.json`):
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"name": "local-dev",
|
|
48
|
+
"description": "Local development environment",
|
|
49
|
+
"config_files": [
|
|
50
|
+
{
|
|
51
|
+
"source": ".env.local",
|
|
52
|
+
"target": ".env"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"source": "config/database.local.json",
|
|
56
|
+
"target": "config/database.json"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Register the environment:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
kse env register env-local.json
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 2. List Environments
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
kse env list
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 3. Switch Environments
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
kse env switch local-dev
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
The system automatically:
|
|
81
|
+
- Creates a backup of existing target files
|
|
82
|
+
- Copies source files to target locations
|
|
83
|
+
- Updates the active environment
|
|
84
|
+
|
|
85
|
+
### 4. View Active Environment
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
kse env info
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### 5. Rollback
|
|
92
|
+
|
|
93
|
+
If something goes wrong, rollback to the previous state:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
kse env rollback
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Commands
|
|
100
|
+
|
|
101
|
+
### `kse env list`
|
|
102
|
+
|
|
103
|
+
List all registered environments with their status.
|
|
104
|
+
|
|
105
|
+
### `kse env switch <name>`
|
|
106
|
+
|
|
107
|
+
Switch to the specified environment. Creates automatic backups before switching.
|
|
108
|
+
|
|
109
|
+
### `kse env info`
|
|
110
|
+
|
|
111
|
+
Display details about the currently active environment.
|
|
112
|
+
|
|
113
|
+
### `kse env register <config-file>`
|
|
114
|
+
|
|
115
|
+
Register a new environment from a JSON configuration file.
|
|
116
|
+
|
|
117
|
+
### `kse env unregister <name> --force`
|
|
118
|
+
|
|
119
|
+
Remove an environment from the registry. Requires `--force` flag for confirmation.
|
|
120
|
+
|
|
121
|
+
### `kse env rollback`
|
|
122
|
+
|
|
123
|
+
Restore the most recent backup, reverting to the previous environment state.
|
|
124
|
+
|
|
125
|
+
### `kse env verify`
|
|
126
|
+
|
|
127
|
+
Verify the current environment configuration by running the verification command defined in the environment. If no verification rules are configured, reports success.
|
|
128
|
+
|
|
129
|
+
### `kse env run "<command>"`
|
|
130
|
+
|
|
131
|
+
Run a command in the context of the current environment. Ensures the active environment is set before executing the command.
|
|
132
|
+
|
|
133
|
+
## Configuration File Format
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"name": "environment-name",
|
|
138
|
+
"description": "Human-readable description",
|
|
139
|
+
"config_files": [
|
|
140
|
+
{
|
|
141
|
+
"source": "path/to/source/file",
|
|
142
|
+
"target": "path/to/target/file"
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"verification": {
|
|
146
|
+
"command": "node verify.js",
|
|
147
|
+
"expected_output": "OK"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Fields
|
|
153
|
+
|
|
154
|
+
- **name** (required): Unique environment name in kebab-case
|
|
155
|
+
- **description** (required): Human-readable description
|
|
156
|
+
- **config_files** (required): Array of source-to-target file mappings
|
|
157
|
+
- **verification** (optional): Verification command and expected output
|
|
158
|
+
|
|
159
|
+
## Backup System
|
|
160
|
+
|
|
161
|
+
The backup system automatically:
|
|
162
|
+
- Creates timestamped backups before each environment switch
|
|
163
|
+
- Maintains up to 10 backups per target file
|
|
164
|
+
- Stores backups in `.kiro/env-backups/`
|
|
165
|
+
- Automatically cleans up old backups
|
|
166
|
+
|
|
167
|
+
## Best Practices
|
|
168
|
+
|
|
169
|
+
1. **Adopt projects with kse**: Run `kse adopt` to let kse manage your project autonomously, enabling faster AI-assisted development without constant confirmations
|
|
170
|
+
2. **Use descriptive names**: Choose clear, descriptive names for your environments
|
|
171
|
+
3. **Keep source files in version control**: Store all environment-specific configuration files in your repository
|
|
172
|
+
4. **Selective .kiro/ version control**: Use layered .gitignore strategy:
|
|
173
|
+
- ✅ **DO commit**: `.kiro/specs/` (Spec documents), `.kiro/steering/CORE_PRINCIPLES.md`, `.kiro/steering/ENVIRONMENT.md`, `.kiro/steering/RULES_GUIDE.md`, `.kiro/tools/`, `.kiro/config/`
|
|
174
|
+
- ❌ **DO NOT commit**: `.kiro/steering/CURRENT_CONTEXT.md` (personal context), `.kiro/environments.json` (user-specific), `.kiro/backups/`, `.kiro/logs/`, `.kiro/reports/`
|
|
175
|
+
- **Why**: Share Spec documents and team rules, but avoid conflicts from personal state and user-specific configurations
|
|
176
|
+
5. **Share environment templates**: Commit environment configuration JSON files (e.g., `env-local.json`, `env-production.json`) to your repository root or a `config/` directory, not in `.kiro/`
|
|
177
|
+
6. **Test switches**: Test environment switches in a safe environment before using in production
|
|
178
|
+
7. **Regular backups**: The system creates automatic backups, but consider additional backup strategies for critical configurations
|
|
179
|
+
8. **Document verification**: Add verification rules to catch configuration errors early
|
|
180
|
+
|
|
181
|
+
## Examples
|
|
182
|
+
|
|
183
|
+
### Example 1: Simple Development/Production Setup
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"name": "development",
|
|
188
|
+
"description": "Local development environment",
|
|
189
|
+
"config_files": [
|
|
190
|
+
{ "source": ".env.development", "target": ".env" }
|
|
191
|
+
]
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"name": "production",
|
|
198
|
+
"description": "Production environment",
|
|
199
|
+
"config_files": [
|
|
200
|
+
{ "source": ".env.production", "target": ".env" }
|
|
201
|
+
],
|
|
202
|
+
"verification": {
|
|
203
|
+
"command": "node scripts/verify-env.js",
|
|
204
|
+
"expected_output": "production"
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Example 2: Multiple Configuration Files
|
|
210
|
+
|
|
211
|
+
```json
|
|
212
|
+
{
|
|
213
|
+
"name": "staging",
|
|
214
|
+
"description": "Staging environment with database and API configs",
|
|
215
|
+
"config_files": [
|
|
216
|
+
{ "source": ".env.staging", "target": ".env" },
|
|
217
|
+
{ "source": "config/database.staging.json", "target": "config/database.json" },
|
|
218
|
+
{ "source": "config/api.staging.json", "target": "config/api.json" }
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## Troubleshooting
|
|
224
|
+
|
|
225
|
+
### "Source file does not exist"
|
|
226
|
+
|
|
227
|
+
Ensure all source files specified in your configuration exist before registering or switching environments.
|
|
228
|
+
|
|
229
|
+
### "Environment already exists"
|
|
230
|
+
|
|
231
|
+
Each environment must have a unique name. Use `kse env unregister <name> --force` to remove the existing environment first.
|
|
232
|
+
|
|
233
|
+
### "Cannot unregister active environment"
|
|
234
|
+
|
|
235
|
+
Switch to a different environment before unregistering the currently active one.
|
|
236
|
+
|
|
237
|
+
### "No backups available to restore"
|
|
238
|
+
|
|
239
|
+
Backups are only created during environment switches. If you haven't switched environments yet, there won't be any backups to restore.
|
|
240
|
+
|
|
241
|
+
## Integration with Multi-Workspace
|
|
242
|
+
|
|
243
|
+
When using kse's multi-workspace feature, each workspace maintains its own independent environment registry. This allows different projects to have different environment configurations without interference.
|
|
244
|
+
|
|
245
|
+
## See Also
|
|
246
|
+
|
|
247
|
+
- [Multi-Workspace Management](../README.md#multi-workspace-management)
|
|
248
|
+
- [Command Reference](command-reference.md)
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
## Migration Guide
|
|
252
|
+
|
|
253
|
+
### Migrating from Manual Configuration Management
|
|
254
|
+
|
|
255
|
+
If you're currently managing environment configurations manually (e.g., copying files, using shell scripts), here's how to migrate to kse environment management:
|
|
256
|
+
|
|
257
|
+
#### Step 1: Identify Your Environments
|
|
258
|
+
|
|
259
|
+
List all the environments you currently manage:
|
|
260
|
+
- Development (local)
|
|
261
|
+
- Staging
|
|
262
|
+
- Production
|
|
263
|
+
- Testing
|
|
264
|
+
- etc.
|
|
265
|
+
|
|
266
|
+
#### Step 2: Identify Configuration Files
|
|
267
|
+
|
|
268
|
+
For each environment, identify which files need to be switched:
|
|
269
|
+
- `.env` files
|
|
270
|
+
- Configuration files (e.g., `config/database.json`, `config/app.json`)
|
|
271
|
+
- API endpoint configurations
|
|
272
|
+
- Feature flags
|
|
273
|
+
- etc.
|
|
274
|
+
|
|
275
|
+
#### Step 3: Create Source Files
|
|
276
|
+
|
|
277
|
+
Create source files for each environment. Use a naming convention like:
|
|
278
|
+
- `.env.local` → `.env`
|
|
279
|
+
- `.env.staging` → `.env`
|
|
280
|
+
- `.env.production` → `.env`
|
|
281
|
+
- `config/database.local.json` → `config/database.json`
|
|
282
|
+
|
|
283
|
+
**Example structure**:
|
|
284
|
+
```
|
|
285
|
+
your-project/
|
|
286
|
+
├── .env.local # Source for local environment
|
|
287
|
+
├── .env.staging # Source for staging environment
|
|
288
|
+
├── .env.production # Source for production environment
|
|
289
|
+
├── config/
|
|
290
|
+
│ ├── database.local.json
|
|
291
|
+
│ ├── database.staging.json
|
|
292
|
+
│ └── database.production.json
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
#### Step 4: Create Environment Configuration Files
|
|
296
|
+
|
|
297
|
+
For each environment, create a JSON configuration file:
|
|
298
|
+
|
|
299
|
+
**local-env.json**:
|
|
300
|
+
```json
|
|
301
|
+
{
|
|
302
|
+
"name": "local",
|
|
303
|
+
"description": "Local development environment",
|
|
304
|
+
"config_files": [
|
|
305
|
+
{
|
|
306
|
+
"source": ".env.local",
|
|
307
|
+
"target": ".env"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"source": "config/database.local.json",
|
|
311
|
+
"target": "config/database.json"
|
|
312
|
+
}
|
|
313
|
+
],
|
|
314
|
+
"verification": {
|
|
315
|
+
"command": "node scripts/verify-env.js",
|
|
316
|
+
"expected_output": "Environment: local"
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
**staging-env.json**:
|
|
322
|
+
```json
|
|
323
|
+
{
|
|
324
|
+
"name": "staging",
|
|
325
|
+
"description": "Staging environment",
|
|
326
|
+
"config_files": [
|
|
327
|
+
{
|
|
328
|
+
"source": ".env.staging",
|
|
329
|
+
"target": ".env"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"source": "config/database.staging.json",
|
|
333
|
+
"target": "config/database.json"
|
|
334
|
+
}
|
|
335
|
+
],
|
|
336
|
+
"verification": {
|
|
337
|
+
"command": "node scripts/verify-env.js",
|
|
338
|
+
"expected_output": "Environment: staging"
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
#### Step 5: Register Environments
|
|
344
|
+
|
|
345
|
+
Register each environment with kse:
|
|
346
|
+
|
|
347
|
+
```bash
|
|
348
|
+
kse env register local-env.json
|
|
349
|
+
kse env register staging-env.json
|
|
350
|
+
kse env register production-env.json
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
#### Step 6: Verify Registration
|
|
354
|
+
|
|
355
|
+
List all registered environments:
|
|
356
|
+
|
|
357
|
+
```bash
|
|
358
|
+
kse env list
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
#### Step 7: Test Environment Switching
|
|
362
|
+
|
|
363
|
+
Switch to an environment and verify:
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
# Switch to local environment
|
|
367
|
+
kse env switch local
|
|
368
|
+
|
|
369
|
+
# Verify the switch
|
|
370
|
+
kse env info
|
|
371
|
+
|
|
372
|
+
# Verify configuration is correct
|
|
373
|
+
kse env verify
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
#### Step 8: Update Your Workflow
|
|
377
|
+
|
|
378
|
+
Replace your manual configuration management with kse commands:
|
|
379
|
+
|
|
380
|
+
**Before**:
|
|
381
|
+
```bash
|
|
382
|
+
# Manual approach
|
|
383
|
+
cp .env.local .env
|
|
384
|
+
cp config/database.local.json config/database.json
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
**After**:
|
|
388
|
+
```bash
|
|
389
|
+
# kse approach
|
|
390
|
+
kse env switch local
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
#### Step 9: Add to .gitignore
|
|
394
|
+
|
|
395
|
+
Add target files to `.gitignore` to avoid committing environment-specific configurations:
|
|
396
|
+
|
|
397
|
+
```gitignore
|
|
398
|
+
# Environment target files (managed by kse)
|
|
399
|
+
.env
|
|
400
|
+
config/database.json
|
|
401
|
+
config/app.json
|
|
402
|
+
|
|
403
|
+
# Keep source files in version control
|
|
404
|
+
!.env.local
|
|
405
|
+
!.env.staging
|
|
406
|
+
!.env.production
|
|
407
|
+
!config/database.*.json
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
### Migrating from Other Tools
|
|
411
|
+
|
|
412
|
+
#### From direnv
|
|
413
|
+
|
|
414
|
+
If you're using direnv, you can migrate by:
|
|
415
|
+
|
|
416
|
+
1. Keep your `.envrc` files as source files
|
|
417
|
+
2. Create kse environment configurations that copy `.envrc.local` → `.envrc`
|
|
418
|
+
3. Continue using direnv for environment variable loading
|
|
419
|
+
4. Use kse for switching between environment configurations
|
|
420
|
+
|
|
421
|
+
#### From Docker Compose
|
|
422
|
+
|
|
423
|
+
If you're using Docker Compose with multiple environment files:
|
|
424
|
+
|
|
425
|
+
1. Keep your `docker-compose.yml` and environment-specific files
|
|
426
|
+
2. Create kse environments that switch between different compose files
|
|
427
|
+
3. Use kse to manage which compose configuration is active
|
|
428
|
+
|
|
429
|
+
**Example**:
|
|
430
|
+
```json
|
|
431
|
+
{
|
|
432
|
+
"name": "docker-local",
|
|
433
|
+
"description": "Docker local environment",
|
|
434
|
+
"config_files": [
|
|
435
|
+
{
|
|
436
|
+
"source": "docker-compose.local.yml",
|
|
437
|
+
"target": "docker-compose.override.yml"
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
"source": ".env.docker.local",
|
|
441
|
+
"target": ".env"
|
|
442
|
+
}
|
|
443
|
+
]
|
|
444
|
+
}
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
#### From Kubernetes ConfigMaps
|
|
448
|
+
|
|
449
|
+
If you're using Kubernetes ConfigMaps for configuration:
|
|
450
|
+
|
|
451
|
+
1. Export ConfigMaps to local files for development
|
|
452
|
+
2. Create kse environments for local development
|
|
453
|
+
3. Use kse for local environment switching
|
|
454
|
+
4. Keep ConfigMaps for production deployments
|
|
455
|
+
|
|
456
|
+
### Best Practices for Migration
|
|
457
|
+
|
|
458
|
+
1. **Start Small**: Begin with one or two environments, test thoroughly, then add more
|
|
459
|
+
2. **Backup First**: Create backups of your current configuration files before migration
|
|
460
|
+
3. **Test Verification**: Create verification scripts to ensure environment correctness
|
|
461
|
+
4. **Document**: Document your environment configurations and switching procedures
|
|
462
|
+
5. **Team Communication**: Inform your team about the new workflow and provide training
|
|
463
|
+
6. **Gradual Rollout**: Migrate one project at a time, learn from each migration
|
|
464
|
+
|
|
465
|
+
### Common Migration Issues
|
|
466
|
+
|
|
467
|
+
#### Issue: Source Files Don't Exist
|
|
468
|
+
|
|
469
|
+
**Problem**: Trying to register an environment but source files are missing.
|
|
470
|
+
|
|
471
|
+
**Solution**: Create source files first, then register the environment.
|
|
472
|
+
|
|
473
|
+
```bash
|
|
474
|
+
# Create source file
|
|
475
|
+
cp .env .env.local
|
|
476
|
+
|
|
477
|
+
# Register environment
|
|
478
|
+
kse env register local-env.json
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
#### Issue: Target Files Already Exist
|
|
482
|
+
|
|
483
|
+
**Problem**: Target files exist and you're worried about overwriting them.
|
|
484
|
+
|
|
485
|
+
**Solution**: kse automatically creates backups before switching. You can also manually backup first.
|
|
486
|
+
|
|
487
|
+
```bash
|
|
488
|
+
# Manual backup (optional, kse does this automatically)
|
|
489
|
+
cp .env .env.backup
|
|
490
|
+
|
|
491
|
+
# Switch environment (creates automatic backup)
|
|
492
|
+
kse env switch local
|
|
493
|
+
|
|
494
|
+
# If needed, rollback
|
|
495
|
+
kse env rollback
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
#### Issue: Verification Fails
|
|
499
|
+
|
|
500
|
+
**Problem**: Environment verification fails after switching.
|
|
501
|
+
|
|
502
|
+
**Solution**: Check the verification command and expected output. Update the environment configuration if needed.
|
|
503
|
+
|
|
504
|
+
```bash
|
|
505
|
+
# Check what went wrong
|
|
506
|
+
kse env verify
|
|
507
|
+
|
|
508
|
+
# Update environment configuration
|
|
509
|
+
# Edit the JSON file and re-register
|
|
510
|
+
kse env register local-env.json
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
### Migration Checklist
|
|
514
|
+
|
|
515
|
+
- [ ] Identify all environments
|
|
516
|
+
- [ ] Identify all configuration files
|
|
517
|
+
- [ ] Create source files for each environment
|
|
518
|
+
- [ ] Create environment configuration JSON files
|
|
519
|
+
- [ ] Register all environments with kse
|
|
520
|
+
- [ ] Test switching between environments
|
|
521
|
+
- [ ] Create verification scripts (optional but recommended)
|
|
522
|
+
- [ ] Update .gitignore
|
|
523
|
+
- [ ] Update team documentation
|
|
524
|
+
- [ ] Train team members on new workflow
|
|
525
|
+
- [ ] Remove old manual scripts
|
|
526
|
+
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# Export Command - Design
|
|
2
|
+
|
|
3
|
+
> Technical design for kse export command
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**Version**: 1.42.0
|
|
8
|
+
**Last Updated**: 2026-02-11
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Architecture
|
|
13
|
+
|
|
14
|
+
**Pattern:** Command Pattern
|
|
15
|
+
**CLI Framework:** Commander.js
|
|
16
|
+
**Markdown Processing:** marked library
|
|
17
|
+
**File I/O:** Node.js fs/promises
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Component Design
|
|
22
|
+
|
|
23
|
+
### ExportCommand
|
|
24
|
+
**File:** `lib/commands/export.command.js`
|
|
25
|
+
|
|
26
|
+
**Responsibilities:**
|
|
27
|
+
- Parse command arguments
|
|
28
|
+
- Validate inputs
|
|
29
|
+
- Orchestrate export process
|
|
30
|
+
- Display results
|
|
31
|
+
|
|
32
|
+
**Methods:**
|
|
33
|
+
```javascript
|
|
34
|
+
class ExportCommand {
|
|
35
|
+
async execute(specName, options) {
|
|
36
|
+
// 1. Validate Spec exists
|
|
37
|
+
// 2. Load Spec data
|
|
38
|
+
// 3. Format based on options.format
|
|
39
|
+
// 4. Write to file
|
|
40
|
+
// 5. Display success message
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
### ExportService
|
|
48
|
+
**File:** `lib/services/export.service.js`
|
|
49
|
+
|
|
50
|
+
**Responsibilities:**
|
|
51
|
+
- Load Spec files
|
|
52
|
+
- Format data for export
|
|
53
|
+
- Generate output files
|
|
54
|
+
|
|
55
|
+
**Methods:**
|
|
56
|
+
```javascript
|
|
57
|
+
class ExportService {
|
|
58
|
+
async loadSpec(specName) {
|
|
59
|
+
// Read requirements.md, design.md, tasks.md
|
|
60
|
+
// Return { requirements, design, tasks, metadata }
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async exportAsJSON(specData, outputPath) {
|
|
64
|
+
// Format as JSON
|
|
65
|
+
// Write to file
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async exportAsMarkdown(specData, outputPath) {
|
|
69
|
+
// Combine all documents
|
|
70
|
+
// Add TOC
|
|
71
|
+
// Write to file
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async exportAsHTML(specData, outputPath) {
|
|
75
|
+
// Convert Markdown to HTML
|
|
76
|
+
// Add styling
|
|
77
|
+
// Write to file
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Command Registration
|
|
85
|
+
|
|
86
|
+
**File:** `bin/kiro-spec-engine.js`
|
|
87
|
+
|
|
88
|
+
```javascript
|
|
89
|
+
program
|
|
90
|
+
.command('export <spec-name>')
|
|
91
|
+
.description('Export Spec in various formats')
|
|
92
|
+
.option('-f, --format <format>', 'Output format (json|md|html)', 'md')
|
|
93
|
+
.option('-o, --output <path>', 'Output file path')
|
|
94
|
+
.option('--include-meta', 'Include metadata', true)
|
|
95
|
+
.action(async (specName, options) => {
|
|
96
|
+
const command = new ExportCommand();
|
|
97
|
+
await command.execute(specName, options);
|
|
98
|
+
});
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Output Formats
|
|
104
|
+
|
|
105
|
+
### JSON Format
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"name": "01-00-feature-name",
|
|
109
|
+
"metadata": {
|
|
110
|
+
"created": "2026-01-23T10:00:00Z",
|
|
111
|
+
"version": "1.0.0"
|
|
112
|
+
},
|
|
113
|
+
"requirements": "# Requirements\n...",
|
|
114
|
+
"design": "# Design\n...",
|
|
115
|
+
"tasks": "# Tasks\n..."
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Markdown Format
|
|
120
|
+
```markdown
|
|
121
|
+
# Spec: 01-00-feature-name
|
|
122
|
+
|
|
123
|
+
**Exported:** 2026-01-23
|
|
124
|
+
**Version:** 1.0.0
|
|
125
|
+
|
|
126
|
+
## Table of Contents
|
|
127
|
+
- [Requirements](#requirements)
|
|
128
|
+
- [Design](#design)
|
|
129
|
+
- [Tasks](#tasks)
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Requirements
|
|
134
|
+
[Content from requirements.md]
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Design
|
|
139
|
+
[Content from design.md]
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Tasks
|
|
144
|
+
[Content from tasks.md]
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### HTML Format
|
|
148
|
+
```html
|
|
149
|
+
<!DOCTYPE html>
|
|
150
|
+
<html>
|
|
151
|
+
<head>
|
|
152
|
+
<title>Spec: 01-00-feature-name</title>
|
|
153
|
+
<style>/* Styling */</style>
|
|
154
|
+
</head>
|
|
155
|
+
<body>
|
|
156
|
+
<h1>Spec: 01-00-feature-name</h1>
|
|
157
|
+
<!-- Converted Markdown content -->
|
|
158
|
+
</body>
|
|
159
|
+
</html>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Error Handling
|
|
165
|
+
|
|
166
|
+
```javascript
|
|
167
|
+
// Spec not found
|
|
168
|
+
throw new Error(`Spec "${specName}" not found in .kiro/specs/`);
|
|
169
|
+
|
|
170
|
+
// Invalid format
|
|
171
|
+
throw new Error(`Invalid format "${format}". Use: json, md, or html`);
|
|
172
|
+
|
|
173
|
+
// File write error
|
|
174
|
+
throw new Error(`Failed to write export file: ${error.message}`);
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Requirements Traceability
|
|
180
|
+
|
|
181
|
+
| Requirement | Component | Method |
|
|
182
|
+
|-------------|-----------|--------|
|
|
183
|
+
| US-1 | ExportService | exportAsJSON() |
|
|
184
|
+
| US-2 | ExportService | exportAsMarkdown() |
|
|
185
|
+
| US-3 | ExportService | exportAsHTML() |
|
|
186
|
+
| FR-1 | ExportCommand | execute() |
|
|
187
|
+
| FR-2 | ExportService | exportAsJSON() |
|
|
188
|
+
| FR-3 | ExportService | exportAsMarkdown() |
|
|
189
|
+
| FR-4 | ExportService | exportAsHTML() |
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
**Version**: 1.42.0
|
|
194
|
+
**Last Updated**: 2026-02-11
|