1
---
2
name: code-exemplars-blueprint-generator
3
description: 'Technology-agnostic prompt generator that creates customizable AI prompts for scanning codebases and identifying high-quality code exemplars. Supports multiple programming languages (.NET, Java, JavaScript, TypeScript, React, Angular, Python) with configurable analysis depth, categorization methods, and documentation formats to establish coding standards and maintain consistency across development teams.'
4
---
5
6
# Code Exemplars Blueprint Generator
7
8
## Configuration Variables
9
${PROJECT_TYPE="Auto-detect|.NET|Java|JavaScript|TypeScript|React|Angular|Python|Other"} <!-- Primary technology -->
10
${SCAN_DEPTH="Basic|Standard|Comprehensive"} <!-- How deeply to analyze the codebase -->
11
${INCLUDE_CODE_SNIPPETS=true|false} <!-- Include actual code snippets in addition to file references -->
12
${CATEGORIZATION="Pattern Type|Architecture Layer|File Type"} <!-- How to organize exemplars -->
13
${MAX_EXAMPLES_PER_CATEGORY=3} <!-- Maximum number of examples per category -->
14
${INCLUDE_COMMENTS=true|false} <!-- Include explanatory comments for each exemplar -->
15
16
## Generated Prompt
17
18
"Scan this codebase and generate an exemplars.md file that identifies high-quality, representative code examples. The exemplars should demonstrate our coding standards and patterns to help maintain consistency. Use the following approach:
19
20
### 1. Codebase Analysis Phase
21
- ${PROJECT_TYPE == "Auto-detect" ? "Automatically detect primary programming languages and frameworks by scanning file extensions and configuration files" : `Focus on ${PROJECT_TYPE} code files`}
22
- Identify files with high-quality implementation, good documentation, and clear structure
23
- Look for commonly used patterns, architecture components, and well-structured implementations
24
- Prioritize files that demonstrate best practices for our technology stack
25
- Only reference actual files that exist in the codebase - no hypothetical examples
26
27
### 2. Exemplar Identification Criteria
28
- Well-structured, readable code with clear naming conventions
29
- Comprehensive comments and documentation
30
- Proper error handling and validation
31
- Adherence to design patterns and architectural principles
32
- Separation of concerns and single responsibility principle
33
- Efficient implementation without code smells
34
- Representative of our standard approaches
35
36
### 3. Core Pattern Categories
37
38
${PROJECT_TYPE == ".NET" || PROJECT_TYPE == "Auto-detect" ? `#### .NET Exemplars (if detected)
39
- **Domain Models**: Find entities that properly implement encapsulation and domain logic
40
- **Repository Implementations**: Examples of our data access approach
41
- **Service Layer Components**: Well-structured business logic implementations
42
- **Controller Patterns**: Clean API controllers with proper validation and responses
43
- **Dependency Injection Usage**: Good examples of DI configuration and usage
44
- **Middleware Components**: Custom middleware implementations
45
- **Unit Test Patterns**: Well-structured tests with proper arrangement and assertions` : ""}
46
47
${(PROJECT_TYPE == "JavaScript" || PROJECT_TYPE == "TypeScript" || PROJECT_TYPE == "React" || PROJECT_TYPE == "Angular" || PROJECT_TYPE == "Auto-detect") ? `#### Frontend Exemplars (if detected)
48
- **Component Structure**: Clean, well-structured components
49
- **State Management**: Good examples of state handling
50
- **API Integration**: Well-implemented service calls and data handling
51
- **Form Handling**: Validation and submission patterns
52
- **Routing Implementation**: Navigation and route configuration
53
- **UI Components**: Reusable, well-structured UI elements
54
- **Unit Test Examples**: Component and service tests` : ""}
55
56
${PROJECT_TYPE == "Java" || PROJECT_TYPE == "Auto-detect" ? `#### Java Exemplars (if detected)
57
- **Entity Classes**: Well-designed JPA entities or domain models
58
- **Service Implementations**: Clean service layer components
59
- **Repository Patterns**: Data access implementations
60
- **Controller/Resource Classes**: API endpoint implementations
61
- **Configuration Classes**: Application configuration
62
- **Unit Tests**: Well-structured JUnit tests` : ""}
63
64
${PROJECT_TYPE == "Python" || PROJECT_TYPE == "Auto-detect" ? `#### Python Exemplars (if detected)
65
- **Class Definitions**: Well-structured classes with proper documentation
66
- **API Routes/Views**: Clean API implementations
67
- **Data Models**: ORM model definitions
68
- **Service Functions**: Business logic implementations
69
- **Utility Modules**: Helper and utility functions
70
- **Test Cases**: Well-structured unit tests` : ""}
71
72
### 4. Architecture Layer Exemplars
73
74
- **Presentation Layer**:
75
- User interface components
76
- Controllers/API endpoints
77
- View models/DTOs
78
79
- **Business Logic Layer**:
80
- Service implementations
81
- Business logic components
82
- Workflow orchestration
83
84
- **Data Access Layer**:
85
- Repository implementations
86
- Data models
87
- Query patterns
88
89
- **Cross-Cutting Concerns**:
90
- Logging implementations
91
- Error handling
92
- Authentication/authorization
93
- Validation
94
95
### 5. Exemplar Documentation Format
96
97
For each identified exemplar, document:
98
- File path (relative to repository root)
99
- Brief description of what makes it exemplary
100
- Pattern or component type it represents
101
${INCLUDE_COMMENTS ? "- Key implementation details and coding principles demonstrated" : ""}
102
${INCLUDE_CODE_SNIPPETS ? "- Small, representative code snippet (if applicable)" : ""}
103
104
${SCAN_DEPTH == "Comprehensive" ? `### 6. Additional Documentation
105
106
- **Consistency Patterns**: Note consistent patterns observed across the codebase
107
- **Architecture Observations**: Document architectural patterns evident in the code
108
- **Implementation Conventions**: Identify naming and structural conventions
109
- **Anti-patterns to Avoid**: Note any areas where the codebase deviates from best practices` : ""}
110
111
### ${SCAN_DEPTH == "Comprehensive" ? "7" : "6"}. Output Format
112
113
Create exemplars.md with:
114
1. Introduction explaining the purpose of the document
115
2. Table of contents with links to categories
116
3. Organized sections based on ${CATEGORIZATION}
117
4. Up to ${MAX_EXAMPLES_PER_CATEGORY} exemplars per category
118
5. Conclusion with recommendations for maintaining code quality
119
120
The document should be actionable for developers needing guidance on implementing new features consistent with existing patterns.
121
122
Important: Only include actual files from the codebase. Verify all file paths exist. Do not include placeholder or hypothetical examples.
123
"
124
125
## Expected Output
126
Upon running this prompt, GitHub Copilot will scan your codebase and generate an exemplars.md file containing real references to high-quality code examples in your repository, organized according to your selected parameters.
127