sdd-workflow 1.1.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 (41) hide show
  1. package/README.md +226 -0
  2. package/bin/sdd-init.js +59 -0
  3. package/package.json +30 -0
  4. package/src/installer.js +558 -0
  5. package/templates/skills/sdd-constitution/SKILL.md +128 -0
  6. package/templates/skills/sdd-implement/SKILL.md +153 -0
  7. package/templates/skills/sdd-init/SKILL.md +302 -0
  8. package/templates/skills/sdd-plan/SKILL.md +226 -0
  9. package/templates/skills/sdd-review/SKILL.md +498 -0
  10. package/templates/skills/sdd-run/SKILL.md +439 -0
  11. package/templates/skills/sdd-specify/SKILL.md +280 -0
  12. package/templates/skills/sdd-split/SKILL.md +432 -0
  13. package/templates/skills/sdd-tasks/SKILL.md +199 -0
  14. package/templates/skills/sdd-testcases/SKILL.md +235 -0
  15. package/templates/specify/README.md +179 -0
  16. package/templates/specify/scripts/create-feature.sh +144 -0
  17. package/templates/specify/templates/constitution-template.md +74 -0
  18. package/templates/specify/templates/plan-modular-template/README.md +98 -0
  19. package/templates/specify/templates/plan-modular-template/architecture.md +127 -0
  20. package/templates/specify/templates/plan-modular-template/backend-api.md +191 -0
  21. package/templates/specify/templates/plan-modular-template/backend-impl.md +134 -0
  22. package/templates/specify/templates/plan-modular-template/changelog.md +34 -0
  23. package/templates/specify/templates/plan-modular-template/data-model.md +130 -0
  24. package/templates/specify/templates/plan-modular-template/frontend-api.md +126 -0
  25. package/templates/specify/templates/plan-modular-template/frontend-impl.md +108 -0
  26. package/templates/specify/templates/plan-modular-template/performance.md +112 -0
  27. package/templates/specify/templates/plan-modular-template/security.md +85 -0
  28. package/templates/specify/templates/plan-template.md +190 -0
  29. package/templates/specify/templates/requirements/metadata-template.json +12 -0
  30. package/templates/specify/templates/requirements/original-template.md +26 -0
  31. package/templates/specify/templates/spec-modular-template/README.md +69 -0
  32. package/templates/specify/templates/spec-modular-template/acceptance-criteria.md +49 -0
  33. package/templates/specify/templates/spec-modular-template/changelog.md +27 -0
  34. package/templates/specify/templates/spec-modular-template/constraints.md +125 -0
  35. package/templates/specify/templates/spec-modular-template/overview.md +60 -0
  36. package/templates/specify/templates/spec-modular-template/user-stories.md +59 -0
  37. package/templates/specify/templates/spec-template.md +214 -0
  38. package/templates/specify/templates/tasks-modular-template/README.md +79 -0
  39. package/templates/specify/templates/tasks-template.md +232 -0
  40. package/templates/specify/templates/testcases-template.md +434 -0
  41. package/templates/teams/sdd-development-team.md +318 -0
@@ -0,0 +1,214 @@
1
+ # 功能规格说明 (Specification)
2
+
3
+ > 功能编号: {feature_id}
4
+ > 创建日期: {date}
5
+ > 状态: 草稿
6
+ > 作者: {author}
7
+
8
+ <!--
9
+ Important: Spec describes What (what to do), not How (how to do it).
10
+ Forbidden: SQL, code snippets, file paths, class/method names, modification lists.
11
+ These belong in plan.md and tasks.md.
12
+ -->
13
+
14
+ ## 0. Requirement Traceability
15
+
16
+ > Record the original source of requirements for traceability
17
+
18
+ ### 0.1 Requirement Source
19
+ | Item | Content |
20
+ |------|---------|
21
+ | Source Type | {source_type} <!-- KB/PRD/Verbal/Other --> |
22
+ | Source URL | {source_url} <!-- if available --> |
23
+ | Requirement Owner | {requirement_owner} |
24
+ | Requirement Version | {requirement_version} |
25
+
26
+ ### 0.2 Original Requirement Document
27
+ {#if has_source}
28
+ **Original Requirement**: `requirements/original.md`
29
+
30
+ This specification is based on the original requirement document. See original document for details.
31
+
32
+ {#if has_child_pages}
33
+ **Related Sub-pages**:
34
+ {child_pages_list}
35
+ {/if}
36
+ {#else}
37
+ *This feature is technology-driven or has no formal requirement document*
38
+ {/if}
39
+
40
+ ### 0.3 Requirement Change Log
41
+ | Date | Change | Changed By |
42
+ |------|--------|------------|
43
+ | {date} | Initial requirement | {author} |
44
+
45
+ ---
46
+
47
+ ## 1. Feature Overview
48
+
49
+ ### 1.1 Feature Name
50
+ {feature_name}
51
+
52
+ ### 1.2 Feature Description
53
+ <!-- Describe the core goal in 2-3 sentences -->
54
+ {feature_description}
55
+
56
+ ### 1.3 Business Background
57
+
58
+ #### Pain Points
59
+ <!-- Describe current problems and difficulties users face -->
60
+ {business_pain_points}
61
+
62
+ #### Solution Overview
63
+ <!-- Describe how to solve these problems in business language -->
64
+ {solution_overview}
65
+
66
+ ### 1.4 Related Modules
67
+ <!-- Only module names and business functions, no file paths or class names -->
68
+ | Module | Business Function | Description |
69
+ |--------|-------------------|-------------|
70
+ | {module_name} | {business_function} | {description} |
71
+
72
+ ---
73
+
74
+ ## 2. User Stories
75
+
76
+ ### User Story 1: {story_title}
77
+ **As** {user_role}
78
+ **I want** {goal}
79
+ **So that** {benefit}
80
+
81
+ **Acceptance Criteria:**
82
+ - [ ] Given {condition}, When {action}, Then {result}
83
+ - [ ] Given {condition}, When {action}, Then {result}
84
+
85
+ ### User Story 2: {story_title}
86
+ ...
87
+
88
+ ---
89
+
90
+ ## 3. Functional Requirements
91
+
92
+ ### 3.1 Core Features
93
+ | Feature | Description | Priority | Notes |
94
+ |---------|-------------|----------|-------|
95
+ | {feature_1} | {description} | P0 | |
96
+ | {feature_2} | {description} | P1 | |
97
+
98
+ ### 3.2 UI Requirements
99
+
100
+ #### 3.2.1 Page Layout
101
+ <!-- Describe page structure in simple ASCII, focus on user-visible content -->
102
+ {page_layout_description}
103
+
104
+ #### 3.2.2 Interaction Flow
105
+ <!-- Describe operation steps from user perspective -->
106
+ {interaction_flow}
107
+
108
+ #### 3.2.3 UI Components
109
+ <!-- Describe component types needed (dropdown, table, dialog, etc.), no class names -->
110
+ {ui_components}
111
+
112
+ ### 3.3 Data Requirements
113
+ <!-- Describe business entities and field meanings, no SQL/DDL -->
114
+
115
+ #### 3.3.1 Business Entities
116
+ <!-- Describe business concepts and their relationships -->
117
+ {business_entities}
118
+
119
+ #### 3.3.2 Business Fields
120
+ <!-- Describe fields from business perspective, not database implementation -->
121
+ | Field | Meaning | Required | Business Rule |
122
+ |-------|---------|----------|---------------|
123
+ | {field_name} | {meaning} | Yes/No | {business_rule} |
124
+
125
+ ### 3.4 Interface Requirements
126
+ <!-- Describe what interfaces are needed and their purpose, no API paths or code -->
127
+
128
+ | Interface Purpose | Description | Notes |
129
+ |-------------------|-------------|-------|
130
+ | {interface_purpose} | {description} | {notes} |
131
+
132
+ ---
133
+
134
+ ## 4. Non-Functional Requirements
135
+
136
+ ### 4.1 Performance Requirements
137
+ - Response time: {response_time}
138
+ - Concurrency: {concurrency}
139
+
140
+ ### 4.2 Security Requirements
141
+ {security_requirements}
142
+
143
+ ### 4.3 Compatibility
144
+ - Browser: Chrome 80+, Edge 80+
145
+ - Resolution: 1920x1080 and above
146
+
147
+ ---
148
+
149
+ ## 5. Boundary Conditions
150
+
151
+ ### 5.1 Preconditions
152
+ {preconditions}
153
+
154
+ ### 5.2 Postconditions
155
+ {postconditions}
156
+
157
+ ### 5.3 Exception Handling
158
+ <!-- Describe exception scenarios and user-visible handling from business perspective -->
159
+ | Exception Scenario | User-Visible Handling |
160
+ |--------------------|-----------------------|
161
+ | {scenario} | {handling} |
162
+
163
+ ---
164
+
165
+ ## 6. Acceptance Criteria
166
+
167
+ ### 6.1 Functional Acceptance
168
+ - [ ] All user story acceptance criteria pass
169
+ - [ ] Core feature tests pass
170
+ - [ ] Boundary condition tests pass
171
+
172
+ ### 6.2 Quality Acceptance
173
+ - [ ] Unit test coverage >= 80%
174
+ - [ ] Code review passed
175
+ - [ ] No critical bugs
176
+
177
+ ### 6.3 Documentation Acceptance
178
+ - [ ] API documentation updated
179
+ - [ ] User manual updated (if needed)
180
+
181
+ ---
182
+
183
+ ## 7. Appendix
184
+
185
+ ### 7.1 Glossary
186
+ <!-- Define business terms to help understand requirements -->
187
+ | Term | Definition |
188
+ |------|------------|
189
+ | {term} | {definition} |
190
+
191
+ ### 7.2 References
192
+ - {reference_1}
193
+ - {reference_2}
194
+
195
+ ### 7.3 Change Log
196
+ | Date | Version | Change | Author |
197
+ |------|---------|--------|--------|
198
+ | {date} | v1.0 | Initial version | {author} |
199
+
200
+ ---
201
+
202
+ *This document is generated based on SDD specification template*
203
+
204
+ <!--
205
+ Self-check list (check after generation):
206
+ - [ ] No SQL statements
207
+ - [ ] No code snippets (in any language)
208
+ - [ ] No file paths (e.g., src/pages/xxx/xxx.jsx)
209
+ - [ ] No class or method names
210
+ - [ ] No "modification list" section
211
+ - [ ] Related modules only have module names, not file paths
212
+ - [ ] Data requirements describe business entities, not database table structures
213
+ - [ ] Interface requirements describe purpose, not API code
214
+ -->
@@ -0,0 +1,79 @@
1
+ # {feature_name} - Task Breakdown Index
2
+
3
+ > Version: {version}
4
+ > Created: {create_date}
5
+ > Updated: {update_date}
6
+ > Related Spec: [spec.md](../spec.md)
7
+ > Implementation Plan: [plan.md](../plan.md)
8
+ > Test Cases: [testcases.md](../testcases.md)
9
+
10
+ ## Document Structure
11
+
12
+ Tasks have been split into the following modules for easier management and on-demand loading:
13
+
14
+ ```
15
+ tasks/
16
+ ├── README.md # This file - task index and overview
17
+ ├── phase-0-preparation.md # Phase 0: Preparation
18
+ ├── phase-1-backend.md # Phase 1: Backend development (test-first)
19
+ ├── phase-2-frontend.md # Phase 2: Frontend development (test-first)
20
+ ├── phase-3-testing.md # Phase 3: Testing & acceptance
21
+ ├── phase-N-*.md # Additional phases (iterations)
22
+ ├── dependencies.md # Task dependency relationships
23
+ ├── checkpoints.md # Checkpoints and acceptance criteria
24
+ └── implementation-notes.md # Implementation records and notes
25
+ ```
26
+
27
+ ## Task Overview
28
+
29
+ | Phase | Task Count | Estimated Hours | Status | Document |
30
+ |-------|------------|-----------------|--------|----------|
31
+ | Phase 0: Preparation | {phase_0_tasks} | {phase_0_hours}h | {phase_0_status} | [phase-0-preparation.md](./phase-0-preparation.md) |
32
+ | Phase 1: Backend Dev | {phase_1_tasks} | {phase_1_hours}h | {phase_1_status} | [phase-1-backend.md](./phase-1-backend.md) |
33
+ | Phase 2: Frontend Dev | {phase_2_tasks} | {phase_2_hours}h | {phase_2_status} | [phase-2-frontend.md](./phase-2-frontend.md) |
34
+ | Phase 3: Testing | {phase_3_tasks} | {phase_3_hours}h | {phase_3_status} | [phase-3-testing.md](./phase-3-testing.md) |
35
+ | **Total** | **{total_tasks}** | **{total_hours}h** | **{progress}%** | - |
36
+
37
+ ## Quick Navigation
38
+
39
+ ### Core Phases
40
+ - [Preparation](./phase-0-preparation.md) - Environment check, test data, code research
41
+ - [Backend Development](./phase-1-backend.md) - Models, DTOs, services, controllers
42
+ - [Frontend Development](./phase-2-frontend.md) - API services, stores, page components, routing
43
+ - [Testing & Acceptance](./phase-3-testing.md) - E2E tests, boundary tests, performance tests
44
+
45
+ ### Auxiliary Documents
46
+ - [Task Dependencies](./dependencies.md) - Dependency graph and execution order
47
+ - [Checkpoints](./checkpoints.md) - Phase acceptance criteria
48
+ - [Implementation Notes](./implementation-notes.md) - Actual vs planned differences, issue records
49
+
50
+ ## Current Progress
51
+
52
+ **Current Phase**: {current_phase}
53
+
54
+ **Recently Completed**:
55
+ - {recent_task_1}
56
+ - {recent_task_2}
57
+ - {recent_task_3}
58
+
59
+ **Next Steps**:
60
+ - {next_task_1}
61
+ - {next_task_2}
62
+
63
+ ## Usage Guide
64
+
65
+ 1. **View Overview**: Read this file to understand overall progress and structure
66
+ 2. **On-demand Loading**: Open the corresponding Phase document for your current work
67
+ 3. **Check Dependencies**: Before starting a task, check [dependencies.md](./dependencies.md) for prerequisites
68
+ 4. **Acceptance Criteria**: After completing a phase, refer to [checkpoints.md](./checkpoints.md) for validation
69
+ 5. **Issue Tracking**: When encountering issues, check [implementation-notes.md](./implementation-notes.md) for records
70
+
71
+ ## Change Log
72
+
73
+ | Version | Date | Change |
74
+ |---------|------|--------|
75
+ | {version} | {date} | {change_description} |
76
+
77
+ ---
78
+
79
+ *This document follows SDD test-first principles, tasks organized in Red-Green-Refactor cycles*
@@ -0,0 +1,232 @@
1
+ # Task Breakdown (Tasks)
2
+
3
+ > Feature ID: {feature_id}
4
+ > Related Plan: {plan_file}
5
+ > Created: {date}
6
+ > Status: Pending
7
+
8
+ ## Task Overview
9
+
10
+ | Phase | Task Count | Estimated Hours | Status |
11
+ |-------|------------|-----------------|--------|
12
+ | Preparation | {count} | {hours}h | Not started |
13
+ | Backend Development | {count} | {hours}h | Not started |
14
+ | Frontend Development | {count} | {hours}h | Not started |
15
+ | Testing & Acceptance | {count} | {hours}h | Not started |
16
+ | **Total** | **{total}** | **{total_hours}h** | |
17
+
18
+ ---
19
+
20
+ ## Phase 0: Preparation
21
+
22
+ ### Task 0.1: Environment Setup
23
+ - **Description**: {description}
24
+ - **Files**: {files}
25
+ - **Dependencies**: None
26
+ - **Status**: [ ] Pending
27
+ - **Acceptance Criteria**:
28
+ - {acceptance_criteria}
29
+
30
+ ### Task 0.2: Database Preparation
31
+ - **Description**: Execute database DDL scripts
32
+ - **Files**: `scripts/{feature_id}.sql`
33
+ - **Dependencies**: Task 0.1
34
+ - **Status**: [ ] Pending
35
+ - **Acceptance Criteria**:
36
+ - Database tables created successfully
37
+ - Indexes created successfully
38
+
39
+ ---
40
+
41
+ ## Phase 1: Backend Development
42
+
43
+ ### Task 1.1: Domain/Model Design [P]
44
+ - **Description**: Create domain entities and value objects
45
+ - **Files**:
46
+ - `{backend_source_path}/models/{Entity}.{ext}`
47
+ - `{backend_source_path}/types/{ValueObject}.{ext}`
48
+ - **Dependencies**: Task 0.2
49
+ - **Status**: [ ] Pending
50
+ - **Acceptance Criteria**:
51
+ - Entity classes follow project conventions
52
+ - Contains necessary fields and methods
53
+
54
+ ### Task 1.2: Repository/Data Access Interface [P]
55
+ - **Description**: Define repository/data access interfaces
56
+ - **Files**: `{backend_source_path}/repositories/{Repository}.{ext}`
57
+ - **Dependencies**: Task 1.1
58
+ - **Status**: [ ] Pending
59
+ - **Acceptance Criteria**:
60
+ - Interface definition complete
61
+ - Method naming follows conventions
62
+
63
+ ### Task 1.3: Repository Implementation
64
+ - **Description**: Implement repository/data access interfaces
65
+ - **Files**:
66
+ - `{backend_source_path}/repositories/impl/{RepositoryImpl}.{ext}`
67
+ - `{backend_source_path}/mappers/{Mapper}.{ext}`
68
+ - **Dependencies**: Task 1.2
69
+ - **Status**: [ ] Pending
70
+ - **Acceptance Criteria**:
71
+ - CRUD operations work correctly
72
+ - SQL queries are correct
73
+
74
+ ### Task 1.4: Service Layer
75
+ - **Description**: Implement service/business logic layer
76
+ - **Files**: `{backend_source_path}/services/{Service}.{ext}`
77
+ - **Dependencies**: Task 1.3
78
+ - **Status**: [ ] Pending
79
+ - **Acceptance Criteria**:
80
+ - Business logic is correct
81
+ - Exception handling is complete
82
+
83
+ ### Task 1.5: API Controller/Handler
84
+ - **Description**: Implement API endpoints
85
+ - **Files**: `{backend_source_path}/controllers/{Controller}.{ext}`
86
+ - **Dependencies**: Task 1.4
87
+ - **Status**: [ ] Pending
88
+ - **Acceptance Criteria**:
89
+ - API conforms to design document
90
+ - Parameter validation is complete
91
+
92
+ ### Task 1.6: Backend Unit Tests
93
+ - **Description**: Write unit tests
94
+ - **Files**: `{backend_test_path}/{Test}.{ext}`
95
+ - **Dependencies**: Task 1.5
96
+ - **Status**: [ ] Pending
97
+ - **Acceptance Criteria**:
98
+ - Test coverage >= 80%
99
+ - All tests pass
100
+
101
+ ---
102
+
103
+ ## Phase 2: Frontend Development
104
+
105
+ ### Task 2.1: API Service Layer [P]
106
+ - **Description**: Create API call services
107
+ - **Files**: `{frontend_source_path}/api/{feature}.{ext}`
108
+ - **Dependencies**: Task 1.5
109
+ - **Status**: [ ] Pending
110
+ - **Acceptance Criteria**:
111
+ - API calls are correct
112
+ - Error handling is complete
113
+
114
+ ### Task 2.2: Store/State Definition [P]
115
+ - **Description**: Create state management store
116
+ - **Files**: `{frontend_source_path}/stores/{Feature}Store.{ext}`
117
+ - **Dependencies**: Task 2.1
118
+ - **Status**: [ ] Pending
119
+ - **Acceptance Criteria**:
120
+ - State management is correct
121
+ - Reactive updates work
122
+
123
+ ### Task 2.3: Page Components
124
+ - **Description**: Create page components
125
+ - **Files**: `{frontend_source_path}/pages/{module}/{Feature}/index.{ext}`
126
+ - **Dependencies**: Task 2.2
127
+ - **Status**: [ ] Pending
128
+ - **Acceptance Criteria**:
129
+ - Page layout is correct
130
+ - Interaction conforms to design
131
+
132
+ ### Task 2.4: Sub-components Development
133
+ - **Description**: Develop feature sub-components
134
+ - **Files**: `{frontend_source_path}/pages/{module}/{Feature}/components/`
135
+ - **Dependencies**: Task 2.3
136
+ - **Status**: [ ] Pending
137
+ - **Acceptance Criteria**:
138
+ - Component functionality is complete
139
+ - Reusability is good
140
+
141
+ ### Task 2.5: Route Configuration
142
+ - **Description**: Configure page routes
143
+ - **Files**: `{frontend_source_path}/routes.{ext}`
144
+ - **Dependencies**: Task 2.3
145
+ - **Status**: [ ] Pending
146
+ - **Acceptance Criteria**:
147
+ - Route configuration is correct
148
+ - Access control is complete
149
+
150
+ ---
151
+
152
+ ## Phase 3: Testing & Acceptance
153
+
154
+ ### Task 3.1: Integration Testing
155
+ - **Description**: Frontend-backend integration testing
156
+ - **Dependencies**: Task 2.5
157
+ - **Status**: [ ] Pending
158
+ - **Acceptance Criteria**:
159
+ - All API calls work correctly
160
+ - Data displays correctly
161
+
162
+ ### Task 3.2: Functional Testing
163
+ - **Description**: Execute functional test cases
164
+ - **Dependencies**: Task 3.1
165
+ - **Status**: [ ] Pending
166
+ - **Acceptance Criteria**:
167
+ - All test cases pass
168
+ - No critical bugs
169
+
170
+ ### Task 3.3: Code Review
171
+ - **Description**: Code review
172
+ - **Dependencies**: Task 3.2
173
+ - **Status**: [ ] Pending
174
+ - **Acceptance Criteria**:
175
+ - Code follows conventions
176
+ - No obvious issues
177
+
178
+ ### Task 3.4: Documentation Update
179
+ - **Description**: Update related documentation
180
+ - **Files**:
181
+ - API documentation
182
+ - User manual (if needed)
183
+ - **Dependencies**: Task 3.3
184
+ - **Status**: [ ] Pending
185
+ - **Acceptance Criteria**:
186
+ - Documentation is accurate and complete
187
+
188
+ ---
189
+
190
+ ## Acceptance Checkpoints
191
+
192
+ ### Checkpoint 1: Backend Development Complete
193
+ - [ ] All backend tasks completed
194
+ - [ ] Unit tests pass
195
+ - [ ] APIs are accessible
196
+
197
+ ### Checkpoint 2: Frontend Development Complete
198
+ - [ ] All frontend tasks completed
199
+ - [ ] Pages are accessible
200
+ - [ ] Basic functionality works
201
+
202
+ ### Checkpoint 3: Feature Acceptance Complete
203
+ - [ ] All test cases pass
204
+ - [ ] Code review passed
205
+ - [ ] Documentation updated
206
+
207
+ ---
208
+
209
+ ## Risks and Dependencies
210
+
211
+ ### External Dependencies
212
+ | Dependency | Provider | Status |
213
+ |------------|----------|--------|
214
+ | {dependency} | {provider} | {status} |
215
+
216
+ ### Risk Items
217
+ | Risk | Mitigation |
218
+ |------|------------|
219
+ | {risk} | {mitigation} |
220
+
221
+ ---
222
+
223
+ ## Change Log
224
+
225
+ | Date | Change | Author |
226
+ |------|--------|--------|
227
+ | {date} | Initial version | {author} |
228
+
229
+ ---
230
+
231
+ *This document is generated based on SDD specification template*
232
+ *Tasks marked [P] can be executed in parallel*