kiro-spec-engine 1.3.0 → 1.4.1

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/README.md +228 -367
  3. package/README.zh.md +0 -330
  4. package/docs/README.md +223 -0
  5. package/docs/command-reference.md +252 -0
  6. package/docs/examples/add-export-command/design.md +194 -0
  7. package/docs/examples/add-export-command/requirements.md +110 -0
  8. package/docs/examples/add-export-command/tasks.md +88 -0
  9. package/docs/examples/add-rest-api/design.md +855 -0
  10. package/docs/examples/add-rest-api/requirements.md +323 -0
  11. package/docs/examples/add-rest-api/tasks.md +355 -0
  12. package/docs/examples/add-user-dashboard/design.md +192 -0
  13. package/docs/examples/add-user-dashboard/requirements.md +143 -0
  14. package/docs/examples/add-user-dashboard/tasks.md +91 -0
  15. package/docs/faq.md +696 -0
  16. package/docs/integration-modes.md +529 -0
  17. package/docs/integration-philosophy.md +313 -0
  18. package/docs/quick-start-with-ai-tools.md +374 -0
  19. package/docs/quick-start.md +711 -0
  20. package/docs/spec-workflow.md +453 -0
  21. package/docs/tools/claude-guide.md +653 -0
  22. package/docs/tools/cursor-guide.md +705 -0
  23. package/docs/tools/generic-guide.md +445 -0
  24. package/docs/tools/kiro-guide.md +308 -0
  25. package/docs/tools/vscode-guide.md +444 -0
  26. package/docs/tools/windsurf-guide.md +390 -0
  27. package/docs/troubleshooting.md +795 -0
  28. package/docs/zh/README.md +275 -0
  29. package/docs/zh/quick-start.md +711 -0
  30. package/docs/zh/tools/claude-guide.md +348 -0
  31. package/docs/zh/tools/cursor-guide.md +280 -0
  32. package/docs/zh/tools/generic-guide.md +498 -0
  33. package/docs/zh/tools/kiro-guide.md +342 -0
  34. package/docs/zh/tools/vscode-guide.md +448 -0
  35. package/docs/zh/tools/windsurf-guide.md +377 -0
  36. package/package.json +1 -1
@@ -0,0 +1,252 @@
1
+ # Command Reference
2
+
3
+ > Quick reference for all kse commands
4
+
5
+ **Version**: 1.3.0
6
+ **Last Updated**: 2026-01-23
7
+
8
+ ---
9
+
10
+ ## Command Naming
11
+
12
+ The package provides two command aliases:
13
+ - `kse` - **Recommended short alias** (use this in all documentation)
14
+ - `kiro-spec-engine` - Full command name (legacy, not recommended)
15
+
16
+ **Always use `kse` in examples and documentation for consistency.**
17
+
18
+ ---
19
+
20
+ ## Installation
21
+
22
+ ```bash
23
+ npm install -g kiro-spec-engine
24
+ ```
25
+
26
+ This creates the `kse` command globally.
27
+
28
+ ---
29
+
30
+ ## Core Commands
31
+
32
+ ### Project Setup
33
+
34
+ ```bash
35
+ # Initialize new project
36
+ kse init [project-name]
37
+
38
+ # Adopt existing project
39
+ kse adopt
40
+
41
+ # Check project status
42
+ kse status
43
+
44
+ # Run system diagnostics
45
+ kse doctor
46
+ ```
47
+
48
+ ### Spec Management
49
+
50
+ ```bash
51
+ # Create new spec (interactive)
52
+ kse create-spec
53
+
54
+ # Create spec with name
55
+ kse create-spec 01-00-feature-name
56
+
57
+ # List all specs
58
+ kse list-specs
59
+ ```
60
+
61
+ ### Task Management
62
+
63
+ ```bash
64
+ # Claim a task
65
+ kse task claim <spec-name> <task-id>
66
+
67
+ # Unclaim a task
68
+ kse task unclaim <spec-name> <task-id>
69
+
70
+ # Show task status
71
+ kse task status <spec-name>
72
+ ```
73
+
74
+ ### Context & Prompts
75
+
76
+ ```bash
77
+ # Export spec context
78
+ kse context export <spec-name>
79
+
80
+ # Export with steering rules
81
+ kse context export <spec-name> --steering
82
+
83
+ # Generate task prompt
84
+ kse prompt generate <spec-name> <task-id>
85
+
86
+ # Generate for specific tool
87
+ kse prompt generate <spec-name> <task-id> --tool=claude-code
88
+ ```
89
+
90
+ ### Watch Mode
91
+
92
+ ```bash
93
+ # Initialize watch configuration
94
+ kse watch init
95
+
96
+ # Start watch mode
97
+ kse watch start
98
+
99
+ # Stop watch mode
100
+ kse watch stop
101
+
102
+ # Check watch status
103
+ kse watch status
104
+
105
+ # View watch logs
106
+ kse watch logs
107
+
108
+ # Show automation metrics
109
+ kse watch metrics
110
+
111
+ # List available presets
112
+ kse watch presets
113
+
114
+ # Install a preset
115
+ kse watch install <preset-name>
116
+ ```
117
+
118
+ ### Workflows
119
+
120
+ ```bash
121
+ # List available workflows
122
+ kse workflows
123
+
124
+ # Show workflow details
125
+ kse workflows show <workflow-name>
126
+
127
+ # Open workflow guide
128
+ kse workflows guide
129
+
130
+ # Mark workflow as complete
131
+ kse workflows complete <workflow-name>
132
+ ```
133
+
134
+ ### Workspace Management
135
+
136
+ ```bash
137
+ # Sync workspace
138
+ kse workspace sync
139
+
140
+ # Show workspace info
141
+ kse workspace info
142
+
143
+ # List team members
144
+ kse workspace team
145
+ ```
146
+
147
+ ### Version & Upgrade
148
+
149
+ ```bash
150
+ # Show version info
151
+ kse version-info
152
+
153
+ # Check for upgrades
154
+ kse upgrade check
155
+
156
+ # Perform upgrade
157
+ kse upgrade
158
+ ```
159
+
160
+ ---
161
+
162
+ ## Global Options
163
+
164
+ ```bash
165
+ # Set language
166
+ kse --lang zh <command>
167
+ kse --lang en <command>
168
+
169
+ # Show help
170
+ kse --help
171
+ kse <command> --help
172
+
173
+ # Show version
174
+ kse --version
175
+ ```
176
+
177
+ ---
178
+
179
+ ## Common Workflows
180
+
181
+ ### Starting a New Feature
182
+
183
+ ```bash
184
+ # 1. Create spec
185
+ kse create-spec 01-00-my-feature
186
+
187
+ # 2. Export context
188
+ kse context export 01-00-my-feature
189
+
190
+ # 3. Work on tasks...
191
+
192
+ # 4. Sync progress
193
+ kse workspace sync
194
+ ```
195
+
196
+ ### Setting Up Automation
197
+
198
+ ```bash
199
+ # 1. Initialize watch mode
200
+ kse watch init
201
+
202
+ # 2. Install presets
203
+ kse watch install auto-sync
204
+ kse watch install test-runner
205
+
206
+ # 3. Start watching
207
+ kse watch start
208
+
209
+ # 4. Check status
210
+ kse watch status
211
+ ```
212
+
213
+ ### Working with Team
214
+
215
+ ```bash
216
+ # 1. Check team status
217
+ kse workspace team
218
+
219
+ # 2. Claim a task
220
+ kse task claim 01-00-feature 1.1
221
+
222
+ # 3. Work on task...
223
+
224
+ # 4. Sync when done
225
+ kse workspace sync
226
+ ```
227
+
228
+ ---
229
+
230
+ ## Tips
231
+
232
+ 1. **Use `kse` not `kiro-spec-engine`** - Shorter and easier to type
233
+ 2. **Add `--help` to any command** - Get detailed usage information
234
+ 3. **Use tab completion** - Most shells support command completion
235
+ 4. **Check `kse doctor`** - Diagnose issues quickly
236
+ 5. **Use watch mode** - Automate repetitive tasks
237
+
238
+ ---
239
+
240
+ ## See Also
241
+
242
+ - [Manual Workflows Guide](./manual-workflows-guide.md)
243
+ - [Cross-Tool Guide](./cross-tool-guide.md)
244
+ - [Adoption Guide](./adoption-guide.md)
245
+ - [Developer Guide](./developer-guide.md)
246
+
247
+ ---
248
+
249
+ **Need Help?**
250
+ - Run `kse --help` for command reference
251
+ - Check [GitHub Issues](https://github.com/heguangyong/kiro-spec-engine/issues)
252
+ - Review [Documentation](../README.md)
@@ -0,0 +1,194 @@
1
+ # Export Command - Design
2
+
3
+ > Technical design for kse export command
4
+
5
+ ---
6
+
7
+ **Version**: 1.0.0
8
+ **Last Updated**: 2026-01-23
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.0.0
194
+ **Last Updated**: 2026-01-23
@@ -0,0 +1,110 @@
1
+ # Export Command - Requirements
2
+
3
+ > Example Spec demonstrating CLI command development
4
+
5
+ ---
6
+
7
+ **Version**: 1.0.0
8
+ **Last Updated**: 2026-01-23
9
+ **Spec Type**: Example - CLI Feature
10
+
11
+ ---
12
+
13
+ ## Overview
14
+
15
+ This Spec demonstrates how to add a new CLI command to kse. We'll implement `kse export` command that exports Spec data in various formats (JSON, Markdown, HTML).
16
+
17
+ **Learning Points:**
18
+ - CLI command structure
19
+ - Argument parsing
20
+ - File I/O operations
21
+ - Output formatting
22
+ - Error handling in CLI
23
+
24
+ ---
25
+
26
+ ## User Stories
27
+
28
+ ### US-1: Export Spec as JSON
29
+ **As a** developer
30
+ **I want to** export a Spec as JSON
31
+ **So that** I can process it programmatically
32
+
33
+ **Acceptance Criteria:**
34
+ - WHEN I run `kse export 01-00-feature --format json` THEN I get a JSON file
35
+ - WHEN export succeeds THEN I see success message with file path
36
+ - WHEN Spec doesn't exist THEN I see error message
37
+
38
+ ### US-2: Export Spec as Markdown
39
+ **As a** developer
40
+ **I want to** export a Spec as single Markdown file
41
+ **So that** I can share it easily
42
+
43
+ **Acceptance Criteria:**
44
+ - WHEN I run `kse export 01-00-feature --format md` THEN I get a Markdown file
45
+ - WHEN I don't specify format THEN Markdown is default
46
+ - WHEN export succeeds THEN file contains all three Spec documents
47
+
48
+ ### US-3: Export Spec as HTML
49
+ **As a** developer
50
+ **I want to** export a Spec as HTML
51
+ **So that** I can view it in a browser
52
+
53
+ **Acceptance Criteria:**
54
+ - WHEN I run `kse export 01-00-feature --format html` THEN I get an HTML file
55
+ - WHEN I open HTML THEN it has proper styling
56
+ - WHEN HTML includes code blocks THEN they have syntax highlighting
57
+
58
+ ---
59
+
60
+ ## Functional Requirements
61
+
62
+ ### FR-1: Command Interface
63
+ ```bash
64
+ kse export <spec-name> [options]
65
+
66
+ Options:
67
+ --format, -f Output format (json|md|html) [default: md]
68
+ --output, -o Output file path [default: auto-generated]
69
+ --include-meta Include metadata in export [default: true]
70
+ ```
71
+
72
+ ### FR-2: JSON Export
73
+ - Export structure: `{ name, requirements, design, tasks, metadata }`
74
+ - Include file paths and timestamps
75
+ - Pretty-print JSON (2-space indentation)
76
+
77
+ ### FR-3: Markdown Export
78
+ - Combine requirements.md, design.md, tasks.md
79
+ - Add table of contents
80
+ - Add metadata header
81
+ - Preserve formatting
82
+
83
+ ### FR-4: HTML Export
84
+ - Convert Markdown to HTML
85
+ - Add CSS styling
86
+ - Add syntax highlighting for code blocks
87
+ - Make it printable
88
+
89
+ ---
90
+
91
+ ## Non-Functional Requirements
92
+
93
+ ### NFR-1: Performance
94
+ - Export completes in < 1 second for typical Spec
95
+ - Handle large Specs (> 10MB) gracefully
96
+
97
+ ### NFR-2: Error Handling
98
+ - Clear error messages for missing Specs
99
+ - Validate format option
100
+ - Handle file write errors
101
+
102
+ ### NFR-3: Usability
103
+ - Intuitive command syntax
104
+ - Helpful error messages
105
+ - Progress indicator for large exports
106
+
107
+ ---
108
+
109
+ **Version**: 1.0.0
110
+ **Last Updated**: 2026-01-23
@@ -0,0 +1,88 @@
1
+ # Export Command - Tasks
2
+
3
+ > Implementation plan for kse export command
4
+
5
+ ---
6
+
7
+ **Version**: 1.0.0
8
+ **Last Updated**: 2026-01-23
9
+
10
+ ---
11
+
12
+ ## Phase 1: Core Infrastructure
13
+
14
+ - [ ] 1.1 Create ExportService class
15
+ - Implement loadSpec() method
16
+ - Add error handling for missing files
17
+ - Write unit tests
18
+
19
+ - [ ] 1.2 Create ExportCommand class
20
+ - Implement execute() method
21
+ - Add input validation
22
+ - Write unit tests
23
+
24
+ ---
25
+
26
+ ## Phase 2: Format Implementations
27
+
28
+ - [ ] 2.1 Implement JSON export
29
+ - Create exportAsJSON() method
30
+ - Format Spec data as JSON
31
+ - Add pretty-printing
32
+ - Write unit tests
33
+
34
+ - [ ] 2.2 Implement Markdown export
35
+ - Create exportAsMarkdown() method
36
+ - Combine all Spec documents
37
+ - Generate table of contents
38
+ - Write unit tests
39
+
40
+ - [ ] 2.3 Implement HTML export
41
+ - Install marked library
42
+ - Create exportAsHTML() method
43
+ - Convert Markdown to HTML
44
+ - Add CSS styling
45
+ - Add syntax highlighting
46
+ - Write unit tests
47
+
48
+ ---
49
+
50
+ ## Phase 3: CLI Integration
51
+
52
+ - [ ] 3.1 Register command in CLI
53
+ - Add command to bin/kiro-spec-engine.js
54
+ - Define options and arguments
55
+ - Wire up to ExportCommand
56
+
57
+ - [ ] 3.2 Add output path handling
58
+ - Generate default output paths
59
+ - Validate custom output paths
60
+ - Create output directories if needed
61
+
62
+ - [ ] 3.3 Add user feedback
63
+ - Show progress spinner
64
+ - Display success message with file path
65
+ - Show helpful error messages
66
+
67
+ ---
68
+
69
+ ## Phase 4: Testing
70
+
71
+ - [ ] 4.1 Unit tests for ExportService
72
+ - [ ] 4.2 Unit tests for ExportCommand
73
+ - [ ] 4.3 Integration tests for CLI command
74
+ - [ ] 4.4 Test all three export formats
75
+ - [ ] 4.5 Test error scenarios
76
+
77
+ ---
78
+
79
+ ## Phase 5: Documentation
80
+
81
+ - [ ] 5.1 Update command reference
82
+ - [ ] 5.2 Add usage examples
83
+ - [ ] 5.3 Update CHANGELOG
84
+
85
+ ---
86
+
87
+ **Version**: 1.0.0
88
+ **Last Updated**: 2026-01-23