project-workflow-analysis-blueprint-generator

作者: github

通過分析專案架構、技術棧與工作流程模式,生成詳細的實作藍圖。自動偵測專案類型、進入點、持久化機制與架構模式(.NET、Java/Spring、React、微服務等),以量身打造文件。記錄從進入點、服務層、資料存取、錯誤處理到回應建構的完整端到端工作流程,並附上實際程式碼範例。可設定輸出詳細程度、工作流程數量等。

npx skills add https://github.com/github/awesome-copilot --skill project-workflow-analysis-blueprint-generator

Project Workflow Documentation Generator

Configuration Variables

${PROJECT_TYPE="Auto-detect|.NET|Java|Spring|Node.js|Python|React|Angular|Microservices|Other"}
<!-- Primary technology stack -->

${ENTRY_POINT="API|GraphQL|Frontend|CLI|Message Consumer|Scheduled Job|Custom"}
<!-- Starting point for the flow -->

${PERSISTENCE_TYPE="Auto-detect|SQL Database|NoSQL Database|File System|External API|Message Queue|Cache|None"}
<!-- Data storage type -->

${ARCHITECTURE_PATTERN="Auto-detect|Layered|Clean|CQRS|Microservices|MVC|MVVM|Serverless|Event-Driven|Other"}
<!-- Primary architecture pattern -->

${WORKFLOW_COUNT=1-5}
<!-- Number of workflows to document -->

${DETAIL_LEVEL="Standard|Implementation-Ready"}
<!-- Level of implementation detail to include -->

${INCLUDE_SEQUENCE_DIAGRAM=true|false}
<!-- Generate sequence diagram -->

${INCLUDE_TEST_PATTERNS=true|false}
<!-- Include testing approach -->

Generated Prompt

"Analyze the codebase and document ${WORKFLOW_COUNT} representative end-to-end workflows 
that can serve as implementation templates for similar features. Use the following approach:

Initial Detection Phase

${PROJECT_TYPE == "Auto-detect" ? 
  "Begin by examining the codebase structure to identify technologies:
   - Check for .NET solutions/projects, Spring configurations, Node.js/Express files, etc.
   - Identify the primary programming language(s) and frameworks in use
   - Determine the architectural patterns based on folder structure and key components" 
  : "Focus on ${PROJECT_TYPE} patterns and conventions"}
${ENTRY_POINT == "Auto-detect" ? 
  "Identify typical entry points by looking for:
   - API controllers or route definitions
   - GraphQL resolvers
   - UI components that initiate network requests
   - Message handlers or event subscribers
   - Scheduled job definitions" 
  : "Focus on ${ENTRY_POINT} entry points"}
${PERSISTENCE_TYPE == "Auto-detect" ? 
  "Determine persistence mechanisms by examining:
   - Database context/connection configurations
   - Repository implementations
   - ORM mappings
   - External API clients
   - File system interactions" 
  : "Focus on ${PERSISTENCE_TYPE} interactions"}

Workflow Documentation Instructions

For each of the ${WORKFLOW_COUNT} most representative workflow(s) in the system:

1. Workflow Overview

  • Provide a name and brief description of the workflow
  • Explain the business purpose it serves
  • Identify the triggering action or event
  • List all files/classes involved in the complete workflow

2. Entry Point Implementation

API Entry Points:

${ENTRY_POINT == "API" || ENTRY_POINT == "Auto-detect" ? 
  "- Document the API controller class and method that receives the request
   - Show the complete method signature including attributes/annotations
   - Include the full request DTO/model class definition
   - Document validation attributes and custom validators
   - Show authentication/authorization attributes and checks" : ""}

GraphQL Entry Points:

${ENTRY_POINT == "GraphQL" || ENTRY_POINT == "Auto-detect" ? 
  "- Document the GraphQL resolver class and method
   - Show the complete schema definition for the query/mutation
   - Include input type definitions
   - Show resolver method implementation with parameter handling" : ""}

Frontend Entry Points:

${ENTRY_POINT == "Frontend" || ENTRY_POINT == "Auto-detect" ? 
  "- Document the component that initiates the API call
   - Show the event handler that triggers the request
   - Include the API client service method
   - Show state management code related to the request" : ""}

Message Consumer Entry Points:

${ENTRY_POINT == "Message Consumer" || ENTRY_POINT == "Auto-detect" ? 
  "- Document the message handler class and method
   - Show message subscription configuration
   - Include the complete message model definition
   - Show deserialization and validation logic" : ""}

3. Service Layer Implementation

  • Document each service class involved with their dependencies
  • Show the complete method signatures with parameters and return types
  • Include actual method implementations with key business logic
  • Document interface definitions where applicable
  • Show dependency injection registration patterns

CQRS Patterns:

${ARCHITECTURE_PATTERN == "CQRS" || ARCHITECTURE_PATTERN == "Auto-detect" ? 
  "- Include complete command/query handler implementations" : ""}

Clean Architecture Patterns:

${ARCHITECTURE_PATTERN == "Clean" || ARCHITECTURE_PATTERN == "Auto-detect" ? 
  "- Show use case/interactor implementations" : ""}

4. Data Mapping Patterns

  • Document DTO to domain model mapping code
  • Show object mapper configurations or manual mapping methods
  • Include validation logic during mapping
  • Document any domain events created during mapping

5. Data Access Implementation

  • Document repository interfaces and their implementations
  • Show complete method signatures with parameters and return types
  • Include actual query implementations
  • Document entity/model class definitions with all properties
  • Show transaction handling patterns

SQL Database Patterns:

${PERSISTENCE_TYPE == "SQL Database" || PERSISTENCE_TYPE == "Auto-detect" ? 
  "- Include ORM configurations, annotations, or Fluent API usage
   - Show actual SQL queries or ORM statements" : ""}

NoSQL Database Patterns:

${PERSISTENCE_TYPE == "NoSQL Database" || PERSISTENCE_TYPE == "Auto-detect" ? 
  "- Show document structure definitions
   - Include document query/update operations" : ""}

6. Response Construction

  • Document response DTO/model class definitions
  • Show mapping from domain/entity models to response models
  • Include status code selection logic
  • Document error response structure and generation

7. Error Handling Patterns

  • Document exception types used in the workflow
  • Show try/catch patterns at each layer
  • Include global exception handler configurations
  • Document error logging implementations
  • Show retry policies or circuit breaker patterns
  • Include compensating actions for failure scenarios

8. Asynchronous Processing Patterns

  • Document background job scheduling code
  • Show event publication implementations
  • Include message queue sending patterns
  • Document callback or webhook implementations
  • Show how async operations are tracked and monitored

Testing Approach (Optional):

${INCLUDE_TEST_PATTERNS ? 
  "9. **Testing Approach**
     - Document unit test implementations for each layer
     - Show mocking patterns and test fixture setup
     - Include integration test implementations
     - Document test data generation approaches
     - Show API/controller test implementations" : ""}

Sequence Diagram (Optional):

${INCLUDE_SEQUENCE_DIAGRAM ? 
  "10. **Sequence Diagram**
      - Generate a detailed sequence diagram showing all components
      - Include method calls with parameter types
      - Show return values between components
      - Document conditional flows and error paths" : ""}

11. Naming Conventions

Document consistent patterns for:

  • Controller naming (e.g., EntityNameController)
  • Service naming (e.g., EntityNameService)
  • Repository naming (e.g., IEntityNameRepository)
  • DTO naming (e.g., EntityNameRequest, EntityNameResponse)
  • Method naming patterns for CRUD operations
  • Variable naming conventions
  • File organization patterns

12. Implementation Templates

Provide reusable code templates for:

  • Creating a new API endpoint following the pattern
  • Implementing a new service method
  • Adding a new repository method
  • Creating new domain model classes
  • Implementing proper error handling

Technology-Specific Implementation Patterns

.NET Implementation Patterns (if detected):

${PROJECT_TYPE == ".NET" || PROJECT_TYPE == "Auto-detect" ? 
  "- Complete controller class with attributes, filters, and dependency injection
   - Service registration in Startup.cs or Program.cs
   - Entity Framework DbContext configuration
   - Repository implementation with EF Core or Dapper
   - AutoMapper profile configurations
   - Middleware implementations for cross-cutting concerns
   - Extension method patterns
   - Options pattern implementation for configuration
   - Logging implementation with ILogger
   - Authentication/authorization filter or policy implementations" : ""}

Spring Implementation Patterns (if detected):

${PROJECT_TYPE == "Java" || PROJECT_TYPE == "Spring" || PROJECT_TYPE == "Auto-detect" ? 
  "- Complete controller class with annotations and dependency injection
   - Service implementation with transaction boundaries
   - Repository interface and implementation
   - JPA entity definitions with relationships
   - DTO class implementations
   - Bean configuration and component scanning
   - Exception handler implementations
   - Custom validator implementations" : ""}

React Implementation Patterns (if detected):

${PROJECT_TYPE == "React" || PROJECT_TYPE == "Auto-detect" ? 
  "- Component structure with props and state
   - Hook implementation patterns (useState, useEffect, custom hooks)
   - API service implementation
   - State management patterns (Context, Redux)
   - Form handling implementations
   - Route configuration" : ""}

Implementation Guidelines

Based on the documented workflows, provide specific guidance for implementing new features:

1. Step-by-Step Implementation Process

  • Where to start when adding a similar feature
  • Order of implementation (e.g., model → repository → service → controller)
  • How to integrate with existing cross-cutting concerns

2. Common Pitfalls to Avoid

  • Identify error-prone areas in the current implementation
  • Note performance considerations
  • List common bugs or issues encountered

3. Extension Mechanisms

  • Document how to plug into existing extension points
  • Show how to add new behavior without modifying existing code
  • Explain configuration-driven feature patterns

Conclusion: Conclude with a summary of the most important patterns that should be followed when implementing new features to maintain consistency with the codebase."

來自 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行新註解;超過1,000行的檔案上限為300行)。保留檔案編碼、縮排風格、語法正確性及……
official
adobe-illustrator-scripting
github
使用 ExtendScript (JavaScript/JSX) 編寫、除錯及最佳化 Adobe Illustrator 自動化腳本。適用於建立或修改操控…的腳本時。
official
agent-governance
github
宣告式政策、意圖分類與稽核軌跡,用於控制AI代理工具存取與行為。可組合的治理政策定義允許/封鎖的工具、內容過濾器、速率限制與核准要求——以配置而非程式碼形式儲存。語意意圖分類在工具執行前,透過基於模式的訊號偵測危險提示(資料外洩、權限提升、提示注入)。工具層級治理裝飾器在函式層級強制執行政策……
official