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,529 @@
1
+ # Integration Modes Guide
2
+
3
+ > Three ways to integrate kse with your AI coding tools
4
+
5
+ ---
6
+
7
+ **Version**: 1.0.0
8
+ **Last Updated**: 2026-01-23
9
+ **Audience**: Intermediate
10
+ **Estimated Time**: 8 minutes
11
+
12
+ ---
13
+
14
+ ## Overview
15
+
16
+ kse supports three integration modes to work with different AI coding tools. Each mode offers different levels of automation and suits different workflows.
17
+
18
+ ```mermaid
19
+ graph TD
20
+ A[kse Integration] --> B[Native Integration]
21
+ A --> C[Manual Export]
22
+ A --> D[Watch Mode]
23
+ B --> E[Kiro IDE]
24
+ C --> F[Cursor/Claude/VS Code]
25
+ D --> G[All Tools]
26
+ ```
27
+
28
+ ---
29
+
30
+ ## Mode 1: Native Integration ⭐
31
+
32
+ **Best for:** Kiro IDE users
33
+ **Automation Level:** Fully Automatic
34
+ **Setup Complexity:** None (built-in)
35
+
36
+ ### How It Works
37
+
38
+ With native integration, the AI tool directly accesses kse without any manual steps. The AI can read Specs, export context, and update tasks automatically.
39
+
40
+ ```mermaid
41
+ sequenceDiagram
42
+ participant User
43
+ participant AI Tool
44
+ participant kse
45
+
46
+ User->>AI Tool: "Implement user login"
47
+ AI Tool->>kse: Read Spec files directly
48
+ kse->>AI Tool: Spec content
49
+ AI Tool->>AI Tool: Generate code
50
+ AI Tool->>kse: Update task status
51
+ AI Tool->>User: Code generated
52
+ ```
53
+
54
+ ### Supported Tools
55
+
56
+ - **Kiro IDE** - Full native support
57
+
58
+ ### Workflow Example
59
+
60
+ ```
61
+ You: "Implement the user login feature"
62
+
63
+ Kiro AI:
64
+ [Automatically reads .kiro/specs/01-00-user-login/]
65
+ [Understands requirements and design]
66
+ [Generates code]
67
+ [Updates tasks.md automatically]
68
+
69
+ ✓ Implemented AuthController
70
+ ✓ Implemented AuthService
71
+ ✓ Updated task 1.1 to complete
72
+ ```
73
+
74
+ ### Advantages
75
+
76
+ - ✅ **Zero manual steps** - AI handles everything
77
+ - ✅ **Always up-to-date** - AI reads latest Spec files
78
+ - ✅ **Automatic task tracking** - AI updates task status
79
+ - ✅ **Seamless workflow** - No context switching
80
+
81
+ ### Limitations
82
+
83
+ - ❌ **Tool-specific** - Only works with Kiro IDE currently
84
+ - ❌ **Requires compatible AI** - AI must support file system access
85
+
86
+ ---
87
+
88
+ ## Mode 2: Manual Export
89
+
90
+ **Best for:** Claude Code, ChatGPT, Cursor, VS Code + Copilot
91
+ **Automation Level:** AI-Driven (for tools with command execution) or Semi-Manual (for web tools)
92
+ **Setup Complexity:** Low
93
+
94
+ ### How It Works
95
+
96
+ The AI tool can directly call kse commands during your conversation. You stay in your familiar AI tool interface - the AI handles kse interaction automatically.
97
+
98
+ ```mermaid
99
+ sequenceDiagram
100
+ participant User
101
+ participant AI Tool
102
+ participant kse
103
+
104
+ User->>AI Tool: "Implement user login feature"
105
+ AI Tool->>kse: kse context export user-login
106
+ kse->>AI Tool: context-export.md content
107
+ AI Tool->>AI Tool: Generate code based on Spec
108
+ AI Tool->>User: Here's the implementation
109
+ AI Tool->>kse: Update tasks.md
110
+ ```
111
+
112
+ **Note:** For AI tools without command execution (like ChatGPT web), you can manually export and paste as a fallback.
113
+
114
+ ### Supported Tools
115
+
116
+ - **Claude Code** - Large context window, excellent understanding
117
+ - **ChatGPT** - Good for conversational development
118
+ - **Cursor** - IDE integration with AI pair programming
119
+ - **VS Code + Copilot** - Inline suggestions with context
120
+ - **Any AI tool** - Works with any tool that accepts text input
121
+
122
+ ### Workflow Example
123
+
124
+ **With AI tools that can execute commands (Cursor, Windsurf, Claude Desktop):**
125
+
126
+ ```
127
+ You: "I have a Spec for user login at 01-00-user-login.
128
+ Please implement task 1.1: Create AuthController"
129
+
130
+ AI Tool:
131
+ [Executes: kse context export 01-00-user-login]
132
+ [Reads the exported context]
133
+ [Generates AuthController code]
134
+ [Updates tasks.md automatically]
135
+
136
+ ✓ Created AuthController with login/logout methods
137
+ ✓ Updated task 1.1 to complete
138
+ ```
139
+
140
+ **With web-based AI tools (ChatGPT, Claude web):**
141
+
142
+ ```bash
143
+ # You run this once
144
+ kse context export 01-00-user-login
145
+ cat .kiro/specs/01-00-user-login/context-export.md | pbcopy
146
+
147
+ # Then paste into AI tool
148
+ You: "Here's my Spec context: [paste]
149
+ Please implement task 1.1: Create AuthController"
150
+
151
+ AI: [Generates code based on your Spec]
152
+
153
+ # You update tasks manually
154
+ # Edit .kiro/specs/01-00-user-login/tasks.md
155
+ ```
156
+
157
+ ### Advantages
158
+
159
+ - ✅ **Works with any AI tool** - Universal compatibility
160
+ - ✅ **AI can call kse directly** - For tools with command execution
161
+ - ✅ **Fallback to manual** - Copy-paste for web-based tools
162
+ - ✅ **Simple setup** - No configuration needed
163
+ - ✅ **Reliable** - No dependencies on special integrations
164
+
165
+ ### Limitations
166
+
167
+ - ❌ **Varies by tool** - Command execution depends on AI tool capabilities
168
+ - ❌ **Manual fallback** - Web-based tools require copy-paste
169
+ - ❌ **Context refresh** - May need to re-export after Spec changes (unless using Watch Mode)
170
+
171
+ ### Optimization Tips
172
+
173
+ **Create shell aliases for faster export:**
174
+
175
+ ```bash
176
+ # Add to ~/.bashrc or ~/.zshrc
177
+ alias kse-clip='kse context export $1 && cat .kiro/specs/$1/context-export.md | pbcopy && echo "✅ Context copied to clipboard"'
178
+
179
+ # Usage
180
+ kse-clip 01-00-user-login
181
+ # Now just paste into your AI tool
182
+ ```
183
+
184
+ **Generate task-specific prompts:**
185
+ ```bash
186
+ # Instead of exporting entire Spec
187
+ kse prompt generate 01-00-user-login 1.1
188
+
189
+ # Generates focused prompt for just task 1.1
190
+ ```
191
+
192
+ ---
193
+
194
+ ## Mode 3: Watch Mode 🔄
195
+
196
+ **Best for:** Frequent Spec changes, team collaboration
197
+ **Automation Level:** Automatic (after setup)
198
+ **Setup Complexity:** Medium
199
+
200
+ ### How It Works
201
+
202
+ kse monitors your Spec files for changes and automatically re-exports context. Your AI tool can always access the latest context without manual export.
203
+
204
+ ```mermaid
205
+ sequenceDiagram
206
+ participant User
207
+ participant kse Watch
208
+ participant Spec Files
209
+ participant AI Tool
210
+
211
+ User->>Spec Files: Edit requirements.md
212
+ Spec Files->>kse Watch: File changed event
213
+ kse Watch->>kse Watch: Auto-export context
214
+ kse Watch->>Spec Files: Update context-export.md
215
+ User->>AI Tool: Use latest context
216
+ AI Tool->>Spec Files: Read context-export.md
217
+ ```
218
+
219
+ ### Supported Tools
220
+
221
+ - **All tools** - Works with any AI tool
222
+ - **Best with:** Windsurf, Cline (can execute commands)
223
+ - **Good with:** Cursor, Claude (manual context refresh)
224
+
225
+ ### Setup
226
+
227
+ **1. Initialize watch mode:**
228
+ ```bash
229
+ kse watch init
230
+ ```
231
+
232
+ **2. Install auto-export preset:**
233
+ ```bash
234
+ kse watch install context-export
235
+ ```
236
+
237
+ **3. Start watching:**
238
+ ```bash
239
+ kse watch start
240
+ ```
241
+
242
+ **4. Verify it's running:**
243
+ ```bash
244
+ kse watch status
245
+ ```
246
+
247
+ Expected output:
248
+ ```
249
+ Watch Mode: Active
250
+ Watching: .kiro/specs/**/*.md
251
+ Actions: context-export
252
+ Last execution: 2 minutes ago
253
+ ```
254
+
255
+ ### Workflow Example
256
+
257
+ **With watch mode running:**
258
+
259
+ 1. **Edit your Spec** (e.g., add a new requirement)
260
+ ```bash
261
+ # Edit .kiro/specs/01-00-user-login/requirements.md
262
+ ```
263
+
264
+ 2. **kse automatically detects the change**
265
+ ```
266
+ [Watch Mode] Detected change: requirements.md
267
+ [Watch Mode] Exporting context for 01-00-user-login...
268
+ [Watch Mode] ✓ Context exported
269
+ ```
270
+
271
+ 3. **Use updated context immediately**
272
+ ```bash
273
+ # Context is already up-to-date
274
+ cat .kiro/specs/01-00-user-login/context-export.md | pbcopy
275
+ ```
276
+
277
+ ### Advantages
278
+
279
+ - ✅ **Always up-to-date** - Context auto-updates on Spec changes
280
+ - ✅ **No manual export** - Set it and forget it
281
+ - ✅ **Great for iteration** - Refine Specs without re-exporting
282
+ - ✅ **Team-friendly** - Everyone gets latest context
283
+
284
+ ### Limitations
285
+
286
+ - ❌ **Requires setup** - Initial configuration needed
287
+ - ❌ **Background process** - Must keep watch mode running
288
+ - ❌ **Resource usage** - Monitors file system continuously
289
+
290
+ ### Advanced Configuration
291
+
292
+ **Custom watch patterns:**
293
+ ```json
294
+ {
295
+ "patterns": [
296
+ ".kiro/specs/**/requirements.md",
297
+ ".kiro/specs/**/design.md",
298
+ ".kiro/specs/**/tasks.md"
299
+ ],
300
+ "actions": [
301
+ {
302
+ "name": "auto-export",
303
+ "command": "kse context export ${spec-name}"
304
+ }
305
+ ]
306
+ }
307
+ ```
308
+
309
+ **Multiple actions:**
310
+ ```bash
311
+ # Install multiple presets
312
+ kse watch install context-export
313
+ kse watch install prompt-regen
314
+ kse watch install auto-sync
315
+ ```
316
+
317
+ ---
318
+
319
+ ## Choosing the Right Mode
320
+
321
+ ### Decision Matrix
322
+
323
+ | Factor | Native | Manual Export | Watch Mode |
324
+ |--------|--------|---------------|------------|
325
+ | **Setup Time** | None | None | 5 minutes |
326
+ | **Automation** | Full | None | Partial |
327
+ | **Tool Support** | Kiro only | All tools | All tools |
328
+ | **Context Freshness** | Always fresh | Manual refresh | Auto-refresh |
329
+ | **Task Tracking** | Automatic | Manual | Manual |
330
+ | **Best For** | Kiro users | Quick start | Active development |
331
+
332
+ ### Recommendations by Tool
333
+
334
+ **Kiro IDE:**
335
+ - ✅ Use **Native Integration** (built-in)
336
+ - No setup needed, fully automatic
337
+
338
+ **Windsurf / Cline:**
339
+ - ✅ Use **Manual Export** initially
340
+ - ⭐ Upgrade to **Watch Mode** for active projects
341
+ - These tools can execute kse commands directly
342
+
343
+ **Claude Code / ChatGPT:**
344
+ - ✅ Use **Manual Export**
345
+ - Create shell aliases for faster workflow
346
+ - Use task-specific prompts for large Specs
347
+
348
+ **Cursor:**
349
+ - ✅ Use **Manual Export** with prompt generation
350
+ - ⭐ Consider **Watch Mode** for frequently changing Specs
351
+ - Cursor can read updated context files automatically
352
+
353
+ **VS Code + Copilot:**
354
+ - ✅ Use **Manual Export**
355
+ - Reference Spec files in code comments
356
+ - Copilot reads project files automatically
357
+
358
+ **Generic AI Tools:**
359
+ - ✅ Use **Manual Export**
360
+ - Universal compatibility
361
+ - Simple copy-paste workflow
362
+
363
+ ---
364
+
365
+ ## Hybrid Approaches
366
+
367
+ ### Manual Export + Watch Mode
368
+
369
+ Use watch mode to keep context fresh, but still manually provide context to AI:
370
+
371
+ ```bash
372
+ # Terminal 1: Keep watch mode running
373
+ kse watch start
374
+
375
+ # Terminal 2: Work normally
376
+ # Edit Specs, context auto-updates
377
+ # Copy latest context when needed
378
+ cat .kiro/specs/01-00-user-login/context-export.md | pbcopy
379
+ ```
380
+
381
+ **Benefits:**
382
+ - Context always fresh
383
+ - Full control over when to provide context to AI
384
+ - Best of both worlds
385
+
386
+ ### Native + Manual Export
387
+
388
+ Use native integration primarily, but export for sharing:
389
+
390
+ ```bash
391
+ # Work with Kiro IDE (native integration)
392
+ # When sharing with team member using different tool:
393
+ kse context export 01-00-user-login
394
+ # Send context-export.md to teammate
395
+ ```
396
+
397
+ **Benefits:**
398
+ - Seamless personal workflow
399
+ - Easy collaboration with non-Kiro users
400
+
401
+ ---
402
+
403
+ ## Context Flow Visualization
404
+
405
+ ### Complete Context Flow
406
+
407
+ ```mermaid
408
+ sequenceDiagram
409
+ participant Dev as Developer
410
+ participant kse as kse
411
+ participant Spec as Spec Files
412
+ participant AI as AI Tool
413
+
414
+ Dev->>kse: Create Spec
415
+ kse->>Spec: Generate requirements.md, design.md, tasks.md
416
+ Dev->>Spec: Edit Spec files
417
+
418
+ alt Native Integration
419
+ AI->>Spec: Read files directly
420
+ AI->>Dev: Generate code
421
+ AI->>Spec: Update tasks.md
422
+ else Manual Export
423
+ Dev->>kse: kse context export
424
+ kse->>Spec: Generate context-export.md
425
+ Dev->>AI: Provide context
426
+ AI->>Dev: Generate code
427
+ Dev->>Spec: Update tasks.md
428
+ else Watch Mode
429
+ Spec->>kse: File change event
430
+ kse->>Spec: Auto-generate context-export.md
431
+ Dev->>AI: Provide context
432
+ AI->>Dev: Generate code
433
+ Dev->>Spec: Update tasks.md
434
+ end
435
+ ```
436
+
437
+ ---
438
+
439
+ ## Best Practices
440
+
441
+ ### For All Modes
442
+
443
+ 1. **Keep Specs updated** - Outdated Specs lead to incorrect code
444
+ 2. **Use version control** - Commit Spec changes
445
+ 3. **Review AI output** - AI follows Spec, but verify correctness
446
+ 4. **Update tasks promptly** - Track progress accurately
447
+
448
+ ### For Manual Export
449
+
450
+ 1. **Create aliases** - Speed up export workflow
451
+ 2. **Use task-specific prompts** - For large Specs
452
+ 3. **Re-export after changes** - Keep context fresh
453
+ 4. **Include steering rules** - For consistent AI behavior
454
+
455
+ ### For Watch Mode
456
+
457
+ 1. **Start watch at project start** - Make it part of your routine
458
+ 2. **Check watch status** - Ensure it's running
459
+ 3. **Monitor logs** - Catch any export errors
460
+ 4. **Stop when not needed** - Save system resources
461
+
462
+ ---
463
+
464
+ ## Troubleshooting
465
+
466
+ ### Native Integration Issues
467
+
468
+ **Problem:** AI doesn't see Spec files
469
+ **Solution:** Ensure `.kiro/specs/` directory exists and has correct permissions
470
+
471
+ ### Manual Export Issues
472
+
473
+ **Problem:** Context file too large for AI tool
474
+ **Solution:** Use task-specific prompts:
475
+ ```bash
476
+ kse prompt generate spec-name task-id
477
+ ```
478
+
479
+ **Problem:** AI doesn't follow Spec
480
+ **Solution:** Be explicit in prompt: "Strictly follow the design document"
481
+
482
+ ### Watch Mode Issues
483
+
484
+ **Problem:** Watch mode not detecting changes
485
+ **Solution:**
486
+ ```bash
487
+ kse watch stop
488
+ kse watch start
489
+ ```
490
+
491
+ **Problem:** Context not updating
492
+ **Solution:** Check watch logs:
493
+ ```bash
494
+ kse watch logs
495
+ ```
496
+
497
+ ---
498
+
499
+ ## Related Documentation
500
+
501
+ - **[Quick Start Guide](quick-start.md)** - Get started with kse
502
+ - **[Tool-Specific Guides](tools/)** - Detailed guides for each AI tool
503
+ - **[Spec Workflow](spec-workflow.md)** - Understanding Specs
504
+ - **[Command Reference](command-reference.md)** - All kse commands
505
+
506
+ ---
507
+
508
+ ## Summary
509
+
510
+ **Three Integration Modes:**
511
+
512
+ 1. **Native Integration** - Fully automatic (Kiro IDE)
513
+ 2. **Manual Export** - Universal compatibility (all tools)
514
+ 3. **Watch Mode** - Auto-refresh context (all tools)
515
+
516
+ **Choose based on:**
517
+ - Your AI tool's capabilities
518
+ - Your workflow preferences
519
+ - Project activity level
520
+
521
+ **Start simple, upgrade as needed:**
522
+ ```
523
+ Manual Export → Watch Mode → Native Integration
524
+ ```
525
+
526
+ ---
527
+
528
+ **Version**: 1.0.0
529
+ **Last Updated**: 2026-01-23