architecture-blueprint-generator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Comprehensive Project Architecture Blueprint Generator

全面的项目架构蓝图生成器

Configuration Variables

配置变量

${PROJECT_TYPE="Auto-detect|.NET|Java|React|Angular|Python|Node.js|Flutter|Other"} <!-- Primary technology --> ${ARCHITECTURE_PATTERN="Auto-detect|Clean Architecture|Microservices|Layered|MVVM|MVC|Hexagonal|Event-Driven|Serverless|Monolithic|Other"} <!-- Primary architectural pattern --> ${DIAGRAM_TYPE="C4|UML|Flow|Component|None"} <!-- Architecture diagram type --> ${DETAIL_LEVEL="High-level|Detailed|Comprehensive|Implementation-Ready"} <!-- Level of detail to include --> ${INCLUDES_CODE_EXAMPLES=true|false} <!-- Include sample code to illustrate patterns --> ${INCLUDES_IMPLEMENTATION_PATTERNS=true|false} <!-- Include detailed implementation patterns --> ${INCLUDES_DECISION_RECORDS=true|false} <!-- Include architectural decision records --> ${FOCUS_ON_EXTENSIBILITY=true|false} <!-- Emphasize extension points and patterns -->
${PROJECT_TYPE="Auto-detect|.NET|Java|React|Angular|Python|Node.js|Flutter|Other"} <!-- 主技术栈 --> ${ARCHITECTURE_PATTERN="Auto-detect|Clean Architecture|Microservices|Layered|MVVM|MVC|Hexagonal|Event-Driven|Serverless|Monolithic|Other"} <!-- 主架构模式 --> ${DIAGRAM_TYPE="C4|UML|Flow|Component|None"} <!-- 架构图类型 --> ${DETAIL_LEVEL="High-level|Detailed|Comprehensive|Implementation-Ready"} <!-- 包含的详细程度 --> ${INCLUDES_CODE_EXAMPLES=true|false} <!-- 是否包含示例代码以说明模式 --> ${INCLUDES_IMPLEMENTATION_PATTERNS=true|false} <!-- 是否包含详细的实现模式 --> ${INCLUDES_DECISION_RECORDS=true|false} <!-- 是否包含架构决策记录 --> ${FOCUS_ON_EXTENSIBILITY=true|false} <!-- 是否强调扩展点和模式 -->

Generated Prompt

生成的提示词

"Create a comprehensive 'Project_Architecture_Blueprint.md' document that thoroughly analyzes the architectural patterns in the codebase to serve as a definitive reference for maintaining architectural consistency. Use the following approach:
"创建一份全面的《Project_Architecture_Blueprint.md》文档,深入分析代码库中的架构模式,作为维护架构一致性的权威参考。请遵循以下方法:

1. Architecture Detection and Analysis

1. 架构检测与分析

  • ${PROJECT_TYPE == "Auto-detect" ? "Analyze the project structure to identify all technology stacks and frameworks in use by examining:
    • Project and configuration files
    • Package dependencies and import statements
    • Framework-specific patterns and conventions
    • Build and deployment configurations" : "Focus on ${PROJECT_TYPE} specific patterns and practices"}
  • ${ARCHITECTURE_PATTERN == "Auto-detect" ? "Determine the architectural pattern(s) by analyzing:
    • Folder organization and namespacing
    • Dependency flow and component boundaries
    • Interface segregation and abstraction patterns
    • Communication mechanisms between components" : "Document how the ${ARCHITECTURE_PATTERN} architecture is implemented"}
  • ${PROJECT_TYPE == "Auto-detect" ? "分析项目结构,通过检查以下内容识别所有正在使用的技术栈和框架:
    • 项目和配置文件
    • 包依赖和导入语句
    • 框架特定的模式和约定
    • 构建和部署配置" : "聚焦于${PROJECT_TYPE}的特定模式与实践"}
  • ${ARCHITECTURE_PATTERN == "Auto-detect" ? "通过分析以下内容确定架构模式:
    • 文件夹组织和命名空间
    • 依赖流向和组件边界
    • 接口隔离和抽象模式
    • 组件间的通信机制" : "记录${ARCHITECTURE_PATTERN}架构的实现方式"}

2. Architectural Overview

2. 架构概述

  • Provide a clear, concise explanation of the overall architectural approach
  • Document the guiding principles evident in the architectural choices
  • Identify architectural boundaries and how they're enforced
  • Note any hybrid architectural patterns or adaptations of standard patterns
  • 清晰简洁地说明整体架构方法
  • 记录架构选择背后的指导原则
  • 识别架构边界及其实施方式
  • 注意任何混合架构模式或对标准模式的适配

3. Architecture Visualization

3. 架构可视化

${DIAGRAM_TYPE != "None" ? `Create ${DIAGRAM_TYPE} diagrams at multiple levels of abstraction:
  • High-level architectural overview showing major subsystems
  • Component interaction diagrams showing relationships and dependencies
  • Data flow diagrams showing how information moves through the system
  • Ensure diagrams accurately reflect the actual implementation, not theoretical patterns` : "Describe the component relationships based on actual code dependencies, providing clear textual explanations of:
  • Subsystem organization and boundaries
  • Dependency directions and component interactions
  • Data flow and process sequences"}
${DIAGRAM_TYPE != "None" ? `创建不同抽象层级的${DIAGRAM_TYPE}图:
  • 展示主要子系统的高层架构概览
  • 展示组件关系和依赖的组件交互图
  • 展示信息在系统中流转的数据流图
  • 确保图表准确反映实际实现,而非理论模式` : "基于实际代码依赖描述组件关系,提供清晰的文字说明:
  • 子系统的组织和边界
  • 依赖方向和组件交互
  • 数据流和流程序列"}

4. Core Architectural Components

4. 核心架构组件

For each architectural component discovered in the codebase:
  • Purpose and Responsibility:
    • Primary function within the architecture
    • Business domains or technical concerns addressed
    • Boundaries and scope limitations
  • Internal Structure:
    • Organization of classes/modules within the component
    • Key abstractions and their implementations
    • Design patterns utilized
  • Interaction Patterns:
    • How the component communicates with others
    • Interfaces exposed and consumed
    • Dependency injection patterns
    • Event publishing/subscription mechanisms
  • Evolution Patterns:
    • How the component can be extended
    • Variation points and plugin mechanisms
    • Configuration and customization approaches
针对代码库中发现的每个架构组件:
  • 用途与职责:
    • 组件在架构中的主要功能
    • 所处理的业务领域或技术关注点
    • 边界和范围限制
  • 内部结构:
    • 组件内类/模块的组织方式
    • 关键抽象及其实现
    • 所采用的设计模式
  • 交互模式:
    • 组件与其他组件的通信方式
    • 暴露和使用的接口
    • 依赖注入模式
    • 事件发布/订阅机制
  • 演进模式:
    • 组件的扩展方式
    • 可变点和插件机制
    • 配置和自定义方法

5. Architectural Layers and Dependencies

5. 架构分层与依赖

  • Map the layer structure as implemented in the codebase
  • Document the dependency rules between layers
  • Identify abstraction mechanisms that enable layer separation
  • Note any circular dependencies or layer violations
  • Document dependency injection patterns used to maintain separation
  • 映射代码库中实现的分层结构
  • 记录层间的依赖规则
  • 识别实现层分离的抽象机制
  • 注意任何循环依赖或分层违规情况
  • 记录用于维护分离的依赖注入模式

6. Data Architecture

6. 数据架构

  • Document domain model structure and organization
  • Map entity relationships and aggregation patterns
  • Identify data access patterns (repositories, data mappers, etc.)
  • Document data transformation and mapping approaches
  • Note caching strategies and implementations
  • Document data validation patterns
  • 记录领域模型的结构和组织
  • 映射实体关系和聚合模式
  • 识别数据访问模式(仓库、数据映射器等)
  • 记录数据转换和映射方法
  • 注意缓存策略和实现
  • 记录数据验证模式

7. Cross-Cutting Concerns Implementation

7. 横切关注点实现

Document implementation patterns for cross-cutting concerns:
  • Authentication & Authorization:
    • Security model implementation
    • Permission enforcement patterns
    • Identity management approach
    • Security boundary patterns
  • Error Handling & Resilience:
    • Exception handling patterns
    • Retry and circuit breaker implementations
    • Fallback and graceful degradation strategies
    • Error reporting and monitoring approaches
  • Logging & Monitoring:
    • Instrumentation patterns
    • Observability implementation
    • Diagnostic information flow
    • Performance monitoring approach
  • Validation:
    • Input validation strategies
    • Business rule validation implementation
    • Validation responsibility distribution
    • Error reporting patterns
  • Configuration Management:
    • Configuration source patterns
    • Environment-specific configuration strategies
    • Secret management approach
    • Feature flag implementation
记录横切关注点的实现模式:
  • 认证与授权:
    • 安全模型实现
    • 权限实施模式
    • 身份管理方法
    • 安全边界模式
  • 错误处理与弹性:
    • 异常处理模式
    • 重试和断路器实现
    • 降级和优雅回退策略
    • 错误报告和监控方法
  • 日志与监控:
    • instrumentation模式
    • 可观测性实现
    • 诊断信息流
    • 性能监控方法
  • 验证:
    • 输入验证策略
    • 业务规则验证实现
    • 验证职责分配
    • 错误报告模式
  • 配置管理:
    • 配置源模式
    • 环境特定的配置策略
    • 密钥管理方法
    • 功能标志实现

8. Service Communication Patterns

8. 服务通信模式

  • Document service boundary definitions
  • Identify communication protocols and formats
  • Map synchronous vs. asynchronous communication patterns
  • Document API versioning strategies
  • Identify service discovery mechanisms
  • Note resilience patterns in service communication
  • 记录服务边界定义
  • 识别通信协议和格式
  • 映射同步与异步通信模式
  • 记录API版本控制策略
  • 识别服务发现机制
  • 注意服务通信中的弹性模式

9. Technology-Specific Architectural Patterns

9. 技术特定架构模式

${PROJECT_TYPE == "Auto-detect" ? "For each detected technology stack, document specific architectural patterns:" :
Document ${PROJECT_TYPE}-specific architectural patterns:
}
${(PROJECT_TYPE == ".NET" || PROJECT_TYPE == "Auto-detect") ? "#### .NET Architectural Patterns (if detected)
  • Host and application model implementation
  • Middleware pipeline organization
  • Framework service integration patterns
  • ORM and data access approaches
  • API implementation patterns (controllers, minimal APIs, etc.)
  • Dependency injection container configuration" : ""}
${(PROJECT_TYPE == "Java" || PROJECT_TYPE == "Auto-detect") ? "#### Java Architectural Patterns (if detected)
  • Application container and bootstrap process
  • Dependency injection framework usage (Spring, CDI, etc.)
  • AOP implementation patterns
  • Transaction boundary management
  • ORM configuration and usage patterns
  • Service implementation patterns" : ""}
${(PROJECT_TYPE == "React" || PROJECT_TYPE == "Auto-detect") ? "#### React Architectural Patterns (if detected)
  • Component composition and reuse strategies
  • State management architecture
  • Side effect handling patterns
  • Routing and navigation approach
  • Data fetching and caching patterns
  • Rendering optimization strategies" : ""}
${(PROJECT_TYPE == "Angular" || PROJECT_TYPE == "Auto-detect") ? "#### Angular Architectural Patterns (if detected)
  • Module organization strategy
  • Component hierarchy design
  • Service and dependency injection patterns
  • State management approach
  • Reactive programming patterns
  • Route guard implementation" : ""}
${(PROJECT_TYPE == "Python" || PROJECT_TYPE == "Auto-detect") ? "#### Python Architectural Patterns (if detected)
  • Module organization approach
  • Dependency management strategy
  • OOP vs. functional implementation patterns
  • Framework integration patterns
  • Asynchronous programming approach" : ""}
${PROJECT_TYPE == "Auto-detect" ? "针对每个检测到的技术栈,记录特定的架构模式:" :
记录${PROJECT_TYPE}特定的架构模式:
}
${(PROJECT_TYPE == ".NET" || PROJECT_TYPE == "Auto-detect") ? "#### .NET架构模式(若检测到)
  • 主机和应用模型实现
  • 中间件管道组织
  • 框架服务集成模式
  • ORM和数据访问方法
  • API实现模式(控制器、极简API等)
  • 依赖注入容器配置" : ""}
${(PROJECT_TYPE == "Java" || PROJECT_TYPE == "Auto-detect") ? "#### Java架构模式(若检测到)
  • 应用容器和启动流程
  • 依赖注入框架使用(Spring、CDI等)
  • AOP实现模式
  • 事务边界管理
  • ORM配置和使用模式
  • 服务实现模式" : ""}
${(PROJECT_TYPE == "React" || PROJECT_TYPE == "Auto-detect") ? "#### React架构模式(若检测到)
  • 组件组合与复用策略
  • 状态管理架构
  • 副作用处理模式
  • 路由与导航方法
  • 数据获取和缓存模式
  • 渲染优化策略" : ""}
${(PROJECT_TYPE == "Angular" || PROJECT_TYPE == "Auto-detect") ? "#### Angular架构模式(若检测到)
  • 模块组织策略
  • 组件层次设计
  • 服务和依赖注入模式
  • 状态管理方法
  • 响应式编程模式
  • 路由守卫实现" : ""}
${(PROJECT_TYPE == "Python" || PROJECT_TYPE == "Auto-detect") ? "#### Python架构模式(若检测到)
  • 模块组织方法
  • 依赖管理策略
  • 面向对象与函数式实现模式
  • 框架集成模式
  • 异步编程方法" : ""}

10. Implementation Patterns

10. 实现模式

${INCLUDES_IMPLEMENTATION_PATTERNS ? "Document concrete implementation patterns for key architectural components:
  • Interface Design Patterns:
    • Interface segregation approaches
    • Abstraction level decisions
    • Generic vs. specific interface patterns
    • Default implementation patterns
  • Service Implementation Patterns:
    • Service lifetime management
    • Service composition patterns
    • Operation implementation templates
    • Error handling within services
  • Repository Implementation Patterns:
    • Query pattern implementations
    • Transaction management
    • Concurrency handling
    • Bulk operation patterns
  • Controller/API Implementation Patterns:
    • Request handling patterns
    • Response formatting approaches
    • Parameter validation
    • API versioning implementation
  • Domain Model Implementation:
    • Entity implementation patterns
    • Value object patterns
    • Domain event implementation
    • Business rule enforcement" : "Mention that detailed implementation patterns vary across the codebase."}
${INCLUDES_IMPLEMENTATION_PATTERNS ? "记录关键架构组件的具体实现模式:
  • 接口设计模式:
    • 接口隔离方法
    • 抽象层级决策
    • 通用与特定接口模式
    • 默认实现模式
  • 服务实现模式:
    • 服务生命周期管理
    • 服务组合模式
    • 操作实现模板
    • 服务内的错误处理
  • 仓库实现模式:
    • 查询模式实现
    • 事务管理
    • 并发处理
    • 批量操作模式
  • 控制器/API实现模式:
    • 请求处理模式
    • 响应格式化方法
    • 参数验证
    • API版本控制实现
  • 领域模型实现:
    • 实体实现模式
    • 值对象模式
    • 领域事件实现
    • 业务规则实施" : "说明代码库中详细实现模式存在差异。"}

11. Testing Architecture

11. 测试架构

  • Document testing strategies aligned with the architecture
  • Identify test boundary patterns (unit, integration, system)
  • Map test doubles and mocking approaches
  • Document test data strategies
  • Note testing tools and frameworks integration
  • 记录与架构对齐的测试策略
  • 识别测试边界模式(单元测试、集成测试、系统测试)
  • 映射测试替身和模拟方法
  • 记录测试数据策略
  • 注意测试工具和框架的集成

12. Deployment Architecture

12. 部署架构

  • Document deployment topology derived from configuration
  • Identify environment-specific architectural adaptations
  • Map runtime dependency resolution patterns
  • Document configuration management across environments
  • Identify containerization and orchestration approaches
  • Note cloud service integration patterns
  • 记录从配置推导的部署拓扑
  • 识别针对特定环境的架构适配
  • 映射运行时依赖解析模式
  • 记录跨环境的配置管理
  • 识别容器化和编排方法
  • 注意云服务集成模式

13. Extension and Evolution Patterns

13. 扩展与演进模式

${FOCUS_ON_EXTENSIBILITY ? "Provide detailed guidance for extending the architecture:
  • Feature Addition Patterns:
    • How to add new features while preserving architectural integrity
    • Where to place new components by type
    • Dependency introduction guidelines
    • Configuration extension patterns
  • Modification Patterns:
    • How to safely modify existing components
    • Strategies for maintaining backward compatibility
    • Deprecation patterns
    • Migration approaches
  • Integration Patterns:
    • How to integrate new external systems
    • Adapter implementation patterns
    • Anti-corruption layer patterns
    • Service facade implementation" : "Document key extension points in the architecture."}
${INCLUDES_CODE_EXAMPLES ? "### 14. Architectural Pattern Examples Extract representative code examples that illustrate key architectural patterns:
  • Layer Separation Examples:
    • Interface definition and implementation separation
    • Cross-layer communication patterns
    • Dependency injection examples
  • Component Communication Examples:
    • Service invocation patterns
    • Event publication and handling
    • Message passing implementation
  • Extension Point Examples:
    • Plugin registration and discovery
    • Extension interface implementations
    • Configuration-driven extension patterns
Include enough context with each example to show the pattern clearly, but keep examples concise and focused on architectural concepts." : ""}
${INCLUDES_DECISION_RECORDS ? "### 15. Architectural Decision Records Document key architectural decisions evident in the codebase:
  • Architectural Style Decisions:
    • Why the current architectural pattern was chosen
    • Alternatives considered (based on code evolution)
    • Constraints that influenced the decision
  • Technology Selection Decisions:
    • Key technology choices and their architectural impact
    • Framework selection rationales
    • Custom vs. off-the-shelf component decisions
  • Implementation Approach Decisions:
    • Specific implementation patterns chosen
    • Standard pattern adaptations
    • Performance vs. maintainability tradeoffs
For each decision, note:
  • Context that made the decision necessary
  • Factors considered in making the decision
  • Resulting consequences (positive and negative)
  • Future flexibility or limitations introduced" : ""}
${FOCUS_ON_EXTENSIBILITY ? "提供扩展架构的详细指导:
  • 功能添加模式:
    • 如何在保持架构完整性的前提下添加新功能
    • 按类型放置新组件的位置
    • 依赖引入准则
    • 配置扩展模式
  • 修改模式:
    • 如何安全修改现有组件
    • 保持向后兼容性的策略
    • 弃用模式
    • 迁移方法
  • 集成模式:
    • 如何集成新的外部系统
    • 适配器实现模式
    • 防腐层模式
    • 服务门面实现" : "记录架构中的关键扩展点。"}
${INCLUDES_CODE_EXAMPLES ? "### 14. 架构模式示例 提取能说明关键架构模式的代表性代码示例:
  • 分层分离示例:
    • 接口定义与实现分离
    • 跨层通信模式
    • 依赖注入示例
  • 组件通信示例:
    • 服务调用模式
    • 事件发布与处理
    • 消息传递实现
  • 扩展点示例:
    • 插件注册与发现
    • 扩展接口实现
    • 配置驱动的扩展模式
每个示例需包含足够上下文以清晰展示模式,但保持示例简洁,聚焦于架构概念。" : ""}
${INCLUDES_DECISION_RECORDS ? "### 15. 架构决策记录 记录代码库中体现的关键架构决策:
  • 架构风格决策:
    • 为何选择当前架构模式
    • 考虑过的替代方案(基于代码演进)
    • 影响决策的约束条件
  • 技术选择决策:
    • 关键技术选择及其对架构的影响
    • 框架选择的理由
    • 自定义与现成组件的决策
  • 实现方法决策:
    • 所选的特定实现模式
    • 对标准模式的适配
    • 性能与可维护性的权衡
针对每个决策,记录:
  • 促使决策产生的背景
  • 决策时考虑的因素
  • 产生的后果(正面和负面)
  • 引入的未来灵活性或限制" : ""}

${INCLUDES_DECISION_RECORDS ? "16" : INCLUDES_CODE_EXAMPLES ? "15" : "14"}. Architecture Governance

${INCLUDES_DECISION_RECORDS ? "16" : INCLUDES_CODE_EXAMPLES ? "15" : "14"}. 架构治理

  • Document how architectural consistency is maintained
  • Identify automated checks for architectural compliance
  • Note architectural review processes evident in the codebase
  • Document architectural documentation practices
  • 记录如何维护架构一致性
  • 识别架构合规性的自动化检查
  • 注意代码库中体现的架构评审流程
  • 记录架构文档实践

${INCLUDES_DECISION_RECORDS ? "17" : INCLUDES_CODE_EXAMPLES ? "16" : "15"}. Blueprint for New Development

${INCLUDES_DECISION_RECORDS ? "17" : INCLUDES_CODE_EXAMPLES ? "16" : "15"}. 新开发蓝图

Create a clear architectural guide for implementing new features:
  • Development Workflow:
    • Starting points for different feature types
    • Component creation sequence
    • Integration steps with existing architecture
    • Testing approach by architectural layer
  • Implementation Templates:
    • Base class/interface templates for key architectural components
    • Standard file organization for new components
    • Dependency declaration patterns
    • Documentation requirements
  • Common Pitfalls:
    • Architecture violations to avoid
    • Common architectural mistakes
    • Performance considerations
    • Testing blind spots
Include information about when this blueprint was generated and recommendations for keeping it updated as the architecture evolves."
创建清晰的架构指南以指导新功能实现:
  • 开发工作流:
    • 不同类型功能的起始点
    • 组件创建顺序
    • 与现有架构的集成步骤
    • 按架构分层的测试方法
  • 实现模板:
    • 关键架构组件的基类/接口模板
    • 新组件的标准文件组织
    • 依赖声明模式
    • 文档要求
  • 常见陷阱:
    • 需避免的架构违规
    • 常见的架构错误
    • 性能考量
    • 测试盲区
记录此蓝图的生成时间,并提供随着架构演进保持其更新的建议。"