kiro-spec-engine 1.5.5 → 1.6.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,65 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.6.1] - 2026-01-24
9
+
10
+ ### Fixed
11
+ - **Cross-platform path handling in SelectiveBackup** 🐛
12
+ - Fixed path construction bug in `lib/backup/selective-backup.js`
13
+ - Changed from string replacement (`this.backupDir.replace('/backups', '')`) to proper path joining
14
+ - Now uses `path.join(projectPath, '.kiro', filePath)` for consistent cross-platform behavior
15
+ - Affects both `createSelectiveBackup()` and `restoreSelective()` methods
16
+ - Ensures backup/restore works correctly on Windows (backslash paths) and Unix (forward slash paths)
17
+
18
+ **Why this matters:**
19
+ - Previous code used string replacement which failed on Windows paths
20
+ - Could cause backup creation to fail silently or create backups in wrong locations
21
+ - Critical for `kse adopt --force` conflict resolution feature
22
+
23
+ ## [1.6.0] - 2026-01-24
24
+
25
+ ### Changed - BREAKING CONCEPTUAL CHANGE 🎯
26
+
27
+ **Repositioned kse from "tool" to "methodology enforcer"**
28
+
29
+ This is a fundamental shift in how kse should be understood and used:
30
+
31
+ **Before (WRONG approach):**
32
+ - `.kiro/README.md` was a "kse command manual"
33
+ - Taught AI "how to use kse tool"
34
+ - Listed 20+ commands with examples
35
+ - Users had to "learn kse" before using it
36
+
37
+ **After (CORRECT approach):**
38
+ - `.kiro/README.md` is a "project development guide"
39
+ - Explains project follows Spec-driven methodology
40
+ - AI's role: follow the methodology, not learn the tool
41
+ - kse commands are helpers used automatically when needed
42
+
43
+ **Key insight from user feedback:**
44
+ > "After installing kse, just tell AI to read .kiro/README.md.
45
+ > AI will understand the methodology and naturally use kse commands
46
+ > to solve problems, rather than memorizing command syntax."
47
+
48
+ **What changed:**
49
+ - `.kiro/README.md` - Completely rewritten as methodology guide (not tool manual)
50
+ - `kse adopt` completion message - Now says "Tell AI to read README" instead of "Create your first spec"
51
+ - `docs/quick-start.md` - Simplified from 5-minute tool tutorial to 2-minute methodology introduction
52
+ - Removed detailed Spec creation examples (that's AI's job, not user's manual work)
53
+
54
+ **Impact:**
55
+ - Users don't need to "learn kse" anymore
56
+ - AI tools understand project methodology by reading README
57
+ - Natural workflow: User asks for feature → AI creates Spec → AI implements
58
+ - kse becomes invisible infrastructure, not a tool to master
59
+
60
+ **Migration:**
61
+ - Existing projects: Run `kse adopt --force` to get new README
62
+ - Tell your AI: "Please read .kiro/README.md to understand project methodology"
63
+ - AI will automatically understand and follow Spec-driven approach
64
+
65
+ This aligns kse with its true purpose: **enforcing development methodology**, not being a CLI tool to learn.
66
+
8
67
  ## [1.5.5] - 2026-01-24
9
68
 
10
69
  ### Added
@@ -1,711 +1,93 @@
1
1
  # Quick Start Guide
2
2
 
3
- > Get started with kse in 5 minutes - from installation to your first AI-assisted feature implementation
4
-
5
- ---
6
-
7
- **Version**: 1.0.0
8
- **Last Updated**: 2026-01-23
9
- **Estimated Time**: 5 minutes
10
- **Audience**: Beginners
3
+ > Get your project using Spec-driven development in 2 minutes
11
4
 
12
5
  ---
13
6
 
14
7
  ## What You'll Learn
15
8
 
16
- By the end of this guide, you will:
17
- - ✅ Install kse and set up your first project
18
- - ✅ Create a complete Spec (Requirements Design → Tasks)
19
- - ✅ Export context for your AI tool
20
- - ✅ Use AI to implement features based on your Spec
21
- - ✅ Track task progress
22
-
23
- ---
24
-
25
- ## Prerequisites
26
-
27
- Before starting, ensure you have:
28
- - **Node.js** 14 or higher ([Download](https://nodejs.org/))
29
- - **npm** 6 or higher (comes with Node.js)
30
- - Basic command-line knowledge
31
- - An AI coding tool (Claude, Cursor, Windsurf, Copilot, etc.)
32
-
33
- Check your versions:
34
- ```bash
35
- node --version # Should show v14.0.0 or higher
36
- npm --version # Should show 6.0.0 or higher
37
- ```
9
+ - Install kse and adopt it in your project
10
+ - ✅ Tell your AI about the methodology
11
+ - ✅ Let AI work according to Spec-driven approach
38
12
 
39
13
  ---
40
14
 
41
15
  ## Step 1: Install kse (30 seconds)
42
16
 
43
- Install kse globally using npm:
44
-
45
17
  ```bash
46
18
  npm install -g kiro-spec-engine
47
19
  ```
48
20
 
49
- **Expected output:**
50
- ```
51
- added 50 packages in 5s
52
- ```
53
-
54
- **Verify installation:**
21
+ Verify:
55
22
  ```bash
56
23
  kse --version
57
24
  ```
58
25
 
59
- **Expected output:**
60
- ```
61
- 1.3.0
62
- ```
63
-
64
- **Troubleshooting:**
65
- - **"kse: command not found"** → Restart your terminal or check your PATH
66
- - **Permission errors on macOS/Linux** → Use `sudo npm install -g kiro-spec-engine`
67
- - **Windows permission errors** → Run terminal as Administrator
68
-
69
26
  ---
70
27
 
71
- ## Step 2: Adopt kse in Your Project (1 minute)
72
-
73
- Navigate to your project directory (or create a new one):
28
+ ## Step 2: Adopt in Your Project (30 seconds)
74
29
 
75
30
  ```bash
76
- # For existing project
77
31
  cd your-project
78
-
79
- # Or create a new project
80
- mkdir my-awesome-app
81
- cd my-awesome-app
82
- git init # kse works best with git projects
83
- ```
84
-
85
- **Adopt kse:**
86
- ```bash
87
32
  kse adopt
88
33
  ```
89
34
 
90
- **Expected output:**
91
- ```
92
- Detected project type: Node.js
93
- Created .kiro/ directory
94
- ✓ Created specs/ directory
95
- ✓ Created steering/ directory
96
- ✓ Generated CORE_PRINCIPLES.md
97
- ✓ Generated ENVIRONMENT.md
98
- ✓ Generated CURRENT_CONTEXT.md
99
-
100
- ✅ Project successfully adopted kse!
101
-
102
- Next steps:
103
- 1. Create your first Spec: kse create-spec 01-00-my-feature
104
- 2. Read the guide: .kiro/README.md
105
- ```
106
-
107
- **What was created:**
108
- ```
109
- your-project/
110
- ├── .kiro/
111
- │ ├── specs/ # Your Specs will live here
112
- │ ├── steering/ # AI behavior rules
113
- │ │ ├── CORE_PRINCIPLES.md
114
- │ │ ├── ENVIRONMENT.md
115
- │ │ └── CURRENT_CONTEXT.md
116
- │ └── README.md # Kiro system documentation
117
- ```
118
-
119
- **Verification:**
120
- ```bash
121
- kse status
122
- ```
123
-
124
- **Expected output:**
125
- ```
126
- Project: my-awesome-app
127
- Specs: 0
128
- Status: Ready
129
- ```
35
+ This creates `.kiro/` directory with:
36
+ - `README.md` - Project development guide
37
+ - `steering/` - Development rules
38
+ - `specs/` - Where Specs will live
130
39
 
131
40
  ---
132
41
 
133
- ## Step 3: Create Your First Spec (2 minutes)
134
-
135
- Let's create a Spec for a user login feature:
136
-
137
- ```bash
138
- kse create-spec 01-00-user-login
139
- ```
140
-
141
- **Expected output:**
142
- ```
143
- ✓ Created spec: 01-00-user-login
144
- ✓ Created requirements.md
145
- ✓ Created design.md
146
- ✓ Created tasks.md
147
-
148
- 📝 Next steps:
149
- 1. Edit requirements.md to define what you're building
150
- 2. Edit design.md to define how you'll build it
151
- 3. Edit tasks.md to break down implementation steps
152
- ```
153
-
154
- ### 3.1 Write Requirements
155
-
156
- Open `.kiro/specs/01-00-user-login/requirements.md` and write:
157
-
158
- ```markdown
159
- # User Login Feature
160
-
161
- ## Overview
162
- Enable users to log in to the application using email and password.
42
+ ## Step 3: Tell Your AI (1 minute)
163
43
 
164
- ## User Stories
44
+ **In your AI tool (Cursor, Claude, Windsurf, etc.), say:**
165
45
 
166
- ### US-1: User Login
167
- **As a** user
168
- **I want to** log in with my email and password
169
- **So that** I can access my account
170
-
171
- ### US-2: Login Validation
172
- **As a** user
173
- **I want to** see clear error messages when login fails
174
- **So that** I know what went wrong
175
-
176
- ## Functional Requirements
177
-
178
- ### FR-1: Login Form
179
- The system shall provide a login form with:
180
- - Email input field
181
- - Password input field
182
- - Submit button
183
-
184
- ### FR-2: Credential Validation
185
- **WHEN** user submits valid credentials
186
- **THEN** system authenticates user and redirects to dashboard
187
-
188
- **WHEN** user submits invalid credentials
189
- **THEN** system displays error message "Invalid email or password"
190
-
191
- ### FR-3: Input Validation
192
- **WHEN** user submits empty email
193
- **THEN** system displays error "Email is required"
194
-
195
- **WHEN** user submits invalid email format
196
- **THEN** system displays error "Please enter a valid email"
197
-
198
- **WHEN** user submits password shorter than 6 characters
199
- **THEN** system displays error "Password must be at least 6 characters"
200
-
201
- ## Non-Functional Requirements
202
-
203
- ### NFR-1: Security
204
- - Passwords must be hashed before storage
205
- - Use bcrypt with salt rounds >= 10
206
- - Implement rate limiting (max 5 attempts per minute)
207
-
208
- ### NFR-2: Performance
209
- - Login response time < 500ms
210
- - Support 100 concurrent login requests
211
-
212
- ### NFR-3: Usability
213
- - Clear error messages
214
- - Accessible form (WCAG 2.1 Level AA)
215
-
216
- ## Acceptance Criteria
217
-
218
- - [ ] User can log in with valid email and password
219
- - [ ] User sees error message with invalid credentials
220
- - [ ] Email validation works correctly
221
- - [ ] Password validation works correctly
222
- - [ ] Passwords are hashed in database
223
- - [ ] Rate limiting prevents brute force attacks
224
- - [ ] Login response time is under 500ms
225
46
  ```
226
-
227
- ### 3.2 Write Design
228
-
229
- Open `.kiro/specs/01-00-user-login/design.md` and write:
230
-
231
- ```markdown
232
- # User Login - Design Document
233
-
234
- ## Overview
235
- This design implements a secure user login system with email/password authentication, input validation, and rate limiting.
236
-
237
- ## Architecture
238
-
239
- ### System Components
240
-
241
- ```mermaid
242
- graph TD
243
- A[Login Form] --> B[AuthController]
244
- B --> C[ValidationService]
245
- B --> D[AuthService]
246
- D --> E[UserRepository]
247
- D --> F[TokenService]
248
- E --> G[Database]
47
+ Please read .kiro/README.md to understand how this project works.
249
48
  ```
250
49
 
251
- ## API Design
252
-
253
- ### POST /api/auth/login
254
-
255
- **Request:**
256
- ```json
257
- {
258
- "email": "user@example.com",
259
- "password": "secret123"
260
- }
261
- ```
262
-
263
- **Success Response (200):**
264
- ```json
265
- {
266
- "success": true,
267
- "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
268
- "user": {
269
- "id": "123",
270
- "email": "user@example.com",
271
- "name": "John Doe"
272
- }
273
- }
274
- ```
275
-
276
- **Error Response (401):**
277
- ```json
278
- {
279
- "success": false,
280
- "error": "Invalid email or password"
281
- }
282
- ```
283
-
284
- **Error Response (429):**
285
- ```json
286
- {
287
- "success": false,
288
- "error": "Too many login attempts. Please try again later."
289
- }
290
- ```
291
-
292
- ## Component Design
293
-
294
- ### AuthController
295
- **Responsibility:** Handle HTTP requests for authentication
296
-
297
- **Methods:**
298
- - `login(req, res)` - Process login request
299
- - `validateRequest(req)` - Validate request format
300
-
301
- ### ValidationService
302
- **Responsibility:** Validate user input
303
-
304
- **Methods:**
305
- - `validateEmail(email)` - Check email format
306
- - `validatePassword(password)` - Check password requirements
307
- - Returns: `{ valid: boolean, errors: string[] }`
308
-
309
- ### AuthService
310
- **Responsibility:** Business logic for authentication
311
-
312
- **Methods:**
313
- - `authenticate(email, password)` - Verify credentials
314
- - `generateToken(user)` - Create JWT token
315
- - `hashPassword(password)` - Hash password with bcrypt
316
-
317
- ### UserRepository
318
- **Responsibility:** Database operations for users
319
-
320
- **Methods:**
321
- - `findByEmail(email)` - Get user by email
322
- - `updateLastLogin(userId)` - Update last login timestamp
323
-
324
- ### RateLimiter
325
- **Responsibility:** Prevent brute force attacks
326
-
327
- **Configuration:**
328
- - Max attempts: 5 per minute per IP
329
- - Block duration: 15 minutes after limit exceeded
330
-
331
- ## Data Models
332
-
333
- ### User
334
- ```javascript
335
- {
336
- id: string,
337
- email: string,
338
- passwordHash: string,
339
- name: string,
340
- createdAt: Date,
341
- lastLoginAt: Date
342
- }
343
- ```
344
-
345
- ## Security Considerations
346
-
347
- 1. **Password Hashing:** Use bcrypt with 10 salt rounds
348
- 2. **JWT Tokens:** Sign with secret key, expire in 24 hours
349
- 3. **Rate Limiting:** Implement per-IP rate limiting
350
- 4. **Input Sanitization:** Sanitize all user inputs
351
- 5. **HTTPS Only:** Enforce HTTPS in production
352
-
353
- ## Error Handling
354
-
355
- | Error | HTTP Code | Message |
356
- |-------|-----------|---------|
357
- | Invalid credentials | 401 | "Invalid email or password" |
358
- | Missing email | 400 | "Email is required" |
359
- | Invalid email format | 400 | "Please enter a valid email" |
360
- | Missing password | 400 | "Password is required" |
361
- | Password too short | 400 | "Password must be at least 6 characters" |
362
- | Rate limit exceeded | 429 | "Too many login attempts. Please try again later." |
363
- | Server error | 500 | "An error occurred. Please try again." |
364
-
365
- ## Technology Stack
366
-
367
- - **Backend:** Node.js + Express
368
- - **Database:** PostgreSQL
369
- - **Authentication:** JWT (jsonwebtoken)
370
- - **Password Hashing:** bcrypt
371
- - **Rate Limiting:** express-rate-limit
372
- - **Validation:** validator.js
373
-
374
- ## Requirements Traceability
375
-
376
- | Requirement | Design Component |
377
- |-------------|------------------|
378
- | FR-1: Login Form | AuthController.login() |
379
- | FR-2: Credential Validation | AuthService.authenticate() |
380
- | FR-3: Input Validation | ValidationService |
381
- | NFR-1: Security | bcrypt, JWT, RateLimiter |
382
- | NFR-2: Performance | Indexed database queries |
383
- | NFR-3: Usability | Clear error messages in API responses |
384
- ```
385
-
386
- ### 3.3 Write Tasks
387
-
388
- Open `.kiro/specs/01-00-user-login/tasks.md` and write:
389
-
390
- ```markdown
391
- # User Login - Implementation Tasks
392
-
393
- ## Phase 1: Setup and Models
394
-
395
- - [ ] 1.1 Set up project dependencies
396
- - Install express, bcrypt, jsonwebtoken, validator, express-rate-limit
397
- - Configure TypeScript (if using)
398
-
399
- - [ ] 1.2 Create User model and database schema
400
- - Define User interface/class
401
- - Create database migration for users table
402
- - Add indexes on email field
403
-
404
- ## Phase 2: Core Services
405
-
406
- - [ ] 2.1 Implement ValidationService
407
- - Create validateEmail() method
408
- - Create validatePassword() method
409
- - Write unit tests
410
-
411
- - [ ] 2.2 Implement AuthService
412
- - Create hashPassword() method
413
- - Create authenticate() method
414
- - Create generateToken() method
415
- - Write unit tests
416
-
417
- - [ ] 2.3 Implement UserRepository
418
- - Create findByEmail() method
419
- - Create updateLastLogin() method
420
- - Write unit tests
421
-
422
- ## Phase 3: API Implementation
423
-
424
- - [ ] 3.1 Implement AuthController
425
- - Create login() endpoint handler
426
- - Add request validation
427
- - Add error handling
428
- - Write integration tests
429
-
430
- - [ ] 3.2 Implement rate limiting
431
- - Configure express-rate-limit
432
- - Apply to login endpoint
433
- - Test rate limiting behavior
434
-
435
- ## Phase 4: Testing and Documentation
436
-
437
- - [ ] 4.1 Write comprehensive tests
438
- - Unit tests for all services
439
- - Integration tests for API endpoint
440
- - Test error scenarios
441
- - Test rate limiting
442
-
443
- - [ ] 4.2 Create API documentation
444
- - Document request/response formats
445
- - Add example requests
446
- - Document error codes
447
-
448
- - [ ] 4.3 Manual testing
449
- - Test with valid credentials
450
- - Test with invalid credentials
451
- - Test input validation
452
- - Test rate limiting
453
- - Test performance (response time < 500ms)
454
-
455
- ## Phase 5: Deployment
456
-
457
- - [ ] 5.1 Environment configuration
458
- - Set up environment variables
459
- - Configure JWT secret
460
- - Configure database connection
461
-
462
- - [ ] 5.2 Deploy to staging
463
- - Deploy code
464
- - Run smoke tests
465
- - Verify functionality
466
-
467
- ## Notes
468
- - All passwords must be hashed before storage
469
- - Use environment variables for secrets
470
- - Follow project coding standards
471
- - Write tests before marking tasks complete
472
- ```
50
+ **Your AI will learn:**
51
+ - This project follows Spec-driven development
52
+ - Every feature starts with a Spec (requirements + design + tasks)
53
+ - How to work with this methodology
473
54
 
474
55
  ---
475
56
 
476
- ## Step 4: Export Context for Your AI Tool (1 minute)
57
+ ## Step 4: Start Working
477
58
 
478
- Now that your Spec is complete, export it for your AI tool:
59
+ **Just ask your AI to implement features:**
479
60
 
480
- ```bash
481
- kse context export 01-00-user-login
482
- ```
483
-
484
- **Expected output:**
485
61
  ```
486
- Exported context to .kiro/specs/01-00-user-login/context-export.md
487
- ✓ Context size: 3.2 KB
488
- ✓ Ready to use with AI tools
62
+ I need a user login feature with email and password.
489
63
  ```
490
64
 
491
- **What was created:**
492
- A file at `.kiro/specs/01-00-user-login/context-export.md` containing:
493
- - All requirements
494
- - Complete design
495
- - Task list
496
- - Project structure
497
- - Formatted for AI consumption
498
-
499
- ---
500
-
501
- ## Step 5: Use Your AI Tool (1 minute)
502
-
503
- Now use your AI tool to implement the feature. Choose your tool:
504
-
505
- ### Option A: Claude Code / ChatGPT
506
-
507
- 1. **Open the context file:**
508
- ```bash
509
- # On macOS
510
- cat .kiro/specs/01-00-user-login/context-export.md | pbcopy
511
-
512
- # On Windows
513
- type .kiro\specs\01-00-user-login\context-export.md | clip
514
-
515
- # On Linux
516
- cat .kiro/specs/01-00-user-login/context-export.md | xclip -selection clipboard
517
- ```
518
-
519
- 2. **Start a new conversation** with Claude or ChatGPT
520
-
521
- 3. **Paste the context** and say:
522
- ```
523
- I've provided the complete Spec for a user login feature.
524
- Please implement task 1.1: "Set up project dependencies"
525
- ```
526
-
527
- 4. **Claude/ChatGPT will:**
528
- - Understand your requirements and design
529
- - Generate the appropriate code
530
- - Follow your architecture decisions
531
-
532
- ### Option B: Cursor
533
-
534
- 1. **Generate a task-specific prompt:**
535
- ```bash
536
- kse prompt generate 01-00-user-login 1.1
537
- ```
538
-
539
- 2. **Open Cursor Composer** (Cmd+K or Ctrl+K)
540
-
541
- 3. **Paste the generated prompt**
542
-
543
- 4. **Cursor will:**
544
- - Read your Spec files
545
- - Generate code matching your design
546
- - Create or modify files directly
547
-
548
- ### Option C: Windsurf / Cline
549
-
550
- 1. **Simply tell the AI:**
551
- ```
552
- Use kse to check the spec for 01-00-user-login and implement task 1.1
553
- ```
554
-
555
- 2. **The AI will:**
556
- - Automatically run `kse context export 01-00-user-login`
557
- - Read the exported context
558
- - Implement the task
559
- - Update task status
560
-
561
- ### Option D: VS Code + Copilot
562
-
563
- 1. **Create a new file** (e.g., `src/auth/AuthController.js`)
65
+ **Your AI will:**
66
+ 1. Suggest creating a Spec first
67
+ 2. Help you define requirements
68
+ 3. Design the solution
69
+ 4. Break down into tasks
70
+ 5. Implement according to the Spec
564
71
 
565
- 2. **Add a comment referencing your Spec:**
566
- ```javascript
567
- // Task 1.1: Set up project dependencies
568
- // See: .kiro/specs/01-00-user-login/design.md
569
- //
570
- // Install: express, bcrypt, jsonwebtoken, validator, express-rate-limit
571
- ```
572
-
573
- 3. **Copilot will:**
574
- - Suggest code based on your Spec
575
- - Follow your design patterns
576
- - Generate appropriate implementations
72
+ **The AI uses kse commands automatically** - you don't need to learn them.
577
73
 
578
74
  ---
579
75
 
580
- ## Step 6: Track Your Progress (30 seconds)
581
-
582
- As you complete tasks, update the task status:
583
-
584
- **Edit** `.kiro/specs/01-00-user-login/tasks.md`:
76
+ ## That's It!
585
77
 
586
- ```markdown
587
- - [x] 1.1 Set up project dependencies ← Changed from [ ] to [x]
588
- - [ ] 1.2 Create User model and database schema
589
- ```
78
+ You're now using Spec-driven development. Your AI understands the methodology and will follow it.
590
79
 
591
- **Check your progress:**
592
- ```bash
593
- kse status
594
- ```
595
-
596
- **Expected output:**
597
- ```
598
- Project: my-awesome-app
599
- Specs: 1
600
-
601
- Spec: 01-00-user-login
602
- Total tasks: 15
603
- Completed: 1
604
- In progress: 0
605
- Not started: 14
606
- Progress: 6.7%
607
- ```
80
+ **Key insight:** You don't "use kse" - your project "follows Spec-driven methodology" and kse helps enforce it.
608
81
 
609
82
  ---
610
83
 
611
84
  ## Next Steps
612
85
 
613
- Congratulations! You've completed the quick start. Here's what to do next:
614
-
615
- ### Learn More About Integration
616
-
617
- Choose your AI tool for detailed guidance:
618
- - **[Cursor Guide](tools/cursor-guide.md)** - Deep dive into Cursor integration
619
- - **[Claude Guide](tools/claude-guide.md)** - Best practices for Claude Code
620
- - **[Windsurf Guide](tools/windsurf-guide.md)** - Automated workflows with Windsurf
621
- - **[Generic Guide](tools/generic-guide.md)** - Works with any AI tool
622
-
623
- ### Explore Advanced Features
624
-
625
- - **[Integration Modes](integration-modes.md)** - Native, Manual, and Watch Mode
86
+ - **[Integration Modes](integration-modes.md)** - Understand how AI tools work with kse
626
87
  - **[Spec Workflow](spec-workflow.md)** - Deep dive into Spec creation
627
- - **[Command Reference](command-reference.md)** - All kse commands
628
-
629
- ### See Real Examples
630
-
631
- - **[API Feature Example](examples/add-rest-api/)** - Complete RESTful API Spec
632
- - **[UI Feature Example](examples/add-user-dashboard/)** - React dashboard Spec
633
- - **[CLI Feature Example](examples/add-export-command/)** - CLI command Spec
634
-
635
- ---
636
-
637
- ## Troubleshooting
638
-
639
- ### Issue: "kse: command not found"
640
-
641
- **Solution:**
642
- 1. Restart your terminal
643
- 2. Check if npm global bin is in PATH:
644
- ```bash
645
- npm config get prefix
646
- ```
647
- 3. Add to PATH if needed (macOS/Linux):
648
- ```bash
649
- export PATH="$(npm config get prefix)/bin:$PATH"
650
- ```
651
-
652
- ### Issue: Context file is too large for AI tool
653
-
654
- **Solution:** Generate task-specific prompts:
655
- ```bash
656
- kse prompt generate 01-00-user-login 1.1
657
- ```
658
-
659
- This creates a smaller, focused context for just that task.
660
-
661
- ### Issue: AI doesn't follow my design
662
-
663
- **Solution:**
664
- 1. Make your design.md more detailed
665
- 2. Add code examples in design.md
666
- 3. Be explicit in your prompt: "Strictly follow the design document"
667
- 4. Include steering rules:
668
- ```bash
669
- kse context export 01-00-user-login --steering
670
- ```
671
-
672
- ### Issue: Can't find my Spec files
673
-
674
- **Solution:**
675
- All Specs are in `.kiro/specs/`:
676
- ```bash
677
- ls .kiro/specs/
678
- ```
679
-
680
- ### More Help
681
-
682
- - 📖 **[Troubleshooting Guide](troubleshooting.md)** - Common issues and solutions
683
- - 🤔 **[FAQ](faq.md)** - Frequently asked questions
684
- - 💬 **[GitHub Discussions](https://github.com/yourusername/kiro-spec-engine/discussions)** - Community help
685
-
686
- ---
687
-
688
- ## Summary
689
-
690
- You've learned how to:
691
- - ✅ Install and set up kse
692
- - ✅ Create structured Specs with requirements, design, and tasks
693
- - ✅ Export context for AI tools
694
- - ✅ Use AI to implement features based on Specs
695
- - ✅ Track implementation progress
696
-
697
- **The kse workflow:**
698
- ```
699
- Create Spec → Export Context → AI Implements → Update Tasks → Repeat
700
- ```
701
-
702
- **Ready to build your next feature?** 🚀
703
-
704
- ```bash
705
- kse create-spec 02-00-your-next-feature
706
- ```
88
+ - **[Tool Guides](tools/)** - Tool-specific tips
707
89
 
708
90
  ---
709
91
 
710
- **Version**: 1.0.0
711
- **Last Updated**: 2026-01-23
92
+ **Version**: 2.0.0
93
+ **Last Updated**: 2026-01-24
@@ -53,7 +53,7 @@ class SelectiveBackup {
53
53
 
54
54
  // Backup each file
55
55
  for (const filePath of filePaths) {
56
- const sourcePath = path.join(projectPath, this.backupDir.replace('/backups', ''), filePath);
56
+ const sourcePath = path.join(projectPath, '.kiro', filePath);
57
57
  const destPath = path.join(filesBackupPath, filePath);
58
58
 
59
59
  // Check if source file exists
@@ -138,7 +138,7 @@ class SelectiveBackup {
138
138
  for (const filePath of filesToRestore) {
139
139
  try {
140
140
  const sourcePath = path.join(backupPath, 'files', filePath);
141
- const destPath = path.join(projectPath, this.backupDir.replace('/backups', ''), filePath);
141
+ const destPath = path.join(projectPath, '.kiro', filePath);
142
142
 
143
143
  // Check if backup file exists
144
144
  const sourceExists = await pathExists(sourcePath);
@@ -399,11 +399,11 @@ async function adoptCommand(options = {}) {
399
399
 
400
400
  console.log();
401
401
  console.log(chalk.blue('💡 Next steps:'));
402
- console.log(' 1. Review the .kiro/ directory structure');
403
- console.log(' 2. Create your first spec: ' + chalk.cyan('kse create-spec my-feature'));
404
- console.log(' 3. Check project status: ' + chalk.cyan('kse status'));
402
+ console.log(' 1. Tell your AI: "Read .kiro/README.md to understand project methodology"');
403
+ console.log(' 2. Start working: Ask AI to implement features following Spec-driven approach');
404
+ console.log(' 3. Check progress: ' + chalk.cyan('kse status'));
405
405
  console.log();
406
- console.log(chalk.red('🔥') + ' Ready to build with Kiro Spec Engine!');
406
+ console.log(chalk.red('🔥') + ' Project now follows Spec-driven development!');
407
407
  } else {
408
408
  console.log(chalk.red('❌ Adoption failed'));
409
409
  console.log();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kiro-spec-engine",
3
- "version": "1.5.5",
3
+ "version": "1.6.1",
4
4
  "description": "Kiro Spec Engine - A spec-driven development engine with steering rules and quality enhancement powered by Ultrawork spirit",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -1,328 +1,181 @@
1
- # kse - Kiro Spec Engine
1
+ # Project Development Guide
2
2
 
3
- > **AI Tools: Read this first!** This project uses kse (Kiro Spec Engine) for structured development.
3
+ > **AI Tools: Read this first!** This project follows Spec-driven development methodology.
4
4
 
5
5
  ---
6
6
 
7
- ## 🎯 What is kse?
7
+ ## 🎯 How This Project Works
8
8
 
9
- **kse** is a CLI tool that provides structured, Spec-driven development workflows for AI-assisted coding.
9
+ This project uses **Spec-driven development** - a structured approach where:
10
+ - Every feature starts with a **Spec** (requirements + design + tasks)
11
+ - All work is tracked and documented
12
+ - AI tools help implement features according to Specs
10
13
 
11
- **Key concepts:**
12
- - **Spec**: A structured feature definition with requirements, design, and tasks
13
- - **Context Export**: Generate AI-friendly documentation from Specs
14
- - **Task Tracking**: Monitor implementation progress
15
- - **Steering Rules**: AI behavior guidelines in `.kiro/steering/`
14
+ **Your role as AI:**
15
+ - When user requests a feature Check if Spec exists, if not, help create one
16
+ - When implementing Follow the Spec's requirements and design
17
+ - When stuck Read the Spec documents for context
18
+ - Track progress by updating task status
16
19
 
17
- **This project has adopted kse** - all development should follow the Spec-driven workflow
20
+ **The tool `kse` helps you:**
21
+ - Check project status: `kse status`
22
+ - Find Specs: `kse workflows`
23
+ - Get context: `kse context export <spec-name>`
24
+ - But you don't need to memorize commands - use them when needed
18
25
 
19
26
  ---
20
27
 
21
- ## 📦 kse Commands (For AI Tools)
28
+ ## 📋 Development Workflow
22
29
 
23
- ### Check Project Status
24
- ```bash
25
- kse status
26
- ```
27
- Shows all Specs and their progress.
28
-
29
- ### List All Specs
30
- ```bash
31
- kse workflows
32
- ```
33
- Lists all available Specs in `.kiro/specs/`.
34
-
35
- ### Export Spec Context
36
- ```bash
37
- kse context export <spec-name>
38
- ```
39
- Generates AI-friendly context from a Spec (requirements + design + tasks).
40
-
41
- **Example:**
42
- ```bash
43
- kse context export 01-00-user-login
44
- # Creates: .kiro/specs/01-00-user-login/context-export.md
45
- ```
46
-
47
- ### Generate Task Prompt
48
- ```bash
49
- kse prompt generate <spec-name> <task-id>
50
- ```
51
- Creates a focused prompt for a specific task.
52
-
53
- **Example:**
54
- ```bash
55
- kse prompt generate 01-00-user-login 1.1
56
- # Generates prompt for task 1.1 only
57
- ```
58
-
59
- ### Claim a Task
60
- ```bash
61
- kse task claim <spec-name> <task-id>
62
- ```
63
- Mark a task as "in progress" and assign it to yourself.
64
-
65
- **Example:**
66
- ```bash
67
- kse task claim 01-00-user-login 1.1
68
- ```
69
-
70
- ### Check Adoption Status
71
- ```bash
72
- kse doctor
73
- ```
74
- Verifies kse is properly configured in the project.
75
-
76
- ---
77
-
78
- ## 🤖 AI Workflow Guide
79
-
80
- ### When User Asks to Implement a Feature
30
+ ### When User Asks You to Implement a Feature
81
31
 
82
32
  **Step 1: Check if Spec exists**
83
- ```bash
84
- kse workflows
85
33
  ```
86
-
87
- **Step 2: Export Spec context**
88
- ```bash
89
- kse context export <spec-name>
34
+ Look in .kiro/specs/ directory
90
35
  ```
91
36
 
92
- **Step 3: Read the exported context**
93
- ```bash
94
- # Context is at: .kiro/specs/<spec-name>/context-export.md
95
- ```
37
+ **Step 2: If Spec exists**
38
+ - Read `requirements.md` - understand what to build
39
+ - Read `design.md` - understand how to build it
40
+ - Read `tasks.md` - see implementation steps
41
+ - Implement according to the Spec
42
+ - Update task status as you complete work
96
43
 
97
- **Step 4: Implement according to the Spec**
98
- - Follow requirements in `requirements.md`
99
- - Follow design in `design.md`
100
- - Complete tasks from `tasks.md`
44
+ **Step 3: If no Spec exists**
45
+ - Suggest creating a Spec first
46
+ - Help user define requirements
47
+ - Help design the solution
48
+ - Break down into tasks
49
+ - Then implement
101
50
 
102
- **Step 5: Update task status**
103
- - Mark tasks as complete: `- [x] 1.1 Task description`
104
- - Mark tasks in progress: `- [-] 1.1 Task description`
51
+ **Why Spec-first?**
52
+ - Clear requirements prevent misunderstandings
53
+ - Design decisions are documented
54
+ - Progress is trackable
55
+ - Knowledge is preserved
105
56
 
106
57
  ### When User Asks About Project Status
107
58
 
59
+ Check what's happening:
108
60
  ```bash
109
61
  kse status
110
62
  ```
111
63
 
112
- This shows:
113
- - All Specs in the project
114
- - Task completion progress
115
- - Current active Specs
116
-
117
- ### When User Asks to Start a New Feature
64
+ This shows all Specs and their progress.
118
65
 
119
- **If no Spec exists:**
120
- ```
121
- I notice there's no Spec for this feature yet.
122
- Would you like me to create one? I can help you define:
123
- 1. Requirements (what we're building)
124
- 2. Design (how we'll build it)
125
- 3. Tasks (implementation steps)
126
- ```
66
+ ### When You Need Context
127
67
 
128
- **If Spec exists:**
68
+ If you need to understand a feature:
129
69
  ```bash
130
70
  kse context export <spec-name>
131
- # Then read and implement according to the Spec
132
71
  ```
133
72
 
73
+ This generates a summary of requirements, design, and tasks.
74
+
134
75
  ---
135
76
 
136
- ## 📁 Directory Structure
77
+ ## 📁 Project Structure
137
78
 
138
79
  ```
139
80
  .kiro/
140
- ├── README.md # This file - kse usage guide
81
+ ├── README.md # This file - project development guide
141
82
  ├── specs/ # All Specs live here
142
- │ ├── SPEC_WORKFLOW_GUIDE.md # Detailed Spec workflow
143
83
  │ └── {spec-name}/ # Individual Spec
144
84
  │ ├── requirements.md # What we're building
145
85
  │ ├── design.md # How we'll build it
146
86
  │ ├── tasks.md # Implementation steps
147
- ├── context-export.md # AI-friendly export (generated)
148
- ├── scripts/ # Spec-specific scripts
149
- ├── tests/ # Spec-specific tests
150
- │ └── results/ # Execution results
151
- ├── steering/ # AI behavior rules
152
- │ ├── RULES_GUIDE.md # Quick reference
153
- │ ├── CORE_PRINCIPLES.md # Core development rules
87
+ └── ... # Other artifacts
88
+ ├── steering/ # Development rules
89
+ ├── CORE_PRINCIPLES.md # Core development principles
154
90
  │ ├── ENVIRONMENT.md # Project environment
155
- │ └── CURRENT_CONTEXT.md # Current Spec context
91
+ │ └── CURRENT_CONTEXT.md # Current work context
156
92
  └── tools/ # Tool configurations
157
93
  ```
158
94
 
159
- **Key files for AI:**
160
- - `.kiro/README.md` (this file) - kse command reference
161
- - `.kiro/steering/CORE_PRINCIPLES.md` - Development rules
162
- - `.kiro/steering/CURRENT_CONTEXT.md` - Current work context
163
- - `.kiro/specs/{spec-name}/context-export.md` - Spec context
95
+ **Key files:**
96
+ - `.kiro/steering/CORE_PRINCIPLES.md` - Development principles for this project
97
+ - `.kiro/steering/CURRENT_CONTEXT.md` - What we're currently working on
98
+ - `.kiro/specs/{spec-name}/` - Feature specifications
164
99
 
165
100
  ---
166
101
 
167
- ## 📖 Spec Structure
168
-
169
- Each Spec contains three core documents:
102
+ ## 📖 What is a Spec?
170
103
 
171
- ### 1. requirements.md
172
- **Purpose:** Define WHAT we're building
104
+ A Spec is a complete feature definition with three parts:
173
105
 
174
- **Contains:**
106
+ ### 1. requirements.md - WHAT we're building
175
107
  - User stories
176
108
  - Functional requirements
177
- - Non-functional requirements
178
109
  - Acceptance criteria
110
+ - Non-functional requirements
179
111
 
180
- ### 2. design.md
181
- **Purpose:** Define HOW we'll build it
182
-
183
- **Contains:**
184
- - Architecture overview
112
+ ### 2. design.md - HOW we'll build it
113
+ - Architecture
185
114
  - Component design
186
115
  - API design
187
- - Data models
188
116
  - Technology choices
189
117
 
190
- ### 3. tasks.md
191
- **Purpose:** Break down implementation
192
-
193
- **Contains:**
118
+ ### 3. tasks.md - Implementation steps
194
119
  - Ordered task list
195
120
  - Task dependencies
196
121
  - Implementation notes
197
122
 
198
- **Task status markers:**
123
+ **Task status:**
199
124
  - `- [ ]` Not started
200
- - `- [-]` In progress
125
+ - `- [-]` In progress
201
126
  - `- [x]` Completed
202
127
 
203
128
  ---
204
129
 
205
- ## 🎯 Spec-Driven Workflow
130
+ ## 💡 Working with This Project
206
131
 
207
- ```
208
- 1. User requests feature
209
-
210
- 2. Check if Spec exists (kse workflows)
211
-
212
- 3. If no Spec: Suggest creating one
213
- If Spec exists: Export context (kse context export)
214
-
215
- 4. Read requirements.md and design.md
216
-
217
- 5. Implement according to Spec
218
-
219
- 6. Update tasks.md as you complete tasks
220
-
221
- 7. Verify against acceptance criteria
222
- ```
132
+ ### DO:
133
+ - Check for existing Specs before starting work
134
+ - ✅ Follow requirements and design in Specs
135
+ - Update task status as you work
136
+ - ✅ Read steering rules for project-specific guidelines
137
+ - Ask user if requirements are unclear
223
138
 
224
- **Why Spec-driven?**
225
- - Clear requirements before coding
226
- - Consistent architecture decisions
227
- - Trackable progress
228
- - Better AI understanding of context
229
- - ✅ Knowledge preserved in Specs
139
+ ### DON'T:
140
+ - Start implementing without understanding requirements
141
+ - Ignore the design document
142
+ - Create files in wrong locations
143
+ - Skip updating task status
230
144
 
231
145
  ---
232
146
 
233
- ## 🔧 Common AI Tasks
234
-
235
- ### Task 1: Implement a Feature
236
-
237
- ```bash
238
- # 1. Check what Specs exist
239
- kse workflows
240
-
241
- # 2. Export the Spec context
242
- kse context export 01-00-user-login
243
-
244
- # 3. Read the context
245
- # File: .kiro/specs/01-00-user-login/context-export.md
246
-
247
- # 4. Implement according to requirements and design
248
-
249
- # 5. Update tasks.md to mark tasks complete
250
- ```
251
-
252
- ### Task 2: Check Project Status
147
+ ## 🔍 Finding Information
253
148
 
254
- ```bash
255
- kse status
256
- ```
257
-
258
- Shows all Specs and their completion progress.
259
-
260
- ### Task 3: Work on Specific Task
261
-
262
- ```bash
263
- # Generate focused prompt for one task
264
- kse prompt generate 01-00-user-login 1.1
265
-
266
- # Claim the task
267
- kse task claim 01-00-user-login 1.1
268
-
269
- # Implement the task
270
-
271
- # Mark complete in tasks.md
272
- ```
273
-
274
- ### Task 4: Understand Project Context
149
+ **Need to understand a feature?**
150
+ Read `.kiro/specs/{spec-name}/requirements.md` and `design.md`
275
151
 
276
- **Read these files in order:**
277
- 1. `.kiro/README.md` (this file) - kse basics
278
- 2. `.kiro/steering/CURRENT_CONTEXT.md` - Current work
279
- 3. `.kiro/steering/CORE_PRINCIPLES.md` - Development rules
280
- 4. `.kiro/specs/{spec-name}/requirements.md` - Feature requirements
281
- 5. `.kiro/specs/{spec-name}/design.md` - Feature design
152
+ **Need to know what to work on?**
153
+ Read `.kiro/specs/{spec-name}/tasks.md`
282
154
 
283
- ---
155
+ **Need project context?**
156
+ → Read `.kiro/steering/CURRENT_CONTEXT.md`
284
157
 
285
- ## 💡 Best Practices for AI
286
-
287
- ### DO:
288
- - ✅ Always check `kse workflows` to see available Specs
289
- - ✅ Export context before implementing: `kse context export <spec>`
290
- - ✅ Follow requirements and design documents strictly
291
- - ✅ Update tasks.md as you complete work
292
- - ✅ Read steering rules in `.kiro/steering/`
293
- - ✅ Keep all Spec artifacts in the Spec directory
158
+ **Need development rules?**
159
+ → Read `.kiro/steering/CORE_PRINCIPLES.md`
294
160
 
295
- ### DON'T:
296
- - Implement features without checking for Specs first
297
- - ❌ Ignore requirements or design documents
298
- - ❌ Create temporary files in project root
299
- - ❌ Skip updating task status
300
- - ❌ Deviate from architecture without discussion
161
+ **Need to check status?**
162
+ Run `kse status`
301
163
 
302
164
  ---
303
165
 
304
- ## 🚀 Quick Reference
305
-
306
- | Task | Command |
307
- |------|---------|
308
- | List all Specs | `kse workflows` |
309
- | Check status | `kse status` |
310
- | Export Spec | `kse context export <spec>` |
311
- | Generate task prompt | `kse prompt generate <spec> <task>` |
312
- | Claim task | `kse task claim <spec> <task>` |
313
- | Verify setup | `kse doctor` |
314
-
315
- ---
166
+ ## 🚀 Quick Start for AI
316
167
 
317
- ## 📚 Learn More
168
+ 1. **User asks you to implement something**
169
+ 2. **You check**: Does a Spec exist for this? (`kse workflows` or check `.kiro/specs/`)
170
+ 3. **If yes**: Read the Spec and implement according to it
171
+ 4. **If no**: Suggest creating a Spec first, help user define it
172
+ 5. **While working**: Update task status in `tasks.md`
173
+ 6. **When done**: Mark tasks complete
318
174
 
319
- - **Spec Workflow Guide**: `.kiro/specs/SPEC_WORKFLOW_GUIDE.md`
320
- - **Core Principles**: `.kiro/steering/CORE_PRINCIPLES.md`
321
- - **Current Context**: `.kiro/steering/CURRENT_CONTEXT.md`
322
- - **Environment**: `.kiro/steering/ENVIRONMENT.md`
175
+ **Remember**: You're not just writing code, you're following a structured development process. The Spec is your guide.
323
176
 
324
177
  ---
325
178
 
326
- **kse Version**: 1.5.4
179
+ **Project Type**: Spec-driven development
327
180
  **Last Updated**: 2026-01-24
328
- **Purpose**: AI tool reference for kse usage
181
+ **Purpose**: Guide AI tools to work effectively with this project