code-exemplars-blueprint-generator
它能做什么
这个生成器会为项目创建一份高质量代码示例指南。通过展示良好的编写范例,它有助于保持统一的编程规范。
适用场景
- ✓在开始新项目、需要确定规范时。
- ✓当代码质量需要提升时。
- ✓当你想帮助新开发者理解最佳实践时。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/code-exemplars-blueprint-generator/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“为我的 Python 项目生成一份代码示例指南,重点关注设计模式,并包含代码片段。”
每周 5 个新技能,1 分钟读完。
工作原理
你需要指定项目类型以及代码的分析方式。随后,工具会生成一个文件,其中的代码示例都遵循你定义的最佳实践。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Code Exemplars Blueprint Generator
Configuration Variables
${PROJECT_TYPE="Auto-detect|.NET|Java|JavaScript|TypeScript|React|Angular|Python|Other"} <!-- Primary technology --> ${SCAN_DEPTH="Basic|Standard|Comprehensive"} <!-- How deeply to analyze the codebase --> ${INCLUDE_CODE_SNIPPETS=true|false} <!-- Include actual code snippets in addition to file references --> ${CATEGORIZATION="Pattern Type|Architecture Layer|File Type"} <!-- How to organize exemplars --> ${MAX_EXAMPLES_PER_CATEGORY=3} <!-- Maximum number of examples per category --> ${INCLUDE_COMMENTS=true|false} <!-- Include explanatory comments for each exemplar -->
Generated Prompt
"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:
1. Codebase Analysis Phase
- ${PROJECT_TYPE == "Auto-detect" ? "Automatically detect primary programming languages and frameworks by scanning file extensions and configuration files" :
Focus on ${PROJECT_TYPE} code files} - Identify files with high-quality implementation, good documentation, and clear structure
- Look for commonly used patterns, architecture components, and well-structured implementations
- Prioritize files that demonstrate best practices for our technology stack
- Only reference actual files that exist in the codebase - no hypothetical examples
2. Exemplar Identification Criteria
- Well-structured, readable code with clear naming conventions
- Comprehensive comments and documentation
- Proper error handling and validation
- Adherence to design patterns and architectural principles
- Separation of concerns and single responsibility principle
- Efficient implementation without code smells
- Representative of our standard approaches
3. Core Pattern Categories
${PROJECT_TYPE == ".NET" || PROJECT_TYPE == "Auto-detect" ? `#### .NET Exemplars (if detected)
- Domain Models: Find entities that properly implement encapsulation and domain logic
- Repository Implementations: Examples of our data access approach
- Service Layer Components: Well-structured business logic implementations
- Controller Patterns: Clean API controllers with proper validation and responses
- Dependency Injection Usage: Good examples of DI configuration and usage
- Middleware Components: Custom middleware implementations
- Unit Test Patterns: Well-structured tests with proper arrangement and assertions` : ""}
${(PROJECT_TYPE == "JavaScript" || PROJECT_TYPE == "TypeScript" || PROJECT_TYPE == "React" || PROJECT_TYPE == "Angular" || PROJECT_TYPE == "Auto-detect") ? `#### Frontend Exemplars (if detected)
- Component Structure: Clean, well-structured components
- State Management: Good examples of state handling
- API Integration: Well-implemented service calls and data handling
- Form Handling: Validation and submission patterns
- Routing Implementation: Navigation and route configuration
- UI Components: Reusable, well-structured UI elements
- Unit Test Examples: Component and service tests` : ""}
${PROJECT_TYPE == "Java" || PROJECT_TYPE == "Auto-detect" ? `#### Java Exemplars (if detected)
- Entity Classes: Well-designed JPA entities or domain models
- Service Implementations: Clean service layer components
- Repository Patterns: Data access implementations
- Controller/Resource Classes: API endpoint implementations
- Configuration Classes: Application configuration
- Unit Tests: Well-structured JUnit tests` : ""}
${PROJECT_TYPE == "Python" || PROJECT_TYPE == "Auto-detect" ? `#### Python Exemplars (if detected)
- Class Definitions: Well-structured classes with proper documentation
- API Routes/Views: Clean API implementations
- Data Models: ORM model definitions
- Service Functions: Business logic implementations
- Utility Modules: Helper and utility functions
- Test Cases: Well-structured unit tests` : ""}
4. Architecture Layer Exemplars
Presentation Layer:
- User interface components
- Controllers/API endpoints
- View models/DTOs
Business Logic Layer:
- Service implementations
- Business logic components
- Workflow orchestration
Data Access Layer:
- Repository implementations
- Data models
- Query patterns
Cross-Cutting Concerns:
- Logging implementations
…
常见问题
什么是“代码示例(code exemplars)”?
它们是一些代码片段,可以作为范本,展示如何编写高质量的代码,并遵循项目中既定的规范。
“与技术无关(technology-agnostic)”是什么意思?
意思是这个工具不局限于某一种编程语言或框架,可以适用于多种编程语言和框架。
我可以选择示例中包含哪些内容吗?
可以。你可以配置是否包含代码片段、解释性注释,以及示例的组织方式(比如按模式类型、架构层次等分类)。
详情
作者的原始描述
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
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7109
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。