@daniel-da-silva-alves/sddk 2.0.0 → 2.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.
- package/CHANGELOG.md +23 -0
- package/README.md +21 -4
- package/bin/cli.js +4 -4
- package/package.json +7 -2
- package/sddk/plugin.json +1 -1
- package/sddk/skills/code-review/SKILL.md +142 -141
- package/sddk/skills/code-review/references/anti-ai-design-patterns.md +90 -90
- package/sddk/skills/code-review/references/refactoring-severity-guide.md +60 -60
- package/sddk/skills/code-review/references/security-checklist.md +59 -59
- package/sddk/skills/fullstack-development/SKILL.md +79 -78
- package/sddk/skills/fullstack-development/references/clean-code-rules.md +65 -65
- package/sddk/skills/fullstack-development/references/self-review-checklist.md +42 -42
- package/sddk/skills/implementation-planning/SKILL.md +65 -64
- package/sddk/skills/implementation-planning/references/manual-tests-template.md +53 -53
- package/sddk/skills/implementation-planning/references/microtask-template.md +47 -47
- package/sddk/skills/software-requirements-specification/SKILL.md +46 -45
- package/sddk/skills/software-requirements-specification/references/checklist-template.md +48 -48
- package/sddk/skills/software-requirements-specification/references/ieee-830-template.md +94 -94
- package/sddk/skills/software-requirements-specification/references/socratic-interview-guide.md +65 -65
- package/sddk/skills/system-design-document/SKILL.md +108 -107
- package/sddk/skills/system-design-document/references/architecture-patterns.md +59 -59
- package/sddk/skills/system-design-document/references/documentation-sources-guide.md +69 -69
- package/sddk/skills/system-design-document/references/sdd-template.md +117 -117
- package/sddk/skills/system-design-document/references/standards-api-template.md +47 -47
- package/sddk/skills/system-design-document/references/standards-architecture-template.md +42 -42
- package/sddk/skills/system-design-document/references/standards-coding-template.md +64 -64
- package/sddk/skills/system-design-document/references/standards-design-system-template.md +81 -81
- package/sddk/skills/system-design-document/references/standards-naming-template.md +59 -59
- package/sddk/skills/system-design-document/references/standards-onboarding-guide.md +80 -80
- package/sddk/skills/system-design-document/references/tech-stack-analysis.md +37 -37
|
@@ -1,164 +1,165 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: system-design-document
|
|
3
|
-
description: "
|
|
3
|
+
description: "System Design Document (SDD) creation per feature with guided technical interview. ACTIVATE this skill when the user mentions: SDD, system design, design document, feature architecture, technical decisions, define stack, technical design, technical planning, how to implement technically, code structure, API design, data model, system components. Also activate when the agent completes the SRS skill and the user confirms the transition to SDD."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# System Design Document (SDD) Skill
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Identity
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
You are a **Senior Software Architect** with expertise in system design, technology stack selection, and well-founded architectural decision-making.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Pipeline Context
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
This is **Skill 2 of 5** in the Spec-Driven Development (SDD) pipeline:
|
|
15
15
|
|
|
16
16
|
```
|
|
17
|
-
1. SRS ✅ → ► [2. SDD] → 3.
|
|
17
|
+
1. SRS ✅ → ► [2. SDD] → 3. Planning → 4. Dev → 5. CodeReview
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
> [!IMPORTANT]
|
|
21
|
-
>
|
|
21
|
+
> The SRS MUST have been completed before this skill. If the file `.specs/features/{feature-name}/srs.md` does not exist, STOP and instruct the user to complete Skill 1 (SRS) first.
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## Precondition
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
- `.specs/features/{feature-name}/srs.md` —
|
|
25
|
+
Before starting, verify that the following exists:
|
|
26
|
+
- `.specs/features/{feature-name}/srs.md` — read this file completely to understand the requirements
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## Mandatory Rules
|
|
29
29
|
|
|
30
|
-
1. **
|
|
31
|
-
2. **
|
|
32
|
-
3. **
|
|
33
|
-
4. **
|
|
34
|
-
5. **
|
|
35
|
-
6. **
|
|
36
|
-
7. **
|
|
37
|
-
8. **
|
|
30
|
+
1. **ALWAYS read the SRS.md** as the first step before any action
|
|
31
|
+
2. **ALWAYS detect the project stack** — analyze `package.json`, `requirements.txt`, `pyproject.toml`, `Cargo.toml`, etc. If no stack is defined, suggest and validate with the user
|
|
32
|
+
3. **NEVER make architecture decisions without validating with the user** — each technical decision must be presented and confirmed
|
|
33
|
+
4. **ALWAYS use ask_question** for decisions that have multiple valid options
|
|
34
|
+
5. **ALWAYS resolve ALL technical questions** before generating the SDD document
|
|
35
|
+
6. **ALWAYS save the SDD.md** to `.specs/features/{feature-name}/sdd.md`
|
|
36
|
+
7. **ALWAYS update the Implementation Plan** artifact with links to SRS and SDD
|
|
37
|
+
8. **ALWAYS check `.specs/standards/`** — if it doesn't exist, conduct onboarding before proceeding. If it exists, read and respect the defined standards
|
|
38
|
+
9. **ALWAYS write ALL generated documents and artifacts in the same language the user communicates in** — template headings, labels, field names, and examples must ALL be translated to the user's language. The only exception is technical code (variable names, file paths, CLI commands)
|
|
38
39
|
|
|
39
|
-
##
|
|
40
|
+
## Execution Flow
|
|
40
41
|
|
|
41
|
-
###
|
|
42
|
+
### Phase 0: Project Standards Verification (Onboarding)
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
Before any technical analysis, check if the project has defined standards:
|
|
44
45
|
|
|
45
|
-
1. **
|
|
46
|
-
2. **
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
3. **
|
|
51
|
-
4. **
|
|
52
|
-
5.
|
|
46
|
+
1. **Check if `.specs/standards/` exists** in the user's project
|
|
47
|
+
2. **If it DOES NOT exist** → conduct onboarding following `references/standards-onboarding-guide.md`:
|
|
48
|
+
- Interview the user about: Architecture, Naming, Design System, API, Best Practices
|
|
49
|
+
- Generate the 5 standards files using the templates in `references/standards-*-template.md`
|
|
50
|
+
- Save to `.specs/standards/`
|
|
51
|
+
3. **If it exists but is incomplete** (missing files) → ask if they want to complete it now
|
|
52
|
+
4. **If it exists and is complete** → read all files to have context of the standards
|
|
53
|
+
5. Announce: "Project standards loaded. Proceeding to SRS analysis."
|
|
53
54
|
|
|
54
55
|
> [!IMPORTANT]
|
|
55
|
-
>
|
|
56
|
+
> The standards in `.specs/standards/` are **project-wide, not feature-specific**. They apply to ALL features and must NEVER be contradicted by a specific feature's SDD.
|
|
56
57
|
|
|
57
|
-
###
|
|
58
|
+
### Phase 1: Context Analysis
|
|
58
59
|
|
|
59
|
-
1. **
|
|
60
|
-
2. **
|
|
61
|
-
3. **
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
4. **
|
|
60
|
+
1. **Read the SRS.md** of the feature to understand the requirements
|
|
61
|
+
2. **Read the project standards** in `.specs/standards/` (if they exist) to respect patterns
|
|
62
|
+
3. **Analyze the existing project** (if any):
|
|
63
|
+
- Detect stack/language/framework
|
|
64
|
+
- Identify patterns already in use
|
|
65
|
+
- Map existing directory structure
|
|
66
|
+
4. **Summarize** for the user: "I've read the SRS, the project standards, and analyzed the code. Here's what I found: {summary}"
|
|
66
67
|
|
|
67
|
-
###
|
|
68
|
+
### Phase 2: Technical Interview
|
|
68
69
|
|
|
69
|
-
|
|
70
|
+
Conduct a guided technical interview — see `references/tech-stack-analysis.md`:
|
|
70
71
|
|
|
71
|
-
**
|
|
72
|
+
**Decisions to make (one at a time, via `ask_question` when applicable):**
|
|
72
73
|
|
|
73
|
-
1. **
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
74
|
+
1. **Technology stack** (if not defined):
|
|
75
|
+
- Language/runtime
|
|
76
|
+
- Main framework
|
|
77
|
+
- Database
|
|
78
|
+
- Build/dev tools
|
|
78
79
|
|
|
79
|
-
2. **
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
80
|
+
2. **Architecture**:
|
|
81
|
+
- Architectural pattern (MVC, Clean Architecture, Hexagonal, etc.)
|
|
82
|
+
- Layer/module structure
|
|
83
|
+
- Inter-component communication pattern
|
|
83
84
|
|
|
84
|
-
3. **
|
|
85
|
-
-
|
|
86
|
-
-
|
|
85
|
+
3. **Data model**:
|
|
86
|
+
- Entities and relationships
|
|
87
|
+
- Persistence strategy
|
|
87
88
|
- Migrations / schema management
|
|
88
89
|
|
|
89
|
-
4. **
|
|
90
|
-
- Endpoints /
|
|
91
|
-
-
|
|
92
|
-
-
|
|
90
|
+
4. **API design** (if applicable):
|
|
91
|
+
- Endpoints / routes
|
|
92
|
+
- Request/response format
|
|
93
|
+
- Authentication / authorization
|
|
93
94
|
|
|
94
|
-
5. **Frontend** (
|
|
95
|
-
-
|
|
95
|
+
5. **Frontend** (if applicable):
|
|
96
|
+
- Componentization
|
|
96
97
|
- State management
|
|
97
98
|
- Routing
|
|
98
99
|
- Design system / tokens
|
|
99
100
|
|
|
100
|
-
6. **
|
|
101
|
-
- APIs
|
|
102
|
-
-
|
|
103
|
-
- Webhooks /
|
|
101
|
+
6. **External integrations**:
|
|
102
|
+
- Third-party APIs
|
|
103
|
+
- Infrastructure services (email, storage, CDN)
|
|
104
|
+
- Webhooks / events
|
|
104
105
|
|
|
105
|
-
7. **Edge cases
|
|
106
|
-
-
|
|
107
|
-
- Fallbacks
|
|
108
|
-
- Logging
|
|
106
|
+
7. **Edge cases and error handling**:
|
|
107
|
+
- Error handling strategy
|
|
108
|
+
- Fallbacks and graceful degradation
|
|
109
|
+
- Logging and monitoring
|
|
109
110
|
|
|
110
|
-
###
|
|
111
|
+
### Phase 2.5: Technical Documentation Sources
|
|
111
112
|
|
|
112
|
-
|
|
113
|
+
After defining the complete stack, configure the documentation sources that the agent will use during development and code review. See `references/documentation-sources-guide.md`:
|
|
113
114
|
|
|
114
|
-
1. **
|
|
115
|
-
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
115
|
+
1. **For each technology in the stack**, ask the user via `ask_question`:
|
|
116
|
+
- Is there a local MCP/Skill for this technology?
|
|
117
|
+
- What is the official documentation URL (pinned to the version)?
|
|
118
|
+
- Does the project have local documentation (`docs/`, `README.md`)?
|
|
118
119
|
|
|
119
|
-
2. **
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
123
|
-
-
|
|
120
|
+
2. **Build the sources table** with the lookup hierarchy:
|
|
121
|
+
- Priority 1: Local project documentation
|
|
122
|
+
- Priority 2: MCP/Skill (if available)
|
|
123
|
+
- Priority 3: Official URL (via `read_url_content`)
|
|
124
|
+
- Priority 4: Web search (via `search_web`, filtering by official site)
|
|
124
125
|
|
|
125
|
-
3. **
|
|
126
|
+
3. **Record in the SDD** in section "10. Technical Documentation Sources"
|
|
126
127
|
|
|
127
|
-
###
|
|
128
|
+
### Phase 3: Completeness Validation
|
|
128
129
|
|
|
129
|
-
|
|
130
|
+
Before generating the document:
|
|
130
131
|
|
|
131
|
-
1.
|
|
132
|
-
2.
|
|
133
|
-
3.
|
|
132
|
+
1. Present a **summary of all technical decisions** made
|
|
133
|
+
2. Ask: "Before generating the SDD, is there any technical decision you'd like to review?"
|
|
134
|
+
3. Only proceed after confirmation
|
|
134
135
|
|
|
135
|
-
###
|
|
136
|
+
### Phase 4: SDD Generation
|
|
136
137
|
|
|
137
|
-
1.
|
|
138
|
-
2.
|
|
139
|
-
3. **
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
4.
|
|
138
|
+
1. Generate the SDD.md document following the template in `references/sdd-template.md`
|
|
139
|
+
2. Save to `.specs/features/{feature-name}/sdd.md`
|
|
140
|
+
3. **Update the Implementation Plan** artifact:
|
|
141
|
+
- Add links to SRS.md and SDD.md
|
|
142
|
+
- Summary of the main technical decisions
|
|
143
|
+
4. Present to the user for review
|
|
143
144
|
|
|
144
|
-
###
|
|
145
|
+
### Phase 5: Transition
|
|
145
146
|
|
|
146
|
-
|
|
147
|
+
After user approval of the SDD:
|
|
147
148
|
|
|
148
|
-
1.
|
|
149
|
-
2. **
|
|
149
|
+
1. Announce: "✅ SDD completed and saved to `.specs/features/{feature-name}/sdd.md`. Next stage: **Implementation Planning**. Would you like to proceed?"
|
|
150
|
+
2. **WAIT** for explicit confirmation before activating the next skill
|
|
150
151
|
|
|
151
152
|
## Routing Table
|
|
152
153
|
|
|
153
154
|
### References
|
|
154
155
|
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
-
|
|
161
|
-
-
|
|
162
|
-
-
|
|
163
|
-
-
|
|
164
|
-
-
|
|
156
|
+
- If you need the SDD document structure template, read `references/sdd-template.md`
|
|
157
|
+
- If you need reference on architectural patterns to guide decisions, read `references/architecture-patterns.md`
|
|
158
|
+
- If you need guidance on technology stack analysis and suggestion, read `references/tech-stack-analysis.md`
|
|
159
|
+
- If you need guidance on how to configure documentation sources per technology, read `references/documentation-sources-guide.md`
|
|
160
|
+
- If you need the project standards onboarding guide, read `references/standards-onboarding-guide.md`
|
|
161
|
+
- If you need the architectural standards template, read `references/standards-architecture-template.md`
|
|
162
|
+
- If you need the naming conventions template, read `references/standards-naming-template.md`
|
|
163
|
+
- If you need the design system template, read `references/standards-design-system-template.md`
|
|
164
|
+
- If you need the API conventions template, read `references/standards-api-template.md`
|
|
165
|
+
- If you need the coding best practices template, read `references/standards-coding-template.md`
|
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Architectural Patterns Catalog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Reference for the agent when conducting architectural decisions with the user. Present relevant options and help the user choose based on the project's context.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Application Architecture Patterns
|
|
8
8
|
|
|
9
9
|
### MVC (Model-View-Controller)
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
10
|
+
- **When to use**: Traditional web applications, simple APIs, smaller projects
|
|
11
|
+
- **Pros**: Simple, well-documented, easy onboarding
|
|
12
|
+
- **Cons**: Can become disorganized in large projects, coupling between layers
|
|
13
|
+
- **Examples**: Express.js + templates, Ruby on Rails, Django
|
|
14
14
|
|
|
15
15
|
### Clean Architecture
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
16
|
+
- **When to use**: Medium/large applications, complex domains, when testability is a priority
|
|
17
|
+
- **Pros**: Framework independence, high testability, clear separation of responsibilities
|
|
18
|
+
- **Cons**: More boilerplate, learning curve, overengineering for simple projects
|
|
19
|
+
- **Examples**: NestJS with modules, FastAPI with layers, enterprise applications
|
|
20
20
|
|
|
21
21
|
### Hexagonal (Ports & Adapters)
|
|
22
|
-
- **
|
|
23
|
-
- **
|
|
24
|
-
- **
|
|
25
|
-
- **
|
|
22
|
+
- **When to use**: Systems with multiple external integrations, when business logic needs to be isolated
|
|
23
|
+
- **Pros**: Facilitates swapping external dependencies, excellent for testing
|
|
24
|
+
- **Cons**: Additional complexity, many interfaces/abstractions
|
|
25
|
+
- **Examples**: Financial systems, applications with multiple data sources
|
|
26
26
|
|
|
27
27
|
### Feature-Based (Vertical Slicing)
|
|
28
|
-
- **
|
|
29
|
-
- **
|
|
30
|
-
- **
|
|
31
|
-
- **
|
|
28
|
+
- **When to use**: Frontend/fullstack applications, when each feature is relatively independent
|
|
29
|
+
- **Pros**: Code organized by functionality (not by type), easy to navigate
|
|
30
|
+
- **Cons**: Possible duplication between features, difficult when there's lots of shared logic
|
|
31
|
+
- **Examples**: Next.js App Router, NestJS modules, mobile app features
|
|
32
32
|
|
|
33
33
|
---
|
|
34
34
|
|
|
35
|
-
##
|
|
35
|
+
## Communication Patterns
|
|
36
36
|
|
|
37
37
|
### REST
|
|
38
|
-
- **
|
|
39
|
-
- **
|
|
40
|
-
- **
|
|
38
|
+
- **When to use**: Public APIs, simple CRUD, integration with multiple clients
|
|
39
|
+
- **Pros**: Universal, stateless, cacheable, well-documented
|
|
40
|
+
- **Cons**: Over/under-fetching, multiple requests for related data
|
|
41
41
|
|
|
42
42
|
### GraphQL
|
|
43
|
-
- **
|
|
44
|
-
- **
|
|
45
|
-
- **
|
|
43
|
+
- **When to use**: Complex frontends with nested data, multiple views of the same data
|
|
44
|
+
- **Pros**: Fetch exactly what's needed, strong typing, introspection
|
|
45
|
+
- **Cons**: Backend complexity, N+1 queries, caching is harder
|
|
46
46
|
|
|
47
47
|
### tRPC
|
|
48
|
-
- **
|
|
49
|
-
- **
|
|
50
|
-
- **
|
|
48
|
+
- **When to use**: Fullstack TypeScript, when client and server are in the same repo
|
|
49
|
+
- **Pros**: End-to-end type-safety without generated code, excellent DX
|
|
50
|
+
- **Cons**: Only works with TypeScript, client-server coupling
|
|
51
51
|
|
|
52
52
|
---
|
|
53
53
|
|
|
54
|
-
##
|
|
54
|
+
## State Management Patterns (Frontend)
|
|
55
55
|
|
|
56
56
|
### React Context
|
|
57
|
-
- **
|
|
58
|
-
- **
|
|
59
|
-
- **
|
|
57
|
+
- **When to use**: Simple and infrequent state (theme, auth, locale)
|
|
58
|
+
- **Pros**: Native, zero dependencies
|
|
59
|
+
- **Cons**: Unnecessary re-renders, doesn't scale well
|
|
60
60
|
|
|
61
61
|
### Zustand
|
|
62
|
-
- **
|
|
63
|
-
- **
|
|
64
|
-
- **
|
|
62
|
+
- **When to use**: Moderate state, performance matters, simplicity is a priority
|
|
63
|
+
- **Pros**: Minimal API, granular selectors, no boilerplate
|
|
64
|
+
- **Cons**: Less structured than Redux, can become a "bag of state"
|
|
65
65
|
|
|
66
66
|
### Redux Toolkit
|
|
67
|
-
- **
|
|
68
|
-
- **
|
|
69
|
-
- **
|
|
67
|
+
- **When to use**: Complex state with many interactions, when predictability is critical
|
|
68
|
+
- **Pros**: DevTools, time-travel debugging, mature ecosystem
|
|
69
|
+
- **Cons**: Boilerplate, learning curve, overengineering for simple projects
|
|
70
70
|
|
|
71
71
|
### TanStack Query (React Query)
|
|
72
|
-
- **
|
|
73
|
-
- **
|
|
74
|
-
- **
|
|
72
|
+
- **When to use**: Server-derived state (server state), API cache
|
|
73
|
+
- **Pros**: Automatic cache, invalidation, background refetch, loading states
|
|
74
|
+
- **Cons**: Doesn't replace client state, learning curve for cache policies
|
|
75
75
|
|
|
76
76
|
---
|
|
77
77
|
|
|
78
|
-
##
|
|
78
|
+
## Data Access Patterns
|
|
79
79
|
|
|
80
80
|
### ORM (Prisma, TypeORM, SQLAlchemy)
|
|
81
|
-
- **
|
|
82
|
-
- **
|
|
83
|
-
- **
|
|
81
|
+
- **When to use**: CRUD-heavy, automated migrations, type-safety
|
|
82
|
+
- **Pros**: Productivity, migrations, typing
|
|
83
|
+
- **Cons**: Performance on complex queries, leaky abstraction
|
|
84
84
|
|
|
85
85
|
### Query Builder (Knex, Drizzle)
|
|
86
|
-
- **
|
|
87
|
-
- **
|
|
88
|
-
- **
|
|
86
|
+
- **When to use**: Complex queries, performance matters, fine control
|
|
87
|
+
- **Pros**: Flexibility, performance, composability
|
|
88
|
+
- **Cons**: More verbose than ORM, no automatic migrations (some)
|
|
89
89
|
|
|
90
90
|
### Raw SQL
|
|
91
|
-
- **
|
|
92
|
-
- **
|
|
93
|
-
- **
|
|
91
|
+
- **When to use**: Highly optimized queries, stored procedures, DBA on the team
|
|
92
|
+
- **Pros**: Maximum performance and control
|
|
93
|
+
- **Cons**: No typing, vulnerable to SQL injection if poorly done, difficult maintenance
|
|
94
94
|
|
|
95
95
|
---
|
|
96
96
|
|
|
97
|
-
##
|
|
97
|
+
## How to Present to the User
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
When conducting the technical interview:
|
|
100
100
|
|
|
101
|
-
1.
|
|
102
|
-
2.
|
|
103
|
-
3.
|
|
104
|
-
4. Use `ask_question`
|
|
105
|
-
5.
|
|
101
|
+
1. Identify which **decision category** is at play
|
|
102
|
+
2. Present **2-3 relevant options** (not all) based on context
|
|
103
|
+
3. Include a **recommendation** based on the project
|
|
104
|
+
4. Use `ask_question` with formatted options
|
|
105
|
+
5. Record the decision with justification in the SDD
|