Objective
Your objective is to integrate the decision documents from the project kickoff phase (product overview, tech stack, structure, standards) and produce a detailedProject Initialization Execution Plan, namely specs/5_初始化计划.md。
Guardrails - CRITICAL
Please strictly follow the general guardrail rules:specs/GUARDRAILS.md Current Phase: Planning & Management Phase
Background
We have completed the project's top-level design (Specs), and the goal now is to get the project "up and running." This is not just about creating a few folders; it also includes key steps such as environment configuration, dependency installation, and toolchain integration.
Input
specs/1_产品概述.md(understand project scale)specs/2_技术栈.md(determine dependencies and tools)specs/3_项目结构.md(determine directory tree)specs/4_开发规范.md(determine Linter/Formatter configuration)
Workflow
- Pre-check:
- Confirm whether the above core specs documents are complete.
- If missing, prompt the user to first complete the corresponding decision phase.
- Task Breakdown (Initialization Breakdown):
- Environment Preparation: Git initialization,
.gitignoreconfiguration, environment variable template. - Skeleton Setup: Based on
specs/3_项目结构.md, create directories one by one. - Dependency Management: Based on
specs/2_技术栈.md, initialize the package management file (package.json/go.mod), and list the core packages to be installed. - Standards Implementation: Based on
specs/4_开发规范.md, configure code style tools (ESLint, Prettier, Husky, etc.). - Infrastructure Code: A Hello World-level entry file to ensure the project can run successfully.
- Environment Preparation: Git initialization,
- Dependency Analysis:
- Ensure the task order is correct (for example: initialize package.json first, then install dependencies).
- Generate Document: Output a Markdown document that conforms to the template.
- Final Delivery: Save to
specs/5_初始化计划.md。
Output Template (5_Initialization_Plan.md)
# 项目初始化计划 (Project Initialization Plan)
## 0. 概览
* **目标**: 完成 [项目名称] 的脚手架搭建与基建配置。
* **预计耗时**: [X] 小时
## 1. 基础环境 (Environment)
- [ ] **Init-01**: Git 仓库初始化
* 执行: `git init`
* 配置: 创建 `.gitignore` (Node/Go/Python 通用配置)
* **提示词**: "初始化 git 仓库并创建适合 [语言] 的 .gitignore"
- [ ] **Init-02**: 依赖管理初始化
* 执行: `npm init -y` / `go mod init`
* 验证: `package.json` / `go.mod` 创建成功
## 2. 目录结构 (Directory Structure)
> 参考 `specs/3_项目结构.md`
- [ ] **Struct-01**: 创建根目录文件
* 创建: `README.md`, `.env.example`
- [ ] **Struct-02**: 创建源码目录
* 创建: `src/`, `src/modules/`, `src/shared/` 等
* **提示词**: "根据 specs/3_项目结构.md 创建项目目录结构"
- [ ] **Struct-03**: 创建文档目录
* 创建: `docs/`, `specs/`
## 3. 核心依赖安装 (Dependencies)
> 参考 `specs/2_技术栈.md`
- [ ] **Dep-01**: 生产环境依赖
* 安装: [列出核心库,如 react, express, gin]
* **提示词**: "安装核心依赖: [依赖列表]"
- [ ] **Dep-02**: 开发环境依赖
* 安装: [列出工具库,如 typescript, nodemon]
## 4. 规范配置 (Configuration)
> 参考 `specs/4_开发规范.md`
- [ ] **Conf-01**: 代码风格配置
* 配置: `.eslintrc.js`, `.prettierrc`
- [ ] **Conf-02**: 提交规范配置 (可选)
* 配置: Husky + Commitlint
## 5. 冒烟测试 (Smoke Test)
- [ ] **Test-01**: 编写 Hello World
* 创建入口文件 (index.js / main.go)
- [ ] **Test-02**: 启动验证
* 配置启动脚本 (scripts)
* 验证: 项目可成功启动并输出日志
---
**执行说明**: 请按顺序执行上述任务。每完成一项,请手动勾选。