1
---
2
name: architecture-blueprint-generator
3
description: 'Comprehensive project architecture blueprint generator that analyzes codebases to create detailed architectural documentation. Automatically detects technology stacks and architectural patterns, generates visual diagrams, documents implementation patterns, and provides extensible blueprints for maintaining architectural consistency and guiding new development.'
4
---
5
6
# Comprehensive Project Architecture Blueprint Generator
7
8
## Configuration Variables
9
${PROJECT_TYPE="Auto-detect|.NET|Java|React|Angular|Python|Node.js|Flutter|Other"} <!-- Primary technology -->
10
${ARCHITECTURE_PATTERN="Auto-detect|Clean Architecture|Microservices|Layered|MVVM|MVC|Hexagonal|Event-Driven|Serverless|Monolithic|Other"} <!-- Primary architectural pattern -->
11
${DIAGRAM_TYPE="C4|UML|Flow|Component|None"} <!-- Architecture diagram type -->
12
${DETAIL_LEVEL="High-level|Detailed|Comprehensive|Implementation-Ready"} <!-- Level of detail to include -->
13
${INCLUDES_CODE_EXAMPLES=true|false} <!-- Include sample code to illustrate patterns -->
14
${INCLUDES_IMPLEMENTATION_PATTERNS=true|false} <!-- Include detailed implementation patterns -->
15
${INCLUDES_DECISION_RECORDS=true|false} <!-- Include architectural decision records -->
16
${FOCUS_ON_EXTENSIBILITY=true|false} <!-- Emphasize extension points and patterns -->
17
18
## Generated Prompt
19
20
"Create a comprehensive 'Project_Architecture_Blueprint.md' document that thoroughly analyzes the architectural patterns in the codebase to serve as a definitive reference for maintaining architectural consistency. Use the following approach:
21
22
### 1. Architecture Detection and Analysis
23
- ${PROJECT_TYPE == "Auto-detect" ? "Analyze the project structure to identify all technology stacks and frameworks in use by examining:
24
- Project and configuration files
25
- Package dependencies and import statements
26
- Framework-specific patterns and conventions
27
- Build and deployment configurations" : "Focus on ${PROJECT_TYPE} specific patterns and practices"}
28
29
- ${ARCHITECTURE_PATTERN == "Auto-detect" ? "Determine the architectural pattern(s) by analyzing:
30
- Folder organization and namespacing
31
- Dependency flow and component boundaries
32
- Interface segregation and abstraction patterns
33
- Communication mechanisms between components" : "Document how the ${ARCHITECTURE_PATTERN} architecture is implemented"}
34
35
### 2. Architectural Overview
36
- Provide a clear, concise explanation of the overall architectural approach
37
- Document the guiding principles evident in the architectural choices
38
- Identify architectural boundaries and how they're enforced
39
- Note any hybrid architectural patterns or adaptations of standard patterns
40
41
### 3. Architecture Visualization
42
${DIAGRAM_TYPE != "None" ? `Create ${DIAGRAM_TYPE} diagrams at multiple levels of abstraction:
43
- High-level architectural overview showing major subsystems
44
- Component interaction diagrams showing relationships and dependencies
45
- Data flow diagrams showing how information moves through the system
46
- Ensure diagrams accurately reflect the actual implementation, not theoretical patterns` : "Describe the component relationships based on actual code dependencies, providing clear textual explanations of:
47
- Subsystem organization and boundaries
48
- Dependency directions and component interactions
49
- Data flow and process sequences"}
50
51
### 4. Core Architectural Components
52
For each architectural component discovered in the codebase:
53
54
- **Purpose and Responsibility**:
55
- Primary function within the architecture
56
- Business domains or technical concerns addressed
57
- Boundaries and scope limitations
58
59
- **Internal Structure**:
60
- Organization of classes/modules within the component
61
- Key abstractions and their implementations
62
- Design patterns utilized
63
64
- **Interaction Patterns**:
65
- How the component communicates with others
66
- Interfaces exposed and consumed
67
- Dependency injection patterns
68
- Event publishing/subscription mechanisms
69
70
- **Evolution Patterns**:
71
- How the component can be extended
72
- Variation points and plugin mechanisms
73
- Configuration and customization approaches
74
75
### 5. Architectural Layers and Dependencies
76
- Map the layer structure as implemented in the codebase
77
- Document the dependency rules between layers
78
- Identify abstraction mechanisms that enable layer separation
79
- Note any circular dependencies or layer violations
80
- Document dependency injection patterns used to maintain separation
81
82
### 6. Data Architecture
83
- Document domain model structure and organization
84
- Map entity relationships and aggregation patterns
85
- Identify data access patterns (repositories, data mappers, etc.)
86
- Document data transformation and mapping approaches
87
- Note caching strategies and implementations
88
- Document data validation patterns
89
90
### 7. Cross-Cutting Concerns Implementation
91
Document implementation patterns for cross-cutting concerns:
92
93
- **Authentication & Authorization**:
94
- Security model implementation
95
- Permission enforcement patterns
96
- Identity management approach
97
- Security boundary patterns
98
99
- **Error Handling & Resilience**:
100
- Exception handling patterns
101
- Retry and circuit breaker implementations
102
- Fallback and graceful degradation strategies
103
- Error reporting and monitoring approaches
104
105
- **Logging & Monitoring**:
106
- Instrumentation patterns
107
- Observability implementation
108
- Diagnostic information flow
109
- Performance monitoring approach
110
111
- **Validation**:
112
- Input validation strategies
113
- Business rule validation implementation
114
- Validation responsibility distribution
115
- Error reporting patterns
116
117
- **Configuration Management**:
118
- Configuration source patterns
119
- Environment-specific configuration strategies
120
- Secret management approach
121
- Feature flag implementation
122
123
### 8. Service Communication Patterns
124
- Document service boundary definitions
125
- Identify communication protocols and formats
126
- Map synchronous vs. asynchronous communication patterns
127
- Document API versioning strategies
128
- Identify service discovery mechanisms
129
- Note resilience patterns in service communication
130
131
### 9. Technology-Specific Architectural Patterns
132
${PROJECT_TYPE == "Auto-detect" ? "For each detected technology stack, document specific architectural patterns:" : `Document ${PROJECT_TYPE}-specific architectural patterns:`}
133
134
${(PROJECT_TYPE == ".NET" || PROJECT_TYPE == "Auto-detect") ?
135
"#### .NET Architectural Patterns (if detected)
136
- Host and application model implementation
137
- Middleware pipeline organization
138
- Framework service integration patterns
139
- ORM and data access approaches
140
- API implementation patterns (controllers, minimal APIs, etc.)
141
- Dependency injection container configuration" : ""}
142
143
${(PROJECT_TYPE == "Java" || PROJECT_TYPE == "Auto-detect") ?
144
"#### Java Architectural Patterns (if detected)
145
- Application container and bootstrap process
146
- Dependency injection framework usage (Spring, CDI, etc.)
147
- AOP implementation patterns
148
- Transaction boundary management
149
- ORM configuration and usage patterns
150
- Service implementation patterns" : ""}
151
152
${(PROJECT_TYPE == "React" || PROJECT_TYPE == "Auto-detect") ?
153
"#### React Architectural Patterns (if detected)
154
- Component composition and reuse strategies
155
- State management architecture
156
- Side effect handling patterns
157
- Routing and navigation approach
158
- Data fetching and caching patterns
159
- Rendering optimization strategies" : ""}
160
161
${(PROJECT_TYPE == "Angular" || PROJECT_TYPE == "Auto-detect") ?
162
"#### Angular Architectural Patterns (if detected)
163
- Module organization strategy
164
- Component hierarchy design
165
- Service and dependency injection patterns
166
- State management approach
167
- Reactive programming patterns
168
- Route guard implementation" : ""}
169
170
${(PROJECT_TYPE == "Python" || PROJECT_TYPE == "Auto-detect") ?
171
"#### Python Architectural Patterns (if detected)
172
- Module organization approach
173
- Dependency management strategy
174
- OOP vs. functional implementation patterns
175
- Framework integration patterns
176
- Asynchronous programming approach" : ""}
177
178
### 10. Implementation Patterns
179
${INCLUDES_IMPLEMENTATION_PATTERNS ?
180
"Document concrete implementation patterns for key architectural components:
181
182
- **Interface Design Patterns**:
183
- Interface segregation approaches
184
- Abstraction level decisions
185
- Generic vs. specific interface patterns
186
- Default implementation patterns
187
188
- **Service Implementation Patterns**:
189
- Service lifetime management
190
- Service composition patterns
191
- Operation implementation templates
192
- Error handling within services
193
194
- **Repository Implementation Patterns**:
195
- Query pattern implementations
196
- Transaction management
197
- Concurrency handling
198
- Bulk operation patterns
199
200
- **Controller/API Implementation Patterns**:
201
- Request handling patterns
202
- Response formatting approaches
203
- Parameter validation
204
- API versioning implementation
205
206
- **Domain Model Implementation**:
207
- Entity implementation patterns
208
- Value object patterns
209
- Domain event implementation
210
- Business rule enforcement" : "Mention that detailed implementation patterns vary across the codebase."}
211
212
### 11. Testing Architecture
213
- Document testing strategies aligned with the architecture
214
- Identify test boundary patterns (unit, integration, system)
215
- Map test doubles and mocking approaches
216
- Document test data strategies
217
- Note testing tools and frameworks integration
218
219
### 12. Deployment Architecture
220
- Document deployment topology derived from configuration
221
- Identify environment-specific architectural adaptations
222
- Map runtime dependency resolution patterns
223
- Document configuration management across environments
224
- Identify containerization and orchestration approaches
225
- Note cloud service integration patterns
226
227
### 13. Extension and Evolution Patterns
228
${FOCUS_ON_EXTENSIBILITY ?
229
"Provide detailed guidance for extending the architecture:
230
231
- **Feature Addition Patterns**:
232
- How to add new features while preserving architectural integrity
233
- Where to place new components by type
234
- Dependency introduction guidelines
235
- Configuration extension patterns
236
237
- **Modification Patterns**:
238
- How to safely modify existing components
239
- Strategies for maintaining backward compatibility
240
- Deprecation patterns
241
- Migration approaches
242
243
- **Integration Patterns**:
244
- How to integrate new external systems
245
- Adapter implementation patterns
246
- Anti-corruption layer patterns
247
- Service facade implementation" : "Document key extension points in the architecture."}
248
249
${INCLUDES_CODE_EXAMPLES ?
250
"### 14. Architectural Pattern Examples
251
Extract representative code examples that illustrate key architectural patterns:
252
253
- **Layer Separation Examples**:
254
- Interface definition and implementation separation
255
- Cross-layer communication patterns
256
- Dependency injection examples
257
258
- **Component Communication Examples**:
259
- Service invocation patterns
260
- Event publication and handling
261
- Message passing implementation
262
263
- **Extension Point Examples**:
264
- Plugin registration and discovery
265
- Extension interface implementations
266
- Configuration-driven extension patterns
267
268
Include enough context with each example to show the pattern clearly, but keep examples concise and focused on architectural concepts." : ""}
269
270
${INCLUDES_DECISION_RECORDS ?
271
"### 15. Architectural Decision Records
272
Document key architectural decisions evident in the codebase:
273
274
- **Architectural Style Decisions**:
275
- Why the current architectural pattern was chosen
276
- Alternatives considered (based on code evolution)
277
- Constraints that influenced the decision
278
279
- **Technology Selection Decisions**:
280
- Key technology choices and their architectural impact
281
- Framework selection rationales
282
- Custom vs. off-the-shelf component decisions
283
284
- **Implementation Approach Decisions**:
285
- Specific implementation patterns chosen
286
- Standard pattern adaptations
287
- Performance vs. maintainability tradeoffs
288
289
For each decision, note:
290
- Context that made the decision necessary
291
- Factors considered in making the decision
292
- Resulting consequences (positive and negative)
293
- Future flexibility or limitations introduced" : ""}
294
295
### ${INCLUDES_DECISION_RECORDS ? "16" : INCLUDES_CODE_EXAMPLES ? "15" : "14"}. Architecture Governance
296
- Document how architectural consistency is maintained
297
- Identify automated checks for architectural compliance
298
- Note architectural review processes evident in the codebase
299
- Document architectural documentation practices
300
301
### ${INCLUDES_DECISION_RECORDS ? "17" : INCLUDES_CODE_EXAMPLES ? "16" : "15"}. Blueprint for New Development
302
Create a clear architectural guide for implementing new features:
303
304
- **Development Workflow**:
305
- Starting points for different feature types
306
- Component creation sequence
307
- Integration steps with existing architecture
308
- Testing approach by architectural layer
309
310
- **Implementation Templates**:
311
- Base class/interface templates for key architectural components
312
- Standard file organization for new components
313
- Dependency declaration patterns
314
- Documentation requirements
315
316
- **Common Pitfalls**:
317
- Architecture violations to avoid
318
- Common architectural mistakes
319
- Performance considerations
320
- Testing blind spots
321
322
Include information about when this blueprint was generated and recommendations for keeping it updated as the architecture evolves."
323