1
---
2
name: project-workflow-analysis-blueprint-generator
3
description: 'Comprehensive technology-agnostic prompt generator for documenting end-to-end application workflows. Automatically detects project architecture patterns, technology stacks, and data flow patterns to generate detailed implementation blueprints covering entry points, service layers, data access, error handling, and testing approaches across multiple technologies including .NET, Java/Spring, React, and microservices architectures.'
4
---
5
6
# Project Workflow Documentation Generator
7
8
## Configuration Variables
9
10
```
11
${PROJECT_TYPE="Auto-detect|.NET|Java|Spring|Node.js|Python|React|Angular|Microservices|Other"}
12
<!-- Primary technology stack -->
13
14
${ENTRY_POINT="API|GraphQL|Frontend|CLI|Message Consumer|Scheduled Job|Custom"}
15
<!-- Starting point for the flow -->
16
17
${PERSISTENCE_TYPE="Auto-detect|SQL Database|NoSQL Database|File System|External API|Message Queue|Cache|None"}
18
<!-- Data storage type -->
19
20
${ARCHITECTURE_PATTERN="Auto-detect|Layered|Clean|CQRS|Microservices|MVC|MVVM|Serverless|Event-Driven|Other"}
21
<!-- Primary architecture pattern -->
22
23
${WORKFLOW_COUNT=1-5}
24
<!-- Number of workflows to document -->
25
26
${DETAIL_LEVEL="Standard|Implementation-Ready"}
27
<!-- Level of implementation detail to include -->
28
29
${INCLUDE_SEQUENCE_DIAGRAM=true|false}
30
<!-- Generate sequence diagram -->
31
32
${INCLUDE_TEST_PATTERNS=true|false}
33
<!-- Include testing approach -->
34
```
35
36
## Generated Prompt
37
38
```
39
"Analyze the codebase and document ${WORKFLOW_COUNT} representative end-to-end workflows
40
that can serve as implementation templates for similar features. Use the following approach:
41
```
42
43
### Initial Detection Phase
44
45
```
46
${PROJECT_TYPE == "Auto-detect" ?
47
"Begin by examining the codebase structure to identify technologies:
48
- Check for .NET solutions/projects, Spring configurations, Node.js/Express files, etc.
49
- Identify the primary programming language(s) and frameworks in use
50
- Determine the architectural patterns based on folder structure and key components"
51
: "Focus on ${PROJECT_TYPE} patterns and conventions"}
52
```
53
54
```
55
${ENTRY_POINT == "Auto-detect" ?
56
"Identify typical entry points by looking for:
57
- API controllers or route definitions
58
- GraphQL resolvers
59
- UI components that initiate network requests
60
- Message handlers or event subscribers
61
- Scheduled job definitions"
62
: "Focus on ${ENTRY_POINT} entry points"}
63
```
64
65
```
66
${PERSISTENCE_TYPE == "Auto-detect" ?
67
"Determine persistence mechanisms by examining:
68
- Database context/connection configurations
69
- Repository implementations
70
- ORM mappings
71
- External API clients
72
- File system interactions"
73
: "Focus on ${PERSISTENCE_TYPE} interactions"}
74
```
75
76
### Workflow Documentation Instructions
77
78
For each of the `${WORKFLOW_COUNT}` most representative workflow(s) in the system:
79
80
#### 1. Workflow Overview
81
- Provide a name and brief description of the workflow
82
- Explain the business purpose it serves
83
- Identify the triggering action or event
84
- List all files/classes involved in the complete workflow
85
86
#### 2. Entry Point Implementation
87
88
**API Entry Points:**
89
```
90
${ENTRY_POINT == "API" || ENTRY_POINT == "Auto-detect" ?
91
"- Document the API controller class and method that receives the request
92
- Show the complete method signature including attributes/annotations
93
- Include the full request DTO/model class definition
94
- Document validation attributes and custom validators
95
- Show authentication/authorization attributes and checks" : ""}
96
```
97
98
**GraphQL Entry Points:**
99
```
100
${ENTRY_POINT == "GraphQL" || ENTRY_POINT == "Auto-detect" ?
101
"- Document the GraphQL resolver class and method
102
- Show the complete schema definition for the query/mutation
103
- Include input type definitions
104
- Show resolver method implementation with parameter handling" : ""}
105
```
106
107
**Frontend Entry Points:**
108
```
109
${ENTRY_POINT == "Frontend" || ENTRY_POINT == "Auto-detect" ?
110
"- Document the component that initiates the API call
111
- Show the event handler that triggers the request
112
- Include the API client service method
113
- Show state management code related to the request" : ""}
114
```
115
116
**Message Consumer Entry Points:**
117
```
118
${ENTRY_POINT == "Message Consumer" || ENTRY_POINT == "Auto-detect" ?
119
"- Document the message handler class and method
120
- Show message subscription configuration
121
- Include the complete message model definition
122
- Show deserialization and validation logic" : ""}
123
```
124
125
#### 3. Service Layer Implementation
126
- Document each service class involved with their dependencies
127
- Show the complete method signatures with parameters and return types
128
- Include actual method implementations with key business logic
129
- Document interface definitions where applicable
130
- Show dependency injection registration patterns
131
132
**CQRS Patterns:**
133
```
134
${ARCHITECTURE_PATTERN == "CQRS" || ARCHITECTURE_PATTERN == "Auto-detect" ?
135
"- Include complete command/query handler implementations" : ""}
136
```
137
138
**Clean Architecture Patterns:**
139
```
140
${ARCHITECTURE_PATTERN == "Clean" || ARCHITECTURE_PATTERN == "Auto-detect" ?
141
"- Show use case/interactor implementations" : ""}
142
```
143
144
#### 4. Data Mapping Patterns
145
- Document DTO to domain model mapping code
146
- Show object mapper configurations or manual mapping methods
147
- Include validation logic during mapping
148
- Document any domain events created during mapping
149
150
#### 5. Data Access Implementation
151
- Document repository interfaces and their implementations
152
- Show complete method signatures with parameters and return types
153
- Include actual query implementations
154
- Document entity/model class definitions with all properties
155
- Show transaction handling patterns
156
157
**SQL Database Patterns:**
158
```
159
${PERSISTENCE_TYPE == "SQL Database" || PERSISTENCE_TYPE == "Auto-detect" ?
160
"- Include ORM configurations, annotations, or Fluent API usage
161
- Show actual SQL queries or ORM statements" : ""}
162
```
163
164
**NoSQL Database Patterns:**
165
```
166
${PERSISTENCE_TYPE == "NoSQL Database" || PERSISTENCE_TYPE == "Auto-detect" ?
167
"- Show document structure definitions
168
- Include document query/update operations" : ""}
169
```
170
171
#### 6. Response Construction
172
- Document response DTO/model class definitions
173
- Show mapping from domain/entity models to response models
174
- Include status code selection logic
175
- Document error response structure and generation
176
177
#### 7. Error Handling Patterns
178
- Document exception types used in the workflow
179
- Show try/catch patterns at each layer
180
- Include global exception handler configurations
181
- Document error logging implementations
182
- Show retry policies or circuit breaker patterns
183
- Include compensating actions for failure scenarios
184
185
#### 8. Asynchronous Processing Patterns
186
- Document background job scheduling code
187
- Show event publication implementations
188
- Include message queue sending patterns
189
- Document callback or webhook implementations
190
- Show how async operations are tracked and monitored
191
192
**Testing Approach (Optional):**
193
```
194
${INCLUDE_TEST_PATTERNS ?
195
"9. **Testing Approach**
196
- Document unit test implementations for each layer
197
- Show mocking patterns and test fixture setup
198
- Include integration test implementations
199
- Document test data generation approaches
200
- Show API/controller test implementations" : ""}
201
```
202
203
**Sequence Diagram (Optional):**
204
```
205
${INCLUDE_SEQUENCE_DIAGRAM ?
206
"10. **Sequence Diagram**
207
- Generate a detailed sequence diagram showing all components
208
- Include method calls with parameter types
209
- Show return values between components
210
- Document conditional flows and error paths" : ""}
211
```
212
213
#### 11. Naming Conventions
214
Document consistent patterns for:
215
- Controller naming (e.g., `EntityNameController`)
216
- Service naming (e.g., `EntityNameService`)
217
- Repository naming (e.g., `IEntityNameRepository`)
218
- DTO naming (e.g., `EntityNameRequest`, `EntityNameResponse`)
219
- Method naming patterns for CRUD operations
220
- Variable naming conventions
221
- File organization patterns
222
223
#### 12. Implementation Templates
224
Provide reusable code templates for:
225
- Creating a new API endpoint following the pattern
226
- Implementing a new service method
227
- Adding a new repository method
228
- Creating new domain model classes
229
- Implementing proper error handling
230
231
### Technology-Specific Implementation Patterns
232
233
**.NET Implementation Patterns (if detected):**
234
```
235
${PROJECT_TYPE == ".NET" || PROJECT_TYPE == "Auto-detect" ?
236
"- Complete controller class with attributes, filters, and dependency injection
237
- Service registration in Startup.cs or Program.cs
238
- Entity Framework DbContext configuration
239
- Repository implementation with EF Core or Dapper
240
- AutoMapper profile configurations
241
- Middleware implementations for cross-cutting concerns
242
- Extension method patterns
243
- Options pattern implementation for configuration
244
- Logging implementation with ILogger
245
- Authentication/authorization filter or policy implementations" : ""}
246
```
247
248
**Spring Implementation Patterns (if detected):**
249
```
250
${PROJECT_TYPE == "Java" || PROJECT_TYPE == "Spring" || PROJECT_TYPE == "Auto-detect" ?
251
"- Complete controller class with annotations and dependency injection
252
- Service implementation with transaction boundaries
253
- Repository interface and implementation
254
- JPA entity definitions with relationships
255
- DTO class implementations
256
- Bean configuration and component scanning
257
- Exception handler implementations
258
- Custom validator implementations" : ""}
259
```
260
261
**React Implementation Patterns (if detected):**
262
```
263
${PROJECT_TYPE == "React" || PROJECT_TYPE == "Auto-detect" ?
264
"- Component structure with props and state
265
- Hook implementation patterns (useState, useEffect, custom hooks)
266
- API service implementation
267
- State management patterns (Context, Redux)
268
- Form handling implementations
269
- Route configuration" : ""}
270
```
271
272
### Implementation Guidelines
273
274
Based on the documented workflows, provide specific guidance for implementing new features:
275
276
#### 1. Step-by-Step Implementation Process
277
- Where to start when adding a similar feature
278
- Order of implementation (e.g., model → repository → service → controller)
279
- How to integrate with existing cross-cutting concerns
280
281
#### 2. Common Pitfalls to Avoid
282
- Identify error-prone areas in the current implementation
283
- Note performance considerations
284
- List common bugs or issues encountered
285
286
#### 3. Extension Mechanisms
287
- Document how to plug into existing extension points
288
- Show how to add new behavior without modifying existing code
289
- Explain configuration-driven feature patterns
290
291
**Conclusion:**
292
Conclude with a summary of the most important patterns that should be followed when
293
implementing new features to maintain consistency with the codebase."
294