kiro-spec-engine 1.2.3 → 1.4.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 +135 -0
- package/README.md +239 -213
- package/README.zh.md +0 -330
- package/bin/kiro-spec-engine.js +62 -0
- package/docs/README.md +223 -0
- package/docs/agent-hooks-analysis.md +815 -0
- package/docs/command-reference.md +252 -0
- package/docs/cross-tool-guide.md +554 -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 +696 -0
- package/docs/integration-modes.md +525 -0
- package/docs/integration-philosophy.md +313 -0
- package/docs/manual-workflows-guide.md +417 -0
- package/docs/quick-start-with-ai-tools.md +374 -0
- package/docs/quick-start.md +711 -0
- package/docs/spec-workflow.md +453 -0
- package/docs/steering-strategy-guide.md +196 -0
- package/docs/tools/claude-guide.md +653 -0
- package/docs/tools/cursor-guide.md +705 -0
- package/docs/tools/generic-guide.md +445 -0
- package/docs/tools/kiro-guide.md +308 -0
- package/docs/tools/vscode-guide.md +444 -0
- package/docs/tools/windsurf-guide.md +390 -0
- package/docs/troubleshooting.md +795 -0
- package/docs/zh/README.md +275 -0
- package/docs/zh/quick-start.md +711 -0
- package/docs/zh/tools/claude-guide.md +348 -0
- package/docs/zh/tools/cursor-guide.md +280 -0
- package/docs/zh/tools/generic-guide.md +498 -0
- package/docs/zh/tools/kiro-guide.md +342 -0
- package/docs/zh/tools/vscode-guide.md +448 -0
- package/docs/zh/tools/windsurf-guide.md +377 -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 +3 -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,445 @@
|
|
|
1
|
+
# Using kse with Any AI Tool
|
|
2
|
+
|
|
3
|
+
> Universal integration guide for kse with any AI coding assistant
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**Version**: 1.0.0
|
|
8
|
+
**Last Updated**: 2026-01-23
|
|
9
|
+
**Tool**: Any AI Tool
|
|
10
|
+
**Integration Mode**: Manual Export
|
|
11
|
+
**Estimated Setup Time**: 2 minutes
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
This guide shows how to use kse with **any AI coding tool**, including:
|
|
18
|
+
- ChatGPT
|
|
19
|
+
- Gemini
|
|
20
|
+
- Codeium
|
|
21
|
+
- Tabnine
|
|
22
|
+
- Amazon CodeWhisperer
|
|
23
|
+
- Any other AI assistant
|
|
24
|
+
|
|
25
|
+
**kse works with any tool that can:**
|
|
26
|
+
- Accept text input
|
|
27
|
+
- Generate code
|
|
28
|
+
- Understand context
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Universal Integration Pattern
|
|
33
|
+
|
|
34
|
+
### The Basic Workflow
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
1. Create Spec in kse
|
|
38
|
+
↓
|
|
39
|
+
2. Export context
|
|
40
|
+
↓
|
|
41
|
+
3. Provide context to your AI tool
|
|
42
|
+
↓
|
|
43
|
+
4. AI generates code
|
|
44
|
+
↓
|
|
45
|
+
5. Update tasks manually
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
This pattern works with **every AI tool**.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Setup
|
|
53
|
+
|
|
54
|
+
### Prerequisites
|
|
55
|
+
|
|
56
|
+
- **Any AI tool** (web-based, IDE plugin, or CLI)
|
|
57
|
+
- **kse installed** (`npm install -g kiro-spec-engine`)
|
|
58
|
+
- **Project adopted** (`kse adopt`)
|
|
59
|
+
|
|
60
|
+
### No Tool-Specific Setup Required
|
|
61
|
+
|
|
62
|
+
kse exports plain text that any AI can understand.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Workflow
|
|
67
|
+
|
|
68
|
+
### Step 1: Create Your Spec
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
kse create-spec 01-00-user-login
|
|
72
|
+
# Edit requirements.md, design.md, tasks.md
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Step 2: Export Context
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
kse context export 01-00-user-login
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
This creates `.kiro/specs/01-00-user-login/context-export.md`
|
|
82
|
+
|
|
83
|
+
### Step 3: Copy Context
|
|
84
|
+
|
|
85
|
+
**macOS:**
|
|
86
|
+
```bash
|
|
87
|
+
cat .kiro/specs/01-00-user-login/context-export.md | pbcopy
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Windows:**
|
|
91
|
+
```bash
|
|
92
|
+
type .kiro\specs\01-00-user-login\context-export.md | clip
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Linux:**
|
|
96
|
+
```bash
|
|
97
|
+
cat .kiro/specs/01-00-user-login/context-export.md | xclip -selection clipboard
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Or manually:**
|
|
101
|
+
- Open `context-export.md`
|
|
102
|
+
- Select all (Ctrl+A / Cmd+A)
|
|
103
|
+
- Copy (Ctrl+C / Cmd+C)
|
|
104
|
+
|
|
105
|
+
### Step 4: Provide to Your AI Tool
|
|
106
|
+
|
|
107
|
+
**Web-based tools (ChatGPT, Gemini, etc.):**
|
|
108
|
+
1. Open the tool in your browser
|
|
109
|
+
2. Start a new conversation
|
|
110
|
+
3. Paste the context
|
|
111
|
+
4. Add your request
|
|
112
|
+
|
|
113
|
+
**IDE plugins (Tabnine, Codeium, etc.):**
|
|
114
|
+
1. Add context as code comments
|
|
115
|
+
2. Let the AI suggest based on comments
|
|
116
|
+
|
|
117
|
+
**CLI tools:**
|
|
118
|
+
1. Pipe context to the tool
|
|
119
|
+
2. Or save to a file and reference it
|
|
120
|
+
|
|
121
|
+
### Step 5: Implement with AI
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
[Paste context]
|
|
125
|
+
|
|
126
|
+
Please implement task 1.1: "Set up project dependencies"
|
|
127
|
+
|
|
128
|
+
Follow the design document exactly.
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Step 6: Update Tasks
|
|
132
|
+
|
|
133
|
+
Edit `tasks.md`:
|
|
134
|
+
```markdown
|
|
135
|
+
- [x] 1.1 Set up project dependencies
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Tool-Specific Adaptations
|
|
141
|
+
|
|
142
|
+
### Web-Based AI (ChatGPT, Gemini, Claude Web, etc.)
|
|
143
|
+
|
|
144
|
+
**Workflow:**
|
|
145
|
+
```
|
|
146
|
+
1. Export context
|
|
147
|
+
2. Open AI tool in browser
|
|
148
|
+
3. Paste context
|
|
149
|
+
4. Implement tasks one by one
|
|
150
|
+
5. Copy generated code to your project
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Tips:**
|
|
154
|
+
- Start fresh conversation per feature
|
|
155
|
+
- Re-paste context if conversation gets long
|
|
156
|
+
- Save important responses
|
|
157
|
+
|
|
158
|
+
### IDE Plugins (Tabnine, Codeium, CodeWhisperer, etc.)
|
|
159
|
+
|
|
160
|
+
**Workflow:**
|
|
161
|
+
```
|
|
162
|
+
1. Export context
|
|
163
|
+
2. Add context as comments in your code
|
|
164
|
+
3. Let AI suggest as you type
|
|
165
|
+
4. Accept or modify suggestions
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**Example:**
|
|
169
|
+
```javascript
|
|
170
|
+
/**
|
|
171
|
+
* Spec: .kiro/specs/01-00-user-login/
|
|
172
|
+
* Task: 2.1 - Implement AuthController
|
|
173
|
+
*
|
|
174
|
+
* Requirements:
|
|
175
|
+
* - POST /api/auth/login endpoint
|
|
176
|
+
* - Validate email and password
|
|
177
|
+
* - Return JWT token on success
|
|
178
|
+
*
|
|
179
|
+
* Design: See design.md for details
|
|
180
|
+
*/
|
|
181
|
+
class AuthController {
|
|
182
|
+
// AI suggests implementation
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### CLI Tools (Aider, etc.)
|
|
186
|
+
|
|
187
|
+
**Workflow:**
|
|
188
|
+
```bash
|
|
189
|
+
# Export context
|
|
190
|
+
kse context export 01-00-user-login
|
|
191
|
+
|
|
192
|
+
# Provide to CLI tool
|
|
193
|
+
your-ai-tool --context .kiro/specs/01-00-user-login/context-export.md
|
|
194
|
+
|
|
195
|
+
# Or pipe it
|
|
196
|
+
cat .kiro/specs/01-00-user-login/context-export.md | your-ai-tool
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### API-Based Tools
|
|
200
|
+
|
|
201
|
+
**Workflow:**
|
|
202
|
+
```javascript
|
|
203
|
+
const fs = require('fs');
|
|
204
|
+
const context = fs.readFileSync('.kiro/specs/01-00-user-login/context-export.md', 'utf8');
|
|
205
|
+
|
|
206
|
+
// Call your AI API
|
|
207
|
+
const response = await aiAPI.generate({
|
|
208
|
+
prompt: `${context}\n\nImplement task 1.1`,
|
|
209
|
+
model: 'your-model'
|
|
210
|
+
});
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Universal Best Practices
|
|
216
|
+
|
|
217
|
+
### 1. Always Provide Complete Context
|
|
218
|
+
|
|
219
|
+
**Good:**
|
|
220
|
+
```
|
|
221
|
+
[Paste entire context-export.md]
|
|
222
|
+
|
|
223
|
+
Implement task 1.1 following the design document.
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**Not as good:**
|
|
227
|
+
```
|
|
228
|
+
Implement user login
|
|
229
|
+
[No context]
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### 2. Be Explicit About Requirements
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
Follow these requirements exactly:
|
|
236
|
+
- Use bcrypt for password hashing
|
|
237
|
+
- Use JWT for tokens
|
|
238
|
+
- Implement rate limiting
|
|
239
|
+
- Follow the API design in the Spec
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### 3. Implement Incrementally
|
|
243
|
+
|
|
244
|
+
```
|
|
245
|
+
Task 1.1 → Review → Task 1.2 → Review → Task 2.1 → Review
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Don't try to implement everything at once.
|
|
249
|
+
|
|
250
|
+
### 4. Reference the Design
|
|
251
|
+
|
|
252
|
+
```
|
|
253
|
+
According to the design document, section "AuthService":
|
|
254
|
+
[Quote relevant section]
|
|
255
|
+
|
|
256
|
+
Please implement this exactly as specified.
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### 5. Update Tasks Promptly
|
|
260
|
+
|
|
261
|
+
After each completed task, update `tasks.md` immediately.
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## Handling Tool Limitations
|
|
266
|
+
|
|
267
|
+
### Limited Context Window
|
|
268
|
+
|
|
269
|
+
**Problem:** Your AI tool can't handle large Specs
|
|
270
|
+
|
|
271
|
+
**Solution:** Use task-specific prompts
|
|
272
|
+
```bash
|
|
273
|
+
kse prompt generate 01-00-user-login 1.1 --max-length=5000
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### No File Access
|
|
277
|
+
|
|
278
|
+
**Problem:** AI can't read your project files
|
|
279
|
+
|
|
280
|
+
**Solution:** Include relevant code in your prompt
|
|
281
|
+
```
|
|
282
|
+
Here's the current User model:
|
|
283
|
+
[Paste code]
|
|
284
|
+
|
|
285
|
+
And here's the Spec:
|
|
286
|
+
[Paste context]
|
|
287
|
+
|
|
288
|
+
Please implement AuthService that uses this User model.
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### No Command Execution
|
|
292
|
+
|
|
293
|
+
**Problem:** AI can't run kse commands
|
|
294
|
+
|
|
295
|
+
**Solution:** Run commands yourself and provide output
|
|
296
|
+
```bash
|
|
297
|
+
kse status
|
|
298
|
+
# Copy output
|
|
299
|
+
|
|
300
|
+
# In AI tool:
|
|
301
|
+
"Here's the current project status:
|
|
302
|
+
[Paste output]
|
|
303
|
+
|
|
304
|
+
What should we work on next?"
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### No Multi-File Editing
|
|
308
|
+
|
|
309
|
+
**Problem:** AI can only generate one file at a time
|
|
310
|
+
|
|
311
|
+
**Solution:** Implement file by file
|
|
312
|
+
```
|
|
313
|
+
"First, generate AuthController.js"
|
|
314
|
+
[Save file]
|
|
315
|
+
|
|
316
|
+
"Now, generate AuthService.js"
|
|
317
|
+
[Save file]
|
|
318
|
+
|
|
319
|
+
"Now, generate the tests"
|
|
320
|
+
[Save file]
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## Example Prompts
|
|
326
|
+
|
|
327
|
+
### Starting a Feature
|
|
328
|
+
```
|
|
329
|
+
I'm implementing a user login feature. Here's the complete Spec:
|
|
330
|
+
|
|
331
|
+
[Paste context-export.md]
|
|
332
|
+
|
|
333
|
+
This includes:
|
|
334
|
+
- Requirements: What we're building
|
|
335
|
+
- Design: How we're building it
|
|
336
|
+
- Tasks: Step-by-step plan
|
|
337
|
+
|
|
338
|
+
Please help me implement task 1.1: "Set up project dependencies"
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
### Implementing a Component
|
|
342
|
+
```
|
|
343
|
+
Based on this Spec:
|
|
344
|
+
|
|
345
|
+
[Paste relevant section]
|
|
346
|
+
|
|
347
|
+
Please implement the AuthService class with these methods:
|
|
348
|
+
1. hashPassword(password)
|
|
349
|
+
2. authenticate(email, password)
|
|
350
|
+
3. generateToken(user)
|
|
351
|
+
|
|
352
|
+
Follow the design document exactly.
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### Debugging
|
|
356
|
+
```
|
|
357
|
+
I'm getting this error:
|
|
358
|
+
|
|
359
|
+
[Paste error]
|
|
360
|
+
|
|
361
|
+
Here's my implementation:
|
|
362
|
+
|
|
363
|
+
[Paste code]
|
|
364
|
+
|
|
365
|
+
According to the Spec, it should:
|
|
366
|
+
|
|
367
|
+
[Paste relevant requirements]
|
|
368
|
+
|
|
369
|
+
What's wrong and how do I fix it?
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
## Creating Your Own Integration
|
|
375
|
+
|
|
376
|
+
### For Tool Developers
|
|
377
|
+
|
|
378
|
+
If you're building an AI coding tool, consider:
|
|
379
|
+
|
|
380
|
+
**1. Native kse Support**
|
|
381
|
+
- Read `.kiro/specs/` directory
|
|
382
|
+
- Parse requirements.md, design.md, tasks.md
|
|
383
|
+
- Update tasks.md automatically
|
|
384
|
+
|
|
385
|
+
**2. Command Execution**
|
|
386
|
+
- Allow executing `kse context export`
|
|
387
|
+
- Read exported context files
|
|
388
|
+
- Execute `kse task claim` and `kse task unclaim`
|
|
389
|
+
|
|
390
|
+
**3. File Watching**
|
|
391
|
+
- Watch for Spec file changes
|
|
392
|
+
- Auto-reload context when Specs update
|
|
393
|
+
|
|
394
|
+
**4. UI Integration**
|
|
395
|
+
- Show Spec structure in sidebar
|
|
396
|
+
- Highlight current task
|
|
397
|
+
- Show progress indicators
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
## Related Documentation
|
|
402
|
+
|
|
403
|
+
- **[Quick Start Guide](../quick-start.md)** - Get started with kse
|
|
404
|
+
- **[Integration Modes](../integration-modes.md)** - Understanding integration modes
|
|
405
|
+
- **[Spec Workflow](../spec-workflow.md)** - Creating effective Specs
|
|
406
|
+
- **[Tool-Specific Guides](../tools/)** - Guides for specific tools
|
|
407
|
+
|
|
408
|
+
---
|
|
409
|
+
|
|
410
|
+
## Summary
|
|
411
|
+
|
|
412
|
+
**kse works with any AI tool:**
|
|
413
|
+
|
|
414
|
+
**Universal workflow:**
|
|
415
|
+
1. Create Spec
|
|
416
|
+
2. Export context
|
|
417
|
+
3. Provide to AI
|
|
418
|
+
4. Implement
|
|
419
|
+
5. Update tasks
|
|
420
|
+
|
|
421
|
+
**Key principles:**
|
|
422
|
+
- ✅ Provide complete context
|
|
423
|
+
- ✅ Be explicit about requirements
|
|
424
|
+
- ✅ Implement incrementally
|
|
425
|
+
- ✅ Reference the design
|
|
426
|
+
- ✅ Update tasks promptly
|
|
427
|
+
|
|
428
|
+
**Adapt to your tool:**
|
|
429
|
+
- Web-based: Copy-paste workflow
|
|
430
|
+
- IDE plugin: Comment-based context
|
|
431
|
+
- CLI: Pipe or file-based
|
|
432
|
+
- API: Programmatic integration
|
|
433
|
+
|
|
434
|
+
**Start using:** 🚀
|
|
435
|
+
```bash
|
|
436
|
+
kse adopt
|
|
437
|
+
kse create-spec 01-00-my-feature
|
|
438
|
+
kse context export 01-00-my-feature
|
|
439
|
+
# Provide context to your AI tool
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
**Version**: 1.0.0
|
|
445
|
+
**Last Updated**: 2026-01-23
|