kiro-spec-engine 1.2.3 → 1.3.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/README.md +172 -0
  3. package/bin/kiro-spec-engine.js +62 -0
  4. package/docs/agent-hooks-analysis.md +815 -0
  5. package/docs/cross-tool-guide.md +554 -0
  6. package/docs/manual-workflows-guide.md +417 -0
  7. package/docs/steering-strategy-guide.md +196 -0
  8. package/lib/adoption/detection-engine.js +14 -4
  9. package/lib/commands/adopt.js +117 -3
  10. package/lib/commands/context.js +99 -0
  11. package/lib/commands/prompt.js +105 -0
  12. package/lib/commands/status.js +225 -0
  13. package/lib/commands/task.js +199 -0
  14. package/lib/commands/watch.js +569 -0
  15. package/lib/commands/workflows.js +240 -0
  16. package/lib/commands/workspace.js +189 -0
  17. package/lib/context/context-exporter.js +378 -0
  18. package/lib/context/prompt-generator.js +482 -0
  19. package/lib/steering/adoption-config.js +164 -0
  20. package/lib/steering/steering-manager.js +289 -0
  21. package/lib/task/task-claimer.js +430 -0
  22. package/lib/utils/tool-detector.js +383 -0
  23. package/lib/watch/action-executor.js +458 -0
  24. package/lib/watch/event-debouncer.js +323 -0
  25. package/lib/watch/execution-logger.js +550 -0
  26. package/lib/watch/file-watcher.js +499 -0
  27. package/lib/watch/presets.js +266 -0
  28. package/lib/watch/watch-manager.js +533 -0
  29. package/lib/workspace/workspace-manager.js +370 -0
  30. package/lib/workspace/workspace-sync.js +356 -0
  31. package/package.json +3 -1
  32. package/template/.kiro/tools/backup_manager.py +295 -0
  33. package/template/.kiro/tools/configuration_manager.py +218 -0
  34. package/template/.kiro/tools/document_evaluator.py +550 -0
  35. package/template/.kiro/tools/enhancement_logger.py +168 -0
  36. package/template/.kiro/tools/error_handler.py +335 -0
  37. package/template/.kiro/tools/improvement_identifier.py +444 -0
  38. package/template/.kiro/tools/modification_applicator.py +737 -0
  39. package/template/.kiro/tools/quality_gate_enforcer.py +207 -0
  40. package/template/.kiro/tools/quality_scorer.py +305 -0
  41. package/template/.kiro/tools/report_generator.py +154 -0
  42. package/template/.kiro/tools/ultrawork_enhancer_refactored.py +0 -0
  43. package/template/.kiro/tools/ultrawork_enhancer_v2.py +463 -0
  44. package/template/.kiro/tools/ultrawork_enhancer_v3.py +606 -0
  45. package/template/.kiro/tools/workflow_quality_gate.py +100 -0
@@ -0,0 +1,554 @@
1
+ # Cross-Tool Usage Guide
2
+
3
+ **Version**: 1.0
4
+ **Last Updated**: 2026-01-23
5
+
6
+ ## Overview
7
+
8
+ Kiro Spec Engine (kse) is designed to work seamlessly across multiple AI coding assistants. This guide explains how to use kse specs with different tools, including Kiro IDE, Claude Code, Cursor, GitHub Copilot, and other AI assistants.
9
+
10
+ ## Table of Contents
11
+
12
+ - [Quick Start](#quick-start)
13
+ - [Kiro IDE (Native)](#kiro-ide-native)
14
+ - [Claude Code](#claude-code)
15
+ - [Cursor](#cursor)
16
+ - [GitHub Copilot](#github-copilot)
17
+ - [Generic AI Tools](#generic-ai-tools)
18
+ - [Feature Comparison](#feature-comparison)
19
+ - [Troubleshooting](#troubleshooting)
20
+
21
+ ---
22
+
23
+ ## Quick Start
24
+
25
+ ### Export Context for Any Tool
26
+
27
+ ```bash
28
+ # Export complete spec context
29
+ kse context export <spec-name>
30
+
31
+ # Export with steering rules
32
+ kse context export <spec-name> --steering --steering-files=CORE_PRINCIPLES.md
33
+
34
+ # Generate task-specific prompt
35
+ kse prompt generate <spec-name> <task-id>
36
+ kse prompt generate <spec-name> <task-id> --tool=claude-code
37
+ ```
38
+
39
+ ### Basic Workflow
40
+
41
+ 1. **Export context** from kse
42
+ 2. **Load context** into your AI tool
43
+ 3. **Work on tasks** with AI assistance
44
+ 4. **Update task status** in original `tasks.md`
45
+
46
+ ---
47
+
48
+ ## Kiro IDE (Native)
49
+
50
+ ### Setup
51
+
52
+ Kiro IDE has native kse integration with automatic steering rule loading.
53
+
54
+ **Installation**:
55
+ ```bash
56
+ npm install -g kiro-spec-engine
57
+ kse adopt
58
+ ```
59
+
60
+ **Features**:
61
+ - ✅ Automatic steering rule loading
62
+ - ✅ Full CLI command support
63
+ - ✅ Real-time task status updates
64
+ - ✅ Multi-user workspace support
65
+ - ✅ Agent hooks integration (if available)
66
+
67
+ ### Workflow
68
+
69
+ 1. **Create or adopt project**:
70
+ ```bash
71
+ kse init "My Project"
72
+ # or
73
+ kse adopt
74
+ ```
75
+
76
+ 2. **Create spec**:
77
+ ```bash
78
+ kse create-spec 01-00-user-authentication
79
+ ```
80
+
81
+ 3. **Work with AI**:
82
+ - Steering rules are loaded automatically
83
+ - Use `#File` to reference spec files
84
+ - Use `#Folder` to reference directories
85
+
86
+ 4. **Track progress**:
87
+ ```bash
88
+ kse status
89
+ ```
90
+
91
+ ### Best Practices
92
+
93
+ - Keep steering rules in `.kiro/steering/` for automatic loading
94
+ - Use `CURRENT_CONTEXT.md` to maintain session context
95
+ - Leverage agent hooks for automated workflows
96
+ - Use multi-user workspaces for team collaboration
97
+
98
+ ---
99
+
100
+ ## Claude Code
101
+
102
+ ### Setup
103
+
104
+ Claude Code requires manual context loading via exported files.
105
+
106
+ **Prerequisites**:
107
+ - kse installed: `npm install -g kiro-spec-engine`
108
+ - Project adopted: `kse adopt`
109
+
110
+ ### Workflow
111
+
112
+ 1. **Export context**:
113
+ ```bash
114
+ kse context export 01-00-user-authentication
115
+ ```
116
+
117
+ 2. **Copy exported file**:
118
+ ```bash
119
+ # Location: .kiro/specs/01-00-user-authentication/context-export.md
120
+ cat .kiro/specs/01-00-user-authentication/context-export.md
121
+ ```
122
+
123
+ 3. **Load into Claude Code**:
124
+ - Copy the entire `context-export.md` content
125
+ - Paste into Claude Code chat
126
+ - Claude will understand the spec structure
127
+
128
+ 4. **Generate task prompt** (optional):
129
+ ```bash
130
+ kse prompt generate 01-00-user-authentication 1.1 --tool=claude-code
131
+ ```
132
+
133
+ 5. **Work on task**:
134
+ - Reference specific sections: "According to the Requirements..."
135
+ - Ask for implementation: "Implement task 1.1 following the Design"
136
+ - Request tests: "Write tests for this implementation"
137
+
138
+ 6. **Update task status**:
139
+ ```bash
140
+ # Manually update tasks.md
141
+ - [x] 1.1 Implement authentication module
142
+ ```
143
+
144
+ ### Tips
145
+
146
+ - **Context size**: Claude has a large context window, so full exports work well
147
+ - **Incremental work**: Load context once, work on multiple tasks
148
+ - **Code generation**: Ask Claude to generate complete implementations
149
+ - **Testing**: Request unit tests and integration tests
150
+ - **Documentation**: Ask for inline comments and README updates
151
+
152
+ ### Example Session
153
+
154
+ ```
155
+ You: [Paste context-export.md content]
156
+
157
+ You: I want to implement task 1.1 "Implement authentication module".
158
+ Please follow the design and create the AuthModule class.
159
+
160
+ Claude: [Generates implementation based on design]
161
+
162
+ You: Now write unit tests for this module.
163
+
164
+ Claude: [Generates tests]
165
+
166
+ You: Update the task status to completed.
167
+
168
+ [Manually update tasks.md: - [x] 1.1 ...]
169
+ ```
170
+
171
+ ---
172
+
173
+ ## Cursor
174
+
175
+ ### Setup
176
+
177
+ Cursor works similarly to Claude Code but with IDE integration.
178
+
179
+ **Prerequisites**:
180
+ - Cursor IDE installed
181
+ - kse installed: `npm install -g kiro-spec-engine`
182
+
183
+ ### Workflow
184
+
185
+ 1. **Export context**:
186
+ ```bash
187
+ kse context export 01-00-user-authentication
188
+ ```
189
+
190
+ 2. **Generate task prompt**:
191
+ ```bash
192
+ kse prompt generate 01-00-user-authentication 1.1 --tool=cursor
193
+ ```
194
+
195
+ 3. **Load into Cursor**:
196
+ - Open Cursor Composer (Cmd+K or Ctrl+K)
197
+ - Paste the prompt content
198
+ - Cursor will understand the context
199
+
200
+ 4. **Work with Cursor**:
201
+ - Use Composer for large changes
202
+ - Use inline suggestions for small edits
203
+ - Reference spec files directly in prompts
204
+
205
+ 5. **Apply changes**:
206
+ - Review Cursor's suggestions
207
+ - Accept or modify changes
208
+ - Run tests to verify
209
+
210
+ 6. **Update task status**:
211
+ ```bash
212
+ # Update tasks.md manually
213
+ ```
214
+
215
+ ### Tips
216
+
217
+ - **Composer mode**: Best for implementing complete tasks
218
+ - **Inline mode**: Good for small fixes and refinements
219
+ - **File references**: Cursor can read project files directly
220
+ - **Multi-file edits**: Cursor can modify multiple files at once
221
+ - **Git integration**: Review changes before committing
222
+
223
+ ### Example Workflow
224
+
225
+ ```bash
226
+ # 1. Generate prompt
227
+ kse prompt generate 01-00-user-auth 1.1 --tool=cursor
228
+
229
+ # 2. Open Cursor Composer (Cmd+K)
230
+ # 3. Paste prompt content
231
+ # 4. Cursor generates implementation
232
+ # 5. Review and accept changes
233
+ # 6. Run tests
234
+ npm test
235
+
236
+ # 7. Update task status
237
+ # Edit tasks.md: - [x] 1.1 ...
238
+ ```
239
+
240
+ ---
241
+
242
+ ## GitHub Copilot
243
+
244
+ ### Setup
245
+
246
+ GitHub Copilot works best with inline comments and code context.
247
+
248
+ **Prerequisites**:
249
+ - GitHub Copilot subscription
250
+ - kse installed: `npm install -g kiro-spec-engine`
251
+
252
+ ### Workflow
253
+
254
+ 1. **Export context**:
255
+ ```bash
256
+ kse context export 01-00-user-authentication
257
+ ```
258
+
259
+ 2. **Generate task prompt**:
260
+ ```bash
261
+ kse prompt generate 01-00-user-authentication 1.1 --tool=codex
262
+ ```
263
+
264
+ 3. **Use in code**:
265
+ ```javascript
266
+ /**
267
+ * Task 1.1: Implement authentication module
268
+ *
269
+ * Requirements:
270
+ * - User login with username/password
271
+ * - Session management
272
+ * - Token generation
273
+ *
274
+ * Design:
275
+ * - AuthModule class with login() method
276
+ * - JWT token generation
277
+ * - Session storage
278
+ */
279
+
280
+ class AuthModule {
281
+ // Copilot will suggest implementation
282
+ }
283
+ ```
284
+
285
+ 4. **Let Copilot suggest**:
286
+ - Type function signatures
287
+ - Copilot suggests implementations
288
+ - Accept or modify suggestions
289
+
290
+ 5. **Update task status**:
291
+ ```bash
292
+ # Update tasks.md manually
293
+ ```
294
+
295
+ ### Tips
296
+
297
+ - **Detailed comments**: More context = better suggestions
298
+ - **Function signatures**: Define interfaces first
299
+ - **Test-driven**: Write test cases, let Copilot implement
300
+ - **Incremental**: Build step-by-step, not all at once
301
+ - **Review carefully**: Copilot suggestions need validation
302
+
303
+ ### Example
304
+
305
+ ```javascript
306
+ // From prompt: Task 1.1 - Implement AuthModule
307
+ // Requirements: User login, session management
308
+ // Design: AuthModule class with login() method
309
+
310
+ class AuthModule {
311
+ constructor(config) {
312
+ // Copilot suggests: this.config = config; this.sessions = new Map();
313
+ }
314
+
315
+ async login(username, password) {
316
+ // Copilot suggests complete implementation
317
+ }
318
+ }
319
+ ```
320
+
321
+ ---
322
+
323
+ ## Generic AI Tools
324
+
325
+ ### Setup
326
+
327
+ Any AI tool that accepts Markdown context can work with kse.
328
+
329
+ ### Workflow
330
+
331
+ 1. **Export context**:
332
+ ```bash
333
+ kse context export <spec-name>
334
+ ```
335
+
336
+ 2. **Load into tool**:
337
+ - Copy `context-export.md` content
338
+ - Paste into AI tool's input
339
+ - Tool will understand the structure
340
+
341
+ 3. **Work on tasks**:
342
+ - Reference requirements and design
343
+ - Ask for implementations
344
+ - Request tests and documentation
345
+
346
+ 4. **Update manually**:
347
+ - Update `tasks.md` after completion
348
+ - Commit changes to git
349
+
350
+ ### Tips
351
+
352
+ - **Clear prompts**: Be specific about what you want
353
+ - **Iterative**: Work on one task at a time
354
+ - **Validation**: Always test generated code
355
+ - **Documentation**: Keep task status updated
356
+
357
+ ---
358
+
359
+ ## Feature Comparison
360
+
361
+ | Feature | Kiro IDE | Claude Code | Cursor | Copilot | Generic |
362
+ |---------|----------|-------------|--------|---------|---------|
363
+ | **Steering Auto-Load** | ✅ | ❌ | ❌ | ❌ | ❌ |
364
+ | **Context Export** | ✅ | ✅ | ✅ | ✅ | ✅ |
365
+ | **Prompt Generation** | ✅ | ✅ | ✅ | ✅ | ✅ |
366
+ | **Task Claiming** | ✅ | ❌ | ❌ | ❌ | ❌ |
367
+ | **Workspace Sync** | ✅ | ❌ | ❌ | ❌ | ❌ |
368
+ | **Multi-User** | ✅ | ❌ | ❌ | ❌ | ❌ |
369
+ | **Real-time Updates** | ✅ | ❌ | ❌ | ❌ | ❌ |
370
+ | **Agent Hooks** | ✅* | ❌ | ❌ | ❌ | ❌ |
371
+ | **File References** | ✅ | ⚠️ | ✅ | ⚠️ | ⚠️ |
372
+ | **Multi-file Edits** | ✅ | ⚠️ | ✅ | ❌ | ⚠️ |
373
+ | **Code Generation** | ✅ | ✅ | ✅ | ✅ | ✅ |
374
+ | **Test Generation** | ✅ | ✅ | ✅ | ⚠️ | ✅ |
375
+
376
+ **Legend**:
377
+ - ✅ Full support
378
+ - ⚠️ Partial support / Manual steps required
379
+ - ❌ Not supported
380
+ - \* If available in Kiro IDE
381
+
382
+ ---
383
+
384
+ ## Limitations and Trade-offs
385
+
386
+ ### Kiro IDE
387
+ **Pros**:
388
+ - Native integration, no manual steps
389
+ - Full feature support
390
+ - Real-time collaboration
391
+
392
+ **Cons**:
393
+ - Requires Kiro IDE
394
+ - Learning curve for IDE features
395
+
396
+ ### Claude Code
397
+ **Pros**:
398
+ - Large context window
399
+ - Excellent code generation
400
+ - Natural language understanding
401
+
402
+ **Cons**:
403
+ - Manual context loading
404
+ - No real-time task updates
405
+ - No multi-user features
406
+
407
+ ### Cursor
408
+ **Pros**:
409
+ - IDE integration
410
+ - Multi-file editing
411
+ - Git integration
412
+
413
+ **Cons**:
414
+ - Manual context loading
415
+ - Smaller context window than Claude
416
+ - No multi-user features
417
+
418
+ ### GitHub Copilot
419
+ **Pros**:
420
+ - Inline suggestions
421
+ - Fast iteration
422
+ - Works in any IDE
423
+
424
+ **Cons**:
425
+ - Limited context understanding
426
+ - Requires detailed comments
427
+ - No task management
428
+
429
+ ### Generic AI Tools
430
+ **Pros**:
431
+ - Works with any tool
432
+ - Flexible workflow
433
+ - No vendor lock-in
434
+
435
+ **Cons**:
436
+ - All manual steps
437
+ - No automation
438
+ - No collaboration features
439
+
440
+ ---
441
+
442
+ ## Troubleshooting
443
+
444
+ ### Context Too Large
445
+
446
+ **Problem**: Exported context exceeds tool's limit
447
+
448
+ **Solutions**:
449
+ ```bash
450
+ # Export without steering
451
+ kse context export <spec> --no-steering
452
+
453
+ # Generate task-specific prompt (smaller)
454
+ kse prompt generate <spec> <task-id>
455
+
456
+ # Export specific sections only
457
+ kse context export <spec> --no-design
458
+ ```
459
+
460
+ ### Task Status Not Syncing
461
+
462
+ **Problem**: Changes in AI tool don't update kse
463
+
464
+ **Solution**: Manual update required for non-Kiro tools
465
+ ```bash
466
+ # Edit tasks.md manually
467
+ vim .kiro/specs/<spec-name>/tasks.md
468
+
469
+ # Or use kse commands
470
+ kse task claim <spec> <task-id>
471
+ kse task unclaim <spec> <task-id>
472
+ ```
473
+
474
+ ### Steering Rules Not Applied
475
+
476
+ **Problem**: AI doesn't follow project conventions
477
+
478
+ **Solution**: Include steering in export
479
+ ```bash
480
+ kse context export <spec> --steering --steering-files=CORE_PRINCIPLES.md,ENVIRONMENT.md
481
+ ```
482
+
483
+ ### Generated Code Doesn't Match Design
484
+
485
+ **Problem**: AI generates code that doesn't follow design
486
+
487
+ **Solution**:
488
+ 1. Be more specific in prompts
489
+ 2. Reference design sections explicitly
490
+ 3. Provide code examples
491
+ 4. Iterate with AI to refine
492
+
493
+ ### Multi-User Conflicts
494
+
495
+ **Problem**: Multiple developers working on same task
496
+
497
+ **Solution**: Use kse task claiming (Kiro IDE only)
498
+ ```bash
499
+ kse task claim <spec> <task-id>
500
+ # Work on task
501
+ kse task unclaim <spec> <task-id>
502
+ ```
503
+
504
+ For other tools: Manual coordination required
505
+
506
+ ---
507
+
508
+ ## Best Practices
509
+
510
+ ### General
511
+
512
+ 1. **Export context before starting**: Always have latest spec
513
+ 2. **One task at a time**: Focus on single task for clarity
514
+ 3. **Test thoroughly**: AI-generated code needs validation
515
+ 4. **Update status promptly**: Keep tasks.md current
516
+ 5. **Commit frequently**: Small, focused commits
517
+
518
+ ### For Non-Kiro Tools
519
+
520
+ 1. **Manual task tracking**: Update tasks.md after each task
521
+ 2. **Context refresh**: Re-export if spec changes
522
+ 3. **Team coordination**: Communicate task assignments
523
+ 4. **Code review**: Always review AI-generated code
524
+ 5. **Documentation**: Keep README and comments updated
525
+
526
+ ### For Kiro IDE
527
+
528
+ 1. **Use steering rules**: Leverage automatic loading
529
+ 2. **Multi-user workspaces**: Enable for team projects
530
+ 3. **Task claiming**: Claim tasks before starting
531
+ 4. **Workspace sync**: Sync regularly with team
532
+ 5. **Agent hooks**: Automate repetitive tasks
533
+
534
+ ---
535
+
536
+ ## Additional Resources
537
+
538
+ - [kse Documentation](../README.md)
539
+ - [Spec Workflow Guide](../.kiro/specs/SPEC_WORKFLOW_GUIDE.md)
540
+ - [Steering Strategy Guide](./steering-strategy-guide.md)
541
+ - [Phase 1 Summary](../.kiro/specs/03-00-multi-user-and-cross-tool-support/docs/phase-1-summary.md)
542
+ - [Phase 2 Summary](../.kiro/specs/03-00-multi-user-and-cross-tool-support/docs/phase-2-summary.md)
543
+
544
+ ---
545
+
546
+ **Questions or Issues?**
547
+
548
+ - Check [Troubleshooting](#troubleshooting) section
549
+ - Review [Feature Comparison](#feature-comparison)
550
+ - Consult tool-specific documentation
551
+ - Open an issue on GitHub
552
+
553
+ **Version History**:
554
+ - v1.0 (2026-01-23): Initial cross-tool guide