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,85 @@
1
+ # Security Design
2
+
3
+ > This document describes security-related design
4
+
5
+ ## 1. Authentication & Authorization
6
+
7
+ ### 1.1 Authentication Mechanism
8
+
9
+ - Use unified authentication system (SSO)
10
+ - Token storage in secure cookies
11
+ - Token expiry auto-redirect to login
12
+
13
+ ### 1.2 Access Control
14
+
15
+ **Backend Access Control**:
16
+
17
+ ```{backend_language}
18
+ // Role-based or permission-based access control on API endpoints
19
+ // Only authorized users can access sensitive operations
20
+ ```
21
+
22
+ **Frontend Access Control**:
23
+
24
+ ```{frontend_language}
25
+ // Conditional rendering based on user permissions
26
+ // Hide or disable UI elements based on roles
27
+ ```
28
+
29
+ ## 2. Data Security
30
+
31
+ ### 2.1 Sensitive Data Encryption
32
+
33
+ - Passwords encrypted with strong hashing algorithm
34
+ - Sensitive fields encrypted at rest
35
+ - All communication over HTTPS
36
+
37
+ ### 2.2 Data Masking
38
+
39
+ ```{backend_language}
40
+ // Phone number masking
41
+ // maskPhone("13812345678") -> "138****5678"
42
+
43
+ // ID card masking
44
+ // maskIdCard("110101199001011234") -> "110101********1234"
45
+ ```
46
+
47
+ ## 3. Interface Security
48
+
49
+ ### 3.1 Parameter Validation
50
+
51
+ ```{backend_language}
52
+ // Validate all input parameters on the server side
53
+ // Use framework-provided validation where available
54
+ ```
55
+
56
+ ### 3.2 SQL Injection Prevention
57
+
58
+ - Use parameterized queries
59
+ - Never concatenate user input into SQL
60
+ - Use ORM/query builder safely
61
+
62
+ ### 3.3 XSS Prevention
63
+
64
+ - Frontend input sanitization
65
+ - Backend output encoding
66
+ - Content-Security-Policy headers
67
+
68
+ ## 4. Log Security
69
+
70
+ ### 4.1 Log Masking
71
+
72
+ ```{backend_language}
73
+ // Never log sensitive data in plain text
74
+ // Mask or redact sensitive fields before logging
75
+ ```
76
+
77
+ ### 4.2 Log Content Rules
78
+
79
+ - Never log passwords
80
+ - Never log full identification numbers
81
+ - Never log financial account numbers
82
+
83
+ ---
84
+
85
+ Back to [Plan Index](./README.md)
@@ -0,0 +1,190 @@
1
+ # Implementation Plan
2
+
3
+ > Feature ID: {feature_id}
4
+ > Related Spec: {spec_file}
5
+ > Created: {date}
6
+ > Status: Draft
7
+
8
+ ## 1. Overview
9
+
10
+ ### 1.1 Implementation Goal
11
+ {implementation_goal}
12
+
13
+ ### 1.2 Technology Choices
14
+ {technology_choices}
15
+
16
+ ### 1.3 Design Principles
17
+ {design_principles}
18
+
19
+ ## 2. Architecture Design
20
+
21
+ ### 2.1 Overall Architecture
22
+ {architecture_overview}
23
+
24
+ ### 2.2 Module Breakdown
25
+ {module_breakdown}
26
+
27
+ ### 2.3 Technology Stack
28
+
29
+ > Read technology stack information from constitution.md or project configuration.
30
+
31
+ #### Frontend
32
+ - Framework: {frontend_framework}
33
+ - UI Library: {ui_library}
34
+ - State Management: {state_management}
35
+ - HTTP Client: {http_client}
36
+ - Other: {other_frontend_libs}
37
+
38
+ #### Backend
39
+ - Framework: {backend_framework}
40
+ - ORM: {orm_framework}
41
+ - Database: {database}
42
+ - Other: {other_backend_libs}
43
+
44
+ ## 3. Data Model
45
+
46
+ ### 3.1 Database Design
47
+
48
+ #### New Tables
49
+ ```sql
50
+ -- {table_name} table
51
+ CREATE TABLE {table_name} (
52
+ id VARCHAR(32) PRIMARY KEY,
53
+ -- Field definitions
54
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
55
+ updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
56
+ );
57
+ ```
58
+
59
+ #### Modified Tables
60
+ ```sql
61
+ -- {table_name} add column
62
+ ALTER TABLE {table_name} ADD COLUMN {column_name} {column_type};
63
+ ```
64
+
65
+ ### 3.2 Entity Design
66
+ {entity_design}
67
+
68
+ ### 3.3 Data Flow
69
+ {data_flow}
70
+
71
+ ## 4. API Design
72
+
73
+ ### 4.1 API List
74
+ | Interface | Method | Path | Description |
75
+ |-----------|--------|------|-------------|
76
+ | {api_name} | {method} | {path} | {description} |
77
+
78
+ ### 4.2 API Detail Design
79
+
80
+ #### {api_name}
81
+ ```json
82
+ // Request
83
+ {
84
+ "field1": "value1",
85
+ "field2": "value2"
86
+ }
87
+
88
+ // Response
89
+ {
90
+ "code": 200,
91
+ "message": "success",
92
+ "data": {
93
+ // Response data
94
+ }
95
+ }
96
+ ```
97
+
98
+ ### 4.3 API Contract File
99
+ See: `contracts/api-spec.json`
100
+
101
+ ## 5. Frontend Implementation
102
+
103
+ ### 5.1 Page Structure
104
+ {page_structure}
105
+
106
+ ### 5.2 Component Design
107
+ | Component | Path | Function |
108
+ |-----------|------|----------|
109
+ | {component} | {path} | {description} |
110
+
111
+ ### 5.3 State Management
112
+ {state_management}
113
+
114
+ ### 5.4 Route Configuration
115
+ {route_config}
116
+
117
+ ## 6. Backend Implementation
118
+
119
+ ### 6.1 Layered Design
120
+
121
+ {architecture_layer_design}
122
+
123
+ ### 6.2 Core Class Design
124
+ {core_classes}
125
+
126
+ ### 6.3 Business Flow
127
+ {business_flow}
128
+
129
+ ## 7. Security Design
130
+
131
+ ### 7.1 Access Control
132
+ {permission_control}
133
+
134
+ ### 7.2 Data Validation
135
+ {data_validation}
136
+
137
+ ### 7.3 Sensitive Data Handling
138
+ {sensitive_data_handling}
139
+
140
+ ## 8. Performance Optimization
141
+
142
+ ### 8.1 Database Optimization
143
+ - Index design: {index_design}
144
+ - Query optimization: {query_optimization}
145
+
146
+ ### 8.2 Frontend Optimization
147
+ - Component lazy loading: {lazy_loading}
148
+ - Caching strategy: {caching_strategy}
149
+
150
+ ## 9. Test Plan
151
+
152
+ ### 9.1 Unit Tests
153
+ {unit_test_plan}
154
+
155
+ ### 9.2 Integration Tests
156
+ {integration_test_plan}
157
+
158
+ ### 9.3 E2E Tests
159
+ {e2e_test_plan}
160
+
161
+ ## 10. Deployment Plan
162
+
163
+ ### 10.1 Environment Requirements
164
+ {environment_requirements}
165
+
166
+ ### 10.2 Configuration Changes
167
+ {configuration_changes}
168
+
169
+ ### 10.3 Data Migration
170
+ {data_migration}
171
+
172
+ ## 11. Risk Assessment
173
+
174
+ | Risk | Impact | Probability | Mitigation |
175
+ |------|--------|-------------|------------|
176
+ | {risk} | {impact} | {probability} | {mitigation} |
177
+
178
+ ## 12. Appendix
179
+
180
+ ### 12.1 References
181
+ {references}
182
+
183
+ ### 12.2 Change Log
184
+ | Date | Version | Change |
185
+ |------|---------|--------|
186
+ | {date} | v1.0 | Initial version |
187
+
188
+ ---
189
+
190
+ *This document is generated based on SDD specification template*
@@ -0,0 +1,12 @@
1
+ {
2
+ "source": "{source_type}",
3
+ "source_url": "{source_url}",
4
+ "page_id": "{page_id}",
5
+ "title": "{title}",
6
+ "author": "{author}",
7
+ "last_updated": "{last_updated}",
8
+ "fetched_at": "{fetched_at}",
9
+ "space_key": "{space_key}",
10
+ "version": "{version}",
11
+ "child_pages": []
12
+ }
@@ -0,0 +1,26 @@
1
+ # Original Requirement Document
2
+
3
+ > This document is automatically fetched from the source for requirement traceability
4
+ > Fetched at: {fetched_at}
5
+ > Source: {source_url}
6
+
7
+ ---
8
+
9
+ ## Document Information
10
+
11
+ | Item | Content |
12
+ |------|---------|
13
+ | Title | {title} |
14
+ | Author | {author} |
15
+ | Last Updated | {last_updated} |
16
+ | Page ID | {page_id} |
17
+
18
+ ---
19
+
20
+ ## Requirement Content
21
+
22
+ {content}
23
+
24
+ ---
25
+
26
+ *This document is automatically fetched by SDD specification*
@@ -0,0 +1,69 @@
1
+ # {feature_name} - Feature Specification Index
2
+
3
+ > Version: {version}
4
+ > Created: {create_date}
5
+ > Updated: {update_date}
6
+ > Source: [{source_title}]({source_url})
7
+
8
+ ## Document Structure
9
+
10
+ The specification has been split into the following modules for easier management and on-demand loading:
11
+
12
+ ```
13
+ spec/
14
+ ├── README.md # This file - specification index and overview
15
+ ├── overview.md # Feature overview, business background
16
+ ├── user-stories.md # All user stories
17
+ ├── acceptance-criteria.md # Acceptance criteria summary
18
+ ├── constraints.md # Constraints and non-functional requirements
19
+ └── changelog.md # Change log
20
+ ```
21
+
22
+ ## Document Overview
23
+
24
+ | Module | Content | Document |
25
+ |--------|---------|----------|
26
+ | Feature Overview | Business background, feature description, related modules | [overview.md](./overview.md) |
27
+ | User Stories | All user stories (US-1, US-2...) | [user-stories.md](./user-stories.md) |
28
+ | Acceptance Criteria | Summary of acceptance criteria per user story | [acceptance-criteria.md](./acceptance-criteria.md) |
29
+ | Constraints | Technical constraints, performance requirements, security requirements | [constraints.md](./constraints.md) |
30
+ | Change Log | Version change history | [changelog.md](./changelog.md) |
31
+
32
+ ## Quick Navigation
33
+
34
+ ### Core Documents
35
+ - [Feature Overview](./overview.md) - Understand business background and goals
36
+ - [User Stories](./user-stories.md) - View all user stories
37
+ - [Acceptance Criteria](./acceptance-criteria.md) - Understand acceptance criteria
38
+
39
+ ### Auxiliary Documents
40
+ - [Constraints](./constraints.md) - Technical and business constraints
41
+ - [Change Log](./changelog.md) - Version change history
42
+
43
+ ## Core Information Summary
44
+
45
+ ### Business Background
46
+
47
+ {Brief description of business background, 2-3 sentences}
48
+
49
+ ### Feature Description
50
+
51
+ {Brief description of feature, 2-3 sentences}
52
+
53
+ ### User Story Count
54
+
55
+ - Total: {total_stories} user stories
56
+ - Core stories: {core_stories}
57
+ - Extended stories: {extended_stories}
58
+
59
+ ## Usage Guide
60
+
61
+ 1. **View Overview**: Read this file to understand the overall structure
62
+ 2. **On-demand Loading**: Open the corresponding module document as needed
63
+ 3. **View User Stories**: Start from [user-stories.md](./user-stories.md)
64
+ 4. **Acceptance Criteria**: Refer to [acceptance-criteria.md](./acceptance-criteria.md)
65
+ 5. **Constraints**: View [constraints.md](./constraints.md) for limitations
66
+
67
+ ---
68
+
69
+ *This document follows SDD specification, describing business requirements only, no technical implementation details*
@@ -0,0 +1,49 @@
1
+ # Acceptance Criteria Summary
2
+
3
+ > This document summarizes all acceptance criteria for user stories
4
+
5
+ ## US-1: {user_story_title}
6
+
7
+ ### Scenario 1: {scenario_description}
8
+
9
+ ```gherkin
10
+ Given {precondition}
11
+ When {action}
12
+ Then {expected_result}
13
+ And {additional_verification}
14
+ ```
15
+
16
+ ### Scenario 2: {scenario_description}
17
+
18
+ ```gherkin
19
+ Given {precondition}
20
+ When {action}
21
+ Then {expected_result}
22
+ ```
23
+
24
+ ---
25
+
26
+ ## US-2: {user_story_title}
27
+
28
+ ### Scenario 1: {scenario_description}
29
+
30
+ ```gherkin
31
+ Given {precondition}
32
+ When {action}
33
+ Then {expected_result}
34
+ ```
35
+
36
+ ---
37
+
38
+ ## Acceptance Checklist
39
+
40
+ - [ ] US-1 All scenarios pass
41
+ - [ ] US-2 All scenarios pass
42
+ - [ ] US-3 All scenarios pass
43
+ - [ ] Performance requirements met
44
+ - [ ] Security requirements met
45
+ - [ ] Compatibility requirements met
46
+
47
+ ---
48
+
49
+ Back to [Specification Index](./README.md)
@@ -0,0 +1,27 @@
1
+ # Change Log
2
+
3
+ > This document records version change history for the feature specification
4
+
5
+ ## Version History
6
+
7
+ | Version | Date | Change | Changed By |
8
+ |---------|------|--------|------------|
9
+ | 1.0 | {date} | Initial version | {author} |
10
+
11
+ ## Detailed Changes
12
+
13
+ ### v1.0 (Initial Version)
14
+
15
+ **Added Features**:
16
+ - Feature 1
17
+ - Feature 2
18
+ - Feature 3
19
+
20
+ **User Stories**:
21
+ - US-1: {title}
22
+ - US-2: {title}
23
+ - US-3: {title}
24
+
25
+ ---
26
+
27
+ Back to [Specification Index](./README.md)
@@ -0,0 +1,125 @@
1
+ # Constraints and Non-Functional Requirements
2
+
3
+ > This document describes technical constraints, performance requirements, security requirements and other non-functional requirements
4
+
5
+ ## 1. Technical Constraints
6
+
7
+ ### 1.1 Technology Stack Constraints
8
+
9
+ | Layer | Technology | Version | Notes |
10
+ |-------|-----------|---------|-------|
11
+ | Frontend Framework | {frontend_framework} | {frontend_version} | {frontend_notes} |
12
+ | UI Library | {ui_library} | {ui_version} | {ui_notes} |
13
+ | Backend Framework | {backend_framework} | {backend_version} | {backend_notes} |
14
+ | Database | {database} | {database_version} | {database_notes} |
15
+
16
+ > Fill in from constitution.md or project configuration.
17
+
18
+ ### 1.2 Compatibility Constraints
19
+
20
+ **Browser Compatibility**:
21
+ - Chrome 90+
22
+ - Edge 90+
23
+ - Firefox 88+
24
+ - Safari 14+
25
+
26
+ **Mobile Compatibility**:
27
+ - {mobile_support_policy}
28
+
29
+ ### 1.3 Dependency Constraints
30
+
31
+ **Restricted Technologies**:
32
+ - No new third-party libraries without approval
33
+ - No framework version changes without approval
34
+
35
+ ## 2. Performance Requirements
36
+
37
+ ### 2.1 Response Time
38
+
39
+ | Operation | Target Response Time | Max Response Time |
40
+ |-----------|---------------------|-------------------|
41
+ | Page load | < 2s | < 5s |
42
+ | List query | < 1s | < 3s |
43
+ | Detail query | < 500ms | < 2s |
44
+ | Data save | < 1s | < 3s |
45
+
46
+ ### 2.2 Concurrency Requirements
47
+
48
+ - Support {concurrent_users} concurrent users
49
+ - Peak QPS: {peak_qps}
50
+
51
+ ### 2.3 Data Volume Requirements
52
+
53
+ - Max records per query: 1000
54
+ - Page size: 20-100 records
55
+
56
+ ## 3. Security Requirements
57
+
58
+ ### 3.1 Authentication & Authorization
59
+
60
+ - Must use unified authentication
61
+ - Support role-based access control
62
+ - Sensitive operations require confirmation
63
+
64
+ ### 3.2 Data Security
65
+
66
+ - Sensitive data must be encrypted at rest
67
+ - Logs must not contain sensitive information
68
+ - Support data masking
69
+
70
+ ### 3.3 Interface Security
71
+
72
+ - All APIs must require authentication
73
+ - Prevent SQL injection
74
+ - Prevent XSS attacks
75
+
76
+ ## 4. Availability Requirements
77
+
78
+ ### 4.1 System Availability
79
+
80
+ - Availability target: 99.9%
81
+ - Planned downtime: no more than 2 hours per month
82
+
83
+ ### 4.2 Fault Tolerance
84
+
85
+ - Support graceful degradation
86
+ - Critical operations support retry
87
+ - Friendly error messages for exceptions
88
+
89
+ ## 5. Maintainability Requirements
90
+
91
+ ### 5.1 Code Standards
92
+
93
+ - Follow project code conventions
94
+ - Must pass lint/style checks
95
+ - Critical logic must have comments
96
+
97
+ ### 5.2 Logging Standards
98
+
99
+ - Critical operations must be logged
100
+ - Log level usage follows conventions
101
+ - Include necessary context information
102
+
103
+ ### 5.3 Documentation Requirements
104
+
105
+ - API documentation must be complete
106
+ - Complex logic must have design documentation
107
+ - Changes must update documentation
108
+
109
+ ## 6. Other Constraints
110
+
111
+ ### 6.1 Database Constraints
112
+
113
+ - No direct modification of production database
114
+ - DDL changes must be approved
115
+ - Must provide rollback plan
116
+
117
+ ### 6.2 Deployment Constraints
118
+
119
+ - Must support gradual rollout
120
+ - Must provide health check endpoint
121
+ - Must support quick rollback
122
+
123
+ ---
124
+
125
+ Back to [Specification Index](./README.md)
@@ -0,0 +1,60 @@
1
+ # Feature Overview
2
+
3
+ > This document describes the business background, feature description and related modules
4
+
5
+ ## 1. Business Background
6
+
7
+ ### 1.1 Current Pain Points
8
+
9
+ {Describe current problems and pain points}
10
+
11
+ ### 1.2 Solution
12
+
13
+ {Describe how this feature solves these pain points}
14
+
15
+ ### 1.3 Business Value
16
+
17
+ {Describe the business value this feature brings}
18
+
19
+ ## 2. Feature Description
20
+
21
+ ### 2.1 Core Features
22
+
23
+ {Describe core features, 2-3 paragraphs}
24
+
25
+ ### 2.2 Feature Scope
26
+
27
+ **In Scope**:
28
+ - Feature 1
29
+ - Feature 2
30
+ - Feature 3
31
+
32
+ **Out of Scope**:
33
+ - Feature 1
34
+ - Feature 2
35
+
36
+ ### 2.3 User Roles
37
+
38
+ | Role | Description | Permissions |
39
+ |------|-------------|-------------|
40
+ | Role 1 | Role description | Permission description |
41
+ | Role 2 | Role description | Permission description |
42
+
43
+ ## 3. Related Modules
44
+
45
+ | Module | Function | Description |
46
+ |--------|----------|-------------|
47
+ | Module 1 | Function description | Relationship description |
48
+ | Module 2 | Function description | Relationship description |
49
+
50
+ ## 4. Business Flow
51
+
52
+ ```
53
+ [User] -> [Action 1] -> [System Processing] -> [Result Display]
54
+ ```
55
+
56
+ {Describe business flow in detail}
57
+
58
+ ---
59
+
60
+ Back to [Specification Index](./README.md)
@@ -0,0 +1,59 @@
1
+ # User Stories
2
+
3
+ > This document contains all user stories
4
+
5
+ ## US-1: {user_story_title}
6
+
7
+ **As** {role}
8
+ **I want** {feature_description}
9
+ **So that** {business_value}
10
+
11
+ **Acceptance Criteria:**
12
+
13
+ ```gherkin
14
+ Given {precondition}
15
+ When {action}
16
+ Then {expected_result}
17
+ ```
18
+
19
+ ```gherkin
20
+ Given {precondition}
21
+ When {action}
22
+ Then {expected_result}
23
+ ```
24
+
25
+ ---
26
+
27
+ ## US-2: {user_story_title}
28
+
29
+ **As** {role}
30
+ **I want** {feature_description}
31
+ **So that** {business_value}
32
+
33
+ **Acceptance Criteria:**
34
+
35
+ ```gherkin
36
+ Given {precondition}
37
+ When {action}
38
+ Then {expected_result}
39
+ ```
40
+
41
+ ---
42
+
43
+ ## US-3: {user_story_title}
44
+
45
+ **As** {role}
46
+ **I want** {feature_description}
47
+ **So that** {business_value}
48
+
49
+ **Acceptance Criteria:**
50
+
51
+ ```gherkin
52
+ Given {precondition}
53
+ When {action}
54
+ Then {expected_result}
55
+ ```
56
+
57
+ ---
58
+
59
+ Back to [Specification Index](./README.md)