folder-structure-blueprint-generator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Project Folder Structure Blueprint Generator

项目文件夹结构蓝图生成器

Configuration Variables

配置变量

${PROJECT_TYPE="Auto-detect|.NET|Java|React|Angular|Python|Node.js|Flutter|Other"}
<!-- Select primary technology -->
${INCLUDES_MICROSERVICES="Auto-detect|true|false"}
<!-- Is this a microservices architecture? -->
${INCLUDES_FRONTEND="Auto-detect|true|false"}
<!-- Does project include frontend components? -->
${IS_MONOREPO="Auto-detect|true|false"}
<!-- Is this a monorepo with multiple projects? -->
${VISUALIZATION_STYLE="ASCII|Markdown List|Table"}
<!-- How to visualize the structure -->
${DEPTH_LEVEL=1-5}
<!-- How many levels of folders to document in detail -->
${INCLUDE_FILE_COUNTS=true|false}
<!-- Include file count statistics -->
${INCLUDE_GENERATED_FOLDERS=true|false}
<!-- Include auto-generated folders -->
${INCLUDE_FILE_PATTERNS=true|false}
<!-- Document file naming/location patterns -->
${INCLUDE_TEMPLATES=true|false}
<!-- Include file/folder templates for new features -->
${PROJECT_TYPE="自动检测|.NET|Java|React|Angular|Python|Node.js|Flutter"}
<!-- 选择主要技术栈 -->
${INCLUDES_MICROSERVICES="自动检测|是|否"}
<!-- 该项目是否采用微服务架构? -->
${INCLUDES_FRONTEND="自动检测|是|否"}
<!-- 项目是否包含前端组件? -->
${IS_MONOREPO="自动检测|是|否"}
<!-- 这是包含多个项目的单体仓库吗? -->
${VISUALIZATION_STYLE="ASCII|Markdown列表|表格"}
<!-- 结构可视化方式 -->
${DEPTH_LEVEL=1-5}
<!-- 需要详细记录的文件夹层级数 -->
${INCLUDE_FILE_COUNTS=是|否}
<!-- 是否包含文件数量统计 -->
${INCLUDE_GENERATED_FOLDERS=是|否}
<!-- 是否包含自动生成的文件夹 -->
${INCLUDE_FILE_PATTERNS=是|否}
<!-- 是否记录文件命名/位置模式 -->
${INCLUDE_TEMPLATES=是|否}
<!-- 是否包含用于新功能的文件/文件夹模板 -->

Generated Prompt

生成的Prompt

"Analyze the project's folder structure and create a comprehensive 'Project_Folders_Structure_Blueprint.md' document that serves as a definitive guide for maintaining consistent code organization. Use the following approach:
"分析项目的文件夹结构,创建一份全面的《Project_Folders_Structure_Blueprint.md》文档,作为维护一致代码组织的权威指南。请遵循以下步骤:

Initial Auto-detection Phase

初始自动检测阶段

${PROJECT_TYPE == "Auto-detect" ? "Begin by scanning the folder structure for key files that identify the project type:
  • Look for solution/project files (.sln, .csproj, .fsproj, .vbproj) to identify .NET projects
  • Check for build files (pom.xml, build.gradle, settings.gradle) for Java projects
  • Identify package.json with dependencies for JavaScript/TypeScript projects
  • Look for specific framework files (angular.json, react-scripts entries, next.config.js)
  • Check for Python project identifiers (requirements.txt, setup.py, pyproject.toml)
  • Examine mobile app identifiers (pubspec.yaml, android/ios folders)
  • Note all technology signatures found and their versions" : "Focus analysis on ${PROJECT_TYPE} project structure"}
${IS_MONOREPO == "Auto-detect" ? "Determine if this is a monorepo by looking for:
  • Multiple distinct projects with their own configuration files
  • Workspace configuration files (lerna.json, nx.json, turborepo.json, etc.)
  • Cross-project references and shared dependency patterns
  • Root-level orchestration scripts and configuration" : ""}
${INCLUDES_MICROSERVICES == "Auto-detect" ? "Check for microservices architecture indicators:
  • Multiple service directories with similar/repeated structures
  • Service-specific Dockerfiles or deployment configurations
  • Inter-service communication patterns (APIs, message brokers)
  • Service registry or discovery configuration
  • API gateway configuration files
  • Shared libraries or utilities across services" : ""}
${INCLUDES_FRONTEND == "Auto-detect" ? "Identify frontend components by looking for:
  • Web asset directories (wwwroot, public, dist, static)
  • UI framework files (components, modules, pages)
  • Frontend build configuration (webpack, vite, rollup, etc.)
  • Style sheet organization (CSS, SCSS, styled-components)
  • Static asset organization (images, fonts, icons)" : ""}
${PROJECT_TYPE == "自动检测" ? "首先扫描文件夹结构,寻找能识别项目类型的关键文件:
  • 查找解决方案/项目文件(.sln、.csproj、.fsproj、.vbproj)以识别.NET项目
  • 检查构建文件(pom.xml、build.gradle、settings.gradle)以识别Java项目
  • 识别带有依赖项的package.json文件,以识别JavaScript/TypeScript项目
  • 查找特定框架文件(angular.json、react-scripts配置、next.config.js)
  • 检查Python项目标识文件(requirements.txt、setup.py、pyproject.toml)
  • 检查移动应用标识文件(pubspec.yaml、android/ios文件夹)
  • 记录所有发现的技术栈及其版本" : "重点分析${PROJECT_TYPE}项目结构"}
${IS_MONOREPO == "自动检测" ? "通过以下特征判断是否为单体仓库:
  • 多个包含独立配置文件的不同项目
  • 工作区配置文件(lerna.json、nx.json、turborepo.json等)
  • 跨项目引用和共享依赖模式
  • 根目录级别的编排脚本和配置" : ""}
${INCLUDES_MICROSERVICES == "自动检测" ? "检查微服务架构的指标:
  • 多个结构相似/重复的服务目录
  • 服务专属的Dockerfile或部署配置
  • 服务间通信模式(API、消息队列)
  • 服务注册或发现配置
  • API网关配置文件
  • 跨服务共享的库或工具类" : ""}
${INCLUDES_FRONTEND == "自动检测" ? "通过以下特征识别前端组件:
  • Web资源目录(wwwroot、public、dist、static)
  • UI框架文件(components、modules、pages)
  • 前端构建配置(webpack、vite、rollup等)
  • 样式表组织(CSS、SCSS、styled-components)
  • 静态资源组织(图片、字体、图标)" : ""}

1. Structural Overview

1. 结构概述

Provide a high-level overview of the ${PROJECT_TYPE == "Auto-detect" ? "detected project type(s)" : PROJECT_TYPE} project's organization principles and folder structure:
  • Document the overall architectural approach reflected in the folder structure
  • Identify the main organizational principles (by feature, by layer, by domain, etc.)
  • Note any structural patterns that repeat throughout the codebase
  • Document the rationale behind the structure where it can be inferred
${IS_MONOREPO == "Auto-detect" ? "If detected as a monorepo, explain how the monorepo is organized and the relationship between projects." : IS_MONOREPO ? "Explain how the monorepo is organized and the relationship between projects." : ""}
${INCLUDES_MICROSERVICES == "Auto-detect" ? "If microservices are detected, describe how they are structured and organized." : INCLUDES_MICROSERVICES ? "Describe how the microservices are structured and organized." : ""}
提供${PROJECT_TYPE == "自动检测" ? "已检测到的项目类型" : PROJECT_TYPE}项目的组织原则和文件夹结构的高层概述:
  • 记录文件夹结构所反映的整体架构方法
  • 识别主要的组织原则(按功能、按层级、按领域等)
  • 记录代码库中重复出现的结构模式
  • 记录可推断的结构设计依据
${IS_MONOREPO == "自动检测" ? "如果检测为单体仓库,请说明单体仓库的组织方式以及项目间的关系。" : IS_MONOREPO ? "说明单体仓库的组织方式以及项目间的关系。" : ""}
${INCLUDES_MICROSERVICES == "自动检测" ? "如果检测到微服务,请描述其结构和组织方式。" : INCLUDES_MICROSERVICES ? "描述微服务的结构和组织方式。" : ""}

2. Directory Visualization

2. 目录可视化

${VISUALIZATION_STYLE == "ASCII" ? "Create an ASCII tree representation of the folder hierarchy to depth level ${DEPTH_LEVEL}." : ""}
${VISUALIZATION_STYLE == "Markdown List" ? "Use nested markdown lists to represent the folder hierarchy to depth level ${DEPTH_LEVEL}." : ""}
${VISUALIZATION_STYLE == "Table" ? "Create a table with columns for Path, Purpose, Content Types, and Conventions." : ""}
${INCLUDE_GENERATED_FOLDERS ? "Include all folders including generated ones." : "Exclude auto-generated folders like bin/, obj/, node_modules/, etc."}
${VISUALIZATION_STYLE == "ASCII" ? "创建文件夹层级的ASCII树状图,层级深度为${DEPTH_LEVEL}。" : ""}
${VISUALIZATION_STYLE == "Markdown列表" ? "使用嵌套的Markdown列表表示文件夹层级,层级深度为${DEPTH_LEVEL}。" : ""}
${VISUALIZATION_STYLE == "表格" ? "创建包含路径、用途、内容类型和规范的表格。" : ""}
${INCLUDE_GENERATED_FOLDERS ? "包含所有文件夹,包括自动生成的文件夹。" : "排除自动生成的文件夹,如bin/、obj/、node_modules/等。"}

3. Key Directory Analysis

3. 关键目录分析

Document each significant directory's purpose, contents, and patterns:
${PROJECT_TYPE == "Auto-detect" ? "For each detected technology, analyze directory structures based on observed usage patterns:" : ""}
${(PROJECT_TYPE == ".NET" || PROJECT_TYPE == "Auto-detect") ? "#### .NET Project Structure (if detected)
  • Solution Organization:
    • How projects are grouped and related
    • Solution folder organization patterns
    • Multi-targeting project patterns
  • Project Organization:
    • Internal folder structure patterns
    • Source code organization approach
    • Resource organization
    • Project dependencies and references
  • Domain/Feature Organization:
    • How business domains or features are separated
    • Domain boundary enforcement patterns
  • Layer Organization:
    • Separation of concerns (Controllers, Services, Repositories, etc.)
    • Layer interaction and dependency patterns
  • Configuration Management:
    • Configuration file locations and purposes
    • Environment-specific configurations
    • Secret management approach
  • Test Project Organization:
    • Test project structure and naming
    • Test categories and organization
    • Test data and mock locations" : ""}
${(PROJECT_TYPE == "React" || PROJECT_TYPE == "Angular" || PROJECT_TYPE == "Auto-detect") ? "#### UI Project Structure (if detected)
  • Component Organization:
    • Component folder structure patterns
    • Grouping strategies (by feature, type, etc.)
    • Shared vs. feature-specific components
  • State Management:
    • State-related file organization
    • Store structure for global state
    • Local state management patterns
  • Routing Organization:
    • Route definition locations
    • Page/view component organization
    • Route parameter handling
  • API Integration:
    • API client organization
    • Service layer structure
    • Data fetching patterns
  • Asset Management:
    • Static resource organization
    • Image/media file structure
    • Font and icon organization
  • Style Organization:
    • CSS/SCSS file structure
    • Theme organization
    • Style module patterns" : ""}
记录每个重要目录的用途、内容和模式:
${PROJECT_TYPE == "自动检测" ? "对于每种检测到的技术栈,根据观察到的使用模式分析目录结构:" : ""}
${(PROJECT_TYPE == ".NET" || PROJECT_TYPE == "自动检测") ? "#### .NET项目结构(如果检测到)
  • 解决方案组织
    • 项目的分组和关联方式
    • 解决方案文件夹的组织模式
    • 多目标项目模式
  • 项目组织:
    • 内部文件夹结构模式
    • 源代码组织方式
    • 资源组织
    • 项目依赖和引用
  • 领域/功能组织:
    • 业务领域或功能的拆分方式
    • 领域边界的实施模式
  • 层级组织:
    • 关注点分离(Controllers、Services、Repositories等)
    • 层级交互和依赖模式
  • 配置管理:
    • 配置文件的位置和用途
    • 环境特定的配置
    • 密钥管理方式
  • 测试项目组织:
    • 测试项目的结构和命名
    • 测试类别和组织方式
    • 测试数据和模拟对象的位置" : ""}
${(PROJECT_TYPE == "React" || PROJECT_TYPE == "Angular" || PROJECT_TYPE == "自动检测") ? "#### UI项目结构(如果检测到)
  • 组件组织:
    • 组件文件夹结构模式
    • 分组策略(按功能、按类型等)
    • 共享组件与功能专属组件的区分
  • 状态管理:
    • 状态相关文件的组织
    • 全局状态的Store结构
    • 局部状态管理模式
  • 路由组织:
    • 路由定义的位置
    • 页面/视图组件的组织
    • 路由参数处理方式
  • API集成:
    • API客户端的组织
    • 服务层结构
    • 数据获取模式
  • 资源管理:
    • 静态资源的组织
    • 图片/媒体文件结构
    • 字体和图标组织
  • 样式组织:
    • CSS/SCSS文件结构
    • 主题组织
    • 样式模块模式" : ""}

4. File Placement Patterns

4. 文件放置模式

${INCLUDE_FILE_PATTERNS ? "Document the patterns that determine where different types of files should be placed:
  • Configuration Files:
    • Locations for different types of configuration
    • Environment-specific configuration patterns
  • Model/Entity Definitions:
    • Where domain models are defined
    • Data transfer object (DTO) locations
    • Schema definition locations
  • Business Logic:
    • Service implementation locations
    • Business rule organization
    • Utility and helper function placement
  • Interface Definitions:
    • Where interfaces and abstractions are defined
    • How interfaces are grouped and organized
  • Test Files:
    • Unit test location patterns
    • Integration test placement
    • Test utility and mock locations
  • Documentation Files:
    • API documentation placement
    • Internal documentation organization
    • README file distribution" : "Document where key file types are located in the project."}
${INCLUDE_FILE_PATTERNS ? "记录不同类型文件的放置模式:
  • 配置文件:
    • 不同类型配置文件的位置
    • 环境特定的配置模式
  • 模型/实体定义:
    • 领域模型的定义位置
    • 数据传输对象(DTO)的位置
    • Schema定义位置
  • 业务逻辑:
    • 服务实现的位置
    • 业务规则的组织
    • 工具类和辅助函数的放置
  • 接口定义:
    • 接口和抽象的定义位置
    • 接口的分组和组织方式
  • 测试文件:
    • 单元测试的位置模式
    • 集成测试的放置
    • 测试工具和模拟对象的位置
  • 文档文件:
    • API文档的放置
    • 内部文档的组织
    • README文件的分布" : "记录关键文件类型在项目中的位置。"}

5. Naming and Organization Conventions

5. 命名与组织规范

Document the naming and organizational conventions observed across the project:
  • File Naming Patterns:
    • Case conventions (PascalCase, camelCase, kebab-case)
    • Prefix and suffix patterns
    • Type indicators in filenames
  • Folder Naming Patterns:
    • Naming conventions for different folder types
    • Hierarchical naming patterns
    • Grouping and categorization conventions
  • Namespace/Module Patterns:
    • How namespaces/modules map to folder structure
    • Import/using statement organization
    • Internal vs. public API separation
  • Organizational Patterns:
    • Code co-location strategies
    • Feature encapsulation approaches
    • Cross-cutting concern organization
记录项目中遵循的命名和组织规范:
  • 文件命名模式:
    • 大小写规范(PascalCase、camelCase、kebab-case)
    • 前缀和后缀模式
    • 文件名中的类型标识
  • 文件夹命名模式:
    • 不同类型文件夹的命名规范
    • 层级命名模式
    • 分组和分类规范
  • 命名空间/模块模式:
    • 命名空间/模块与文件夹结构的映射方式
    • 导入/引用语句的组织
    • 内部API与公共API的分离
  • 组织模式:
    • 代码共存策略
    • 功能封装方式
    • 横切关注点的组织

6. Navigation and Development Workflow

6. 导航与开发流程

Provide guidance for navigating and working with the codebase structure:
  • Entry Points:
    • Main application entry points
    • Key configuration starting points
    • Initial files for understanding the project
  • Common Development Tasks:
    • Where to add new features
    • How to extend existing functionality
    • Where to place new tests
    • Configuration modification locations
  • Dependency Patterns:
    • How dependencies flow between folders
    • Import/reference patterns
    • Dependency injection registration locations
${INCLUDE_FILE_COUNTS ? "- Content Statistics:
  • Files per directory analysis
  • Code distribution metrics
  • Complexity concentration areas" : ""}
提供代码库结构的导航和开发工作流指导:
  • 入口点:
    • 主应用入口点
    • 关键配置的起始点
    • 用于理解项目的初始文件
  • 常见开发任务:
    • 新增功能的位置
    • 扩展现有功能的方式
    • 新增测试的放置位置
    • 配置修改的位置
  • 依赖模式:
    • 文件夹间的依赖流向
    • 导入/引用模式
    • 依赖注入的注册位置
${INCLUDE_FILE_COUNTS ? "- 内容统计:
  • 按目录统计文件数量
  • 代码分布指标
  • 复杂度集中区域" : ""}

7. Build and Output Organization

7. 构建与输出组织

Document the build process and output organization:
  • Build Configuration:
    • Build script locations and purposes
    • Build pipeline organization
    • Build task definitions
  • Output Structure:
    • Compiled/built output locations
    • Output organization patterns
    • Distribution package structure
  • Environment-Specific Builds:
    • Development vs. production differences
    • Environment configuration strategies
    • Build variant organization
记录构建流程和输出组织:
  • 构建配置:
    • 构建脚本的位置和用途
    • 构建流水线的组织
    • 构建任务的定义
  • 输出结构:
    • 编译/构建输出的位置
    • 输出组织模式
    • 分发包结构
  • 环境特定构建:
    • 开发环境与生产环境的差异
    • 环境配置策略
    • 构建变体的组织

8. Technology-Specific Organization

8. 技术栈专属组织

${(PROJECT_TYPE == ".NET" || PROJECT_TYPE == "Auto-detect") ? "#### .NET-Specific Structure Patterns (if detected)
  • Project File Organization:
    • Project file structure and patterns
    • Target framework configuration
    • Property group organization
    • Item group patterns
  • Assembly Organization:
    • Assembly naming patterns
    • Multi-assembly architecture
    • Assembly reference patterns
  • Resource Organization:
    • Embedded resource patterns
    • Localization file structure
    • Static web asset organization
  • Package Management:
    • NuGet configuration locations
    • Package reference organization
    • Package version management" : ""}
${(PROJECT_TYPE == "Java" || PROJECT_TYPE == "Auto-detect") ? "#### Java-Specific Structure Patterns (if detected)
  • Package Hierarchy:
    • Package naming and nesting conventions
    • Domain vs. technical packages
    • Visibility and access patterns
  • Build Tool Organization:
    • Maven/Gradle structure patterns
    • Module organization
    • Plugin configuration patterns
  • Resource Organization:
    • Resource folder structures
    • Environment-specific resources
    • Properties file organization" : ""}
${(PROJECT_TYPE == "Node.js" || PROJECT_TYPE == "Auto-detect") ? "#### Node.js-Specific Structure Patterns (if detected)
  • Module Organization:
    • CommonJS vs. ESM organization
    • Internal module patterns
    • Third-party dependency management
  • Script Organization:
    • npm/yarn script definition patterns
    • Utility script locations
    • Development tool scripts
  • Configuration Management:
    • Configuration file locations
    • Environment variable management
    • Secret management approaches" : ""}
${(PROJECT_TYPE == ".NET" || PROJECT_TYPE == "自动检测") ? "#### .NET专属结构模式(如果检测到)
  • 项目文件组织:
    • 项目文件的结构和模式
    • 目标框架配置
    • 属性组组织
    • 项组模式
  • 程序集组织:
    • 程序集命名模式
    • 多程序集架构
    • 程序集引用模式
  • 资源组织:
    • 嵌入式资源模式
    • 本地化文件结构
    • 静态Web资源组织
  • 包管理:
    • NuGet配置的位置
    • 包引用的组织
    • 包版本管理" : ""}
${(PROJECT_TYPE == "Java" || PROJECT_TYPE == "自动检测") ? "#### Java专属结构模式(如果检测到)
  • 包层级:
    • 包命名和嵌套规范
    • 领域包与技术包的区分
    • 可见性和访问模式
  • 构建工具组织:
    • Maven/Gradle结构模式
    • 模块组织
    • 插件配置模式
  • 资源组织:
    • 资源文件夹结构
    • 环境特定资源
    • 属性文件组织" : ""}
${(PROJECT_TYPE == "Node.js" || PROJECT_TYPE == "自动检测") ? "#### Node.js专属结构模式(如果检测到)
  • 模块组织:
    • CommonJS与ESM的组织方式
    • 内部模块模式
    • 第三方依赖管理
  • 脚本组织:
    • npm/yarn脚本定义模式
    • 工具脚本的位置
    • 开发工具脚本
  • 配置管理:
    • 配置文件的位置
    • 环境变量管理
    • 密钥管理方式" : ""}

9. Extension and Evolution

9. 扩展与演进

Document how the project structure is designed to be extended:
  • Extension Points:
    • How to add new modules/features while maintaining conventions
    • Plugin/extension folder patterns
    • Customization directory structures
  • Scalability Patterns:
    • How the structure scales for larger features
    • Approach for breaking down large modules
    • Code splitting strategies
  • Refactoring Patterns:
    • Common refactoring approaches observed
    • How structural changes are managed
    • Incremental reorganization patterns
${INCLUDE_TEMPLATES ? "### 10. Structure Templates
Provide templates for creating new components that follow project conventions:
  • New Feature Template:
    • Folder structure for adding a complete feature
    • Required file types and their locations
    • Naming patterns to follow
  • New Component Template:
    • Directory structure for a typical component
    • Essential files to include
    • Integration points with existing structure
  • New Service Template:
    • Structure for adding a new service
    • Interface and implementation placement
    • Configuration and registration patterns
  • New Test Structure:
    • Folder structure for test projects/files
    • Test file organization templates
    • Test resource organization" : ""}
记录项目结构的扩展设计:
  • 扩展点:
    • 在保持规范的前提下新增模块/功能的方式
    • 插件/扩展文件夹模式
    • 自定义目录结构
  • 可扩展性模式:
    • 结构如何适应更大的功能
    • 拆分大型模块的方法
    • 代码分割策略
  • 重构模式:
    • 常见的重构方式
    • 结构变更的管理方式
    • 增量重组模式
${INCLUDE_TEMPLATES ? "### 10. 结构模板
提供遵循项目规范的新组件创建模板:
  • 新功能模板:
    • 新增完整功能的文件夹结构
    • 所需的文件类型及其位置
    • 需遵循的命名模式
  • 新组件模板:
    • 典型组件的目录结构
    • 必备文件
    • 与现有结构的集成点
  • 新服务模板:
    • 新增服务的结构
    • 接口和实现的放置位置
    • 配置和注册模式
  • 新测试结构:
    • 测试项目/文件的文件夹结构
    • 测试文件组织模板
    • 测试资源组织" : ""}

${INCLUDE_TEMPLATES ? "11" : "10"}. Structure Enforcement

${INCLUDE_TEMPLATES ? "11" : "10"}. 结构实施保障

Document how the project structure is maintained and enforced:
  • Structure Validation:
    • Tools/scripts that enforce structure
    • Build checks for structural compliance
    • Linting rules related to structure
  • Documentation Practices:
    • How structural changes are documented
    • Where architectural decisions are recorded
    • Structure evolution history
Include a section at the end about maintaining this blueprint and when it was last updated. "
记录项目结构的维护和实施方式:
  • 结构验证:
    • 用于实施结构规范的工具/脚本
    • 构建过程中的结构合规性检查
    • 与结构相关的代码检查规则
  • 文档实践:
    • 结构变更的文档记录方式
    • 架构决策的记录位置
    • 结构演进历史
在文档末尾添加关于本蓝图的维护说明以及最后更新时间。"