code-exemplars-blueprint-generator

作者: github

与技术无关的提示生成器,用于识别和记录跨多种语言的高质量代码示例。支持七种编程语言(.NET、Java、JavaScript、TypeScript、React、Angular、Python),具备自动检测功能。可配置分析深度(基础、标准、全面)、分类方法(模式类型、架构层、文件类型)和文档格式。生成包含真实文件引用、描述和可选代码的exemplars.md文件。

npx skills add https://github.com/github/awesome-copilot --skill code-exemplars-blueprint-generator

Code Exemplars Blueprint Generator

Configuration Variables

${PROJECT_TYPE="Auto-detect|.NET|Java|JavaScript|TypeScript|React|Angular|Python|Other"} ${SCAN_DEPTH="Basic|Standard|Comprehensive"} ${INCLUDE_CODE_SNIPPETS=true|false} ${CATEGORIZATION="Pattern Type|Architecture Layer|File Type"} ${MAX_EXAMPLES_PER_CATEGORY=3} ${INCLUDE_COMMENTS=true|false}

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
    • Error handling
    • Authentication/authorization
    • Validation

5. Exemplar Documentation Format

For each identified exemplar, document:

  • File path (relative to repository root)
  • Brief description of what makes it exemplary
  • Pattern or component type it represents ${INCLUDE_COMMENTS ? "- Key implementation details and coding principles demonstrated" : ""} ${INCLUDE_CODE_SNIPPETS ? "- Small, representative code snippet (if applicable)" : ""}

${SCAN_DEPTH == "Comprehensive" ? `### 6. Additional Documentation

  • Consistency Patterns: Note consistent patterns observed across the codebase
  • Architecture Observations: Document architectural patterns evident in the code
  • Implementation Conventions: Identify naming and structural conventions
  • Anti-patterns to Avoid: Note any areas where the codebase deviates from best practices` : ""}

${SCAN_DEPTH == "Comprehensive" ? "7" : "6"}. Output Format

Create exemplars.md with:

  1. Introduction explaining the purpose of the document
  2. Table of contents with links to categories
  3. Organized sections based on ${CATEGORIZATION}
  4. Up to ${MAX_EXAMPLES_PER_CATEGORY} exemplars per category
  5. Conclusion with recommendations for maintaining code quality

The document should be actionable for developers needing guidance on implementing new features consistent with existing patterns.

Important: Only include actual files from the codebase. Verify all file paths exist. Do not include placeholder or hypothetical examples. "

Expected Output

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.

来自 github 的更多技能

console-rendering
github
在Go中使用基于结构体标签的控制台渲染系统的说明
official
acquire-codebase-knowledge
github
当用户明确要求映射、记录或熟悉现有代码库时使用此技能。触发词如“映射此代码库”、“记录…
official
acreadiness-assess
github
Run the AgentRC readiness assessment on the current repository and produce a static HTML dashboard at reports/index.html. Wraps `npx github:microsoft/agentrc…
official
acreadiness-generate-instructions
github
通过AgentRC指令命令生成定制化的AI代理指令文件。生成.github/copilot-instructions.md(默认,推荐用于VS Code中的Copilot…
official
acreadiness-policy
github
帮助用户选择、编写或应用AgentRC策略。策略通过禁用无关检查、覆盖影响/级别、设置…来定制就绪评分。
official
add-educational-comments
github
为代码文件添加教育性注释,将其转化为有效的学习资源。根据三个可配置的知识水平(初级、中级、高级)调整解释深度和语气。若未提供文件,自动请求文件,并附带编号列表以便快速选择。仅通过教育性注释将文件扩展最多125%(硬性限制:新增400行;超过1000行的文件限制为300行)。保留文件编码、缩进风格、语法正确性以及...
official
adobe-illustrator-scripting
github
使用ExtendScript(JavaScript/JSX)编写、调试和优化Adobe Illustrator自动化脚本。在创建或修改操作…的脚本时使用。
official
agent-governance
github
声明式策略、意图分类及审计追踪,用于控制AI代理工具访问与行为。可组合的治理策略定义允许/禁止的工具、内容过滤器、速率限制及审批要求——以配置而非代码形式存储。语义意图分类在执行工具前通过基于模式的信号检测危险提示(数据泄露、权限提升、提示注入)。工具级治理装饰器在函数层面强制执行策略...
official