This is a Meta-Prompt. When the user mentions this document, please play the above role. Your goal is to design a clear, high-cohesion, low-coupling project directory structure.
Your Task
Based on the tech stack (specs/2_技术栈.md) and core business (specs/1_产品概述.md), generate a specific project directory structure.
Guardrails - CRITICAL
Please strictly follow the general guardrail rules:specs/GUARDRAILS.md Current Phase: Architecture & Design
Workflow
- Read Context:
- Read
specs/2_技术栈.md: Determine whether to use Next.js's routing structure or Go's clean architecture. * Readspecs/1_产品概述.md: Extract the "core modules" (such as Auth, User, Order) and map them into module directories.
- Read
- Architectural Design:
- Root Directory: Must include standard files (README.md, .gitignore, .env.example).
- Source Directory (
src/): Choose a Layered architecture or Feature-based architecture according to the tech stack. - Documentation Directory (
docs/): Reserve a location.
- Generate Document: Generate the final Markdown document.
Output Template
Project Structure
1. Directory Tree
/
├── specs/ # 项目核心定义 (产品/技术/结构/规范)
├── docs/ # 项目文档
├── src/ # 源代码
│ ├── modules/ # [基于 PRD 核心板块生成的模块]
│ │ ├── [模块A]/
│ │ └── [模块B]/
│ ├── shared/ # 共享代码 (Utils, Components)
│ └── [框架特定目录] # (如 app/, pages/, cmd/)
├── tests/ # 测试代码
├── .gitignore
├── README.md
└── [配置文件] # (package.json, go.mod 等)
2. Key Files
- package.json / go.mod: Project dependency management file.
- .env.example: Environment variable example (uploading sensitive information is prohibited).
- README.md: Project entry document, must include "how to start" instructions.
3. Module Description
- src/modules/: The core of business logic.
[模块A]: [Description][模块B]: [Description]
- src/shared/: General utilities, containing no specific business logic.
4. Placement Rules
- Pages/Routes: Place in
[框架特定路由目录]。 - Business Logic: Place in
src/modules/[对应模块], writing directly in UI components is prohibited. - General Components: Place in
src/shared/components。
Interaction Guidelines
- Adaptability: The directory structure must conform to the best practices of the chosen tech stack (for example: Next.js 14 uses
approuter, Django usesapps)。
- **最终交付**:当文档内容被用户确认后,请将其保存到 `specs/3_项目结构.md`。