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,444 @@
1
+ # Using kse with VS Code + Copilot
2
+
3
+ > Integration guide for kse with Visual Studio Code and GitHub Copilot
4
+
5
+ ---
6
+
7
+ **Version**: 1.0.0
8
+ **Last Updated**: 2026-01-23
9
+ **Tool**: VS Code + GitHub Copilot
10
+ **Integration Mode**: Manual Export + Inline Context
11
+ **Estimated Setup Time**: 5 minutes
12
+
13
+ ---
14
+
15
+ ## Overview
16
+
17
+ **VS Code + Copilot** provides AI-powered code completion and suggestions as you type.
18
+
19
+ **kse integration** uses a hybrid approach:
20
+ - Export context for understanding
21
+ - Reference Specs in code comments
22
+ - Copilot suggests code based on Spec files
23
+
24
+ ### Why Use kse with VS Code + Copilot?
25
+
26
+ - ✅ **IDE you already use** - No need to switch tools
27
+ - ✅ **Inline suggestions** - AI helps as you type
28
+ - ✅ **Spec-aware completions** - Copilot reads your Spec files
29
+ - ✅ **Familiar workflow** - Minimal changes to your process
30
+
31
+ ---
32
+
33
+ ## Integration Mode
34
+
35
+ **Mode:** Manual Export + Inline Context
36
+
37
+ **How it works:**
38
+ 1. Create Specs in kse
39
+ 2. Reference Specs in code comments
40
+ 3. Copilot reads Spec files and suggests code
41
+ 4. Optionally export context for Copilot Chat
42
+
43
+ ---
44
+
45
+ ## Setup
46
+
47
+ ### Prerequisites
48
+
49
+ - **VS Code installed** ([Download](https://code.visualstudio.com/))
50
+ - **GitHub Copilot extension** ([Install](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot))
51
+ - **kse installed** globally (`npm install -g kiro-spec-engine`)
52
+ - **Project adopted** by kse (`kse adopt`)
53
+
54
+ ### Step 1: Configure VS Code Settings
55
+
56
+ Add to `.vscode/settings.json`:
57
+
58
+ ```json
59
+ {
60
+ "github.copilot.enable": {
61
+ "*": true,
62
+ "markdown": true
63
+ },
64
+ "files.associations": {
65
+ "*.md": "markdown"
66
+ }
67
+ }
68
+ ```
69
+
70
+ ### Step 2: Create Workspace Snippet (Optional)
71
+
72
+ Create `.vscode/kse.code-snippets`:
73
+
74
+ ```json
75
+ {
76
+ "kse Spec Reference": {
77
+ "prefix": "kse-ref",
78
+ "body": [
79
+ "/**",
80
+ " * Spec: .kiro/specs/${1:spec-name}/",
81
+ " * Task: ${2:task-id}",
82
+ " * ",
83
+ " * Requirements: ${3:requirement-summary}",
84
+ " * Design: ${4:design-summary}",
85
+ " */"
86
+ ],
87
+ "description": "Reference kse Spec in code"
88
+ }
89
+ }
90
+ ```
91
+
92
+ ---
93
+
94
+ ## Workflow
95
+
96
+ ### Method 1: Inline Spec References (Recommended) ⭐
97
+
98
+ **Reference Specs in your code comments:**
99
+
100
+ ```javascript
101
+ /**
102
+ * AuthController - Handles user authentication
103
+ *
104
+ * Spec: .kiro/specs/01-00-user-login/
105
+ * Task: 2.1 - Implement AuthController
106
+ *
107
+ * Requirements:
108
+ * - POST /api/auth/login endpoint
109
+ * - Validate email and password
110
+ * - Return JWT token on success
111
+ * - Return error on failure
112
+ *
113
+ * Design: See .kiro/specs/01-00-user-login/design.md#authcontroller
114
+ */
115
+ class AuthController {
116
+ // Start typing, Copilot will suggest based on comments and Spec files
117
+ async login(req, res) {
118
+ // Copilot suggests implementation
119
+ ```
120
+
121
+ **Copilot reads:**
122
+ - Your comments
123
+ - Spec files in `.kiro/specs/`
124
+ - Other project files
125
+
126
+ **Copilot suggests:**
127
+ - Method implementations
128
+ - Error handling
129
+ - Validation logic
130
+ - All based on your Spec
131
+
132
+ ### Method 2: Using Copilot Chat
133
+
134
+ **Step 1: Export context**
135
+ ```bash
136
+ kse context export 01-00-user-login
137
+ ```
138
+
139
+ **Step 2: Open Copilot Chat** (Ctrl+Shift+I or Cmd+Shift+I)
140
+
141
+ **Step 3: Provide context**
142
+ ```
143
+ I'm implementing user login. Here's the Spec:
144
+
145
+ [Paste context from context-export.md]
146
+
147
+ Please help me implement the AuthController.
148
+ ```
149
+
150
+ **Step 4: Copilot generates code**
151
+
152
+ ### Method 3: File-Level Context
153
+
154
+ **Add Spec reference at top of file:**
155
+
156
+ ```javascript
157
+ /**
158
+ * @file AuthController.js
159
+ * @spec .kiro/specs/01-00-user-login/
160
+ * @task 2.1
161
+ *
162
+ * Implements user authentication according to Spec.
163
+ * See design document for architecture details.
164
+ */
165
+
166
+ // Copilot now has context for entire file
167
+ ```
168
+
169
+ ---
170
+
171
+ ## Example Workflow
172
+
173
+ ### Implementing a Feature
174
+
175
+ **1. Create Spec**
176
+ ```bash
177
+ kse create-spec 01-00-user-login
178
+ # Edit requirements.md, design.md, tasks.md
179
+ ```
180
+
181
+ **2. Create file with Spec reference**
182
+
183
+ ```javascript
184
+ /**
185
+ * AuthService.js
186
+ *
187
+ * Spec: .kiro/specs/01-00-user-login/
188
+ * Task: 2.2 - Implement AuthService
189
+ *
190
+ * Methods to implement:
191
+ * - hashPassword(password) - Use bcrypt with 10 salt rounds
192
+ * - authenticate(email, password) - Verify credentials
193
+ * - generateToken(user) - Create JWT token (24h expiration)
194
+ *
195
+ * See design.md for detailed specifications.
196
+ */
197
+
198
+ class AuthService {
199
+ constructor() {
200
+ // Copilot suggests: this.bcrypt = require('bcrypt');
201
+ ```
202
+
203
+ **3. Let Copilot suggest**
204
+
205
+ As you type, Copilot suggests:
206
+ - Constructor initialization
207
+ - Method signatures
208
+ - Implementation details
209
+ - Error handling
210
+ - All based on your Spec comments
211
+
212
+ **4. Accept or modify suggestions**
213
+
214
+ Press `Tab` to accept, or keep typing to modify.
215
+
216
+ **5. Update tasks.md**
217
+
218
+ ```markdown
219
+ - [x] 2.2 Implement AuthService
220
+ ```
221
+
222
+ ---
223
+
224
+ ## Tips & Best Practices
225
+
226
+ ### 1. Write Detailed Comments
227
+
228
+ **Good:**
229
+ ```javascript
230
+ /**
231
+ * Validates user email format
232
+ *
233
+ * Requirements (FR-3):
234
+ * - Must be valid email format
235
+ * - Must not be empty
236
+ * - Must be lowercase
237
+ *
238
+ * Returns: { valid: boolean, error?: string }
239
+ */
240
+ function validateEmail(email) {
241
+ // Copilot suggests comprehensive validation
242
+ ```
243
+
244
+ **Not as good:**
245
+ ```javascript
246
+ // Validate email
247
+ function validateEmail(email) {
248
+ // Copilot has less context
249
+ ```
250
+
251
+ ### 2. Reference Spec Files
252
+
253
+ ```javascript
254
+ // See: .kiro/specs/01-00-user-login/design.md#api-design
255
+ ```
256
+
257
+ Copilot can read the referenced file.
258
+
259
+ ### 3. Use Type Annotations
260
+
261
+ ```typescript
262
+ /**
263
+ * Spec: .kiro/specs/01-00-user-login/
264
+ * Task: 2.2
265
+ */
266
+ interface User {
267
+ id: string;
268
+ email: string;
269
+ passwordHash: string;
270
+ // Copilot suggests remaining fields from Spec
271
+ }
272
+ ```
273
+
274
+ ### 4. Break Down Complex Tasks
275
+
276
+ ```javascript
277
+ // Task 2.2.1: Hash password
278
+ async hashPassword(password: string): Promise<string> {
279
+ // Copilot suggests bcrypt implementation
280
+ }
281
+
282
+ // Task 2.2.2: Verify password
283
+ async verifyPassword(password: string, hash: string): Promise<boolean> {
284
+ // Copilot suggests comparison logic
285
+ }
286
+ ```
287
+
288
+ ### 5. Use Copilot Chat for Complex Logic
289
+
290
+ For complex implementations, use Copilot Chat with exported context.
291
+
292
+ ---
293
+
294
+ ## Advanced Techniques
295
+
296
+ ### 1. Spec-Driven TDD
297
+
298
+ ```javascript
299
+ /**
300
+ * AuthService Tests
301
+ * Spec: .kiro/specs/01-00-user-login/
302
+ *
303
+ * Test cases from acceptance criteria:
304
+ * - AC-1: Valid credentials return user
305
+ * - AC-2: Invalid credentials return null
306
+ * - AC-3: Rate limiting prevents brute force
307
+ */
308
+ describe('AuthService', () => {
309
+ // Copilot suggests test cases based on acceptance criteria
310
+ ```
311
+
312
+ ### 2. Multi-File Context
313
+
314
+ ```javascript
315
+ /**
316
+ * Related files:
317
+ * - .kiro/specs/01-00-user-login/design.md
318
+ * - src/models/User.js
319
+ * - src/services/ValidationService.js
320
+ */
321
+ ```
322
+
323
+ Copilot considers all referenced files.
324
+
325
+ ### 3. Incremental Implementation
326
+
327
+ ```javascript
328
+ // TODO: Implement according to Spec task 2.2.1
329
+ // See: .kiro/specs/01-00-user-login/design.md#authservice
330
+
331
+ // Copilot suggests implementation when you start typing
332
+ ```
333
+
334
+ ---
335
+
336
+ ## Comparison with Other Tools
337
+
338
+ ### vs Cursor
339
+
340
+ **Copilot advantages:**
341
+ - ✅ Lighter weight
342
+ - ✅ Faster suggestions
343
+ - ✅ Better inline completions
344
+
345
+ **Cursor advantages:**
346
+ - ✅ Better at understanding full Specs
347
+ - ✅ Can modify multiple files
348
+ - ✅ More powerful AI model
349
+
350
+ ### vs Claude
351
+
352
+ **Copilot advantages:**
353
+ - ✅ IDE integration
354
+ - ✅ Real-time suggestions
355
+ - ✅ No context switching
356
+
357
+ **Claude advantages:**
358
+ - ✅ Larger context window
359
+ - ✅ Better at complex logic
360
+ - ✅ More conversational
361
+
362
+ **Best approach:** Use Copilot for coding, Claude for planning
363
+
364
+ ---
365
+
366
+ ## Troubleshooting
367
+
368
+ ### Issue: Copilot doesn't suggest Spec-aware code
369
+
370
+ **Solution 1:** Add more detailed comments
371
+ ```javascript
372
+ /**
373
+ * Detailed description of what this should do
374
+ * Reference: .kiro/specs/01-00-user-login/design.md
375
+ */
376
+ ```
377
+
378
+ **Solution 2:** Ensure Spec files are in workspace
379
+ - Copilot only reads files in open workspace
380
+ - Make sure `.kiro/specs/` is included
381
+
382
+ ### Issue: Suggestions don't match design
383
+
384
+ **Solution:** Be more explicit in comments
385
+ ```javascript
386
+ /**
387
+ * IMPORTANT: Must use bcrypt with exactly 10 salt rounds
388
+ * See design.md section "Security Considerations"
389
+ */
390
+ ```
391
+
392
+ ### Issue: Copilot suggests outdated patterns
393
+
394
+ **Solution:** Specify modern patterns in comments
395
+ ```javascript
396
+ /**
397
+ * Use async/await (not callbacks or .then())
398
+ * Use ES6+ syntax
399
+ */
400
+ ```
401
+
402
+ ---
403
+
404
+ ## Related Documentation
405
+
406
+ - **[Quick Start Guide](../quick-start.md)** - Get started with kse
407
+ - **[Integration Modes](../integration-modes.md)** - Understanding integration modes
408
+ - **[Spec Workflow](../spec-workflow.md)** - Creating effective Specs
409
+
410
+ ---
411
+
412
+ ## Summary
413
+
414
+ **VS Code + Copilot + kse workflow:**
415
+ 1. Create Spec in kse
416
+ 2. Reference Spec in code comments
417
+ 3. Let Copilot suggest implementations
418
+ 4. Use Copilot Chat for complex logic
419
+ 5. Update tasks.md manually
420
+
421
+ **Key advantages:**
422
+ - ✅ Use your existing IDE
423
+ - ✅ Real-time AI assistance
424
+ - ✅ Spec-aware suggestions
425
+ - ✅ Minimal workflow changes
426
+
427
+ **Best practices:**
428
+ - Write detailed comments
429
+ - Reference Spec files
430
+ - Use type annotations
431
+ - Break down complex tasks
432
+ - Combine with Copilot Chat
433
+
434
+ **Start using:** 🚀
435
+ ```bash
436
+ kse adopt
437
+ kse create-spec 01-00-my-feature
438
+ # Open VS Code and start coding with Spec references
439
+ ```
440
+
441
+ ---
442
+
443
+ **Version**: 1.0.0
444
+ **Last Updated**: 2026-01-23