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,313 @@
|
|
|
1
|
+
# kse 集成哲学
|
|
2
|
+
|
|
3
|
+
> kse 如何与 AI 编码工具配合工作
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 核心定位
|
|
8
|
+
|
|
9
|
+
**kse 不是替代 AI 工具,而是增强 AI 工具**
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
┌─────────────────────────────────────┐
|
|
13
|
+
│ AI 编码工具 │
|
|
14
|
+
│ (Codex/Claude/Cursor/Windsurf) │
|
|
15
|
+
│ │
|
|
16
|
+
│ 用户主要工作界面 ← 这里写代码 │
|
|
17
|
+
└──────────────┬──────────────────────┘
|
|
18
|
+
│
|
|
19
|
+
│ 读取上下文
|
|
20
|
+
▼
|
|
21
|
+
┌─────────────────────────────────────┐
|
|
22
|
+
│ kse │
|
|
23
|
+
│ │
|
|
24
|
+
│ Spec 管理 + 上下文生成 │
|
|
25
|
+
│ (后台运行,提供结构化信息) │
|
|
26
|
+
└─────────────────────────────────────┘
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## 三种集成模式
|
|
32
|
+
|
|
33
|
+
### 模式 1:AI 主动调用 kse(最佳)⭐
|
|
34
|
+
|
|
35
|
+
**适用工具**:Windsurf、Cline、Aider(可执行命令的 AI)
|
|
36
|
+
|
|
37
|
+
**工作流**:
|
|
38
|
+
```
|
|
39
|
+
用户 → AI 工具 → AI 自动执行 kse 命令 → 获取上下文 → 生成代码
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**示例对话**:
|
|
43
|
+
```
|
|
44
|
+
用户:我要实现用户登录功能
|
|
45
|
+
|
|
46
|
+
AI:好的,让我先查看项目的 Spec
|
|
47
|
+
[自动执行] kse context export 01-00-user-login
|
|
48
|
+
[读取文件] .kiro/specs/01-00-user-login/context-export.md
|
|
49
|
+
|
|
50
|
+
我看到设计文档中定义了 AuthController...
|
|
51
|
+
[生成代码]
|
|
52
|
+
|
|
53
|
+
[自动执行] kse task claim 01-00-user-login 1.1
|
|
54
|
+
任务已认领,开始实现...
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**配置方法**:
|
|
58
|
+
|
|
59
|
+
在 AI 工具的系统提示中添加:
|
|
60
|
+
```markdown
|
|
61
|
+
你可以使用以下 kse 命令来管理项目:
|
|
62
|
+
|
|
63
|
+
- `kse context export <spec-name>` - 导出 Spec 上下文
|
|
64
|
+
- `kse prompt generate <spec-name> <task-id>` - 生成任务提示
|
|
65
|
+
- `kse task claim <spec-name> <task-id>` - 认领任务
|
|
66
|
+
- `kse status` - 查看项目状态
|
|
67
|
+
|
|
68
|
+
在实现功能前,先用 kse 命令查看相关 Spec。
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**优势**:
|
|
72
|
+
- ✅ 完全自动化
|
|
73
|
+
- ✅ 用户无需手动操作
|
|
74
|
+
- ✅ AI 自动管理 Spec 生命周期
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
### 模式 2:手动导出 + AI 使用(当前)
|
|
79
|
+
|
|
80
|
+
**适用工具**:Claude Code、ChatGPT、GitHub Copilot
|
|
81
|
+
|
|
82
|
+
**工作流**:
|
|
83
|
+
```
|
|
84
|
+
用户 → 手动执行 kse 命令 → 复制上下文 → 粘贴到 AI → AI 生成代码
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**示例流程**:
|
|
88
|
+
```bash
|
|
89
|
+
# 1. 用户手动导出
|
|
90
|
+
kse context export 01-00-user-login
|
|
91
|
+
|
|
92
|
+
# 2. 复制内容
|
|
93
|
+
cat .kiro/specs/01-00-user-login/context-export.md | pbcopy
|
|
94
|
+
|
|
95
|
+
# 3. 粘贴到 Claude/ChatGPT
|
|
96
|
+
|
|
97
|
+
# 4. 对话
|
|
98
|
+
用户:请实现任务 1.1
|
|
99
|
+
AI:[生成代码]
|
|
100
|
+
|
|
101
|
+
# 5. 手动更新任务状态
|
|
102
|
+
# 编辑 tasks.md: - [x] 1.1 ...
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**改进建议**:
|
|
106
|
+
```bash
|
|
107
|
+
# 添加快捷命令
|
|
108
|
+
kse clip 01-00-user-login # 自动复制到剪贴板
|
|
109
|
+
kse clip 01-00-user-login 1.1 # 只复制任务 1.1 的上下文
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**优势**:
|
|
113
|
+
- ✅ 适用于所有 AI 工具
|
|
114
|
+
- ✅ 用户完全控制
|
|
115
|
+
|
|
116
|
+
**劣势**:
|
|
117
|
+
- ❌ 需要手动操作
|
|
118
|
+
- ❌ 步骤较多
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
### 模式 3:Watch Mode 自动化(进阶)
|
|
123
|
+
|
|
124
|
+
**适用场景**:频繁修改 Spec 的项目
|
|
125
|
+
|
|
126
|
+
**工作流**:
|
|
127
|
+
```
|
|
128
|
+
用户修改 Spec → kse 自动检测 → 自动重新导出 → AI 工具自动刷新
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**配置**:
|
|
132
|
+
```bash
|
|
133
|
+
# 启动 Watch Mode
|
|
134
|
+
kse watch init
|
|
135
|
+
kse watch install auto-export
|
|
136
|
+
kse watch start
|
|
137
|
+
|
|
138
|
+
# 现在修改任何 Spec 文件,都会自动重新导出
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Watch 配置示例**:
|
|
142
|
+
```json
|
|
143
|
+
{
|
|
144
|
+
"patterns": [
|
|
145
|
+
".kiro/specs/**/requirements.md",
|
|
146
|
+
".kiro/specs/**/design.md",
|
|
147
|
+
".kiro/specs/**/tasks.md"
|
|
148
|
+
],
|
|
149
|
+
"actions": [
|
|
150
|
+
{
|
|
151
|
+
"name": "auto-export",
|
|
152
|
+
"command": "kse context export ${spec-name}"
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**优势**:
|
|
159
|
+
- ✅ 完全自动化
|
|
160
|
+
- ✅ Spec 修改立即生效
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 推荐配置
|
|
165
|
+
|
|
166
|
+
### 对于 Windsurf/Cline 用户(推荐)⭐
|
|
167
|
+
|
|
168
|
+
**在 AI 系统提示中添加**:
|
|
169
|
+
|
|
170
|
+
```markdown
|
|
171
|
+
# Spec 管理规则
|
|
172
|
+
|
|
173
|
+
项目使用 kse (Kiro Spec Engine) 管理需求和设计。
|
|
174
|
+
|
|
175
|
+
## 工作流程
|
|
176
|
+
|
|
177
|
+
1. **查看 Spec**:实现功能前,先执行 `kse context export <spec-name>` 查看设计
|
|
178
|
+
2. **认领任务**:开始工作前,执行 `kse task claim <spec-name> <task-id>`
|
|
179
|
+
3. **实现代码**:严格按照 Spec 中的设计实现
|
|
180
|
+
4. **更新状态**:完成后,在 tasks.md 中标记任务为完成 `[x]`
|
|
181
|
+
|
|
182
|
+
## 可用命令
|
|
183
|
+
|
|
184
|
+
- `kse status` - 查看项目状态
|
|
185
|
+
- `kse context export <spec-name>` - 导出 Spec 上下文
|
|
186
|
+
- `kse task claim <spec-name> <task-id>` - 认领任务
|
|
187
|
+
- `kse prompt generate <spec-name> <task-id>` - 生成任务提示
|
|
188
|
+
|
|
189
|
+
## 示例
|
|
190
|
+
|
|
191
|
+
用户说:"实现用户登录"
|
|
192
|
+
你应该:
|
|
193
|
+
1. 执行 `kse context export 01-00-user-login`
|
|
194
|
+
2. 读取导出的上下文
|
|
195
|
+
3. 根据设计文档实现代码
|
|
196
|
+
4. 执行 `kse task claim 01-00-user-login 1.1`
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### 对于 Claude/ChatGPT 用户
|
|
200
|
+
|
|
201
|
+
**创建快捷脚本**:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
# ~/.bashrc 或 ~/.zshrc
|
|
205
|
+
alias kse-clip='kse context export $1 && cat .kiro/specs/$1/context-export.md | pbcopy && echo "✅ 已复制到剪贴板"'
|
|
206
|
+
|
|
207
|
+
# 使用
|
|
208
|
+
kse-clip 01-00-user-login
|
|
209
|
+
# 然后直接粘贴到 Claude
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### 对于 Cursor 用户
|
|
213
|
+
|
|
214
|
+
**使用 Cursor Rules**:
|
|
215
|
+
|
|
216
|
+
创建 `.cursorrules` 文件:
|
|
217
|
+
```markdown
|
|
218
|
+
# Spec 驱动开发
|
|
219
|
+
|
|
220
|
+
项目使用 kse 管理 Spec。实现功能前:
|
|
221
|
+
|
|
222
|
+
1. 查看 `.kiro/specs/<spec-name>/design.md`
|
|
223
|
+
2. 按照设计实现
|
|
224
|
+
3. 更新 `.kiro/specs/<spec-name>/tasks.md`
|
|
225
|
+
|
|
226
|
+
示例:
|
|
227
|
+
- 设计文档:`.kiro/specs/01-00-user-login/design.md`
|
|
228
|
+
- 任务列表:`.kiro/specs/01-00-user-login/tasks.md`
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## 未来改进方向
|
|
234
|
+
|
|
235
|
+
### 1. MCP (Model Context Protocol) 集成
|
|
236
|
+
|
|
237
|
+
让 AI 工具通过 MCP 直接访问 kse:
|
|
238
|
+
|
|
239
|
+
```javascript
|
|
240
|
+
// AI 工具可以直接调用
|
|
241
|
+
const context = await mcp.call('kse.getContext', '01-00-user-login');
|
|
242
|
+
const tasks = await mcp.call('kse.getTasks', '01-00-user-login');
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### 2. IDE 插件
|
|
246
|
+
|
|
247
|
+
为主流 IDE 提供插件:
|
|
248
|
+
- VS Code Extension
|
|
249
|
+
- Cursor Extension
|
|
250
|
+
- JetBrains Plugin
|
|
251
|
+
|
|
252
|
+
功能:
|
|
253
|
+
- 右键菜单:"导出到 AI 工具"
|
|
254
|
+
- 状态栏显示当前 Spec
|
|
255
|
+
- 快捷键快速导出
|
|
256
|
+
|
|
257
|
+
### 3. Web Dashboard
|
|
258
|
+
|
|
259
|
+
提供 Web 界面:
|
|
260
|
+
```bash
|
|
261
|
+
kse serve
|
|
262
|
+
# 打开 http://localhost:3000
|
|
263
|
+
# 可视化管理 Spec,一键复制上下文
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## 常见问题
|
|
269
|
+
|
|
270
|
+
### Q: 为什么不把 kse 做成 AI 工具的插件?
|
|
271
|
+
|
|
272
|
+
**A**:
|
|
273
|
+
- kse 是**通用工具**,支持所有 AI 工具
|
|
274
|
+
- 做成插件会限制在特定工具
|
|
275
|
+
- CLI 工具更灵活,可以被任何工具调用
|
|
276
|
+
|
|
277
|
+
### Q: 能否让 AI 工具自动读取 .kiro/ 目录?
|
|
278
|
+
|
|
279
|
+
**A**:
|
|
280
|
+
- 部分工具支持(Cursor、Copilot)
|
|
281
|
+
- 但需要明确的上下文导出更可靠
|
|
282
|
+
- kse 的价值在于**结构化和格式化**上下文
|
|
283
|
+
|
|
284
|
+
### Q: 两套工具确实有点麻烦,有更简单的方案吗?
|
|
285
|
+
|
|
286
|
+
**A**:
|
|
287
|
+
- **短期**:使用 Windsurf/Cline,让 AI 自动调用 kse
|
|
288
|
+
- **中期**:使用快捷脚本(如 `kse-clip`)
|
|
289
|
+
- **长期**:MCP 集成,完全无缝
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## 总结
|
|
294
|
+
|
|
295
|
+
**kse 的定位**:
|
|
296
|
+
- ❌ 不是独立的开发工具
|
|
297
|
+
- ❌ 不是 AI 工具的竞争对手
|
|
298
|
+
- ✅ 是 AI 工具的**上下文提供者**
|
|
299
|
+
- ✅ 是项目的**Spec 管理系统**
|
|
300
|
+
|
|
301
|
+
**最佳实践**:
|
|
302
|
+
1. **用 kse 管理 Spec**(需求、设计、任务)
|
|
303
|
+
2. **用 AI 工具写代码**(主要工作界面)
|
|
304
|
+
3. **让 AI 工具调用 kse**(自动化集成)
|
|
305
|
+
|
|
306
|
+
**选择合适的模式**:
|
|
307
|
+
- 能执行命令的 AI → 模式 1(AI 主动调用)⭐
|
|
308
|
+
- 不能执行命令的 AI → 模式 2(手动导出)
|
|
309
|
+
- 频繁修改 Spec → 模式 3(Watch Mode)
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
**记住**:kse 是幕后英雄,AI 工具是前台明星。两者配合,才能发挥最大价值!🚀
|
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
# Manual Workflows Guide
|
|
2
|
+
|
|
3
|
+
> Complete guide for manual workflows when automation is not available
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
This guide provides step-by-step instructions for common workflows when using kiro-spec-engine without automation (watch mode or agent hooks). These workflows are designed to be efficient and easy to follow.
|
|
10
|
+
|
|
11
|
+
**When to use manual workflows:**
|
|
12
|
+
- When automation is not set up
|
|
13
|
+
- When working in environments without watch mode support
|
|
14
|
+
- When you prefer manual control over automation
|
|
15
|
+
- For one-off tasks or testing
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Table of Contents
|
|
20
|
+
|
|
21
|
+
1. [Task Sync Workflow](#task-sync-workflow)
|
|
22
|
+
2. [Context Export Workflow](#context-export-workflow)
|
|
23
|
+
3. [Prompt Generation Workflow](#prompt-generation-workflow)
|
|
24
|
+
4. [Workflow Checklists](#workflow-checklists)
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Task Sync Workflow
|
|
29
|
+
|
|
30
|
+
### Purpose
|
|
31
|
+
Keep your workspace synchronized with task progress across multiple users or tools.
|
|
32
|
+
|
|
33
|
+
### Time Estimate
|
|
34
|
+
- Initial sync: 2-3 minutes
|
|
35
|
+
- Subsequent syncs: 30-60 seconds
|
|
36
|
+
|
|
37
|
+
### Prerequisites
|
|
38
|
+
- Project adopted with kiro-spec-engine
|
|
39
|
+
- Active spec with tasks.md file
|
|
40
|
+
- Write access to .kiro/specs/ directory
|
|
41
|
+
|
|
42
|
+
### Step-by-Step Instructions
|
|
43
|
+
|
|
44
|
+
#### 1. Check Current Status
|
|
45
|
+
```bash
|
|
46
|
+
kse status
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**What to look for:**
|
|
50
|
+
- Current spec name
|
|
51
|
+
- Number of tasks (total, completed, in progress)
|
|
52
|
+
- Last sync timestamp
|
|
53
|
+
|
|
54
|
+
**Time:** ~5 seconds
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
#### 2. Review Task Changes
|
|
59
|
+
Open your spec's `tasks.md` file and review:
|
|
60
|
+
- Tasks you've completed (mark with `[x]`)
|
|
61
|
+
- Tasks you're working on (mark with `[-]`)
|
|
62
|
+
- Tasks you've queued (mark with `[~]`)
|
|
63
|
+
|
|
64
|
+
**Example:**
|
|
65
|
+
```markdown
|
|
66
|
+
- [x] 1.1 Completed task
|
|
67
|
+
- [-] 1.2 In progress task
|
|
68
|
+
- [~] 1.3 Queued task
|
|
69
|
+
- [ ] 1.4 Not started task
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Time:** ~30-60 seconds
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
#### 3. Sync Workspace
|
|
77
|
+
```bash
|
|
78
|
+
kse workspace sync
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**What this does:**
|
|
82
|
+
- Updates workspace metadata
|
|
83
|
+
- Synchronizes task status
|
|
84
|
+
- Detects conflicts
|
|
85
|
+
- Updates timestamps
|
|
86
|
+
|
|
87
|
+
**Time:** ~10-15 seconds
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
#### 4. Verify Sync
|
|
92
|
+
```bash
|
|
93
|
+
kse status
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Verify:**
|
|
97
|
+
- Task counts are updated
|
|
98
|
+
- Sync timestamp is current
|
|
99
|
+
- No conflicts reported
|
|
100
|
+
|
|
101
|
+
**Time:** ~5 seconds
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
### Best Practices
|
|
106
|
+
|
|
107
|
+
1. **Sync Frequency**
|
|
108
|
+
- Before starting work: Always sync first
|
|
109
|
+
- After completing tasks: Sync immediately
|
|
110
|
+
- During long sessions: Sync every 30-60 minutes
|
|
111
|
+
|
|
112
|
+
2. **Conflict Resolution**
|
|
113
|
+
- If conflicts detected, review both versions
|
|
114
|
+
- Keep the most recent accurate state
|
|
115
|
+
- Document resolution in commit message
|
|
116
|
+
|
|
117
|
+
3. **Team Coordination**
|
|
118
|
+
- Communicate task claims in team chat
|
|
119
|
+
- Use task claiming feature: `kse task claim <spec> <task-id>`
|
|
120
|
+
- Check for claimed tasks before starting work
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Context Export Workflow
|
|
125
|
+
|
|
126
|
+
### Purpose
|
|
127
|
+
Export spec context for sharing with AI assistants or team members.
|
|
128
|
+
|
|
129
|
+
### Time Estimate
|
|
130
|
+
- Single spec export: 15-30 seconds
|
|
131
|
+
- With steering rules: 30-45 seconds
|
|
132
|
+
|
|
133
|
+
### Prerequisites
|
|
134
|
+
- Active spec with requirements, design, and tasks
|
|
135
|
+
- Optional: Steering rules configured
|
|
136
|
+
|
|
137
|
+
### Step-by-Step Instructions
|
|
138
|
+
|
|
139
|
+
#### 1. Identify Spec to Export
|
|
140
|
+
```bash
|
|
141
|
+
kse status
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Note the spec name you want to export.
|
|
145
|
+
|
|
146
|
+
**Time:** ~5 seconds
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
#### 2. Export Context
|
|
151
|
+
```bash
|
|
152
|
+
kse context export <spec-name>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Options:**
|
|
156
|
+
- `--include-steering`: Include steering rules
|
|
157
|
+
- `--steering-files <files>`: Specific steering files (comma-separated)
|
|
158
|
+
- `--output <path>`: Custom output path
|
|
159
|
+
|
|
160
|
+
**Example:**
|
|
161
|
+
```bash
|
|
162
|
+
kse context export my-feature --include-steering --steering-files CORE_PRINCIPLES.md,ENVIRONMENT.md
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**Time:** ~10-20 seconds
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
#### 3. Locate Export File
|
|
170
|
+
The export is saved to:
|
|
171
|
+
```
|
|
172
|
+
.kiro/specs/<spec-name>/context-export.md
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Time:** ~5 seconds
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
#### 4. Use Exported Context
|
|
180
|
+
- Copy content to AI assistant
|
|
181
|
+
- Share with team members
|
|
182
|
+
- Use as documentation reference
|
|
183
|
+
- Include in project handoff
|
|
184
|
+
|
|
185
|
+
**Time:** Varies by use case
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
### Best Practices
|
|
190
|
+
|
|
191
|
+
1. **When to Export**
|
|
192
|
+
- Before starting a new task
|
|
193
|
+
- When asking for AI assistance
|
|
194
|
+
- For project documentation
|
|
195
|
+
- During team handoffs
|
|
196
|
+
|
|
197
|
+
2. **What to Include**
|
|
198
|
+
- Always: requirements, design, tasks
|
|
199
|
+
- Usually: core steering rules
|
|
200
|
+
- Sometimes: environment-specific rules
|
|
201
|
+
- Rarely: all steering rules (too verbose)
|
|
202
|
+
|
|
203
|
+
3. **Export Management**
|
|
204
|
+
- Exports are regenerated each time
|
|
205
|
+
- Old exports are overwritten
|
|
206
|
+
- Consider versioning important exports
|
|
207
|
+
- Clean up old exports periodically
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Prompt Generation Workflow
|
|
212
|
+
|
|
213
|
+
### Purpose
|
|
214
|
+
Generate AI prompts for specific tasks with relevant context.
|
|
215
|
+
|
|
216
|
+
### Time Estimate
|
|
217
|
+
- Single task prompt: 20-30 seconds
|
|
218
|
+
- Batch generation: 1-2 minutes per 10 tasks
|
|
219
|
+
|
|
220
|
+
### Prerequisites
|
|
221
|
+
- Active spec with tasks
|
|
222
|
+
- Task IDs identified
|
|
223
|
+
- Requirements and design documents complete
|
|
224
|
+
|
|
225
|
+
### Step-by-Step Instructions
|
|
226
|
+
|
|
227
|
+
#### 1. Identify Task
|
|
228
|
+
Review tasks.md and note the task ID:
|
|
229
|
+
```bash
|
|
230
|
+
cat .kiro/specs/<spec-name>/tasks.md
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
**Example task ID:** `1.2` or `3.1.1`
|
|
234
|
+
|
|
235
|
+
**Time:** ~10-15 seconds
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
#### 2. Generate Prompt
|
|
240
|
+
```bash
|
|
241
|
+
kse prompt generate <spec-name> <task-id>
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
**Options:**
|
|
245
|
+
- `--target <tool>`: Target tool (kiro, vscode, cursor, other)
|
|
246
|
+
- `--output <path>`: Custom output path
|
|
247
|
+
|
|
248
|
+
**Example:**
|
|
249
|
+
```bash
|
|
250
|
+
kse prompt generate my-feature 1.2 --target vscode
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Time:** ~10-15 seconds
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
#### 3. Locate Generated Prompt
|
|
258
|
+
The prompt is saved to:
|
|
259
|
+
```
|
|
260
|
+
.kiro/specs/<spec-name>/prompts/task-<task-id>.md
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
**Time:** ~5 seconds
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
#### 4. Use Generated Prompt
|
|
268
|
+
- Copy to AI assistant
|
|
269
|
+
- Review for accuracy
|
|
270
|
+
- Customize if needed
|
|
271
|
+
- Execute task based on prompt
|
|
272
|
+
|
|
273
|
+
**Time:** Varies by task complexity
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
### Batch Operations
|
|
278
|
+
|
|
279
|
+
For multiple tasks:
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
# Generate prompts for all incomplete tasks
|
|
283
|
+
for task in 1.1 1.2 1.3; do
|
|
284
|
+
kse prompt generate my-feature $task
|
|
285
|
+
done
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
**Time:** ~20-30 seconds per task
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
### Best Practices
|
|
293
|
+
|
|
294
|
+
1. **Prompt Quality**
|
|
295
|
+
- Review generated prompts before use
|
|
296
|
+
- Customize for specific context
|
|
297
|
+
- Add tool-specific instructions
|
|
298
|
+
- Include relevant examples
|
|
299
|
+
|
|
300
|
+
2. **Prompt Organization**
|
|
301
|
+
- Keep prompts in spec directory
|
|
302
|
+
- Use consistent naming
|
|
303
|
+
- Version control prompts
|
|
304
|
+
- Clean up after task completion
|
|
305
|
+
|
|
306
|
+
3. **Optimization Tips**
|
|
307
|
+
- Generate prompts in batches
|
|
308
|
+
- Reuse prompts for similar tasks
|
|
309
|
+
- Template common patterns
|
|
310
|
+
- Document customizations
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## Workflow Checklists
|
|
315
|
+
|
|
316
|
+
### Daily Workflow Checklist
|
|
317
|
+
|
|
318
|
+
**Morning (Start of Work)**
|
|
319
|
+
- [ ] Sync workspace: `kse workspace sync`
|
|
320
|
+
- [ ] Check status: `kse status`
|
|
321
|
+
- [ ] Review task list
|
|
322
|
+
- [ ] Claim tasks you'll work on
|
|
323
|
+
- [ ] Export context for active tasks
|
|
324
|
+
|
|
325
|
+
**During Work**
|
|
326
|
+
- [ ] Update task status as you progress
|
|
327
|
+
- [ ] Sync every 30-60 minutes
|
|
328
|
+
- [ ] Export context when asking for help
|
|
329
|
+
- [ ] Generate prompts for new tasks
|
|
330
|
+
|
|
331
|
+
**End of Day**
|
|
332
|
+
- [ ] Mark completed tasks
|
|
333
|
+
- [ ] Update in-progress tasks
|
|
334
|
+
- [ ] Final sync: `kse workspace sync`
|
|
335
|
+
- [ ] Commit changes to version control
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
### Task Completion Checklist
|
|
340
|
+
|
|
341
|
+
- [ ] Review task requirements
|
|
342
|
+
- [ ] Generate task prompt
|
|
343
|
+
- [ ] Export context if needed
|
|
344
|
+
- [ ] Complete implementation
|
|
345
|
+
- [ ] Run tests
|
|
346
|
+
- [ ] Update task status to completed
|
|
347
|
+
- [ ] Sync workspace
|
|
348
|
+
- [ ] Commit changes
|
|
349
|
+
|
|
350
|
+
---
|
|
351
|
+
|
|
352
|
+
### Spec Creation Checklist
|
|
353
|
+
|
|
354
|
+
- [ ] Create spec: `kse create-spec <name>`
|
|
355
|
+
- [ ] Write requirements.md
|
|
356
|
+
- [ ] Write design.md
|
|
357
|
+
- [ ] Generate tasks.md
|
|
358
|
+
- [ ] Export initial context
|
|
359
|
+
- [ ] Generate prompts for first tasks
|
|
360
|
+
- [ ] Sync workspace
|
|
361
|
+
- [ ] Begin implementation
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
365
|
+
## Time Estimates Summary
|
|
366
|
+
|
|
367
|
+
| Workflow | Time Estimate |
|
|
368
|
+
|----------|---------------|
|
|
369
|
+
| Task Sync | 30-60 seconds |
|
|
370
|
+
| Context Export | 15-45 seconds |
|
|
371
|
+
| Prompt Generation | 20-30 seconds |
|
|
372
|
+
| Daily Sync Routine | 2-3 minutes |
|
|
373
|
+
| Full Spec Setup | 10-15 minutes |
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
## Troubleshooting
|
|
378
|
+
|
|
379
|
+
### Common Issues
|
|
380
|
+
|
|
381
|
+
**Issue: Sync conflicts**
|
|
382
|
+
- **Solution:** Review both versions, keep most recent
|
|
383
|
+
- **Prevention:** Sync more frequently
|
|
384
|
+
|
|
385
|
+
**Issue: Export fails**
|
|
386
|
+
- **Solution:** Check spec exists, files are readable
|
|
387
|
+
- **Prevention:** Verify spec structure before export
|
|
388
|
+
|
|
389
|
+
**Issue: Prompt generation incomplete**
|
|
390
|
+
- **Solution:** Ensure requirements and design are complete
|
|
391
|
+
- **Prevention:** Complete docs before generating prompts
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
## Next Steps
|
|
396
|
+
|
|
397
|
+
1. **Set Up Automation:** Consider using watch mode for automatic workflows
|
|
398
|
+
```bash
|
|
399
|
+
kse watch init
|
|
400
|
+
kse watch install auto-sync
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
2. **Learn More:**
|
|
404
|
+
- [Watch Mode Guide](./watch-mode-guide.md)
|
|
405
|
+
- [Cross-Tool Guide](./cross-tool-guide.md)
|
|
406
|
+
- [Architecture](./architecture.md)
|
|
407
|
+
|
|
408
|
+
3. **Get Help:**
|
|
409
|
+
- Run `kse --help` for command reference
|
|
410
|
+
- Check [GitHub Issues](https://github.com/heguangyong/kiro-spec-engine/issues)
|
|
411
|
+
- Review [Contributing Guide](../CONTRIBUTING.md)
|
|
412
|
+
|
|
413
|
+
---
|
|
414
|
+
|
|
415
|
+
**Version:** 1.0
|
|
416
|
+
**Last Updated:** 2026-01-23
|
|
417
|
+
**Spec:** 05-00-agent-hooks-and-automation
|