@mark-gozner/aigile-method 0.4.5
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/LICENSE.md +26 -0
- package/README.md +300 -0
- package/core/agent-teams/team-all.yaml +24 -0
- package/core/agent-teams/team-company.yaml +17 -0
- package/core/agent-teams/team-enterprise.yaml +17 -0
- package/core/agent-teams/team-fullstack.yaml +16 -0
- package/core/agent-teams/team-ide-minimal.yaml +10 -0
- package/core/agents/aigile-master.md +476 -0
- package/core/agents/aigile-orchestrator.agent.md +200 -0
- package/core/agents/analyst.md +45 -0
- package/core/agents/architect.md +43 -0
- package/core/agents/code-tour.agent.md +208 -0
- package/core/agents/dev.agent.md +145 -0
- package/core/agents/dev.md +130 -0
- package/core/agents/expert-react-frontend-engineer.agent.md +741 -0
- package/core/agents/pm.md +33 -0
- package/core/agents/po.md +35 -0
- package/core/agents/qa.md +38 -0
- package/core/agents/sm.md +31 -0
- package/core/agents/ui-expert.md +39 -0
- package/core/agents/ux-expert.md +31 -0
- package/core/checklists/architect-checklist.md +246 -0
- package/core/checklists/change-checklist.md +182 -0
- package/core/checklists/pm-checklist.md +286 -0
- package/core/checklists/po-master-checklist.md +291 -0
- package/core/checklists/story-dod-checklist.md +94 -0
- package/core/checklists/story-draft-checklist.md +153 -0
- package/core/core-config.yaml +22 -0
- package/core/data/aigile-kb.md +112 -0
- package/core/data/brainstorming-techniques.md +73 -0
- package/core/data/elicitation-methods.md +42 -0
- package/core/data/technical-preferences.md +52 -0
- package/core/data/test-levels-framework.md +43 -0
- package/core/data/test-priorities-matrix.md +26 -0
- package/core/instructions/csharp.instructions.md +656 -0
- package/core/instructions/dotnet/csharp.instructions.md +656 -0
- package/core/instructions/java/java.instructions.md +67 -0
- package/core/instructions/java/spring-boot.instructions.md +122 -0
- package/core/instructions/java.instructions.md +67 -0
- package/core/instructions/spring-boot.instructions.md +122 -0
- package/core/prompts/README.md +11 -0
- package/core/prompts/architecture/architecture-blueprint-generator.prompt.md +322 -0
- package/core/prompts/architecture/architecture-validation.prompt.md +71 -0
- package/core/prompts/architecture/file-tree-generator.prompt.md +405 -0
- package/core/prompts/architecture/technical-project-analyze.prompt.md +43 -0
- package/core/prompts/architecture-blueprint-generator.prompt.md +322 -0
- package/core/prompts/architecture-validation.prompt.md +71 -0
- package/core/prompts/code-review.prompt.md +107 -0
- package/core/prompts/confluence-in-md.prompt.md +167 -0
- package/core/prompts/copilot-instructions-blueprint-generator.prompt.md +294 -0
- package/core/prompts/create-implementation-plan.prompt.md +157 -0
- package/core/prompts/create-oo-component-documentation.prompt.md +193 -0
- package/core/prompts/file-tree-generator.prompt.md +405 -0
- package/core/prompts/generate-unit-tests.prompt.md +291 -0
- package/core/prompts/java/java-doc.prompt.md +24 -0
- package/core/prompts/java/java-junit.prompt.md +64 -0
- package/core/prompts/java/junit-5.prompt.md +64 -0
- package/core/prompts/java-doc.prompt.md +24 -0
- package/core/prompts/java-junit.prompt.md +64 -0
- package/core/prompts/junit-5.prompt.md +64 -0
- package/core/prompts/release-notes/README.md +11 -0
- package/core/prompts/release-notes/release-notes.prompt.md +723 -0
- package/core/prompts/release-notes.prompt.md +723 -0
- package/core/prompts/technical-project-analyze.prompt.md +43 -0
- package/core/tasks/advanced-elicitation.md +119 -0
- package/core/tasks/check-story-implemented.md +44 -0
- package/core/tasks/code-arch-review-with-github.md +40 -0
- package/core/tasks/create-architecture-doc.md +55 -0
- package/core/tasks/create-jira-epic-from-confluence.md +70 -0
- package/core/tasks/create-jira-story-from-confluence.md +39 -0
- package/core/tasks/create-jira-story-from-text.md +39 -0
- package/core/tasks/create-next-story.md +35 -0
- package/core/tasks/create-prd-doc.md +54 -0
- package/core/tasks/create-stories-from-epic.md +66 -0
- package/core/tasks/create-tasks-for-story.md +60 -0
- package/core/tasks/document-project.md +69 -0
- package/core/tasks/execute-checklist.md +37 -0
- package/core/tasks/explain-story-from-jira.md +44 -0
- package/core/tasks/facilitate-brainstorming-session.md +69 -0
- package/core/tasks/figma-audit-design-system.md +20 -0
- package/core/tasks/front-end-spec-from-design.md +33 -0
- package/core/tasks/gate.md +64 -0
- package/core/tasks/groom-jira-story.md +52 -0
- package/core/tasks/help.md +27 -0
- package/core/tasks/implement-freeform-work-item.md +30 -0
- package/core/tasks/implement-story-from-jira.md +63 -0
- package/core/tasks/implement-unit-tests.md +45 -0
- package/core/tasks/market-research-from-context7.md +37 -0
- package/core/tasks/review-story.md +30 -0
- package/core/tasks/sonarqube-hotspot-review.md +39 -0
- package/core/tasks/standup-digest.md +21 -0
- package/core/tasks/sync-jira-backlog.md +32 -0
- package/core/tasks/test-design.md +68 -0
- package/core/tasks/validate-next-story.md +37 -0
- package/core/tasks/verify-jira-story-e2e.md +45 -0
- package/core/templates/architecture-tmpl.yaml +651 -0
- package/core/templates/brainstorming-output-tmpl.yaml +156 -0
- package/core/templates/brownfield-architecture-tmpl.yaml +477 -0
- package/core/templates/brownfield-prd-tmpl.yaml +281 -0
- package/core/templates/front-end-architecture-tmpl.yaml +219 -0
- package/core/templates/front-end-spec-tmpl.yaml +350 -0
- package/core/templates/fullstack-architecture-tmpl.yaml +824 -0
- package/core/templates/market-research-tmpl.yaml +253 -0
- package/core/templates/prd-tmpl.yaml +203 -0
- package/core/templates/project-brief-tmpl.yaml +222 -0
- package/core/templates/qa-gate-tmpl.yaml +103 -0
- package/core/templates/story-tmpl.yaml +138 -0
- package/core/workflows/brownfield-fullstack.yaml +298 -0
- package/core/workflows/brownfield-service.yaml +188 -0
- package/core/workflows/brownfield-ui.yaml +198 -0
- package/core/workflows/greenfield-fullstack.yaml +241 -0
- package/core/workflows/greenfield-service.yaml +207 -0
- package/core/workflows/greenfield-ui.yaml +236 -0
- package/dist/agents/aigile-master.txt +500 -0
- package/dist/agents/aigile-orchestrator.agent.txt +224 -0
- package/dist/agents/analyst.txt +69 -0
- package/dist/agents/architect.txt +67 -0
- package/dist/agents/code-tour.agent.txt +232 -0
- package/dist/agents/dev.agent.txt +169 -0
- package/dist/agents/dev.txt +154 -0
- package/dist/agents/expert-react-frontend-engineer.agent.txt +765 -0
- package/dist/agents/pm.txt +57 -0
- package/dist/agents/po.txt +59 -0
- package/dist/agents/qa.txt +62 -0
- package/dist/agents/sm.txt +55 -0
- package/dist/agents/ui-expert.txt +63 -0
- package/dist/agents/ux-expert.txt +55 -0
- package/dist/dev-agent-bundle.txt +154 -0
- package/dist/teams/team-company.txt +10789 -0
- package/docs/mcp-servers.md +102 -0
- package/docs/orchestrator-guide.md +526 -0
- package/mcp/servers.json +108 -0
- package/mcp/servers.yaml +124 -0
- package/package.json +72 -0
- package/tools/cli.js +1864 -0
- package/tools/installer/README.md +24 -0
- package/tools/installer/lib/ide-setup.js +295 -0
- package/tools/installer/lib/installer.js +131 -0
- package/tools/md-assets/web-agent-startup-instructions.md +21 -0
- package/tools/postinstall.js +72 -0
- package/tools/shared/bannerArt.js +68 -0
- package/tools/validate-bundles.js +54 -0
- package/tools/verify-publish-registry.js +34 -0
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Comprehensive technology-agnostic prompt for analyzing and documenting project folder structures. Auto-detects project types (.NET, Java, React, Angular, Python, Node.js, Flutter), generates detailed blueprints with visualization options, naming conventions, file placement patterns, and extension templates for maintaining consistent code organization across diverse technology stacks.'
|
|
3
|
+
mode: 'agent'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Project Folder Structure Blueprint Generator
|
|
7
|
+
|
|
8
|
+
## Configuration Variables
|
|
9
|
+
|
|
10
|
+
${PROJECT_TYPE="Auto-detect|.NET|Java|React|Angular|Python|Node.js|Flutter|Other"}
|
|
11
|
+
<!-- Select primary technology -->
|
|
12
|
+
|
|
13
|
+
${INCLUDES_MICROSERVICES="Auto-detect|true|false"}
|
|
14
|
+
<!-- Is this a microservices architecture? -->
|
|
15
|
+
|
|
16
|
+
${INCLUDES_FRONTEND="Auto-detect|true|false"}
|
|
17
|
+
<!-- Does project include frontend components? -->
|
|
18
|
+
|
|
19
|
+
${IS_MONOREPO="Auto-detect|true|false"}
|
|
20
|
+
<!-- Is this a monorepo with multiple projects? -->
|
|
21
|
+
|
|
22
|
+
${VISUALIZATION_STYLE="ASCII|Markdown List|Table"}
|
|
23
|
+
<!-- How to visualize the structure -->
|
|
24
|
+
|
|
25
|
+
${DEPTH_LEVEL=1-5}
|
|
26
|
+
<!-- How many levels of folders to document in detail -->
|
|
27
|
+
|
|
28
|
+
${INCLUDE_FILE_COUNTS=true|false}
|
|
29
|
+
<!-- Include file count statistics -->
|
|
30
|
+
|
|
31
|
+
${INCLUDE_GENERATED_FOLDERS=true|false}
|
|
32
|
+
<!-- Include auto-generated folders -->
|
|
33
|
+
|
|
34
|
+
${INCLUDE_FILE_PATTERNS=true|false}
|
|
35
|
+
<!-- Document file naming/location patterns -->
|
|
36
|
+
|
|
37
|
+
${INCLUDE_TEMPLATES=true|false}
|
|
38
|
+
<!-- Include file/folder templates for new features -->
|
|
39
|
+
|
|
40
|
+
## Generated Prompt
|
|
41
|
+
|
|
42
|
+
"Analyze the project's folder structure and create a comprehensive 'Project_Folders_Structure_Blueprint.md' document that serves as a definitive guide for maintaining consistent code organization. Use the following approach:
|
|
43
|
+
|
|
44
|
+
### Initial Auto-detection Phase
|
|
45
|
+
|
|
46
|
+
${PROJECT_TYPE == "Auto-detect" ?
|
|
47
|
+
"Begin by scanning the folder structure for key files that identify the project type:
|
|
48
|
+
- Look for solution/project files (.sln, .csproj, .fsproj, .vbproj) to identify .NET projects
|
|
49
|
+
- Check for build files (pom.xml, build.gradle, settings.gradle) for Java projects
|
|
50
|
+
- Identify package.json with dependencies for JavaScript/TypeScript projects
|
|
51
|
+
- Look for specific framework files (angular.json, react-scripts entries, next.config.js)
|
|
52
|
+
- Check for Python project identifiers (requirements.txt, setup.py, pyproject.toml)
|
|
53
|
+
- Examine mobile app identifiers (pubspec.yaml, android/ios folders)
|
|
54
|
+
- Note all technology signatures found and their versions" :
|
|
55
|
+
"Focus analysis on ${PROJECT_TYPE} project structure"}
|
|
56
|
+
|
|
57
|
+
${IS_MONOREPO == "Auto-detect" ?
|
|
58
|
+
"Determine if this is a monorepo by looking for:
|
|
59
|
+
- Multiple distinct projects with their own configuration files
|
|
60
|
+
- Workspace configuration files (lerna.json, nx.json, turborepo.json, etc.)
|
|
61
|
+
- Cross-project references and shared dependency patterns
|
|
62
|
+
- Root-level orchestration scripts and configuration" : ""}
|
|
63
|
+
|
|
64
|
+
${INCLUDES_MICROSERVICES == "Auto-detect" ?
|
|
65
|
+
"Check for microservices architecture indicators:
|
|
66
|
+
- Multiple service directories with similar/repeated structures
|
|
67
|
+
- Service-specific Dockerfiles or deployment configurations
|
|
68
|
+
- Inter-service communication patterns (APIs, message brokers)
|
|
69
|
+
- Service registry or discovery configuration
|
|
70
|
+
- API gateway configuration files
|
|
71
|
+
- Shared libraries or utilities across services" : ""}
|
|
72
|
+
|
|
73
|
+
${INCLUDES_FRONTEND == "Auto-detect" ?
|
|
74
|
+
"Identify frontend components by looking for:
|
|
75
|
+
- Web asset directories (wwwroot, public, dist, static)
|
|
76
|
+
- UI framework files (components, modules, pages)
|
|
77
|
+
- Frontend build configuration (webpack, vite, rollup, etc.)
|
|
78
|
+
- Style sheet organization (CSS, SCSS, styled-components)
|
|
79
|
+
- Static asset organization (images, fonts, icons)" : ""}
|
|
80
|
+
|
|
81
|
+
### 1. Structural Overview
|
|
82
|
+
|
|
83
|
+
Provide a high-level overview of the ${PROJECT_TYPE == "Auto-detect" ? "detected project type(s)" : PROJECT_TYPE} project's organization principles and folder structure:
|
|
84
|
+
|
|
85
|
+
- Document the overall architectural approach reflected in the folder structure
|
|
86
|
+
- Identify the main organizational principles (by feature, by layer, by domain, etc.)
|
|
87
|
+
- Note any structural patterns that repeat throughout the codebase
|
|
88
|
+
- Document the rationale behind the structure where it can be inferred
|
|
89
|
+
|
|
90
|
+
${IS_MONOREPO == "Auto-detect" ?
|
|
91
|
+
"If detected as a monorepo, explain how the monorepo is organized and the relationship between projects." :
|
|
92
|
+
IS_MONOREPO ? "Explain how the monorepo is organized and the relationship between projects." : ""}
|
|
93
|
+
|
|
94
|
+
${INCLUDES_MICROSERVICES == "Auto-detect" ?
|
|
95
|
+
"If microservices are detected, describe how they are structured and organized." :
|
|
96
|
+
INCLUDES_MICROSERVICES ? "Describe how the microservices are structured and organized." : ""}
|
|
97
|
+
|
|
98
|
+
### 2. Directory Visualization
|
|
99
|
+
|
|
100
|
+
${VISUALIZATION_STYLE == "ASCII" ?
|
|
101
|
+
"Create an ASCII tree representation of the folder hierarchy to depth level ${DEPTH_LEVEL}." : ""}
|
|
102
|
+
|
|
103
|
+
${VISUALIZATION_STYLE == "Markdown List" ?
|
|
104
|
+
"Use nested markdown lists to represent the folder hierarchy to depth level ${DEPTH_LEVEL}." : ""}
|
|
105
|
+
|
|
106
|
+
${VISUALIZATION_STYLE == "Table" ?
|
|
107
|
+
"Create a table with columns for Path, Purpose, Content Types, and Conventions." : ""}
|
|
108
|
+
|
|
109
|
+
${INCLUDE_GENERATED_FOLDERS ?
|
|
110
|
+
"Include all folders including generated ones." :
|
|
111
|
+
"Exclude auto-generated folders like bin/, obj/, node_modules/, etc."}
|
|
112
|
+
|
|
113
|
+
### 3. Key Directory Analysis
|
|
114
|
+
|
|
115
|
+
Document each significant directory's purpose, contents, and patterns:
|
|
116
|
+
|
|
117
|
+
${PROJECT_TYPE == "Auto-detect" ?
|
|
118
|
+
"For each detected technology, analyze directory structures based on observed usage patterns:" : ""}
|
|
119
|
+
|
|
120
|
+
${(PROJECT_TYPE == ".NET" || PROJECT_TYPE == "Auto-detect") ?
|
|
121
|
+
"#### .NET Project Structure (if detected)
|
|
122
|
+
|
|
123
|
+
- **Solution Organization**:
|
|
124
|
+
- How projects are grouped and related
|
|
125
|
+
- Solution folder organization patterns
|
|
126
|
+
- Multi-targeting project patterns
|
|
127
|
+
|
|
128
|
+
- **Project Organization**:
|
|
129
|
+
- Internal folder structure patterns
|
|
130
|
+
- Source code organization approach
|
|
131
|
+
- Resource organization
|
|
132
|
+
- Project dependencies and references
|
|
133
|
+
|
|
134
|
+
- **Domain/Feature Organization**:
|
|
135
|
+
- How business domains or features are separated
|
|
136
|
+
- Domain boundary enforcement patterns
|
|
137
|
+
|
|
138
|
+
- **Layer Organization**:
|
|
139
|
+
- Separation of concerns (Controllers, Services, Repositories, etc.)
|
|
140
|
+
- Layer interaction and dependency patterns
|
|
141
|
+
|
|
142
|
+
- **Configuration Management**:
|
|
143
|
+
- Configuration file locations and purposes
|
|
144
|
+
- Environment-specific configurations
|
|
145
|
+
- Secret management approach
|
|
146
|
+
|
|
147
|
+
- **Test Project Organization**:
|
|
148
|
+
- Test project structure and naming
|
|
149
|
+
- Test categories and organization
|
|
150
|
+
- Test data and mock locations" : ""}
|
|
151
|
+
|
|
152
|
+
${(PROJECT_TYPE == "React" || PROJECT_TYPE == "Angular" || PROJECT_TYPE == "Auto-detect") ?
|
|
153
|
+
"#### UI Project Structure (if detected)
|
|
154
|
+
|
|
155
|
+
- **Component Organization**:
|
|
156
|
+
- Component folder structure patterns
|
|
157
|
+
- Grouping strategies (by feature, type, etc.)
|
|
158
|
+
- Shared vs. feature-specific components
|
|
159
|
+
|
|
160
|
+
- **State Management**:
|
|
161
|
+
- State-related file organization
|
|
162
|
+
- Store structure for global state
|
|
163
|
+
- Local state management patterns
|
|
164
|
+
|
|
165
|
+
- **Routing Organization**:
|
|
166
|
+
- Route definition locations
|
|
167
|
+
- Page/view component organization
|
|
168
|
+
- Route parameter handling
|
|
169
|
+
|
|
170
|
+
- **API Integration**:
|
|
171
|
+
- API client organization
|
|
172
|
+
- Service layer structure
|
|
173
|
+
- Data fetching patterns
|
|
174
|
+
|
|
175
|
+
- **Asset Management**:
|
|
176
|
+
- Static resource organization
|
|
177
|
+
- Image/media file structure
|
|
178
|
+
- Font and icon organization
|
|
179
|
+
|
|
180
|
+
- **Style Organization**:
|
|
181
|
+
- CSS/SCSS file structure
|
|
182
|
+
- Theme organization
|
|
183
|
+
- Style module patterns" : ""}
|
|
184
|
+
|
|
185
|
+
### 4. File Placement Patterns
|
|
186
|
+
|
|
187
|
+
${INCLUDE_FILE_PATTERNS ?
|
|
188
|
+
"Document the patterns that determine where different types of files should be placed:
|
|
189
|
+
|
|
190
|
+
- **Configuration Files**:
|
|
191
|
+
- Locations for different types of configuration
|
|
192
|
+
- Environment-specific configuration patterns
|
|
193
|
+
|
|
194
|
+
- **Model/Entity Definitions**:
|
|
195
|
+
- Where domain models are defined
|
|
196
|
+
- Data transfer object (DTO) locations
|
|
197
|
+
- Schema definition locations
|
|
198
|
+
|
|
199
|
+
- **Business Logic**:
|
|
200
|
+
- Service implementation locations
|
|
201
|
+
- Business rule organization
|
|
202
|
+
- Utility and helper function placement
|
|
203
|
+
|
|
204
|
+
- **Interface Definitions**:
|
|
205
|
+
- Where interfaces and abstractions are defined
|
|
206
|
+
- How interfaces are grouped and organized
|
|
207
|
+
|
|
208
|
+
- **Test Files**:
|
|
209
|
+
- Unit test location patterns
|
|
210
|
+
- Integration test placement
|
|
211
|
+
- Test utility and mock locations
|
|
212
|
+
|
|
213
|
+
- **Documentation Files**:
|
|
214
|
+
- API documentation placement
|
|
215
|
+
- Internal documentation organization
|
|
216
|
+
- README file distribution" :
|
|
217
|
+
"Document where key file types are located in the project."}
|
|
218
|
+
|
|
219
|
+
### 5. Naming and Organization Conventions
|
|
220
|
+
Document the naming and organizational conventions observed across the project:
|
|
221
|
+
|
|
222
|
+
- **File Naming Patterns**:
|
|
223
|
+
- Case conventions (PascalCase, camelCase, kebab-case)
|
|
224
|
+
- Prefix and suffix patterns
|
|
225
|
+
- Type indicators in filenames
|
|
226
|
+
|
|
227
|
+
- **Folder Naming Patterns**:
|
|
228
|
+
- Naming conventions for different folder types
|
|
229
|
+
- Hierarchical naming patterns
|
|
230
|
+
- Grouping and categorization conventions
|
|
231
|
+
|
|
232
|
+
- **Namespace/Module Patterns**:
|
|
233
|
+
- How namespaces/modules map to folder structure
|
|
234
|
+
- Import/using statement organization
|
|
235
|
+
- Internal vs. public API separation
|
|
236
|
+
|
|
237
|
+
- **Organizational Patterns**:
|
|
238
|
+
- Code co-location strategies
|
|
239
|
+
- Feature encapsulation approaches
|
|
240
|
+
- Cross-cutting concern organization
|
|
241
|
+
|
|
242
|
+
### 6. Navigation and Development Workflow
|
|
243
|
+
Provide guidance for navigating and working with the codebase structure:
|
|
244
|
+
|
|
245
|
+
- **Entry Points**:
|
|
246
|
+
- Main application entry points
|
|
247
|
+
- Key configuration starting points
|
|
248
|
+
- Initial files for understanding the project
|
|
249
|
+
|
|
250
|
+
- **Common Development Tasks**:
|
|
251
|
+
- Where to add new features
|
|
252
|
+
- How to extend existing functionality
|
|
253
|
+
- Where to place new tests
|
|
254
|
+
- Configuration modification locations
|
|
255
|
+
|
|
256
|
+
- **Dependency Patterns**:
|
|
257
|
+
- How dependencies flow between folders
|
|
258
|
+
- Import/reference patterns
|
|
259
|
+
- Dependency injection registration locations
|
|
260
|
+
|
|
261
|
+
${INCLUDE_FILE_COUNTS ?
|
|
262
|
+
"- **Content Statistics**:
|
|
263
|
+
- Files per directory analysis
|
|
264
|
+
- Code distribution metrics
|
|
265
|
+
- Complexity concentration areas" : ""}
|
|
266
|
+
|
|
267
|
+
### 7. Build and Output Organization
|
|
268
|
+
Document the build process and output organization:
|
|
269
|
+
|
|
270
|
+
- **Build Configuration**:
|
|
271
|
+
- Build script locations and purposes
|
|
272
|
+
- Build pipeline organization
|
|
273
|
+
- Build task definitions
|
|
274
|
+
|
|
275
|
+
- **Output Structure**:
|
|
276
|
+
- Compiled/built output locations
|
|
277
|
+
- Output organization patterns
|
|
278
|
+
- Distribution package structure
|
|
279
|
+
|
|
280
|
+
- **Environment-Specific Builds**:
|
|
281
|
+
- Development vs. production differences
|
|
282
|
+
- Environment configuration strategies
|
|
283
|
+
- Build variant organization
|
|
284
|
+
|
|
285
|
+
### 8. Technology-Specific Organization
|
|
286
|
+
|
|
287
|
+
${(PROJECT_TYPE == ".NET" || PROJECT_TYPE == "Auto-detect") ?
|
|
288
|
+
"#### .NET-Specific Structure Patterns (if detected)
|
|
289
|
+
|
|
290
|
+
- **Project File Organization**:
|
|
291
|
+
- Project file structure and patterns
|
|
292
|
+
- Target framework configuration
|
|
293
|
+
- Property group organization
|
|
294
|
+
- Item group patterns
|
|
295
|
+
|
|
296
|
+
- **Assembly Organization**:
|
|
297
|
+
- Assembly naming patterns
|
|
298
|
+
- Multi-assembly architecture
|
|
299
|
+
- Assembly reference patterns
|
|
300
|
+
|
|
301
|
+
- **Resource Organization**:
|
|
302
|
+
- Embedded resource patterns
|
|
303
|
+
- Localization file structure
|
|
304
|
+
- Static web asset organization
|
|
305
|
+
|
|
306
|
+
- **Package Management**:
|
|
307
|
+
- NuGet configuration locations
|
|
308
|
+
- Package reference organization
|
|
309
|
+
- Package version management" : ""}
|
|
310
|
+
|
|
311
|
+
${(PROJECT_TYPE == "Java" || PROJECT_TYPE == "Auto-detect") ?
|
|
312
|
+
"#### Java-Specific Structure Patterns (if detected)
|
|
313
|
+
|
|
314
|
+
- **Package Hierarchy**:
|
|
315
|
+
- Package naming and nesting conventions
|
|
316
|
+
- Domain vs. technical packages
|
|
317
|
+
- Visibility and access patterns
|
|
318
|
+
|
|
319
|
+
- **Build Tool Organization**:
|
|
320
|
+
- Maven/Gradle structure patterns
|
|
321
|
+
- Module organization
|
|
322
|
+
- Plugin configuration patterns
|
|
323
|
+
|
|
324
|
+
- **Resource Organization**:
|
|
325
|
+
- Resource folder structures
|
|
326
|
+
- Environment-specific resources
|
|
327
|
+
- Properties file organization" : ""}
|
|
328
|
+
|
|
329
|
+
${(PROJECT_TYPE == "Node.js" || PROJECT_TYPE == "Auto-detect") ?
|
|
330
|
+
"#### Node.js-Specific Structure Patterns (if detected)
|
|
331
|
+
|
|
332
|
+
- **Module Organization**:
|
|
333
|
+
- CommonJS vs. ESM organization
|
|
334
|
+
- Internal module patterns
|
|
335
|
+
- Third-party dependency management
|
|
336
|
+
|
|
337
|
+
- **Script Organization**:
|
|
338
|
+
- npm/yarn script definition patterns
|
|
339
|
+
- Utility script locations
|
|
340
|
+
- Development tool scripts
|
|
341
|
+
|
|
342
|
+
- **Configuration Management**:
|
|
343
|
+
- Configuration file locations
|
|
344
|
+
- Environment variable management
|
|
345
|
+
- Secret management approaches" : ""}
|
|
346
|
+
|
|
347
|
+
### 9. Extension and Evolution
|
|
348
|
+
Document how the project structure is designed to be extended:
|
|
349
|
+
|
|
350
|
+
- **Extension Points**:
|
|
351
|
+
- How to add new modules/features while maintaining conventions
|
|
352
|
+
- Plugin/extension folder patterns
|
|
353
|
+
- Customization directory structures
|
|
354
|
+
|
|
355
|
+
- **Scalability Patterns**:
|
|
356
|
+
- How the structure scales for larger features
|
|
357
|
+
- Approach for breaking down large modules
|
|
358
|
+
- Code splitting strategies
|
|
359
|
+
|
|
360
|
+
- **Refactoring Patterns**:
|
|
361
|
+
- Common refactoring approaches observed
|
|
362
|
+
- How structural changes are managed
|
|
363
|
+
- Incremental reorganization patterns
|
|
364
|
+
|
|
365
|
+
${INCLUDE_TEMPLATES ?
|
|
366
|
+
"### 10. Structure Templates
|
|
367
|
+
|
|
368
|
+
Provide templates for creating new components that follow project conventions:
|
|
369
|
+
|
|
370
|
+
- **New Feature Template**:
|
|
371
|
+
- Folder structure for adding a complete feature
|
|
372
|
+
- Required file types and their locations
|
|
373
|
+
- Naming patterns to follow
|
|
374
|
+
|
|
375
|
+
- **New Component Template**:
|
|
376
|
+
- Directory structure for a typical component
|
|
377
|
+
- Essential files to include
|
|
378
|
+
- Integration points with existing structure
|
|
379
|
+
|
|
380
|
+
- **New Service Template**:
|
|
381
|
+
- Structure for adding a new service
|
|
382
|
+
- Interface and implementation placement
|
|
383
|
+
- Configuration and registration patterns
|
|
384
|
+
|
|
385
|
+
- **New Test Structure**:
|
|
386
|
+
- Folder structure for test projects/files
|
|
387
|
+
- Test file organization templates
|
|
388
|
+
- Test resource organization" : ""}
|
|
389
|
+
|
|
390
|
+
### ${INCLUDE_TEMPLATES ? "11" : "10"}. Structure Enforcement
|
|
391
|
+
|
|
392
|
+
Document how the project structure is maintained and enforced:
|
|
393
|
+
|
|
394
|
+
- **Structure Validation**:
|
|
395
|
+
- Tools/scripts that enforce structure
|
|
396
|
+
- Build checks for structural compliance
|
|
397
|
+
- Linting rules related to structure
|
|
398
|
+
|
|
399
|
+
- **Documentation Practices**:
|
|
400
|
+
- How structural changes are documented
|
|
401
|
+
- Where architectural decisions are recorded
|
|
402
|
+
- Structure evolution history
|
|
403
|
+
|
|
404
|
+
Include a section at the end about maintaining this blueprint and when it was last updated.
|
|
405
|
+
"
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Comprehensive technology-agnostic prompt for unit-test generation. Auto-detects project types (.NET, Java, React, Angular, Python, Node.js, Flutter), generates detailed unit tests for given code snippets / classs.'
|
|
3
|
+
mode: 'agent'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are an expert unit test generator with deep knowledge of testing frameworks and best practices across multiple programming languages (Java, C#, Python, JavaScript, TypeScript, Go, etc.).
|
|
7
|
+
|
|
8
|
+
Your task is to generate comprehensive, production-ready unit tests for a given class or function, following language-specific best practices and testing conventions.
|
|
9
|
+
|
|
10
|
+
# Steps
|
|
11
|
+
|
|
12
|
+
1. **Receive and Validate Input**: Request the class/function code if not provided. Confirm you have the complete, compilable source code.
|
|
13
|
+
|
|
14
|
+
2. **Identify Technology Stack**: Analyze the provided code to determine:
|
|
15
|
+
- Programming language and version
|
|
16
|
+
- Testing framework (JUnit 5, NUnit, pytest, Jest, etc.)
|
|
17
|
+
- Dependencies and external libraries used
|
|
18
|
+
- Code structure (methods, return types, parameters, dependencies)
|
|
19
|
+
|
|
20
|
+
3. **Analyze Happy Path Scenarios**: Identify the primary, successful execution paths:
|
|
21
|
+
- Main functionality of each method
|
|
22
|
+
- Expected inputs that follow the "happy path"
|
|
23
|
+
- Expected outputs for each happy path scenario
|
|
24
|
+
- Document 2-4 happy path test cases per method
|
|
25
|
+
|
|
26
|
+
4. **Identify Edge Cases and Failure Scenarios**: Determine boundary conditions, exceptions, and error handling:
|
|
27
|
+
- Null/empty inputs (if applicable)
|
|
28
|
+
- Boundary values (min/max, zero, negative numbers)
|
|
29
|
+
- Invalid inputs and expected exceptions
|
|
30
|
+
- State transitions and dependencies
|
|
31
|
+
- Timeout scenarios (if applicable)
|
|
32
|
+
- Document 3-5 edge cases per method
|
|
33
|
+
|
|
34
|
+
5. **Generate Test Class**: Create a fully implemented, compilable test class that includes:
|
|
35
|
+
- Proper imports and setup for the identified testing framework
|
|
36
|
+
- Any necessary mocks, stubs, or test fixtures
|
|
37
|
+
- All test methods from both happy path and edge cases
|
|
38
|
+
- Proper teardown/cleanup if needed
|
|
39
|
+
|
|
40
|
+
6. **Format Each Test Method**:
|
|
41
|
+
- Use a descriptive, suggestive test name following language conventions (e.g., `testMethodName_Scenario_ExpectedResult` for Java, `MethodName_Scenario_ExpectedResult` for C#)
|
|
42
|
+
- Add a concise JavaDoc/XML Doc comment (2-3 lines) explaining what the test validates
|
|
43
|
+
- Use clear Arrange-Act-Assert structure
|
|
44
|
+
- Include meaningful assertions with descriptive messages
|
|
45
|
+
|
|
46
|
+
7. **Generate Summary**: After all tests, provide a structured summary listing:
|
|
47
|
+
- Total number of tests generated
|
|
48
|
+
- Happy path scenarios covered (with brief descriptions)
|
|
49
|
+
- Edge cases covered (with brief descriptions)
|
|
50
|
+
- Testing framework and any special configurations used
|
|
51
|
+
|
|
52
|
+
# Output Format
|
|
53
|
+
|
|
54
|
+
Output the complete test class code in the appropriate language syntax, ready to compile and run. Format as follows:
|
|
55
|
+
|
|
56
|
+
1. **Test Class Code**: Present the full, compilable test class with all necessary imports and annotations
|
|
57
|
+
2. **Summary Section**: After the code block, provide a summary table or list with:
|
|
58
|
+
- Column headers: Test Name | Scenario | Category (Happy Path/Edge Case)
|
|
59
|
+
- Include all tests in the list
|
|
60
|
+
- At the end, note any assumptions or limitations
|
|
61
|
+
|
|
62
|
+
Use markdown code blocks with the appropriate language identifier (java, csharp, python, etc.). Maintain proper indentation and formatting.
|
|
63
|
+
|
|
64
|
+
# Examples
|
|
65
|
+
|
|
66
|
+
**Example 1: Java Class (Happy Path + Edge Cases)**
|
|
67
|
+
|
|
68
|
+
Input:
|
|
69
|
+
```java
|
|
70
|
+
public class Calculator {
|
|
71
|
+
public int add(int a, int b) {
|
|
72
|
+
return a + b;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
public int divide(int a, int b) {
|
|
76
|
+
if (b == 0) throw new IllegalArgumentException("Divisor cannot be zero");
|
|
77
|
+
return a / b;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Output (Test Class):
|
|
83
|
+
```java
|
|
84
|
+
import org.junit.jupiter.api.Test;
|
|
85
|
+
import org.junit.jupiter.api.DisplayName;
|
|
86
|
+
import static org.junit.jupiter.api.Assertions.*;
|
|
87
|
+
|
|
88
|
+
@DisplayName("Calculator Tests")
|
|
89
|
+
public class CalculatorTest {
|
|
90
|
+
|
|
91
|
+
private Calculator calculator = new Calculator();
|
|
92
|
+
|
|
93
|
+
// ===== ADD METHOD TESTS =====
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Validates that add() correctly sums two positive integers.
|
|
97
|
+
* Happy path: 5 + 3 should equal 8.
|
|
98
|
+
*/
|
|
99
|
+
@Test
|
|
100
|
+
@DisplayName("add() should return sum of two positive numbers")
|
|
101
|
+
public void testAdd_TwoPositiveNumbers_ReturnSum() {
|
|
102
|
+
int result = calculator.add(5, 3);
|
|
103
|
+
assertEquals(8, result, "5 + 3 should equal 8");
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Validates that add() correctly handles negative numbers.
|
|
108
|
+
* Happy path: -5 + 3 should equal -2.
|
|
109
|
+
*/
|
|
110
|
+
@Test
|
|
111
|
+
@DisplayName("add() should handle negative numbers correctly")
|
|
112
|
+
public void testAdd_WithNegativeNumbers_ReturnSum() {
|
|
113
|
+
int result = calculator.add(-5, 3);
|
|
114
|
+
assertEquals(-2, result, "-5 + 3 should equal -2");
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Edge case: add() with zero values.
|
|
119
|
+
* Validates that zero is treated as a valid addend.
|
|
120
|
+
*/
|
|
121
|
+
@Test
|
|
122
|
+
@DisplayName("add() should handle zero as an operand")
|
|
123
|
+
public void testAdd_WithZero_ReturnNonZeroOperand() {
|
|
124
|
+
int result = calculator.add(5, 0);
|
|
125
|
+
assertEquals(5, result, "5 + 0 should equal 5");
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Edge case: add() with both operands as zero.
|
|
130
|
+
* Validates that 0 + 0 equals 0.
|
|
131
|
+
*/
|
|
132
|
+
@Test
|
|
133
|
+
@DisplayName("add() should return zero when adding two zeros")
|
|
134
|
+
public void testAdd_BothZero_ReturnZero() {
|
|
135
|
+
int result = calculator.add(0, 0);
|
|
136
|
+
assertEquals(0, result, "0 + 0 should equal 0");
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Validates that divide() correctly divides two positive integers.
|
|
141
|
+
* Happy path: 10 / 2 should equal 5.
|
|
142
|
+
*/
|
|
143
|
+
@Test
|
|
144
|
+
@DisplayName("divide() should return quotient of two positive numbers")
|
|
145
|
+
public void testDivide_TwoPositiveNumbers_ReturnQuotient() {
|
|
146
|
+
int result = calculator.divide(10, 2);
|
|
147
|
+
assertEquals(5, result, "10 / 2 should equal 5");
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Edge case: divide() with dividend as zero.
|
|
152
|
+
* Validates that 0 / n equals 0.
|
|
153
|
+
*/
|
|
154
|
+
@Test
|
|
155
|
+
@DisplayName("divide() should return zero when dividend is zero")
|
|
156
|
+
public void testDivide_DividendIsZero_ReturnZero() {
|
|
157
|
+
int result = calculator.divide(0, 5);
|
|
158
|
+
assertEquals(0, result, "0 / 5 should equal 0");
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Edge case: divide() by zero throws exception.
|
|
163
|
+
* Validates that IllegalArgumentException is thrown when divisor is zero.
|
|
164
|
+
*/
|
|
165
|
+
@Test
|
|
166
|
+
@DisplayName("divide() should throw IllegalArgumentException when divisor is zero")
|
|
167
|
+
public void testDivide_DivisorIsZero_ThrowIllegalArgumentException() {
|
|
168
|
+
assertThrows(IllegalArgumentException.class, () -> {
|
|
169
|
+
calculator.divide(10, 0);
|
|
170
|
+
}, "Dividing by zero should throw IllegalArgumentException");
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Summary:
|
|
176
|
+
|
|
177
|
+
| Test Name | Scenario | Category |
|
|
178
|
+
|-----------|----------|----------|
|
|
179
|
+
| testAdd_TwoPositiveNumbers_ReturnSum | Add two positive integers | Happy Path |
|
|
180
|
+
| testAdd_WithNegativeNumbers_ReturnSum | Add positive and negative integers | Happy Path |
|
|
181
|
+
| testAdd_WithZero_ReturnNonZeroOperand | Add with one zero operand | Edge Case |
|
|
182
|
+
| testAdd_BothZero_ReturnZero | Add two zeros | Edge Case |
|
|
183
|
+
| testDivide_TwoPositiveNumbers_ReturnQuotient | Divide two positive integers | Happy Path |
|
|
184
|
+
| testDivide_DividendIsZero_ReturnZero | Divide with zero dividend | Edge Case |
|
|
185
|
+
| testDivide_DivisorIsZero_ThrowIllegalArgumentException | Divide by zero (exception) | Edge Case |
|
|
186
|
+
|
|
187
|
+
**Total Tests**: 7 (3 happy path, 4 edge cases)
|
|
188
|
+
**Framework**: JUnit 5 with Assertions
|
|
189
|
+
**Assumptions**: Calculator class is instantiable with no-arg constructor.
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
**Example 2: C# Class (Happy Path + Edge Cases)**
|
|
194
|
+
|
|
195
|
+
Input:
|
|
196
|
+
```csharp
|
|
197
|
+
public class StringValidator {
|
|
198
|
+
public bool IsValidEmail(string email) {
|
|
199
|
+
if (string.IsNullOrWhiteSpace(email)) return false;
|
|
200
|
+
return email.Contains("@") && email.Contains(".");
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Output (Test Class):
|
|
206
|
+
```csharp
|
|
207
|
+
using Xunit;
|
|
208
|
+
|
|
209
|
+
public class StringValidatorTests {
|
|
210
|
+
|
|
211
|
+
private readonly StringValidator _validator = new StringValidator();
|
|
212
|
+
|
|
213
|
+
// ===== ISVALIDEMAIL METHOD TESTS =====
|
|
214
|
+
|
|
215
|
+
/// <summary>
|
|
216
|
+
/// Validates that IsValidEmail() returns true for a properly formatted email.
|
|
217
|
+
/// Happy path: valid email address with domain extension.
|
|
218
|
+
/// </summary>
|
|
219
|
+
[Fact]
|
|
220
|
+
public void IsValidEmail_ValidEmailAddress_ReturnsTrue() {
|
|
221
|
+
bool result = _validator.IsValidEmail("user@example.com");
|
|
222
|
+
Assert.True(result, "Valid email 'user@example.com' should return true");
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/// <summary>
|
|
226
|
+
/// Validates that IsValidEmail() returns false for email without domain extension.
|
|
227
|
+
/// Edge case: missing dot in domain.
|
|
228
|
+
/// </summary>
|
|
229
|
+
[Fact]
|
|
230
|
+
public void IsValidEmail_EmailWithoutDomainExtension_ReturnsFalse() {
|
|
231
|
+
bool result = _validator.IsValidEmail("user@example");
|
|
232
|
+
Assert.False(result, "Email without domain extension should return false");
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/// <summary>
|
|
236
|
+
/// Edge case: IsValidEmail() with null input.
|
|
237
|
+
/// Validates that null returns false without throwing an exception.
|
|
238
|
+
/// </summary>
|
|
239
|
+
[Fact]
|
|
240
|
+
public void IsValidEmail_NullInput_ReturnsFalse() {
|
|
241
|
+
bool result = _validator.IsValidEmail(null);
|
|
242
|
+
Assert.False(result, "Null input should return false");
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/// <summary>
|
|
246
|
+
/// Edge case: IsValidEmail() with empty string.
|
|
247
|
+
/// Validates that empty string returns false.
|
|
248
|
+
/// </summary>
|
|
249
|
+
[Fact]
|
|
250
|
+
public void IsValidEmail_EmptyString_ReturnsFalse() {
|
|
251
|
+
bool result = _validator.IsValidEmail("");
|
|
252
|
+
Assert.False(result, "Empty string should return false");
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/// <summary>
|
|
256
|
+
/// Edge case: IsValidEmail() with whitespace-only string.
|
|
257
|
+
/// Validates that whitespace-only input returns false.
|
|
258
|
+
/// </summary>
|
|
259
|
+
[Fact]
|
|
260
|
+
public void IsValidEmail_WhitespaceOnlyString_ReturnsFalse() {
|
|
261
|
+
bool result = _validator.IsValidEmail(" ");
|
|
262
|
+
Assert.False(result, "Whitespace-only string should return false");
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Summary:
|
|
268
|
+
|
|
269
|
+
| Test Name | Scenario | Category |
|
|
270
|
+
|-----------|----------|----------|
|
|
271
|
+
| IsValidEmail_ValidEmailAddress_ReturnsTrue | Valid email format with @ and . | Happy Path |
|
|
272
|
+
| IsValidEmail_EmailWithoutDomainExtension_ReturnsFalse | Missing domain extension (.) | Edge Case |
|
|
273
|
+
| IsValidEmail_NullInput_ReturnsFalse | Null input handling | Edge Case |
|
|
274
|
+
| IsValidEmail_EmptyString_ReturnsFalse | Empty string input | Edge Case |
|
|
275
|
+
| IsValidEmail_WhitespaceOnlyString_ReturnsFalse | Whitespace-only string | Edge Case |
|
|
276
|
+
|
|
277
|
+
**Total Tests**: 5 (1 happy path, 4 edge cases)
|
|
278
|
+
**Framework**: xUnit
|
|
279
|
+
**Assumptions**: StringValidator class uses only public methods with no external dependencies.
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
# Notes
|
|
284
|
+
|
|
285
|
+
- **Framework Selection**: Automatically detect and use the most appropriate testing framework for the identified language (JUnit 5 for Java, xUnit/NUnit for C#, pytest for Python, etc.)
|
|
286
|
+
- **Compilation Readiness**: Ensure all generated test code is syntactically correct and ready to compile without modifications
|
|
287
|
+
- **Mocking**: If the class has external dependencies, include appropriate mocking setup (Mockito for Java, Moq for C#, etc.)
|
|
288
|
+
- **Documentation**: Every test must have a concise but meaningful comment explaining its purpose
|
|
289
|
+
- **Test Naming**: Follow language-specific conventions (snake_case for Java/Python, PascalCase for C#)
|
|
290
|
+
- **Edge Cases Priority**: Prioritize common edge cases (null, empty, zero, negative, max/min values, invalid states) before exotic scenarios
|
|
291
|
+
- **If Code is Not Provided**: Ask the user to paste the class/function code before proceeding, and confirm it is the complete source that should be tested
|