$npx -y skills add github/awesome-copilot --skill copilot-instructions-blueprint-generatorTechnology-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
| 1 | # Copilot Instructions Blueprint Generator |
| 2 | |
| 3 | ## Configuration Variables |
| 4 | ${PROJECT_TYPE="Auto-detect|.NET|Java|JavaScript|TypeScript|React|Angular|Python|Multiple|Other"} <!-- Primary technology --> |
| 5 | ${ARCHITECTURE_STYLE="Layered|Microservices|Monolithic|Domain-Driven|Event-Driven|Serverless|Mixed"} <!-- Architectural approach --> |
| 6 | ${CODE_QUALITY_FOCUS="Maintainability|Performance|Security|Accessibility|Testability|All"} <!-- Quality priorities --> |
| 7 | ${DOCUMENTATION_LEVEL="Minimal|Standard|Comprehensive"} <!-- Documentation requirements --> |
| 8 | ${TESTING_REQUIREMENTS="Unit|Integration|E2E|TDD|BDD|All"} <!-- Testing approach --> |
| 9 | ${VERSIONING="Semantic|CalVer|Custom"} <!-- Versioning approach --> |
| 10 | |
| 11 | ## Generated Prompt |
| 12 | |
| 13 | "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: |
| 14 | |
| 15 | ### 1. Core Instruction Structure |
| 16 | |
| 17 | ```markdown |
| 18 | # GitHub Copilot Instructions |
| 19 | |
| 20 | ## Priority Guidelines |
| 21 | |
| 22 | When generating code for this repository: |
| 23 | |
| 24 | 1. **Version Compatibility**: Always detect and respect the exact versions of languages, frameworks, and libraries used in this project |
| 25 | 2. **Context Files**: Prioritize patterns and standards defined in the .github/copilot directory |
| 26 | 3. **Codebase Patterns**: When context files don't provide specific guidance, scan the codebase for established patterns |
| 27 | 4. **Architectural Consistency**: Maintain our ${ARCHITECTURE_STYLE} architectural style and established boundaries |
| 28 | 5. **Code Quality**: Prioritize ${CODE_QUALITY_FOCUS == "All" ? "maintainability, performance, security, accessibility, and testability" : CODE_QUALITY_FOCUS} in all generated code |
| 29 | |
| 30 | ## Technology Version Detection |
| 31 | |
| 32 | Before generating code, scan the codebase to identify: |
| 33 | |
| 34 | 1. **Language Versions**: Detect the exact versions of programming languages in use |
| 35 | - Examine project files, configuration files, and package managers |
| 36 | - Look for language-specific version indicators (e.g., <LangVersion> in .NET projects) |
| 37 | - Never use language features beyond the detected version |
| 38 | |
| 39 | 2. **Framework Versions**: Identify the exact versions of all frameworks |
| 40 | - Check package.json, .csproj, pom.xml, requirements.txt, etc. |
| 41 | - Respect version constraints when generating code |
| 42 | - Never suggest features not available in the detected framework versions |
| 43 | |
| 44 | 3. **Library Versions**: Note the exact versions of key libraries and dependencies |
| 45 | - Generate code compatible with these specific versions |
| 46 | - Never use APIs or features not available in the detected versions |
| 47 | |
| 48 | ## Context Files |
| 49 | |
| 50 | Prioritize the following files in .github/copilot directory (if they exist): |
| 51 | |
| 52 | - **architecture.md**: System architecture guidelines |
| 53 | - **tech-stack.md**: Technology versions and framework details |
| 54 | - **coding-standards.md**: Code style and formatting standards |
| 55 | - **folder-structure.md**: Project organization guidelines |
| 56 | - **exemplars.md**: Exemplary code patterns to follow |
| 57 | |
| 58 | ## Codebase Scanning Instructions |
| 59 | |
| 60 | When context files don't provide specific guidance: |
| 61 | |
| 62 | 1. Identify similar files to the one being modified or created |
| 63 | 2. Analyze patterns for: |
| 64 | - Naming conventions |
| 65 | - Code organization |
| 66 | - Error handling |
| 67 | - Logging approaches |
| 68 | - Documentation style |
| 69 | - Testing patterns |
| 70 | |
| 71 | 3. Follow the most consistent patterns found in the codebase |
| 72 | 4. When conflicting patterns exist, prioritize patterns in newer files or files with higher test coverage |
| 73 | 5. Never introduce patterns not found in the existing codebase |
| 74 | |
| 75 | ## Code Quality Standards |
| 76 | |
| 77 | ${CODE_QUALITY_FOCUS.includes("Maintainability") || CODE_QUALITY_FOCUS == "All" ? `### Maintainability |
| 78 | - Write self-documenting code with clear naming |
| 79 | - Follow the naming and organization conventions evident in the codebase |
| 80 | - Follow established patterns for consistency |
| 81 | - Keep functions focused on single responsibilities |
| 82 | - Limit function complexity and length to match existing patterns` : ""} |
| 83 | |
| 84 | ${CODE_QUALITY_FOCUS.includes("Performance") || CODE_QUALITY_FOCUS == "All" ? `### Performance |
| 85 | - Follow existing patterns for memory and resource management |
| 86 | - Match existing patterns for handling computationally expensive operations |
| 87 | - Follow established patterns for asynchronous operations |
| 88 | - Apply caching consistently with existing patterns |
| 89 | - Optimize according to patterns evident in the codebase` : ""} |
| 90 | |
| 91 | ${CODE_QUALITY_FOCUS.includes("Security") || CODE_QUALITY_FOCUS == "All" ? `### Security |
| 92 | - Follow existing patterns for input validation |
| 93 | - Apply the same |