Copilot Instructions Blueprint Generator

Copilot Instructions Blueprint Generator

Generates a project-specific copilot-instructions.md by analysing the codebase's real patterns, versions and architecture so Copilot writes consistent code.

Skill files1 file
SKILL.md295 lines
1
---
2
name: copilot-instructions-blueprint-generator
3
description: 'Technology-agnostic blueprint generator for creating comprehensive copilot-instructions.md files that guide GitHub Copilot to produce code consistent with project standards, architecture patterns, and exact technology versions by analyzing existing codebase patterns and avoiding assumptions.'
4
---
5
6
# Copilot Instructions Blueprint Generator
7
8
## Configuration Variables
9
${PROJECT_TYPE="Auto-detect|.NET|Java|JavaScript|TypeScript|React|Angular|Python|Multiple|Other"} <!-- Primary technology -->
10
${ARCHITECTURE_STYLE="Layered|Microservices|Monolithic|Domain-Driven|Event-Driven|Serverless|Mixed"} <!-- Architectural approach -->
11
${CODE_QUALITY_FOCUS="Maintainability|Performance|Security|Accessibility|Testability|All"} <!-- Quality priorities -->
12
${DOCUMENTATION_LEVEL="Minimal|Standard|Comprehensive"} <!-- Documentation requirements -->
13
${TESTING_REQUIREMENTS="Unit|Integration|E2E|TDD|BDD|All"} <!-- Testing approach -->
14
${VERSIONING="Semantic|CalVer|Custom"} <!-- Versioning approach -->
15
16
## Generated Prompt
17
18
"Generate a comprehensive copilot-instructions.md file that will guide GitHub Copilot to produce code consistent with our project's standards, architecture, and technology versions. The instructions must be strictly based on actual code patterns in our codebase and avoid making any assumptions. Follow this approach:
19
20
### 1. Core Instruction Structure
21
22
```markdown
23
# GitHub Copilot Instructions
24
25
## Priority Guidelines
26
27
When generating code for this repository:
28
29
1. **Version Compatibility**: Always detect and respect the exact versions of languages, frameworks, and libraries used in this project
30
2. **Context Files**: Prioritize patterns and standards defined in the .github/copilot directory
31
3. **Codebase Patterns**: When context files don't provide specific guidance, scan the codebase for established patterns
32
4. **Architectural Consistency**: Maintain our ${ARCHITECTURE_STYLE} architectural style and established boundaries
33
5. **Code Quality**: Prioritize ${CODE_QUALITY_FOCUS == "All" ? "maintainability, performance, security, accessibility, and testability" : CODE_QUALITY_FOCUS} in all generated code
34
35
## Technology Version Detection
36
37
Before generating code, scan the codebase to identify:
38
39
1. **Language Versions**: Detect the exact versions of programming languages in use
40
- Examine project files, configuration files, and package managers
41
- Look for language-specific version indicators (e.g., <LangVersion> in .NET projects)
42
- Never use language features beyond the detected version
43
44
2. **Framework Versions**: Identify the exact versions of all frameworks
45
- Check package.json, .csproj, pom.xml, requirements.txt, etc.
46
- Respect version constraints when generating code
47
- Never suggest features not available in the detected framework versions
48
49
3. **Library Versions**: Note the exact versions of key libraries and dependencies
50
- Generate code compatible with these specific versions
51
- Never use APIs or features not available in the detected versions
52
53
## Context Files
54
55
Prioritize the following files in .github/copilot directory (if they exist):
56
57
- **architecture.md**: System architecture guidelines
58
- **tech-stack.md**: Technology versions and framework details
59
- **coding-standards.md**: Code style and formatting standards
60
- **folder-structure.md**: Project organization guidelines
61
- **exemplars.md**: Exemplary code patterns to follow
62
63
## Codebase Scanning Instructions
64
65
When context files don't provide specific guidance:
66
67
1. Identify similar files to the one being modified or created
68
2. Analyze patterns for:
69
- Naming conventions
70
- Code organization
71
- Error handling
72
- Logging approaches
73
- Documentation style
74
- Testing patterns
75
76
3. Follow the most consistent patterns found in the codebase
77
4. When conflicting patterns exist, prioritize patterns in newer files or files with higher test coverage
78
5. Never introduce patterns not found in the existing codebase
79
80
## Code Quality Standards
81
82
${CODE_QUALITY_FOCUS.includes("Maintainability") || CODE_QUALITY_FOCUS == "All" ? `### Maintainability
83
- Write self-documenting code with clear naming
84
- Follow the naming and organization conventions evident in the codebase
85
- Follow established patterns for consistency
86
- Keep functions focused on single responsibilities
87
- Limit function complexity and length to match existing patterns` : ""}
88
89
${CODE_QUALITY_FOCUS.includes("Performance") || CODE_QUALITY_FOCUS == "All" ? `### Performance
90
- Follow existing patterns for memory and resource management
91
- Match existing patterns for handling computationally expensive operations
92
- Follow established patterns for asynchronous operations
93
- Apply caching consistently with existing patterns
94
- Optimize according to patterns evident in the codebase` : ""}
95
96
${CODE_QUALITY_FOCUS.includes("Security") || CODE_QUALITY_FOCUS == "All" ? `### Security
97
- Follow existing patterns for input validation
98
- Apply the same sanitization techniques used in the codebase
99
- Use parameterized queries matching existing patterns
100
- Follow established authentication and authorization patterns
101
- Handle sensitive data according to existing patterns` : ""}
102
103
${CODE_QUALITY_FOCUS.includes("Accessibility") || CODE_QUALITY_FOCUS == "All" ? `### Accessibility
104
- Follow existing accessibility patterns in the codebase
105
- Match ARIA attribute usage with existing components
106
- Maintain keyboard navigation support consistent with existing code
107
- Follow established patterns for color and contrast
108
- Apply text alternative patterns consistent with the codebase` : ""}
109
110
${CODE_QUALITY_FOCUS.includes("Testability") || CODE_QUALITY_FOCUS == "All" ? `### Testability
111
- Follow established patterns for testable code
112
- Match dependency injection approaches used in the codebase
113
- Apply the same patterns for managing dependencies
114
- Follow established mocking and test double patterns
115
- Match the testing style used in existing tests` : ""}
116
117
## Documentation Requirements
118
119
${DOCUMENTATION_LEVEL == "Minimal" ?
120
`- Match the level and style of comments found in existing code
121
- Document according to patterns observed in the codebase
122
- Follow existing patterns for documenting non-obvious behavior
123
- Use the same format for parameter descriptions as existing code` : ""}
124
125
${DOCUMENTATION_LEVEL == "Standard" ?
126
`- Follow the exact documentation format found in the codebase
127
- Match the XML/JSDoc style and completeness of existing comments
128
- Document parameters, returns, and exceptions in the same style
129
- Follow existing patterns for usage examples
130
- Match class-level documentation style and content` : ""}
131
132
${DOCUMENTATION_LEVEL == "Comprehensive" ?
133
`- Follow the most detailed documentation patterns found in the codebase
134
- Match the style and completeness of the best-documented code
135
- Document exactly as the most thoroughly documented files do
136
- Follow existing patterns for linking documentation
137
- Match the level of detail in explanations of design decisions` : ""}
138
139
## Testing Approach
140
141
${TESTING_REQUIREMENTS.includes("Unit") || TESTING_REQUIREMENTS == "All" ?
142
`### Unit Testing
143
- Match the exact structure and style of existing unit tests
144
- Follow the same naming conventions for test classes and methods
145
- Use the same assertion patterns found in existing tests
146
- Apply the same mocking approach used in the codebase
147
- Follow existing patterns for test isolation` : ""}
148
149
${TESTING_REQUIREMENTS.includes("Integration") || TESTING_REQUIREMENTS == "All" ?
150
`### Integration Testing
151
- Follow the same integration test patterns found in the codebase
152
- Match existing patterns for test data setup and teardown
153
- Use the same approach for testing component interactions
154
- Follow existing patterns for verifying system behavior` : ""}
155
156
${TESTING_REQUIREMENTS.includes("E2E") || TESTING_REQUIREMENTS == "All" ?
157
`### End-to-End Testing
158
- Match the existing E2E test structure and patterns
159
- Follow established patterns for UI testing
160
- Apply the same approach for verifying user journeys` : ""}
161
162
${TESTING_REQUIREMENTS.includes("TDD") || TESTING_REQUIREMENTS == "All" ?
163
`### Test-Driven Development
164
- Follow TDD patterns evident in the codebase
165
- Match the progression of test cases seen in existing code
166
- Apply the same refactoring patterns after tests pass` : ""}
167
168
${TESTING_REQUIREMENTS.includes("BDD") || TESTING_REQUIREMENTS == "All" ?
169
`### Behavior-Driven Development
170
- Match the existing Given-When-Then structure in tests
171
- Follow the same patterns for behavior descriptions
172
- Apply the same level of business focus in test cases` : ""}
173
174
## Technology-Specific Guidelines
175
176
${PROJECT_TYPE == ".NET" || PROJECT_TYPE == "Auto-detect" || PROJECT_TYPE == "Multiple" ? `### .NET Guidelines
177
- Detect and strictly adhere to the specific .NET version in use
178
- Use only C# language features compatible with the detected version
179
- Follow LINQ usage patterns exactly as they appear in the codebase
180
- Match async/await usage patterns from existing code
181
- Apply the same dependency injection approach used in the codebase
182
- Use the same collection types and patterns found in existing code` : ""}
183
184
${PROJECT_TYPE == "Java" || PROJECT_TYPE == "Auto-detect" || PROJECT_TYPE == "Multiple" ? `### Java Guidelines
185
- Detect and adhere to the specific Java version in use
186
- Follow the exact same design patterns found in the codebase
187
- Match exception handling patterns from existing code
188
- Use the same collection types and approaches found in the codebase
189
- Apply the dependency injection patterns evident in existing code` : ""}
190
191
${PROJECT_TYPE == "JavaScript" || PROJECT_TYPE == "TypeScript" || PROJECT_TYPE == "Auto-detect" || PROJECT_TYPE == "Multiple" ? `### JavaScript/TypeScript Guidelines
192
- Detect and adhere to the specific ECMAScript/TypeScript version in use
193
- Follow the same module import/export patterns found in the codebase
194
- Match TypeScript type definitions with existing patterns
195
- Use the same async patterns (promises, async/await) as existing code
196
- Follow error handling patterns from similar files` : ""}
197
198
${PROJECT_TYPE == "React" || PROJECT_TYPE == "Auto-detect" || PROJECT_TYPE == "Multiple" ? `### React Guidelines
199
- Detect and adhere to the specific React version in use
200
- Match component structure patterns from existing components
201
- Follow the same hooks and lifecycle patterns found in the codebase
202
- Apply the same state management approach used in existing components
203
- Match prop typing and validation patterns from existing code` : ""}
204
205
${PROJECT_TYPE == "Angular" || PROJECT_TYPE == "Auto-detect" || PROJECT_TYPE == "Multiple" ? `### Angular Guidelines
206
- Detect and adhere to the specific Angular version in use
207
- Follow the same component and module patterns found in the codebase
208
- Match decorator usage exactly as seen in existing code
209
- Apply the same RxJS patterns found in the codebase
210
- Follow existing patterns for component communication` : ""}
211
212
${PROJECT_TYPE == "Python" || PROJECT_TYPE == "Auto-detect" || PROJECT_TYPE == "Multiple" ? `### Python Guidelines
213
- Detect and adhere to the specific Python version in use
214
- Follow the same import organization found in existing modules
215
- Match type hinting approaches if used in the codebase
216
- Apply the same error handling patterns found in existing code
217
- Follow the same module organization patterns` : ""}
218
219
## Version Control Guidelines
220
221
${VERSIONING == "Semantic" ?
222
`- Follow Semantic Versioning patterns as applied in the codebase
223
- Match existing patterns for documenting breaking changes
224
- Follow the same approach for deprecation notices` : ""}
225
226
${VERSIONING == "CalVer" ?
227
`- Follow Calendar Versioning patterns as applied in the codebase
228
- Match existing patterns for documenting changes
229
- Follow the same approach for highlighting significant changes` : ""}
230
231
${VERSIONING == "Custom" ?
232
`- Match the exact versioning pattern observed in the codebase
233
- Follow the same changelog format used in existing documentation
234
- Apply the same tagging conventions used in the project` : ""}
235
236
## General Best Practices
237
238
- Follow naming conventions exactly as they appear in existing code
239
- Match code organization patterns from similar files
240
- Apply error handling consistent with existing patterns
241
- Follow the same approach to testing as seen in the codebase
242
- Match logging patterns from existing code
243
- Use the same approach to configuration as seen in the codebase
244
245
## Project-Specific Guidance
246
247
- Scan the codebase thoroughly before generating any code
248
- Respect existing architectural boundaries without exception
249
- Match the style and patterns of surrounding code
250
- When in doubt, prioritize consistency with existing code over external best practices
251
```
252
253
### 2. Codebase Analysis Instructions
254
255
To create the copilot-instructions.md file, first analyze the codebase to:
256
257
1. **Identify Exact Technology Versions**:
258
- ${PROJECT_TYPE == "Auto-detect" ? "Detect all programming languages, frameworks, and libraries by scanning file extensions and configuration files" : `Focus on ${PROJECT_TYPE} technologies`}
259
- Extract precise version information from project files, package.json, .csproj, etc.
260
- Document version constraints and compatibility requirements
261
262
2. **Understand Architecture**:
263
- Analyze folder structure and module organization
264
- Identify clear layer boundaries and component relationships
265
- Document communication patterns between components
266
267
3. **Document Code Patterns**:
268
- Catalog naming conventions for different code elements
269
- Note documentation styles and completeness
270
- Document error handling patterns
271
- Map testing approaches and coverage
272
273
4. **Note Quality Standards**:
274
- Identify performance optimization techniques actually used
275
- Document security practices implemented in the code
276
- Note accessibility features present (if applicable)
277
- Document code quality patterns evident in the codebase
278
279
### 3. Implementation Notes
280
281
The final copilot-instructions.md should:
282
- Be placed in the .github/copilot directory
283
- Reference only patterns and standards that exist in the codebase
284
- Include explicit version compatibility requirements
285
- Avoid prescribing any practices not evident in the code
286
- Provide concrete examples from the codebase
287
- Be comprehensive yet concise enough for Copilot to effectively use
288
289
Important: Only include guidance based on patterns actually observed in the codebase. Explicitly instruct Copilot to prioritize consistency with existing code over external best practices or newer language features.
290
"
291
292
## Expected Output
293
294
A comprehensive copilot-instructions.md file that will guide GitHub Copilot to produce code that is perfectly compatible with your existing technology versions and follows your established patterns and architecture.
295

© GitHub, Inc. · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 13,390 prompts

More by @OpenSourceBuffGuy

See all
Designer toy 3D caricature with original photo inset prompt image

Designer toy 3D caricature with original photo inset

Turns an uploaded photo into a premium designer-toy 3D caricature with an oversized head, plus the original photo as a corner inset for a before and after.

image-prompt, reference-image, face-reference, negative-prompt, 3d-render, caricature, action-figure, toys, portrait, before-and-after, studio-lighting, soft-lighting, photorealistic, square-format, mockup, structured-output, gpt-image, chatgpt, for-content-creators, for-artists, medium-shot

Suburban backyard where the sky falls prompt image

Suburban backyard where the sky falls

Generates a realistic handheld phone video of an ordinary backyard that is interrupted when the whole sky drops like a solid ceiling.

video-prompt, handheld, home-video, single-take, surreal, photorealistic, visual-effects, natural-light, hailuo, smartphone-photo, negative-prompt, candid, quick

Eight panel Nutella storyboard with pancake and jar scenes prompt image

Eight panel Nutella storyboard with pancake and jar scenes

Draws a single-page eight-panel storyboard for a premium chocolate-spread commercial, with scene cards, camera directions and macro food shots.

image-prompt, storyboard, food-photography, product-photography, advertising, multi-panel, macro, cinematic, studio-lighting, luxury, photorealistic, vertical-format, text-rendering, gpt-image, structured-output, timed-beats, cooking, infographic, bokeh, poster, video-ad, camera-movement

Reviews

Loading reviews…

Discussion

Loading comments…