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.
Files changed (78) hide show
  1. package/CHANGELOG.md +135 -0
  2. package/README.md +239 -213
  3. package/README.zh.md +0 -330
  4. package/bin/kiro-spec-engine.js +62 -0
  5. package/docs/README.md +223 -0
  6. package/docs/agent-hooks-analysis.md +815 -0
  7. package/docs/command-reference.md +252 -0
  8. package/docs/cross-tool-guide.md +554 -0
  9. package/docs/examples/add-export-command/design.md +194 -0
  10. package/docs/examples/add-export-command/requirements.md +110 -0
  11. package/docs/examples/add-export-command/tasks.md +88 -0
  12. package/docs/examples/add-rest-api/design.md +855 -0
  13. package/docs/examples/add-rest-api/requirements.md +323 -0
  14. package/docs/examples/add-rest-api/tasks.md +355 -0
  15. package/docs/examples/add-user-dashboard/design.md +192 -0
  16. package/docs/examples/add-user-dashboard/requirements.md +143 -0
  17. package/docs/examples/add-user-dashboard/tasks.md +91 -0
  18. package/docs/faq.md +696 -0
  19. package/docs/integration-modes.md +525 -0
  20. package/docs/integration-philosophy.md +313 -0
  21. package/docs/manual-workflows-guide.md +417 -0
  22. package/docs/quick-start-with-ai-tools.md +374 -0
  23. package/docs/quick-start.md +711 -0
  24. package/docs/spec-workflow.md +453 -0
  25. package/docs/steering-strategy-guide.md +196 -0
  26. package/docs/tools/claude-guide.md +653 -0
  27. package/docs/tools/cursor-guide.md +705 -0
  28. package/docs/tools/generic-guide.md +445 -0
  29. package/docs/tools/kiro-guide.md +308 -0
  30. package/docs/tools/vscode-guide.md +444 -0
  31. package/docs/tools/windsurf-guide.md +390 -0
  32. package/docs/troubleshooting.md +795 -0
  33. package/docs/zh/README.md +275 -0
  34. package/docs/zh/quick-start.md +711 -0
  35. package/docs/zh/tools/claude-guide.md +348 -0
  36. package/docs/zh/tools/cursor-guide.md +280 -0
  37. package/docs/zh/tools/generic-guide.md +498 -0
  38. package/docs/zh/tools/kiro-guide.md +342 -0
  39. package/docs/zh/tools/vscode-guide.md +448 -0
  40. package/docs/zh/tools/windsurf-guide.md +377 -0
  41. package/lib/adoption/detection-engine.js +14 -4
  42. package/lib/commands/adopt.js +117 -3
  43. package/lib/commands/context.js +99 -0
  44. package/lib/commands/prompt.js +105 -0
  45. package/lib/commands/status.js +225 -0
  46. package/lib/commands/task.js +199 -0
  47. package/lib/commands/watch.js +569 -0
  48. package/lib/commands/workflows.js +240 -0
  49. package/lib/commands/workspace.js +189 -0
  50. package/lib/context/context-exporter.js +378 -0
  51. package/lib/context/prompt-generator.js +482 -0
  52. package/lib/steering/adoption-config.js +164 -0
  53. package/lib/steering/steering-manager.js +289 -0
  54. package/lib/task/task-claimer.js +430 -0
  55. package/lib/utils/tool-detector.js +383 -0
  56. package/lib/watch/action-executor.js +458 -0
  57. package/lib/watch/event-debouncer.js +323 -0
  58. package/lib/watch/execution-logger.js +550 -0
  59. package/lib/watch/file-watcher.js +499 -0
  60. package/lib/watch/presets.js +266 -0
  61. package/lib/watch/watch-manager.js +533 -0
  62. package/lib/workspace/workspace-manager.js +370 -0
  63. package/lib/workspace/workspace-sync.js +356 -0
  64. package/package.json +3 -1
  65. package/template/.kiro/tools/backup_manager.py +295 -0
  66. package/template/.kiro/tools/configuration_manager.py +218 -0
  67. package/template/.kiro/tools/document_evaluator.py +550 -0
  68. package/template/.kiro/tools/enhancement_logger.py +168 -0
  69. package/template/.kiro/tools/error_handler.py +335 -0
  70. package/template/.kiro/tools/improvement_identifier.py +444 -0
  71. package/template/.kiro/tools/modification_applicator.py +737 -0
  72. package/template/.kiro/tools/quality_gate_enforcer.py +207 -0
  73. package/template/.kiro/tools/quality_scorer.py +305 -0
  74. package/template/.kiro/tools/report_generator.py +154 -0
  75. package/template/.kiro/tools/ultrawork_enhancer_refactored.py +0 -0
  76. package/template/.kiro/tools/ultrawork_enhancer_v2.py +463 -0
  77. package/template/.kiro/tools/ultrawork_enhancer_v3.py +606 -0
  78. package/template/.kiro/tools/workflow_quality_gate.py +100 -0
@@ -0,0 +1,192 @@
1
+ # User Dashboard - Design
2
+
3
+ > Technical design for React dashboard feature
4
+
5
+ ---
6
+
7
+ **Version**: 1.0.0
8
+ **Last Updated**: 2026-01-23
9
+
10
+ ---
11
+
12
+ ## Architecture
13
+
14
+ **Pattern:** Container/Presentational Components
15
+ **State Management:** React Context + Hooks
16
+ **Styling:** CSS Modules
17
+ **Charts:** Recharts library
18
+
19
+ ---
20
+
21
+ ## Component Design
22
+
23
+ ### Dashboard (Container)
24
+ **File:** `src/pages/Dashboard.jsx`
25
+
26
+ **Responsibilities:**
27
+ - Fetch dashboard data
28
+ - Manage loading/error states
29
+ - Compose child components
30
+
31
+ **State:**
32
+ ```javascript
33
+ {
34
+ metrics: { total, completed, inProgress, pending },
35
+ chartData: [{ date, count }],
36
+ recentTasks: [{ id, title, status, date }],
37
+ loading: boolean,
38
+ error: string | null
39
+ }
40
+ ```
41
+
42
+ ---
43
+
44
+ ### MetricCard (Presentational)
45
+ **File:** `src/components/MetricCard.jsx`
46
+
47
+ **Props:**
48
+ ```javascript
49
+ {
50
+ title: string,
51
+ value: number,
52
+ change: number, // percentage
53
+ icon: ReactNode
54
+ }
55
+ ```
56
+
57
+ **Renders:**
58
+ - Card container
59
+ - Icon
60
+ - Title
61
+ - Value (large text)
62
+ - Change indicator (↑/↓ with color)
63
+
64
+ ---
65
+
66
+ ### TaskCompletionChart (Presentational)
67
+ **File:** `src/components/TaskCompletionChart.jsx`
68
+
69
+ **Props:**
70
+ ```javascript
71
+ {
72
+ data: [{ date: string, count: number }]
73
+ }
74
+ ```
75
+
76
+ **Implementation:**
77
+ - Use Recharts LineChart
78
+ - Format dates on X-axis
79
+ - Show tooltip on hover
80
+ - Responsive container
81
+
82
+ ---
83
+
84
+ ### TaskList (Presentational)
85
+ **File:** `src/components/TaskList.jsx`
86
+
87
+ **Props:**
88
+ ```javascript
89
+ {
90
+ tasks: [{ id, title, status, date }],
91
+ onTaskClick: (id) => void
92
+ }
93
+ ```
94
+
95
+ ---
96
+
97
+ ## State Management
98
+
99
+ ### DashboardContext
100
+ **File:** `src/contexts/DashboardContext.jsx`
101
+
102
+ ```javascript
103
+ const DashboardContext = createContext();
104
+
105
+ export function DashboardProvider({ children }) {
106
+ const [state, dispatch] = useReducer(dashboardReducer, initialState);
107
+
108
+ const fetchDashboardData = async () => {
109
+ // Fetch metrics, chart data, recent tasks
110
+ };
111
+
112
+ return (
113
+ <DashboardContext.Provider value={{ state, fetchDashboardData }}>
114
+ {children}
115
+ </DashboardContext.Provider>
116
+ );
117
+ }
118
+ ```
119
+
120
+ ---
121
+
122
+ ## API Integration
123
+
124
+ ### useDashboard Hook
125
+ **File:** `src/hooks/useDashboard.js`
126
+
127
+ ```javascript
128
+ export function useDashboard() {
129
+ const [data, setData] = useState(null);
130
+ const [loading, setLoading] = useState(true);
131
+ const [error, setError] = useState(null);
132
+
133
+ useEffect(() => {
134
+ async function fetchData() {
135
+ try {
136
+ const [metrics, chartData, tasks] = await Promise.all([
137
+ api.get('/dashboard/metrics'),
138
+ api.get('/dashboard/chart-data'),
139
+ api.get('/tasks?limit=5&sort=recent')
140
+ ]);
141
+ setData({ metrics, chartData, tasks });
142
+ } catch (err) {
143
+ setError(err.message);
144
+ } finally {
145
+ setLoading(false);
146
+ }
147
+ }
148
+ fetchData();
149
+ }, []);
150
+
151
+ return { data, loading, error };
152
+ }
153
+ ```
154
+
155
+ ---
156
+
157
+ ## Styling
158
+
159
+ ### Responsive Grid
160
+ ```css
161
+ .dashboard {
162
+ display: grid;
163
+ grid-template-columns: repeat(2, 1fr);
164
+ gap: 24px;
165
+ padding: 24px;
166
+ }
167
+
168
+ @media (max-width: 768px) {
169
+ .dashboard {
170
+ grid-template-columns: 1fr;
171
+ }
172
+ }
173
+ ```
174
+
175
+ ---
176
+
177
+ ## Requirements Traceability
178
+
179
+ | Requirement | Component | File |
180
+ |-------------|-----------|------|
181
+ | US-1 | MetricCard | MetricCard.jsx |
182
+ | US-2 | TaskCompletionChart | TaskCompletionChart.jsx |
183
+ | US-3 | TaskList | TaskList.jsx |
184
+ | FR-1 | Dashboard | Dashboard.jsx |
185
+ | FR-2 | MetricCard | MetricCard.jsx |
186
+ | FR-3 | TaskCompletionChart | TaskCompletionChart.jsx |
187
+ | FR-4 | TaskList | TaskList.jsx |
188
+
189
+ ---
190
+
191
+ **Version**: 1.0.0
192
+ **Last Updated**: 2026-01-23
@@ -0,0 +1,143 @@
1
+ # User Dashboard - Requirements
2
+
3
+ > Example Spec demonstrating React UI feature development
4
+
5
+ ---
6
+
7
+ **Version**: 1.0.0
8
+ **Last Updated**: 2026-01-23
9
+ **Spec Type**: Example - UI Feature
10
+
11
+ ---
12
+
13
+ ## Overview
14
+
15
+ This Spec demonstrates how to structure requirements for a React dashboard feature. We'll build a user analytics dashboard with data visualization, covering common UI patterns like component composition, state management, API integration, and responsive design.
16
+
17
+ **Learning Points:**
18
+ - Component hierarchy design
19
+ - State management patterns
20
+ - Data visualization
21
+ - Responsive layouts
22
+ - API integration
23
+
24
+ ---
25
+
26
+ ## User Stories
27
+
28
+ ### US-1: View Dashboard Overview
29
+ **As a** user
30
+ **I want to** see an overview of my key metrics
31
+ **So that** I can quickly understand my account status
32
+
33
+ **Acceptance Criteria:**
34
+ - WHEN I navigate to `/dashboard` THEN I see 4 metric cards (total tasks, completed, in progress, pending)
35
+ - WHEN metrics load THEN I see loading skeletons
36
+ - WHEN metrics fail to load THEN I see error message with retry button
37
+ - WHEN I view on mobile THEN cards stack vertically
38
+
39
+ ### US-2: View Task Completion Chart
40
+ **As a** user
41
+ **I want to** see a chart of my task completion over time
42
+ **So that** I can track my productivity
43
+
44
+ **Acceptance Criteria:**
45
+ - WHEN I view dashboard THEN I see a line chart showing last 7 days of task completions
46
+ - WHEN I hover over data points THEN I see exact values in tooltip
47
+ - WHEN chart loads THEN it animates smoothly
48
+ - WHEN I view on mobile THEN chart is responsive
49
+
50
+ ### US-3: View Recent Tasks List
51
+ **As a** user
52
+ **I want to** see my most recent tasks
53
+ **So that** I can quickly access current work
54
+
55
+ **Acceptance Criteria:**
56
+ - WHEN I view dashboard THEN I see 5 most recent tasks
57
+ - WHEN I click a task THEN I navigate to task detail page
58
+ - WHEN I have no tasks THEN I see empty state with "Create Task" button
59
+ - WHEN tasks load THEN I see loading state
60
+
61
+ ---
62
+
63
+ ## Functional Requirements
64
+
65
+ ### FR-1: Dashboard Layout
66
+ - Responsive grid layout (desktop: 2 columns, mobile: 1 column)
67
+ - Header with user name and logout button
68
+ - Metric cards section
69
+ - Chart section
70
+ - Recent tasks section
71
+
72
+ ### FR-2: Metric Cards
73
+ - Display 4 metrics: Total, Completed, In Progress, Pending
74
+ - Show count and percentage change from last week
75
+ - Color-coded indicators (green: increase, red: decrease)
76
+ - Loading skeleton during data fetch
77
+
78
+ ### FR-3: Task Completion Chart
79
+ - Line chart showing last 7 days
80
+ - X-axis: dates, Y-axis: task count
81
+ - Interactive tooltips on hover
82
+ - Smooth animations
83
+ - Responsive sizing
84
+
85
+ ### FR-4: Recent Tasks List
86
+ - Display 5 most recent tasks
87
+ - Show task title, status, and date
88
+ - Clickable to navigate to detail
89
+ - Empty state when no tasks
90
+ - Loading state during fetch
91
+
92
+ ---
93
+
94
+ ## Non-Functional Requirements
95
+
96
+ ### NFR-1: Performance
97
+ - Initial render < 1 second
98
+ - Chart animation < 500ms
99
+ - Smooth scrolling on mobile
100
+
101
+ ### NFR-2: Accessibility
102
+ - WCAG 2.1 AA compliance
103
+ - Keyboard navigation support
104
+ - Screen reader friendly
105
+ - Proper ARIA labels
106
+
107
+ ### NFR-3: Responsive Design
108
+ - Desktop: 1024px+
109
+ - Tablet: 768px-1023px
110
+ - Mobile: 320px-767px
111
+
112
+ ---
113
+
114
+ ## Component Hierarchy
115
+
116
+ ```
117
+ Dashboard
118
+ ├── DashboardHeader
119
+ ├── MetricsSection
120
+ │ ├── MetricCard (x4)
121
+ │ └── MetricCardSkeleton
122
+ ├── ChartSection
123
+ │ ├── TaskCompletionChart
124
+ │ └── ChartSkeleton
125
+ └── RecentTasksSection
126
+ ├── TaskList
127
+ │ └── TaskListItem (x5)
128
+ ├── EmptyState
129
+ └── TaskListSkeleton
130
+ ```
131
+
132
+ ---
133
+
134
+ ## API Endpoints
135
+
136
+ - `GET /api/v1/dashboard/metrics` - Fetch metric data
137
+ - `GET /api/v1/dashboard/chart-data` - Fetch chart data
138
+ - `GET /api/v1/tasks?limit=5&sort=recent` - Fetch recent tasks
139
+
140
+ ---
141
+
142
+ **Version**: 1.0.0
143
+ **Last Updated**: 2026-01-23
@@ -0,0 +1,91 @@
1
+ # User Dashboard - Tasks
2
+
3
+ > Implementation plan for React dashboard
4
+
5
+ ---
6
+
7
+ **Version**: 1.0.0
8
+ **Last Updated**: 2026-01-23
9
+
10
+ ---
11
+
12
+ ## Phase 1: Setup
13
+
14
+ - [ ] 1.1 Install dependencies (react, recharts, axios)
15
+ - [ ] 1.2 Create component directory structure
16
+ - [ ] 1.3 Set up CSS Modules configuration
17
+
18
+ ---
19
+
20
+ ## Phase 2: Core Components
21
+
22
+ - [ ] 2.1 Create MetricCard component
23
+ - Implement props interface
24
+ - Add styling with CSS Modules
25
+ - Add loading skeleton variant
26
+ - Write unit tests
27
+
28
+ - [ ] 2.2 Create TaskCompletionChart component
29
+ - Integrate Recharts LineChart
30
+ - Implement responsive container
31
+ - Add tooltip formatting
32
+ - Add loading skeleton
33
+ - Write unit tests
34
+
35
+ - [ ] 2.3 Create TaskList component
36
+ - Implement task list rendering
37
+ - Add click handlers
38
+ - Add empty state
39
+ - Add loading skeleton
40
+ - Write unit tests
41
+
42
+ ---
43
+
44
+ ## Phase 3: Dashboard Container
45
+
46
+ - [ ] 3.1 Create useDashboard hook
47
+ - Implement data fetching
48
+ - Handle loading states
49
+ - Handle error states
50
+ - Write unit tests
51
+
52
+ - [ ] 3.2 Create Dashboard page component
53
+ - Compose all child components
54
+ - Implement responsive grid layout
55
+ - Add error boundary
56
+ - Write integration tests
57
+
58
+ ---
59
+
60
+ ## Phase 4: Styling & Polish
61
+
62
+ - [ ] 4.1 Implement responsive design
63
+ - Desktop layout (2 columns)
64
+ - Tablet layout (2 columns)
65
+ - Mobile layout (1 column)
66
+ - Test on different screen sizes
67
+
68
+ - [ ] 4.2 Add animations
69
+ - Chart entrance animation
70
+ - Card hover effects
71
+ - Loading skeleton animations
72
+
73
+ - [ ] 4.3 Accessibility improvements
74
+ - Add ARIA labels
75
+ - Test keyboard navigation
76
+ - Test with screen reader
77
+ - Ensure color contrast
78
+
79
+ ---
80
+
81
+ ## Phase 5: Testing
82
+
83
+ - [ ] 5.1 Unit tests for all components
84
+ - [ ] 5.2 Integration tests for Dashboard
85
+ - [ ] 5.3 Visual regression tests
86
+ - [ ] 5.4 Accessibility tests
87
+
88
+ ---
89
+
90
+ **Version**: 1.0.0
91
+ **Last Updated**: 2026-01-23