ai-spector 0.1.1
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/README.md +169 -0
- package/_templates/basic_design/db-design-template.md +177 -0
- package/_templates/basic_design/detail-api-template.md +278 -0
- package/_templates/basic_design/detail-screen-template.md +281 -0
- package/_templates/basic_design/list-api-template.md +130 -0
- package/_templates/basic_design/list-screen-template.md +242 -0
- package/_templates/detail_design/common/architecture-overview-template.md +302 -0
- package/_templates/detail_design/common/deployment-infrastructure-template.md +461 -0
- package/_templates/detail_design/common/error-handling-patterns-template.md +460 -0
- package/_templates/detail_design/common/integration-patterns-template.md +410 -0
- package/_templates/detail_design/common/performance-standards-template.md +406 -0
- package/_templates/detail_design/common/security-patterns-template.md +395 -0
- package/_templates/detail_design/feature-detail-design-template.md +773 -0
- package/_templates/detail_design/feature-list-template.md +39 -0
- package/_templates/srs/1-introduction.md +58 -0
- package/_templates/srs/2-overall-description.md +91 -0
- package/_templates/srs/3-use-case-detail-template.md +142 -0
- package/_templates/srs/3-use-cases.md +53 -0
- package/_templates/srs/4-system-feature-detail-template.md +131 -0
- package/_templates/srs/4-system-features-list-template.md +39 -0
- package/_templates/srs/5-data-requirements.md +59 -0
- package/_templates/srs/6-external-interfaces.md +56 -0
- package/_templates/srs/7-quality-attributes.md +74 -0
- package/_templates/srs/8-internationalization.md +36 -0
- package/_templates/srs/9-other-requirements.md +46 -0
- package/assets/cursor/commands/analyze.md +39 -0
- package/assets/cursor/commands/generate-detail-design.md +35 -0
- package/assets/cursor/commands/generate-srs.md +38 -0
- package/assets/cursor/skills/spec-writer/SKILL.md +33 -0
- package/assets/workflow/config/analyze.graphify.json +36 -0
- package/assets/workflow/config/completeness-rules.detail-design.json +57 -0
- package/assets/workflow/config/completeness-rules.srs.json +72 -0
- package/assets/workflow/config/dag.detail-design.json +64 -0
- package/assets/workflow/config/dag.srs.json +87 -0
- package/assets/workflow/state/state.template.json +26 -0
- package/assets/workflow/templates/basic_design/db-design-template.md +177 -0
- package/assets/workflow/templates/basic_design/detail-api-template.md +278 -0
- package/assets/workflow/templates/basic_design/detail-screen-template.md +281 -0
- package/assets/workflow/templates/basic_design/list-api-template.md +130 -0
- package/assets/workflow/templates/basic_design/list-screen-template.md +242 -0
- package/assets/workflow/templates/detail_design/common/architecture-overview-template.md +302 -0
- package/assets/workflow/templates/detail_design/common/deployment-infrastructure-template.md +461 -0
- package/assets/workflow/templates/detail_design/common/error-handling-patterns-template.md +460 -0
- package/assets/workflow/templates/detail_design/common/integration-patterns-template.md +410 -0
- package/assets/workflow/templates/detail_design/common/performance-standards-template.md +406 -0
- package/assets/workflow/templates/detail_design/common/security-patterns-template.md +395 -0
- package/assets/workflow/templates/detail_design/feature-detail-design-template.md +773 -0
- package/assets/workflow/templates/detail_design/feature-list-template.md +39 -0
- package/assets/workflow/templates/srs/1-introduction.md +58 -0
- package/assets/workflow/templates/srs/2-overall-description.md +91 -0
- package/assets/workflow/templates/srs/3-use-case-detail-template.md +142 -0
- package/assets/workflow/templates/srs/3-use-cases.md +53 -0
- package/assets/workflow/templates/srs/4-system-feature-detail-template.md +131 -0
- package/assets/workflow/templates/srs/4-system-features-list-template.md +39 -0
- package/assets/workflow/templates/srs/5-data-requirements.md +59 -0
- package/assets/workflow/templates/srs/6-external-interfaces.md +56 -0
- package/assets/workflow/templates/srs/7-quality-attributes.md +74 -0
- package/assets/workflow/templates/srs/8-internationalization.md +36 -0
- package/assets/workflow/templates/srs/9-other-requirements.md +46 -0
- package/bin/spec-writer.js +56 -0
- package/package.json +25 -0
- package/src/cli/helpers/fs.js +50 -0
- package/src/cli/init.js +178 -0
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
# Architecture Overview: <Project Name>
|
|
2
|
+
|
|
3
|
+
> This document describes the system-wide architecture, technology stack, design principles, and architectural patterns used across all features.
|
|
4
|
+
|
|
5
|
+
**Source Requirements:** SRS Section 2 (Overall Description), Section 7 (Quality Attributes)
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Overview
|
|
10
|
+
|
|
11
|
+
**Purpose:**
|
|
12
|
+
> Describe the purpose of this architecture document and its scope.
|
|
13
|
+
|
|
14
|
+
**Architecture Principles:**
|
|
15
|
+
- <Principle 1: e.g., Microservices architecture, separation of concerns>
|
|
16
|
+
- <Principle 2: e.g., API-first design>
|
|
17
|
+
- <Principle 3: e.g., Scalability and high availability>
|
|
18
|
+
- <Principle 4: e.g., Security by design>
|
|
19
|
+
|
|
20
|
+
**Design Goals:**
|
|
21
|
+
- <Goal 1>
|
|
22
|
+
- <Goal 2>
|
|
23
|
+
- <Goal 3>
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 2. System Context (C4 Level 1)
|
|
28
|
+
|
|
29
|
+
> High-level view showing the system and its relationships with users and external systems.
|
|
30
|
+
|
|
31
|
+
```mermaid
|
|
32
|
+
C4Context
|
|
33
|
+
title System Context Diagram
|
|
34
|
+
|
|
35
|
+
Person(user, "User", "End user of the system")
|
|
36
|
+
System(softwareSystem, "<System Name>", "Provides core functionality")
|
|
37
|
+
System_Ext(emailSystem, "Email Service", "External email service")
|
|
38
|
+
System_Ext(paymentSystem, "Payment Gateway", "External payment service")
|
|
39
|
+
|
|
40
|
+
Rel(user, softwareSystem, "Uses")
|
|
41
|
+
Rel(softwareSystem, emailSystem, "Sends emails via")
|
|
42
|
+
Rel(softwareSystem, paymentSystem, "Processes payments via")
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**External Systems:**
|
|
46
|
+
- <External System 1>: <Purpose and relationship>
|
|
47
|
+
- <External System 2>: <Purpose and relationship>
|
|
48
|
+
|
|
49
|
+
**Users:**
|
|
50
|
+
- <User Type 1>: <Role and interaction>
|
|
51
|
+
- <User Type 2>: <Role and interaction>
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 3. Container Architecture (C4 Level 2)
|
|
56
|
+
|
|
57
|
+
> Shows the high-level technical building blocks (applications, databases, file systems, etc.).
|
|
58
|
+
|
|
59
|
+
```mermaid
|
|
60
|
+
C4Container
|
|
61
|
+
title Container Diagram
|
|
62
|
+
|
|
63
|
+
Person(user, "User")
|
|
64
|
+
System_Boundary(systemBoundary, "<System Name>") {
|
|
65
|
+
Container(webApp, "Web Application", "React/Next.js", "Provides UI")
|
|
66
|
+
Container(api, "API Gateway", "Node.js/Express", "REST API")
|
|
67
|
+
Container(authService, "Authentication Service", "Node.js", "Handles authentication")
|
|
68
|
+
ContainerDb(database, "Database", "PostgreSQL", "Stores data")
|
|
69
|
+
Container(messageQueue, "Message Queue", "RabbitMQ", "Handles async processing")
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
System_Ext(emailService, "Email Service")
|
|
73
|
+
|
|
74
|
+
Rel(user, webApp, "Uses")
|
|
75
|
+
Rel(webApp, api, "API calls")
|
|
76
|
+
Rel(api, authService, "Validates tokens")
|
|
77
|
+
Rel(api, database, "Reads from and writes to")
|
|
78
|
+
Rel(api, messageQueue, "Publishes messages")
|
|
79
|
+
Rel(messageQueue, emailService, "Sends emails")
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Containers:**
|
|
83
|
+
|
|
84
|
+
| Container | Technology | Purpose | Responsibilities |
|
|
85
|
+
|-----------|------------|---------|------------------|
|
|
86
|
+
| Web Application | <Tech Stack> | <Purpose> | <Responsibilities> |
|
|
87
|
+
| API Gateway | <Tech Stack> | <Purpose> | <Responsibilities> |
|
|
88
|
+
| Database | <DBMS> | <Purpose> | <Responsibilities> |
|
|
89
|
+
| Message Queue | <MQ Technology> | <Purpose> | <Responsibilities> |
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 4. Component Architecture (C4 Level 3)
|
|
94
|
+
|
|
95
|
+
> Shows how containers are broken down into components (for key containers only).
|
|
96
|
+
|
|
97
|
+
**Example: API Gateway Components**
|
|
98
|
+
|
|
99
|
+
```mermaid
|
|
100
|
+
C4Component
|
|
101
|
+
title API Gateway Component Diagram
|
|
102
|
+
|
|
103
|
+
Container_Boundary(apiGateway, "API Gateway") {
|
|
104
|
+
Component(authController, "Auth Controller", "Express Router", "Handles authentication endpoints")
|
|
105
|
+
Component(userController, "User Controller", "Express Router", "Handles user management")
|
|
106
|
+
Component(validationMiddleware, "Validation Middleware", "Express Middleware", "Validates requests")
|
|
107
|
+
Component(errorHandler, "Error Handler", "Express Middleware", "Handles errors")
|
|
108
|
+
ComponentDb(database, "Database")
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
Rel(authController, validationMiddleware, "Uses")
|
|
112
|
+
Rel(authController, errorHandler, "Uses")
|
|
113
|
+
Rel(userController, validationMiddleware, "Uses")
|
|
114
|
+
Rel(userController, database, "Reads from and writes to")
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## 5. Technology Stack
|
|
120
|
+
|
|
121
|
+
**Frontend:**
|
|
122
|
+
- Framework: <React/Vue/Angular>
|
|
123
|
+
- Language: <TypeScript/JavaScript>
|
|
124
|
+
- Build Tool: <Webpack/Vite>
|
|
125
|
+
- State Management: <Redux/Zustand>
|
|
126
|
+
- UI Library: <Material-UI/Ant Design>
|
|
127
|
+
|
|
128
|
+
**Backend:**
|
|
129
|
+
- Runtime: <Node.js/Python/Java>
|
|
130
|
+
- Framework: <Express/FastAPI/Spring Boot>
|
|
131
|
+
- Language: <TypeScript/Python/Java>
|
|
132
|
+
|
|
133
|
+
**Database:**
|
|
134
|
+
- Primary Database: <PostgreSQL/MySQL/MongoDB>
|
|
135
|
+
- Caching: <Redis/Memcached>
|
|
136
|
+
- Search: <Elasticsearch/OpenSearch> (if applicable)
|
|
137
|
+
|
|
138
|
+
**Infrastructure:**
|
|
139
|
+
- Containerization: <Docker>
|
|
140
|
+
- Orchestration: <Kubernetes/Docker Compose>
|
|
141
|
+
- Cloud Provider: <AWS/Azure/GCP>
|
|
142
|
+
- CI/CD: <GitHub Actions/Jenkins/GitLab CI>
|
|
143
|
+
|
|
144
|
+
**Other Services:**
|
|
145
|
+
- Message Queue: <RabbitMQ/Apache Kafka>
|
|
146
|
+
- Monitoring: <Prometheus/Grafana>
|
|
147
|
+
- Logging: <ELK Stack/CloudWatch>
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 6. Architectural Patterns
|
|
152
|
+
|
|
153
|
+
**Pattern 1: <Pattern Name>**
|
|
154
|
+
- **Description:** <Description of the pattern>
|
|
155
|
+
- **Rationale:** <Why this pattern is used>
|
|
156
|
+
- **Implementation:** <How it's implemented>
|
|
157
|
+
|
|
158
|
+
**Pattern 2: <Pattern Name>**
|
|
159
|
+
- **Description:** <Description>
|
|
160
|
+
- **Rationale:** <Rationale>
|
|
161
|
+
- **Implementation:** <Implementation>
|
|
162
|
+
|
|
163
|
+
**Common Patterns:**
|
|
164
|
+
- **Layered Architecture:** <Description>
|
|
165
|
+
- **Microservices:** <Description>
|
|
166
|
+
- **Event-Driven Architecture:** <Description>
|
|
167
|
+
- **API Gateway Pattern:** <Description>
|
|
168
|
+
- **Database per Service:** <Description>
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## 7. Design Principles
|
|
173
|
+
|
|
174
|
+
**Separation of Concerns:**
|
|
175
|
+
> Each component/module should have a single, well-defined responsibility.
|
|
176
|
+
|
|
177
|
+
**Loose Coupling:**
|
|
178
|
+
> Components should interact through well-defined interfaces, minimizing dependencies.
|
|
179
|
+
|
|
180
|
+
**High Cohesion:**
|
|
181
|
+
> Related functionality should be grouped together within components.
|
|
182
|
+
|
|
183
|
+
**Scalability:**
|
|
184
|
+
> System should be designed to handle growth in users, data, and transactions.
|
|
185
|
+
|
|
186
|
+
**Security:**
|
|
187
|
+
> Security should be built into every layer of the architecture.
|
|
188
|
+
|
|
189
|
+
**Observability:**
|
|
190
|
+
> System should provide visibility into its operations through logging, monitoring, and tracing.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## 8. System Boundaries
|
|
195
|
+
|
|
196
|
+
**Internal Components:**
|
|
197
|
+
- <Component 1>
|
|
198
|
+
- <Component 2>
|
|
199
|
+
|
|
200
|
+
**External Dependencies:**
|
|
201
|
+
- <External Service 1>: <Purpose, SLA>
|
|
202
|
+
- <External Service 2>: <Purpose, SLA>
|
|
203
|
+
|
|
204
|
+
**Integration Points:**
|
|
205
|
+
- <Integration Point 1>: <Protocol, format>
|
|
206
|
+
- <Integration Point 2>: <Protocol, format>
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## 9. Data Flow
|
|
211
|
+
|
|
212
|
+
**High-Level Data Flow:**
|
|
213
|
+
|
|
214
|
+
```mermaid
|
|
215
|
+
flowchart LR
|
|
216
|
+
User[User] -->|Request| WebApp[Web Application]
|
|
217
|
+
WebApp -->|API Call| APIGateway[API Gateway]
|
|
218
|
+
APIGateway -->|Query| Database[(Database)]
|
|
219
|
+
APIGateway -->|Publish| MessageQueue[Message Queue]
|
|
220
|
+
MessageQueue -->|Process| WorkerService[Worker Service]
|
|
221
|
+
WorkerService -->|Update| Database
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**Data Flow Patterns:**
|
|
225
|
+
- **Request-Response:** <Description>
|
|
226
|
+
- **Event-Driven:** <Description>
|
|
227
|
+
- **Batch Processing:** <Description>
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## 10. Non-Functional Requirements
|
|
232
|
+
|
|
233
|
+
**Performance:**
|
|
234
|
+
- API Response Time: <Target, e.g., < 200ms for 95th percentile>
|
|
235
|
+
- Throughput: <Target, e.g., 1000 requests/second>
|
|
236
|
+
- Database Query Time: <Target>
|
|
237
|
+
|
|
238
|
+
**Scalability:**
|
|
239
|
+
- Horizontal Scaling: <Approach>
|
|
240
|
+
- Vertical Scaling: <Approach>
|
|
241
|
+
- Auto-scaling: <Configuration>
|
|
242
|
+
|
|
243
|
+
**Availability:**
|
|
244
|
+
- Target Uptime: <99.9%>
|
|
245
|
+
- Disaster Recovery: <Strategy>
|
|
246
|
+
- Backup Strategy: <Strategy>
|
|
247
|
+
|
|
248
|
+
**Security:**
|
|
249
|
+
- Authentication: <Method>
|
|
250
|
+
- Authorization: <Method>
|
|
251
|
+
- Data Encryption: <At rest, in transit>
|
|
252
|
+
- Compliance: <Standards>
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## 11. Deployment Architecture
|
|
257
|
+
|
|
258
|
+
**Environments:**
|
|
259
|
+
- Development: <Description>
|
|
260
|
+
- Staging: <Description>
|
|
261
|
+
- Production: <Description>
|
|
262
|
+
|
|
263
|
+
**Deployment Strategy:**
|
|
264
|
+
- <Blue-Green/Canary/Rolling Update>
|
|
265
|
+
|
|
266
|
+
**Infrastructure Components:**
|
|
267
|
+
- Load Balancer: <Type and configuration>
|
|
268
|
+
- Application Servers: <Number and configuration>
|
|
269
|
+
- Database: <Configuration and replication>
|
|
270
|
+
- Caching Layer: <Configuration>
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## 12. References
|
|
275
|
+
|
|
276
|
+
**Related Documents:**
|
|
277
|
+
- [Security Patterns](../common/security-patterns-template.md)
|
|
278
|
+
- [Performance Standards](../common/performance-standards-template.md)
|
|
279
|
+
- [Integration Patterns](../common/integration-patterns-template.md)
|
|
280
|
+
- [Deployment & Infrastructure](../common/deployment-infrastructure-template.md)
|
|
281
|
+
- [Basic Design - API Design](../../basic_design/api-design-template.md)
|
|
282
|
+
- [Basic Design - Database Design](../../basic_design/db-design-template.md)
|
|
283
|
+
|
|
284
|
+
**SRS References:**
|
|
285
|
+
- SRS Section 2: Overall Description
|
|
286
|
+
- SRS Section 7: Quality Attributes
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## 13. Notes
|
|
291
|
+
|
|
292
|
+
**Design Decisions:**
|
|
293
|
+
- <Decision 1>: <Rationale>
|
|
294
|
+
- <Decision 2>: <Rationale>
|
|
295
|
+
|
|
296
|
+
**Trade-offs:**
|
|
297
|
+
- <Trade-off 1>: <Decision and rationale>
|
|
298
|
+
- <Trade-off 2>: <Decision and rationale>
|
|
299
|
+
|
|
300
|
+
**Future Considerations:**
|
|
301
|
+
- <Future enhancement 1>
|
|
302
|
+
- <Future enhancement 2>
|