kiro-spec-engine 1.21.1 → 1.22.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 +30 -0
- package/README.md +19 -0
- package/bin/kiro-spec-engine.js +4 -0
- package/docs/spec-collaboration-guide.md +369 -0
- package/lib/collab/collab-manager.js +285 -0
- package/lib/collab/contract-manager.js +320 -0
- package/lib/collab/dependency-manager.js +280 -0
- package/lib/collab/integration-manager.js +202 -0
- package/lib/collab/metadata-manager.js +233 -0
- package/lib/collab/visualizer.js +208 -0
- package/lib/commands/collab.js +275 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.22.0] - 2026-02-02
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **Spec-Level Collaboration System**: Enable multiple AI instances to work on different Specs in parallel
|
|
14
|
+
- **Master Spec and Sub-Specs**: Break down large features into manageable, independently developable modules
|
|
15
|
+
- **Dependency Management**: Define and track dependencies between Specs with automatic circular dependency detection
|
|
16
|
+
- **Interface Contracts**: Formal API definitions (JSON/TypeScript format) ensuring compatibility between Specs
|
|
17
|
+
- **Status Tracking**: Monitor progress, assignments, and blocking issues across all Specs
|
|
18
|
+
- **Integration Testing**: Run cross-Spec integration tests to verify modules work together correctly
|
|
19
|
+
- **Dependency Visualization**: View dependency graphs with critical path highlighting
|
|
20
|
+
- **CLI Commands**: Complete set of commands for collaboration management
|
|
21
|
+
- `kse collab init` - Initialize Master Spec with Sub-Specs
|
|
22
|
+
- `kse collab status` - Display collaboration status and dependency graph
|
|
23
|
+
- `kse collab assign` - Assign Specs to Kiro instances
|
|
24
|
+
- `kse collab verify` - Verify interface contract compliance
|
|
25
|
+
- `kse collab integrate` - Run integration tests across Specs
|
|
26
|
+
- `kse collab migrate` - Convert standalone Spec to collaborative mode
|
|
27
|
+
- **Backward Compatible**: Opt-in system that doesn't affect existing single-Spec workflows
|
|
28
|
+
- **Comprehensive Documentation**: Complete guide with examples and best practices
|
|
29
|
+
|
|
30
|
+
### Technical Details
|
|
31
|
+
- New collaboration managers: MetadataManager, DependencyManager, ContractManager, IntegrationManager, Visualizer
|
|
32
|
+
- Collaboration metadata stored in `.kiro/specs/{spec-name}/collaboration.json`
|
|
33
|
+
- Interface contracts stored in `.kiro/specs/{spec-name}/interfaces/{interface-name}.json`
|
|
34
|
+
- Atomic metadata updates with file locking and retry logic
|
|
35
|
+
- Graph-based dependency analysis with cycle detection
|
|
36
|
+
- Automated interface verification for JavaScript/TypeScript
|
|
37
|
+
- Integration test framework with dependency validation
|
|
38
|
+
- Text and Mermaid format graph visualization
|
|
39
|
+
|
|
10
40
|
## [1.21.1] - 2026-02-01
|
|
11
41
|
|
|
12
42
|
### Fixed
|
package/README.md
CHANGED
|
@@ -279,6 +279,17 @@ Structure your work with Requirements → Design → Tasks workflow
|
|
|
279
279
|
- **Cross-Platform**: Consistent path handling across Windows/Linux/macOS
|
|
280
280
|
- **Smart Exclusions**: Automatically skip common non-repository directories (node_modules, build, etc.)
|
|
281
281
|
|
|
282
|
+
### Spec-Level Collaboration 🚀 NEW in v1.22.0
|
|
283
|
+
- **Parallel Development**: Enable multiple AI instances to work on different Specs simultaneously
|
|
284
|
+
- **Dependency Management**: Define and track dependencies between Specs with circular dependency detection
|
|
285
|
+
- **Interface Contracts**: Formal API definitions ensuring compatibility between independently developed Specs
|
|
286
|
+
- **Status Tracking**: Monitor progress and assignments across all Specs in real-time
|
|
287
|
+
- **Integration Testing**: Run cross-Spec integration tests to verify modules work together
|
|
288
|
+
- **Dependency Visualization**: View dependency graphs with critical path highlighting
|
|
289
|
+
- **Backward Compatible**: Opt-in system that doesn't affect existing single-Spec workflows
|
|
290
|
+
|
|
291
|
+
[Learn more about Spec-Level Collaboration →](docs/spec-collaboration-guide.md)
|
|
292
|
+
|
|
282
293
|
### DevOps Integration Foundation 🚀
|
|
283
294
|
- **Operations Spec Management**: Standardized operations documentation (deployment, monitoring, troubleshooting, etc.)
|
|
284
295
|
- **Progressive AI Autonomy**: L1-L5 takeover levels for gradual AI operations control
|
|
@@ -348,6 +359,14 @@ kse repo init [--nested] # Initialize repository configuration (nested
|
|
|
348
359
|
kse repo init --no-nested # Initialize without nested repository scanning
|
|
349
360
|
kse repo status [--verbose] # Show status of all repositories (including nested)
|
|
350
361
|
kse repo exec "<command>" # Execute command in all repositories
|
|
362
|
+
|
|
363
|
+
# Spec-level collaboration (NEW in v1.22.0)
|
|
364
|
+
kse collab init <master> [options] # Initialize Master Spec with Sub-Specs
|
|
365
|
+
kse collab status [spec] [--graph] # Display collaboration status
|
|
366
|
+
kse collab assign <spec> <kiro> # Assign Spec to Kiro instance
|
|
367
|
+
kse collab verify <spec> # Verify interface contracts
|
|
368
|
+
kse collab integrate <specs...> # Run integration tests
|
|
369
|
+
kse collab migrate <spec> # Convert standalone Spec to collaborative
|
|
351
370
|
kse repo health # Check repository health
|
|
352
371
|
|
|
353
372
|
# DevOps operations
|
package/bin/kiro-spec-engine.js
CHANGED
|
@@ -13,6 +13,7 @@ const upgradeCommand = require('../lib/commands/upgrade');
|
|
|
13
13
|
const rollbackCommand = require('../lib/commands/rollback');
|
|
14
14
|
const watchCommands = require('../lib/commands/watch');
|
|
15
15
|
const workflowsCommand = require('../lib/commands/workflows');
|
|
16
|
+
const registerCollabCommands = require('../lib/commands/collab');
|
|
16
17
|
const VersionChecker = require('../lib/version/version-checker');
|
|
17
18
|
|
|
18
19
|
const i18n = getI18n();
|
|
@@ -551,6 +552,9 @@ repoCmd
|
|
|
551
552
|
await repoCommand.healthRepo(options);
|
|
552
553
|
});
|
|
553
554
|
|
|
555
|
+
// Spec-level collaboration commands
|
|
556
|
+
registerCollabCommands(program);
|
|
557
|
+
|
|
554
558
|
// Template management commands
|
|
555
559
|
const templatesCommand = require('../lib/commands/templates');
|
|
556
560
|
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
# Spec-Level Collaboration Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The Spec-level collaboration system enables multiple AI instances (Kiro) to work on different Specs in parallel within a large project. This guide explains how to use the collaboration features to coordinate parallel development efforts.
|
|
6
|
+
|
|
7
|
+
## Key Concepts
|
|
8
|
+
|
|
9
|
+
### Master Spec and Sub-Specs
|
|
10
|
+
|
|
11
|
+
- **Master Spec**: A high-level Spec that defines the overall feature and breaks it down into multiple Sub-Specs
|
|
12
|
+
- **Sub-Spec**: A child Spec that implements a specific module or component of the Master Spec
|
|
13
|
+
|
|
14
|
+
### Dependencies
|
|
15
|
+
|
|
16
|
+
Specs can depend on other Specs in three ways:
|
|
17
|
+
|
|
18
|
+
- **requires-completion**: The dependent Spec must be fully completed before this Spec can start
|
|
19
|
+
- **requires-interface**: The dependent Spec must have its interface defined (can be in-progress)
|
|
20
|
+
- **optional**: The dependency is optional and doesn't block progress
|
|
21
|
+
|
|
22
|
+
### Interface Contracts
|
|
23
|
+
|
|
24
|
+
Interface contracts formally define the APIs, data structures, and behaviors that a Spec provides or consumes. They ensure compatibility between independently developed Specs.
|
|
25
|
+
|
|
26
|
+
### Kiro Instances
|
|
27
|
+
|
|
28
|
+
A Kiro instance is an AI assistant working on a specific Spec. You can assign Specs to different instances to enable parallel development.
|
|
29
|
+
|
|
30
|
+
## Quick Start
|
|
31
|
+
|
|
32
|
+
### 1. Initialize a Master Spec
|
|
33
|
+
|
|
34
|
+
Create a Master Spec with Sub-Specs:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
kse collab init user-management \
|
|
38
|
+
--sub-specs user-service auth-service session-manager \
|
|
39
|
+
--dependencies "auth-service:user-service" \
|
|
40
|
+
--dependencies "session-manager:auth-service"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
This creates:
|
|
44
|
+
- A Master Spec called `user-management`
|
|
45
|
+
- Three Sub-Specs: `user-service`, `auth-service`, `session-manager`
|
|
46
|
+
- Dependencies: `auth-service` depends on `user-service`, `session-manager` depends on `auth-service`
|
|
47
|
+
|
|
48
|
+
### 2. Check Status
|
|
49
|
+
|
|
50
|
+
View all Specs and their status:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
kse collab status
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
View dependency graph:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
kse collab status --graph
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 3. Assign Specs to Kiro Instances
|
|
63
|
+
|
|
64
|
+
Assign Specs to different AI instances:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
kse collab assign user-service kiro-1
|
|
68
|
+
kse collab assign auth-service kiro-2
|
|
69
|
+
kse collab assign session-manager kiro-3
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 4. Define Interface Contracts
|
|
73
|
+
|
|
74
|
+
Create an interface contract for a Spec (in `.kiro/specs/{spec-name}/interfaces/`):
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"version": "1.0.0",
|
|
79
|
+
"spec": "user-service",
|
|
80
|
+
"interfaces": [
|
|
81
|
+
{
|
|
82
|
+
"name": "UserService",
|
|
83
|
+
"type": "class",
|
|
84
|
+
"exports": [
|
|
85
|
+
{
|
|
86
|
+
"name": "createUser",
|
|
87
|
+
"type": "function",
|
|
88
|
+
"signature": "(userData: UserData) => Promise<User>",
|
|
89
|
+
"required": true
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "getUser",
|
|
93
|
+
"type": "function",
|
|
94
|
+
"signature": "(userId: string) => Promise<User>",
|
|
95
|
+
"required": true
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"types": [
|
|
101
|
+
{
|
|
102
|
+
"name": "UserData",
|
|
103
|
+
"definition": "{ name: string, email: string }"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "User",
|
|
107
|
+
"definition": "{ id: string, name: string, email: string }"
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### 5. Verify Contracts
|
|
114
|
+
|
|
115
|
+
Verify that implementations match contracts:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
kse collab verify user-service
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 6. Run Integration Tests
|
|
122
|
+
|
|
123
|
+
Run integration tests across multiple Specs:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
kse collab integrate user-service auth-service session-manager
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Workflow Example
|
|
130
|
+
|
|
131
|
+
### Scenario: Building a User Management System
|
|
132
|
+
|
|
133
|
+
**Step 1: Architect creates Master Spec**
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
kse collab init user-management \
|
|
137
|
+
--sub-specs database-layer user-service auth-service notification-service \
|
|
138
|
+
--dependencies "user-service:database-layer" \
|
|
139
|
+
--dependencies "auth-service:user-service" \
|
|
140
|
+
--dependencies "notification-service:user-service"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Step 2: Check which Specs are ready**
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
kse collab status
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Output:
|
|
150
|
+
```
|
|
151
|
+
Total Specs: 5
|
|
152
|
+
Ready to Start: 1
|
|
153
|
+
|
|
154
|
+
✓ user-management (unassigned)
|
|
155
|
+
○ database-layer (unassigned)
|
|
156
|
+
○ user-service (unassigned)
|
|
157
|
+
○ auth-service (unassigned)
|
|
158
|
+
○ notification-service (unassigned)
|
|
159
|
+
|
|
160
|
+
Ready to start: database-layer
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**Step 3: Assign and start development**
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
kse collab assign database-layer kiro-1
|
|
167
|
+
kse collab assign user-service kiro-2
|
|
168
|
+
kse collab assign auth-service kiro-3
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**Step 4: Define interfaces**
|
|
172
|
+
|
|
173
|
+
Each Kiro instance defines the interface contract for their Spec.
|
|
174
|
+
|
|
175
|
+
**Step 5: Verify and integrate**
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
kse collab verify database-layer
|
|
179
|
+
kse collab verify user-service
|
|
180
|
+
kse collab integrate database-layer user-service
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Commands Reference
|
|
184
|
+
|
|
185
|
+
### `kse collab init`
|
|
186
|
+
|
|
187
|
+
Initialize a Master Spec with Sub-Specs.
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
kse collab init <master-spec> [options]
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Options:
|
|
194
|
+
- `-s, --sub-specs <specs...>`: Sub-spec names
|
|
195
|
+
- `-d, --dependencies <deps...>`: Dependencies in format "spec:dep1,dep2"
|
|
196
|
+
|
|
197
|
+
### `kse collab status`
|
|
198
|
+
|
|
199
|
+
Display collaboration status.
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
kse collab status [spec-name] [options]
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Options:
|
|
206
|
+
- `-g, --graph`: Show dependency graph
|
|
207
|
+
- `--critical-path`: Highlight critical path in graph
|
|
208
|
+
|
|
209
|
+
### `kse collab assign`
|
|
210
|
+
|
|
211
|
+
Assign a Spec to a Kiro instance.
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
kse collab assign <spec-name> <kiro-instance>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### `kse collab verify`
|
|
218
|
+
|
|
219
|
+
Verify interface contracts for a Spec.
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
kse collab verify <spec-name>
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### `kse collab integrate`
|
|
226
|
+
|
|
227
|
+
Run integration tests across Specs.
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
kse collab integrate <spec-names...>
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### `kse collab migrate`
|
|
234
|
+
|
|
235
|
+
Convert a standalone Spec to collaborative mode.
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
kse collab migrate <spec-name>
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## Best Practices
|
|
242
|
+
|
|
243
|
+
### 1. Clear Interface Contracts
|
|
244
|
+
|
|
245
|
+
Define clear, complete interface contracts before starting implementation. This prevents integration issues later.
|
|
246
|
+
|
|
247
|
+
### 2. Minimal Dependencies
|
|
248
|
+
|
|
249
|
+
Keep dependencies minimal and well-justified. Too many dependencies create bottlenecks.
|
|
250
|
+
|
|
251
|
+
### 3. Regular Verification
|
|
252
|
+
|
|
253
|
+
Run `kse collab verify` frequently to catch interface mismatches early.
|
|
254
|
+
|
|
255
|
+
### 4. Integration Testing
|
|
256
|
+
|
|
257
|
+
Write integration tests that span multiple Specs to verify they work together correctly.
|
|
258
|
+
|
|
259
|
+
### 5. Status Updates
|
|
260
|
+
|
|
261
|
+
Update Spec status regularly so other Kiro instances know when dependencies are ready.
|
|
262
|
+
|
|
263
|
+
### 6. Critical Path Awareness
|
|
264
|
+
|
|
265
|
+
Use `kse collab status --graph --critical-path` to identify bottlenecks and prioritize work.
|
|
266
|
+
|
|
267
|
+
## Troubleshooting
|
|
268
|
+
|
|
269
|
+
### Circular Dependency Detected
|
|
270
|
+
|
|
271
|
+
**Error**: `Circular dependency detected: spec-a → spec-b → spec-c → spec-a`
|
|
272
|
+
|
|
273
|
+
**Solution**: Remove one of the dependencies to break the cycle. Redesign the architecture if necessary.
|
|
274
|
+
|
|
275
|
+
### Interface Mismatch
|
|
276
|
+
|
|
277
|
+
**Error**: `Implementation does not match contract for 'UserService'`
|
|
278
|
+
|
|
279
|
+
**Solution**: Update either the implementation or the contract to match. Run `kse collab verify` to see specific mismatches.
|
|
280
|
+
|
|
281
|
+
### Spec Blocked
|
|
282
|
+
|
|
283
|
+
**Error**: `Cannot assign blocked spec (reason: API key missing)`
|
|
284
|
+
|
|
285
|
+
**Solution**: Resolve the blocking issue first, then reassign the Spec.
|
|
286
|
+
|
|
287
|
+
## Advanced Topics
|
|
288
|
+
|
|
289
|
+
### Hierarchical Structures
|
|
290
|
+
|
|
291
|
+
You can create nested structures with Sub-Sub-Specs:
|
|
292
|
+
|
|
293
|
+
```bash
|
|
294
|
+
kse collab init backend-system --sub-specs api-layer business-logic data-layer
|
|
295
|
+
kse collab init api-layer --sub-specs rest-api graphql-api
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Breaking Changes
|
|
299
|
+
|
|
300
|
+
When you need to make breaking changes to an interface:
|
|
301
|
+
|
|
302
|
+
1. Version the interface (e.g., `UserServiceV2.json`)
|
|
303
|
+
2. Update consumers to use the new version
|
|
304
|
+
3. Run `kse collab verify` to detect breaking changes
|
|
305
|
+
4. Coordinate with affected Kiro instances
|
|
306
|
+
|
|
307
|
+
### Custom Integration Tests
|
|
308
|
+
|
|
309
|
+
Create integration tests in `.kiro/specs/{master-spec}/integration-tests/`:
|
|
310
|
+
|
|
311
|
+
```javascript
|
|
312
|
+
module.exports = {
|
|
313
|
+
name: 'User Authentication Flow',
|
|
314
|
+
specs: ['user-service', 'auth-service'],
|
|
315
|
+
async setup() {
|
|
316
|
+
// Setup test environment
|
|
317
|
+
},
|
|
318
|
+
async test() {
|
|
319
|
+
const userService = require('../../user-service/lib/user-service');
|
|
320
|
+
const authService = require('../../auth-service/lib/auth-service');
|
|
321
|
+
|
|
322
|
+
// Test cross-spec functionality
|
|
323
|
+
const user = await userService.createUser({ name: 'Test', email: 'test@example.com' });
|
|
324
|
+
const token = await authService.login(user.email, 'password');
|
|
325
|
+
assert(token, 'Should receive auth token');
|
|
326
|
+
},
|
|
327
|
+
async teardown() {
|
|
328
|
+
// Cleanup
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
## Metadata File Format
|
|
334
|
+
|
|
335
|
+
Collaboration metadata is stored in `.kiro/specs/{spec-name}/collaboration.json`:
|
|
336
|
+
|
|
337
|
+
```json
|
|
338
|
+
{
|
|
339
|
+
"version": "1.0.0",
|
|
340
|
+
"type": "master" | "sub",
|
|
341
|
+
"masterSpec": "parent-spec-name",
|
|
342
|
+
"subSpecs": ["child-1", "child-2"],
|
|
343
|
+
"dependencies": [
|
|
344
|
+
{
|
|
345
|
+
"spec": "other-spec",
|
|
346
|
+
"type": "requires-completion",
|
|
347
|
+
"reason": "Needs database schema"
|
|
348
|
+
}
|
|
349
|
+
],
|
|
350
|
+
"assignment": {
|
|
351
|
+
"kiroInstance": "kiro-1",
|
|
352
|
+
"assignedAt": "2026-02-01T10:00:00Z"
|
|
353
|
+
},
|
|
354
|
+
"status": {
|
|
355
|
+
"current": "in-progress",
|
|
356
|
+
"updatedAt": "2026-02-01T10:00:00Z"
|
|
357
|
+
},
|
|
358
|
+
"interfaces": {
|
|
359
|
+
"provides": ["UserService.json"],
|
|
360
|
+
"consumes": ["other-spec/interfaces/DatabaseService.json"]
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
## See Also
|
|
366
|
+
|
|
367
|
+
- [Spec Workflow Guide](../README.md)
|
|
368
|
+
- [Multi-Repository Management](multi-repo-management-guide.md)
|
|
369
|
+
- [Environment Management](environment-management-guide.md)
|